@ntlab/ntjs-assets 2.0.11 → 2.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/.github/workflows/publish.yml +2 -1
  2. package/assets/js/DataTables/Extensions/ColReorder/js/dataTables.colReorder.js +4 -55
  3. package/assets/js/DataTables/Extensions/ColReorder/js/dataTables.colReorder.min.js +4 -4
  4. package/assets/js/DataTables/Extensions/SearchBuilder/css/searchBuilder.bootstrap5.css +1 -1
  5. package/assets/js/DataTables/Extensions/SearchBuilder/css/searchBuilder.bootstrap5.min.css +1 -1
  6. package/assets/js/DataTables/Extensions/SearchBuilder/css/searchBuilder.dataTables.css +1 -1
  7. package/assets/js/DataTables/Extensions/SearchBuilder/css/searchBuilder.dataTables.min.css +1 -1
  8. package/assets/js/DataTables/Extensions/SearchBuilder/js/dataTables.searchBuilder.js +8 -8
  9. package/assets/js/DataTables/Extensions/SearchBuilder/js/dataTables.searchBuilder.min.js +3 -3
  10. package/assets/js/DataTables/Extensions/SearchBuilder/js/searchBuilder.bootstrap5.js +2 -2
  11. package/assets/js/DataTables/Extensions/SearchBuilder/js/searchBuilder.bootstrap5.min.js +1 -1
  12. package/assets/js/DataTables/Extensions/Select/js/dataTables.select.js +34 -10
  13. package/assets/js/DataTables/Extensions/Select/js/dataTables.select.min.js +2 -2
  14. package/assets/js/DataTables/Extensions/StateRestore/js/StateRestore.js +19 -3
  15. package/assets/js/DataTables/Extensions/StateRestore/js/StateRestoreCollection.js +4 -4
  16. package/assets/js/DataTables/Extensions/StateRestore/js/dataTables.stateRestore.js +29 -13
  17. package/assets/js/DataTables/Extensions/StateRestore/js/dataTables.stateRestore.min.js +2 -2
  18. package/assets/js/DataTables/Extensions/StateRestore/js/index.js +6 -6
  19. package/assets/js/cdn.json +4 -4
  20. package/assets/js/pdfjs/build/pdf.mjs +2314 -898
  21. package/assets/js/pdfjs/build/pdf.mjs.map +1 -1
  22. package/assets/js/pdfjs/build/pdf.sandbox.mjs +5 -7
  23. package/assets/js/pdfjs/build/pdf.sandbox.mjs.map +1 -1
  24. package/assets/js/pdfjs/build/pdf.worker.mjs +655 -435
  25. package/assets/js/pdfjs/build/pdf.worker.mjs.map +1 -1
  26. package/assets/js/pdfjs/web/debugger.css +1 -1
  27. package/assets/js/pdfjs/web/images/cursor-editorFreeHighlight.svg +6 -0
  28. package/assets/js/pdfjs/web/images/cursor-editorTextHighlight.svg +8 -0
  29. package/assets/js/pdfjs/web/images/toolbarButton-editorFreeText.svg +3 -1
  30. package/assets/js/pdfjs/web/images/toolbarButton-editorStamp.svg +1 -1
  31. package/assets/js/pdfjs/web/locale/ar/viewer.ftl +25 -0
  32. package/assets/js/pdfjs/web/locale/be/viewer.ftl +20 -2
  33. package/assets/js/pdfjs/web/locale/bg/viewer.ftl +137 -0
  34. package/assets/js/pdfjs/web/locale/br/viewer.ftl +22 -0
  35. package/assets/js/pdfjs/web/locale/cs/viewer.ftl +20 -2
  36. package/assets/js/pdfjs/web/locale/cy/viewer.ftl +22 -8
  37. package/assets/js/pdfjs/web/locale/da/viewer.ftl +28 -2
  38. package/assets/js/pdfjs/web/locale/de/viewer.ftl +21 -3
  39. package/assets/js/pdfjs/web/locale/dsb/viewer.ftl +20 -2
  40. package/assets/js/pdfjs/web/locale/el/viewer.ftl +20 -2
  41. package/assets/js/pdfjs/web/locale/en-CA/viewer.ftl +25 -0
  42. package/assets/js/pdfjs/web/locale/en-GB/viewer.ftl +20 -2
  43. package/assets/js/pdfjs/web/locale/en-US/viewer.ftl +15 -8
  44. package/assets/js/pdfjs/web/locale/eo/viewer.ftl +57 -8
  45. package/assets/js/pdfjs/web/locale/es-AR/viewer.ftl +20 -2
  46. package/assets/js/pdfjs/web/locale/es-CL/viewer.ftl +20 -2
  47. package/assets/js/pdfjs/web/locale/es-ES/viewer.ftl +20 -2
  48. package/assets/js/pdfjs/web/locale/eu/viewer.ftl +53 -0
  49. package/assets/js/pdfjs/web/locale/fi/viewer.ftl +20 -2
  50. package/assets/js/pdfjs/web/locale/fr/viewer.ftl +16 -2
  51. package/assets/js/pdfjs/web/locale/fur/viewer.ftl +41 -2
  52. package/assets/js/pdfjs/web/locale/fy-NL/viewer.ftl +20 -2
  53. package/assets/js/pdfjs/web/locale/gl/viewer.ftl +17 -0
  54. package/assets/js/pdfjs/web/locale/gn/viewer.ftl +7 -2
  55. package/assets/js/pdfjs/web/locale/he/viewer.ftl +20 -2
  56. package/assets/js/pdfjs/web/locale/hsb/viewer.ftl +20 -2
  57. package/assets/js/pdfjs/web/locale/hu/viewer.ftl +16 -2
  58. package/assets/js/pdfjs/web/locale/ia/viewer.ftl +7 -2
  59. package/assets/js/pdfjs/web/locale/is/viewer.ftl +20 -2
  60. package/assets/js/pdfjs/web/locale/it/viewer.ftl +20 -2
  61. package/assets/js/pdfjs/web/locale/ja/viewer.ftl +39 -4
  62. package/assets/js/pdfjs/web/locale/ka/viewer.ftl +45 -9
  63. package/assets/js/pdfjs/web/locale/kk/viewer.ftl +20 -2
  64. package/assets/js/pdfjs/web/locale/ko/viewer.ftl +22 -4
  65. package/assets/js/pdfjs/web/locale/nb-NO/viewer.ftl +7 -2
  66. package/assets/js/pdfjs/web/locale/nl/viewer.ftl +20 -2
  67. package/assets/js/pdfjs/web/locale/nn-NO/viewer.ftl +19 -2
  68. package/assets/js/pdfjs/web/locale/oc/viewer.ftl +36 -0
  69. package/assets/js/pdfjs/web/locale/pa-IN/viewer.ftl +28 -2
  70. package/assets/js/pdfjs/web/locale/pl/viewer.ftl +7 -2
  71. package/assets/js/pdfjs/web/locale/pt-BR/viewer.ftl +20 -2
  72. package/assets/js/pdfjs/web/locale/pt-PT/viewer.ftl +49 -0
  73. package/assets/js/pdfjs/web/locale/rm/viewer.ftl +16 -2
  74. package/assets/js/pdfjs/web/locale/ru/viewer.ftl +20 -2
  75. package/assets/js/pdfjs/web/locale/sk/viewer.ftl +23 -5
  76. package/assets/js/pdfjs/web/locale/skr/viewer.ftl +22 -0
  77. package/assets/js/pdfjs/web/locale/sl/viewer.ftl +7 -2
  78. package/assets/js/pdfjs/web/locale/sq/viewer.ftl +7 -2
  79. package/assets/js/pdfjs/web/locale/sv-SE/viewer.ftl +20 -2
  80. package/assets/js/pdfjs/web/locale/tg/viewer.ftl +7 -2
  81. package/assets/js/pdfjs/web/locale/th/viewer.ftl +49 -0
  82. package/assets/js/pdfjs/web/locale/tr/viewer.ftl +25 -7
  83. package/assets/js/pdfjs/web/locale/uk/viewer.ftl +29 -11
  84. package/assets/js/pdfjs/web/locale/vi/viewer.ftl +21 -3
  85. package/assets/js/pdfjs/web/locale/zh-CN/viewer.ftl +20 -2
  86. package/assets/js/pdfjs/web/locale/zh-TW/viewer.ftl +20 -2
  87. package/assets/js/pdfjs/web/viewer.css +556 -100
  88. package/assets/js/pdfjs/web/viewer.html +20 -9
  89. package/assets/js/pdfjs/web/viewer.mjs +1100 -817
  90. package/assets/js/pdfjs/web/viewer.mjs.map +1 -1
  91. package/package.json +1 -1
  92. package/assets/js/pdfjs/web/images/gv-toolbarButton-openinapp.svg +0 -11
@@ -22,7 +22,7 @@
22
22
 
23
23
  /******/ var __webpack_modules__ = ({
24
24
 
25
- /***/ 8759:
25
+ /***/ 588:
26
26
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
27
27
 
28
28
 
@@ -845,7 +845,7 @@ class Indent {
845
845
 
846
846
  /***/ }),
847
847
 
848
- /***/ 8275:
848
+ /***/ 5273:
849
849
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
850
850
 
851
851
 
@@ -1372,14 +1372,14 @@ class DOMLocalization extends Localization {
1372
1372
 
1373
1373
  /***/ }),
1374
1374
 
1375
- /***/ 631:
1375
+ /***/ 259:
1376
1376
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1377
1377
 
1378
1378
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1379
1379
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1380
1380
  /* harmony export */ AltTextManager: () => (/* binding */ AltTextManager)
1381
1381
  /* harmony export */ });
1382
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
1382
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
1383
1383
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
1384
1384
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
1385
1385
 
@@ -1577,16 +1577,9 @@ class AltTextManager {
1577
1577
  }
1578
1578
  }
1579
1579
  #close() {
1580
- this.#eventBus.dispatch("reporttelemetry", {
1581
- source: this,
1582
- details: {
1583
- type: "editing",
1584
- subtype: this.#currentEditor.editorType,
1585
- data: this.#telemetryData || {
1586
- action: "alt_text_cancel",
1587
- alt_text_keyboard: !this.#hasUsedPointer
1588
- }
1589
- }
1580
+ this.#currentEditor._reportTelemetry(this.#telemetryData || {
1581
+ action: "alt_text_cancel",
1582
+ alt_text_keyboard: !this.#hasUsedPointer
1590
1583
  });
1591
1584
  this.#telemetryData = null;
1592
1585
  this.#removeOnClickListeners();
@@ -1640,29 +1633,30 @@ __webpack_async_result__();
1640
1633
 
1641
1634
  /***/ }),
1642
1635
 
1643
- /***/ 2640:
1636
+ /***/ 283:
1644
1637
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1645
1638
 
1646
1639
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1647
1640
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1648
1641
  /* harmony export */ AnnotationEditorLayerBuilder: () => (/* binding */ AnnotationEditorLayerBuilder)
1649
1642
  /* harmony export */ });
1650
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
1651
- /* harmony import */ var web_l10n_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7910);
1652
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_l10n_utils__WEBPACK_IMPORTED_MODULE_1__]);
1653
- ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_l10n_utils__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1643
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
1644
+ /* harmony import */ var web_null_l10n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(410);
1645
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_null_l10n__WEBPACK_IMPORTED_MODULE_1__]);
1646
+ ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_null_l10n__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1654
1647
 
1655
1648
 
1656
1649
  class AnnotationEditorLayerBuilder {
1657
1650
  #annotationLayer = null;
1658
1651
  #drawLayer = null;
1652
+ #onAppend = null;
1659
1653
  #textLayer = null;
1660
1654
  #uiManager;
1661
1655
  constructor(options) {
1662
- this.pageDiv = options.pageDiv;
1663
1656
  this.pdfPage = options.pdfPage;
1664
1657
  this.accessibilityManager = options.accessibilityManager;
1665
- this.l10n = options.l10n || web_l10n_utils__WEBPACK_IMPORTED_MODULE_1__.NullL10n;
1658
+ this.l10n = options.l10n;
1659
+ this.l10n ||= new web_null_l10n__WEBPACK_IMPORTED_MODULE_1__.GenericL10n();
1666
1660
  this.annotationEditorLayer = null;
1667
1661
  this.div = null;
1668
1662
  this._cancelled = false;
@@ -1670,6 +1664,7 @@ class AnnotationEditorLayerBuilder {
1670
1664
  this.#annotationLayer = options.annotationLayer || null;
1671
1665
  this.#textLayer = options.textLayer || null;
1672
1666
  this.#drawLayer = options.drawLayer || null;
1667
+ this.#onAppend = options.onAppend || null;
1673
1668
  }
1674
1669
  async render(viewport, intent = "display") {
1675
1670
  if (intent !== "display") {
@@ -1690,10 +1685,9 @@ class AnnotationEditorLayerBuilder {
1690
1685
  }
1691
1686
  const div = this.div = document.createElement("div");
1692
1687
  div.className = "annotationEditorLayer";
1693
- div.tabIndex = 0;
1694
1688
  div.hidden = true;
1695
1689
  div.dir = this.#uiManager.direction;
1696
- this.pageDiv.append(div);
1690
+ this.#onAppend?.(div);
1697
1691
  this.annotationEditorLayer = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorLayer({
1698
1692
  uiManager: this.#uiManager,
1699
1693
  div,
@@ -1719,9 +1713,7 @@ class AnnotationEditorLayerBuilder {
1719
1713
  if (!this.div) {
1720
1714
  return;
1721
1715
  }
1722
- this.pageDiv = null;
1723
1716
  this.annotationEditorLayer.destroy();
1724
- this.div.remove();
1725
1717
  }
1726
1718
  hide() {
1727
1719
  if (!this.div) {
@@ -1730,7 +1722,7 @@ class AnnotationEditorLayerBuilder {
1730
1722
  this.div.hidden = true;
1731
1723
  }
1732
1724
  show() {
1733
- if (!this.div || this.annotationEditorLayer.isEmpty) {
1725
+ if (!this.div || this.annotationEditorLayer.isInvisible) {
1734
1726
  return;
1735
1727
  }
1736
1728
  this.div.hidden = false;
@@ -1742,14 +1734,14 @@ __webpack_async_result__();
1742
1734
 
1743
1735
  /***/ }),
1744
1736
 
1745
- /***/ 1296:
1737
+ /***/ 226:
1746
1738
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1747
1739
 
1748
1740
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1749
1741
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1750
1742
  /* harmony export */ AnnotationEditorParams: () => (/* binding */ AnnotationEditorParams)
1751
1743
  /* harmony export */ });
1752
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
1744
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
1753
1745
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
1754
1746
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
1755
1747
 
@@ -1764,7 +1756,9 @@ class AnnotationEditorParams {
1764
1756
  editorInkColor,
1765
1757
  editorInkThickness,
1766
1758
  editorInkOpacity,
1767
- editorStampAddImage
1759
+ editorStampAddImage,
1760
+ editorFreeHighlightThickness,
1761
+ editorHighlightShowAll
1768
1762
  }) {
1769
1763
  const dispatchEvent = (typeStr, value) => {
1770
1764
  this.eventBus.dispatch("switchannotationeditorparams", {
@@ -1791,6 +1785,14 @@ class AnnotationEditorParams {
1791
1785
  editorStampAddImage.addEventListener("click", () => {
1792
1786
  dispatchEvent("CREATE");
1793
1787
  });
1788
+ editorFreeHighlightThickness.addEventListener("input", function () {
1789
+ dispatchEvent("HIGHLIGHT_THICKNESS", this.valueAsNumber);
1790
+ });
1791
+ editorHighlightShowAll.addEventListener("click", function () {
1792
+ const checked = this.getAttribute("aria-pressed") === "true";
1793
+ this.setAttribute("aria-pressed", !checked);
1794
+ dispatchEvent("HIGHLIGHT_SHOW_ALL", !checked);
1795
+ });
1794
1796
  this.eventBus._on("annotationeditorparamschanged", evt => {
1795
1797
  for (const [type, value] of evt.details) {
1796
1798
  switch (type) {
@@ -1809,6 +1811,15 @@ class AnnotationEditorParams {
1809
1811
  case pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorParamsType.INK_OPACITY:
1810
1812
  editorInkOpacity.value = value;
1811
1813
  break;
1814
+ case pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:
1815
+ editorFreeHighlightThickness.value = value;
1816
+ break;
1817
+ case pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorParamsType.HIGHLIGHT_FREE:
1818
+ editorFreeHighlightThickness.disabled = !value;
1819
+ break;
1820
+ case pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:
1821
+ editorHighlightShowAll.setAttribute("aria-pressed", value);
1822
+ break;
1812
1823
  }
1813
1824
  }
1814
1825
  });
@@ -1820,23 +1831,23 @@ __webpack_async_result__();
1820
1831
 
1821
1832
  /***/ }),
1822
1833
 
1823
- /***/ 6735:
1834
+ /***/ 2707:
1824
1835
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1825
1836
 
1826
1837
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1827
1838
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1828
1839
  /* harmony export */ AnnotationLayerBuilder: () => (/* binding */ AnnotationLayerBuilder)
1829
1840
  /* harmony export */ });
1830
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
1831
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4927);
1841
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
1842
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
1832
1843
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
1833
1844
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
1834
1845
 
1835
1846
 
1836
1847
  class AnnotationLayerBuilder {
1848
+ #onAppend = null;
1837
1849
  #onPresentationModeChanged = null;
1838
1850
  constructor({
1839
- pageDiv,
1840
1851
  pdfPage,
1841
1852
  linkService,
1842
1853
  downloadManager,
@@ -1847,9 +1858,9 @@ class AnnotationLayerBuilder {
1847
1858
  hasJSActionsPromise = null,
1848
1859
  fieldObjectsPromise = null,
1849
1860
  annotationCanvasMap = null,
1850
- accessibilityManager = null
1861
+ accessibilityManager = null,
1862
+ onAppend = null
1851
1863
  }) {
1852
- this.pageDiv = pageDiv;
1853
1864
  this.pdfPage = pdfPage;
1854
1865
  this.linkService = linkService;
1855
1866
  this.downloadManager = downloadManager;
@@ -1861,6 +1872,7 @@ class AnnotationLayerBuilder {
1861
1872
  this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null);
1862
1873
  this._annotationCanvasMap = annotationCanvasMap;
1863
1874
  this._accessibilityManager = accessibilityManager;
1875
+ this.#onAppend = onAppend;
1864
1876
  this.annotationLayer = null;
1865
1877
  this.div = null;
1866
1878
  this._cancelled = false;
@@ -1886,7 +1898,7 @@ class AnnotationLayerBuilder {
1886
1898
  }
1887
1899
  const div = this.div = document.createElement("div");
1888
1900
  div.className = "annotationLayer";
1889
- this.pageDiv.append(div);
1901
+ this.#onAppend?.(div);
1890
1902
  if (annotations.length === 0) {
1891
1903
  this.hide();
1892
1904
  return;
@@ -1962,43 +1974,50 @@ __webpack_async_result__();
1962
1974
 
1963
1975
  /***/ }),
1964
1976
 
1965
- /***/ 39:
1977
+ /***/ 1621:
1966
1978
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1967
1979
 
1968
1980
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1969
1981
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1970
- /* harmony export */ DefaultExternalServices: () => (/* binding */ DefaultExternalServices),
1971
- /* harmony export */ PDFPrintServiceFactory: () => (/* binding */ PDFPrintServiceFactory),
1972
1982
  /* harmony export */ PDFViewerApplication: () => (/* binding */ PDFViewerApplication)
1973
1983
  /* harmony export */ });
1974
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
1975
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1869);
1976
- /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8961);
1977
- /* harmony import */ var _event_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6554);
1978
- /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3234);
1979
- /* harmony import */ var web_alt_text_manager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(631);
1980
- /* harmony import */ var web_annotation_editor_params__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1296);
1981
- /* harmony import */ var _overlay_manager_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(1996);
1982
- /* harmony import */ var _password_prompt_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6329);
1983
- /* harmony import */ var web_pdf_attachment_viewer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(716);
1984
- /* harmony import */ var web_pdf_cursor_tools__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3611);
1985
- /* harmony import */ var web_pdf_document_properties__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(6312);
1986
- /* harmony import */ var web_pdf_find_bar__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1795);
1987
- /* harmony import */ var _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(3557);
1988
- /* harmony import */ var _pdf_history_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(6418);
1989
- /* harmony import */ var web_pdf_layer_viewer__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(3706);
1990
- /* harmony import */ var web_pdf_outline_viewer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(1141);
1991
- /* harmony import */ var web_pdf_presentation_mode__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(323);
1992
- /* harmony import */ var _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(5119);
1993
- /* harmony import */ var _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(2599);
1994
- /* harmony import */ var web_pdf_sidebar__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(4487);
1995
- /* harmony import */ var web_pdf_thumbnail_viewer__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(3510);
1996
- /* harmony import */ var _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(9290);
1997
- /* harmony import */ var web_secondary_toolbar__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(1544);
1998
- /* harmony import */ var web_toolbar__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(276);
1999
- /* harmony import */ var _view_history_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(1096);
2000
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__, web_alt_text_manager__WEBPACK_IMPORTED_MODULE_5__, web_annotation_editor_params__WEBPACK_IMPORTED_MODULE_6__, _password_prompt_js__WEBPACK_IMPORTED_MODULE_7__, web_pdf_attachment_viewer__WEBPACK_IMPORTED_MODULE_8__, web_pdf_cursor_tools__WEBPACK_IMPORTED_MODULE_9__, web_pdf_document_properties__WEBPACK_IMPORTED_MODULE_10__, web_pdf_find_bar__WEBPACK_IMPORTED_MODULE_11__, _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_12__, web_pdf_outline_viewer__WEBPACK_IMPORTED_MODULE_15__, web_pdf_presentation_mode__WEBPACK_IMPORTED_MODULE_16__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_17__, _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_18__, web_pdf_thumbnail_viewer__WEBPACK_IMPORTED_MODULE_20__, _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_21__, web_secondary_toolbar__WEBPACK_IMPORTED_MODULE_22__, web_toolbar__WEBPACK_IMPORTED_MODULE_23__]);
2001
- ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__, web_alt_text_manager__WEBPACK_IMPORTED_MODULE_5__, web_annotation_editor_params__WEBPACK_IMPORTED_MODULE_6__, _password_prompt_js__WEBPACK_IMPORTED_MODULE_7__, web_pdf_attachment_viewer__WEBPACK_IMPORTED_MODULE_8__, web_pdf_cursor_tools__WEBPACK_IMPORTED_MODULE_9__, web_pdf_document_properties__WEBPACK_IMPORTED_MODULE_10__, web_pdf_find_bar__WEBPACK_IMPORTED_MODULE_11__, _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_12__, web_pdf_outline_viewer__WEBPACK_IMPORTED_MODULE_15__, web_pdf_presentation_mode__WEBPACK_IMPORTED_MODULE_16__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_17__, _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_18__, web_pdf_thumbnail_viewer__WEBPACK_IMPORTED_MODULE_20__, _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_21__, web_secondary_toolbar__WEBPACK_IMPORTED_MODULE_22__, web_toolbar__WEBPACK_IMPORTED_MODULE_23__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1984
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
1985
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2603);
1986
+ /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9840);
1987
+ /* harmony import */ var _event_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5656);
1988
+ /* harmony import */ var web_external_services__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6750);
1989
+ /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(787);
1990
+ /* harmony import */ var web_alt_text_manager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(259);
1991
+ /* harmony import */ var web_annotation_editor_params__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(226);
1992
+ /* harmony import */ var _caret_browsing_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(3973);
1993
+ /* harmony import */ var web_download_manager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1544);
1994
+ /* harmony import */ var _overlay_manager_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(6174);
1995
+ /* harmony import */ var _password_prompt_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2690);
1996
+ /* harmony import */ var web_pdf_attachment_viewer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(9251);
1997
+ /* harmony import */ var web_pdf_cursor_tools__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5993);
1998
+ /* harmony import */ var web_pdf_document_properties__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(164);
1999
+ /* harmony import */ var web_pdf_find_bar__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2226);
2000
+ /* harmony import */ var _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(9814);
2001
+ /* harmony import */ var _pdf_history_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(8543);
2002
+ /* harmony import */ var web_pdf_layer_viewer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(4275);
2003
+ /* harmony import */ var web_pdf_outline_viewer__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(5514);
2004
+ /* harmony import */ var web_pdf_presentation_mode__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(8917);
2005
+ /* harmony import */ var web_print_service__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(1144);
2006
+ /* harmony import */ var _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(6615);
2007
+ /* harmony import */ var _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(5942);
2008
+ /* harmony import */ var web_pdf_sidebar__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(2275);
2009
+ /* harmony import */ var web_pdf_thumbnail_viewer__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(8280);
2010
+ /* harmony import */ var _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(6285);
2011
+ /* harmony import */ var web_secondary_toolbar__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(1900);
2012
+ /* harmony import */ var web_toolbar__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(6297);
2013
+ /* harmony import */ var _view_history_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(9226);
2014
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__, web_external_services__WEBPACK_IMPORTED_MODULE_4__, web_alt_text_manager__WEBPACK_IMPORTED_MODULE_6__, web_annotation_editor_params__WEBPACK_IMPORTED_MODULE_7__, web_download_manager__WEBPACK_IMPORTED_MODULE_8__, _password_prompt_js__WEBPACK_IMPORTED_MODULE_9__, web_pdf_attachment_viewer__WEBPACK_IMPORTED_MODULE_10__, web_pdf_cursor_tools__WEBPACK_IMPORTED_MODULE_11__, web_pdf_document_properties__WEBPACK_IMPORTED_MODULE_12__, web_pdf_presentation_mode__WEBPACK_IMPORTED_MODULE_18__, web_print_service__WEBPACK_IMPORTED_MODULE_19__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_20__, _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_21__, web_pdf_thumbnail_viewer__WEBPACK_IMPORTED_MODULE_23__, _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_24__, web_secondary_toolbar__WEBPACK_IMPORTED_MODULE_25__, web_toolbar__WEBPACK_IMPORTED_MODULE_26__]);
2015
+ ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__, web_external_services__WEBPACK_IMPORTED_MODULE_4__, web_alt_text_manager__WEBPACK_IMPORTED_MODULE_6__, web_annotation_editor_params__WEBPACK_IMPORTED_MODULE_7__, web_download_manager__WEBPACK_IMPORTED_MODULE_8__, _password_prompt_js__WEBPACK_IMPORTED_MODULE_9__, web_pdf_attachment_viewer__WEBPACK_IMPORTED_MODULE_10__, web_pdf_cursor_tools__WEBPACK_IMPORTED_MODULE_11__, web_pdf_document_properties__WEBPACK_IMPORTED_MODULE_12__, web_pdf_presentation_mode__WEBPACK_IMPORTED_MODULE_18__, web_print_service__WEBPACK_IMPORTED_MODULE_19__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_20__, _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_21__, web_pdf_thumbnail_viewer__WEBPACK_IMPORTED_MODULE_23__, _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_24__, web_secondary_toolbar__WEBPACK_IMPORTED_MODULE_25__, web_toolbar__WEBPACK_IMPORTED_MODULE_26__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
2016
+
2017
+
2018
+
2019
+
2020
+
2002
2021
 
2003
2022
 
2004
2023
 
@@ -2032,36 +2051,12 @@ const ViewOnLoad = {
2032
2051
  PREVIOUS: 0,
2033
2052
  INITIAL: 1
2034
2053
  };
2035
- class DefaultExternalServices {
2036
- constructor() {
2037
- throw new Error("Cannot initialize DefaultExternalServices.");
2038
- }
2039
- static updateFindControlState(data) {}
2040
- static updateFindMatchesCount(data) {}
2041
- static initPassiveLoading(callbacks) {}
2042
- static reportTelemetry(data) {}
2043
- static createDownloadManager() {
2044
- throw new Error("Not implemented: createDownloadManager");
2045
- }
2046
- static createPreferences() {
2047
- throw new Error("Not implemented: createPreferences");
2048
- }
2049
- static async createL10n() {
2050
- throw new Error("Not implemented: createL10n");
2051
- }
2052
- static createScripting() {
2053
- throw new Error("Not implemented: createScripting");
2054
- }
2055
- static updateEditorStates(data) {
2056
- throw new Error("Not implemented: updateEditorStates");
2057
- }
2058
- static getNimbusExperimentData() {
2059
- return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.shadow)(this, "getNimbusExperimentData", Promise.resolve(null));
2060
- }
2061
- }
2062
2054
  const PDFViewerApplication = {
2063
2055
  initialBookmark: document.location.hash.substring(1),
2064
- _initializedCapability: new pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PromiseCapability(),
2056
+ _initializedCapability: {
2057
+ ...Promise.withResolvers(),
2058
+ settled: false
2059
+ },
2065
2060
  appConfig: null,
2066
2061
  pdfDocument: null,
2067
2062
  pdfLoadingTask: null,
@@ -2094,7 +2089,6 @@ const PDFViewerApplication = {
2094
2089
  url: "",
2095
2090
  baseUrl: "",
2096
2091
  _downloadUrl: "",
2097
- externalServices: DefaultExternalServices,
2098
2092
  _boundEvents: Object.create(null),
2099
2093
  documentInfo: null,
2100
2094
  metadata: null,
@@ -2112,6 +2106,10 @@ const PDFViewerApplication = {
2112
2106
  _touchInfo: null,
2113
2107
  _isCtrlKeyDown: false,
2114
2108
  _nimbusDataPromise: null,
2109
+ _caretBrowsing: null,
2110
+ _isScrolling: false,
2111
+ _lastScrollTop: 0,
2112
+ _lastScrollLeft: 0,
2115
2113
  async initialize(appConfig) {
2116
2114
  let l10nPromise;
2117
2115
  this.appConfig = appConfig;
@@ -2139,12 +2137,13 @@ const PDFViewerApplication = {
2139
2137
  this.l10n = await l10nPromise;
2140
2138
  document.getElementsByTagName("html")[0].dir = this.l10n.getDirection();
2141
2139
  this.l10n.translate(appConfig.appContainer || document.documentElement);
2142
- if (this.isViewerEmbedded && _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("externalLinkTarget") === _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_4__.LinkTarget.NONE) {
2143
- _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.set("externalLinkTarget", _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_4__.LinkTarget.TOP);
2140
+ if (this.isViewerEmbedded && _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("externalLinkTarget") === _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_5__.LinkTarget.NONE) {
2141
+ _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.set("externalLinkTarget", _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_5__.LinkTarget.TOP);
2144
2142
  }
2145
2143
  await this._initializeViewerComponents();
2146
2144
  this.bindEvents();
2147
2145
  this.bindWindowEvents();
2146
+ this._initializedCapability.settled = true;
2148
2147
  this._initializedCapability.resolve();
2149
2148
  },
2150
2149
  async _parseHashParams() {
@@ -2223,26 +2222,25 @@ const PDFViewerApplication = {
2223
2222
  } = this;
2224
2223
  const eventBus = _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("isInAutomation") ? new _event_utils_js__WEBPACK_IMPORTED_MODULE_3__.AutomationEventBus() : new _event_utils_js__WEBPACK_IMPORTED_MODULE_3__.EventBus();
2225
2224
  this.eventBus = eventBus;
2226
- this.overlayManager = new _overlay_manager_js__WEBPACK_IMPORTED_MODULE_24__.OverlayManager();
2227
- const pdfRenderingQueue = new _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_17__.PDFRenderingQueue();
2225
+ this.overlayManager = new _overlay_manager_js__WEBPACK_IMPORTED_MODULE_27__.OverlayManager();
2226
+ const pdfRenderingQueue = new _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_20__.PDFRenderingQueue();
2228
2227
  pdfRenderingQueue.onIdle = this._cleanup.bind(this);
2229
2228
  this.pdfRenderingQueue = pdfRenderingQueue;
2230
- const pdfLinkService = new _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_4__.PDFLinkService({
2229
+ const pdfLinkService = new _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_5__.PDFLinkService({
2231
2230
  eventBus,
2232
2231
  externalLinkTarget: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("externalLinkTarget"),
2233
2232
  externalLinkRel: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("externalLinkRel"),
2234
2233
  ignoreDestinationZoom: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("ignoreDestinationZoom")
2235
2234
  });
2236
2235
  this.pdfLinkService = pdfLinkService;
2237
- const downloadManager = externalServices.createDownloadManager();
2238
- this.downloadManager = downloadManager;
2239
- const findController = new _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_12__.PDFFindController({
2236
+ const downloadManager = this.downloadManager = new web_download_manager__WEBPACK_IMPORTED_MODULE_8__.DownloadManager();
2237
+ const findController = new _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_14__.PDFFindController({
2240
2238
  linkService: pdfLinkService,
2241
2239
  eventBus,
2242
2240
  updateMatchesCountOnProgress: true
2243
2241
  });
2244
2242
  this.findController = findController;
2245
- const pdfScriptingManager = new _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_18__.PDFScriptingManager({
2243
+ const pdfScriptingManager = new _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_21__.PDFScriptingManager({
2246
2244
  eventBus,
2247
2245
  externalServices,
2248
2246
  docProperties: this._scriptingDocProperties.bind(this)
@@ -2256,8 +2254,8 @@ const PDFViewerApplication = {
2256
2254
  background: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("pageColorsBackground"),
2257
2255
  foreground: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("pageColorsForeground")
2258
2256
  } : null;
2259
- const altTextManager = appConfig.altTextDialog ? new web_alt_text_manager__WEBPACK_IMPORTED_MODULE_5__.AltTextManager(appConfig.altTextDialog, container, this.overlayManager, eventBus) : null;
2260
- const pdfViewer = new _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_21__.PDFViewer({
2257
+ const altTextManager = appConfig.altTextDialog ? new web_alt_text_manager__WEBPACK_IMPORTED_MODULE_6__.AltTextManager(appConfig.altTextDialog, container, this.overlayManager, eventBus) : null;
2258
+ const pdfViewer = new _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_24__.PDFViewer({
2261
2259
  container,
2262
2260
  viewer,
2263
2261
  eventBus,
@@ -2272,19 +2270,20 @@ const PDFViewerApplication = {
2272
2270
  annotationMode: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("annotationMode"),
2273
2271
  annotationEditorMode,
2274
2272
  annotationEditorHighlightColors: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("highlightEditorColors"),
2273
+ enableHighlightFloatingButton: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("enableHighlightFloatingButton"),
2275
2274
  imageResourcesPath: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("imageResourcesPath"),
2276
2275
  enablePrintAutoRotate: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("enablePrintAutoRotate"),
2277
- isOffscreenCanvasSupported,
2278
2276
  maxCanvasPixels: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("maxCanvasPixels"),
2279
2277
  enablePermissions: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("enablePermissions"),
2280
- pageColors
2278
+ pageColors,
2279
+ mlManager: this.mlManager
2281
2280
  });
2282
2281
  this.pdfViewer = pdfViewer;
2283
2282
  pdfRenderingQueue.setViewer(pdfViewer);
2284
2283
  pdfLinkService.setViewer(pdfViewer);
2285
2284
  pdfScriptingManager.setViewer(pdfViewer);
2286
2285
  if (appConfig.sidebar?.thumbnailView) {
2287
- this.pdfThumbnailViewer = new web_pdf_thumbnail_viewer__WEBPACK_IMPORTED_MODULE_20__.PDFThumbnailViewer({
2286
+ this.pdfThumbnailViewer = new web_pdf_thumbnail_viewer__WEBPACK_IMPORTED_MODULE_23__.PDFThumbnailViewer({
2288
2287
  container: appConfig.sidebar.thumbnailView,
2289
2288
  eventBus,
2290
2289
  renderingQueue: pdfRenderingQueue,
@@ -2294,25 +2293,25 @@ const PDFViewerApplication = {
2294
2293
  pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer);
2295
2294
  }
2296
2295
  if (!this.isViewerEmbedded && !_app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("disableHistory")) {
2297
- this.pdfHistory = new _pdf_history_js__WEBPACK_IMPORTED_MODULE_13__.PDFHistory({
2296
+ this.pdfHistory = new _pdf_history_js__WEBPACK_IMPORTED_MODULE_15__.PDFHistory({
2298
2297
  linkService: pdfLinkService,
2299
2298
  eventBus
2300
2299
  });
2301
2300
  pdfLinkService.setHistory(this.pdfHistory);
2302
2301
  }
2303
2302
  if (!this.supportsIntegratedFind && appConfig.findBar) {
2304
- this.findBar = new web_pdf_find_bar__WEBPACK_IMPORTED_MODULE_11__.PDFFindBar(appConfig.findBar, eventBus);
2303
+ this.findBar = new web_pdf_find_bar__WEBPACK_IMPORTED_MODULE_13__.PDFFindBar(appConfig.findBar, eventBus);
2305
2304
  }
2306
2305
  if (appConfig.annotationEditorParams) {
2307
2306
  if (annotationEditorMode !== pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.AnnotationEditorType.DISABLE) {
2308
- if (!isOffscreenCanvasSupported) {
2309
- appConfig.toolbar?.editorStampButton?.classList.add("hidden");
2307
+ if (_app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("enableStampEditor") && isOffscreenCanvasSupported) {
2308
+ appConfig.toolbar?.editorStampButton?.classList.remove("hidden");
2310
2309
  }
2311
2310
  const editorHighlightButton = appConfig.toolbar?.editorHighlightButton;
2312
2311
  if (editorHighlightButton && _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("enableHighlightEditor")) {
2313
2312
  editorHighlightButton.hidden = false;
2314
2313
  }
2315
- this.annotationEditorParams = new web_annotation_editor_params__WEBPACK_IMPORTED_MODULE_6__.AnnotationEditorParams(appConfig.annotationEditorParams, eventBus);
2314
+ this.annotationEditorParams = new web_annotation_editor_params__WEBPACK_IMPORTED_MODULE_7__.AnnotationEditorParams(appConfig.annotationEditorParams, eventBus);
2316
2315
  } else {
2317
2316
  for (const id of ["editorModeButtons", "editorModeSeparator"]) {
2318
2317
  document.getElementById(id)?.classList.add("hidden");
@@ -2320,33 +2319,33 @@ const PDFViewerApplication = {
2320
2319
  }
2321
2320
  }
2322
2321
  if (appConfig.documentProperties) {
2323
- this.pdfDocumentProperties = new web_pdf_document_properties__WEBPACK_IMPORTED_MODULE_10__.PDFDocumentProperties(appConfig.documentProperties, this.overlayManager, eventBus, l10n, () => this._docFilename);
2322
+ this.pdfDocumentProperties = new web_pdf_document_properties__WEBPACK_IMPORTED_MODULE_12__.PDFDocumentProperties(appConfig.documentProperties, this.overlayManager, eventBus, l10n, () => this._docFilename);
2324
2323
  }
2325
2324
  if (appConfig.secondaryToolbar?.cursorHandToolButton) {
2326
- this.pdfCursorTools = new web_pdf_cursor_tools__WEBPACK_IMPORTED_MODULE_9__.PDFCursorTools({
2325
+ this.pdfCursorTools = new web_pdf_cursor_tools__WEBPACK_IMPORTED_MODULE_11__.PDFCursorTools({
2327
2326
  container,
2328
2327
  eventBus,
2329
2328
  cursorToolOnLoad: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("cursorToolOnLoad")
2330
2329
  });
2331
2330
  }
2332
2331
  if (appConfig.toolbar) {
2333
- this.toolbar = new web_toolbar__WEBPACK_IMPORTED_MODULE_23__.Toolbar(appConfig.toolbar, eventBus);
2332
+ this.toolbar = new web_toolbar__WEBPACK_IMPORTED_MODULE_26__.Toolbar(appConfig.toolbar, eventBus);
2334
2333
  }
2335
2334
  if (appConfig.secondaryToolbar) {
2336
- this.secondaryToolbar = new web_secondary_toolbar__WEBPACK_IMPORTED_MODULE_22__.SecondaryToolbar(appConfig.secondaryToolbar, eventBus);
2335
+ this.secondaryToolbar = new web_secondary_toolbar__WEBPACK_IMPORTED_MODULE_25__.SecondaryToolbar(appConfig.secondaryToolbar, eventBus);
2337
2336
  }
2338
2337
  if (this.supportsFullscreen && appConfig.secondaryToolbar?.presentationModeButton) {
2339
- this.pdfPresentationMode = new web_pdf_presentation_mode__WEBPACK_IMPORTED_MODULE_16__.PDFPresentationMode({
2338
+ this.pdfPresentationMode = new web_pdf_presentation_mode__WEBPACK_IMPORTED_MODULE_18__.PDFPresentationMode({
2340
2339
  container,
2341
2340
  pdfViewer,
2342
2341
  eventBus
2343
2342
  });
2344
2343
  }
2345
2344
  if (appConfig.passwordOverlay) {
2346
- this.passwordPrompt = new _password_prompt_js__WEBPACK_IMPORTED_MODULE_7__.PasswordPrompt(appConfig.passwordOverlay, this.overlayManager, this.isViewerEmbedded);
2345
+ this.passwordPrompt = new _password_prompt_js__WEBPACK_IMPORTED_MODULE_9__.PasswordPrompt(appConfig.passwordOverlay, this.overlayManager, this.isViewerEmbedded);
2347
2346
  }
2348
2347
  if (appConfig.sidebar?.outlineView) {
2349
- this.pdfOutlineViewer = new web_pdf_outline_viewer__WEBPACK_IMPORTED_MODULE_15__.PDFOutlineViewer({
2348
+ this.pdfOutlineViewer = new web_pdf_outline_viewer__WEBPACK_IMPORTED_MODULE_17__.PDFOutlineViewer({
2350
2349
  container: appConfig.sidebar.outlineView,
2351
2350
  eventBus,
2352
2351
  l10n,
@@ -2355,7 +2354,7 @@ const PDFViewerApplication = {
2355
2354
  });
2356
2355
  }
2357
2356
  if (appConfig.sidebar?.attachmentsView) {
2358
- this.pdfAttachmentViewer = new web_pdf_attachment_viewer__WEBPACK_IMPORTED_MODULE_8__.PDFAttachmentViewer({
2357
+ this.pdfAttachmentViewer = new web_pdf_attachment_viewer__WEBPACK_IMPORTED_MODULE_10__.PDFAttachmentViewer({
2359
2358
  container: appConfig.sidebar.attachmentsView,
2360
2359
  eventBus,
2361
2360
  l10n,
@@ -2363,14 +2362,14 @@ const PDFViewerApplication = {
2363
2362
  });
2364
2363
  }
2365
2364
  if (appConfig.sidebar?.layersView) {
2366
- this.pdfLayerViewer = new web_pdf_layer_viewer__WEBPACK_IMPORTED_MODULE_14__.PDFLayerViewer({
2365
+ this.pdfLayerViewer = new web_pdf_layer_viewer__WEBPACK_IMPORTED_MODULE_16__.PDFLayerViewer({
2367
2366
  container: appConfig.sidebar.layersView,
2368
2367
  eventBus,
2369
2368
  l10n
2370
2369
  });
2371
2370
  }
2372
2371
  if (appConfig.sidebar) {
2373
- this.pdfSidebar = new web_pdf_sidebar__WEBPACK_IMPORTED_MODULE_19__.PDFSidebar({
2372
+ this.pdfSidebar = new web_pdf_sidebar__WEBPACK_IMPORTED_MODULE_22__.PDFSidebar({
2374
2373
  elements: appConfig.sidebar,
2375
2374
  eventBus,
2376
2375
  l10n
@@ -2387,7 +2386,7 @@ const PDFViewerApplication = {
2387
2386
  }
2388
2387
  },
2389
2388
  async run(config) {
2390
- this.preferences = this.externalServices.createPreferences();
2389
+ this.preferences = new web_external_services__WEBPACK_IMPORTED_MODULE_4__.Preferences();
2391
2390
  await this.initialize(config);
2392
2391
  const {
2393
2392
  appConfig,
@@ -2398,8 +2397,12 @@ const PDFViewerApplication = {
2398
2397
  const params = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.parseQueryString)(queryString);
2399
2398
  file = params.get("file") ?? _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("defaultUrl");
2400
2399
  validateFileURL(file);
2401
- const fileInput = appConfig.openFileInput;
2400
+ const fileInput = this._openFileInput = document.createElement("input");
2401
+ fileInput.id = "fileInput";
2402
+ fileInput.hidden = true;
2403
+ fileInput.type = "file";
2402
2404
  fileInput.value = null;
2405
+ document.body.append(fileInput);
2403
2406
  fileInput.addEventListener("change", function (evt) {
2404
2407
  const {
2405
2408
  files
@@ -2453,6 +2456,12 @@ const PDFViewerApplication = {
2453
2456
  this._hideViewBookmark();
2454
2457
  }
2455
2458
  },
2459
+ get externalServices() {
2460
+ return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.shadow)(this, "externalServices", new web_external_services__WEBPACK_IMPORTED_MODULE_4__.ExternalServices());
2461
+ },
2462
+ get mlManager() {
2463
+ return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.shadow)(this, "mlManager", _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("enableML") === true ? new web_external_services__WEBPACK_IMPORTED_MODULE_4__.MLManager() : null);
2464
+ },
2456
2465
  get initialized() {
2457
2466
  return this._initializedCapability.settled;
2458
2467
  },
@@ -2495,7 +2504,7 @@ const PDFViewerApplication = {
2495
2504
  this.pdfViewer.currentPageNumber = val;
2496
2505
  },
2497
2506
  get supportsPrinting() {
2498
- return PDFPrintServiceFactory.instance.supportsPrinting;
2507
+ return web_print_service__WEBPACK_IMPORTED_MODULE_19__.PDFPrintServiceFactory.supportsPrinting;
2499
2508
  },
2500
2509
  get supportsFullscreen() {
2501
2510
  return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.shadow)(this, "supportsFullscreen", document.fullscreenEnabled);
@@ -2517,8 +2526,12 @@ const PDFViewerApplication = {
2517
2526
  get supportsMouseWheelZoomMetaKey() {
2518
2527
  return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.shadow)(this, "supportsMouseWheelZoomMetaKey", _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("supportsMouseWheelZoomMetaKey"));
2519
2528
  },
2520
- initPassiveLoading(file) {
2521
- throw new Error("Not implemented: initPassiveLoading");
2529
+ get supportsCaretBrowsingMode() {
2530
+ return _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("supportsCaretBrowsingMode");
2531
+ },
2532
+ moveCaret(isUp, select) {
2533
+ this._caretBrowsing ||= new _caret_browsing_js__WEBPACK_IMPORTED_MODULE_28__.CaretBrowsingMode(this.appConfig.mainContainer, this.appConfig.viewerContainer, this.appConfig.toolbar?.container);
2534
+ this._caretBrowsing.moveCaret(isUp, select);
2522
2535
  },
2523
2536
  setTitleUsingUrl(url = "", downloadUrl = null) {
2524
2537
  this.url = url;
@@ -2649,10 +2662,9 @@ const PDFViewerApplication = {
2649
2662
  } else if (reason instanceof pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.UnexpectedResponseException) {
2650
2663
  key = "pdfjs-unexpected-response-error";
2651
2664
  }
2652
- return this.l10n.get(key).then(msg => {
2653
- this._documentError(msg, {
2654
- message: reason?.message
2655
- });
2665
+ return this._documentError(key, {
2666
+ message: reason.message
2667
+ }).then(() => {
2656
2668
  throw reason;
2657
2669
  });
2658
2670
  });
@@ -2703,7 +2715,8 @@ const PDFViewerApplication = {
2703
2715
  this.externalServices.reportTelemetry({
2704
2716
  type: "editing",
2705
2717
  data: {
2706
- type: "save"
2718
+ type: "save",
2719
+ stats: this.pdfDocument?.annotationStorage.editorStats
2707
2720
  }
2708
2721
  });
2709
2722
  }
@@ -2715,21 +2728,17 @@ const PDFViewerApplication = {
2715
2728
  this.download(options);
2716
2729
  }
2717
2730
  },
2718
- openInExternalApp() {
2719
- this.downloadOrSave({
2720
- openInExternalApp: true
2721
- });
2722
- },
2723
- _documentError(message, moreInfo = null) {
2731
+ async _documentError(key, moreInfo = null) {
2724
2732
  this._unblockDocumentLoadEvent();
2725
- this._otherError(message, moreInfo);
2733
+ const message = await this._otherError(key || "pdfjs-loading-error", moreInfo);
2726
2734
  this.eventBus.dispatch("documenterror", {
2727
2735
  source: this,
2728
2736
  message,
2729
2737
  reason: moreInfo?.message ?? null
2730
2738
  });
2731
2739
  },
2732
- _otherError(message, moreInfo = null) {
2740
+ async _otherError(key, moreInfo = null) {
2741
+ const message = await this.l10n.get(key);
2733
2742
  const moreInfoText = [`PDF.js v${pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.version || "?"} (build: ${pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.build || "?"})`];
2734
2743
  if (moreInfo) {
2735
2744
  moreInfoText.push(`Message: ${moreInfo.message}`);
@@ -2745,6 +2754,7 @@ const PDFViewerApplication = {
2745
2754
  }
2746
2755
  }
2747
2756
  console.error(`${message}\n\n${moreInfoText.join("\n")}`);
2757
+ return message;
2748
2758
  },
2749
2759
  progress(level) {
2750
2760
  if (!this.loadingBar || this.downloadComplete) {
@@ -2788,7 +2798,7 @@ const PDFViewerApplication = {
2788
2798
  pagesPromise
2789
2799
  } = pdfViewer;
2790
2800
  this.pdfThumbnailViewer?.setDocument(pdfDocument);
2791
- const storedPromise = (this.store = new _view_history_js__WEBPACK_IMPORTED_MODULE_25__.ViewHistory(pdfDocument.fingerprints[0])).getMultiple({
2801
+ const storedPromise = (this.store = new _view_history_js__WEBPACK_IMPORTED_MODULE_29__.ViewHistory(pdfDocument.fingerprints[0])).getMultiple({
2792
2802
  page: null,
2793
2803
  zoom: _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_SCALE_VALUE,
2794
2804
  scrollLeft: "0",
@@ -2869,10 +2879,8 @@ const PDFViewerApplication = {
2869
2879
  this._unblockDocumentLoadEvent();
2870
2880
  this._initializeAutoPrint(pdfDocument, openActionPromise);
2871
2881
  }, reason => {
2872
- this.l10n.get("pdfjs-loading-error").then(msg => {
2873
- this._documentError(msg, {
2874
- message: reason?.message
2875
- });
2882
+ this._documentError("pdfjs-loading-error", {
2883
+ message: reason.message
2876
2884
  });
2877
2885
  });
2878
2886
  onePageRendered.then(data => {
@@ -3095,14 +3103,6 @@ const PDFViewerApplication = {
3095
3103
  annotationStorage.onAnnotationEditor = typeStr => {
3096
3104
  this._hasAnnotationEditors = !!typeStr;
3097
3105
  this.setTitle();
3098
- if (typeStr) {
3099
- this.externalServices.reportTelemetry({
3100
- type: "editing",
3101
- data: {
3102
- type: typeStr
3103
- }
3104
- });
3105
- }
3106
3106
  };
3107
3107
  },
3108
3108
  setInitialView(storedHash, {
@@ -3156,16 +3156,12 @@ const PDFViewerApplication = {
3156
3156
  this.pdfRenderingQueue.renderHighestPriority();
3157
3157
  },
3158
3158
  beforePrint() {
3159
- this._printAnnotationStoragePromise = this.pdfScriptingManager.dispatchWillPrint().catch(() => {}).then(() => {
3160
- return this.pdfDocument?.annotationStorage.print;
3161
- });
3159
+ this._printAnnotationStoragePromise = this.pdfScriptingManager.dispatchWillPrint().catch(() => {}).then(() => this.pdfDocument?.annotationStorage.print);
3162
3160
  if (this.printService) {
3163
3161
  return;
3164
3162
  }
3165
3163
  if (!this.supportsPrinting) {
3166
- this.l10n.get("pdfjs-printing-not-supported").then(msg => {
3167
- this._otherError(msg);
3168
- });
3164
+ this._otherError("pdfjs-printing-not-supported");
3169
3165
  return;
3170
3166
  }
3171
3167
  if (!this.pdfViewer.pageViewsReady) {
@@ -3174,20 +3170,22 @@ const PDFViewerApplication = {
3174
3170
  });
3175
3171
  return;
3176
3172
  }
3177
- const pagesOverview = this.pdfViewer.getPagesOverview();
3178
- const printContainer = this.appConfig.printContainer;
3179
- const printResolution = _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("printResolution");
3180
- const optionalContentConfigPromise = this.pdfViewer.optionalContentConfigPromise;
3181
- const printService = PDFPrintServiceFactory.instance.createPrintService(this.pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, this._printAnnotationStoragePromise);
3182
- this.printService = printService;
3173
+ this.printService = web_print_service__WEBPACK_IMPORTED_MODULE_19__.PDFPrintServiceFactory.createPrintService({
3174
+ pdfDocument: this.pdfDocument,
3175
+ pagesOverview: this.pdfViewer.getPagesOverview(),
3176
+ printContainer: this.appConfig.printContainer,
3177
+ printResolution: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("printResolution"),
3178
+ printAnnotationStoragePromise: this._printAnnotationStoragePromise
3179
+ });
3183
3180
  this.forceRendering();
3184
3181
  this.setTitle();
3185
- printService.layout();
3182
+ this.printService.layout();
3186
3183
  if (this._hasAnnotationEditors) {
3187
3184
  this.externalServices.reportTelemetry({
3188
3185
  type: "editing",
3189
3186
  data: {
3190
- type: "print"
3187
+ type: "print",
3188
+ stats: this.pdfDocument?.annotationStorage.editorStats
3191
3189
  }
3192
3190
  });
3193
3191
  }
@@ -3245,7 +3243,6 @@ const PDFViewerApplication = {
3245
3243
  eventBus._on("switchannotationeditorparams", webViewerSwitchAnnotationEditorParams);
3246
3244
  eventBus._on("print", webViewerPrint);
3247
3245
  eventBus._on("download", webViewerDownload);
3248
- eventBus._on("openinexternalapp", webViewerOpenInExternalApp);
3249
3246
  eventBus._on("firstpage", webViewerFirstPage);
3250
3247
  eventBus._on("lastpage", webViewerLastPage);
3251
3248
  eventBus._on("nextpage", webViewerNextPage);
@@ -3277,7 +3274,10 @@ const PDFViewerApplication = {
3277
3274
  bindWindowEvents() {
3278
3275
  const {
3279
3276
  eventBus,
3280
- _boundEvents
3277
+ _boundEvents,
3278
+ appConfig: {
3279
+ mainContainer
3280
+ }
3281
3281
  } = this;
3282
3282
  function addWindowResolutionChange(evt = null) {
3283
3283
  if (evt) {
@@ -3341,6 +3341,39 @@ const PDFViewerApplication = {
3341
3341
  window.addEventListener("beforeprint", _boundEvents.windowBeforePrint);
3342
3342
  window.addEventListener("afterprint", _boundEvents.windowAfterPrint);
3343
3343
  window.addEventListener("updatefromsandbox", _boundEvents.windowUpdateFromSandbox);
3344
+ if (!("onscrollend" in document.documentElement)) {
3345
+ return;
3346
+ }
3347
+ ({
3348
+ scrollTop: this._lastScrollTop,
3349
+ scrollLeft: this._lastScrollLeft
3350
+ } = mainContainer);
3351
+ const scrollend = _boundEvents.mainContainerScrollend = () => {
3352
+ ({
3353
+ scrollTop: this._lastScrollTop,
3354
+ scrollLeft: this._lastScrollLeft
3355
+ } = mainContainer);
3356
+ this._isScrolling = false;
3357
+ mainContainer.addEventListener("scroll", scroll, {
3358
+ passive: true
3359
+ });
3360
+ mainContainer.removeEventListener("scrollend", scrollend);
3361
+ mainContainer.removeEventListener("blur", scrollend);
3362
+ };
3363
+ const scroll = _boundEvents.mainContainerScroll = () => {
3364
+ if (this._isCtrlKeyDown || this._lastScrollTop === mainContainer.scrollTop && this._lastScrollLeft === mainContainer.scrollLeft) {
3365
+ return;
3366
+ }
3367
+ mainContainer.removeEventListener("scroll", scroll, {
3368
+ passive: true
3369
+ });
3370
+ this._isScrolling = true;
3371
+ mainContainer.addEventListener("scrollend", scrollend);
3372
+ mainContainer.addEventListener("blur", scrollend);
3373
+ };
3374
+ mainContainer.addEventListener("scroll", scroll, {
3375
+ passive: true
3376
+ });
3344
3377
  },
3345
3378
  unbindEvents() {
3346
3379
  const {
@@ -3364,7 +3397,6 @@ const PDFViewerApplication = {
3364
3397
  eventBus._off("presentationmode", webViewerPresentationMode);
3365
3398
  eventBus._off("print", webViewerPrint);
3366
3399
  eventBus._off("download", webViewerDownload);
3367
- eventBus._off("openinexternalapp", webViewerOpenInExternalApp);
3368
3400
  eventBus._off("firstpage", webViewerFirstPage);
3369
3401
  eventBus._off("lastpage", webViewerLastPage);
3370
3402
  eventBus._off("nextpage", webViewerNextPage);
@@ -3397,7 +3429,10 @@ const PDFViewerApplication = {
3397
3429
  },
3398
3430
  unbindWindowEvents() {
3399
3431
  const {
3400
- _boundEvents
3432
+ _boundEvents,
3433
+ appConfig: {
3434
+ mainContainer
3435
+ }
3401
3436
  } = this;
3402
3437
  window.removeEventListener("visibilitychange", webViewerVisibilityChange);
3403
3438
  window.removeEventListener("wheel", webViewerWheel, {
@@ -3420,12 +3455,17 @@ const PDFViewerApplication = {
3420
3455
  window.removeEventListener("beforeprint", _boundEvents.windowBeforePrint);
3421
3456
  window.removeEventListener("afterprint", _boundEvents.windowAfterPrint);
3422
3457
  window.removeEventListener("updatefromsandbox", _boundEvents.windowUpdateFromSandbox);
3458
+ mainContainer.removeEventListener("scroll", _boundEvents.mainContainerScroll);
3459
+ mainContainer.removeEventListener("scrollend", _boundEvents.mainContainerScrollend);
3460
+ mainContainer.removeEventListener("blur", _boundEvents.mainContainerScrollend);
3423
3461
  _boundEvents.removeWindowResolutionChange?.();
3424
3462
  _boundEvents.windowResize = null;
3425
3463
  _boundEvents.windowHashChange = null;
3426
3464
  _boundEvents.windowBeforePrint = null;
3427
3465
  _boundEvents.windowAfterPrint = null;
3428
3466
  _boundEvents.windowUpdateFromSandbox = null;
3467
+ _boundEvents.mainContainerScroll = null;
3468
+ _boundEvents.mainContainerScrollend = null;
3429
3469
  },
3430
3470
  _accumulateTicks(ticks, prop) {
3431
3471
  if (this[prop] > 0 && ticks < 0 || this[prop] < 0 && ticks > 0) {
@@ -3466,6 +3506,10 @@ const PDFViewerApplication = {
3466
3506
  return this.pdfScriptingManager.ready;
3467
3507
  }
3468
3508
  };
3509
+ (0,web_external_services__WEBPACK_IMPORTED_MODULE_4__.initCom)(PDFViewerApplication);
3510
+ {
3511
+ web_print_service__WEBPACK_IMPORTED_MODULE_19__.PDFPrintServiceFactory.initGlobals(PDFViewerApplication);
3512
+ }
3469
3513
  {
3470
3514
  const HOSTED_VIEWER_ORIGINS = ["null", "http://mozilla.github.io", "https://mozilla.github.io"];
3471
3515
  var validateFileURL = function (file) {
@@ -3482,10 +3526,8 @@ const PDFViewerApplication = {
3482
3526
  throw new Error("file origin does not match viewer's");
3483
3527
  }
3484
3528
  } catch (ex) {
3485
- PDFViewerApplication.l10n.get("pdfjs-loading-error").then(msg => {
3486
- PDFViewerApplication._documentError(msg, {
3487
- message: ex?.message
3488
- });
3529
+ PDFViewerApplication._documentError("pdfjs-loading-error", {
3530
+ message: ex.message
3489
3531
  });
3490
3532
  throw ex;
3491
3533
  }
@@ -3493,15 +3535,12 @@ const PDFViewerApplication = {
3493
3535
  }
3494
3536
  async function loadFakeWorker() {
3495
3537
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.GlobalWorkerOptions.workerSrc ||= _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("workerSrc");
3496
- await import(/* webpackIgnore: true */ pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PDFWorker.workerSrc);
3538
+ await import( /*webpackIgnore: true*/pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PDFWorker.workerSrc);
3497
3539
  }
3498
3540
  async function loadPDFBug(self) {
3499
- const {
3500
- debuggerScriptPath
3501
- } = self.appConfig;
3502
3541
  const {
3503
3542
  PDFBug
3504
- } = await import(/* webpackIgnore: true */ debuggerScriptPath);
3543
+ } = await import( /*webpackIgnore: true*/_app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("debuggerSrc"));
3505
3544
  self._PDFBug = PDFBug;
3506
3545
  }
3507
3546
  function reportPageStatsPDFBug({
@@ -3535,9 +3574,7 @@ function webViewerPageRendered({
3535
3574
  }
3536
3575
  }
3537
3576
  if (error) {
3538
- PDFViewerApplication.l10n.get("pdfjs-rendering-error").then(msg => {
3539
- PDFViewerApplication._otherError(msg, error);
3540
- });
3577
+ PDFViewerApplication._otherError("pdfjs-rendering-error", error);
3541
3578
  }
3542
3579
  }
3543
3580
  function webViewerPageMode({
@@ -3574,7 +3611,7 @@ function webViewerNamedAction(evt) {
3574
3611
  break;
3575
3612
  case "Find":
3576
3613
  if (!PDFViewerApplication.supportsIntegratedFind) {
3577
- PDFViewerApplication?.findBar.toggle();
3614
+ PDFViewerApplication.findBar?.toggle();
3578
3615
  }
3579
3616
  break;
3580
3617
  case "Print":
@@ -3664,8 +3701,7 @@ function webViewerHashchange(evt) {
3664
3701
  });
3665
3702
  };
3666
3703
  var webViewerOpenFile = function (evt) {
3667
- const fileInput = PDFViewerApplication.appConfig.openFileInput;
3668
- fileInput.click();
3704
+ PDFViewerApplication._openFileInput?.click();
3669
3705
  };
3670
3706
  }
3671
3707
  function webViewerPresentationMode() {
@@ -3683,9 +3719,6 @@ function webViewerPrint() {
3683
3719
  function webViewerDownload() {
3684
3720
  PDFViewerApplication.downloadOrSave();
3685
3721
  }
3686
- function webViewerOpenInExternalApp() {
3687
- PDFViewerApplication.openInExternalApp();
3688
- }
3689
3722
  function webViewerFirstPage() {
3690
3723
  PDFViewerApplication.page = 1;
3691
3724
  }
@@ -3755,7 +3788,7 @@ function webViewerUpdateFindMatchesCount({
3755
3788
  if (PDFViewerApplication.supportsIntegratedFind) {
3756
3789
  PDFViewerApplication.externalServices.updateFindMatchesCount(matchesCount);
3757
3790
  } else {
3758
- PDFViewerApplication.findBar.updateResultsCount(matchesCount);
3791
+ PDFViewerApplication.findBar?.updateResultsCount(matchesCount);
3759
3792
  }
3760
3793
  }
3761
3794
  function webViewerUpdateFindControlState({
@@ -3831,7 +3864,7 @@ function webViewerWheel(evt) {
3831
3864
  const isPinchToZoom = evt.ctrlKey && !PDFViewerApplication._isCtrlKeyDown && deltaMode === WheelEvent.DOM_DELTA_PIXEL && evt.deltaX === 0 && (Math.abs(scaleFactor - 1) < 0.05 || isBuiltInMac) && evt.deltaZ === 0;
3832
3865
  if (isPinchToZoom || evt.ctrlKey && supportsMouseWheelZoomCtrlKey || evt.metaKey && supportsMouseWheelZoomMetaKey) {
3833
3866
  evt.preventDefault();
3834
- if (zoomDisabledTimeout || document.visibilityState === "hidden" || PDFViewerApplication.overlayManager.active) {
3867
+ if (PDFViewerApplication._isScrolling || zoomDisabledTimeout || document.visibilityState === "hidden" || PDFViewerApplication.overlayManager.active) {
3835
3868
  return;
3836
3869
  }
3837
3870
  const previousScale = pdfViewer.currentScale;
@@ -3866,8 +3899,6 @@ function webViewerWheel(evt) {
3866
3899
  }
3867
3900
  }
3868
3901
  PDFViewerApplication._centerAtPos(previousScale, evt.clientX, evt.clientY);
3869
- } else {
3870
- setZoomDisabledTimeout();
3871
3902
  }
3872
3903
  }
3873
3904
  function webViewerTouchStart(evt) {
@@ -4136,6 +4167,11 @@ function webViewerKeyDown(evt) {
4136
4167
  turnOnlyIfPageFit = false;
4137
4168
  switch (evt.keyCode) {
4138
4169
  case 38:
4170
+ if (PDFViewerApplication.supportsCaretBrowsingMode) {
4171
+ PDFViewerApplication.moveCaret(true, false);
4172
+ handled = true;
4173
+ break;
4174
+ }
4139
4175
  case 33:
4140
4176
  if (pdfViewer.isVerticalScrollbarEnabled) {
4141
4177
  turnOnlyIfPageFit = true;
@@ -4149,6 +4185,9 @@ function webViewerKeyDown(evt) {
4149
4185
  turnPage = -1;
4150
4186
  break;
4151
4187
  case 37:
4188
+ if (PDFViewerApplication.supportsCaretBrowsingMode) {
4189
+ return;
4190
+ }
4152
4191
  if (pdfViewer.isHorizontalScrollbarEnabled) {
4153
4192
  turnOnlyIfPageFit = true;
4154
4193
  }
@@ -4167,6 +4206,11 @@ function webViewerKeyDown(evt) {
4167
4206
  }
4168
4207
  break;
4169
4208
  case 40:
4209
+ if (PDFViewerApplication.supportsCaretBrowsingMode) {
4210
+ PDFViewerApplication.moveCaret(false, false);
4211
+ handled = true;
4212
+ break;
4213
+ }
4170
4214
  case 34:
4171
4215
  if (pdfViewer.isVerticalScrollbarEnabled) {
4172
4216
  turnOnlyIfPageFit = true;
@@ -4181,6 +4225,9 @@ function webViewerKeyDown(evt) {
4181
4225
  turnPage = 1;
4182
4226
  break;
4183
4227
  case 39:
4228
+ if (PDFViewerApplication.supportsCaretBrowsingMode) {
4229
+ return;
4230
+ }
4184
4231
  if (pdfViewer.isHorizontalScrollbarEnabled) {
4185
4232
  turnOnlyIfPageFit = true;
4186
4233
  }
@@ -4234,6 +4281,14 @@ function webViewerKeyDown(evt) {
4234
4281
  pdfViewer.previousPage();
4235
4282
  handled = true;
4236
4283
  break;
4284
+ case 38:
4285
+ PDFViewerApplication.moveCaret(true, true);
4286
+ handled = true;
4287
+ break;
4288
+ case 40:
4289
+ PDFViewerApplication.moveCaret(false, true);
4290
+ handled = true;
4291
+ break;
4237
4292
  case 82:
4238
4293
  PDFViewerApplication.rotatePages(-90);
4239
4294
  break;
@@ -4264,30 +4319,21 @@ function webViewerReportTelemetry({
4264
4319
  }) {
4265
4320
  PDFViewerApplication.externalServices.reportTelemetry(details);
4266
4321
  }
4267
- const PDFPrintServiceFactory = {
4268
- instance: {
4269
- supportsPrinting: false,
4270
- createPrintService() {
4271
- throw new Error("Not implemented: createPrintService");
4272
- }
4273
- }
4274
- };
4275
4322
 
4276
4323
  __webpack_async_result__();
4277
4324
  } catch(e) { __webpack_async_result__(e); } });
4278
4325
 
4279
4326
  /***/ }),
4280
4327
 
4281
- /***/ 8961:
4328
+ /***/ 9840:
4282
4329
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
4283
4330
 
4284
4331
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4285
4332
  /* harmony export */ AppOptions: () => (/* binding */ AppOptions),
4286
- /* harmony export */ OptionKind: () => (/* binding */ OptionKind),
4287
- /* harmony export */ compatibilityParams: () => (/* binding */ compatibilityParams)
4333
+ /* harmony export */ OptionKind: () => (/* binding */ OptionKind)
4288
4334
  /* harmony export */ });
4289
- const compatibilityParams = Object.create(null);
4290
4335
  {
4336
+ var compatibilityParams = Object.create(null);
4291
4337
  const userAgent = navigator.userAgent || "";
4292
4338
  const platform = navigator.platform || "";
4293
4339
  const maxTouchPoints = navigator.maxTouchPoints || 1;
@@ -4315,6 +4361,10 @@ const defaultOptions = {
4315
4361
  value: false,
4316
4362
  kind: OptionKind.BROWSER
4317
4363
  },
4364
+ supportsCaretBrowsingMode: {
4365
+ value: false,
4366
+ kind: OptionKind.BROWSER
4367
+ },
4318
4368
  supportsDocumentFonts: {
4319
4369
  value: true,
4320
4370
  kind: OptionKind.BROWSER
@@ -4347,6 +4397,10 @@ const defaultOptions = {
4347
4397
  value: 0,
4348
4398
  kind: OptionKind.VIEWER + OptionKind.PREFERENCE
4349
4399
  },
4400
+ debuggerSrc: {
4401
+ value: "./debugger.mjs",
4402
+ kind: OptionKind.VIEWER
4403
+ },
4350
4404
  defaultZoomDelay: {
4351
4405
  value: 400,
4352
4406
  kind: OptionKind.VIEWER + OptionKind.PREFERENCE
@@ -4367,6 +4421,14 @@ const defaultOptions = {
4367
4421
  value: false,
4368
4422
  kind: OptionKind.VIEWER + OptionKind.PREFERENCE
4369
4423
  },
4424
+ enableHighlightFloatingButton: {
4425
+ value: false,
4426
+ kind: OptionKind.VIEWER + OptionKind.PREFERENCE
4427
+ },
4428
+ enableML: {
4429
+ value: false,
4430
+ kind: OptionKind.VIEWER + OptionKind.PREFERENCE
4431
+ },
4370
4432
  enablePermissions: {
4371
4433
  value: false,
4372
4434
  kind: OptionKind.VIEWER + OptionKind.PREFERENCE
@@ -4379,6 +4441,10 @@ const defaultOptions = {
4379
4441
  value: true,
4380
4442
  kind: OptionKind.VIEWER + OptionKind.PREFERENCE
4381
4443
  },
4444
+ enableStampEditor: {
4445
+ value: true,
4446
+ kind: OptionKind.VIEWER + OptionKind.PREFERENCE
4447
+ },
4382
4448
  externalLinkRel: {
4383
4449
  value: "noopener noreferrer nofollow",
4384
4450
  kind: OptionKind.VIEWER
@@ -4404,7 +4470,7 @@ const defaultOptions = {
4404
4470
  kind: OptionKind.VIEWER
4405
4471
  },
4406
4472
  maxCanvasPixels: {
4407
- value: 16777216,
4473
+ value: 2 ** 25,
4408
4474
  kind: OptionKind.VIEWER
4409
4475
  },
4410
4476
  forcePageColors: {
@@ -4541,32 +4607,26 @@ const defaultOptions = {
4541
4607
  };
4542
4608
  }
4543
4609
  const userOptions = Object.create(null);
4610
+ {
4611
+ for (const name in compatibilityParams) {
4612
+ userOptions[name] = compatibilityParams[name];
4613
+ }
4614
+ }
4544
4615
  class AppOptions {
4545
4616
  constructor() {
4546
4617
  throw new Error("Cannot initialize AppOptions.");
4547
4618
  }
4548
4619
  static get(name) {
4549
- const userOption = userOptions[name];
4550
- if (userOption !== undefined) {
4551
- return userOption;
4552
- }
4553
- const defaultOption = defaultOptions[name];
4554
- if (defaultOption !== undefined) {
4555
- return compatibilityParams[name] ?? defaultOption.value;
4556
- }
4557
- return undefined;
4620
+ return userOptions[name] ?? defaultOptions[name]?.value ?? undefined;
4558
4621
  }
4559
- static getAll(kind = null) {
4622
+ static getAll(kind = null, defaultOnly = false) {
4560
4623
  const options = Object.create(null);
4561
4624
  for (const name in defaultOptions) {
4562
4625
  const defaultOption = defaultOptions[name];
4563
- if (kind) {
4564
- if (!(kind & defaultOption.kind)) {
4565
- continue;
4566
- }
4626
+ if (kind && !(kind & defaultOption.kind)) {
4627
+ continue;
4567
4628
  }
4568
- const userOption = userOptions[name];
4569
- options[name] = userOption !== undefined ? userOption : compatibilityParams[name] ?? defaultOption.value;
4629
+ options[name] = defaultOnly ? defaultOption.value : userOptions[name] ?? defaultOption.value;
4570
4630
  }
4571
4631
  return options;
4572
4632
  }
@@ -4578,8 +4638,12 @@ class AppOptions {
4578
4638
  if (this.get("disablePreferences")) {
4579
4639
  return;
4580
4640
  }
4581
- if (Object.keys(userOptions).length) {
4641
+ for (const name in userOptions) {
4642
+ if (compatibilityParams[name] !== undefined) {
4643
+ continue;
4644
+ }
4582
4645
  console.warn("setAll: The Preferences may override manually set AppOptions; " + 'please use the "disablePreferences"-option in order to prevent that.');
4646
+ break;
4583
4647
  }
4584
4648
  }
4585
4649
  for (const name in options) {
@@ -4588,19 +4652,23 @@ class AppOptions {
4588
4652
  }
4589
4653
  static remove(name) {
4590
4654
  delete userOptions[name];
4655
+ const val = compatibilityParams[name];
4656
+ if (val !== undefined) {
4657
+ userOptions[name] = val;
4658
+ }
4591
4659
  }
4592
4660
  }
4593
4661
 
4594
4662
 
4595
4663
  /***/ }),
4596
4664
 
4597
- /***/ 9415:
4665
+ /***/ 2961:
4598
4666
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
4599
4667
 
4600
4668
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4601
4669
  /* harmony export */ BaseTreeViewer: () => (/* binding */ BaseTreeViewer)
4602
4670
  /* harmony export */ });
4603
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
4671
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
4604
4672
 
4605
4673
  const TREEITEM_OFFSET_TOP = -100;
4606
4674
  const TREEITEM_SELECTED_CLASS = "selected";
@@ -4702,18 +4770,226 @@ class BaseTreeViewer {
4702
4770
 
4703
4771
  /***/ }),
4704
4772
 
4705
- /***/ 4397:
4773
+ /***/ 3973:
4774
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
4775
+
4776
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4777
+ /* harmony export */ CaretBrowsingMode: () => (/* binding */ CaretBrowsingMode)
4778
+ /* harmony export */ });
4779
+ const PRECISION = 1e-1;
4780
+ class CaretBrowsingMode {
4781
+ #mainContainer;
4782
+ #toolBarHeight;
4783
+ #viewerContainer;
4784
+ constructor(mainContainer, viewerContainer, toolbarContainer) {
4785
+ this.#mainContainer = mainContainer;
4786
+ this.#viewerContainer = viewerContainer;
4787
+ this.#toolBarHeight = toolbarContainer?.getBoundingClientRect().height ?? 0;
4788
+ }
4789
+ #isOnSameLine(rect1, rect2) {
4790
+ const top1 = rect1.y;
4791
+ const bot1 = rect1.bottom;
4792
+ const mid1 = rect1.y + rect1.height / 2;
4793
+ const top2 = rect2.y;
4794
+ const bot2 = rect2.bottom;
4795
+ const mid2 = rect2.y + rect2.height / 2;
4796
+ return top1 <= mid2 && mid2 <= bot1 || top2 <= mid1 && mid1 <= bot2;
4797
+ }
4798
+ #isUnderOver(rect, x, y, isUp) {
4799
+ const midY = rect.y + rect.height / 2;
4800
+ return (isUp ? y >= midY : y <= midY) && rect.x - PRECISION <= x && x <= rect.right + PRECISION;
4801
+ }
4802
+ #isVisible(rect) {
4803
+ return rect.top >= this.#toolBarHeight && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
4804
+ }
4805
+ #getCaretPosition(selection, isUp) {
4806
+ const {
4807
+ focusNode,
4808
+ focusOffset
4809
+ } = selection;
4810
+ const range = document.createRange();
4811
+ range.setStart(focusNode, focusOffset);
4812
+ range.setEnd(focusNode, focusOffset);
4813
+ const rect = range.getBoundingClientRect();
4814
+ return [rect.x, isUp ? rect.top : rect.bottom];
4815
+ }
4816
+ static #caretPositionFromPoint(x, y) {
4817
+ if (!document.caretPositionFromPoint) {
4818
+ const {
4819
+ startContainer: offsetNode,
4820
+ startOffset: offset
4821
+ } = document.caretRangeFromPoint(x, y);
4822
+ return {
4823
+ offsetNode,
4824
+ offset
4825
+ };
4826
+ }
4827
+ return document.caretPositionFromPoint(x, y);
4828
+ }
4829
+ #setCaretPositionHelper(selection, caretX, select, element, rect) {
4830
+ rect ||= element.getBoundingClientRect();
4831
+ if (caretX <= rect.x + PRECISION) {
4832
+ if (select) {
4833
+ selection.extend(element.firstChild, 0);
4834
+ } else {
4835
+ selection.setPosition(element.firstChild, 0);
4836
+ }
4837
+ return;
4838
+ }
4839
+ if (rect.right - PRECISION <= caretX) {
4840
+ const {
4841
+ lastChild
4842
+ } = element;
4843
+ if (select) {
4844
+ selection.extend(lastChild, lastChild.length);
4845
+ } else {
4846
+ selection.setPosition(lastChild, lastChild.length);
4847
+ }
4848
+ return;
4849
+ }
4850
+ const midY = rect.y + rect.height / 2;
4851
+ let caretPosition = CaretBrowsingMode.#caretPositionFromPoint(caretX, midY);
4852
+ let parentElement = caretPosition.offsetNode?.parentElement;
4853
+ if (parentElement && parentElement !== element) {
4854
+ const elementsAtPoint = document.elementsFromPoint(caretX, midY);
4855
+ const savedVisibilities = [];
4856
+ for (const el of elementsAtPoint) {
4857
+ if (el === element) {
4858
+ break;
4859
+ }
4860
+ const {
4861
+ style
4862
+ } = el;
4863
+ savedVisibilities.push([el, style.visibility]);
4864
+ style.visibility = "hidden";
4865
+ }
4866
+ caretPosition = CaretBrowsingMode.#caretPositionFromPoint(caretX, midY);
4867
+ parentElement = caretPosition.offsetNode?.parentElement;
4868
+ for (const [el, visibility] of savedVisibilities) {
4869
+ el.style.visibility = visibility;
4870
+ }
4871
+ }
4872
+ if (parentElement !== element) {
4873
+ if (select) {
4874
+ selection.extend(element.firstChild, 0);
4875
+ } else {
4876
+ selection.setPosition(element.firstChild, 0);
4877
+ }
4878
+ return;
4879
+ }
4880
+ if (select) {
4881
+ selection.extend(caretPosition.offsetNode, caretPosition.offset);
4882
+ } else {
4883
+ selection.setPosition(caretPosition.offsetNode, caretPosition.offset);
4884
+ }
4885
+ }
4886
+ #setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX) {
4887
+ if (this.#isVisible(newLineElementRect)) {
4888
+ this.#setCaretPositionHelper(selection, caretX, select, newLineElement, newLineElementRect);
4889
+ return;
4890
+ }
4891
+ this.#mainContainer.addEventListener("scrollend", this.#setCaretPositionHelper.bind(this, selection, caretX, select, newLineElement, null), {
4892
+ once: true
4893
+ });
4894
+ newLineElement.scrollIntoView();
4895
+ }
4896
+ #getNodeOnNextPage(textLayer, isUp) {
4897
+ while (true) {
4898
+ const page = textLayer.closest(".page");
4899
+ const pageNumber = parseInt(page.getAttribute("data-page-number"));
4900
+ const nextPage = isUp ? pageNumber - 1 : pageNumber + 1;
4901
+ textLayer = this.#viewerContainer.querySelector(`.page[data-page-number="${nextPage}"] .textLayer`);
4902
+ if (!textLayer) {
4903
+ return null;
4904
+ }
4905
+ const walker = document.createTreeWalker(textLayer, NodeFilter.SHOW_TEXT);
4906
+ const node = isUp ? walker.lastChild() : walker.firstChild();
4907
+ if (node) {
4908
+ return node;
4909
+ }
4910
+ }
4911
+ }
4912
+ moveCaret(isUp, select) {
4913
+ const selection = document.getSelection();
4914
+ if (selection.rangeCount === 0) {
4915
+ return;
4916
+ }
4917
+ const {
4918
+ focusNode
4919
+ } = selection;
4920
+ const focusElement = focusNode.nodeType !== Node.ELEMENT_NODE ? focusNode.parentElement : focusNode;
4921
+ const root = focusElement.closest(".textLayer");
4922
+ if (!root) {
4923
+ return;
4924
+ }
4925
+ const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
4926
+ walker.currentNode = focusNode;
4927
+ const focusRect = focusElement.getBoundingClientRect();
4928
+ let newLineElement = null;
4929
+ const nodeIterator = (isUp ? walker.previousSibling : walker.nextSibling).bind(walker);
4930
+ while (nodeIterator()) {
4931
+ const element = walker.currentNode.parentElement;
4932
+ if (!this.#isOnSameLine(focusRect, element.getBoundingClientRect())) {
4933
+ newLineElement = element;
4934
+ break;
4935
+ }
4936
+ }
4937
+ if (!newLineElement) {
4938
+ const node = this.#getNodeOnNextPage(root, isUp);
4939
+ if (!node) {
4940
+ return;
4941
+ }
4942
+ if (select) {
4943
+ const lastNode = (isUp ? walker.firstChild() : walker.lastChild()) || focusNode;
4944
+ selection.extend(lastNode, isUp ? 0 : lastNode.length);
4945
+ const range = document.createRange();
4946
+ range.setStart(node, isUp ? node.length : 0);
4947
+ range.setEnd(node, isUp ? node.length : 0);
4948
+ selection.addRange(range);
4949
+ return;
4950
+ }
4951
+ const [caretX] = this.#getCaretPosition(selection, isUp);
4952
+ const {
4953
+ parentElement
4954
+ } = node;
4955
+ this.#setCaretPosition(select, selection, parentElement, parentElement.getBoundingClientRect(), caretX);
4956
+ return;
4957
+ }
4958
+ const [caretX, caretY] = this.#getCaretPosition(selection, isUp);
4959
+ const newLineElementRect = newLineElement.getBoundingClientRect();
4960
+ if (this.#isUnderOver(newLineElementRect, caretX, caretY, isUp)) {
4961
+ this.#setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX);
4962
+ return;
4963
+ }
4964
+ while (nodeIterator()) {
4965
+ const element = walker.currentNode.parentElement;
4966
+ const elementRect = element.getBoundingClientRect();
4967
+ if (!this.#isOnSameLine(newLineElementRect, elementRect)) {
4968
+ break;
4969
+ }
4970
+ if (this.#isUnderOver(elementRect, caretX, caretY, isUp)) {
4971
+ this.#setCaretPosition(select, selection, element, elementRect, caretX);
4972
+ return;
4973
+ }
4974
+ }
4975
+ this.#setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX);
4976
+ }
4977
+ }
4978
+
4979
+
4980
+ /***/ }),
4981
+
4982
+ /***/ 1544:
4706
4983
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
4707
4984
 
4708
4985
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
4709
4986
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4710
4987
  /* harmony export */ DownloadManager: () => (/* binding */ DownloadManager)
4711
4988
  /* harmony export */ });
4712
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
4989
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
4713
4990
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
4714
4991
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
4715
4992
 
4716
- ;
4717
4993
  function download(blobUrl, filename) {
4718
4994
  const a = document.createElement("a");
4719
4995
  if (!a.click) {
@@ -4782,14 +5058,14 @@ __webpack_async_result__();
4782
5058
 
4783
5059
  /***/ }),
4784
5060
 
4785
- /***/ 758:
5061
+ /***/ 3088:
4786
5062
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
4787
5063
 
4788
5064
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
4789
5065
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4790
5066
  /* harmony export */ DrawLayerBuilder: () => (/* binding */ DrawLayerBuilder)
4791
5067
  /* harmony export */ });
4792
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
5068
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
4793
5069
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
4794
5070
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
4795
5071
 
@@ -4827,7 +5103,7 @@ __webpack_async_result__();
4827
5103
 
4828
5104
  /***/ }),
4829
5105
 
4830
- /***/ 6554:
5106
+ /***/ 5656:
4831
5107
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
4832
5108
 
4833
5109
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -4840,35 +5116,38 @@ const WaitOnType = {
4840
5116
  EVENT: "event",
4841
5117
  TIMEOUT: "timeout"
4842
5118
  };
4843
- function waitOnEventOrTimeout({
5119
+ async function waitOnEventOrTimeout({
4844
5120
  target,
4845
5121
  name,
4846
5122
  delay = 0
4847
5123
  }) {
4848
- return new Promise(function (resolve, reject) {
4849
- if (typeof target !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) {
4850
- throw new Error("waitOnEventOrTimeout - invalid parameters.");
4851
- }
4852
- function handler(type) {
4853
- if (target instanceof EventBus) {
4854
- target._off(name, eventHandler);
4855
- } else {
4856
- target.removeEventListener(name, eventHandler);
4857
- }
4858
- if (timeout) {
4859
- clearTimeout(timeout);
4860
- }
4861
- resolve(type);
4862
- }
4863
- const eventHandler = handler.bind(null, WaitOnType.EVENT);
5124
+ if (typeof target !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) {
5125
+ throw new Error("waitOnEventOrTimeout - invalid parameters.");
5126
+ }
5127
+ const {
5128
+ promise,
5129
+ resolve
5130
+ } = Promise.withResolvers();
5131
+ function handler(type) {
4864
5132
  if (target instanceof EventBus) {
4865
- target._on(name, eventHandler);
5133
+ target._off(name, eventHandler);
4866
5134
  } else {
4867
- target.addEventListener(name, eventHandler);
5135
+ target.removeEventListener(name, eventHandler);
4868
5136
  }
4869
- const timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT);
4870
- const timeout = setTimeout(timeoutHandler, delay);
4871
- });
5137
+ if (timeout) {
5138
+ clearTimeout(timeout);
5139
+ }
5140
+ resolve(type);
5141
+ }
5142
+ const eventHandler = handler.bind(null, WaitOnType.EVENT);
5143
+ if (target instanceof EventBus) {
5144
+ target._on(name, eventHandler);
5145
+ } else {
5146
+ target.addEventListener(name, eventHandler);
5147
+ }
5148
+ const timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT);
5149
+ const timeout = setTimeout(timeoutHandler, delay);
5150
+ return promise;
4872
5151
  }
4873
5152
  class EventBus {
4874
5153
  #listeners = Object.create(null);
@@ -4941,7 +5220,38 @@ class AutomationEventBus extends EventBus {
4941
5220
 
4942
5221
  /***/ }),
4943
5222
 
4944
- /***/ 9170:
5223
+ /***/ 4290:
5224
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
5225
+
5226
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5227
+ /* harmony export */ BaseExternalServices: () => (/* binding */ BaseExternalServices)
5228
+ /* harmony export */ });
5229
+ class BaseExternalServices {
5230
+ constructor() {
5231
+ if (this.constructor === BaseExternalServices) {
5232
+ throw new Error("Cannot initialize BaseExternalServices.");
5233
+ }
5234
+ }
5235
+ updateFindControlState(data) {}
5236
+ updateFindMatchesCount(data) {}
5237
+ initPassiveLoading() {}
5238
+ reportTelemetry(data) {}
5239
+ async createL10n() {
5240
+ throw new Error("Not implemented: createL10n");
5241
+ }
5242
+ createScripting() {
5243
+ throw new Error("Not implemented: createScripting");
5244
+ }
5245
+ updateEditorStates(data) {
5246
+ throw new Error("Not implemented: updateEditorStates");
5247
+ }
5248
+ async getNimbusExperimentData() {}
5249
+ }
5250
+
5251
+
5252
+ /***/ }),
5253
+
5254
+ /***/ 289:
4945
5255
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
4946
5256
 
4947
5257
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
@@ -4949,13 +5259,13 @@ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
4949
5259
  /* harmony export */ GenericScripting: () => (/* binding */ GenericScripting)
4950
5260
  /* harmony export */ });
4951
5261
  /* unused harmony export docProperties */
4952
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
5262
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
4953
5263
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
4954
5264
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
4955
5265
 
4956
5266
  async function docProperties(pdfDocument) {
4957
5267
  const url = "",
4958
- baseUrl = url.split("#")[0];
5268
+ baseUrl = url.split("#", 1)[0];
4959
5269
  let {
4960
5270
  info,
4961
5271
  metadata,
@@ -4982,7 +5292,7 @@ async function docProperties(pdfDocument) {
4982
5292
  class GenericScripting {
4983
5293
  constructor(sandboxBundleSrc) {
4984
5294
  this._ready = new Promise((resolve, reject) => {
4985
- const sandbox = import(/* webpackIgnore: true */ sandboxBundleSrc);
5295
+ const sandbox = import( /*webpackIgnore: true*/sandboxBundleSrc);
4986
5296
  sandbox.then(pdfjsSandbox => {
4987
5297
  resolve(pdfjsSandbox.QuickJSSandbox());
4988
5298
  }).catch(reject);
@@ -5007,28 +5317,30 @@ __webpack_async_result__();
5007
5317
 
5008
5318
  /***/ }),
5009
5319
 
5010
- /***/ 1546:
5320
+ /***/ 6750:
5011
5321
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
5012
5322
 
5013
5323
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
5014
- /* unused harmony export GenericCom */
5015
- /* harmony import */ var _app_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39);
5016
- /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8961);
5017
- /* harmony import */ var _preferences_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(216);
5018
- /* harmony import */ var _download_manager_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4397);
5019
- /* harmony import */ var _genericl10n_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(450);
5020
- /* harmony import */ var _generic_scripting_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9170);
5021
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_app_js__WEBPACK_IMPORTED_MODULE_0__, _download_manager_js__WEBPACK_IMPORTED_MODULE_3__, _genericl10n_js__WEBPACK_IMPORTED_MODULE_4__, _generic_scripting_js__WEBPACK_IMPORTED_MODULE_5__]);
5022
- ([_app_js__WEBPACK_IMPORTED_MODULE_0__, _download_manager_js__WEBPACK_IMPORTED_MODULE_3__, _genericl10n_js__WEBPACK_IMPORTED_MODULE_4__, _generic_scripting_js__WEBPACK_IMPORTED_MODULE_5__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
5023
-
5324
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5325
+ /* harmony export */ ExternalServices: () => (/* binding */ ExternalServices),
5326
+ /* harmony export */ MLManager: () => (/* binding */ MLManager),
5327
+ /* harmony export */ Preferences: () => (/* binding */ Preferences),
5328
+ /* harmony export */ initCom: () => (/* binding */ initCom)
5329
+ /* harmony export */ });
5330
+ /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9840);
5331
+ /* harmony import */ var _external_services_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4290);
5332
+ /* harmony import */ var _preferences_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8224);
5333
+ /* harmony import */ var _genericl10n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(410);
5334
+ /* harmony import */ var _generic_scripting_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(289);
5335
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_genericl10n_js__WEBPACK_IMPORTED_MODULE_2__, _generic_scripting_js__WEBPACK_IMPORTED_MODULE_3__]);
5336
+ ([_genericl10n_js__WEBPACK_IMPORTED_MODULE_2__, _generic_scripting_js__WEBPACK_IMPORTED_MODULE_3__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
5024
5337
 
5025
5338
 
5026
5339
 
5027
5340
 
5028
5341
 
5029
- ;
5030
- const GenericCom = {};
5031
- class GenericPreferences extends _preferences_js__WEBPACK_IMPORTED_MODULE_2__.BasePreferences {
5342
+ function initCom(app) {}
5343
+ class Preferences extends _preferences_js__WEBPACK_IMPORTED_MODULE_1__.BasePreferences {
5032
5344
  async _writeToStorage(prefObj) {
5033
5345
  localStorage.setItem("pdfjs.preferences", JSON.stringify(prefObj));
5034
5346
  }
@@ -5038,50 +5350,58 @@ class GenericPreferences extends _preferences_js__WEBPACK_IMPORTED_MODULE_2__.Ba
5038
5350
  };
5039
5351
  }
5040
5352
  }
5041
- class GenericExternalServices extends _app_js__WEBPACK_IMPORTED_MODULE_0__.DefaultExternalServices {
5042
- static createDownloadManager() {
5043
- return new _download_manager_js__WEBPACK_IMPORTED_MODULE_3__.DownloadManager();
5353
+ class ExternalServices extends _external_services_js__WEBPACK_IMPORTED_MODULE_4__.BaseExternalServices {
5354
+ async createL10n() {
5355
+ return new _genericl10n_js__WEBPACK_IMPORTED_MODULE_2__.GenericL10n(_app_options_js__WEBPACK_IMPORTED_MODULE_0__.AppOptions.get("locale"));
5044
5356
  }
5045
- static createPreferences() {
5046
- return new GenericPreferences();
5357
+ createScripting() {
5358
+ return new _generic_scripting_js__WEBPACK_IMPORTED_MODULE_3__.GenericScripting(_app_options_js__WEBPACK_IMPORTED_MODULE_0__.AppOptions.get("sandboxBundleSrc"));
5047
5359
  }
5048
- static async createL10n() {
5049
- return new _genericl10n_js__WEBPACK_IMPORTED_MODULE_4__.GenericL10n(_app_options_js__WEBPACK_IMPORTED_MODULE_1__.AppOptions.get("locale"));
5050
- }
5051
- static createScripting() {
5052
- return new _generic_scripting_js__WEBPACK_IMPORTED_MODULE_5__.GenericScripting(_app_options_js__WEBPACK_IMPORTED_MODULE_1__.AppOptions.get("sandboxBundleSrc"));
5360
+ }
5361
+ class MLManager {
5362
+ async guess() {
5363
+ return null;
5053
5364
  }
5054
5365
  }
5055
- _app_js__WEBPACK_IMPORTED_MODULE_0__.PDFViewerApplication.externalServices = GenericExternalServices;
5056
5366
 
5057
5367
  __webpack_async_result__();
5058
5368
  } catch(e) { __webpack_async_result__(e); } });
5059
5369
 
5060
5370
  /***/ }),
5061
5371
 
5062
- /***/ 450:
5372
+ /***/ 410:
5063
5373
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
5064
5374
 
5065
5375
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
5066
5376
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5067
5377
  /* harmony export */ GenericL10n: () => (/* binding */ GenericL10n)
5068
5378
  /* harmony export */ });
5069
- /* harmony import */ var fluent_bundle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8759);
5070
- /* harmony import */ var fluent_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8275);
5071
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1869);
5072
- /* harmony import */ var _l10n_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4065);
5379
+ /* harmony import */ var fluent_bundle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(588);
5380
+ /* harmony import */ var fluent_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5273);
5381
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2603);
5382
+ /* harmony import */ var _l10n_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4693);
5073
5383
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__]);
5074
5384
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
5075
5385
 
5076
5386
 
5077
5387
 
5078
5388
 
5389
+ function createBundle(lang, text) {
5390
+ const resource = new fluent_bundle__WEBPACK_IMPORTED_MODULE_0__.FluentResource(text);
5391
+ const bundle = new fluent_bundle__WEBPACK_IMPORTED_MODULE_0__.FluentBundle(lang);
5392
+ const errors = bundle.addResource(resource);
5393
+ if (errors.length) {
5394
+ console.error("L10n errors", errors);
5395
+ }
5396
+ return bundle;
5397
+ }
5079
5398
  class GenericL10n extends _l10n_js__WEBPACK_IMPORTED_MODULE_3__.L10n {
5080
5399
  constructor(lang) {
5081
5400
  super({
5082
5401
  lang
5083
5402
  });
5084
- this._setL10n(new fluent_dom__WEBPACK_IMPORTED_MODULE_1__.DOMLocalization([], GenericL10n.#generateBundles.bind(GenericL10n, "en-us", this.getLanguage())));
5403
+ const generateBundles = !lang ? GenericL10n.#generateBundlesFallback.bind(GenericL10n, this.getLanguage()) : GenericL10n.#generateBundles.bind(GenericL10n, "en-us", this.getLanguage());
5404
+ this._setL10n(new fluent_dom__WEBPACK_IMPORTED_MODULE_1__.DOMLocalization([], generateBundles));
5085
5405
  }
5086
5406
  static async *#generateBundles(defaultLang, baseLang) {
5087
5407
  const {
@@ -5101,6 +5421,9 @@ class GenericL10n extends _l10n_js__WEBPACK_IMPORTED_MODULE_3__.L10n {
5101
5421
  if (bundle) {
5102
5422
  yield bundle;
5103
5423
  }
5424
+ if (lang === "en-us") {
5425
+ yield this.#createBundleFallback(lang);
5426
+ }
5104
5427
  }
5105
5428
  }
5106
5429
  static async #createBundle(lang, baseURL, paths) {
@@ -5110,24 +5433,31 @@ class GenericL10n extends _l10n_js__WEBPACK_IMPORTED_MODULE_3__.L10n {
5110
5433
  }
5111
5434
  const url = new URL(path, baseURL);
5112
5435
  const text = await (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__.fetchData)(url, "text");
5113
- const resource = new fluent_bundle__WEBPACK_IMPORTED_MODULE_0__.FluentResource(text);
5114
- const bundle = new fluent_bundle__WEBPACK_IMPORTED_MODULE_0__.FluentBundle(lang);
5115
- const errors = bundle.addResource(resource);
5116
- if (errors.length) {
5117
- console.error("L10n errors", errors);
5118
- }
5119
- return bundle;
5436
+ return createBundle(lang, text);
5120
5437
  }
5121
5438
  static async #getPaths() {
5122
- const {
5123
- href
5124
- } = document.querySelector(`link[type="application/l10n"]`);
5125
- const paths = await (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__.fetchData)(href, "json");
5439
+ try {
5440
+ const {
5441
+ href
5442
+ } = document.querySelector(`link[type="application/l10n"]`);
5443
+ const paths = await (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__.fetchData)(href, "json");
5444
+ return {
5445
+ baseURL: href.replace(/[^/]*$/, "") || "./",
5446
+ paths
5447
+ };
5448
+ } catch {}
5126
5449
  return {
5127
- baseURL: href.replace(/[^/]*$/, "") || "./",
5128
- paths
5450
+ baseURL: "./",
5451
+ paths: Object.create(null)
5129
5452
  };
5130
5453
  }
5454
+ static async *#generateBundlesFallback(lang) {
5455
+ yield this.#createBundleFallback(lang);
5456
+ }
5457
+ static async #createBundleFallback(lang) {
5458
+ const text = "pdfjs-previous-button =\n .title = Previous Page\npdfjs-previous-button-label = Previous\npdfjs-next-button =\n .title = Next Page\npdfjs-next-button-label = Next\npdfjs-page-input =\n .title = Page\npdfjs-of-pages = of { $pagesCount }\npdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })\npdfjs-zoom-out-button =\n .title = Zoom Out\npdfjs-zoom-out-button-label = Zoom Out\npdfjs-zoom-in-button =\n .title = Zoom In\npdfjs-zoom-in-button-label = Zoom In\npdfjs-zoom-select =\n .title = Zoom\npdfjs-presentation-mode-button =\n .title = Switch to Presentation Mode\npdfjs-presentation-mode-button-label = Presentation Mode\npdfjs-open-file-button =\n .title = Open File\npdfjs-open-file-button-label = Open\npdfjs-print-button =\n .title = Print\npdfjs-print-button-label = Print\npdfjs-save-button =\n .title = Save\npdfjs-save-button-label = Save\npdfjs-download-button =\n .title = Download\npdfjs-download-button-label = Download\npdfjs-bookmark-button =\n .title = Current Page (View URL from Current Page)\npdfjs-bookmark-button-label = Current Page\npdfjs-tools-button =\n .title = Tools\npdfjs-tools-button-label = Tools\npdfjs-first-page-button =\n .title = Go to First Page\npdfjs-first-page-button-label = Go to First Page\npdfjs-last-page-button =\n .title = Go to Last Page\npdfjs-last-page-button-label = Go to Last Page\npdfjs-page-rotate-cw-button =\n .title = Rotate Clockwise\npdfjs-page-rotate-cw-button-label = Rotate Clockwise\npdfjs-page-rotate-ccw-button =\n .title = Rotate Counterclockwise\npdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise\npdfjs-cursor-text-select-tool-button =\n .title = Enable Text Selection Tool\npdfjs-cursor-text-select-tool-button-label = Text Selection Tool\npdfjs-cursor-hand-tool-button =\n .title = Enable Hand Tool\npdfjs-cursor-hand-tool-button-label = Hand Tool\npdfjs-scroll-page-button =\n .title = Use Page Scrolling\npdfjs-scroll-page-button-label = Page Scrolling\npdfjs-scroll-vertical-button =\n .title = Use Vertical Scrolling\npdfjs-scroll-vertical-button-label = Vertical Scrolling\npdfjs-scroll-horizontal-button =\n .title = Use Horizontal Scrolling\npdfjs-scroll-horizontal-button-label = Horizontal Scrolling\npdfjs-scroll-wrapped-button =\n .title = Use Wrapped Scrolling\npdfjs-scroll-wrapped-button-label = Wrapped Scrolling\npdfjs-spread-none-button =\n .title = Do not join page spreads\npdfjs-spread-none-button-label = No Spreads\npdfjs-spread-odd-button =\n .title = Join page spreads starting with odd-numbered pages\npdfjs-spread-odd-button-label = Odd Spreads\npdfjs-spread-even-button =\n .title = Join page spreads starting with even-numbered pages\npdfjs-spread-even-button-label = Even Spreads\npdfjs-document-properties-button =\n .title = Document Properties\u2026\npdfjs-document-properties-button-label = Document Properties\u2026\npdfjs-document-properties-file-name = File name:\npdfjs-document-properties-file-size = File size:\npdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes)\npdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes)\npdfjs-document-properties-title = Title:\npdfjs-document-properties-author = Author:\npdfjs-document-properties-subject = Subject:\npdfjs-document-properties-keywords = Keywords:\npdfjs-document-properties-creation-date = Creation Date:\npdfjs-document-properties-modification-date = Modification Date:\npdfjs-document-properties-date-string = { $date }, { $time }\npdfjs-document-properties-creator = Creator:\npdfjs-document-properties-producer = PDF Producer:\npdfjs-document-properties-version = PDF Version:\npdfjs-document-properties-page-count = Page Count:\npdfjs-document-properties-page-size = Page Size:\npdfjs-document-properties-page-size-unit-inches = in\npdfjs-document-properties-page-size-unit-millimeters = mm\npdfjs-document-properties-page-size-orientation-portrait = portrait\npdfjs-document-properties-page-size-orientation-landscape = landscape\npdfjs-document-properties-page-size-name-a-three = A3\npdfjs-document-properties-page-size-name-a-four = A4\npdfjs-document-properties-page-size-name-letter = Letter\npdfjs-document-properties-page-size-name-legal = Legal\npdfjs-document-properties-page-size-dimension-string = { $width } \xD7 { $height } { $unit } ({ $orientation })\npdfjs-document-properties-page-size-dimension-name-string = { $width } \xD7 { $height } { $unit } ({ $name }, { $orientation })\npdfjs-document-properties-linearized = Fast Web View:\npdfjs-document-properties-linearized-yes = Yes\npdfjs-document-properties-linearized-no = No\npdfjs-document-properties-close-button = Close\npdfjs-print-progress-message = Preparing document for printing\u2026\npdfjs-print-progress-percent = { $progress }%\npdfjs-print-progress-close-button = Cancel\npdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.\npdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.\npdfjs-toggle-sidebar-button =\n .title = Toggle Sidebar\npdfjs-toggle-sidebar-notification-button =\n .title = Toggle Sidebar (document contains outline/attachments/layers)\npdfjs-toggle-sidebar-button-label = Toggle Sidebar\npdfjs-document-outline-button =\n .title = Show Document Outline (double-click to expand/collapse all items)\npdfjs-document-outline-button-label = Document Outline\npdfjs-attachments-button =\n .title = Show Attachments\npdfjs-attachments-button-label = Attachments\npdfjs-layers-button =\n .title = Show Layers (double-click to reset all layers to the default state)\npdfjs-layers-button-label = Layers\npdfjs-thumbs-button =\n .title = Show Thumbnails\npdfjs-thumbs-button-label = Thumbnails\npdfjs-current-outline-item-button =\n .title = Find Current Outline Item\npdfjs-current-outline-item-button-label = Current Outline Item\npdfjs-findbar-button =\n .title = Find in Document\npdfjs-findbar-button-label = Find\npdfjs-additional-layers = Additional Layers\npdfjs-thumb-page-title =\n .title = Page { $page }\npdfjs-thumb-page-canvas =\n .aria-label = Thumbnail of Page { $page }\npdfjs-find-input =\n .title = Find\n .placeholder = Find in document\u2026\npdfjs-find-previous-button =\n .title = Find the previous occurrence of the phrase\npdfjs-find-previous-button-label = Previous\npdfjs-find-next-button =\n .title = Find the next occurrence of the phrase\npdfjs-find-next-button-label = Next\npdfjs-find-highlight-checkbox = Highlight All\npdfjs-find-match-case-checkbox-label = Match Case\npdfjs-find-match-diacritics-checkbox-label = Match Diacritics\npdfjs-find-entire-word-checkbox-label = Whole Words\npdfjs-find-reached-top = Reached top of document, continued from bottom\npdfjs-find-reached-bottom = Reached end of document, continued from top\npdfjs-find-match-count =\n { $total ->\n [one] { $current } of { $total } match\n *[other] { $current } of { $total } matches\n }\npdfjs-find-match-count-limit =\n { $limit ->\n [one] More than { $limit } match\n *[other] More than { $limit } matches\n }\npdfjs-find-not-found = Phrase not found\npdfjs-page-scale-width = Page Width\npdfjs-page-scale-fit = Page Fit\npdfjs-page-scale-auto = Automatic Zoom\npdfjs-page-scale-actual = Actual Size\npdfjs-page-scale-percent = { $scale }%\npdfjs-page-landmark =\n .aria-label = Page { $page }\npdfjs-loading-error = An error occurred while loading the PDF.\npdfjs-invalid-file-error = Invalid or corrupted PDF file.\npdfjs-missing-file-error = Missing PDF file.\npdfjs-unexpected-response-error = Unexpected server response.\npdfjs-rendering-error = An error occurred while rendering the page.\npdfjs-annotation-date-string = { $date }, { $time }\npdfjs-text-annotation-type =\n .alt = [{ $type } Annotation]\npdfjs-password-label = Enter the password to open this PDF file.\npdfjs-password-invalid = Invalid password. Please try again.\npdfjs-password-ok-button = OK\npdfjs-password-cancel-button = Cancel\npdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.\npdfjs-editor-free-text-button =\n .title = Text\npdfjs-editor-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\npdfjs-editor-ink-button-label = Draw\npdfjs-editor-stamp-button =\n .title = Add or edit images\npdfjs-editor-stamp-button-label = Add or edit images\npdfjs-editor-highlight-button =\n .title = Highlight\npdfjs-editor-highlight-button-label = Highlight\npdfjs-highlight-floating-button1 =\n .title = Highlight\n .aria-label = Highlight\npdfjs-highlight-floating-button-label = Highlight\npdfjs-editor-remove-ink-button =\n .title = Remove drawing\npdfjs-editor-remove-freetext-button =\n .title = Remove text\npdfjs-editor-remove-stamp-button =\n .title = Remove image\npdfjs-editor-remove-highlight-button =\n .title = Remove highlight\npdfjs-editor-free-text-color-input = Color\npdfjs-editor-free-text-size-input = Size\npdfjs-editor-ink-color-input = Color\npdfjs-editor-ink-thickness-input = Thickness\npdfjs-editor-ink-opacity-input = Opacity\npdfjs-editor-stamp-add-image-button =\n .title = Add image\npdfjs-editor-stamp-add-image-button-label = Add image\npdfjs-editor-free-highlight-thickness-input = Thickness\npdfjs-editor-free-highlight-thickness-title =\n .title = Change thickness when highlighting items other than text\npdfjs-free-text =\n .aria-label = Text Editor\npdfjs-free-text-default-content = Start typing\u2026\npdfjs-ink =\n .aria-label = Draw Editor\npdfjs-ink-canvas =\n .aria-label = User-created image\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button-label = Edit alt text\npdfjs-editor-alt-text-dialog-label = Choose an option\npdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can\u2019t see the image or when it doesn\u2019t load.\npdfjs-editor-alt-text-add-description-label = Add a description\npdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.\npdfjs-editor-alt-text-mark-decorative-label = Mark as decorative\npdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.\npdfjs-editor-alt-text-cancel-button = Cancel\npdfjs-editor-alt-text-save-button = Save\npdfjs-editor-alt-text-decorative-tooltip = Marked as decorative\npdfjs-editor-alt-text-textarea =\n .placeholder = For example, \u201CA young man sits down at a table to eat a meal\u201D\npdfjs-editor-resizer-label-top-left = Top left corner \u2014 resize\npdfjs-editor-resizer-label-top-middle = Top middle \u2014 resize\npdfjs-editor-resizer-label-top-right = Top right corner \u2014 resize\npdfjs-editor-resizer-label-middle-right = Middle right \u2014 resize\npdfjs-editor-resizer-label-bottom-right = Bottom right corner \u2014 resize\npdfjs-editor-resizer-label-bottom-middle = Bottom middle \u2014 resize\npdfjs-editor-resizer-label-bottom-left = Bottom left corner \u2014 resize\npdfjs-editor-resizer-label-middle-left = Middle left \u2014 resize\npdfjs-editor-highlight-colorpicker-label = Highlight color\npdfjs-editor-colorpicker-button =\n .title = Change color\npdfjs-editor-colorpicker-dropdown =\n .aria-label = Color choices\npdfjs-editor-colorpicker-yellow =\n .title = Yellow\npdfjs-editor-colorpicker-green =\n .title = Green\npdfjs-editor-colorpicker-blue =\n .title = Blue\npdfjs-editor-colorpicker-pink =\n .title = Pink\npdfjs-editor-colorpicker-red =\n .title = Red\npdfjs-editor-highlight-show-all-button-label = Show all\npdfjs-editor-highlight-show-all-button =\n .title = Show all";
5459
+ return createBundle(lang, text);
5460
+ }
5131
5461
  }
5132
5462
 
5133
5463
  __webpack_async_result__();
@@ -5135,7 +5465,7 @@ __webpack_async_result__();
5135
5465
 
5136
5466
  /***/ }),
5137
5467
 
5138
- /***/ 6143:
5468
+ /***/ 2640:
5139
5469
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
5140
5470
 
5141
5471
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -5235,12 +5565,13 @@ class GrabToPan {
5235
5565
 
5236
5566
  /***/ }),
5237
5567
 
5238
- /***/ 4065:
5568
+ /***/ 4693:
5239
5569
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
5240
5570
 
5241
5571
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5242
5572
  /* harmony export */ L10n: () => (/* binding */ L10n)
5243
5573
  /* harmony export */ });
5574
+ /* unused harmony export GenericL10n */
5244
5575
  class L10n {
5245
5576
  #dir;
5246
5577
  #lang;
@@ -5313,75 +5644,12 @@ class L10n {
5313
5644
  return ["ar", "he", "fa", "ps", "ur"].includes(shortCode);
5314
5645
  }
5315
5646
  }
5647
+ const GenericL10n = null;
5316
5648
 
5317
5649
 
5318
5650
  /***/ }),
5319
5651
 
5320
- /***/ 7910:
5321
- /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
5322
-
5323
- __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
5324
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5325
- /* harmony export */ NullL10n: () => (/* binding */ NullL10n)
5326
- /* harmony export */ });
5327
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
5328
- /* harmony import */ var fluent_bundle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8759);
5329
- /* harmony import */ var fluent_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8275);
5330
- /* harmony import */ var _l10n_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4065);
5331
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
5332
- pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
5333
-
5334
-
5335
-
5336
-
5337
- class ConstL10n extends _l10n_js__WEBPACK_IMPORTED_MODULE_3__.L10n {
5338
- constructor(lang) {
5339
- super({
5340
- lang
5341
- });
5342
- this._setL10n(new fluent_dom__WEBPACK_IMPORTED_MODULE_2__.DOMLocalization([], ConstL10n.#generateBundles.bind(ConstL10n, lang)));
5343
- }
5344
- static async *#generateBundles(lang) {
5345
- const text = 'pdfjs-previous-button =\n .title = Previous Page\npdfjs-previous-button-label = Previous\npdfjs-next-button =\n .title = Next Page\npdfjs-next-button-label = Next\npdfjs-page-input =\n .title = Page\npdfjs-of-pages = of { $pagesCount }\npdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })\npdfjs-zoom-out-button =\n .title = Zoom Out\npdfjs-zoom-out-button-label = Zoom Out\npdfjs-zoom-in-button =\n .title = Zoom In\npdfjs-zoom-in-button-label = Zoom In\npdfjs-zoom-select =\n .title = Zoom\npdfjs-presentation-mode-button =\n .title = Switch to Presentation Mode\npdfjs-presentation-mode-button-label = Presentation Mode\npdfjs-open-file-button =\n .title = Open File\npdfjs-open-file-button-label = Open\npdfjs-print-button =\n .title = Print\npdfjs-print-button-label = Print\npdfjs-save-button =\n .title = Save\npdfjs-save-button-label = Save\npdfjs-download-button =\n .title = Download\npdfjs-download-button-label = Download\npdfjs-bookmark-button =\n .title = Current Page (View URL from Current Page)\npdfjs-bookmark-button-label = Current Page\npdfjs-open-in-app-button =\n .title = Open in app\npdfjs-open-in-app-button-label = Open in app\npdfjs-tools-button =\n .title = Tools\npdfjs-tools-button-label = Tools\npdfjs-first-page-button =\n .title = Go to First Page\npdfjs-first-page-button-label = Go to First Page\npdfjs-last-page-button =\n .title = Go to Last Page\npdfjs-last-page-button-label = Go to Last Page\npdfjs-page-rotate-cw-button =\n .title = Rotate Clockwise\npdfjs-page-rotate-cw-button-label = Rotate Clockwise\npdfjs-page-rotate-ccw-button =\n .title = Rotate Counterclockwise\npdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise\npdfjs-cursor-text-select-tool-button =\n .title = Enable Text Selection Tool\npdfjs-cursor-text-select-tool-button-label = Text Selection Tool\npdfjs-cursor-hand-tool-button =\n .title = Enable Hand Tool\npdfjs-cursor-hand-tool-button-label = Hand Tool\npdfjs-scroll-page-button =\n .title = Use Page Scrolling\npdfjs-scroll-page-button-label = Page Scrolling\npdfjs-scroll-vertical-button =\n .title = Use Vertical Scrolling\npdfjs-scroll-vertical-button-label = Vertical Scrolling\npdfjs-scroll-horizontal-button =\n .title = Use Horizontal Scrolling\npdfjs-scroll-horizontal-button-label = Horizontal Scrolling\npdfjs-scroll-wrapped-button =\n .title = Use Wrapped Scrolling\npdfjs-scroll-wrapped-button-label = Wrapped Scrolling\npdfjs-spread-none-button =\n .title = Do not join page spreads\npdfjs-spread-none-button-label = No Spreads\npdfjs-spread-odd-button =\n .title = Join page spreads starting with odd-numbered pages\npdfjs-spread-odd-button-label = Odd Spreads\npdfjs-spread-even-button =\n .title = Join page spreads starting with even-numbered pages\npdfjs-spread-even-button-label = Even Spreads\npdfjs-document-properties-button =\n .title = Document Properties\u2026\npdfjs-document-properties-button-label = Document Properties\u2026\npdfjs-document-properties-file-name = File name:\npdfjs-document-properties-file-size = File size:\npdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes)\npdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes)\npdfjs-document-properties-title = Title:\npdfjs-document-properties-author = Author:\npdfjs-document-properties-subject = Subject:\npdfjs-document-properties-keywords = Keywords:\npdfjs-document-properties-creation-date = Creation Date:\npdfjs-document-properties-modification-date = Modification Date:\npdfjs-document-properties-date-string = { $date }, { $time }\npdfjs-document-properties-creator = Creator:\npdfjs-document-properties-producer = PDF Producer:\npdfjs-document-properties-version = PDF Version:\npdfjs-document-properties-page-count = Page Count:\npdfjs-document-properties-page-size = Page Size:\npdfjs-document-properties-page-size-unit-inches = in\npdfjs-document-properties-page-size-unit-millimeters = mm\npdfjs-document-properties-page-size-orientation-portrait = portrait\npdfjs-document-properties-page-size-orientation-landscape = landscape\npdfjs-document-properties-page-size-name-a-three = A3\npdfjs-document-properties-page-size-name-a-four = A4\npdfjs-document-properties-page-size-name-letter = Letter\npdfjs-document-properties-page-size-name-legal = Legal\npdfjs-document-properties-page-size-dimension-string = { $width } \xD7 { $height } { $unit } ({ $orientation })\npdfjs-document-properties-page-size-dimension-name-string = { $width } \xD7 { $height } { $unit } ({ $name }, { $orientation })\npdfjs-document-properties-linearized = Fast Web View:\npdfjs-document-properties-linearized-yes = Yes\npdfjs-document-properties-linearized-no = No\npdfjs-document-properties-close-button = Close\npdfjs-print-progress-message = Preparing document for printing\u2026\npdfjs-print-progress-percent = { $progress }%\npdfjs-print-progress-close-button = Cancel\npdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.\npdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.\npdfjs-toggle-sidebar-button =\n .title = Toggle Sidebar\npdfjs-toggle-sidebar-notification-button =\n .title = Toggle Sidebar (document contains outline/attachments/layers)\npdfjs-toggle-sidebar-button-label = Toggle Sidebar\npdfjs-document-outline-button =\n .title = Show Document Outline (double-click to expand/collapse all items)\npdfjs-document-outline-button-label = Document Outline\npdfjs-attachments-button =\n .title = Show Attachments\npdfjs-attachments-button-label = Attachments\npdfjs-layers-button =\n .title = Show Layers (double-click to reset all layers to the default state)\npdfjs-layers-button-label = Layers\npdfjs-thumbs-button =\n .title = Show Thumbnails\npdfjs-thumbs-button-label = Thumbnails\npdfjs-current-outline-item-button =\n .title = Find Current Outline Item\npdfjs-current-outline-item-button-label = Current Outline Item\npdfjs-findbar-button =\n .title = Find in Document\npdfjs-findbar-button-label = Find\npdfjs-additional-layers = Additional Layers\npdfjs-thumb-page-title =\n .title = Page { $page }\npdfjs-thumb-page-canvas =\n .aria-label = Thumbnail of Page { $page }\npdfjs-find-input =\n .title = Find\n .placeholder = Find in document\u2026\npdfjs-find-previous-button =\n .title = Find the previous occurrence of the phrase\npdfjs-find-previous-button-label = Previous\npdfjs-find-next-button =\n .title = Find the next occurrence of the phrase\npdfjs-find-next-button-label = Next\npdfjs-find-highlight-checkbox = Highlight All\npdfjs-find-match-case-checkbox-label = Match Case\npdfjs-find-match-diacritics-checkbox-label = Match Diacritics\npdfjs-find-entire-word-checkbox-label = Whole Words\npdfjs-find-reached-top = Reached top of document, continued from bottom\npdfjs-find-reached-bottom = Reached end of document, continued from top\npdfjs-find-match-count =\n { $total ->\n [one] { $current } of { $total } match\n *[other] { $current } of { $total } matches\n }\npdfjs-find-match-count-limit =\n { $limit ->\n [one] More than { $limit } match\n *[other] More than { $limit } matches\n }\npdfjs-find-not-found = Phrase not found\npdfjs-page-scale-width = Page Width\npdfjs-page-scale-fit = Page Fit\npdfjs-page-scale-auto = Automatic Zoom\npdfjs-page-scale-actual = Actual Size\npdfjs-page-scale-percent = { $scale }%\npdfjs-page-landmark =\n .aria-label = Page { $page }\npdfjs-loading-error = An error occurred while loading the PDF.\npdfjs-invalid-file-error = Invalid or corrupted PDF file.\npdfjs-missing-file-error = Missing PDF file.\npdfjs-unexpected-response-error = Unexpected server response.\npdfjs-rendering-error = An error occurred while rendering the page.\npdfjs-annotation-date-string = { $date }, { $time }\npdfjs-text-annotation-type =\n .alt = [{ $type } Annotation]\npdfjs-password-label = Enter the password to open this PDF file.\npdfjs-password-invalid = Invalid password. Please try again.\npdfjs-password-ok-button = OK\npdfjs-password-cancel-button = Cancel\npdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.\npdfjs-editor-free-text-button =\n .title = Text\npdfjs-editor-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\npdfjs-editor-ink-button-label = Draw\npdfjs-editor-stamp-button =\n .title = Add or edit images\npdfjs-editor-stamp-button-label = Add or edit images\npdfjs-editor-highlight-button =\n .title = Highlight\npdfjs-editor-highlight-button-label = Highlight\npdfjs-editor-remove-ink-button =\n .title = Remove drawing\npdfjs-editor-remove-freetext-button =\n .title = Remove text\npdfjs-editor-remove-stamp-button =\n .title = Remove image\npdfjs-editor-remove-highlight-button =\n .title = Remove highlight\npdfjs-editor-free-text-color-input = Color\npdfjs-editor-free-text-size-input = Size\npdfjs-editor-ink-color-input = Color\npdfjs-editor-ink-thickness-input = Thickness\npdfjs-editor-ink-opacity-input = Opacity\npdfjs-editor-stamp-add-image-button =\n .title = Add image\npdfjs-editor-stamp-add-image-button-label = Add image\npdfjs-free-text =\n .aria-label = Text Editor\npdfjs-free-text-default-content = Start typing\u2026\npdfjs-ink =\n .aria-label = Draw Editor\npdfjs-ink-canvas =\n .aria-label = User-created image\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button-label = Edit alt text\npdfjs-editor-alt-text-dialog-label = Choose an option\npdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can\u2019t see the image or when it doesn\u2019t load.\npdfjs-editor-alt-text-add-description-label = Add a description\npdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.\npdfjs-editor-alt-text-mark-decorative-label = Mark as decorative\npdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.\npdfjs-editor-alt-text-cancel-button = Cancel\npdfjs-editor-alt-text-save-button = Save\npdfjs-editor-alt-text-decorative-tooltip = Marked as decorative\npdfjs-editor-alt-text-textarea =\n .placeholder = For example, \u201CA young man sits down at a table to eat a meal\u201D\npdfjs-editor-resizer-label-top-left = Top left corner \u2014 resize\npdfjs-editor-resizer-label-top-middle = Top middle \u2014 resize\npdfjs-editor-resizer-label-top-right = Top right corner \u2014 resize\npdfjs-editor-resizer-label-middle-right = Middle right \u2014 resize\npdfjs-editor-resizer-label-bottom-right = Bottom right corner \u2014 resize\npdfjs-editor-resizer-label-bottom-middle = Bottom middle \u2014 resize\npdfjs-editor-resizer-label-bottom-left = Bottom left corner \u2014 resize\npdfjs-editor-resizer-label-middle-left = Middle left \u2014 resize\npdfjs-editor-highlight-colorpicker-label = Highlight color\npdfjs-editor-colorpicker-button =\n .title = Change color\npdfjs-editor-colorpicker-dropdown =\n .aria-label = Color choices\npdfjs-editor-colorpicker-yellow =\n .title = Yellow\npdfjs-editor-colorpicker-green =\n .title = Green\npdfjs-editor-colorpicker-blue =\n .title = Blue\npdfjs-editor-colorpicker-pink =\n .title = Pink\npdfjs-editor-colorpicker-red =\n .title = Red';
5346
- const resource = new fluent_bundle__WEBPACK_IMPORTED_MODULE_1__.FluentResource(text);
5347
- const bundle = new fluent_bundle__WEBPACK_IMPORTED_MODULE_1__.FluentBundle(lang);
5348
- const errors = bundle.addResource(resource);
5349
- if (errors.length) {
5350
- console.error("L10n errors", errors);
5351
- }
5352
- yield bundle;
5353
- }
5354
- static get instance() {
5355
- return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "instance", new ConstL10n("en-us"));
5356
- }
5357
- }
5358
- const NullL10n = {
5359
- getLanguage() {
5360
- return ConstL10n.instance.getLanguage();
5361
- },
5362
- getDirection() {
5363
- return ConstL10n.instance.getDirection();
5364
- },
5365
- async get(ids, args = null, fallback) {
5366
- return ConstL10n.instance.get(ids, args, fallback);
5367
- },
5368
- async translate(element) {
5369
- return ConstL10n.instance.translate(element);
5370
- },
5371
- pause() {
5372
- return ConstL10n.instance.pause();
5373
- },
5374
- resume() {
5375
- return ConstL10n.instance.resume();
5376
- }
5377
- };
5378
-
5379
- __webpack_async_result__();
5380
- } catch(e) { __webpack_async_result__(e); } });
5381
-
5382
- /***/ }),
5383
-
5384
- /***/ 1996:
5652
+ /***/ 6174:
5385
5653
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
5386
5654
 
5387
5655
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -5437,14 +5705,14 @@ class OverlayManager {
5437
5705
 
5438
5706
  /***/ }),
5439
5707
 
5440
- /***/ 6329:
5708
+ /***/ 2690:
5441
5709
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
5442
5710
 
5443
5711
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
5444
5712
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5445
5713
  /* harmony export */ PasswordPrompt: () => (/* binding */ PasswordPrompt)
5446
5714
  /* harmony export */ });
5447
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
5715
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
5448
5716
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
5449
5717
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
5450
5718
 
@@ -5471,10 +5739,8 @@ class PasswordPrompt {
5471
5739
  this.dialog.addEventListener("close", this.#cancel.bind(this));
5472
5740
  }
5473
5741
  async open() {
5474
- if (this.#activeCapability) {
5475
- await this.#activeCapability.promise;
5476
- }
5477
- this.#activeCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability();
5742
+ await this.#activeCapability?.promise;
5743
+ this.#activeCapability = Promise.withResolvers();
5478
5744
  try {
5479
5745
  await this.overlayManager.open(this.dialog);
5480
5746
  } catch (ex) {
@@ -5525,22 +5791,22 @@ __webpack_async_result__();
5525
5791
 
5526
5792
  /***/ }),
5527
5793
 
5528
- /***/ 716:
5794
+ /***/ 9251:
5529
5795
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
5530
5796
 
5531
5797
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
5532
5798
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5533
5799
  /* harmony export */ PDFAttachmentViewer: () => (/* binding */ PDFAttachmentViewer)
5534
5800
  /* harmony export */ });
5535
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
5536
- /* harmony import */ var _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9415);
5537
- /* harmony import */ var _event_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6554);
5538
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
5539
- pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
5801
+ /* harmony import */ var _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2961);
5802
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2603);
5803
+ /* harmony import */ var _event_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5656);
5804
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__]);
5805
+ pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
5540
5806
 
5541
5807
 
5542
5808
 
5543
- class PDFAttachmentViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_1__.BaseTreeViewer {
5809
+ class PDFAttachmentViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__.BaseTreeViewer {
5544
5810
  constructor(options) {
5545
5811
  super(options);
5546
5812
  this.downloadManager = options.downloadManager;
@@ -5550,7 +5816,7 @@ class PDFAttachmentViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_
5550
5816
  super.reset();
5551
5817
  this._attachments = null;
5552
5818
  if (!keepRenderedCapability) {
5553
- this._renderedCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability();
5819
+ this._renderedCapability = Promise.withResolvers();
5554
5820
  }
5555
5821
  this._pendingDispatchEvent = false;
5556
5822
  }
@@ -5599,7 +5865,7 @@ class PDFAttachmentViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_
5599
5865
  for (const name in attachments) {
5600
5866
  const item = attachments[name];
5601
5867
  const content = item.content,
5602
- filename = (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.getFilenameFromUrl)(item.filename, true);
5868
+ filename = (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.getFilenameFromUrl)(item.filename, true);
5603
5869
  const div = document.createElement("div");
5604
5870
  div.className = "treeItem";
5605
5871
  const element = document.createElement("a");
@@ -5646,16 +5912,16 @@ __webpack_async_result__();
5646
5912
 
5647
5913
  /***/ }),
5648
5914
 
5649
- /***/ 3611:
5915
+ /***/ 5993:
5650
5916
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
5651
5917
 
5652
5918
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
5653
5919
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5654
5920
  /* harmony export */ PDFCursorTools: () => (/* binding */ PDFCursorTools)
5655
5921
  /* harmony export */ });
5656
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
5657
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4927);
5658
- /* harmony import */ var _grab_to_pan_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6143);
5922
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
5923
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
5924
+ /* harmony import */ var _grab_to_pan_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2640);
5659
5925
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
5660
5926
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
5661
5927
 
@@ -5773,15 +6039,15 @@ __webpack_async_result__();
5773
6039
 
5774
6040
  /***/ }),
5775
6041
 
5776
- /***/ 6312:
6042
+ /***/ 164:
5777
6043
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
5778
6044
 
5779
6045
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
5780
6046
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5781
6047
  /* harmony export */ PDFDocumentProperties: () => (/* binding */ PDFDocumentProperties)
5782
6048
  /* harmony export */ });
5783
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
5784
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1869);
6049
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
6050
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2603);
5785
6051
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__]);
5786
6052
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
5787
6053
 
@@ -5886,7 +6152,7 @@ class PDFDocumentProperties {
5886
6152
  #reset() {
5887
6153
  this.pdfDocument = null;
5888
6154
  this.#fieldData = null;
5889
- this._dataAvailableCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PromiseCapability();
6155
+ this._dataAvailableCapability = Promise.withResolvers();
5890
6156
  this._currentPageNumber = 1;
5891
6157
  this._pagesRotation = 0;
5892
6158
  }
@@ -5989,17 +6255,14 @@ __webpack_async_result__();
5989
6255
 
5990
6256
  /***/ }),
5991
6257
 
5992
- /***/ 1795:
5993
- /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
6258
+ /***/ 2226:
6259
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
5994
6260
 
5995
- __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
5996
6261
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5997
6262
  /* harmony export */ PDFFindBar: () => (/* binding */ PDFFindBar)
5998
6263
  /* harmony export */ });
5999
- /* harmony import */ var _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3557);
6000
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4927);
6001
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_0__]);
6002
- _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
6264
+ /* harmony import */ var _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9814);
6265
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
6003
6266
 
6004
6267
 
6005
6268
  const MATCHES_COUNT_LIMIT = 1000;
@@ -6164,25 +6427,96 @@ class PDFFindBar {
6164
6427
  }
6165
6428
  }
6166
6429
 
6167
- __webpack_async_result__();
6168
- } catch(e) { __webpack_async_result__(e); } });
6169
6430
 
6170
6431
  /***/ }),
6171
6432
 
6172
- /***/ 3557:
6173
- /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
6433
+ /***/ 9814:
6434
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
6174
6435
 
6175
- __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
6176
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6177
- /* harmony export */ FindState: () => (/* binding */ FindState),
6178
- /* harmony export */ PDFFindController: () => (/* binding */ PDFFindController)
6179
- /* harmony export */ });
6180
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
6181
- /* harmony import */ var _pdf_find_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6839);
6182
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1869);
6183
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__]);
6184
- pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
6185
6436
 
6437
+ // EXPORTS
6438
+ __webpack_require__.d(__webpack_exports__, {
6439
+ FindState: () => (/* binding */ FindState),
6440
+ PDFFindController: () => (/* binding */ PDFFindController)
6441
+ });
6442
+
6443
+ // EXTERNAL MODULE: ./web/ui_utils.js
6444
+ var ui_utils = __webpack_require__(7256);
6445
+ ;// CONCATENATED MODULE: ./web/pdf_find_utils.js
6446
+ const CharacterType = {
6447
+ SPACE: 0,
6448
+ ALPHA_LETTER: 1,
6449
+ PUNCT: 2,
6450
+ HAN_LETTER: 3,
6451
+ KATAKANA_LETTER: 4,
6452
+ HIRAGANA_LETTER: 5,
6453
+ HALFWIDTH_KATAKANA_LETTER: 6,
6454
+ THAI_LETTER: 7
6455
+ };
6456
+ function isAlphabeticalScript(charCode) {
6457
+ return charCode < 0x2e80;
6458
+ }
6459
+ function isAscii(charCode) {
6460
+ return (charCode & 0xff80) === 0;
6461
+ }
6462
+ function isAsciiAlpha(charCode) {
6463
+ return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a;
6464
+ }
6465
+ function isAsciiDigit(charCode) {
6466
+ return charCode >= 0x30 && charCode <= 0x39;
6467
+ }
6468
+ function isAsciiSpace(charCode) {
6469
+ return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a;
6470
+ }
6471
+ function isHan(charCode) {
6472
+ return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff;
6473
+ }
6474
+ function isKatakana(charCode) {
6475
+ return charCode >= 0x30a0 && charCode <= 0x30ff;
6476
+ }
6477
+ function isHiragana(charCode) {
6478
+ return charCode >= 0x3040 && charCode <= 0x309f;
6479
+ }
6480
+ function isHalfwidthKatakana(charCode) {
6481
+ return charCode >= 0xff60 && charCode <= 0xff9f;
6482
+ }
6483
+ function isThai(charCode) {
6484
+ return (charCode & 0xff80) === 0x0e00;
6485
+ }
6486
+ function getCharacterType(charCode) {
6487
+ if (isAlphabeticalScript(charCode)) {
6488
+ if (isAscii(charCode)) {
6489
+ if (isAsciiSpace(charCode)) {
6490
+ return CharacterType.SPACE;
6491
+ } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) {
6492
+ return CharacterType.ALPHA_LETTER;
6493
+ }
6494
+ return CharacterType.PUNCT;
6495
+ } else if (isThai(charCode)) {
6496
+ return CharacterType.THAI_LETTER;
6497
+ } else if (charCode === 0xa0) {
6498
+ return CharacterType.SPACE;
6499
+ }
6500
+ return CharacterType.ALPHA_LETTER;
6501
+ }
6502
+ if (isHan(charCode)) {
6503
+ return CharacterType.HAN_LETTER;
6504
+ } else if (isKatakana(charCode)) {
6505
+ return CharacterType.KATAKANA_LETTER;
6506
+ } else if (isHiragana(charCode)) {
6507
+ return CharacterType.HIRAGANA_LETTER;
6508
+ } else if (isHalfwidthKatakana(charCode)) {
6509
+ return CharacterType.HALFWIDTH_KATAKANA_LETTER;
6510
+ }
6511
+ return CharacterType.ALPHA_LETTER;
6512
+ }
6513
+ let NormalizeWithNFKC;
6514
+ function getNormalizeWithNFKC() {
6515
+ NormalizeWithNFKC ||= ` ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`;
6516
+ return NormalizeWithNFKC;
6517
+ }
6518
+
6519
+ ;// CONCATENATED MODULE: ./web/pdf_find_controller.js
6186
6520
 
6187
6521
 
6188
6522
  const FindState = {
@@ -6243,7 +6577,7 @@ function normalize(text) {
6243
6577
  normalizationRegex = withSyllablesRegExp;
6244
6578
  } else {
6245
6579
  const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join("");
6246
- const toNormalizeWithNFKC = (0,_pdf_find_utils_js__WEBPACK_IMPORTED_MODULE_1__.getNormalizeWithNFKC)();
6580
+ const toNormalizeWithNFKC = getNormalizeWithNFKC();
6247
6581
  const CJK = "(?:\\p{Ideographic}|[\u3040-\u30FF])";
6248
6582
  const HKDiacritics = "(?:\u3099|\u309A)";
6249
6583
  const regexp = `([${replace}])|([${toNormalizeWithNFKC}])|(${HKDiacritics}\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(${CJK}\\n)|(\\n)`;
@@ -6369,11 +6703,11 @@ function getOriginalIndex(diffs, pos, len) {
6369
6703
  }
6370
6704
  const start = pos;
6371
6705
  const end = pos + len - 1;
6372
- let i = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.binarySearchFirstItem)(diffs, x => x[0] >= start);
6706
+ let i = (0,ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= start);
6373
6707
  if (diffs[i][0] > start) {
6374
6708
  --i;
6375
6709
  }
6376
- let j = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.binarySearchFirstItem)(diffs, x => x[0] >= end, i);
6710
+ let j = (0,ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= end, i);
6377
6711
  if (diffs[j][0] > end) {
6378
6712
  --j;
6379
6713
  }
@@ -6492,7 +6826,7 @@ class PDFFindController {
6492
6826
  top: MATCH_SCROLL_OFFSET_TOP,
6493
6827
  left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT
6494
6828
  };
6495
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.scrollIntoView)(element, spot, true);
6829
+ (0,ui_utils.scrollIntoView)(element, spot, true);
6496
6830
  }
6497
6831
  #reset() {
6498
6832
  this._highlightMatches = false;
@@ -6522,7 +6856,7 @@ class PDFFindController {
6522
6856
  this._dirtyMatch = false;
6523
6857
  clearTimeout(this._findTimeout);
6524
6858
  this._findTimeout = null;
6525
- this._firstPageCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__.PromiseCapability();
6859
+ this._firstPageCapability = Promise.withResolvers();
6526
6860
  }
6527
6861
  get #query() {
6528
6862
  const {
@@ -6567,7 +6901,7 @@ class PDFFindController {
6567
6901
  if (match) {
6568
6902
  const first = content.charCodeAt(startIdx);
6569
6903
  const limit = match[1].charCodeAt(0);
6570
- if ((0,_pdf_find_utils_js__WEBPACK_IMPORTED_MODULE_1__.getCharacterType)(first) === (0,_pdf_find_utils_js__WEBPACK_IMPORTED_MODULE_1__.getCharacterType)(limit)) {
6904
+ if (getCharacterType(first) === getCharacterType(limit)) {
6571
6905
  return false;
6572
6906
  }
6573
6907
  }
@@ -6575,7 +6909,7 @@ class PDFFindController {
6575
6909
  if (match) {
6576
6910
  const last = content.charCodeAt(startIdx + length - 1);
6577
6911
  const limit = match[1].charCodeAt(0);
6578
- if ((0,_pdf_find_utils_js__WEBPACK_IMPORTED_MODULE_1__.getCharacterType)(last) === (0,_pdf_find_utils_js__WEBPACK_IMPORTED_MODULE_1__.getCharacterType)(limit)) {
6912
+ if (getCharacterType(last) === getCharacterType(limit)) {
6579
6913
  return false;
6580
6914
  }
6581
6915
  }
@@ -6685,17 +7019,18 @@ class PDFFindController {
6685
7019
  if (this._extractTextPromises.length > 0) {
6686
7020
  return;
6687
7021
  }
6688
- let promise = Promise.resolve();
7022
+ let deferred = Promise.resolve();
6689
7023
  const textOptions = {
6690
7024
  disableNormalization: true
6691
7025
  };
6692
7026
  for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {
6693
- const extractTextCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_2__.PromiseCapability();
6694
- this._extractTextPromises[i] = extractTextCapability.promise;
6695
- promise = promise.then(() => {
6696
- return this._pdfDocument.getPage(i + 1).then(pdfPage => {
6697
- return pdfPage.getTextContent(textOptions);
6698
- }).then(textContent => {
7027
+ const {
7028
+ promise,
7029
+ resolve
7030
+ } = Promise.withResolvers();
7031
+ this._extractTextPromises[i] = promise;
7032
+ deferred = deferred.then(() => {
7033
+ return this._pdfDocument.getPage(i + 1).then(pdfPage => pdfPage.getTextContent(textOptions)).then(textContent => {
6699
7034
  const strBuf = [];
6700
7035
  for (const textItem of textContent.items) {
6701
7036
  strBuf.push(textItem.str);
@@ -6704,13 +7039,13 @@ class PDFFindController {
6704
7039
  }
6705
7040
  }
6706
7041
  [this._pageContents[i], this._pageDiffs[i], this._hasDiacritics[i]] = normalize(strBuf.join(""));
6707
- extractTextCapability.resolve();
7042
+ resolve();
6708
7043
  }, reason => {
6709
7044
  console.error(`Unable to get text content for page ${i + 1}`, reason);
6710
7045
  this._pageContents[i] = "";
6711
7046
  this._pageDiffs[i] = null;
6712
7047
  this._hasDiacritics[i] = false;
6713
- extractTextCapability.resolve();
7048
+ resolve();
6714
7049
  });
6715
7050
  });
6716
7051
  }
@@ -6902,104 +7237,18 @@ class PDFFindController {
6902
7237
  }
6903
7238
  }
6904
7239
 
6905
- __webpack_async_result__();
6906
- } catch(e) { __webpack_async_result__(e); } });
6907
-
6908
- /***/ }),
6909
-
6910
- /***/ 6839:
6911
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
6912
-
6913
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6914
- /* harmony export */ getCharacterType: () => (/* binding */ getCharacterType),
6915
- /* harmony export */ getNormalizeWithNFKC: () => (/* binding */ getNormalizeWithNFKC)
6916
- /* harmony export */ });
6917
- /* unused harmony export CharacterType */
6918
- const CharacterType = {
6919
- SPACE: 0,
6920
- ALPHA_LETTER: 1,
6921
- PUNCT: 2,
6922
- HAN_LETTER: 3,
6923
- KATAKANA_LETTER: 4,
6924
- HIRAGANA_LETTER: 5,
6925
- HALFWIDTH_KATAKANA_LETTER: 6,
6926
- THAI_LETTER: 7
6927
- };
6928
- function isAlphabeticalScript(charCode) {
6929
- return charCode < 0x2e80;
6930
- }
6931
- function isAscii(charCode) {
6932
- return (charCode & 0xff80) === 0;
6933
- }
6934
- function isAsciiAlpha(charCode) {
6935
- return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a;
6936
- }
6937
- function isAsciiDigit(charCode) {
6938
- return charCode >= 0x30 && charCode <= 0x39;
6939
- }
6940
- function isAsciiSpace(charCode) {
6941
- return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a;
6942
- }
6943
- function isHan(charCode) {
6944
- return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff;
6945
- }
6946
- function isKatakana(charCode) {
6947
- return charCode >= 0x30a0 && charCode <= 0x30ff;
6948
- }
6949
- function isHiragana(charCode) {
6950
- return charCode >= 0x3040 && charCode <= 0x309f;
6951
- }
6952
- function isHalfwidthKatakana(charCode) {
6953
- return charCode >= 0xff60 && charCode <= 0xff9f;
6954
- }
6955
- function isThai(charCode) {
6956
- return (charCode & 0xff80) === 0x0e00;
6957
- }
6958
- function getCharacterType(charCode) {
6959
- if (isAlphabeticalScript(charCode)) {
6960
- if (isAscii(charCode)) {
6961
- if (isAsciiSpace(charCode)) {
6962
- return CharacterType.SPACE;
6963
- } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) {
6964
- return CharacterType.ALPHA_LETTER;
6965
- }
6966
- return CharacterType.PUNCT;
6967
- } else if (isThai(charCode)) {
6968
- return CharacterType.THAI_LETTER;
6969
- } else if (charCode === 0xa0) {
6970
- return CharacterType.SPACE;
6971
- }
6972
- return CharacterType.ALPHA_LETTER;
6973
- }
6974
- if (isHan(charCode)) {
6975
- return CharacterType.HAN_LETTER;
6976
- } else if (isKatakana(charCode)) {
6977
- return CharacterType.KATAKANA_LETTER;
6978
- } else if (isHiragana(charCode)) {
6979
- return CharacterType.HIRAGANA_LETTER;
6980
- } else if (isHalfwidthKatakana(charCode)) {
6981
- return CharacterType.HALFWIDTH_KATAKANA_LETTER;
6982
- }
6983
- return CharacterType.ALPHA_LETTER;
6984
- }
6985
- let NormalizeWithNFKC;
6986
- function getNormalizeWithNFKC() {
6987
- NormalizeWithNFKC ||= ` ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`;
6988
- return NormalizeWithNFKC;
6989
- }
6990
-
6991
7240
 
6992
7241
  /***/ }),
6993
7242
 
6994
- /***/ 6418:
7243
+ /***/ 8543:
6995
7244
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
6996
7245
 
6997
7246
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6998
7247
  /* harmony export */ PDFHistory: () => (/* binding */ PDFHistory)
6999
7248
  /* harmony export */ });
7000
7249
  /* unused harmony exports isDestArraysEqual, isDestHashesEqual */
7001
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
7002
- /* harmony import */ var _event_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6554);
7250
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
7251
+ /* harmony import */ var _event_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5656);
7003
7252
 
7004
7253
 
7005
7254
  const HASH_CHANGE_TIMEOUT = 1000;
@@ -7214,7 +7463,7 @@ class PDFHistory {
7214
7463
  this._updateInternalState(destination, newState.uid);
7215
7464
  let newUrl;
7216
7465
  if (this._updateUrl && destination?.hash) {
7217
- const baseUrl = document.location.href.split("#")[0];
7466
+ const baseUrl = document.location.href.split("#", 1)[0];
7218
7467
  if (!baseUrl.startsWith("file://")) {
7219
7468
  newUrl = `${baseUrl}#${destination.hash}`;
7220
7469
  }
@@ -7469,13 +7718,13 @@ function isDestArraysEqual(firstDest, secondDest) {
7469
7718
 
7470
7719
  /***/ }),
7471
7720
 
7472
- /***/ 3706:
7721
+ /***/ 4275:
7473
7722
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7474
7723
 
7475
7724
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7476
7725
  /* harmony export */ PDFLayerViewer: () => (/* binding */ PDFLayerViewer)
7477
7726
  /* harmony export */ });
7478
- /* harmony import */ var _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9415);
7727
+ /* harmony import */ var _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2961);
7479
7728
 
7480
7729
  class PDFLayerViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__.BaseTreeViewer {
7481
7730
  constructor(options) {
@@ -7609,7 +7858,9 @@ class PDFLayerViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__.B
7609
7858
  return;
7610
7859
  }
7611
7860
  const pdfDocument = this._pdfDocument;
7612
- const optionalContentConfig = await (promise || pdfDocument.getOptionalContentConfig());
7861
+ const optionalContentConfig = await (promise || pdfDocument.getOptionalContentConfig({
7862
+ intent: "display"
7863
+ }));
7613
7864
  if (pdfDocument !== this._pdfDocument) {
7614
7865
  return;
7615
7866
  }
@@ -7633,7 +7884,7 @@ class PDFLayerViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__.B
7633
7884
 
7634
7885
  /***/ }),
7635
7886
 
7636
- /***/ 3234:
7887
+ /***/ 787:
7637
7888
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7638
7889
 
7639
7890
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -7641,7 +7892,7 @@ class PDFLayerViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__.B
7641
7892
  /* harmony export */ PDFLinkService: () => (/* binding */ PDFLinkService),
7642
7893
  /* harmony export */ SimpleLinkService: () => (/* binding */ SimpleLinkService)
7643
7894
  /* harmony export */ });
7644
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
7895
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
7645
7896
 
7646
7897
  const DEFAULT_LINK_REL = "noopener noreferrer nofollow";
7647
7898
  const LinkTarget = {
@@ -7665,9 +7916,7 @@ function addLinkAttributes(link, {
7665
7916
  } else {
7666
7917
  link.href = "";
7667
7918
  link.title = `Disabled: ${url}`;
7668
- link.onclick = () => {
7669
- return false;
7670
- };
7919
+ link.onclick = () => false;
7671
7920
  }
7672
7921
  let targetStr = "";
7673
7922
  switch (target) {
@@ -7946,30 +8195,7 @@ class PDFLinkService {
7946
8195
  if (pdfDocument !== this.pdfDocument) {
7947
8196
  return;
7948
8197
  }
7949
- let operator;
7950
- for (const elem of action.state) {
7951
- switch (elem) {
7952
- case "ON":
7953
- case "OFF":
7954
- case "Toggle":
7955
- operator = elem;
7956
- continue;
7957
- }
7958
- switch (operator) {
7959
- case "ON":
7960
- optionalContentConfig.setVisibility(elem, true);
7961
- break;
7962
- case "OFF":
7963
- optionalContentConfig.setVisibility(elem, false);
7964
- break;
7965
- case "Toggle":
7966
- const group = optionalContentConfig.getGroup(elem);
7967
- if (group) {
7968
- optionalContentConfig.setVisibility(elem, !group.visible);
7969
- }
7970
- break;
7971
- }
7972
- }
8198
+ optionalContentConfig.setOCGState(action);
7973
8199
  this.pdfViewer.optionalContentConfigPromise = Promise.resolve(optionalContentConfig);
7974
8200
  }
7975
8201
  cachePageRef(pageNum, pageRef) {
@@ -8079,19 +8305,14 @@ class SimpleLinkService {
8079
8305
 
8080
8306
  /***/ }),
8081
8307
 
8082
- /***/ 1141:
8083
- /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
8308
+ /***/ 5514:
8309
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
8084
8310
 
8085
- __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
8086
8311
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8087
8312
  /* harmony export */ PDFOutlineViewer: () => (/* binding */ PDFOutlineViewer)
8088
8313
  /* harmony export */ });
8089
- /* harmony import */ var _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9415);
8090
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1869);
8091
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4927);
8092
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__]);
8093
- pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
8094
-
8314
+ /* harmony import */ var _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2961);
8315
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
8095
8316
 
8096
8317
 
8097
8318
  class PDFOutlineViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__.BaseTreeViewer {
@@ -8106,9 +8327,7 @@ class PDFOutlineViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__
8106
8327
  });
8107
8328
  this.eventBus._on("pagesloaded", evt => {
8108
8329
  this._isPagesLoaded = !!evt.pagesCount;
8109
- if (this._currentOutlineItemCapability && !this._currentOutlineItemCapability.settled) {
8110
- this._currentOutlineItemCapability.resolve(this._isPagesLoaded);
8111
- }
8330
+ this._currentOutlineItemCapability?.resolve(this._isPagesLoaded);
8112
8331
  });
8113
8332
  this.eventBus._on("sidebarviewchanged", evt => {
8114
8333
  this._sidebarView = evt.view;
@@ -8120,13 +8339,11 @@ class PDFOutlineViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__
8120
8339
  this._pageNumberToDestHashCapability = null;
8121
8340
  this._currentPageNumber = 1;
8122
8341
  this._isPagesLoaded = null;
8123
- if (this._currentOutlineItemCapability && !this._currentOutlineItemCapability.settled) {
8124
- this._currentOutlineItemCapability.resolve(false);
8125
- }
8342
+ this._currentOutlineItemCapability?.resolve(false);
8126
8343
  this._currentOutlineItemCapability = null;
8127
8344
  }
8128
8345
  _dispatchEvent(outlineCount) {
8129
- this._currentOutlineItemCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PromiseCapability();
8346
+ this._currentOutlineItemCapability = Promise.withResolvers();
8130
8347
  if (outlineCount === 0 || this._pdfDocument?.loadingParams.disableAutoFetch) {
8131
8348
  this._currentOutlineItemCapability.resolve(false);
8132
8349
  } else if (this._isPagesLoaded !== null) {
@@ -8288,7 +8505,7 @@ class PDFOutlineViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__
8288
8505
  return;
8289
8506
  }
8290
8507
  this._updateCurrentTreeItem(null);
8291
- if (this._sidebarView !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.SidebarView.OUTLINE) {
8508
+ if (this._sidebarView !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.SidebarView.OUTLINE) {
8292
8509
  return;
8293
8510
  }
8294
8511
  for (let i = this._currentPageNumber; i > 0; i--) {
@@ -8308,7 +8525,7 @@ class PDFOutlineViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__
8308
8525
  if (this._pageNumberToDestHashCapability) {
8309
8526
  return this._pageNumberToDestHashCapability.promise;
8310
8527
  }
8311
- this._pageNumberToDestHashCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PromiseCapability();
8528
+ this._pageNumberToDestHashCapability = Promise.withResolvers();
8312
8529
  const pageNumberToDestHash = new Map(),
8313
8530
  pageNumberNesting = new Map();
8314
8531
  const queue = [{
@@ -8366,33 +8583,31 @@ class PDFOutlineViewer extends _base_tree_viewer_js__WEBPACK_IMPORTED_MODULE_0__
8366
8583
  }
8367
8584
  }
8368
8585
 
8369
- __webpack_async_result__();
8370
- } catch(e) { __webpack_async_result__(e); } });
8371
8586
 
8372
8587
  /***/ }),
8373
8588
 
8374
- /***/ 6732:
8589
+ /***/ 9966:
8375
8590
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
8376
8591
 
8377
8592
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
8378
8593
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8379
8594
  /* harmony export */ PDFPageView: () => (/* binding */ PDFPageView)
8380
8595
  /* harmony export */ });
8381
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
8382
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4927);
8383
- /* harmony import */ var _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2640);
8384
- /* harmony import */ var _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6735);
8385
- /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8961);
8386
- /* harmony import */ var _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(758);
8387
- /* harmony import */ var web_l10n_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7910);
8388
- /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3234);
8389
- /* harmony import */ var _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7498);
8390
- /* harmony import */ var _text_accessibility_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4630);
8391
- /* harmony import */ var _text_highlighter_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4274);
8392
- /* harmony import */ var _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1013);
8393
- /* harmony import */ var _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8012);
8394
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_5__, web_l10n_utils__WEBPACK_IMPORTED_MODULE_6__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_11__]);
8395
- ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_5__, web_l10n_utils__WEBPACK_IMPORTED_MODULE_6__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_11__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
8596
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
8597
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
8598
+ /* harmony import */ var _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(283);
8599
+ /* harmony import */ var _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2707);
8600
+ /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9840);
8601
+ /* harmony import */ var _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3088);
8602
+ /* harmony import */ var web_null_l10n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(410);
8603
+ /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(787);
8604
+ /* harmony import */ var _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(6698);
8605
+ /* harmony import */ var _text_accessibility_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(5860);
8606
+ /* harmony import */ var _text_highlighter_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(2027);
8607
+ /* harmony import */ var _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7765);
8608
+ /* harmony import */ var _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2973);
8609
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_5__, web_null_l10n__WEBPACK_IMPORTED_MODULE_6__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_11__]);
8610
+ ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_5__, web_null_l10n__WEBPACK_IMPORTED_MODULE_6__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_11__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
8396
8611
 
8397
8612
 
8398
8613
 
@@ -8406,8 +8621,8 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfj
8406
8621
 
8407
8622
 
8408
8623
 
8409
- const MAX_CANVAS_PIXELS = _app_options_js__WEBPACK_IMPORTED_MODULE_4__.compatibilityParams.maxCanvasPixels || 16777216;
8410
8624
  const DEFAULT_LAYER_PROPERTIES = null;
8625
+ const LAYERS_ORDER = new Map([["canvasWrapper", 0], ["textLayer", 1], ["annotationLayer", 2], ["annotationEditorLayer", 3], ["xfaLayer", 3]]);
8411
8626
  class PDFPageView {
8412
8627
  #annotationMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE_FORMS;
8413
8628
  #hasRestrictedScaling = false;
@@ -8423,6 +8638,7 @@ class PDFPageView {
8423
8638
  regularAnnotations: true
8424
8639
  };
8425
8640
  #viewportMap = new WeakMap();
8641
+ #layers = [null, null, null, null];
8426
8642
  constructor(options) {
8427
8643
  const container = options.container;
8428
8644
  const defaultViewport = options.defaultViewport;
@@ -8439,12 +8655,12 @@ class PDFPageView {
8439
8655
  this.#textLayerMode = options.textLayerMode ?? _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.TextLayerMode.ENABLE;
8440
8656
  this.#annotationMode = options.annotationMode ?? pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE_FORMS;
8441
8657
  this.imageResourcesPath = options.imageResourcesPath || "";
8442
- this.isOffscreenCanvasSupported = options.isOffscreenCanvasSupported ?? true;
8443
- this.maxCanvasPixels = options.maxCanvasPixels ?? MAX_CANVAS_PIXELS;
8658
+ this.maxCanvasPixels = options.maxCanvasPixels ?? _app_options_js__WEBPACK_IMPORTED_MODULE_4__.AppOptions.get("maxCanvasPixels");
8444
8659
  this.pageColors = options.pageColors || null;
8445
8660
  this.eventBus = options.eventBus;
8446
8661
  this.renderingQueue = options.renderingQueue;
8447
- this.l10n = options.l10n || web_l10n_utils__WEBPACK_IMPORTED_MODULE_6__.NullL10n;
8662
+ this.l10n = options.l10n;
8663
+ this.l10n ||= new web_null_l10n__WEBPACK_IMPORTED_MODULE_6__.GenericL10n();
8448
8664
  this.renderTask = null;
8449
8665
  this.resume = null;
8450
8666
  this._isStandalone = !this.renderingQueue?.hasViewer();
@@ -8481,11 +8697,28 @@ class PDFPageView {
8481
8697
  this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility;
8482
8698
  });
8483
8699
  }
8484
- if (this.l10n === web_l10n_utils__WEBPACK_IMPORTED_MODULE_6__.NullL10n) {
8700
+ if (!options.l10n) {
8485
8701
  this.l10n.translate(this.div);
8486
8702
  }
8487
8703
  }
8488
8704
  }
8705
+ #addLayer(div, name) {
8706
+ const pos = LAYERS_ORDER.get(name);
8707
+ const oldDiv = this.#layers[pos];
8708
+ this.#layers[pos] = div;
8709
+ if (oldDiv) {
8710
+ oldDiv.replaceWith(div);
8711
+ return;
8712
+ }
8713
+ for (let i = pos - 1; i >= 0; i--) {
8714
+ const layer = this.#layers[i];
8715
+ if (layer) {
8716
+ layer.after(div);
8717
+ return;
8718
+ }
8719
+ }
8720
+ this.div.prepend(div);
8721
+ }
8489
8722
  get renderingState() {
8490
8723
  return this.#renderingState;
8491
8724
  }
@@ -8529,7 +8762,8 @@ class PDFPageView {
8529
8762
  }
8530
8763
  setPdfPage(pdfPage) {
8531
8764
  if (this._isStandalone && (this.pageColors?.foreground === "CanvasText" || this.pageColors?.background === "Canvas")) {
8532
- this._container?.style.setProperty("--hcm-highlight-filter", pdfPage.filterFactory.addHighlightHCMFilter("CanvasText", "Canvas", "HighlightText", "Highlight"));
8765
+ this._container?.style.setProperty("--hcm-highlight-filter", pdfPage.filterFactory.addHighlightHCMFilter("highlight", "CanvasText", "Canvas", "HighlightText", "Highlight"));
8766
+ this._container?.style.setProperty("--hcm-highlight-selected-filter", pdfPage.filterFactory.addHighlightHCMFilter("highlight_selected", "CanvasText", "Canvas", "HighlightText", "Highlight"));
8533
8767
  }
8534
8768
  this.pdfPage = pdfPage;
8535
8769
  this.pdfPageRotate = pdfPage.rotate;
@@ -8602,7 +8836,7 @@ class PDFPageView {
8602
8836
  } finally {
8603
8837
  if (this.xfaLayer?.div) {
8604
8838
  this.l10n.pause();
8605
- this.div.append(this.xfaLayer.div);
8839
+ this.#addLayer(this.xfaLayer.div, "xfaLayer");
8606
8840
  this.l10n.resume();
8607
8841
  }
8608
8842
  this.eventBus.dispatch("xfalayerrendered", {
@@ -8714,6 +8948,10 @@ class PDFPageView {
8714
8948
  continue;
8715
8949
  }
8716
8950
  node.remove();
8951
+ const layerIndex = this.#layers.indexOf(node);
8952
+ if (layerIndex >= 0) {
8953
+ this.#layers[layerIndex] = null;
8954
+ }
8717
8955
  }
8718
8956
  div.removeAttribute("data-loaded");
8719
8957
  if (annotationLayerNode) {
@@ -8978,20 +9216,20 @@ class PDFPageView {
8978
9216
  this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.RenderingStates.RUNNING;
8979
9217
  const canvasWrapper = document.createElement("div");
8980
9218
  canvasWrapper.classList.add("canvasWrapper");
8981
- div.append(canvasWrapper);
9219
+ canvasWrapper.setAttribute("aria-hidden", true);
9220
+ this.#addLayer(canvasWrapper, "canvasWrapper");
8982
9221
  if (!this.textLayer && this.#textLayerMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.TextLayerMode.DISABLE && !pdfPage.isPureXfa) {
8983
9222
  this._accessibilityManager ||= new _text_accessibility_js__WEBPACK_IMPORTED_MODULE_9__.TextAccessibilityManager();
8984
9223
  this.textLayer = new _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__.TextLayerBuilder({
8985
9224
  highlighter: this._textHighlighter,
8986
9225
  accessibilityManager: this._accessibilityManager,
8987
- isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,
8988
- enablePermissions: this.#textLayerMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.TextLayerMode.ENABLE_PERMISSIONS
9226
+ enablePermissions: this.#textLayerMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.TextLayerMode.ENABLE_PERMISSIONS,
9227
+ onAppend: textLayerDiv => {
9228
+ this.l10n.pause();
9229
+ this.#addLayer(textLayerDiv, "textLayer");
9230
+ this.l10n.resume();
9231
+ }
8989
9232
  });
8990
- this.textLayer.onAppend = textLayerDiv => {
8991
- this.l10n.pause();
8992
- this.div.append(textLayerDiv);
8993
- this.l10n.resume();
8994
- };
8995
9233
  }
8996
9234
  if (!this.annotationLayer && this.#annotationMode !== pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.DISABLE) {
8997
9235
  const {
@@ -9004,7 +9242,6 @@ class PDFPageView {
9004
9242
  } = this.#layerProperties;
9005
9243
  this._annotationCanvasMap ||= new Map();
9006
9244
  this.annotationLayer = new _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__.AnnotationLayerBuilder({
9007
- pageDiv: div,
9008
9245
  pdfPage,
9009
9246
  annotationStorage,
9010
9247
  imageResourcesPath: this.imageResourcesPath,
@@ -9015,7 +9252,10 @@ class PDFPageView {
9015
9252
  hasJSActionsPromise,
9016
9253
  fieldObjectsPromise,
9017
9254
  annotationCanvasMap: this._annotationCanvasMap,
9018
- accessibilityManager: this._accessibilityManager
9255
+ accessibilityManager: this._accessibilityManager,
9256
+ onAppend: annotationLayerDiv => {
9257
+ this.#addLayer(annotationLayerDiv, "annotationLayer");
9258
+ }
9019
9259
  });
9020
9260
  }
9021
9261
  const renderContinueCallback = cont => {
@@ -9109,13 +9349,15 @@ class PDFPageView {
9109
9349
  if (!this.annotationEditorLayer) {
9110
9350
  this.annotationEditorLayer = new _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__.AnnotationEditorLayerBuilder({
9111
9351
  uiManager: annotationEditorUIManager,
9112
- pageDiv: div,
9113
9352
  pdfPage,
9114
9353
  l10n,
9115
9354
  accessibilityManager: this._accessibilityManager,
9116
9355
  annotationLayer: this.annotationLayer?.annotationLayer,
9117
9356
  textLayer: this.textLayer,
9118
- drawLayer: this.drawLayer.getDrawLayer()
9357
+ drawLayer: this.drawLayer.getDrawLayer(),
9358
+ onAppend: annotationEditorLayerDiv => {
9359
+ this.#addLayer(annotationEditorLayerDiv, "annotationEditorLayer");
9360
+ }
9119
9361
  });
9120
9362
  }
9121
9363
  this.#renderAnnotationEditorLayer();
@@ -9172,15 +9414,15 @@ __webpack_async_result__();
9172
9414
 
9173
9415
  /***/ }),
9174
9416
 
9175
- /***/ 323:
9417
+ /***/ 8917:
9176
9418
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
9177
9419
 
9178
9420
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
9179
9421
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9180
9422
  /* harmony export */ PDFPresentationMode: () => (/* binding */ PDFPresentationMode)
9181
9423
  /* harmony export */ });
9182
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
9183
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1869);
9424
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
9425
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2603);
9184
9426
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__]);
9185
9427
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
9186
9428
 
@@ -9296,7 +9538,7 @@ class PDFPresentationMode {
9296
9538
  this.#addWindowListeners();
9297
9539
  this.#showControls();
9298
9540
  this.contextMenuOpen = false;
9299
- window.getSelection().removeAllRanges();
9541
+ document.getSelection().empty();
9300
9542
  }
9301
9543
  #exit() {
9302
9544
  const pageNumber = this.pdfViewer.currentPageNumber;
@@ -9471,22 +9713,25 @@ __webpack_async_result__();
9471
9713
 
9472
9714
  /***/ }),
9473
9715
 
9474
- /***/ 1834:
9716
+ /***/ 1144:
9475
9717
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
9476
9718
 
9477
9719
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
9478
- /* unused harmony export PDFPrintService */
9479
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
9480
- /* harmony import */ var _app_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39);
9481
- /* harmony import */ var _print_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4552);
9482
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _app_js__WEBPACK_IMPORTED_MODULE_1__, _print_utils_js__WEBPACK_IMPORTED_MODULE_2__]);
9483
- ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _app_js__WEBPACK_IMPORTED_MODULE_1__, _print_utils_js__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
9484
-
9720
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9721
+ /* harmony export */ PDFPrintServiceFactory: () => (/* binding */ PDFPrintServiceFactory)
9722
+ /* harmony export */ });
9723
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
9724
+ /* harmony import */ var _print_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(659);
9725
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _print_utils_js__WEBPACK_IMPORTED_MODULE_1__]);
9726
+ ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _print_utils_js__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
9485
9727
 
9486
9728
 
9487
9729
  let activeService = null;
9488
9730
  let dialog = null;
9489
9731
  let overlayManager = null;
9732
+ let viewerApp = {
9733
+ initialized: false
9734
+ };
9490
9735
  function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size, printResolution, optionalContentConfigPromise, printAnnotationStoragePromise) {
9491
9736
  const scratchCanvas = activeService.scratchCanvas;
9492
9737
  const PRINT_UNITS = printResolution / pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.PixelsPerInch.PDF;
@@ -9510,16 +9755,30 @@ function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size, printRe
9510
9755
  optionalContentConfigPromise,
9511
9756
  printAnnotationStorage
9512
9757
  };
9513
- return pdfPage.render(renderContext).promise;
9758
+ const renderTask = pdfPage.render(renderContext);
9759
+ return renderTask.promise.catch(reason => {
9760
+ if (!(reason instanceof pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.RenderingCancelledException)) {
9761
+ console.error(reason);
9762
+ }
9763
+ throw reason;
9764
+ });
9514
9765
  });
9515
9766
  }
9516
9767
  class PDFPrintService {
9517
- constructor(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise = null, printAnnotationStoragePromise = null) {
9768
+ constructor({
9769
+ pdfDocument,
9770
+ pagesOverview,
9771
+ printContainer,
9772
+ printResolution,
9773
+ printAnnotationStoragePromise = null
9774
+ }) {
9518
9775
  this.pdfDocument = pdfDocument;
9519
9776
  this.pagesOverview = pagesOverview;
9520
9777
  this.printContainer = printContainer;
9521
9778
  this._printResolution = printResolution || 150;
9522
- this._optionalContentConfigPromise = optionalContentConfigPromise || pdfDocument.getOptionalContentConfig();
9779
+ this._optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({
9780
+ intent: "print"
9781
+ });
9523
9782
  this._printAnnotationStoragePromise = printAnnotationStoragePromise || Promise.resolve();
9524
9783
  this.currentPage = -1;
9525
9784
  this.scratchCanvas = document.createElement("canvas");
@@ -9562,7 +9821,7 @@ class PDFPrintService {
9562
9821
  }
9563
9822
  renderPages() {
9564
9823
  if (this.pdfDocument.isPureXfa) {
9565
- (0,_print_utils_js__WEBPACK_IMPORTED_MODULE_2__.getXfaHtmlForPrinting)(this.printContainer, this.pdfDocument);
9824
+ (0,_print_utils_js__WEBPACK_IMPORTED_MODULE_1__.getXfaHtmlForPrinting)(this.printContainer, this.pdfDocument);
9566
9825
  return Promise.resolve();
9567
9826
  }
9568
9827
  const pageCount = this.pagesOverview.length;
@@ -9699,7 +9958,7 @@ if ("onbeforeprint" in window) {
9699
9958
  let overlayPromise;
9700
9959
  function ensureOverlay() {
9701
9960
  if (!overlayPromise) {
9702
- overlayManager = _app_js__WEBPACK_IMPORTED_MODULE_1__.PDFViewerApplication.overlayManager;
9961
+ overlayManager = viewerApp.overlayManager;
9703
9962
  if (!overlayManager) {
9704
9963
  throw new Error("The overlay manager has not yet been initialized.");
9705
9964
  }
@@ -9710,31 +9969,35 @@ function ensureOverlay() {
9710
9969
  }
9711
9970
  return overlayPromise;
9712
9971
  }
9713
- _app_js__WEBPACK_IMPORTED_MODULE_1__.PDFPrintServiceFactory.instance = {
9714
- supportsPrinting: true,
9715
- createPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, printAnnotationStoragePromise) {
9972
+ class PDFPrintServiceFactory {
9973
+ static initGlobals(app) {
9974
+ viewerApp = app;
9975
+ }
9976
+ static get supportsPrinting() {
9977
+ return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "supportsPrinting", true);
9978
+ }
9979
+ static createPrintService(params) {
9716
9980
  if (activeService) {
9717
9981
  throw new Error("The print service is created and active.");
9718
9982
  }
9719
- activeService = new PDFPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, printAnnotationStoragePromise);
9720
- return activeService;
9983
+ return activeService = new PDFPrintService(params);
9721
9984
  }
9722
- };
9985
+ }
9723
9986
 
9724
9987
  __webpack_async_result__();
9725
9988
  } catch(e) { __webpack_async_result__(e); } });
9726
9989
 
9727
9990
  /***/ }),
9728
9991
 
9729
- /***/ 5119:
9992
+ /***/ 6615:
9730
9993
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
9731
9994
 
9732
9995
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
9733
9996
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9734
9997
  /* harmony export */ PDFRenderingQueue: () => (/* binding */ PDFRenderingQueue)
9735
9998
  /* harmony export */ });
9736
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
9737
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4927);
9999
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
10000
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
9738
10001
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
9739
10002
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
9740
10003
 
@@ -9856,15 +10119,15 @@ __webpack_async_result__();
9856
10119
 
9857
10120
  /***/ }),
9858
10121
 
9859
- /***/ 2599:
10122
+ /***/ 5942:
9860
10123
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
9861
10124
 
9862
10125
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
9863
10126
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9864
10127
  /* harmony export */ PDFScriptingManager: () => (/* binding */ PDFScriptingManager)
9865
10128
  /* harmony export */ });
9866
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
9867
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1869);
10129
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
10130
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2603);
9868
10131
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__]);
9869
10132
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
9870
10133
 
@@ -10008,7 +10271,7 @@ class PDFScriptingManager {
10008
10271
  return;
10009
10272
  }
10010
10273
  await this.#willPrintCapability?.promise;
10011
- this.#willPrintCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PromiseCapability();
10274
+ this.#willPrintCapability = Promise.withResolvers();
10012
10275
  try {
10013
10276
  await this.#scripting.dispatchEventInSandbox({
10014
10277
  id: "doc",
@@ -10137,7 +10400,7 @@ class PDFScriptingManager {
10137
10400
  const pdfDocument = this.#pdfDocument,
10138
10401
  visitedPages = this._visitedPages;
10139
10402
  if (initialize) {
10140
- this.#closeCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PromiseCapability();
10403
+ this.#closeCapability = Promise.withResolvers();
10141
10404
  }
10142
10405
  if (!this.#closeCapability) {
10143
10406
  return;
@@ -10187,7 +10450,7 @@ class PDFScriptingManager {
10187
10450
  });
10188
10451
  }
10189
10452
  #initScripting() {
10190
- this.#destroyCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PromiseCapability();
10453
+ this.#destroyCapability = Promise.withResolvers();
10191
10454
  if (this.#scripting) {
10192
10455
  throw new Error("#initScripting: Scripting already exists.");
10193
10456
  }
@@ -10228,13 +10491,13 @@ __webpack_async_result__();
10228
10491
 
10229
10492
  /***/ }),
10230
10493
 
10231
- /***/ 4487:
10494
+ /***/ 2275:
10232
10495
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
10233
10496
 
10234
10497
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10235
10498
  /* harmony export */ PDFSidebar: () => (/* binding */ PDFSidebar)
10236
10499
  /* harmony export */ });
10237
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
10500
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
10238
10501
 
10239
10502
  const SIDEBAR_WIDTH_VAR = "--sidebar-width";
10240
10503
  const SIDEBAR_MIN_WIDTH = 200;
@@ -10546,7 +10809,7 @@ class PDFSidebar {
10546
10809
 
10547
10810
  /***/ }),
10548
10811
 
10549
- /***/ 3346:
10812
+ /***/ 1123:
10550
10813
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
10551
10814
 
10552
10815
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
@@ -10554,8 +10817,8 @@ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
10554
10817
  /* harmony export */ PDFThumbnailView: () => (/* binding */ PDFThumbnailView),
10555
10818
  /* harmony export */ TempImageFactory: () => (/* binding */ TempImageFactory)
10556
10819
  /* harmony export */ });
10557
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
10558
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1869);
10820
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
10821
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2603);
10559
10822
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__]);
10560
10823
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
10561
10824
 
@@ -10690,7 +10953,7 @@ class PDFThumbnailView {
10690
10953
  }
10691
10954
  this.resume = null;
10692
10955
  }
10693
- _getPageDrawContext(upscaleFactor = 1) {
10956
+ #getPageDrawContext(upscaleFactor = 1) {
10694
10957
  const canvas = document.createElement("canvas");
10695
10958
  const ctx = canvas.getContext("2d", {
10696
10959
  alpha: false
@@ -10705,11 +10968,11 @@ class PDFThumbnailView {
10705
10968
  transform
10706
10969
  };
10707
10970
  }
10708
- _convertCanvasToImage(canvas) {
10971
+ #convertCanvasToImage(canvas) {
10709
10972
  if (this.renderingState !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.RenderingStates.FINISHED) {
10710
- throw new Error("_convertCanvasToImage: Rendering has not finished.");
10973
+ throw new Error("#convertCanvasToImage: Rendering has not finished.");
10711
10974
  }
10712
- const reducedCanvas = this._reduceImage(canvas);
10975
+ const reducedCanvas = this.#reduceImage(canvas);
10713
10976
  const image = document.createElement("img");
10714
10977
  image.className = "thumbnailImage";
10715
10978
  image.setAttribute("data-l10n-id", "pdfjs-thumb-page-canvas");
@@ -10729,7 +10992,7 @@ class PDFThumbnailView {
10729
10992
  return;
10730
10993
  }
10731
10994
  this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.RenderingStates.FINISHED;
10732
- this._convertCanvasToImage(canvas);
10995
+ this.#convertCanvasToImage(canvas);
10733
10996
  if (error) {
10734
10997
  throw error;
10735
10998
  }
@@ -10751,7 +11014,7 @@ class PDFThumbnailView {
10751
11014
  ctx,
10752
11015
  canvas,
10753
11016
  transform
10754
- } = this._getPageDrawContext(DRAW_UPSCALE_FACTOR);
11017
+ } = this.#getPageDrawContext(DRAW_UPSCALE_FACTOR);
10755
11018
  const drawViewport = this.viewport.clone({
10756
11019
  scale: DRAW_UPSCALE_FACTOR * this.scale
10757
11020
  });
@@ -10806,13 +11069,13 @@ class PDFThumbnailView {
10806
11069
  return;
10807
11070
  }
10808
11071
  this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.RenderingStates.FINISHED;
10809
- this._convertCanvasToImage(canvas);
11072
+ this.#convertCanvasToImage(canvas);
10810
11073
  }
10811
- _reduceImage(img) {
11074
+ #reduceImage(img) {
10812
11075
  const {
10813
11076
  ctx,
10814
11077
  canvas
10815
- } = this._getPageDrawContext();
11078
+ } = this.#getPageDrawContext();
10816
11079
  if (img.width <= 2 * canvas.width) {
10817
11080
  ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height);
10818
11081
  return canvas;
@@ -10853,15 +11116,15 @@ __webpack_async_result__();
10853
11116
 
10854
11117
  /***/ }),
10855
11118
 
10856
- /***/ 3510:
11119
+ /***/ 8280:
10857
11120
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
10858
11121
 
10859
11122
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
10860
11123
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10861
11124
  /* harmony export */ PDFThumbnailViewer: () => (/* binding */ PDFThumbnailViewer)
10862
11125
  /* harmony export */ });
10863
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
10864
- /* harmony import */ var _pdf_thumbnail_view_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3346);
11126
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
11127
+ /* harmony import */ var _pdf_thumbnail_view_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1123);
10865
11128
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pdf_thumbnail_view_js__WEBPACK_IMPORTED_MODULE_1__]);
10866
11129
  _pdf_thumbnail_view_js__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
10867
11130
 
@@ -10881,16 +11144,16 @@ class PDFThumbnailViewer {
10881
11144
  this.linkService = linkService;
10882
11145
  this.renderingQueue = renderingQueue;
10883
11146
  this.pageColors = pageColors || null;
10884
- this.scroll = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.watchScroll)(this.container, this._scrollUpdated.bind(this));
10885
- this._resetView();
11147
+ this.scroll = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.watchScroll)(this.container, this.#scrollUpdated.bind(this));
11148
+ this.#resetView();
10886
11149
  }
10887
- _scrollUpdated() {
11150
+ #scrollUpdated() {
10888
11151
  this.renderingQueue.renderHighestPriority();
10889
11152
  }
10890
11153
  getThumbnail(index) {
10891
11154
  return this._thumbnails[index];
10892
11155
  }
10893
- _getVisibleThumbs() {
11156
+ #getVisibleThumbs() {
10894
11157
  return (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.getVisibleElements)({
10895
11158
  scrollEl: this.container,
10896
11159
  views: this._thumbnails
@@ -10914,7 +11177,7 @@ class PDFThumbnailViewer {
10914
11177
  first,
10915
11178
  last,
10916
11179
  views
10917
- } = this._getVisibleThumbs();
11180
+ } = this.#getVisibleThumbs();
10918
11181
  if (views.length > 0) {
10919
11182
  let shouldScroll = false;
10920
11183
  if (pageNumber <= first.id || pageNumber >= last.id) {
@@ -10968,7 +11231,7 @@ class PDFThumbnailViewer {
10968
11231
  }
10969
11232
  _pdf_thumbnail_view_js__WEBPACK_IMPORTED_MODULE_1__.TempImageFactory.destroyCanvas();
10970
11233
  }
10971
- _resetView() {
11234
+ #resetView() {
10972
11235
  this._thumbnails = [];
10973
11236
  this._currentPageNumber = 1;
10974
11237
  this._pageLabels = null;
@@ -10977,15 +11240,17 @@ class PDFThumbnailViewer {
10977
11240
  }
10978
11241
  setDocument(pdfDocument) {
10979
11242
  if (this.pdfDocument) {
10980
- this._cancelRendering();
10981
- this._resetView();
11243
+ this.#cancelRendering();
11244
+ this.#resetView();
10982
11245
  }
10983
11246
  this.pdfDocument = pdfDocument;
10984
11247
  if (!pdfDocument) {
10985
11248
  return;
10986
11249
  }
10987
11250
  const firstPagePromise = pdfDocument.getPage(1);
10988
- const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();
11251
+ const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({
11252
+ intent: "display"
11253
+ });
10989
11254
  firstPagePromise.then(firstPdfPage => {
10990
11255
  const pagesCount = pdfDocument.numPages;
10991
11256
  const viewport = firstPdfPage.getViewport({
@@ -11011,7 +11276,7 @@ class PDFThumbnailViewer {
11011
11276
  console.error("Unable to initialize thumbnail viewer", reason);
11012
11277
  });
11013
11278
  }
11014
- _cancelRendering() {
11279
+ #cancelRendering() {
11015
11280
  for (const thumbnail of this._thumbnails) {
11016
11281
  thumbnail.cancelRendering();
11017
11282
  }
@@ -11056,7 +11321,7 @@ class PDFThumbnailViewer {
11056
11321
  return this.scroll.down;
11057
11322
  }
11058
11323
  forceRendering() {
11059
- const visibleThumbs = this._getVisibleThumbs();
11324
+ const visibleThumbs = this.#getVisibleThumbs();
11060
11325
  const scrollAhead = this.#getScrollAhead(visibleThumbs);
11061
11326
  const thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this._thumbnails, scrollAhead);
11062
11327
  if (thumbView) {
@@ -11074,7 +11339,7 @@ __webpack_async_result__();
11074
11339
 
11075
11340
  /***/ }),
11076
11341
 
11077
- /***/ 9290:
11342
+ /***/ 6285:
11078
11343
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
11079
11344
 
11080
11345
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
@@ -11083,14 +11348,14 @@ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
11083
11348
  /* harmony export */ PagesCountLimit: () => (/* binding */ PagesCountLimit)
11084
11349
  /* harmony export */ });
11085
11350
  /* unused harmony export PDFPageViewBuffer */
11086
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
11087
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4927);
11088
- /* harmony import */ var web_l10n_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7910);
11089
- /* harmony import */ var _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6732);
11090
- /* harmony import */ var _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5119);
11091
- /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3234);
11092
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_l10n_utils__WEBPACK_IMPORTED_MODULE_2__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_3__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_4__]);
11093
- ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_l10n_utils__WEBPACK_IMPORTED_MODULE_2__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_3__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
11351
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
11352
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
11353
+ /* harmony import */ var web_null_l10n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(410);
11354
+ /* harmony import */ var _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9966);
11355
+ /* harmony import */ var _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6615);
11356
+ /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(787);
11357
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_null_l10n__WEBPACK_IMPORTED_MODULE_2__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_3__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_4__]);
11358
+ ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_null_l10n__WEBPACK_IMPORTED_MODULE_2__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_3__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
11094
11359
 
11095
11360
 
11096
11361
 
@@ -11163,7 +11428,9 @@ class PDFViewer {
11163
11428
  #annotationMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE_FORMS;
11164
11429
  #containerTopLeft = null;
11165
11430
  #copyCallbackBound = null;
11431
+ #enableHighlightFloatingButton = false;
11166
11432
  #enablePermissions = false;
11433
+ #mlManager = null;
11167
11434
  #getAllTextInProgress = false;
11168
11435
  #hiddenCopyElement = null;
11169
11436
  #interruptCopyCondition = false;
@@ -11174,7 +11441,7 @@ class PDFViewer {
11174
11441
  #scaleTimeoutId = null;
11175
11442
  #textLayerMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.TextLayerMode.ENABLE;
11176
11443
  constructor(options) {
11177
- const viewerVersion = '4.0.379';
11444
+ const viewerVersion = "4.1.392";
11178
11445
  if (pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.version !== viewerVersion) {
11179
11446
  throw new Error(`The API version "${pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.version}" does not match the Viewer version "${viewerVersion}".`);
11180
11447
  }
@@ -11200,14 +11467,16 @@ class PDFViewer {
11200
11467
  this.#annotationMode = options.annotationMode ?? pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE_FORMS;
11201
11468
  this.#annotationEditorMode = options.annotationEditorMode ?? pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.NONE;
11202
11469
  this.#annotationEditorHighlightColors = options.annotationEditorHighlightColors || null;
11470
+ this.#enableHighlightFloatingButton = options.enableHighlightFloatingButton === true;
11203
11471
  this.imageResourcesPath = options.imageResourcesPath || "";
11204
11472
  this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
11205
11473
  this.removePageBorders = options.removePageBorders || false;
11206
- this.isOffscreenCanvasSupported = options.isOffscreenCanvasSupported ?? true;
11207
11474
  this.maxCanvasPixels = options.maxCanvasPixels;
11208
- this.l10n = options.l10n || web_l10n_utils__WEBPACK_IMPORTED_MODULE_2__.NullL10n;
11475
+ this.l10n = options.l10n;
11476
+ this.l10n ||= new web_null_l10n__WEBPACK_IMPORTED_MODULE_2__.GenericL10n();
11209
11477
  this.#enablePermissions = options.enablePermissions || false;
11210
11478
  this.pageColors = options.pageColors || null;
11479
+ this.#mlManager = options.mlManager || null;
11211
11480
  this.defaultRenderingQueue = !options.renderingQueue;
11212
11481
  if (this.defaultRenderingQueue) {
11213
11482
  this.renderingQueue = new _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_4__.PDFRenderingQueue();
@@ -11232,7 +11501,7 @@ class PDFViewer {
11232
11501
  pdfPage?.cleanup();
11233
11502
  }
11234
11503
  });
11235
- if (this.l10n === web_l10n_utils__WEBPACK_IMPORTED_MODULE_2__.NullL10n) {
11504
+ if (!options.l10n) {
11236
11505
  this.l10n.translate(this.container);
11237
11506
  }
11238
11507
  }
@@ -11246,7 +11515,7 @@ class PDFViewer {
11246
11515
  return new Set(this.#buffer);
11247
11516
  }
11248
11517
  get pageViewsReady() {
11249
- return this._pagesCapability.settled && this._pages.every(pageView => pageView?.pdfPage);
11518
+ return this._pages.every(pageView => pageView?.pdfPage);
11250
11519
  }
11251
11520
  get renderForms() {
11252
11521
  return this.#annotationMode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE_FORMS;
@@ -11428,9 +11697,9 @@ class PDFViewer {
11428
11697
  }
11429
11698
  return params;
11430
11699
  }
11431
- #onePageRenderedOrForceFetch() {
11700
+ async #onePageRenderedOrForceFetch() {
11432
11701
  if (document.visibilityState === "hidden" || !this.container.offsetParent || this._getVisiblePages().views.length === 0) {
11433
- return Promise.resolve();
11702
+ return;
11434
11703
  }
11435
11704
  const visibilityChangePromise = new Promise(resolve => {
11436
11705
  this.#onVisibilityChange = () => {
@@ -11438,12 +11707,12 @@ class PDFViewer {
11438
11707
  return;
11439
11708
  }
11440
11709
  resolve();
11441
- document.removeEventListener("visibilitychange", this.#onVisibilityChange);
11442
- this.#onVisibilityChange = null;
11443
11710
  };
11444
11711
  document.addEventListener("visibilitychange", this.#onVisibilityChange);
11445
11712
  });
11446
- return Promise.race([this._onePageRenderedCapability.promise, visibilityChangePromise]);
11713
+ await Promise.race([this._onePageRenderedCapability.promise, visibilityChangePromise]);
11714
+ document.removeEventListener("visibilitychange", this.#onVisibilityChange);
11715
+ this.#onVisibilityChange = null;
11447
11716
  }
11448
11717
  async getAllText() {
11449
11718
  const texts = [];
@@ -11522,7 +11791,9 @@ class PDFViewer {
11522
11791
  }
11523
11792
  const pagesCount = pdfDocument.numPages;
11524
11793
  const firstPagePromise = pdfDocument.getPage(1);
11525
- const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();
11794
+ const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({
11795
+ intent: "display"
11796
+ });
11526
11797
  const permissionsPromise = this.#enablePermissions ? pdfDocument.getPermissions() : Promise.resolve();
11527
11798
  if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {
11528
11799
  console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");
@@ -11547,7 +11818,7 @@ class PDFViewer {
11547
11818
  };
11548
11819
  this.eventBus._on("pagerender", this._onBeforeDraw);
11549
11820
  this._onAfterDraw = evt => {
11550
- if (evt.cssTransform || this._onePageRenderedCapability.settled) {
11821
+ if (evt.cssTransform) {
11551
11822
  return;
11552
11823
  }
11553
11824
  this._onePageRenderedCapability.resolve({
@@ -11555,10 +11826,6 @@ class PDFViewer {
11555
11826
  });
11556
11827
  this.eventBus._off("pagerendered", this._onAfterDraw);
11557
11828
  this._onAfterDraw = null;
11558
- if (this.#onVisibilityChange) {
11559
- document.removeEventListener("visibilitychange", this.#onVisibilityChange);
11560
- this.#onVisibilityChange = null;
11561
- }
11562
11829
  };
11563
11830
  this.eventBus._on("pagerendered", this._onAfterDraw);
11564
11831
  Promise.all([firstPagePromise, permissionsPromise]).then(([firstPdfPage, permissions]) => {
@@ -11582,7 +11849,7 @@ class PDFViewer {
11582
11849
  if (pdfDocument.isPureXfa) {
11583
11850
  console.warn("Warning: XFA-editing is not implemented.");
11584
11851
  } else if (isValidAnnotationEditorMode(mode)) {
11585
- this.#annotationEditorUIManager = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorUIManager(this.container, this.viewer, this.#altTextManager, this.eventBus, pdfDocument, this.pageColors, this.#annotationEditorHighlightColors);
11852
+ this.#annotationEditorUIManager = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorUIManager(this.container, this.viewer, this.#altTextManager, this.eventBus, pdfDocument, this.pageColors, this.#annotationEditorHighlightColors, this.#enableHighlightFloatingButton, this.#mlManager);
11586
11853
  this.eventBus.dispatch("annotationeditoruimanager", {
11587
11854
  source: this,
11588
11855
  uiManager: this.#annotationEditorUIManager
@@ -11601,7 +11868,8 @@ class PDFViewer {
11601
11868
  });
11602
11869
  this.viewer.style.setProperty("--scale-factor", viewport.scale);
11603
11870
  if (this.pageColors?.foreground === "CanvasText" || this.pageColors?.background === "Canvas") {
11604
- this.viewer.style.setProperty("--hcm-highlight-filter", pdfDocument.filterFactory.addHighlightHCMFilter("CanvasText", "Canvas", "HighlightText", "Highlight"));
11871
+ this.viewer.style.setProperty("--hcm-highlight-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight", "CanvasText", "Canvas", "HighlightText", "Highlight"));
11872
+ this.viewer.style.setProperty("--hcm-highlight-selected-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight_selected", "CanvasText", "Canvas", "HighlightText", "ButtonText"));
11605
11873
  }
11606
11874
  for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
11607
11875
  const pageView = new _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_3__.PDFPageView({
@@ -11615,7 +11883,6 @@ class PDFViewer {
11615
11883
  textLayerMode,
11616
11884
  annotationMode,
11617
11885
  imageResourcesPath: this.imageResourcesPath,
11618
- isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,
11619
11886
  maxCanvasPixels: this.maxCanvasPixels,
11620
11887
  pageColors: this.pageColors,
11621
11888
  l10n: this.l10n,
@@ -11723,9 +11990,9 @@ class PDFViewer {
11723
11990
  this._location = null;
11724
11991
  this._pagesRotation = 0;
11725
11992
  this._optionalContentConfigPromise = null;
11726
- this._firstPageCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability();
11727
- this._onePageRenderedCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability();
11728
- this._pagesCapability = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability();
11993
+ this._firstPageCapability = Promise.withResolvers();
11994
+ this._onePageRenderedCapability = Promise.withResolvers();
11995
+ this._pagesCapability = Promise.withResolvers();
11729
11996
  this._scrollMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.ScrollMode.VERTICAL;
11730
11997
  this._previousScrollMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.ScrollMode.UNKNOWN;
11731
11998
  this._spreadMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.SpreadMode.NONE;
@@ -12248,7 +12515,9 @@ class PDFViewer {
12248
12515
  }
12249
12516
  if (!this._optionalContentConfigPromise) {
12250
12517
  console.error("optionalContentConfigPromise: Not initialized yet.");
12251
- return this.pdfDocument.getOptionalContentConfig();
12518
+ return this.pdfDocument.getOptionalContentConfig({
12519
+ intent: "display"
12520
+ });
12252
12521
  }
12253
12522
  return this._optionalContentConfigPromise;
12254
12523
  }
@@ -12612,7 +12881,7 @@ __webpack_async_result__();
12612
12881
 
12613
12882
  /***/ }),
12614
12883
 
12615
- /***/ 1869:
12884
+ /***/ 2603:
12616
12885
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
12617
12886
 
12618
12887
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
@@ -12636,7 +12905,6 @@ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
12636
12905
  /* harmony export */ PasswordResponses: () => (/* binding */ PasswordResponses),
12637
12906
  /* harmony export */ PermissionFlag: () => (/* binding */ PermissionFlag),
12638
12907
  /* harmony export */ PixelsPerInch: () => (/* binding */ PixelsPerInch),
12639
- /* harmony export */ PromiseCapability: () => (/* binding */ PromiseCapability),
12640
12908
  /* harmony export */ RenderingCancelledException: () => (/* binding */ RenderingCancelledException),
12641
12909
  /* harmony export */ UnexpectedResponseException: () => (/* binding */ UnexpectedResponseException),
12642
12910
  /* harmony export */ XfaLayer: () => (/* binding */ XfaLayer),
@@ -12697,7 +12965,6 @@ const {
12697
12965
  PDFWorker,
12698
12966
  PermissionFlag,
12699
12967
  PixelsPerInch,
12700
- PromiseCapability,
12701
12968
  RenderingCancelledException,
12702
12969
  renderTextLayer,
12703
12970
  setLayerDimensions,
@@ -12715,45 +12982,58 @@ __webpack_async_result__();
12715
12982
 
12716
12983
  /***/ }),
12717
12984
 
12718
- /***/ 216:
12985
+ /***/ 8224:
12719
12986
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12720
12987
 
12721
12988
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12722
12989
  /* harmony export */ BasePreferences: () => (/* binding */ BasePreferences)
12723
12990
  /* harmony export */ });
12724
- /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8961);
12991
+ /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9840);
12725
12992
 
12726
12993
  class BasePreferences {
12994
+ #browserDefaults = Object.freeze({
12995
+ canvasMaxAreaInBytes: -1,
12996
+ isInAutomation: false,
12997
+ supportsCaretBrowsingMode: false,
12998
+ supportsDocumentFonts: true,
12999
+ supportsIntegratedFind: false,
13000
+ supportsMouseWheelZoomCtrlKey: true,
13001
+ supportsMouseWheelZoomMetaKey: true,
13002
+ supportsPinchToZoom: true
13003
+ });
12727
13004
  #defaults = Object.freeze({
12728
- "annotationEditorMode": 0,
12729
- "annotationMode": 2,
12730
- "cursorToolOnLoad": 0,
12731
- "defaultZoomDelay": 400,
12732
- "defaultZoomValue": "",
12733
- "disablePageLabels": false,
12734
- "enableHighlightEditor": false,
12735
- "enablePermissions": false,
12736
- "enablePrintAutoRotate": true,
12737
- "enableScripting": true,
12738
- "externalLinkTarget": 0,
12739
- "highlightEditorColors": "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
12740
- "historyUpdateUrl": false,
12741
- "ignoreDestinationZoom": false,
12742
- "forcePageColors": false,
12743
- "pageColorsBackground": "Canvas",
12744
- "pageColorsForeground": "CanvasText",
12745
- "pdfBugEnabled": false,
12746
- "sidebarViewOnLoad": -1,
12747
- "scrollModeOnLoad": -1,
12748
- "spreadModeOnLoad": -1,
12749
- "textLayerMode": 1,
12750
- "viewOnLoad": 0,
12751
- "disableAutoFetch": false,
12752
- "disableFontFace": false,
12753
- "disableRange": false,
12754
- "disableStream": false,
12755
- "enableXfa": true,
12756
- "viewerCssTheme": 0
13005
+ annotationEditorMode: 0,
13006
+ annotationMode: 2,
13007
+ cursorToolOnLoad: 0,
13008
+ defaultZoomDelay: 400,
13009
+ defaultZoomValue: "",
13010
+ disablePageLabels: false,
13011
+ enableHighlightEditor: false,
13012
+ enableHighlightFloatingButton: false,
13013
+ enableML: false,
13014
+ enablePermissions: false,
13015
+ enablePrintAutoRotate: true,
13016
+ enableScripting: true,
13017
+ enableStampEditor: true,
13018
+ externalLinkTarget: 0,
13019
+ highlightEditorColors: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
13020
+ historyUpdateUrl: false,
13021
+ ignoreDestinationZoom: false,
13022
+ forcePageColors: false,
13023
+ pageColorsBackground: "Canvas",
13024
+ pageColorsForeground: "CanvasText",
13025
+ pdfBugEnabled: false,
13026
+ sidebarViewOnLoad: -1,
13027
+ scrollModeOnLoad: -1,
13028
+ spreadModeOnLoad: -1,
13029
+ textLayerMode: 1,
13030
+ viewOnLoad: 0,
13031
+ disableAutoFetch: false,
13032
+ disableFontFace: false,
13033
+ disableRange: false,
13034
+ disableStream: false,
13035
+ enableXfa: true,
13036
+ viewerCssTheme: 0
12757
13037
  });
12758
13038
  #prefs = Object.create(null);
12759
13039
  #initializedPromise = null;
@@ -12765,23 +13045,14 @@ class BasePreferences {
12765
13045
  browserPrefs,
12766
13046
  prefs
12767
13047
  }) => {
12768
- const BROWSER_PREFS = {
12769
- "canvasMaxAreaInBytes": -1,
12770
- "isInAutomation": false,
12771
- "supportsDocumentFonts": true,
12772
- "supportsIntegratedFind": false,
12773
- "supportsMouseWheelZoomCtrlKey": true,
12774
- "supportsMouseWheelZoomMetaKey": true,
12775
- "supportsPinchToZoom": true
12776
- };
12777
13048
  const options = Object.create(null);
12778
- for (const [name, defaultVal] of Object.entries(BROWSER_PREFS)) {
13049
+ for (const [name, val] of Object.entries(this.#browserDefaults)) {
12779
13050
  const prefVal = browserPrefs?.[name];
12780
- options[name] = typeof prefVal === typeof defaultVal ? prefVal : defaultVal;
13051
+ options[name] = typeof prefVal === typeof val ? prefVal : val;
12781
13052
  }
12782
- for (const [name, defaultVal] of Object.entries(this.#defaults)) {
13053
+ for (const [name, val] of Object.entries(this.#defaults)) {
12783
13054
  const prefVal = prefs?.[name];
12784
- options[name] = this.#prefs[name] = typeof prefVal === typeof defaultVal ? prefVal : defaultVal;
13055
+ options[name] = this.#prefs[name] = typeof prefVal === typeof val ? prefVal : val;
12785
13056
  }
12786
13057
  _app_options_js__WEBPACK_IMPORTED_MODULE_0__.AppOptions.setAll(options, true);
12787
13058
  });
@@ -12792,19 +13063,27 @@ class BasePreferences {
12792
13063
  async _readFromStorage(prefObj) {
12793
13064
  throw new Error("Not implemented: _readFromStorage");
12794
13065
  }
13066
+ #updatePref({
13067
+ name,
13068
+ value
13069
+ }) {
13070
+ throw new Error("Not implemented: #updatePref");
13071
+ }
12795
13072
  async reset() {
12796
13073
  await this.#initializedPromise;
12797
- const prefs = this.#prefs;
13074
+ const oldPrefs = structuredClone(this.#prefs);
12798
13075
  this.#prefs = Object.create(null);
12799
- return this._writeToStorage(this.#defaults).catch(reason => {
12800
- this.#prefs = prefs;
13076
+ try {
13077
+ await this._writeToStorage(this.#defaults);
13078
+ } catch (reason) {
13079
+ this.#prefs = oldPrefs;
12801
13080
  throw reason;
12802
- });
13081
+ }
12803
13082
  }
12804
13083
  async set(name, value) {
12805
13084
  await this.#initializedPromise;
12806
13085
  const defaultValue = this.#defaults[name],
12807
- prefs = this.#prefs;
13086
+ oldPrefs = structuredClone(this.#prefs);
12808
13087
  if (defaultValue === undefined) {
12809
13088
  throw new Error(`Set preference: "${name}" is undefined.`);
12810
13089
  } else if (value === undefined) {
@@ -12822,10 +13101,12 @@ class BasePreferences {
12822
13101
  throw new Error(`Set preference: "${value}" must be an integer.`);
12823
13102
  }
12824
13103
  this.#prefs[name] = value;
12825
- return this._writeToStorage(this.#prefs).catch(reason => {
12826
- this.#prefs = prefs;
13104
+ try {
13105
+ await this._writeToStorage(this.#prefs);
13106
+ } catch (reason) {
13107
+ this.#prefs = oldPrefs;
12827
13108
  throw reason;
12828
- });
13109
+ }
12829
13110
  }
12830
13111
  async get(name) {
12831
13112
  await this.#initializedPromise;
@@ -12843,16 +13124,16 @@ class BasePreferences {
12843
13124
 
12844
13125
  /***/ }),
12845
13126
 
12846
- /***/ 4552:
13127
+ /***/ 659:
12847
13128
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
12848
13129
 
12849
13130
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
12850
13131
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12851
13132
  /* harmony export */ getXfaHtmlForPrinting: () => (/* binding */ getXfaHtmlForPrinting)
12852
13133
  /* harmony export */ });
12853
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
12854
- /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3234);
12855
- /* harmony import */ var _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8012);
13134
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
13135
+ /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(787);
13136
+ /* harmony import */ var _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2973);
12856
13137
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__]);
12857
13138
  ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
12858
13139
 
@@ -12885,15 +13166,15 @@ __webpack_async_result__();
12885
13166
 
12886
13167
  /***/ }),
12887
13168
 
12888
- /***/ 1544:
13169
+ /***/ 1900:
12889
13170
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
12890
13171
 
12891
13172
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
12892
13173
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12893
13174
  /* harmony export */ SecondaryToolbar: () => (/* binding */ SecondaryToolbar)
12894
13175
  /* harmony export */ });
12895
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
12896
- /* harmony import */ var _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9290);
13176
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
13177
+ /* harmony import */ var _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6285);
12897
13178
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__]);
12898
13179
  _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
12899
13180
 
@@ -13169,13 +13450,13 @@ __webpack_async_result__();
13169
13450
 
13170
13451
  /***/ }),
13171
13452
 
13172
- /***/ 7498:
13453
+ /***/ 6698:
13173
13454
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13174
13455
 
13175
13456
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13176
13457
  /* harmony export */ StructTreeLayerBuilder: () => (/* binding */ StructTreeLayerBuilder)
13177
13458
  /* harmony export */ });
13178
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
13459
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
13179
13460
 
13180
13461
  const PDF_ROLE_TO_HTML_ROLE = {
13181
13462
  Document: null,
@@ -13293,13 +13574,13 @@ class StructTreeLayerBuilder {
13293
13574
 
13294
13575
  /***/ }),
13295
13576
 
13296
- /***/ 4630:
13577
+ /***/ 5860:
13297
13578
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13298
13579
 
13299
13580
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13300
13581
  /* harmony export */ TextAccessibilityManager: () => (/* binding */ TextAccessibilityManager)
13301
13582
  /* harmony export */ });
13302
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4927);
13583
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
13303
13584
 
13304
13585
  class TextAccessibilityManager {
13305
13586
  #enabled = false;
@@ -13454,7 +13735,7 @@ class TextAccessibilityManager {
13454
13735
 
13455
13736
  /***/ }),
13456
13737
 
13457
- /***/ 4274:
13738
+ /***/ 2027:
13458
13739
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13459
13740
 
13460
13741
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -13682,29 +13963,30 @@ class TextHighlighter {
13682
13963
 
13683
13964
  /***/ }),
13684
13965
 
13685
- /***/ 1013:
13966
+ /***/ 7765:
13686
13967
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
13687
13968
 
13688
13969
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
13689
13970
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13690
13971
  /* harmony export */ TextLayerBuilder: () => (/* binding */ TextLayerBuilder)
13691
13972
  /* harmony export */ });
13692
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
13693
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4927);
13973
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
13974
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
13694
13975
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
13695
13976
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
13696
13977
 
13697
13978
 
13698
13979
  class TextLayerBuilder {
13699
13980
  #enablePermissions = false;
13981
+ #onAppend = null;
13700
13982
  #rotation = 0;
13701
13983
  #scale = 0;
13702
13984
  #textContentSource = null;
13703
13985
  constructor({
13704
13986
  highlighter = null,
13705
13987
  accessibilityManager = null,
13706
- isOffscreenCanvasSupported = true,
13707
- enablePermissions = false
13988
+ enablePermissions = false,
13989
+ onAppend = null
13708
13990
  }) {
13709
13991
  this.textContentItemsStr = [];
13710
13992
  this.renderingDone = false;
@@ -13713,10 +13995,10 @@ class TextLayerBuilder {
13713
13995
  this.textLayerRenderTask = null;
13714
13996
  this.highlighter = highlighter;
13715
13997
  this.accessibilityManager = accessibilityManager;
13716
- this.isOffscreenCanvasSupported = isOffscreenCanvasSupported;
13717
13998
  this.#enablePermissions = enablePermissions === true;
13718
- this.onAppend = null;
13999
+ this.#onAppend = onAppend;
13719
14000
  this.div = document.createElement("div");
14001
+ this.div.tabIndex = 0;
13720
14002
  this.div.className = "textLayer";
13721
14003
  }
13722
14004
  #finishRendering() {
@@ -13747,7 +14029,6 @@ class TextLayerBuilder {
13747
14029
  viewport,
13748
14030
  textDivs: this.textDivs,
13749
14031
  textDivProperties: this.textDivProperties,
13750
- isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,
13751
14032
  mustRescale,
13752
14033
  mustRotate
13753
14034
  });
@@ -13766,14 +14047,13 @@ class TextLayerBuilder {
13766
14047
  viewport,
13767
14048
  textDivs: this.textDivs,
13768
14049
  textDivProperties: this.textDivProperties,
13769
- textContentItemsStr: this.textContentItemsStr,
13770
- isOffscreenCanvasSupported: this.isOffscreenCanvasSupported
14050
+ textContentItemsStr: this.textContentItemsStr
13771
14051
  });
13772
14052
  await this.textLayerRenderTask.promise;
13773
14053
  this.#finishRendering();
13774
14054
  this.#scale = scale;
13775
14055
  this.#rotation = rotation;
13776
- this.onAppend(this.div);
14056
+ this.#onAppend?.(this.div);
13777
14057
  this.highlighter?.enable();
13778
14058
  this.accessibilityManager?.enable();
13779
14059
  }
@@ -13846,15 +14126,15 @@ __webpack_async_result__();
13846
14126
 
13847
14127
  /***/ }),
13848
14128
 
13849
- /***/ 276:
14129
+ /***/ 6297:
13850
14130
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
13851
14131
 
13852
14132
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
13853
14133
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13854
14134
  /* harmony export */ Toolbar: () => (/* binding */ Toolbar)
13855
14135
  /* harmony export */ });
13856
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
13857
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4927);
14136
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
14137
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
13858
14138
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
13859
14139
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
13860
14140
 
@@ -13937,6 +14217,15 @@ class Toolbar {
13937
14217
  once: true
13938
14218
  });
13939
14219
  }
14220
+ eventBus._on("showannotationeditorui", ({
14221
+ mode
14222
+ }) => {
14223
+ switch (mode) {
14224
+ case pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.HIGHLIGHT:
14225
+ options.editorHighlightButton.click();
14226
+ break;
14227
+ }
14228
+ });
13940
14229
  this.reset();
13941
14230
  }
13942
14231
  #setAnnotationEditorUIManager(uiManager, parentContainer) {
@@ -14112,7 +14401,7 @@ __webpack_async_result__();
14112
14401
 
14113
14402
  /***/ }),
14114
14403
 
14115
- /***/ 4927:
14404
+ /***/ 7256:
14116
14405
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14117
14406
 
14118
14407
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -14289,15 +14578,13 @@ function parseQueryString(query) {
14289
14578
  }
14290
14579
  return params;
14291
14580
  }
14292
- const InvisibleCharactersRegExp = /[\x00-\x1F]/g;
14581
+ const InvisibleCharsRegExp = /[\x00-\x1F]/g;
14293
14582
  function removeNullCharacters(str, replaceInvisible = false) {
14294
- if (!InvisibleCharactersRegExp.test(str)) {
14583
+ if (!InvisibleCharsRegExp.test(str)) {
14295
14584
  return str;
14296
14585
  }
14297
14586
  if (replaceInvisible) {
14298
- return str.replaceAll(InvisibleCharactersRegExp, m => {
14299
- return m === "\x00" ? "" : " ";
14300
- });
14587
+ return str.replaceAll(InvisibleCharsRegExp, m => m === "\x00" ? "" : " ");
14301
14588
  }
14302
14589
  return str.replaceAll("\x00", "");
14303
14590
  }
@@ -14640,7 +14927,7 @@ function toggleExpandedBtn(button, toggle, view = null) {
14640
14927
 
14641
14928
  /***/ }),
14642
14929
 
14643
- /***/ 1096:
14930
+ /***/ 9226:
14644
14931
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14645
14932
 
14646
14933
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -14715,40 +15002,36 @@ class ViewHistory {
14715
15002
 
14716
15003
  /***/ }),
14717
15004
 
14718
- /***/ 6400:
15005
+ /***/ 2030:
14719
15006
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
14720
15007
 
14721
15008
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
14722
15009
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14723
- /* harmony export */ PDFViewerApplication: () => (/* reexport safe */ _app_js__WEBPACK_IMPORTED_MODULE_5__.PDFViewerApplication),
15010
+ /* harmony export */ PDFViewerApplication: () => (/* reexport safe */ _app_js__WEBPACK_IMPORTED_MODULE_3__.PDFViewerApplication),
14724
15011
  /* harmony export */ PDFViewerApplicationConstants: () => (/* binding */ AppConstants),
14725
- /* harmony export */ PDFViewerApplicationOptions: () => (/* reexport safe */ _app_options_js__WEBPACK_IMPORTED_MODULE_3__.AppOptions)
15012
+ /* harmony export */ PDFViewerApplicationOptions: () => (/* reexport safe */ _app_options_js__WEBPACK_IMPORTED_MODULE_1__.AppOptions)
14726
15013
  /* harmony export */ });
14727
- /* harmony import */ var web_com__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1546);
14728
- /* harmony import */ var web_print_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1834);
14729
- /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4927);
14730
- /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8961);
14731
- /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3234);
14732
- /* harmony import */ var _app_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(39);
14733
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([web_com__WEBPACK_IMPORTED_MODULE_0__, web_print_service__WEBPACK_IMPORTED_MODULE_1__, _app_js__WEBPACK_IMPORTED_MODULE_5__]);
14734
- ([web_com__WEBPACK_IMPORTED_MODULE_0__, web_print_service__WEBPACK_IMPORTED_MODULE_1__, _app_js__WEBPACK_IMPORTED_MODULE_5__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
14735
-
14736
-
15014
+ /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
15015
+ /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9840);
15016
+ /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(787);
15017
+ /* harmony import */ var _app_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1621);
15018
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_app_js__WEBPACK_IMPORTED_MODULE_3__]);
15019
+ _app_js__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
14737
15020
 
14738
15021
 
14739
15022
 
14740
15023
 
14741
- const pdfjsVersion = '4.0.379';
14742
- const pdfjsBuild = '9e14d04fd';
15024
+ const pdfjsVersion = "4.1.392";
15025
+ const pdfjsBuild = "fcb76a78d";
14743
15026
  const AppConstants = {
14744
- LinkTarget: _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_4__.LinkTarget,
14745
- RenderingStates: _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates,
14746
- ScrollMode: _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.ScrollMode,
14747
- SpreadMode: _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.SpreadMode
15027
+ LinkTarget: _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_2__.LinkTarget,
15028
+ RenderingStates: _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.RenderingStates,
15029
+ ScrollMode: _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode,
15030
+ SpreadMode: _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SpreadMode
14748
15031
  };
14749
- window.PDFViewerApplication = _app_js__WEBPACK_IMPORTED_MODULE_5__.PDFViewerApplication;
15032
+ window.PDFViewerApplication = _app_js__WEBPACK_IMPORTED_MODULE_3__.PDFViewerApplication;
14750
15033
  window.PDFViewerApplicationConstants = AppConstants;
14751
- window.PDFViewerApplicationOptions = _app_options_js__WEBPACK_IMPORTED_MODULE_3__.AppOptions;
15034
+ window.PDFViewerApplicationOptions = _app_options_js__WEBPACK_IMPORTED_MODULE_1__.AppOptions;
14752
15035
  function getViewerConfiguration() {
14753
15036
  return {
14754
15037
  appContainer: document.body,
@@ -14869,11 +15152,11 @@ function getViewerConfiguration() {
14869
15152
  editorInkColor: document.getElementById("editorInkColor"),
14870
15153
  editorInkThickness: document.getElementById("editorInkThickness"),
14871
15154
  editorInkOpacity: document.getElementById("editorInkOpacity"),
14872
- editorStampAddImage: document.getElementById("editorStampAddImage")
15155
+ editorStampAddImage: document.getElementById("editorStampAddImage"),
15156
+ editorFreeHighlightThickness: document.getElementById("editorFreeHighlightThickness"),
15157
+ editorHighlightShowAll: document.getElementById("editorHighlightShowAll")
14873
15158
  },
14874
- printContainer: document.getElementById("printContainer"),
14875
- openFileInput: document.getElementById("fileInput"),
14876
- debuggerScriptPath: "./debugger.mjs"
15159
+ printContainer: document.getElementById("printContainer")
14877
15160
  };
14878
15161
  }
14879
15162
  function webViewerLoad() {
@@ -14891,7 +15174,7 @@ function webViewerLoad() {
14891
15174
  console.error(`webviewerloaded: ${ex}`);
14892
15175
  document.dispatchEvent(event);
14893
15176
  }
14894
- _app_js__WEBPACK_IMPORTED_MODULE_5__.PDFViewerApplication.run(config);
15177
+ _app_js__WEBPACK_IMPORTED_MODULE_3__.PDFViewerApplication.run(config);
14895
15178
  }
14896
15179
  document.blockUnblockOnload?.(true);
14897
15180
  if (document.readyState === "interactive" || document.readyState === "complete") {
@@ -14905,14 +15188,14 @@ __webpack_async_result__();
14905
15188
 
14906
15189
  /***/ }),
14907
15190
 
14908
- /***/ 8012:
15191
+ /***/ 2973:
14909
15192
  /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
14910
15193
 
14911
15194
  __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
14912
15195
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14913
15196
  /* harmony export */ XfaLayerBuilder: () => (/* binding */ XfaLayerBuilder)
14914
15197
  /* harmony export */ });
14915
- /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
15198
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
14916
15199
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
14917
15200
  pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
14918
15201
 
@@ -15103,7 +15386,7 @@ __webpack_async_result__();
15103
15386
  /******/ // startup
15104
15387
  /******/ // Load entry module and return exports
15105
15388
  /******/ // This entry module used 'module' so it can't be inlined
15106
- /******/ var __webpack_exports__ = __webpack_require__(6400);
15389
+ /******/ var __webpack_exports__ = __webpack_require__(2030);
15107
15390
  /******/ __webpack_exports__ = await __webpack_exports__;
15108
15391
  /******/ var __webpack_exports__PDFViewerApplication = __webpack_exports__.PDFViewerApplication;
15109
15392
  /******/ var __webpack_exports__PDFViewerApplicationConstants = __webpack_exports__.PDFViewerApplicationConstants;