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AAnC,CAAd;EAOA,IAAI;IAIFC,MAAA,CAAOpC,QAAP,CAAgB2/B,aAAhB,CAA8B5e,KAA9B;EAJE,CAAJ,CAKE,OAAOlb,EAAP,EAAW;IAGXZ,OAAA,CAAQK,KAAR,CAAe,oBAAmBO,EAApB,EAAd;IACA7F,QAAA,CAAS2/B,aAAT,CAAuB5e,KAAvB;EAJW;EAOf3kB,yBAAA,CAAqB8Q,GAArB,CAAyBC,MAAzB;AA1BuB;AA+BzBnN,QAAA,CAAS+iB,kBAAT,GAA8B,IAA9B;AAEA,IACE/iB,QAAA,CAAS0vE,UAAT,KAAwB,aAAxB,IACA1vE,QAAA,CAAS0vE,UAAT,KAAwB,UAF1B,EAGE;EACAwJ,aAAA;AADA,CAHF,MAKO;EACLl5E,QAAA,CAASob,gBAAT,CAA0B,kBAA1B,EAA8C89D,aAA9C,EAA6D,IAA7D;AADK","sources":["webpack://pdf.js/web/genericcom.js","webpack://pdf.js/web/app.js","webpack://pdf.js/web/ui_utils.js","webpack://pdf.js/web/pdfjs.js","webpack://pdf.js/web/app_options.js","webpack://pdf.js/web/event_utils.js","webpack://pdf.js/web/pdf_link_service.js","webpack://pdf.js/web/annotation_editor_params.js","webpack://pdf.js/web/overlay_manager.js","webpack://pdf.js/web/password_prompt.js","webpack://pdf.js/web/pdf_attachment_viewer.js","webpack://pdf.js/web/base_tree_viewer.js","webpack://pdf.js/web/pdf_cursor_tools.js","webpack://pdf.js/web/grab_to_pan.js","webpack://pdf.js/web/pdf_document_properties.js","webpack://pdf.js/web/pdf_find_bar.js","webpack://pdf.js/web/pdf_find_controller.js","webpack://pdf.js/web/pdf_find_utils.js","webpack://pdf.js/web/pdf_history.js","webpack://pdf.js/web/pdf_layer_viewer.js","webpack://pdf.js/web/pdf_outline_viewer.js","webpack://pdf.js/web/pdf_presentation_mode.js","webpack://pdf.js/web/pdf_rendering_queue.js","webpack://pdf.js/web/pdf_scripting_manager.js","webpack://pdf.js/web/pdf_sidebar.js","webpack://pdf.js/web/pdf_thumbnail_viewer.js","webpack://pdf.js/web/pdf_thumbnail_view.js","webpack://pdf.js/web/pdf_viewer.js","webpack://pdf.js/web/l10n_utils.js","webpack://pdf.js/web/pdf_page_view.js","webpack://pdf.js/web/annotation_editor_layer_builder.js","webpack://pdf.js/web/annotation_layer_builder.js","webpack://pdf.js/web/struct_tree_layer_builder.js","webpack://pdf.js/web/text_accessibility.js","webpack://pdf.js/web/text_highlighter.js","webpack://pdf.js/web/text_layer_builder.js","webpack://pdf.js/web/xfa_layer_builder.js","webpack://pdf.js/web/secondary_toolbar.js","webpack://pdf.js/web/toolbar.js","webpack://pdf.js/web/view_history.js","webpack://pdf.js/web/preferences.js","webpack://pdf.js/web/download_manager.js","webpack://pdf.js/web/genericl10n.js","webpack://pdf.js/external/webL10n/l10n.js","webpack://pdf.js/web/generic_scripting.js","webpack://pdf.js/web/pdf_print_service.js","webpack://pdf.js/web/print_utils.js","webpack://pdf.js/webpack/bootstrap","webpack://pdf.js/web/viewer.js"],"sourcesContent":["/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DefaultExternalServices, PDFViewerApplication } from \"./app.js\";\nimport { BasePreferences } from \"./preferences.js\";\nimport { DownloadManager } from \"./download_manager.js\";\nimport { GenericL10n } from \"./genericl10n.js\";\nimport { GenericScripting } from \"./generic_scripting.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n throw new Error(\n 'Module \"pdfjs-web/genericcom\" shall not be used outside GENERIC build.'\n );\n}\n\nconst GenericCom = {};\n\nclass GenericPreferences extends BasePreferences {\n async _writeToStorage(prefObj) {\n localStorage.setItem(\"pdfjs.preferences\", JSON.stringify(prefObj));\n }\n\n async _readFromStorage(prefObj) {\n return JSON.parse(localStorage.getItem(\"pdfjs.preferences\"));\n }\n}\n\nclass GenericExternalServices extends DefaultExternalServices {\n static createDownloadManager() {\n return new DownloadManager();\n }\n\n static createPreferences() {\n return new GenericPreferences();\n }\n\n static createL10n({ locale = \"en-US\" }) {\n return new GenericL10n(locale);\n }\n\n static createScripting({ sandboxBundleSrc }) {\n return new GenericScripting(sandboxBundleSrc);\n }\n}\nPDFViewerApplication.externalServices = GenericExternalServices;\n\nexport { GenericCom };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n animationStarted,\n apiPageLayoutToViewerModes,\n apiPageModeToSidebarView,\n AutoPrintRegExp,\n CursorTool,\n DEFAULT_SCALE_VALUE,\n getActiveOrFocusedElement,\n isValidRotation,\n isValidScrollMode,\n isValidSpreadMode,\n normalizeWheelEventDirection,\n parseQueryString,\n ProgressBar,\n RenderingStates,\n ScrollMode,\n SidebarView,\n SpreadMode,\n TextLayerMode,\n} from \"./ui_utils.js\";\nimport {\n AnnotationEditorType,\n build,\n FeatureTest,\n getDocument,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n GlobalWorkerOptions,\n InvalidPDFException,\n isDataScheme,\n isPdfFile,\n loadScript,\n MissingPDFException,\n OPS,\n PDFWorker,\n PromiseCapability,\n shadow,\n UnexpectedResponseException,\n version,\n} from \"pdfjs-lib\";\nimport { AppOptions, OptionKind } from \"./app_options.js\";\nimport { AutomationEventBus, EventBus } from \"./event_utils.js\";\nimport { LinkTarget, PDFLinkService } from \"./pdf_link_service.js\";\nimport { AnnotationEditorParams } from \"web-annotation_editor_params\";\nimport { OverlayManager } from \"./overlay_manager.js\";\nimport { PasswordPrompt } from \"./password_prompt.js\";\nimport { PDFAttachmentViewer } from \"web-pdf_attachment_viewer\";\nimport { PDFCursorTools } from \"web-pdf_cursor_tools\";\nimport { PDFDocumentProperties } from \"web-pdf_document_properties\";\nimport { PDFFindBar } from \"web-pdf_find_bar\";\nimport { PDFFindController } from \"./pdf_find_controller.js\";\nimport { PDFHistory } from \"./pdf_history.js\";\nimport { PDFLayerViewer } from \"web-pdf_layer_viewer\";\nimport { PDFOutlineViewer } from \"web-pdf_outline_viewer\";\nimport { PDFPresentationMode } from \"web-pdf_presentation_mode\";\nimport { PDFRenderingQueue } from \"./pdf_rendering_queue.js\";\nimport { PDFScriptingManager } from \"./pdf_scripting_manager.js\";\nimport { PDFSidebar } from \"web-pdf_sidebar\";\nimport { PDFThumbnailViewer } from \"web-pdf_thumbnail_viewer\";\nimport { PDFViewer } from \"./pdf_viewer.js\";\nimport { SecondaryToolbar } from \"web-secondary_toolbar\";\nimport { Toolbar } from \"web-toolbar\";\nimport { ViewHistory } from \"./view_history.js\";\n\nconst FORCE_PAGES_LOADED_TIMEOUT = 10000; // ms\nconst WHEEL_ZOOM_DISABLED_TIMEOUT = 1000; // ms\n\nconst ViewOnLoad = {\n UNKNOWN: -1,\n PREVIOUS: 0, // Default value.\n INITIAL: 1,\n};\n\nconst ViewerCssTheme = {\n AUTOMATIC: 0, // Default value.\n LIGHT: 1,\n DARK: 2,\n};\n\nclass DefaultExternalServices {\n constructor() {\n throw new Error(\"Cannot initialize DefaultExternalServices.\");\n }\n\n static updateFindControlState(data) {}\n\n static updateFindMatchesCount(data) {}\n\n static initPassiveLoading(callbacks) {}\n\n static reportTelemetry(data) {}\n\n static createDownloadManager() {\n throw new Error(\"Not implemented: createDownloadManager\");\n }\n\n static createPreferences() {\n throw new Error(\"Not implemented: createPreferences\");\n }\n\n static createL10n(options) {\n throw new Error(\"Not implemented: createL10n\");\n }\n\n static createScripting(options) {\n throw new Error(\"Not implemented: createScripting\");\n }\n\n static get supportsPinchToZoom() {\n return shadow(this, \"supportsPinchToZoom\", true);\n }\n\n static get supportsIntegratedFind() {\n return shadow(this, \"supportsIntegratedFind\", false);\n }\n\n static get supportsDocumentFonts() {\n return shadow(this, \"supportsDocumentFonts\", true);\n }\n\n static get supportedMouseWheelZoomModifierKeys() {\n return shadow(this, \"supportedMouseWheelZoomModifierKeys\", {\n ctrlKey: true,\n metaKey: true,\n });\n }\n\n static get isInAutomation() {\n return shadow(this, \"isInAutomation\", false);\n }\n\n static updateEditorStates(data) {\n throw new Error(\"Not implemented: updateEditorStates\");\n }\n\n static get canvasMaxAreaInBytes() {\n return shadow(this, \"canvasMaxAreaInBytes\", -1);\n }\n\n static getNimbusExperimentData() {\n return shadow(this, \"getNimbusExperimentData\", Promise.resolve(null));\n }\n}\n\nconst PDFViewerApplication = {\n initialBookmark: document.location.hash.substring(1),\n _initializedCapability: new PromiseCapability(),\n appConfig: null,\n pdfDocument: null,\n pdfLoadingTask: null,\n printService: null,\n /** @type {PDFViewer} */\n pdfViewer: null,\n /** @type {PDFThumbnailViewer} */\n pdfThumbnailViewer: null,\n /** @type {PDFRenderingQueue} */\n pdfRenderingQueue: null,\n /** @type {PDFPresentationMode} */\n pdfPresentationMode: null,\n /** @type {PDFDocumentProperties} */\n pdfDocumentProperties: null,\n /** @type {PDFLinkService} */\n pdfLinkService: null,\n /** @type {PDFHistory} */\n pdfHistory: null,\n /** @type {PDFSidebar} */\n pdfSidebar: null,\n /** @type {PDFOutlineViewer} */\n pdfOutlineViewer: null,\n /** @type {PDFAttachmentViewer} */\n pdfAttachmentViewer: null,\n /** @type {PDFLayerViewer} */\n pdfLayerViewer: null,\n /** @type {PDFCursorTools} */\n pdfCursorTools: null,\n /** @type {PDFScriptingManager} */\n pdfScriptingManager: null,\n /** @type {ViewHistory} */\n store: null,\n /** @type {DownloadManager} */\n downloadManager: null,\n /** @type {OverlayManager} */\n overlayManager: null,\n /** @type {Preferences} */\n preferences: null,\n /** @type {Toolbar} */\n toolbar: null,\n /** @type {SecondaryToolbar} */\n secondaryToolbar: null,\n /** @type {EventBus} */\n eventBus: null,\n /** @type {IL10n} */\n l10n: null,\n /** @type {AnnotationEditorParams} */\n annotationEditorParams: null,\n isInitialViewSet: false,\n downloadComplete: false,\n isViewerEmbedded: window.parent !== window,\n url: \"\",\n baseUrl: \"\",\n _downloadUrl: \"\",\n externalServices: DefaultExternalServices,\n _boundEvents: Object.create(null),\n documentInfo: null,\n metadata: null,\n _contentDispositionFilename: null,\n _contentLength: null,\n _saveInProgress: false,\n _wheelUnusedTicks: 0,\n _wheelUnusedFactor: 1,\n _touchUnusedTicks: 0,\n _touchUnusedFactor: 1,\n _PDFBug: null,\n _hasAnnotationEditors: false,\n _title: document.title,\n _printAnnotationStoragePromise: null,\n _touchInfo: null,\n _isCtrlKeyDown: false,\n _nimbusDataPromise: null,\n\n // Called once when the document is loaded.\n async initialize(appConfig) {\n this.preferences = this.externalServices.createPreferences();\n this.appConfig = appConfig;\n\n if (\n typeof PDFJSDev === \"undefined\"\n ? window.isGECKOVIEW\n : PDFJSDev.test(\"GECKOVIEW\")\n ) {\n this._nimbusDataPromise = this.externalServices.getNimbusExperimentData();\n }\n\n await this._initializeOptions();\n this._forceCssTheme();\n await this._initializeL10n();\n\n if (\n this.isViewerEmbedded &&\n AppOptions.get(\"externalLinkTarget\") === LinkTarget.NONE\n ) {\n // Prevent external links from \"replacing\" the viewer,\n // when it's embedded in e.g. an <iframe> or an <object>.\n AppOptions.set(\"externalLinkTarget\", LinkTarget.TOP);\n }\n await this._initializeViewerComponents();\n\n // Bind the various event handlers *after* the viewer has been\n // initialized, to prevent errors if an event arrives too soon.\n this.bindEvents();\n this.bindWindowEvents();\n\n // We can start UI localization now.\n const appContainer = appConfig.appContainer || document.documentElement;\n this.l10n.translate(appContainer).then(() => {\n // Dispatch the 'localized' event on the `eventBus` once the viewer\n // has been fully initialized and translated.\n this.eventBus.dispatch(\"localized\", { source: this });\n });\n\n this._initializedCapability.resolve();\n },\n\n /**\n * @private\n */\n async _initializeOptions() {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (AppOptions.get(\"disablePreferences\")) {\n if (AppOptions.get(\"pdfBugEnabled\")) {\n await this._parseHashParams();\n }\n // Give custom implementations of the default viewer a simpler way to\n // opt-out of having the `Preferences` override existing `AppOptions`.\n return;\n }\n if (AppOptions._hasUserOptions()) {\n console.warn(\n \"_initializeOptions: The Preferences may override manually set AppOptions; \" +\n 'please use the \"disablePreferences\"-option in order to prevent that.'\n );\n }\n }\n try {\n AppOptions.setAll(await this.preferences.getAll());\n } catch (reason) {\n console.error(`_initializeOptions: \"${reason.message}\".`);\n }\n\n if (AppOptions.get(\"pdfBugEnabled\")) {\n await this._parseHashParams();\n }\n },\n\n /**\n * Potentially parse special debugging flags in the hash section of the URL.\n * @private\n */\n async _parseHashParams() {\n const hash = document.location.hash.substring(1);\n if (!hash) {\n return;\n }\n const { mainContainer, viewerContainer } = this.appConfig,\n params = parseQueryString(hash);\n\n if (params.get(\"disableworker\") === \"true\") {\n try {\n await loadFakeWorker();\n } catch (ex) {\n console.error(`_parseHashParams: \"${ex.message}\".`);\n }\n }\n if (params.has(\"disablerange\")) {\n AppOptions.set(\"disableRange\", params.get(\"disablerange\") === \"true\");\n }\n if (params.has(\"disablestream\")) {\n AppOptions.set(\"disableStream\", params.get(\"disablestream\") === \"true\");\n }\n if (params.has(\"disableautofetch\")) {\n AppOptions.set(\n \"disableAutoFetch\",\n params.get(\"disableautofetch\") === \"true\"\n );\n }\n if (params.has(\"disablefontface\")) {\n AppOptions.set(\n \"disableFontFace\",\n params.get(\"disablefontface\") === \"true\"\n );\n }\n if (params.has(\"disablehistory\")) {\n AppOptions.set(\"disableHistory\", params.get(\"disablehistory\") === \"true\");\n }\n if (params.has(\"verbosity\")) {\n AppOptions.set(\"verbosity\", params.get(\"verbosity\") | 0);\n }\n if (params.has(\"textlayer\")) {\n switch (params.get(\"textlayer\")) {\n case \"off\":\n AppOptions.set(\"textLayerMode\", TextLayerMode.DISABLE);\n break;\n case \"visible\":\n case \"shadow\":\n case \"hover\":\n viewerContainer.classList.add(`textLayer-${params.get(\"textlayer\")}`);\n try {\n await loadPDFBug(this);\n this._PDFBug.loadCSS();\n } catch (ex) {\n console.error(`_parseHashParams: \"${ex.message}\".`);\n }\n break;\n }\n }\n if (params.has(\"pdfbug\")) {\n AppOptions.set(\"pdfBug\", true);\n AppOptions.set(\"fontExtraProperties\", true);\n\n const enabled = params.get(\"pdfbug\").split(\",\");\n try {\n await loadPDFBug(this);\n this._PDFBug.init({ OPS }, mainContainer, enabled);\n } catch (ex) {\n console.error(`_parseHashParams: \"${ex.message}\".`);\n }\n }\n // It is not possible to change locale for the (various) extension builds.\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n params.has(\"locale\")\n ) {\n AppOptions.set(\"locale\", params.get(\"locale\"));\n }\n },\n\n /**\n * @private\n */\n async _initializeL10n() {\n this.l10n = this.externalServices.createL10n(\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? { locale: AppOptions.get(\"locale\") }\n : null\n );\n const dir = await this.l10n.getDirection();\n document.getElementsByTagName(\"html\")[0].dir = dir;\n },\n\n /**\n * @private\n */\n _forceCssTheme() {\n const cssTheme = AppOptions.get(\"viewerCssTheme\");\n if (\n cssTheme === ViewerCssTheme.AUTOMATIC ||\n !Object.values(ViewerCssTheme).includes(cssTheme)\n ) {\n return;\n }\n try {\n const styleSheet = document.styleSheets[0];\n const cssRules = styleSheet?.cssRules || [];\n for (let i = 0, ii = cssRules.length; i < ii; i++) {\n const rule = cssRules[i];\n if (\n rule instanceof CSSMediaRule &&\n rule.media?.[0] === \"(prefers-color-scheme: dark)\"\n ) {\n if (cssTheme === ViewerCssTheme.LIGHT) {\n styleSheet.deleteRule(i);\n return;\n }\n // cssTheme === ViewerCssTheme.DARK\n const darkRules =\n /^@media \\(prefers-color-scheme: dark\\) {\\n\\s*([\\w\\s-.,:;/\\\\{}()]+)\\n}$/.exec(\n rule.cssText\n );\n if (darkRules?.[1]) {\n styleSheet.deleteRule(i);\n styleSheet.insertRule(darkRules[1], i);\n }\n return;\n }\n }\n } catch (reason) {\n console.error(`_forceCssTheme: \"${reason?.message}\".`);\n }\n },\n\n /**\n * @private\n */\n async _initializeViewerComponents() {\n const { appConfig, externalServices, l10n } = this;\n\n const eventBus = externalServices.isInAutomation\n ? new AutomationEventBus()\n : new EventBus();\n this.eventBus = eventBus;\n\n this.overlayManager = new OverlayManager();\n\n const pdfRenderingQueue = new PDFRenderingQueue();\n pdfRenderingQueue.onIdle = this._cleanup.bind(this);\n this.pdfRenderingQueue = pdfRenderingQueue;\n\n const pdfLinkService = new PDFLinkService({\n eventBus,\n externalLinkTarget: AppOptions.get(\"externalLinkTarget\"),\n externalLinkRel: AppOptions.get(\"externalLinkRel\"),\n ignoreDestinationZoom: AppOptions.get(\"ignoreDestinationZoom\"),\n });\n this.pdfLinkService = pdfLinkService;\n\n const downloadManager = externalServices.createDownloadManager();\n this.downloadManager = downloadManager;\n\n const findController = new PDFFindController({\n linkService: pdfLinkService,\n eventBus,\n updateMatchesCountOnProgress:\n typeof PDFJSDev === \"undefined\"\n ? !window.isGECKOVIEW\n : !PDFJSDev.test(\"GECKOVIEW\"),\n });\n this.findController = findController;\n\n const pdfScriptingManager = new PDFScriptingManager({\n eventBus,\n sandboxBundleSrc:\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC || CHROME\")\n ? AppOptions.get(\"sandboxBundleSrc\")\n : null,\n scriptingFactory: externalServices,\n docPropertiesLookup: this._scriptingDocProperties.bind(this),\n });\n this.pdfScriptingManager = pdfScriptingManager;\n\n const container = appConfig.mainContainer,\n viewer = appConfig.viewerContainer;\n const annotationEditorMode = AppOptions.get(\"annotationEditorMode\");\n const pageColors =\n AppOptions.get(\"forcePageColors\") ||\n window.matchMedia(\"(forced-colors: active)\").matches\n ? {\n background: AppOptions.get(\"pageColorsBackground\"),\n foreground: AppOptions.get(\"pageColorsForeground\"),\n }\n : null;\n\n const pdfViewer = new PDFViewer({\n container,\n viewer,\n eventBus,\n renderingQueue: pdfRenderingQueue,\n linkService: pdfLinkService,\n downloadManager,\n findController,\n scriptingManager:\n AppOptions.get(\"enableScripting\") && pdfScriptingManager,\n l10n,\n textLayerMode: AppOptions.get(\"textLayerMode\"),\n annotationMode: AppOptions.get(\"annotationMode\"),\n annotationEditorMode,\n imageResourcesPath: AppOptions.get(\"imageResourcesPath\"),\n enablePrintAutoRotate: AppOptions.get(\"enablePrintAutoRotate\"),\n useOnlyCssZoom: AppOptions.get(\"useOnlyCssZoom\"),\n isOffscreenCanvasSupported: AppOptions.get(\"isOffscreenCanvasSupported\"),\n maxCanvasPixels: AppOptions.get(\"maxCanvasPixels\"),\n enablePermissions: AppOptions.get(\"enablePermissions\"),\n pageColors,\n });\n this.pdfViewer = pdfViewer;\n\n pdfRenderingQueue.setViewer(pdfViewer);\n pdfLinkService.setViewer(pdfViewer);\n pdfScriptingManager.setViewer(pdfViewer);\n\n if (appConfig.sidebar?.thumbnailView) {\n this.pdfThumbnailViewer = new PDFThumbnailViewer({\n container: appConfig.sidebar.thumbnailView,\n eventBus,\n renderingQueue: pdfRenderingQueue,\n linkService: pdfLinkService,\n l10n,\n pageColors,\n });\n pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer);\n }\n\n // The browsing history is only enabled when the viewer is standalone,\n // i.e. not when it is embedded in a web page.\n if (!this.isViewerEmbedded && !AppOptions.get(\"disableHistory\")) {\n this.pdfHistory = new PDFHistory({\n linkService: pdfLinkService,\n eventBus,\n });\n pdfLinkService.setHistory(this.pdfHistory);\n }\n\n if (!this.supportsIntegratedFind && appConfig.findBar) {\n this.findBar = new PDFFindBar(appConfig.findBar, eventBus, l10n);\n }\n\n if (appConfig.annotationEditorParams) {\n if (annotationEditorMode !== AnnotationEditorType.DISABLE) {\n this.annotationEditorParams = new AnnotationEditorParams(\n appConfig.annotationEditorParams,\n eventBus\n );\n } else {\n for (const id of [\"editorModeButtons\", \"editorModeSeparator\"]) {\n document.getElementById(id)?.classList.add(\"hidden\");\n }\n }\n }\n\n if (appConfig.documentProperties) {\n this.pdfDocumentProperties = new PDFDocumentProperties(\n appConfig.documentProperties,\n this.overlayManager,\n eventBus,\n l10n,\n /* fileNameLookup = */ () => this._docFilename\n );\n }\n\n // NOTE: The cursor-tools are unlikely to be helpful/useful in GeckoView,\n // in particular the `HandTool` which basically simulates touch scrolling.\n if (appConfig.secondaryToolbar?.cursorHandToolButton) {\n this.pdfCursorTools = new PDFCursorTools({\n container,\n eventBus,\n cursorToolOnLoad: AppOptions.get(\"cursorToolOnLoad\"),\n });\n }\n\n if (appConfig.toolbar) {\n if (\n typeof PDFJSDev === \"undefined\"\n ? window.isGECKOVIEW\n : PDFJSDev.test(\"GECKOVIEW\")\n ) {\n if (AppOptions.get(\"enableFloatingToolbar\")) {\n this.toolbar = new Toolbar(\n appConfig.toolbar,\n eventBus,\n l10n,\n await this._nimbusDataPromise,\n externalServices\n );\n }\n } else {\n this.toolbar = new Toolbar(appConfig.toolbar, eventBus, l10n);\n }\n }\n\n if (appConfig.secondaryToolbar) {\n this.secondaryToolbar = new SecondaryToolbar(\n appConfig.secondaryToolbar,\n eventBus,\n externalServices\n );\n }\n\n if (\n this.supportsFullscreen &&\n appConfig.secondaryToolbar?.presentationModeButton\n ) {\n this.pdfPresentationMode = new PDFPresentationMode({\n container,\n pdfViewer,\n eventBus,\n });\n }\n\n if (appConfig.passwordOverlay) {\n this.passwordPrompt = new PasswordPrompt(\n appConfig.passwordOverlay,\n this.overlayManager,\n l10n,\n this.isViewerEmbedded\n );\n }\n\n if (appConfig.sidebar?.outlineView) {\n this.pdfOutlineViewer = new PDFOutlineViewer({\n container: appConfig.sidebar.outlineView,\n eventBus,\n linkService: pdfLinkService,\n downloadManager,\n });\n }\n\n if (appConfig.sidebar?.attachmentsView) {\n this.pdfAttachmentViewer = new PDFAttachmentViewer({\n container: appConfig.sidebar.attachmentsView,\n eventBus,\n downloadManager,\n });\n }\n\n if (appConfig.sidebar?.layersView) {\n this.pdfLayerViewer = new PDFLayerViewer({\n container: appConfig.sidebar.layersView,\n eventBus,\n l10n,\n });\n }\n\n if (appConfig.sidebar) {\n this.pdfSidebar = new PDFSidebar({\n elements: appConfig.sidebar,\n eventBus,\n l10n,\n });\n this.pdfSidebar.onToggled = this.forceRendering.bind(this);\n this.pdfSidebar.onUpdateThumbnails = () => {\n // Use the rendered pages to set the corresponding thumbnail images.\n for (const pageView of pdfViewer.getCachedPageViews()) {\n if (pageView.renderingState === RenderingStates.FINISHED) {\n this.pdfThumbnailViewer\n .getThumbnail(pageView.id - 1)\n ?.setImage(pageView);\n }\n }\n this.pdfThumbnailViewer.scrollThumbnailIntoView(\n pdfViewer.currentPageNumber\n );\n };\n }\n },\n\n run(config) {\n this.initialize(config).then(webViewerInitialized);\n },\n\n get initialized() {\n return this._initializedCapability.settled;\n },\n\n get initializedPromise() {\n return this._initializedCapability.promise;\n },\n\n zoomIn(steps, scaleFactor) {\n if (this.pdfViewer.isInPresentationMode) {\n return;\n }\n this.pdfViewer.increaseScale({\n drawingDelay: AppOptions.get(\"defaultZoomDelay\"),\n steps,\n scaleFactor,\n });\n },\n\n zoomOut(steps, scaleFactor) {\n if (this.pdfViewer.isInPresentationMode) {\n return;\n }\n this.pdfViewer.decreaseScale({\n drawingDelay: AppOptions.get(\"defaultZoomDelay\"),\n steps,\n scaleFactor,\n });\n },\n\n zoomReset() {\n if (this.pdfViewer.isInPresentationMode) {\n return;\n }\n this.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;\n },\n\n get pagesCount() {\n return this.pdfDocument ? this.pdfDocument.numPages : 0;\n },\n\n get page() {\n return this.pdfViewer.currentPageNumber;\n },\n\n set page(val) {\n this.pdfViewer.currentPageNumber = val;\n },\n\n get supportsPrinting() {\n return PDFPrintServiceFactory.instance.supportsPrinting;\n },\n\n get supportsFullscreen() {\n return shadow(this, \"supportsFullscreen\", document.fullscreenEnabled);\n },\n\n get supportsPinchToZoom() {\n return this.externalServices.supportsPinchToZoom;\n },\n\n get supportsIntegratedFind() {\n return this.externalServices.supportsIntegratedFind;\n },\n\n get supportsDocumentFonts() {\n return this.externalServices.supportsDocumentFonts;\n },\n\n get loadingBar() {\n const barElement = document.getElementById(\"loadingBar\");\n const bar = barElement ? new ProgressBar(barElement) : null;\n return shadow(this, \"loadingBar\", bar);\n },\n\n get supportedMouseWheelZoomModifierKeys() {\n return this.externalServices.supportedMouseWheelZoomModifierKeys;\n },\n\n initPassiveLoading() {\n if (\n typeof PDFJSDev === \"undefined\" ||\n !PDFJSDev.test(\"MOZCENTRAL || CHROME\")\n ) {\n throw new Error(\"Not implemented: initPassiveLoading\");\n }\n this.externalServices.initPassiveLoading({\n onOpenWithTransport: range => {\n this.open({ range });\n },\n onOpenWithData: (data, contentDispositionFilename) => {\n if (isPdfFile(contentDispositionFilename)) {\n this._contentDispositionFilename = contentDispositionFilename;\n }\n this.open({ data });\n },\n onOpenWithURL: (url, length, originalUrl) => {\n this.open({ url, length, originalUrl });\n },\n onError: err => {\n this.l10n.get(\"loading_error\").then(msg => {\n this._documentError(msg, err);\n });\n },\n onProgress: (loaded, total) => {\n this.progress(loaded / total);\n },\n });\n },\n\n setTitleUsingUrl(url = \"\", downloadUrl = null) {\n this.url = url;\n this.baseUrl = url.split(\"#\")[0];\n if (downloadUrl) {\n this._downloadUrl =\n downloadUrl === url ? this.baseUrl : downloadUrl.split(\"#\")[0];\n }\n if (isDataScheme(url)) {\n this._hideViewBookmark();\n }\n let title = getPdfFilenameFromUrl(url, \"\");\n if (!title) {\n try {\n title = decodeURIComponent(getFilenameFromUrl(url)) || url;\n } catch (ex) {\n // decodeURIComponent may throw URIError,\n // fall back to using the unprocessed url in that case\n title = url;\n }\n }\n this.setTitle(title);\n },\n\n setTitle(title = this._title) {\n this._title = title;\n\n if (this.isViewerEmbedded) {\n // Embedded PDF viewers should not be changing their parent page's title.\n return;\n }\n const editorIndicator =\n this._hasAnnotationEditors && !this.pdfRenderingQueue.printing;\n document.title = `${editorIndicator ? \"* \" : \"\"}${title}`;\n },\n\n get _docFilename() {\n // Use `this.url` instead of `this.baseUrl` to perform filename detection\n // based on the reference fragment as ultimate fallback if needed.\n return this._contentDispositionFilename || getPdfFilenameFromUrl(this.url);\n },\n\n /**\n * @private\n */\n _hideViewBookmark() {\n const { secondaryToolbar } = this.appConfig;\n // URL does not reflect proper document location - hiding some buttons.\n secondaryToolbar?.viewBookmarkButton.classList.add(\"hidden\");\n\n // Avoid displaying multiple consecutive separators in the secondaryToolbar.\n if (secondaryToolbar?.presentationModeButton.classList.contains(\"hidden\")) {\n document.getElementById(\"viewBookmarkSeparator\")?.classList.add(\"hidden\");\n }\n },\n\n /**\n * Closes opened PDF document.\n * @returns {Promise} - Returns the promise, which is resolved when all\n * destruction is completed.\n */\n async close() {\n this._unblockDocumentLoadEvent();\n this._hideViewBookmark();\n\n if (!this.pdfLoadingTask) {\n return;\n }\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.pdfDocument?.annotationStorage.size > 0 &&\n this._annotationStorageModified\n ) {\n try {\n // Trigger saving, to prevent data loss in forms; see issue 12257.\n await this.save();\n } catch (reason) {\n // Ignoring errors, to ensure that document closing won't break.\n }\n }\n const promises = [];\n\n promises.push(this.pdfLoadingTask.destroy());\n this.pdfLoadingTask = null;\n\n if (this.pdfDocument) {\n this.pdfDocument = null;\n\n this.pdfThumbnailViewer?.setDocument(null);\n this.pdfViewer.setDocument(null);\n this.pdfLinkService.setDocument(null);\n this.pdfDocumentProperties?.setDocument(null);\n }\n this.pdfLinkService.externalLinkEnabled = true;\n this.store = null;\n this.isInitialViewSet = false;\n this.downloadComplete = false;\n this.url = \"\";\n this.baseUrl = \"\";\n this._downloadUrl = \"\";\n this.documentInfo = null;\n this.metadata = null;\n this._contentDispositionFilename = null;\n this._contentLength = null;\n this._saveInProgress = false;\n this._hasAnnotationEditors = false;\n\n promises.push(this.pdfScriptingManager.destroyPromise);\n\n this.setTitle();\n this.pdfSidebar?.reset();\n this.pdfOutlineViewer?.reset();\n this.pdfAttachmentViewer?.reset();\n this.pdfLayerViewer?.reset();\n\n this.pdfHistory?.reset();\n this.findBar?.reset();\n this.toolbar?.reset();\n this.secondaryToolbar?.reset();\n this._PDFBug?.cleanup();\n\n await Promise.all(promises);\n },\n\n /**\n * Opens a new PDF document.\n * @param {Object} args - Accepts any/all of the properties from\n * {@link DocumentInitParameters}, and also a `originalUrl` string.\n * @returns {Promise} - Promise that is resolved when the document is opened.\n */\n async open(args) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n let deprecatedArgs = false;\n if (typeof args === \"string\") {\n args = { url: args }; // URL\n deprecatedArgs = true;\n } else if (args?.byteLength) {\n args = { data: args }; // ArrayBuffer\n deprecatedArgs = true;\n }\n if (deprecatedArgs) {\n console.error(\n \"The `PDFViewerApplication.open` signature was updated, please use an object instead.\"\n );\n }\n }\n\n if (this.pdfLoadingTask) {\n // We need to destroy already opened document.\n await this.close();\n }\n // Set the necessary global worker parameters, using the available options.\n const workerParams = AppOptions.getAll(OptionKind.WORKER);\n Object.assign(GlobalWorkerOptions, workerParams);\n\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n args.url\n ) {\n // The Firefox built-in viewer always calls `setTitleUsingUrl`, before\n // `initPassiveLoading`, and it never provides an `originalUrl` here.\n this.setTitleUsingUrl(\n args.originalUrl || args.url,\n /* downloadUrl = */ args.url\n );\n }\n // Set the necessary API parameters, using all the available options.\n const apiParams = AppOptions.getAll(OptionKind.API);\n const params = {\n canvasMaxAreaInBytes: this.externalServices.canvasMaxAreaInBytes,\n ...apiParams,\n ...args,\n };\n\n if (typeof PDFJSDev === \"undefined\") {\n params.docBaseUrl ||= document.URL.split(\"#\")[0];\n } else if (PDFJSDev.test(\"MOZCENTRAL || CHROME\")) {\n params.docBaseUrl ||= this.baseUrl;\n }\n const loadingTask = getDocument(params);\n this.pdfLoadingTask = loadingTask;\n\n loadingTask.onPassword = (updateCallback, reason) => {\n if (this.isViewerEmbedded) {\n // The load event can't be triggered until the password is entered, so\n // if the viewer is in an iframe and its visibility depends on the\n // onload callback then the viewer never shows (bug 1801341).\n this._unblockDocumentLoadEvent();\n }\n\n this.pdfLinkService.externalLinkEnabled = false;\n this.passwordPrompt.setUpdateCallback(updateCallback, reason);\n this.passwordPrompt.open();\n };\n\n loadingTask.onProgress = ({ loaded, total }) => {\n this.progress(loaded / total);\n };\n\n return loadingTask.promise.then(\n pdfDocument => {\n this.load(pdfDocument);\n },\n reason => {\n if (loadingTask !== this.pdfLoadingTask) {\n return undefined; // Ignore errors for previously opened PDF files.\n }\n\n let key = \"loading_error\";\n if (reason instanceof InvalidPDFException) {\n key = \"invalid_file_error\";\n } else if (reason instanceof MissingPDFException) {\n key = \"missing_file_error\";\n } else if (reason instanceof UnexpectedResponseException) {\n key = \"unexpected_response_error\";\n }\n return this.l10n.get(key).then(msg => {\n this._documentError(msg, { message: reason?.message });\n throw reason;\n });\n }\n );\n },\n\n /**\n * @private\n */\n _ensureDownloadComplete() {\n if (this.pdfDocument && this.downloadComplete) {\n return;\n }\n throw new Error(\"PDF document not downloaded.\");\n },\n\n async download(options = {}) {\n const url = this._downloadUrl,\n filename = this._docFilename;\n try {\n this._ensureDownloadComplete();\n\n const data = await this.pdfDocument.getData();\n const blob = new Blob([data], { type: \"application/pdf\" });\n\n await this.downloadManager.download(blob, url, filename, options);\n } catch (reason) {\n // When the PDF document isn't ready, or the PDF file is still\n // downloading, simply download using the URL.\n await this.downloadManager.downloadUrl(url, filename, options);\n }\n },\n\n async save(options = {}) {\n if (this._saveInProgress) {\n return;\n }\n this._saveInProgress = true;\n await this.pdfScriptingManager.dispatchWillSave();\n\n const url = this._downloadUrl,\n filename = this._docFilename;\n try {\n this._ensureDownloadComplete();\n\n const data = await this.pdfDocument.saveDocument();\n const blob = new Blob([data], { type: \"application/pdf\" });\n\n await this.downloadManager.download(blob, url, filename, options);\n } catch (reason) {\n // When the PDF document isn't ready, or the PDF file is still\n // downloading, simply fallback to a \"regular\" download.\n console.error(`Error when saving the document: ${reason.message}`);\n await this.download(options);\n } finally {\n await this.pdfScriptingManager.dispatchDidSave();\n this._saveInProgress = false;\n }\n\n if (this._hasAnnotationEditors) {\n this.externalServices.reportTelemetry({\n type: \"editing\",\n data: { type: \"save\" },\n });\n }\n },\n\n downloadOrSave(options = {}) {\n if (this.pdfDocument?.annotationStorage.size > 0) {\n this.save(options);\n } else {\n this.download(options);\n }\n },\n\n openInExternalApp() {\n this.downloadOrSave({ openInExternalApp: true });\n },\n\n /**\n * Report the error; used for errors affecting loading and/or parsing of\n * the entire PDF document.\n */\n _documentError(message, moreInfo = null) {\n this._unblockDocumentLoadEvent();\n\n this._otherError(message, moreInfo);\n\n this.eventBus.dispatch(\"documenterror\", {\n source: this,\n message,\n reason: moreInfo?.message ?? null,\n });\n },\n\n /**\n * Report the error; used for errors affecting e.g. only a single page.\n * @param {string} message - A message that is human readable.\n * @param {Object} [moreInfo] - Further information about the error that is\n * more technical. Should have a 'message' and\n * optionally a 'stack' property.\n */\n _otherError(message, moreInfo = null) {\n const moreInfoText = [`PDF.js v${version || \"?\"} (build: ${build || \"?\"})`];\n if (moreInfo) {\n moreInfoText.push(`Message: ${moreInfo.message}`);\n\n if (moreInfo.stack) {\n moreInfoText.push(`Stack: ${moreInfo.stack}`);\n } else {\n if (moreInfo.filename) {\n moreInfoText.push(`File: ${moreInfo.filename}`);\n }\n if (moreInfo.lineNumber) {\n moreInfoText.push(`Line: ${moreInfo.lineNumber}`);\n }\n }\n }\n\n console.error(`${message}\\n\\n${moreInfoText.join(\"\\n\")}`);\n },\n\n progress(level) {\n if (!this.loadingBar || this.downloadComplete) {\n // Don't accidentally show the loading bar again when the entire file has\n // already been fetched (only an issue when disableAutoFetch is enabled).\n return;\n }\n const percent = Math.round(level * 100);\n // When we transition from full request to range requests, it's possible\n // that we discard some of the loaded data. This can cause the loading\n // bar to move backwards. So prevent this by only updating the bar if it\n // increases.\n if (percent <= this.loadingBar.percent) {\n return;\n }\n this.loadingBar.percent = percent;\n\n // When disableAutoFetch is enabled, it's not uncommon for the entire file\n // to never be fetched (depends on e.g. the file structure). In this case\n // the loading bar will not be completely filled, nor will it be hidden.\n // To prevent displaying a partially filled loading bar permanently, we\n // hide it when no data has been loaded during a certain amount of time.\n if (\n this.pdfDocument?.loadingParams.disableAutoFetch ??\n AppOptions.get(\"disableAutoFetch\")\n ) {\n this.loadingBar.setDisableAutoFetch();\n }\n },\n\n load(pdfDocument) {\n this.pdfDocument = pdfDocument;\n\n pdfDocument.getDownloadInfo().then(({ length }) => {\n this._contentLength = length; // Ensure that the correct length is used.\n this.downloadComplete = true;\n this.loadingBar?.hide();\n\n firstPagePromise.then(() => {\n this.eventBus.dispatch(\"documentloaded\", { source: this });\n });\n });\n\n // Since the `setInitialView` call below depends on this being resolved,\n // fetch it early to avoid delaying initial rendering of the PDF document.\n const pageLayoutPromise = pdfDocument.getPageLayout().catch(function () {\n /* Avoid breaking initial rendering; ignoring errors. */\n });\n const pageModePromise = pdfDocument.getPageMode().catch(function () {\n /* Avoid breaking initial rendering; ignoring errors. */\n });\n const openActionPromise = pdfDocument.getOpenAction().catch(function () {\n /* Avoid breaking initial rendering; ignoring errors. */\n });\n\n this.toolbar?.setPagesCount(pdfDocument.numPages, false);\n this.secondaryToolbar?.setPagesCount(pdfDocument.numPages);\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\")) {\n const baseUrl = location.href.split(\"#\")[0];\n // Ignore \"data:\"-URLs for performance reasons, even though it may cause\n // internal links to not work perfectly in all cases (see bug 1803050).\n this.pdfLinkService.setDocument(\n pdfDocument,\n isDataScheme(baseUrl) ? null : baseUrl\n );\n } else {\n this.pdfLinkService.setDocument(pdfDocument);\n }\n this.pdfDocumentProperties?.setDocument(pdfDocument);\n\n const pdfViewer = this.pdfViewer;\n pdfViewer.setDocument(pdfDocument);\n const { firstPagePromise, onePageRendered, pagesPromise } = pdfViewer;\n\n this.pdfThumbnailViewer?.setDocument(pdfDocument);\n\n const storedPromise = (this.store = new ViewHistory(\n pdfDocument.fingerprints[0]\n ))\n .getMultiple({\n page: null,\n zoom: DEFAULT_SCALE_VALUE,\n scrollLeft: \"0\",\n scrollTop: \"0\",\n rotation: null,\n sidebarView: SidebarView.UNKNOWN,\n scrollMode: ScrollMode.UNKNOWN,\n spreadMode: SpreadMode.UNKNOWN,\n })\n .catch(() => {\n /* Unable to read from storage; ignoring errors. */\n return Object.create(null);\n });\n\n firstPagePromise.then(pdfPage => {\n this.loadingBar?.setWidth(this.appConfig.viewerContainer);\n this._initializeAnnotationStorageCallbacks(pdfDocument);\n\n Promise.all([\n animationStarted,\n storedPromise,\n pageLayoutPromise,\n pageModePromise,\n openActionPromise,\n ])\n .then(async ([timeStamp, stored, pageLayout, pageMode, openAction]) => {\n const viewOnLoad = AppOptions.get(\"viewOnLoad\");\n\n this._initializePdfHistory({\n fingerprint: pdfDocument.fingerprints[0],\n viewOnLoad,\n initialDest: openAction?.dest,\n });\n const initialBookmark = this.initialBookmark;\n\n // Initialize the default values, from user preferences.\n const zoom = AppOptions.get(\"defaultZoomValue\");\n let hash = zoom ? `zoom=${zoom}` : null;\n\n let rotation = null;\n let sidebarView = AppOptions.get(\"sidebarViewOnLoad\");\n let scrollMode = AppOptions.get(\"scrollModeOnLoad\");\n let spreadMode = AppOptions.get(\"spreadModeOnLoad\");\n\n if (stored.page && viewOnLoad !== ViewOnLoad.INITIAL) {\n hash =\n `page=${stored.page}&zoom=${zoom || stored.zoom},` +\n `${stored.scrollLeft},${stored.scrollTop}`;\n\n rotation = parseInt(stored.rotation, 10);\n // Always let user preference take precedence over the view history.\n if (sidebarView === SidebarView.UNKNOWN) {\n sidebarView = stored.sidebarView | 0;\n }\n if (scrollMode === ScrollMode.UNKNOWN) {\n scrollMode = stored.scrollMode | 0;\n }\n if (spreadMode === SpreadMode.UNKNOWN) {\n spreadMode = stored.spreadMode | 0;\n }\n }\n // NOTE: Ignore the pageMode/pageLayout in GeckoView since there's no\n // sidebar available, nor any UI for changing the Scroll/Spread modes.\n if (\n typeof PDFJSDev === \"undefined\"\n ? !window.isGECKOVIEW\n : !PDFJSDev.test(\"GECKOVIEW\")\n ) {\n // Always let the user preference/view history take precedence.\n if (pageMode && sidebarView === SidebarView.UNKNOWN) {\n sidebarView = apiPageModeToSidebarView(pageMode);\n }\n if (\n pageLayout &&\n scrollMode === ScrollMode.UNKNOWN &&\n spreadMode === SpreadMode.UNKNOWN\n ) {\n const modes = apiPageLayoutToViewerModes(pageLayout);\n // TODO: Try to improve page-switching when using the mouse-wheel\n // and/or arrow-keys before allowing the document to control this.\n // scrollMode = modes.scrollMode;\n spreadMode = modes.spreadMode;\n }\n }\n\n this.setInitialView(hash, {\n rotation,\n sidebarView,\n scrollMode,\n spreadMode,\n });\n this.eventBus.dispatch(\"documentinit\", { source: this });\n // Make all navigation keys work on document load,\n // unless the viewer is embedded in a web page.\n if (!this.isViewerEmbedded) {\n pdfViewer.focus();\n }\n\n // For documents with different page sizes, once all pages are\n // resolved, ensure that the correct location becomes visible on load.\n // (To reduce the risk, in very large and/or slow loading documents,\n // that the location changes *after* the user has started interacting\n // with the viewer, wait for either `pagesPromise` or a timeout.)\n await Promise.race([\n pagesPromise,\n new Promise(resolve => {\n setTimeout(resolve, FORCE_PAGES_LOADED_TIMEOUT);\n }),\n ]);\n if (!initialBookmark && !hash) {\n return;\n }\n if (pdfViewer.hasEqualPageSizes) {\n return;\n }\n this.initialBookmark = initialBookmark;\n\n // eslint-disable-next-line no-self-assign\n pdfViewer.currentScaleValue = pdfViewer.currentScaleValue;\n // Re-apply the initial document location.\n this.setInitialView(hash);\n })\n .catch(() => {\n // Ensure that the document is always completely initialized,\n // even if there are any errors thrown above.\n this.setInitialView();\n })\n .then(function () {\n // At this point, rendering of the initial page(s) should always have\n // started (and may even have completed).\n // To prevent any future issues, e.g. the document being completely\n // blank on load, always trigger rendering here.\n pdfViewer.update();\n });\n });\n\n pagesPromise.then(\n () => {\n this._unblockDocumentLoadEvent();\n\n this._initializeAutoPrint(pdfDocument, openActionPromise);\n },\n reason => {\n this.l10n.get(\"loading_error\").then(msg => {\n this._documentError(msg, { message: reason?.message });\n });\n }\n );\n\n onePageRendered.then(data => {\n this.externalServices.reportTelemetry({\n type: \"pageInfo\",\n timestamp: data.timestamp,\n });\n\n if (this.pdfOutlineViewer) {\n pdfDocument.getOutline().then(outline => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the outline resolved.\n }\n this.pdfOutlineViewer.render({ outline, pdfDocument });\n });\n }\n if (this.pdfAttachmentViewer) {\n pdfDocument.getAttachments().then(attachments => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the attachments resolved.\n }\n this.pdfAttachmentViewer.render({ attachments });\n });\n }\n if (this.pdfLayerViewer) {\n // Ensure that the layers accurately reflects the current state in the\n // viewer itself, rather than the default state provided by the API.\n pdfViewer.optionalContentConfigPromise.then(optionalContentConfig => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the layers resolved.\n }\n this.pdfLayerViewer.render({ optionalContentConfig, pdfDocument });\n });\n }\n });\n\n this._initializePageLabels(pdfDocument);\n this._initializeMetadata(pdfDocument);\n },\n\n /**\n * @private\n */\n async _scriptingDocProperties(pdfDocument) {\n if (!this.documentInfo) {\n // It should be *extremely* rare for metadata to not have been resolved\n // when this code runs, but ensure that we handle that case here.\n await new Promise(resolve => {\n this.eventBus._on(\"metadataloaded\", resolve, { once: true });\n });\n if (pdfDocument !== this.pdfDocument) {\n return null; // The document was closed while the metadata resolved.\n }\n }\n if (!this._contentLength) {\n // Always waiting for the entire PDF document to be loaded will, most\n // likely, delay sandbox-creation too much in the general case for all\n // PDF documents which are not provided as binary data to the API.\n // Hence we'll simply have to trust that the `contentLength` (as provided\n // by the server), when it exists, is accurate enough here.\n await new Promise(resolve => {\n this.eventBus._on(\"documentloaded\", resolve, { once: true });\n });\n if (pdfDocument !== this.pdfDocument) {\n return null; // The document was closed while the downloadInfo resolved.\n }\n }\n\n return {\n ...this.documentInfo,\n baseURL: this.baseUrl,\n filesize: this._contentLength,\n filename: this._docFilename,\n metadata: this.metadata?.getRaw(),\n authors: this.metadata?.get(\"dc:creator\"),\n numPages: this.pagesCount,\n URL: this.url,\n };\n },\n\n /**\n * @private\n */\n async _initializeAutoPrint(pdfDocument, openActionPromise) {\n const [openAction, javaScript] = await Promise.all([\n openActionPromise,\n !this.pdfViewer.enableScripting ? pdfDocument.getJavaScript() : null,\n ]);\n\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the auto print data resolved.\n }\n let triggerAutoPrint = false;\n\n if (openAction?.action === \"Print\") {\n triggerAutoPrint = true;\n }\n if (javaScript) {\n javaScript.some(js => {\n if (!js) {\n // Don't warn/fallback for empty JavaScript actions.\n return false;\n }\n console.warn(\"Warning: JavaScript support is not enabled\");\n return true;\n });\n\n if (!triggerAutoPrint) {\n // Hack to support auto printing.\n for (const js of javaScript) {\n if (js && AutoPrintRegExp.test(js)) {\n triggerAutoPrint = true;\n break;\n }\n }\n }\n }\n\n if (triggerAutoPrint) {\n this.triggerPrinting();\n }\n },\n\n /**\n * @private\n */\n async _initializeMetadata(pdfDocument) {\n const { info, metadata, contentDispositionFilename, contentLength } =\n await pdfDocument.getMetadata();\n\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the metadata resolved.\n }\n this.documentInfo = info;\n this.metadata = metadata;\n this._contentDispositionFilename ??= contentDispositionFilename;\n this._contentLength ??= contentLength; // See `getDownloadInfo`-call above.\n\n // Provides some basic debug information\n console.log(\n `PDF ${pdfDocument.fingerprints[0]} [${info.PDFFormatVersion} ` +\n `${(info.Producer || \"-\").trim()} / ${(info.Creator || \"-\").trim()}] ` +\n `(PDF.js: ${version || \"?\"} [${build || \"?\"}])`\n );\n let pdfTitle = info.Title;\n\n const metadataTitle = metadata?.get(\"dc:title\");\n if (metadataTitle) {\n // Ghostscript can produce invalid 'dc:title' Metadata entries:\n // - The title may be \"Untitled\" (fixes bug 1031612).\n // - The title may contain incorrectly encoded characters, which thus\n // looks broken, hence we ignore the Metadata entry when it contains\n // characters from the Specials Unicode block (fixes bug 1605526).\n if (\n metadataTitle !== \"Untitled\" &&\n !/[\\uFFF0-\\uFFFF]/g.test(metadataTitle)\n ) {\n pdfTitle = metadataTitle;\n }\n }\n if (pdfTitle) {\n this.setTitle(\n `${pdfTitle} - ${this._contentDispositionFilename || this._title}`\n );\n } else if (this._contentDispositionFilename) {\n this.setTitle(this._contentDispositionFilename);\n }\n\n if (\n info.IsXFAPresent &&\n !info.IsAcroFormPresent &&\n !pdfDocument.isPureXfa\n ) {\n if (pdfDocument.loadingParams.enableXfa) {\n console.warn(\"Warning: XFA Foreground documents are not supported\");\n } else {\n console.warn(\"Warning: XFA support is not enabled\");\n }\n } else if (\n (info.IsAcroFormPresent || info.IsXFAPresent) &&\n !this.pdfViewer.renderForms\n ) {\n console.warn(\"Warning: Interactive form support is not enabled\");\n }\n\n if (info.IsSignaturesPresent) {\n console.warn(\"Warning: Digital signatures validation is not supported\");\n }\n\n this.eventBus.dispatch(\"metadataloaded\", { source: this });\n },\n\n /**\n * @private\n */\n async _initializePageLabels(pdfDocument) {\n if (\n typeof PDFJSDev === \"undefined\"\n ? window.isGECKOVIEW\n : PDFJSDev.test(\"GECKOVIEW\")\n ) {\n return;\n }\n const labels = await pdfDocument.getPageLabels();\n\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the page labels resolved.\n }\n if (!labels || AppOptions.get(\"disablePageLabels\")) {\n return;\n }\n const numLabels = labels.length;\n // Ignore page labels that correspond to standard page numbering,\n // or page labels that are all empty.\n let standardLabels = 0,\n emptyLabels = 0;\n for (let i = 0; i < numLabels; i++) {\n const label = labels[i];\n if (label === (i + 1).toString()) {\n standardLabels++;\n } else if (label === \"\") {\n emptyLabels++;\n } else {\n break;\n }\n }\n if (standardLabels >= numLabels || emptyLabels >= numLabels) {\n return;\n }\n const { pdfViewer, pdfThumbnailViewer, toolbar } = this;\n\n pdfViewer.setPageLabels(labels);\n pdfThumbnailViewer?.setPageLabels(labels);\n\n // Changing toolbar page display to use labels and we need to set\n // the label of the current page.\n toolbar?.setPagesCount(numLabels, true);\n toolbar?.setPageNumber(\n pdfViewer.currentPageNumber,\n pdfViewer.currentPageLabel\n );\n },\n\n /**\n * @private\n */\n _initializePdfHistory({ fingerprint, viewOnLoad, initialDest = null }) {\n if (!this.pdfHistory) {\n return;\n }\n this.pdfHistory.initialize({\n fingerprint,\n resetHistory: viewOnLoad === ViewOnLoad.INITIAL,\n updateUrl: AppOptions.get(\"historyUpdateUrl\"),\n });\n\n if (this.pdfHistory.initialBookmark) {\n this.initialBookmark = this.pdfHistory.initialBookmark;\n\n this.initialRotation = this.pdfHistory.initialRotation;\n }\n\n // Always let the browser history/document hash take precedence.\n if (\n initialDest &&\n !this.initialBookmark &&\n viewOnLoad === ViewOnLoad.UNKNOWN\n ) {\n this.initialBookmark = JSON.stringify(initialDest);\n // TODO: Re-factor the `PDFHistory` initialization to remove this hack\n // that's currently necessary to prevent weird initial history state.\n this.pdfHistory.push({ explicitDest: initialDest, pageNumber: null });\n }\n },\n\n /**\n * @private\n */\n _initializeAnnotationStorageCallbacks(pdfDocument) {\n if (pdfDocument !== this.pdfDocument) {\n return;\n }\n const { annotationStorage } = pdfDocument;\n\n annotationStorage.onSetModified = () => {\n window.addEventListener(\"beforeunload\", beforeUnload);\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this._annotationStorageModified = true;\n }\n };\n annotationStorage.onResetModified = () => {\n window.removeEventListener(\"beforeunload\", beforeUnload);\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n delete this._annotationStorageModified;\n }\n };\n annotationStorage.onAnnotationEditor = typeStr => {\n this._hasAnnotationEditors = !!typeStr;\n this.setTitle();\n\n if (typeStr) {\n this.externalServices.reportTelemetry({\n type: \"editing\",\n data: { type: typeStr },\n });\n }\n };\n },\n\n setInitialView(\n storedHash,\n { rotation, sidebarView, scrollMode, spreadMode } = {}\n ) {\n const setRotation = angle => {\n if (isValidRotation(angle)) {\n this.pdfViewer.pagesRotation = angle;\n }\n };\n const setViewerModes = (scroll, spread) => {\n if (isValidScrollMode(scroll)) {\n this.pdfViewer.scrollMode = scroll;\n }\n if (isValidSpreadMode(spread)) {\n this.pdfViewer.spreadMode = spread;\n }\n };\n this.isInitialViewSet = true;\n this.pdfSidebar?.setInitialView(sidebarView);\n\n setViewerModes(scrollMode, spreadMode);\n\n if (this.initialBookmark) {\n setRotation(this.initialRotation);\n delete this.initialRotation;\n\n this.pdfLinkService.setHash(this.initialBookmark);\n this.initialBookmark = null;\n } else if (storedHash) {\n setRotation(rotation);\n\n this.pdfLinkService.setHash(storedHash);\n }\n\n // Ensure that the correct page number is displayed in the UI,\n // even if the active page didn't change during document load.\n this.toolbar?.setPageNumber(\n this.pdfViewer.currentPageNumber,\n this.pdfViewer.currentPageLabel\n );\n this.secondaryToolbar?.setPageNumber(this.pdfViewer.currentPageNumber);\n\n if (!this.pdfViewer.currentScaleValue) {\n // Scale was not initialized: invalid bookmark or scale was not specified.\n // Setting the default one.\n this.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;\n }\n },\n\n /**\n * @private\n */\n _cleanup() {\n if (!this.pdfDocument) {\n return; // run cleanup when document is loaded\n }\n this.pdfViewer.cleanup();\n this.pdfThumbnailViewer?.cleanup();\n\n this.pdfDocument.cleanup();\n },\n\n forceRendering() {\n this.pdfRenderingQueue.printing = !!this.printService;\n this.pdfRenderingQueue.isThumbnailViewEnabled =\n this.pdfSidebar?.visibleView === SidebarView.THUMBS;\n this.pdfRenderingQueue.renderHighestPriority();\n },\n\n beforePrint() {\n this._printAnnotationStoragePromise = this.pdfScriptingManager\n .dispatchWillPrint()\n .catch(() => {\n /* Avoid breaking printing; ignoring errors. */\n })\n .then(() => {\n return this.pdfDocument?.annotationStorage.print;\n });\n\n if (this.printService) {\n // There is no way to suppress beforePrint/afterPrint events,\n // but PDFPrintService may generate double events -- this will ignore\n // the second event that will be coming from native window.print().\n return;\n }\n\n if (!this.supportsPrinting) {\n this.l10n.get(\"printing_not_supported\").then(msg => {\n this._otherError(msg);\n });\n return;\n }\n\n // The beforePrint is a sync method and we need to know layout before\n // returning from this method. Ensure that we can get sizes of the pages.\n if (!this.pdfViewer.pageViewsReady) {\n this.l10n.get(\"printing_not_ready\").then(msg => {\n // eslint-disable-next-line no-alert\n window.alert(msg);\n });\n return;\n }\n\n const pagesOverview = this.pdfViewer.getPagesOverview();\n const printContainer = this.appConfig.printContainer;\n const printResolution = AppOptions.get(\"printResolution\");\n const optionalContentConfigPromise =\n this.pdfViewer.optionalContentConfigPromise;\n\n const printService = PDFPrintServiceFactory.instance.createPrintService(\n this.pdfDocument,\n pagesOverview,\n printContainer,\n printResolution,\n optionalContentConfigPromise,\n this._printAnnotationStoragePromise,\n this.l10n\n );\n this.printService = printService;\n this.forceRendering();\n // Disable the editor-indicator during printing (fixes bug 1790552).\n this.setTitle();\n\n printService.layout();\n\n if (this._hasAnnotationEditors) {\n this.externalServices.reportTelemetry({\n type: \"editing\",\n data: { type: \"print\" },\n });\n }\n },\n\n afterPrint() {\n if (this._printAnnotationStoragePromise) {\n this._printAnnotationStoragePromise.then(() => {\n this.pdfScriptingManager.dispatchDidPrint();\n });\n this._printAnnotationStoragePromise = null;\n }\n\n if (this.printService) {\n this.printService.destroy();\n this.printService = null;\n\n this.pdfDocument?.annotationStorage.resetModified();\n }\n this.forceRendering();\n // Re-enable the editor-indicator after printing (fixes bug 1790552).\n this.setTitle();\n },\n\n rotatePages(delta) {\n this.pdfViewer.pagesRotation += delta;\n // Note that the thumbnail viewer is updated, and rendering is triggered,\n // in the 'rotationchanging' event handler.\n },\n\n requestPresentationMode() {\n this.pdfPresentationMode?.request();\n },\n\n triggerPrinting() {\n if (!this.supportsPrinting) {\n return;\n }\n window.print();\n },\n\n bindEvents() {\n const { eventBus, _boundEvents } = this;\n\n _boundEvents.beforePrint = this.beforePrint.bind(this);\n _boundEvents.afterPrint = this.afterPrint.bind(this);\n\n eventBus._on(\"resize\", webViewerResize);\n eventBus._on(\"hashchange\", webViewerHashchange);\n eventBus._on(\"beforeprint\", _boundEvents.beforePrint);\n eventBus._on(\"afterprint\", _boundEvents.afterPrint);\n eventBus._on(\"pagerender\", webViewerPageRender);\n eventBus._on(\"pagerendered\", webViewerPageRendered);\n eventBus._on(\"updateviewarea\", webViewerUpdateViewarea);\n eventBus._on(\"pagechanging\", webViewerPageChanging);\n eventBus._on(\"scalechanging\", webViewerScaleChanging);\n eventBus._on(\"rotationchanging\", webViewerRotationChanging);\n eventBus._on(\"sidebarviewchanged\", webViewerSidebarViewChanged);\n eventBus._on(\"pagemode\", webViewerPageMode);\n eventBus._on(\"namedaction\", webViewerNamedAction);\n eventBus._on(\"presentationmodechanged\", webViewerPresentationModeChanged);\n eventBus._on(\"presentationmode\", webViewerPresentationMode);\n eventBus._on(\n \"switchannotationeditormode\",\n webViewerSwitchAnnotationEditorMode\n );\n eventBus._on(\n \"switchannotationeditorparams\",\n webViewerSwitchAnnotationEditorParams\n );\n eventBus._on(\"print\", webViewerPrint);\n eventBus._on(\"download\", webViewerDownload);\n eventBus._on(\"openinexternalapp\", webViewerOpenInExternalApp);\n eventBus._on(\"firstpage\", webViewerFirstPage);\n eventBus._on(\"lastpage\", webViewerLastPage);\n eventBus._on(\"nextpage\", webViewerNextPage);\n eventBus._on(\"previouspage\", webViewerPreviousPage);\n eventBus._on(\"zoomin\", webViewerZoomIn);\n eventBus._on(\"zoomout\", webViewerZoomOut);\n eventBus._on(\"zoomreset\", webViewerZoomReset);\n eventBus._on(\"pagenumberchanged\", webViewerPageNumberChanged);\n eventBus._on(\"scalechanged\", webViewerScaleChanged);\n eventBus._on(\"rotatecw\", webViewerRotateCw);\n eventBus._on(\"rotateccw\", webViewerRotateCcw);\n eventBus._on(\"optionalcontentconfig\", webViewerOptionalContentConfig);\n eventBus._on(\"switchscrollmode\", webViewerSwitchScrollMode);\n eventBus._on(\"scrollmodechanged\", webViewerScrollModeChanged);\n eventBus._on(\"switchspreadmode\", webViewerSwitchSpreadMode);\n eventBus._on(\"spreadmodechanged\", webViewerSpreadModeChanged);\n eventBus._on(\"documentproperties\", webViewerDocumentProperties);\n eventBus._on(\"findfromurlhash\", webViewerFindFromUrlHash);\n eventBus._on(\"updatefindmatchescount\", webViewerUpdateFindMatchesCount);\n eventBus._on(\"updatefindcontrolstate\", webViewerUpdateFindControlState);\n\n if (AppOptions.get(\"pdfBug\")) {\n _boundEvents.reportPageStatsPDFBug = reportPageStatsPDFBug;\n\n eventBus._on(\"pagerendered\", _boundEvents.reportPageStatsPDFBug);\n eventBus._on(\"pagechanging\", _boundEvents.reportPageStatsPDFBug);\n }\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n eventBus._on(\"fileinputchange\", webViewerFileInputChange);\n eventBus._on(\"openfile\", webViewerOpenFile);\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n eventBus._on(\n \"annotationeditorstateschanged\",\n webViewerAnnotationEditorStatesChanged\n );\n }\n },\n\n bindWindowEvents() {\n const { eventBus, _boundEvents } = this;\n\n function addWindowResolutionChange(evt = null) {\n if (evt) {\n webViewerResolutionChange(evt);\n }\n const mediaQueryList = window.matchMedia(\n `(resolution: ${window.devicePixelRatio || 1}dppx)`\n );\n mediaQueryList.addEventListener(\"change\", addWindowResolutionChange, {\n once: true,\n });\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return;\n }\n _boundEvents.removeWindowResolutionChange ||= function () {\n mediaQueryList.removeEventListener(\"change\", addWindowResolutionChange);\n _boundEvents.removeWindowResolutionChange = null;\n };\n }\n addWindowResolutionChange();\n\n _boundEvents.windowResize = () => {\n eventBus.dispatch(\"resize\", { source: window });\n };\n _boundEvents.windowHashChange = () => {\n eventBus.dispatch(\"hashchange\", {\n source: window,\n hash: document.location.hash.substring(1),\n });\n };\n _boundEvents.windowBeforePrint = () => {\n eventBus.dispatch(\"beforeprint\", { source: window });\n };\n _boundEvents.windowAfterPrint = () => {\n eventBus.dispatch(\"afterprint\", { source: window });\n };\n _boundEvents.windowUpdateFromSandbox = event => {\n eventBus.dispatch(\"updatefromsandbox\", {\n source: window,\n detail: event.detail,\n });\n };\n\n window.addEventListener(\"visibilitychange\", webViewerVisibilityChange);\n window.addEventListener(\"wheel\", webViewerWheel, { passive: false });\n window.addEventListener(\"touchstart\", webViewerTouchStart, {\n passive: false,\n });\n window.addEventListener(\"touchmove\", webViewerTouchMove, {\n passive: false,\n });\n window.addEventListener(\"touchend\", webViewerTouchEnd, {\n passive: false,\n });\n window.addEventListener(\"click\", webViewerClick);\n window.addEventListener(\"keydown\", webViewerKeyDown);\n window.addEventListener(\"keyup\", webViewerKeyUp);\n window.addEventListener(\"resize\", _boundEvents.windowResize);\n window.addEventListener(\"hashchange\", _boundEvents.windowHashChange);\n window.addEventListener(\"beforeprint\", _boundEvents.windowBeforePrint);\n window.addEventListener(\"afterprint\", _boundEvents.windowAfterPrint);\n window.addEventListener(\n \"updatefromsandbox\",\n _boundEvents.windowUpdateFromSandbox\n );\n },\n\n unbindEvents() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: unbindEvents\");\n }\n const { eventBus, _boundEvents } = this;\n\n eventBus._off(\"resize\", webViewerResize);\n eventBus._off(\"hashchange\", webViewerHashchange);\n eventBus._off(\"beforeprint\", _boundEvents.beforePrint);\n eventBus._off(\"afterprint\", _boundEvents.afterPrint);\n eventBus._off(\"pagerender\", webViewerPageRender);\n eventBus._off(\"pagerendered\", webViewerPageRendered);\n eventBus._off(\"updateviewarea\", webViewerUpdateViewarea);\n eventBus._off(\"pagechanging\", webViewerPageChanging);\n eventBus._off(\"scalechanging\", webViewerScaleChanging);\n eventBus._off(\"rotationchanging\", webViewerRotationChanging);\n eventBus._off(\"sidebarviewchanged\", webViewerSidebarViewChanged);\n eventBus._off(\"pagemode\", webViewerPageMode);\n eventBus._off(\"namedaction\", webViewerNamedAction);\n eventBus._off(\"presentationmodechanged\", webViewerPresentationModeChanged);\n eventBus._off(\"presentationmode\", webViewerPresentationMode);\n eventBus._off(\"print\", webViewerPrint);\n eventBus._off(\"download\", webViewerDownload);\n eventBus._off(\"openinexternalapp\", webViewerOpenInExternalApp);\n eventBus._off(\"firstpage\", webViewerFirstPage);\n eventBus._off(\"lastpage\", webViewerLastPage);\n eventBus._off(\"nextpage\", webViewerNextPage);\n eventBus._off(\"previouspage\", webViewerPreviousPage);\n eventBus._off(\"zoomin\", webViewerZoomIn);\n eventBus._off(\"zoomout\", webViewerZoomOut);\n eventBus._off(\"zoomreset\", webViewerZoomReset);\n eventBus._off(\"pagenumberchanged\", webViewerPageNumberChanged);\n eventBus._off(\"scalechanged\", webViewerScaleChanged);\n eventBus._off(\"rotatecw\", webViewerRotateCw);\n eventBus._off(\"rotateccw\", webViewerRotateCcw);\n eventBus._off(\"optionalcontentconfig\", webViewerOptionalContentConfig);\n eventBus._off(\"switchscrollmode\", webViewerSwitchScrollMode);\n eventBus._off(\"scrollmodechanged\", webViewerScrollModeChanged);\n eventBus._off(\"switchspreadmode\", webViewerSwitchSpreadMode);\n eventBus._off(\"spreadmodechanged\", webViewerSpreadModeChanged);\n eventBus._off(\"documentproperties\", webViewerDocumentProperties);\n eventBus._off(\"findfromurlhash\", webViewerFindFromUrlHash);\n eventBus._off(\"updatefindmatchescount\", webViewerUpdateFindMatchesCount);\n eventBus._off(\"updatefindcontrolstate\", webViewerUpdateFindControlState);\n\n if (_boundEvents.reportPageStatsPDFBug) {\n eventBus._off(\"pagerendered\", _boundEvents.reportPageStatsPDFBug);\n eventBus._off(\"pagechanging\", _boundEvents.reportPageStatsPDFBug);\n\n _boundEvents.reportPageStatsPDFBug = null;\n }\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n eventBus._off(\"fileinputchange\", webViewerFileInputChange);\n eventBus._off(\"openfile\", webViewerOpenFile);\n }\n\n _boundEvents.beforePrint = null;\n _boundEvents.afterPrint = null;\n },\n\n unbindWindowEvents() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: unbindWindowEvents\");\n }\n const { _boundEvents } = this;\n\n window.removeEventListener(\"visibilitychange\", webViewerVisibilityChange);\n window.removeEventListener(\"wheel\", webViewerWheel, { passive: false });\n window.removeEventListener(\"touchstart\", webViewerTouchStart, {\n passive: false,\n });\n window.removeEventListener(\"touchmove\", webViewerTouchMove, {\n passive: false,\n });\n window.removeEventListener(\"touchend\", webViewerTouchEnd, {\n passive: false,\n });\n window.removeEventListener(\"click\", webViewerClick);\n window.removeEventListener(\"keydown\", webViewerKeyDown);\n window.removeEventListener(\"keyup\", webViewerKeyUp);\n window.removeEventListener(\"resize\", _boundEvents.windowResize);\n window.removeEventListener(\"hashchange\", _boundEvents.windowHashChange);\n window.removeEventListener(\"beforeprint\", _boundEvents.windowBeforePrint);\n window.removeEventListener(\"afterprint\", _boundEvents.windowAfterPrint);\n window.removeEventListener(\n \"updatefromsandbox\",\n _boundEvents.windowUpdateFromSandbox\n );\n\n _boundEvents.removeWindowResolutionChange?.();\n _boundEvents.windowResize = null;\n _boundEvents.windowHashChange = null;\n _boundEvents.windowBeforePrint = null;\n _boundEvents.windowAfterPrint = null;\n _boundEvents.windowUpdateFromSandbox = null;\n },\n\n _accumulateTicks(ticks, prop) {\n // If the direction changed, reset the accumulated ticks.\n if ((this[prop] > 0 && ticks < 0) || (this[prop] < 0 && ticks > 0)) {\n this[prop] = 0;\n }\n this[prop] += ticks;\n const wholeTicks = Math.trunc(this[prop]);\n this[prop] -= wholeTicks;\n return wholeTicks;\n },\n\n _accumulateFactor(previousScale, factor, prop) {\n if (factor === 1) {\n return 1;\n }\n // If the direction changed, reset the accumulated factor.\n if ((this[prop] > 1 && factor < 1) || (this[prop] < 1 && factor > 1)) {\n this[prop] = 1;\n }\n\n const newFactor =\n Math.floor(previousScale * factor * this[prop] * 100) /\n (100 * previousScale);\n this[prop] = factor / newFactor;\n\n return newFactor;\n },\n\n _centerAtPos(previousScale, x, y) {\n const { pdfViewer } = this;\n const scaleDiff = pdfViewer.currentScale / previousScale - 1;\n if (scaleDiff !== 0) {\n const [top, left] = pdfViewer.containerTopLeft;\n pdfViewer.container.scrollLeft += (x - left) * scaleDiff;\n pdfViewer.container.scrollTop += (y - top) * scaleDiff;\n }\n },\n\n /**\n * Should be called *after* all pages have loaded, or if an error occurred,\n * to unblock the \"load\" event; see https://bugzilla.mozilla.org/show_bug.cgi?id=1618553\n * @private\n */\n _unblockDocumentLoadEvent() {\n document.blockUnblockOnload?.(false);\n\n // Ensure that this method is only ever run once.\n this._unblockDocumentLoadEvent = () => {};\n },\n\n /**\n * Used together with the integration-tests, to enable awaiting full\n * initialization of the scripting/sandbox.\n */\n get scriptingReady() {\n return this.pdfScriptingManager.ready;\n },\n};\n\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n const HOSTED_VIEWER_ORIGINS = [\n \"null\",\n \"http://mozilla.github.io\",\n \"https://mozilla.github.io\",\n ];\n // eslint-disable-next-line no-var\n var validateFileURL = function (file) {\n if (!file) {\n return;\n }\n try {\n const viewerOrigin = new URL(window.location.href).origin || \"null\";\n if (HOSTED_VIEWER_ORIGINS.includes(viewerOrigin)) {\n // Hosted or local viewer, allow for any file locations\n return;\n }\n const fileOrigin = new URL(file, window.location.href).origin;\n // Removing of the following line will not guarantee that the viewer will\n // start accepting URLs from foreign origin -- CORS headers on the remote\n // server must be properly configured.\n if (fileOrigin !== viewerOrigin) {\n throw new Error(\"file origin does not match viewer's\");\n }\n } catch (ex) {\n PDFViewerApplication.l10n.get(\"loading_error\").then(msg => {\n PDFViewerApplication._documentError(msg, { message: ex?.message });\n });\n throw ex;\n }\n };\n}\n\nasync function loadFakeWorker() {\n GlobalWorkerOptions.workerSrc ||= AppOptions.get(\"workerSrc\");\n\n if (typeof PDFJSDev === \"undefined\") {\n window.pdfjsWorker = await import(\"pdfjs/pdf.worker.js\");\n return;\n }\n await loadScript(PDFWorker.workerSrc);\n}\n\nasync function loadPDFBug(self) {\n const { debuggerScriptPath } = self.appConfig;\n const { PDFBug } =\n typeof PDFJSDev === \"undefined\"\n ? await import(debuggerScriptPath) // eslint-disable-line no-unsanitized/method\n : await import(debuggerScriptPath); // eslint-disable-line no-undef\n\n self._PDFBug = PDFBug;\n}\n\nfunction reportPageStatsPDFBug({ pageNumber }) {\n if (!globalThis.Stats?.enabled) {\n return;\n }\n const pageView = PDFViewerApplication.pdfViewer.getPageView(\n /* index = */ pageNumber - 1\n );\n globalThis.Stats.add(pageNumber, pageView?.pdfPage?.stats);\n}\n\nfunction webViewerInitialized() {\n const { appConfig, eventBus, l10n } = PDFViewerApplication;\n let file;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n const queryString = document.location.search.substring(1);\n const params = parseQueryString(queryString);\n file = params.get(\"file\") ?? AppOptions.get(\"defaultUrl\");\n validateFileURL(file);\n } else if (PDFJSDev.test(\"MOZCENTRAL\")) {\n file = window.location.href;\n } else if (PDFJSDev.test(\"CHROME\")) {\n file = AppOptions.get(\"defaultUrl\");\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n const fileInput = appConfig.openFileInput;\n fileInput.value = null;\n\n fileInput.addEventListener(\"change\", function (evt) {\n const { files } = evt.target;\n if (!files || files.length === 0) {\n return;\n }\n eventBus.dispatch(\"fileinputchange\", {\n source: this,\n fileInput: evt.target,\n });\n });\n\n // Enable dragging-and-dropping a new PDF file onto the viewerContainer.\n appConfig.mainContainer.addEventListener(\"dragover\", function (evt) {\n evt.preventDefault();\n\n evt.dataTransfer.dropEffect =\n evt.dataTransfer.effectAllowed === \"copy\" ? \"copy\" : \"move\";\n });\n appConfig.mainContainer.addEventListener(\"drop\", function (evt) {\n evt.preventDefault();\n\n const { files } = evt.dataTransfer;\n if (!files || files.length === 0) {\n return;\n }\n eventBus.dispatch(\"fileinputchange\", {\n source: this,\n fileInput: evt.dataTransfer,\n });\n });\n }\n\n if (!PDFViewerApplication.supportsDocumentFonts) {\n AppOptions.set(\"disableFontFace\", true);\n l10n.get(\"web_fonts_disabled\").then(msg => {\n console.warn(msg);\n });\n }\n\n if (!PDFViewerApplication.supportsPrinting) {\n appConfig.toolbar?.print?.classList.add(\"hidden\");\n appConfig.secondaryToolbar?.printButton.classList.add(\"hidden\");\n }\n\n if (!PDFViewerApplication.supportsFullscreen) {\n appConfig.secondaryToolbar?.presentationModeButton.classList.add(\"hidden\");\n }\n\n if (PDFViewerApplication.supportsIntegratedFind) {\n appConfig.toolbar?.viewFind?.classList.add(\"hidden\");\n }\n\n appConfig.mainContainer.addEventListener(\n \"transitionend\",\n function (evt) {\n if (evt.target === /* mainContainer */ this) {\n eventBus.dispatch(\"resize\", { source: this });\n }\n },\n true\n );\n\n try {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (file) {\n PDFViewerApplication.open({ url: file });\n } else {\n PDFViewerApplication._hideViewBookmark();\n }\n } else if (PDFJSDev.test(\"MOZCENTRAL || CHROME\")) {\n PDFViewerApplication.setTitleUsingUrl(file, /* downloadUrl = */ file);\n PDFViewerApplication.initPassiveLoading();\n } else {\n throw new Error(\"Not implemented: webViewerInitialized\");\n }\n } catch (reason) {\n l10n.get(\"loading_error\").then(msg => {\n PDFViewerApplication._documentError(msg, reason);\n });\n }\n}\n\nfunction webViewerPageRender({ pageNumber }) {\n // If the page is (the most) visible when it starts rendering,\n // ensure that the page number input loading indicator is displayed.\n if (pageNumber === PDFViewerApplication.page) {\n PDFViewerApplication.toolbar?.updateLoadingIndicatorState(true);\n }\n}\n\nfunction webViewerPageRendered({ pageNumber, error }) {\n // If the page is still visible when it has finished rendering,\n // ensure that the page number input loading indicator is hidden.\n if (pageNumber === PDFViewerApplication.page) {\n PDFViewerApplication.toolbar?.updateLoadingIndicatorState(false);\n }\n\n // Use the rendered page to set the corresponding thumbnail image.\n if (PDFViewerApplication.pdfSidebar?.visibleView === SidebarView.THUMBS) {\n const pageView = PDFViewerApplication.pdfViewer.getPageView(\n /* index = */ pageNumber - 1\n );\n const thumbnailView = PDFViewerApplication.pdfThumbnailViewer?.getThumbnail(\n /* index = */ pageNumber - 1\n );\n if (pageView) {\n thumbnailView?.setImage(pageView);\n }\n }\n\n if (error) {\n PDFViewerApplication.l10n.get(\"rendering_error\").then(msg => {\n PDFViewerApplication._otherError(msg, error);\n });\n }\n}\n\nfunction webViewerPageMode({ mode }) {\n // Handle the 'pagemode' hash parameter, see also `PDFLinkService_setHash`.\n let view;\n switch (mode) {\n case \"thumbs\":\n view = SidebarView.THUMBS;\n break;\n case \"bookmarks\":\n case \"outline\": // non-standard\n view = SidebarView.OUTLINE;\n break;\n case \"attachments\": // non-standard\n view = SidebarView.ATTACHMENTS;\n break;\n case \"layers\": // non-standard\n view = SidebarView.LAYERS;\n break;\n case \"none\":\n view = SidebarView.NONE;\n break;\n default:\n console.error('Invalid \"pagemode\" hash parameter: ' + mode);\n return;\n }\n PDFViewerApplication.pdfSidebar?.switchView(view, /* forceOpen = */ true);\n}\n\nfunction webViewerNamedAction(evt) {\n // Processing a couple of named actions that might be useful, see also\n // `PDFLinkService.executeNamedAction`.\n switch (evt.action) {\n case \"GoToPage\":\n PDFViewerApplication.appConfig.toolbar?.pageNumber.select();\n break;\n\n case \"Find\":\n if (!PDFViewerApplication.supportsIntegratedFind) {\n PDFViewerApplication?.findBar.toggle();\n }\n break;\n\n case \"Print\":\n PDFViewerApplication.triggerPrinting();\n break;\n\n case \"SaveAs\":\n PDFViewerApplication.downloadOrSave();\n break;\n }\n}\n\nfunction webViewerPresentationModeChanged(evt) {\n PDFViewerApplication.pdfViewer.presentationModeState = evt.state;\n}\n\nfunction webViewerSidebarViewChanged({ view }) {\n PDFViewerApplication.pdfRenderingQueue.isThumbnailViewEnabled =\n view === SidebarView.THUMBS;\n\n if (PDFViewerApplication.isInitialViewSet) {\n // Only update the storage when the document has been loaded *and* rendered.\n PDFViewerApplication.store?.set(\"sidebarView\", view).catch(() => {\n // Unable to write to storage.\n });\n }\n}\n\nfunction webViewerUpdateViewarea({ location }) {\n if (PDFViewerApplication.isInitialViewSet) {\n // Only update the storage when the document has been loaded *and* rendered.\n PDFViewerApplication.store\n ?.setMultiple({\n page: location.pageNumber,\n zoom: location.scale,\n scrollLeft: location.left,\n scrollTop: location.top,\n rotation: location.rotation,\n })\n .catch(() => {\n // Unable to write to storage.\n });\n }\n if (PDFViewerApplication.appConfig.secondaryToolbar) {\n const href = PDFViewerApplication.pdfLinkService.getAnchorUrl(\n location.pdfOpenParams\n );\n PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href =\n href;\n }\n}\n\nfunction webViewerScrollModeChanged(evt) {\n if (\n PDFViewerApplication.isInitialViewSet &&\n !PDFViewerApplication.pdfViewer.isInPresentationMode\n ) {\n // Only update the storage when the document has been loaded *and* rendered.\n PDFViewerApplication.store?.set(\"scrollMode\", evt.mode).catch(() => {\n // Unable to write to storage.\n });\n }\n}\n\nfunction webViewerSpreadModeChanged(evt) {\n if (\n PDFViewerApplication.isInitialViewSet &&\n !PDFViewerApplication.pdfViewer.isInPresentationMode\n ) {\n // Only update the storage when the document has been loaded *and* rendered.\n PDFViewerApplication.store?.set(\"spreadMode\", evt.mode).catch(() => {\n // Unable to write to storage.\n });\n }\n}\n\nfunction webViewerResize() {\n const { pdfDocument, pdfViewer, pdfRenderingQueue } = PDFViewerApplication;\n\n if (pdfRenderingQueue.printing && window.matchMedia(\"print\").matches) {\n // Work-around issue 15324 by ignoring \"resize\" events during printing.\n return;\n }\n\n if (!pdfDocument) {\n return;\n }\n const currentScaleValue = pdfViewer.currentScaleValue;\n if (\n currentScaleValue === \"auto\" ||\n currentScaleValue === \"page-fit\" ||\n currentScaleValue === \"page-width\"\n ) {\n // Note: the scale is constant for 'page-actual'.\n pdfViewer.currentScaleValue = currentScaleValue;\n }\n pdfViewer.update();\n}\n\nfunction webViewerHashchange(evt) {\n const hash = evt.hash;\n if (!hash) {\n return;\n }\n if (!PDFViewerApplication.isInitialViewSet) {\n PDFViewerApplication.initialBookmark = hash;\n } else if (!PDFViewerApplication.pdfHistory?.popStateInProgress) {\n PDFViewerApplication.pdfLinkService.setHash(hash);\n }\n}\n\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // eslint-disable-next-line no-var\n var webViewerFileInputChange = function (evt) {\n if (PDFViewerApplication.pdfViewer?.isInPresentationMode) {\n return; // Opening a new PDF file isn't supported in Presentation Mode.\n }\n const file = evt.fileInput.files[0];\n\n PDFViewerApplication.open({\n url: URL.createObjectURL(file),\n originalUrl: file.name,\n });\n };\n\n // eslint-disable-next-line no-var\n var webViewerOpenFile = function (evt) {\n const fileInput = PDFViewerApplication.appConfig.openFileInput;\n fileInput.click();\n };\n}\n\nfunction webViewerPresentationMode() {\n PDFViewerApplication.requestPresentationMode();\n}\nfunction webViewerSwitchAnnotationEditorMode(evt) {\n PDFViewerApplication.pdfViewer.annotationEditorMode = evt.mode;\n}\nfunction webViewerSwitchAnnotationEditorParams(evt) {\n PDFViewerApplication.pdfViewer.annotationEditorParams = evt;\n}\nfunction webViewerPrint() {\n PDFViewerApplication.triggerPrinting();\n}\nfunction webViewerDownload() {\n PDFViewerApplication.downloadOrSave();\n}\nfunction webViewerOpenInExternalApp() {\n PDFViewerApplication.openInExternalApp();\n}\nfunction webViewerFirstPage() {\n PDFViewerApplication.page = 1;\n}\nfunction webViewerLastPage() {\n PDFViewerApplication.page = PDFViewerApplication.pagesCount;\n}\nfunction webViewerNextPage() {\n PDFViewerApplication.pdfViewer.nextPage();\n}\nfunction webViewerPreviousPage() {\n PDFViewerApplication.pdfViewer.previousPage();\n}\nfunction webViewerZoomIn() {\n PDFViewerApplication.zoomIn();\n}\nfunction webViewerZoomOut() {\n PDFViewerApplication.zoomOut();\n}\nfunction webViewerZoomReset() {\n PDFViewerApplication.zoomReset();\n}\nfunction webViewerPageNumberChanged(evt) {\n const pdfViewer = PDFViewerApplication.pdfViewer;\n // Note that for `<input type=\"number\">` HTML elements, an empty string will\n // be returned for non-number inputs; hence we simply do nothing in that case.\n if (evt.value !== \"\") {\n PDFViewerApplication.pdfLinkService.goToPage(evt.value);\n }\n\n // Ensure that the page number input displays the correct value, even if the\n // value entered by the user was invalid (e.g. a floating point number).\n if (\n evt.value !== pdfViewer.currentPageNumber.toString() &&\n evt.value !== pdfViewer.currentPageLabel\n ) {\n PDFViewerApplication.toolbar?.setPageNumber(\n pdfViewer.currentPageNumber,\n pdfViewer.currentPageLabel\n );\n }\n}\nfunction webViewerScaleChanged(evt) {\n PDFViewerApplication.pdfViewer.currentScaleValue = evt.value;\n}\nfunction webViewerRotateCw() {\n PDFViewerApplication.rotatePages(90);\n}\nfunction webViewerRotateCcw() {\n PDFViewerApplication.rotatePages(-90);\n}\nfunction webViewerOptionalContentConfig(evt) {\n PDFViewerApplication.pdfViewer.optionalContentConfigPromise = evt.promise;\n}\nfunction webViewerSwitchScrollMode(evt) {\n PDFViewerApplication.pdfViewer.scrollMode = evt.mode;\n}\nfunction webViewerSwitchSpreadMode(evt) {\n PDFViewerApplication.pdfViewer.spreadMode = evt.mode;\n}\nfunction webViewerDocumentProperties() {\n PDFViewerApplication.pdfDocumentProperties?.open();\n}\n\nfunction webViewerFindFromUrlHash(evt) {\n PDFViewerApplication.eventBus.dispatch(\"find\", {\n source: evt.source,\n type: \"\",\n query: evt.query,\n caseSensitive: false,\n entireWord: false,\n highlightAll: true,\n findPrevious: false,\n matchDiacritics: true,\n });\n}\n\nfunction webViewerUpdateFindMatchesCount({ matchesCount }) {\n if (PDFViewerApplication.supportsIntegratedFind) {\n PDFViewerApplication.externalServices.updateFindMatchesCount(matchesCount);\n } else {\n PDFViewerApplication.findBar.updateResultsCount(matchesCount);\n }\n}\n\nfunction webViewerUpdateFindControlState({\n state,\n previous,\n matchesCount,\n rawQuery,\n}) {\n if (PDFViewerApplication.supportsIntegratedFind) {\n PDFViewerApplication.externalServices.updateFindControlState({\n result: state,\n findPrevious: previous,\n matchesCount,\n rawQuery,\n });\n } else {\n PDFViewerApplication.findBar?.updateUIState(state, previous, matchesCount);\n }\n}\n\nfunction webViewerScaleChanging(evt) {\n PDFViewerApplication.toolbar?.setPageScale(evt.presetValue, evt.scale);\n\n PDFViewerApplication.pdfViewer.update();\n}\n\nfunction webViewerRotationChanging(evt) {\n if (PDFViewerApplication.pdfThumbnailViewer) {\n PDFViewerApplication.pdfThumbnailViewer.pagesRotation = evt.pagesRotation;\n }\n\n PDFViewerApplication.forceRendering();\n // Ensure that the active page doesn't change during rotation.\n PDFViewerApplication.pdfViewer.currentPageNumber = evt.pageNumber;\n}\n\nfunction webViewerPageChanging({ pageNumber, pageLabel }) {\n PDFViewerApplication.toolbar?.setPageNumber(pageNumber, pageLabel);\n PDFViewerApplication.secondaryToolbar?.setPageNumber(pageNumber);\n\n if (PDFViewerApplication.pdfSidebar?.visibleView === SidebarView.THUMBS) {\n PDFViewerApplication.pdfThumbnailViewer?.scrollThumbnailIntoView(\n pageNumber\n );\n }\n\n // Show/hide the loading indicator in the page number input element.\n const currentPage = PDFViewerApplication.pdfViewer.getPageView(\n /* index = */ pageNumber - 1\n );\n PDFViewerApplication.toolbar?.updateLoadingIndicatorState(\n currentPage?.renderingState === RenderingStates.RUNNING\n );\n}\n\nfunction webViewerResolutionChange(evt) {\n PDFViewerApplication.pdfViewer.refresh();\n}\n\nfunction webViewerVisibilityChange(evt) {\n if (document.visibilityState === \"visible\") {\n // Ignore mouse wheel zooming during tab switches (bug 1503412).\n setZoomDisabledTimeout();\n }\n}\n\nlet zoomDisabledTimeout = null;\nfunction setZoomDisabledTimeout() {\n if (zoomDisabledTimeout) {\n clearTimeout(zoomDisabledTimeout);\n }\n zoomDisabledTimeout = setTimeout(function () {\n zoomDisabledTimeout = null;\n }, WHEEL_ZOOM_DISABLED_TIMEOUT);\n}\n\nfunction webViewerWheel(evt) {\n const {\n pdfViewer,\n supportedMouseWheelZoomModifierKeys,\n supportsPinchToZoom,\n } = PDFViewerApplication;\n\n if (pdfViewer.isInPresentationMode) {\n return;\n }\n\n // Pinch-to-zoom on a trackpad maps to a wheel event with ctrlKey set to true\n // https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent#browser_compatibility\n // Hence if ctrlKey is true but ctrl key hasn't been pressed then we can\n // infer that we have a pinch-to-zoom.\n // But the ctrlKey could have been pressed outside of the browser window,\n // hence we try to do some magic to guess if the scaleFactor is likely coming\n // from a pinch-to-zoom or not.\n\n // It is important that we query deltaMode before delta{X,Y}, so that\n // Firefox doesn't switch to DOM_DELTA_PIXEL mode for compat with other\n // browsers, see https://bugzilla.mozilla.org/show_bug.cgi?id=1392460.\n const deltaMode = evt.deltaMode;\n\n // The following formula is a bit strange but it comes from:\n // https://searchfox.org/mozilla-central/rev/d62c4c4d5547064487006a1506287da394b64724/widget/InputData.cpp#618-626\n let scaleFactor = Math.exp(-evt.deltaY / 100);\n\n const isBuiltInMac =\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"MOZCENTRAL\") &&\n FeatureTest.platform.isMac;\n const isPinchToZoom =\n evt.ctrlKey &&\n !PDFViewerApplication._isCtrlKeyDown &&\n deltaMode === WheelEvent.DOM_DELTA_PIXEL &&\n evt.deltaX === 0 &&\n (Math.abs(scaleFactor - 1) < 0.05 || isBuiltInMac) &&\n evt.deltaZ === 0;\n\n if (\n isPinchToZoom ||\n (evt.ctrlKey && supportedMouseWheelZoomModifierKeys.ctrlKey) ||\n (evt.metaKey && supportedMouseWheelZoomModifierKeys.metaKey)\n ) {\n // Only zoom the pages, not the entire viewer.\n evt.preventDefault();\n // NOTE: this check must be placed *after* preventDefault.\n if (zoomDisabledTimeout || document.visibilityState === \"hidden\") {\n return;\n }\n\n const previousScale = pdfViewer.currentScale;\n if (isPinchToZoom && supportsPinchToZoom) {\n scaleFactor = PDFViewerApplication._accumulateFactor(\n previousScale,\n scaleFactor,\n \"_wheelUnusedFactor\"\n );\n if (scaleFactor < 1) {\n PDFViewerApplication.zoomOut(null, scaleFactor);\n } else if (scaleFactor > 1) {\n PDFViewerApplication.zoomIn(null, scaleFactor);\n } else {\n return;\n }\n } else {\n const delta = normalizeWheelEventDirection(evt);\n\n let ticks = 0;\n if (\n deltaMode === WheelEvent.DOM_DELTA_LINE ||\n deltaMode === WheelEvent.DOM_DELTA_PAGE\n ) {\n // For line-based devices, use one tick per event, because different\n // OSs have different defaults for the number lines. But we generally\n // want one \"clicky\" roll of the wheel (which produces one event) to\n // adjust the zoom by one step.\n if (Math.abs(delta) >= 1) {\n ticks = Math.sign(delta);\n } else {\n // If we're getting fractional lines (I can't think of a scenario\n // this might actually happen), be safe and use the accumulator.\n ticks = PDFViewerApplication._accumulateTicks(\n delta,\n \"_wheelUnusedTicks\"\n );\n }\n } else {\n // pixel-based devices\n const PIXELS_PER_LINE_SCALE = 30;\n ticks = PDFViewerApplication._accumulateTicks(\n delta / PIXELS_PER_LINE_SCALE,\n \"_wheelUnusedTicks\"\n );\n }\n\n if (ticks < 0) {\n PDFViewerApplication.zoomOut(-ticks);\n } else if (ticks > 0) {\n PDFViewerApplication.zoomIn(ticks);\n } else {\n return;\n }\n }\n\n // After scaling the page via zoomIn/zoomOut, the position of the upper-\n // left corner is restored. When the mouse wheel is used, the position\n // under the cursor should be restored instead.\n PDFViewerApplication._centerAtPos(previousScale, evt.clientX, evt.clientY);\n } else {\n setZoomDisabledTimeout();\n }\n}\n\nfunction webViewerTouchStart(evt) {\n if (\n PDFViewerApplication.pdfViewer.isInPresentationMode ||\n evt.touches.length < 2\n ) {\n return;\n }\n evt.preventDefault();\n\n if (evt.touches.length !== 2) {\n PDFViewerApplication._touchInfo = null;\n return;\n }\n\n let [touch0, touch1] = evt.touches;\n if (touch0.identifier > touch1.identifier) {\n [touch0, touch1] = [touch1, touch0];\n }\n PDFViewerApplication._touchInfo = {\n touch0X: touch0.pageX,\n touch0Y: touch0.pageY,\n touch1X: touch1.pageX,\n touch1Y: touch1.pageY,\n };\n}\n\nfunction webViewerTouchMove(evt) {\n if (!PDFViewerApplication._touchInfo || evt.touches.length !== 2) {\n return;\n }\n\n const { pdfViewer, _touchInfo, supportsPinchToZoom } = PDFViewerApplication;\n let [touch0, touch1] = evt.touches;\n if (touch0.identifier > touch1.identifier) {\n [touch0, touch1] = [touch1, touch0];\n }\n const { pageX: page0X, pageY: page0Y } = touch0;\n const { pageX: page1X, pageY: page1Y } = touch1;\n const {\n touch0X: pTouch0X,\n touch0Y: pTouch0Y,\n touch1X: pTouch1X,\n touch1Y: pTouch1Y,\n } = _touchInfo;\n\n if (\n Math.abs(pTouch0X - page0X) <= 1 &&\n Math.abs(pTouch0Y - page0Y) <= 1 &&\n Math.abs(pTouch1X - page1X) <= 1 &&\n Math.abs(pTouch1Y - page1Y) <= 1\n ) {\n // Touches are really too close and it's hard do some basic\n // geometry in order to guess something.\n return;\n }\n\n _touchInfo.touch0X = page0X;\n _touchInfo.touch0Y = page0Y;\n _touchInfo.touch1X = page1X;\n _touchInfo.touch1Y = page1Y;\n\n if (pTouch0X === page0X && pTouch0Y === page0Y) {\n // First touch is fixed, if the vectors are collinear then we've a pinch.\n const v1X = pTouch1X - page0X;\n const v1Y = pTouch1Y - page0Y;\n const v2X = page1X - page0X;\n const v2Y = page1Y - page0Y;\n const det = v1X * v2Y - v1Y * v2X;\n // 0.02 is approximatively sin(0.15deg).\n if (Math.abs(det) > 0.02 * Math.hypot(v1X, v1Y) * Math.hypot(v2X, v2Y)) {\n return;\n }\n } else if (pTouch1X === page1X && pTouch1Y === page1Y) {\n // Second touch is fixed, if the vectors are collinear then we've a pinch.\n const v1X = pTouch0X - page1X;\n const v1Y = pTouch0Y - page1Y;\n const v2X = page0X - page1X;\n const v2Y = page0Y - page1Y;\n const det = v1X * v2Y - v1Y * v2X;\n if (Math.abs(det) > 0.02 * Math.hypot(v1X, v1Y) * Math.hypot(v2X, v2Y)) {\n return;\n }\n } else {\n const diff0X = page0X - pTouch0X;\n const diff1X = page1X - pTouch1X;\n const diff0Y = page0Y - pTouch0Y;\n const diff1Y = page1Y - pTouch1Y;\n const dotProduct = diff0X * diff1X + diff0Y * diff1Y;\n if (dotProduct >= 0) {\n // The two touches go in almost the same direction.\n return;\n }\n }\n\n evt.preventDefault();\n\n const distance = Math.hypot(page0X - page1X, page0Y - page1Y) || 1;\n const pDistance = Math.hypot(pTouch0X - pTouch1X, pTouch0Y - pTouch1Y) || 1;\n const previousScale = pdfViewer.currentScale;\n if (supportsPinchToZoom) {\n const newScaleFactor = PDFViewerApplication._accumulateFactor(\n previousScale,\n distance / pDistance,\n \"_touchUnusedFactor\"\n );\n if (newScaleFactor < 1) {\n PDFViewerApplication.zoomOut(null, newScaleFactor);\n } else if (newScaleFactor > 1) {\n PDFViewerApplication.zoomIn(null, newScaleFactor);\n } else {\n return;\n }\n } else {\n const PIXELS_PER_LINE_SCALE = 30;\n const ticks = PDFViewerApplication._accumulateTicks(\n (distance - pDistance) / PIXELS_PER_LINE_SCALE,\n \"_touchUnusedTicks\"\n );\n if (ticks < 0) {\n PDFViewerApplication.zoomOut(-ticks);\n } else if (ticks > 0) {\n PDFViewerApplication.zoomIn(ticks);\n } else {\n return;\n }\n }\n\n PDFViewerApplication._centerAtPos(\n previousScale,\n (page0X + page1X) / 2,\n (page0Y + page1Y) / 2\n );\n}\n\nfunction webViewerTouchEnd(evt) {\n if (!PDFViewerApplication._touchInfo) {\n return;\n }\n\n evt.preventDefault();\n PDFViewerApplication._touchInfo = null;\n PDFViewerApplication._touchUnusedTicks = 0;\n PDFViewerApplication._touchUnusedFactor = 1;\n}\n\nfunction webViewerClick(evt) {\n if (!PDFViewerApplication.secondaryToolbar?.isOpen) {\n return;\n }\n const appConfig = PDFViewerApplication.appConfig;\n if (\n PDFViewerApplication.pdfViewer.containsElement(evt.target) ||\n (appConfig.toolbar?.container.contains(evt.target) &&\n evt.target !== appConfig.secondaryToolbar?.toggleButton)\n ) {\n PDFViewerApplication.secondaryToolbar.close();\n }\n}\n\nfunction webViewerKeyUp(evt) {\n // evt.ctrlKey is false hence we use evt.key.\n if (evt.key === \"Control\") {\n PDFViewerApplication._isCtrlKeyDown = false;\n }\n}\n\nfunction webViewerKeyDown(evt) {\n PDFViewerApplication._isCtrlKeyDown = evt.key === \"Control\";\n\n if (PDFViewerApplication.overlayManager.active) {\n return;\n }\n const { eventBus, pdfViewer } = PDFViewerApplication;\n const isViewerInPresentationMode = pdfViewer.isInPresentationMode;\n\n let handled = false,\n ensureViewerFocused = false;\n const cmd =\n (evt.ctrlKey ? 1 : 0) |\n (evt.altKey ? 2 : 0) |\n (evt.shiftKey ? 4 : 0) |\n (evt.metaKey ? 8 : 0);\n\n // First, handle the key bindings that are independent whether an input\n // control is selected or not.\n if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) {\n // either CTRL or META key with optional SHIFT.\n switch (evt.keyCode) {\n case 70: // f\n if (!PDFViewerApplication.supportsIntegratedFind && !evt.shiftKey) {\n PDFViewerApplication.findBar?.open();\n handled = true;\n }\n break;\n case 71: // g\n if (!PDFViewerApplication.supportsIntegratedFind) {\n const { state } = PDFViewerApplication.findController;\n if (state) {\n const newState = {\n source: window,\n type: \"again\",\n findPrevious: cmd === 5 || cmd === 12,\n };\n eventBus.dispatch(\"find\", { ...state, ...newState });\n }\n handled = true;\n }\n break;\n case 61: // FF/Mac '='\n case 107: // FF '+' and '='\n case 187: // Chrome '+'\n case 171: // FF with German keyboard\n PDFViewerApplication.zoomIn();\n handled = true;\n break;\n case 173: // FF/Mac '-'\n case 109: // FF '-'\n case 189: // Chrome '-'\n PDFViewerApplication.zoomOut();\n handled = true;\n break;\n case 48: // '0'\n case 96: // '0' on Numpad of Swedish keyboard\n if (!isViewerInPresentationMode) {\n // keeping it unhandled (to restore page zoom to 100%)\n setTimeout(function () {\n // ... and resetting the scale after browser adjusts its scale\n PDFViewerApplication.zoomReset();\n });\n handled = false;\n }\n break;\n\n case 38: // up arrow\n if (isViewerInPresentationMode || PDFViewerApplication.page > 1) {\n PDFViewerApplication.page = 1;\n handled = true;\n ensureViewerFocused = true;\n }\n break;\n case 40: // down arrow\n if (\n isViewerInPresentationMode ||\n PDFViewerApplication.page < PDFViewerApplication.pagesCount\n ) {\n PDFViewerApplication.page = PDFViewerApplication.pagesCount;\n handled = true;\n ensureViewerFocused = true;\n }\n break;\n }\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC || CHROME\")) {\n // CTRL or META without shift\n if (cmd === 1 || cmd === 8) {\n switch (evt.keyCode) {\n case 83: // s\n eventBus.dispatch(\"download\", { source: window });\n handled = true;\n break;\n\n case 79: // o\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n eventBus.dispatch(\"openfile\", { source: window });\n handled = true;\n }\n break;\n }\n }\n }\n\n // CTRL+ALT or Option+Command\n if (cmd === 3 || cmd === 10) {\n switch (evt.keyCode) {\n case 80: // p\n PDFViewerApplication.requestPresentationMode();\n handled = true;\n PDFViewerApplication.externalServices.reportTelemetry({\n type: \"buttons\",\n data: { id: \"presentationModeKeyboard\" },\n });\n break;\n case 71: // g\n // focuses input#pageNumber field\n if (PDFViewerApplication.appConfig.toolbar) {\n PDFViewerApplication.appConfig.toolbar.pageNumber.select();\n handled = true;\n }\n break;\n }\n }\n\n if (handled) {\n if (ensureViewerFocused && !isViewerInPresentationMode) {\n pdfViewer.focus();\n }\n evt.preventDefault();\n return;\n }\n\n // Some shortcuts should not get handled if a control/input element\n // is selected.\n const curElement = getActiveOrFocusedElement();\n const curElementTagName = curElement?.tagName.toUpperCase();\n if (\n curElementTagName === \"INPUT\" ||\n curElementTagName === \"TEXTAREA\" ||\n curElementTagName === \"SELECT\" ||\n curElement?.isContentEditable\n ) {\n // Make sure that the secondary toolbar is closed when Escape is pressed.\n if (evt.keyCode !== /* Esc = */ 27) {\n return;\n }\n }\n\n // No control key pressed at all.\n if (cmd === 0) {\n let turnPage = 0,\n turnOnlyIfPageFit = false;\n switch (evt.keyCode) {\n case 38: // up arrow\n case 33: // pg up\n // vertical scrolling using arrow/pg keys\n if (pdfViewer.isVerticalScrollbarEnabled) {\n turnOnlyIfPageFit = true;\n }\n turnPage = -1;\n break;\n case 8: // backspace\n if (!isViewerInPresentationMode) {\n turnOnlyIfPageFit = true;\n }\n turnPage = -1;\n break;\n case 37: // left arrow\n // horizontal scrolling using arrow keys\n if (pdfViewer.isHorizontalScrollbarEnabled) {\n turnOnlyIfPageFit = true;\n }\n /* falls through */\n case 75: // 'k'\n case 80: // 'p'\n turnPage = -1;\n break;\n case 27: // esc key\n if (PDFViewerApplication.secondaryToolbar?.isOpen) {\n PDFViewerApplication.secondaryToolbar.close();\n handled = true;\n }\n if (\n !PDFViewerApplication.supportsIntegratedFind &&\n PDFViewerApplication.findBar?.opened\n ) {\n PDFViewerApplication.findBar.close();\n handled = true;\n }\n break;\n case 40: // down arrow\n case 34: // pg down\n // vertical scrolling using arrow/pg keys\n if (pdfViewer.isVerticalScrollbarEnabled) {\n turnOnlyIfPageFit = true;\n }\n turnPage = 1;\n break;\n case 13: // enter key\n case 32: // spacebar\n if (!isViewerInPresentationMode) {\n turnOnlyIfPageFit = true;\n }\n turnPage = 1;\n break;\n case 39: // right arrow\n // horizontal scrolling using arrow keys\n if (pdfViewer.isHorizontalScrollbarEnabled) {\n turnOnlyIfPageFit = true;\n }\n /* falls through */\n case 74: // 'j'\n case 78: // 'n'\n turnPage = 1;\n break;\n\n case 36: // home\n if (isViewerInPresentationMode || PDFViewerApplication.page > 1) {\n PDFViewerApplication.page = 1;\n handled = true;\n ensureViewerFocused = true;\n }\n break;\n case 35: // end\n if (\n isViewerInPresentationMode ||\n PDFViewerApplication.page < PDFViewerApplication.pagesCount\n ) {\n PDFViewerApplication.page = PDFViewerApplication.pagesCount;\n handled = true;\n ensureViewerFocused = true;\n }\n break;\n\n case 83: // 's'\n PDFViewerApplication.pdfCursorTools?.switchTool(CursorTool.SELECT);\n break;\n case 72: // 'h'\n PDFViewerApplication.pdfCursorTools?.switchTool(CursorTool.HAND);\n break;\n\n case 82: // 'r'\n PDFViewerApplication.rotatePages(90);\n break;\n\n case 115: // F4\n PDFViewerApplication.pdfSidebar?.toggle();\n break;\n }\n\n if (\n turnPage !== 0 &&\n (!turnOnlyIfPageFit || pdfViewer.currentScaleValue === \"page-fit\")\n ) {\n if (turnPage > 0) {\n pdfViewer.nextPage();\n } else {\n pdfViewer.previousPage();\n }\n handled = true;\n }\n }\n\n // shift-key\n if (cmd === 4) {\n switch (evt.keyCode) {\n case 13: // enter key\n case 32: // spacebar\n if (\n !isViewerInPresentationMode &&\n pdfViewer.currentScaleValue !== \"page-fit\"\n ) {\n break;\n }\n pdfViewer.previousPage();\n\n handled = true;\n break;\n\n case 82: // 'r'\n PDFViewerApplication.rotatePages(-90);\n break;\n }\n }\n\n if (!handled && !isViewerInPresentationMode) {\n // 33=Page Up 34=Page Down 35=End 36=Home\n // 37=Left 38=Up 39=Right 40=Down\n // 32=Spacebar\n if (\n (evt.keyCode >= 33 && evt.keyCode <= 40) ||\n (evt.keyCode === 32 && curElementTagName !== \"BUTTON\")\n ) {\n ensureViewerFocused = true;\n }\n }\n\n if (ensureViewerFocused && !pdfViewer.containsElement(curElement)) {\n // The page container is not focused, but a page navigation key has been\n // pressed. Change the focus to the viewer container to make sure that\n // navigation by keyboard works as expected.\n pdfViewer.focus();\n }\n\n if (handled) {\n evt.preventDefault();\n }\n}\n\nfunction beforeUnload(evt) {\n evt.preventDefault();\n evt.returnValue = \"\";\n return false;\n}\n\nfunction webViewerAnnotationEditorStatesChanged(data) {\n PDFViewerApplication.externalServices.updateEditorStates(data);\n}\n\n/* Abstract factory for the print service. */\nconst PDFPrintServiceFactory = {\n instance: {\n supportsPrinting: false,\n createPrintService() {\n throw new Error(\"Not implemented: createPrintService\");\n },\n },\n};\n\nexport {\n DefaultExternalServices,\n PDFPrintServiceFactory,\n PDFViewerApplication,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst DEFAULT_SCALE_VALUE = \"auto\";\nconst DEFAULT_SCALE = 1.0;\nconst DEFAULT_SCALE_DELTA = 1.1;\nconst MIN_SCALE = 0.1;\nconst MAX_SCALE = 10.0;\nconst UNKNOWN_SCALE = 0;\nconst MAX_AUTO_SCALE = 1.25;\nconst SCROLLBAR_PADDING = 40;\nconst VERTICAL_PADDING = 5;\n\nconst RenderingStates = {\n INITIAL: 0,\n RUNNING: 1,\n PAUSED: 2,\n FINISHED: 3,\n};\n\nconst PresentationModeState = {\n UNKNOWN: 0,\n NORMAL: 1,\n CHANGING: 2,\n FULLSCREEN: 3,\n};\n\nconst SidebarView = {\n UNKNOWN: -1,\n NONE: 0,\n THUMBS: 1, // Default value.\n OUTLINE: 2,\n ATTACHMENTS: 3,\n LAYERS: 4,\n};\n\nconst TextLayerMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_PERMISSIONS: 2,\n};\n\nconst ScrollMode = {\n UNKNOWN: -1,\n VERTICAL: 0, // Default value.\n HORIZONTAL: 1,\n WRAPPED: 2,\n PAGE: 3,\n};\n\nconst SpreadMode = {\n UNKNOWN: -1,\n NONE: 0, // Default value.\n ODD: 1,\n EVEN: 2,\n};\n\nconst CursorTool = {\n SELECT: 0, // The default value.\n HAND: 1,\n ZOOM: 2,\n};\n\n// Used by `PDFViewerApplication`, and by the API unit-tests.\nconst AutoPrintRegExp = /\\bprint\\s*\\(/;\n\n/**\n * Scale factors for the canvas, necessary with HiDPI displays.\n */\nclass OutputScale {\n constructor() {\n const pixelRatio = window.devicePixelRatio || 1;\n\n /**\n * @type {number} Horizontal scale.\n */\n this.sx = pixelRatio;\n\n /**\n * @type {number} Vertical scale.\n */\n this.sy = pixelRatio;\n }\n\n /**\n * @type {boolean} Returns `true` when scaling is required, `false` otherwise.\n */\n get scaled() {\n return this.sx !== 1 || this.sy !== 1;\n }\n}\n\n/**\n * Scrolls specified element into view of its parent.\n * @param {HTMLElement} element - The element to be visible.\n * @param {Object} [spot] - An object with optional top and left properties,\n * specifying the offset from the top left edge.\n * @param {number} [spot.left]\n * @param {number} [spot.top]\n * @param {boolean} [scrollMatches] - When scrolling search results into view,\n * ignore elements that either: Contains marked content identifiers,\n * or have the CSS-rule `overflow: hidden;` set. The default value is `false`.\n */\nfunction scrollIntoView(element, spot, scrollMatches = false) {\n // Assuming offsetParent is available (it's not available when viewer is in\n // hidden iframe or object). We have to scroll: if the offsetParent is not set\n // producing the error. See also animationStarted.\n let parent = element.offsetParent;\n if (!parent) {\n console.error(\"offsetParent is not set -- cannot scroll\");\n return;\n }\n let offsetY = element.offsetTop + element.clientTop;\n let offsetX = element.offsetLeft + element.clientLeft;\n while (\n (parent.clientHeight === parent.scrollHeight &&\n parent.clientWidth === parent.scrollWidth) ||\n (scrollMatches &&\n (parent.classList.contains(\"markedContent\") ||\n getComputedStyle(parent).overflow === \"hidden\"))\n ) {\n offsetY += parent.offsetTop;\n offsetX += parent.offsetLeft;\n\n parent = parent.offsetParent;\n if (!parent) {\n return; // no need to scroll\n }\n }\n if (spot) {\n if (spot.top !== undefined) {\n offsetY += spot.top;\n }\n if (spot.left !== undefined) {\n offsetX += spot.left;\n parent.scrollLeft = offsetX;\n }\n }\n parent.scrollTop = offsetY;\n}\n\n/**\n * Helper function to start monitoring the scroll event and converting them into\n * PDF.js friendly one: with scroll debounce and scroll direction.\n */\nfunction watchScroll(viewAreaElement, callback) {\n const debounceScroll = function (evt) {\n if (rAF) {\n return;\n }\n // schedule an invocation of scroll for next animation frame.\n rAF = window.requestAnimationFrame(function viewAreaElementScrolled() {\n rAF = null;\n\n const currentX = viewAreaElement.scrollLeft;\n const lastX = state.lastX;\n if (currentX !== lastX) {\n state.right = currentX > lastX;\n }\n state.lastX = currentX;\n const currentY = viewAreaElement.scrollTop;\n const lastY = state.lastY;\n if (currentY !== lastY) {\n state.down = currentY > lastY;\n }\n state.lastY = currentY;\n callback(state);\n });\n };\n\n const state = {\n right: true,\n down: true,\n lastX: viewAreaElement.scrollLeft,\n lastY: viewAreaElement.scrollTop,\n _eventHandler: debounceScroll,\n };\n\n let rAF = null;\n viewAreaElement.addEventListener(\"scroll\", debounceScroll, true);\n return state;\n}\n\n/**\n * Helper function to parse query string (e.g. ?param1=value¶m2=...).\n * @param {string}\n * @returns {Map}\n */\nfunction parseQueryString(query) {\n const params = new Map();\n for (const [key, value] of new URLSearchParams(query)) {\n params.set(key.toLowerCase(), value);\n }\n return params;\n}\n\nconst InvisibleCharactersRegExp = /[\\x01-\\x1F]/g;\n\n/**\n * @param {string} str\n * @param {boolean} [replaceInvisible]\n */\nfunction removeNullCharacters(str, replaceInvisible = false) {\n if (typeof str !== \"string\") {\n console.error(`The argument must be a string.`);\n return str;\n }\n if (replaceInvisible) {\n str = str.replaceAll(InvisibleCharactersRegExp, \" \");\n }\n return str.replaceAll(\"\\x00\", \"\");\n}\n\n/**\n * Use binary search to find the index of the first item in a given array which\n * passes a given condition. The items are expected to be sorted in the sense\n * that if the condition is true for one item in the array, then it is also true\n * for all following items.\n *\n * @returns {number} Index of the first array element to pass the test,\n * or |items.length| if no such element exists.\n */\nfunction binarySearchFirstItem(items, condition, start = 0) {\n let minIndex = start;\n let maxIndex = items.length - 1;\n\n if (maxIndex < 0 || !condition(items[maxIndex])) {\n return items.length;\n }\n if (condition(items[minIndex])) {\n return minIndex;\n }\n\n while (minIndex < maxIndex) {\n const currentIndex = (minIndex + maxIndex) >> 1;\n const currentItem = items[currentIndex];\n if (condition(currentItem)) {\n maxIndex = currentIndex;\n } else {\n minIndex = currentIndex + 1;\n }\n }\n return minIndex; /* === maxIndex */\n}\n\n/**\n * Approximates float number as a fraction using Farey sequence (max order\n * of 8).\n * @param {number} x - Positive float number.\n * @returns {Array} Estimated fraction: the first array item is a numerator,\n * the second one is a denominator.\n */\nfunction approximateFraction(x) {\n // Fast paths for int numbers or their inversions.\n if (Math.floor(x) === x) {\n return [x, 1];\n }\n const xinv = 1 / x;\n const limit = 8;\n if (xinv > limit) {\n return [1, limit];\n } else if (Math.floor(xinv) === xinv) {\n return [1, xinv];\n }\n\n const x_ = x > 1 ? xinv : x;\n // a/b and c/d are neighbours in Farey sequence.\n let a = 0,\n b = 1,\n c = 1,\n d = 1;\n // Limiting search to order 8.\n while (true) {\n // Generating next term in sequence (order of q).\n const p = a + c,\n q = b + d;\n if (q > limit) {\n break;\n }\n if (x_ <= p / q) {\n c = p;\n d = q;\n } else {\n a = p;\n b = q;\n }\n }\n let result;\n // Select closest of the neighbours to x.\n if (x_ - a / b < c / d - x_) {\n result = x_ === x ? [a, b] : [b, a];\n } else {\n result = x_ === x ? [c, d] : [d, c];\n }\n return result;\n}\n\nfunction roundToDivide(x, div) {\n const r = x % div;\n return r === 0 ? x : Math.round(x - r + div);\n}\n\n/**\n * @typedef {Object} GetPageSizeInchesParameters\n * @property {number[]} view\n * @property {number} userUnit\n * @property {number} rotate\n */\n\n/**\n * @typedef {Object} PageSize\n * @property {number} width - In inches.\n * @property {number} height - In inches.\n */\n\n/**\n * Gets the size of the specified page, converted from PDF units to inches.\n * @param {GetPageSizeInchesParameters} params\n * @returns {PageSize}\n */\nfunction getPageSizeInches({ view, userUnit, rotate }) {\n const [x1, y1, x2, y2] = view;\n // We need to take the page rotation into account as well.\n const changeOrientation = rotate % 180 !== 0;\n\n const width = ((x2 - x1) / 72) * userUnit;\n const height = ((y2 - y1) / 72) * userUnit;\n\n return {\n width: changeOrientation ? height : width,\n height: changeOrientation ? width : height,\n };\n}\n\n/**\n * Helper function for getVisibleElements.\n *\n * @param {number} index - initial guess at the first visible element\n * @param {Array} views - array of pages, into which `index` is an index\n * @param {number} top - the top of the scroll pane\n * @returns {number} less than or equal to `index` that is definitely at or\n * before the first visible element in `views`, but not by too much. (Usually,\n * this will be the first element in the first partially visible row in\n * `views`, although sometimes it goes back one row further.)\n */\nfunction backtrackBeforeAllVisibleElements(index, views, top) {\n // binarySearchFirstItem's assumption is that the input is ordered, with only\n // one index where the conditions flips from false to true: [false ...,\n // true...]. With vertical scrolling and spreads, it is possible to have\n // [false ..., true, false, true ...]. With wrapped scrolling we can have a\n // similar sequence, with many more mixed true and false in the middle.\n //\n // So there is no guarantee that the binary search yields the index of the\n // first visible element. It could have been any of the other visible elements\n // that were preceded by a hidden element.\n\n // Of course, if either this element or the previous (hidden) element is also\n // the first element, there's nothing to worry about.\n if (index < 2) {\n return index;\n }\n\n // That aside, the possible cases are represented below.\n //\n // **** = fully hidden\n // A*B* = mix of partially visible and/or hidden pages\n // CDEF = fully visible\n //\n // (1) Binary search could have returned A, in which case we can stop.\n // (2) Binary search could also have returned B, in which case we need to\n // check the whole row.\n // (3) Binary search could also have returned C, in which case we need to\n // check the whole previous row.\n //\n // There's one other possibility:\n //\n // **** = fully hidden\n // ABCD = mix of fully and/or partially visible pages\n //\n // (4) Binary search could only have returned A.\n\n // Initially assume that we need to find the beginning of the current row\n // (case 1, 2, or 4), which means finding a page that is above the current\n // page's top. If the found page is partially visible, we're definitely not in\n // case 3, and this assumption is correct.\n let elt = views[index].div;\n let pageTop = elt.offsetTop + elt.clientTop;\n\n if (pageTop >= top) {\n // The found page is fully visible, so we're actually either in case 3 or 4,\n // and unfortunately we can't tell the difference between them without\n // scanning the entire previous row, so we just conservatively assume that\n // we do need to backtrack to that row. In both cases, the previous page is\n // in the previous row, so use its top instead.\n elt = views[index - 1].div;\n pageTop = elt.offsetTop + elt.clientTop;\n }\n\n // Now we backtrack to the first page that still has its bottom below\n // `pageTop`, which is the top of a page in the first visible row (unless\n // we're in case 4, in which case it's the row before that).\n // `index` is found by binary search, so the page at `index - 1` is\n // invisible and we can start looking for potentially visible pages from\n // `index - 2`. (However, if this loop terminates on its first iteration,\n // which is the case when pages are stacked vertically, `index` should remain\n // unchanged, so we use a distinct loop variable.)\n for (let i = index - 2; i >= 0; --i) {\n elt = views[i].div;\n if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) {\n // We have reached the previous row, so stop now.\n // This loop is expected to terminate relatively quickly because the\n // number of pages per row is expected to be small.\n break;\n }\n index = i;\n }\n return index;\n}\n\n/**\n * @typedef {Object} GetVisibleElementsParameters\n * @property {HTMLElement} scrollEl - A container that can possibly scroll.\n * @property {Array} views - Objects with a `div` property that contains an\n * HTMLElement, which should all be descendants of `scrollEl` satisfying the\n * relevant layout assumptions.\n * @property {boolean} sortByVisibility - If `true`, the returned elements are\n * sorted in descending order of the percent of their padding box that is\n * visible. The default value is `false`.\n * @property {boolean} horizontal - If `true`, the elements are assumed to be\n * laid out horizontally instead of vertically. The default value is `false`.\n * @property {boolean} rtl - If `true`, the `scrollEl` container is assumed to\n * be in right-to-left mode. The default value is `false`.\n */\n\n/**\n * Generic helper to find out what elements are visible within a scroll pane.\n *\n * Well, pretty generic. There are some assumptions placed on the elements\n * referenced by `views`:\n * - If `horizontal`, no left of any earlier element is to the right of the\n * left of any later element.\n * - Otherwise, `views` can be split into contiguous rows where, within a row,\n * no top of any element is below the bottom of any other element, and\n * between rows, no bottom of any element in an earlier row is below the\n * top of any element in a later row.\n *\n * (Here, top, left, etc. all refer to the padding edge of the element in\n * question. For pages, that ends up being equivalent to the bounding box of the\n * rendering canvas. Earlier and later refer to index in `views`, not page\n * layout.)\n *\n * @param {GetVisibleElementsParameters}\n * @returns {Object} `{ first, last, views: [{ id, x, y, view, percent }] }`\n */\nfunction getVisibleElements({\n scrollEl,\n views,\n sortByVisibility = false,\n horizontal = false,\n rtl = false,\n}) {\n const top = scrollEl.scrollTop,\n bottom = top + scrollEl.clientHeight;\n const left = scrollEl.scrollLeft,\n right = left + scrollEl.clientWidth;\n\n // Throughout this \"generic\" function, comments will assume we're working with\n // PDF document pages, which is the most important and complex case. In this\n // case, the visible elements we're actually interested is the page canvas,\n // which is contained in a wrapper which adds no padding/border/margin, which\n // is itself contained in `view.div` which adds no padding (but does add a\n // border). So, as specified in this function's doc comment, this function\n // does all of its work on the padding edge of the provided views, starting at\n // offsetLeft/Top (which includes margin) and adding clientLeft/Top (which is\n // the border). Adding clientWidth/Height gets us the bottom-right corner of\n // the padding edge.\n function isElementBottomAfterViewTop(view) {\n const element = view.div;\n const elementBottom =\n element.offsetTop + element.clientTop + element.clientHeight;\n return elementBottom > top;\n }\n function isElementNextAfterViewHorizontally(view) {\n const element = view.div;\n const elementLeft = element.offsetLeft + element.clientLeft;\n const elementRight = elementLeft + element.clientWidth;\n return rtl ? elementLeft < right : elementRight > left;\n }\n\n const visible = [],\n ids = new Set(),\n numViews = views.length;\n let firstVisibleElementInd = binarySearchFirstItem(\n views,\n horizontal\n ? isElementNextAfterViewHorizontally\n : isElementBottomAfterViewTop\n );\n\n // Please note the return value of the `binarySearchFirstItem` function when\n // no valid element is found (hence the `firstVisibleElementInd` check below).\n if (\n firstVisibleElementInd > 0 &&\n firstVisibleElementInd < numViews &&\n !horizontal\n ) {\n // In wrapped scrolling (or vertical scrolling with spreads), with some page\n // sizes, isElementBottomAfterViewTop doesn't satisfy the binary search\n // condition: there can be pages with bottoms above the view top between\n // pages with bottoms below. This function detects and corrects that error;\n // see it for more comments.\n firstVisibleElementInd = backtrackBeforeAllVisibleElements(\n firstVisibleElementInd,\n views,\n top\n );\n }\n\n // lastEdge acts as a cutoff for us to stop looping, because we know all\n // subsequent pages will be hidden.\n //\n // When using wrapped scrolling or vertical scrolling with spreads, we can't\n // simply stop the first time we reach a page below the bottom of the view;\n // the tops of subsequent pages on the same row could still be visible. In\n // horizontal scrolling, we don't have that issue, so we can stop as soon as\n // we pass `right`, without needing the code below that handles the -1 case.\n let lastEdge = horizontal ? right : -1;\n\n for (let i = firstVisibleElementInd; i < numViews; i++) {\n const view = views[i],\n element = view.div;\n const currentWidth = element.offsetLeft + element.clientLeft;\n const currentHeight = element.offsetTop + element.clientTop;\n const viewWidth = element.clientWidth,\n viewHeight = element.clientHeight;\n const viewRight = currentWidth + viewWidth;\n const viewBottom = currentHeight + viewHeight;\n\n if (lastEdge === -1) {\n // As commented above, this is only needed in non-horizontal cases.\n // Setting lastEdge to the bottom of the first page that is partially\n // visible ensures that the next page fully below lastEdge is on the\n // next row, which has to be fully hidden along with all subsequent rows.\n if (viewBottom >= bottom) {\n lastEdge = viewBottom;\n }\n } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) {\n break;\n }\n\n if (\n viewBottom <= top ||\n currentHeight >= bottom ||\n viewRight <= left ||\n currentWidth >= right\n ) {\n continue;\n }\n\n const hiddenHeight =\n Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);\n const hiddenWidth =\n Math.max(0, left - currentWidth) + Math.max(0, viewRight - right);\n\n const fractionHeight = (viewHeight - hiddenHeight) / viewHeight,\n fractionWidth = (viewWidth - hiddenWidth) / viewWidth;\n const percent = (fractionHeight * fractionWidth * 100) | 0;\n\n visible.push({\n id: view.id,\n x: currentWidth,\n y: currentHeight,\n view,\n percent,\n widthPercent: (fractionWidth * 100) | 0,\n });\n ids.add(view.id);\n }\n\n const first = visible[0],\n last = visible.at(-1);\n\n if (sortByVisibility) {\n visible.sort(function (a, b) {\n const pc = a.percent - b.percent;\n if (Math.abs(pc) > 0.001) {\n return -pc;\n }\n return a.id - b.id; // ensure stability\n });\n }\n return { first, last, views: visible, ids };\n}\n\n/**\n * Event handler to suppress context menu.\n */\nfunction noContextMenuHandler(evt) {\n evt.preventDefault();\n}\n\nfunction normalizeWheelEventDirection(evt) {\n let delta = Math.hypot(evt.deltaX, evt.deltaY);\n const angle = Math.atan2(evt.deltaY, evt.deltaX);\n if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) {\n // All that is left-up oriented has to change the sign.\n delta = -delta;\n }\n return delta;\n}\n\nfunction normalizeWheelEventDelta(evt) {\n const deltaMode = evt.deltaMode; // Avoid being affected by bug 1392460.\n let delta = normalizeWheelEventDirection(evt);\n\n const MOUSE_PIXELS_PER_LINE = 30;\n const MOUSE_LINES_PER_PAGE = 30;\n\n // Converts delta to per-page units\n if (deltaMode === WheelEvent.DOM_DELTA_PIXEL) {\n delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE;\n } else if (deltaMode === WheelEvent.DOM_DELTA_LINE) {\n delta /= MOUSE_LINES_PER_PAGE;\n }\n return delta;\n}\n\nfunction isValidRotation(angle) {\n return Number.isInteger(angle) && angle % 90 === 0;\n}\n\nfunction isValidScrollMode(mode) {\n return (\n Number.isInteger(mode) &&\n Object.values(ScrollMode).includes(mode) &&\n mode !== ScrollMode.UNKNOWN\n );\n}\n\nfunction isValidSpreadMode(mode) {\n return (\n Number.isInteger(mode) &&\n Object.values(SpreadMode).includes(mode) &&\n mode !== SpreadMode.UNKNOWN\n );\n}\n\nfunction isPortraitOrientation(size) {\n return size.width <= size.height;\n}\n\n/**\n * Promise that is resolved when DOM window becomes visible.\n */\nconst animationStarted = new Promise(function (resolve) {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof window === \"undefined\"\n ) {\n // Prevent \"ReferenceError: window is not defined\" errors when running the\n // unit-tests in Node.js environments.\n setTimeout(resolve, 20);\n return;\n }\n window.requestAnimationFrame(resolve);\n});\n\nconst docStyle =\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof document === \"undefined\"\n ? null\n : document.documentElement.style;\n\nfunction clamp(v, min, max) {\n return Math.min(Math.max(v, min), max);\n}\n\nclass ProgressBar {\n #classList = null;\n\n #disableAutoFetchTimeout = null;\n\n #percent = 0;\n\n #style = null;\n\n #visible = true;\n\n constructor(bar) {\n this.#classList = bar.classList;\n this.#style = bar.style;\n }\n\n get percent() {\n return this.#percent;\n }\n\n set percent(val) {\n this.#percent = clamp(val, 0, 100);\n\n if (isNaN(val)) {\n this.#classList.add(\"indeterminate\");\n return;\n }\n this.#classList.remove(\"indeterminate\");\n\n this.#style.setProperty(\"--progressBar-percent\", `${this.#percent}%`);\n }\n\n setWidth(viewer) {\n if (!viewer) {\n return;\n }\n const container = viewer.parentNode;\n const scrollbarWidth = container.offsetWidth - viewer.offsetWidth;\n if (scrollbarWidth > 0) {\n this.#style.setProperty(\n \"--progressBar-end-offset\",\n `${scrollbarWidth}px`\n );\n }\n }\n\n setDisableAutoFetch(delay = /* ms = */ 5000) {\n if (isNaN(this.#percent)) {\n return;\n }\n if (this.#disableAutoFetchTimeout) {\n clearTimeout(this.#disableAutoFetchTimeout);\n }\n this.show();\n\n this.#disableAutoFetchTimeout = setTimeout(() => {\n this.#disableAutoFetchTimeout = null;\n this.hide();\n }, delay);\n }\n\n hide() {\n if (!this.#visible) {\n return;\n }\n this.#visible = false;\n this.#classList.add(\"hidden\");\n }\n\n show() {\n if (this.#visible) {\n return;\n }\n this.#visible = true;\n this.#classList.remove(\"hidden\");\n }\n}\n\n/**\n * Get the active or focused element in current DOM.\n *\n * Recursively search for the truly active or focused element in case there are\n * shadow DOMs.\n *\n * @returns {Element} the truly active or focused element.\n */\nfunction getActiveOrFocusedElement() {\n let curRoot = document;\n let curActiveOrFocused =\n curRoot.activeElement || curRoot.querySelector(\":focus\");\n\n while (curActiveOrFocused?.shadowRoot) {\n curRoot = curActiveOrFocused.shadowRoot;\n curActiveOrFocused =\n curRoot.activeElement || curRoot.querySelector(\":focus\");\n }\n\n return curActiveOrFocused;\n}\n\n/**\n * Converts API PageLayout values to the format used by `BaseViewer`.\n * @param {string} mode - The API PageLayout value.\n * @returns {Object}\n */\nfunction apiPageLayoutToViewerModes(layout) {\n let scrollMode = ScrollMode.VERTICAL,\n spreadMode = SpreadMode.NONE;\n\n switch (layout) {\n case \"SinglePage\":\n scrollMode = ScrollMode.PAGE;\n break;\n case \"OneColumn\":\n break;\n case \"TwoPageLeft\":\n scrollMode = ScrollMode.PAGE;\n /* falls through */\n case \"TwoColumnLeft\":\n spreadMode = SpreadMode.ODD;\n break;\n case \"TwoPageRight\":\n scrollMode = ScrollMode.PAGE;\n /* falls through */\n case \"TwoColumnRight\":\n spreadMode = SpreadMode.EVEN;\n break;\n }\n return { scrollMode, spreadMode };\n}\n\n/**\n * Converts API PageMode values to the format used by `PDFSidebar`.\n * NOTE: There's also a \"FullScreen\" parameter which is not possible to support,\n * since the Fullscreen API used in browsers requires that entering\n * fullscreen mode only occurs as a result of a user-initiated event.\n * @param {string} mode - The API PageMode value.\n * @returns {number} A value from {SidebarView}.\n */\nfunction apiPageModeToSidebarView(mode) {\n switch (mode) {\n case \"UseNone\":\n return SidebarView.NONE;\n case \"UseThumbs\":\n return SidebarView.THUMBS;\n case \"UseOutlines\":\n return SidebarView.OUTLINE;\n case \"UseAttachments\":\n return SidebarView.ATTACHMENTS;\n case \"UseOC\":\n return SidebarView.LAYERS;\n }\n return SidebarView.NONE; // Default value.\n}\n\nfunction toggleCheckedBtn(button, toggle, view = null) {\n button.classList.toggle(\"toggled\", toggle);\n button.setAttribute(\"aria-checked\", toggle);\n\n view?.classList.toggle(\"hidden\", !toggle);\n}\n\nfunction toggleExpandedBtn(button, toggle, view = null) {\n button.classList.toggle(\"toggled\", toggle);\n button.setAttribute(\"aria-expanded\", toggle);\n\n view?.classList.toggle(\"hidden\", !toggle);\n}\n\nexport {\n animationStarted,\n apiPageLayoutToViewerModes,\n apiPageModeToSidebarView,\n approximateFraction,\n AutoPrintRegExp,\n backtrackBeforeAllVisibleElements, // only exported for testing\n binarySearchFirstItem,\n CursorTool,\n DEFAULT_SCALE,\n DEFAULT_SCALE_DELTA,\n DEFAULT_SCALE_VALUE,\n docStyle,\n getActiveOrFocusedElement,\n getPageSizeInches,\n getVisibleElements,\n isPortraitOrientation,\n isValidRotation,\n isValidScrollMode,\n isValidSpreadMode,\n MAX_AUTO_SCALE,\n MAX_SCALE,\n MIN_SCALE,\n noContextMenuHandler,\n normalizeWheelEventDelta,\n normalizeWheelEventDirection,\n OutputScale,\n parseQueryString,\n PresentationModeState,\n ProgressBar,\n removeNullCharacters,\n RenderingStates,\n roundToDivide,\n SCROLLBAR_PADDING,\n scrollIntoView,\n ScrollMode,\n SidebarView,\n SpreadMode,\n TextLayerMode,\n toggleCheckedBtn,\n toggleExpandedBtn,\n UNKNOWN_SCALE,\n VERTICAL_PADDING,\n watchScroll,\n};\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals module, __non_webpack_require__ */\n\n\"use strict\";\n\nlet pdfjsLib;\nif (typeof window !== \"undefined\" && window[\"pdfjs-dist/build/pdf\"]) {\n pdfjsLib = window[\"pdfjs-dist/build/pdf\"];\n} else {\n pdfjsLib = __non_webpack_require__(\"../build/pdf.js\");\n}\nmodule.exports = pdfjsLib;\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst compatibilityParams = Object.create(null);\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof navigator === \"undefined\"\n ) {\n globalThis.navigator = Object.create(null);\n }\n const userAgent = navigator.userAgent || \"\";\n const platform = navigator.platform || \"\";\n const maxTouchPoints = navigator.maxTouchPoints || 1;\n\n const isAndroid = /Android/.test(userAgent);\n const isIOS =\n /\\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) ||\n (platform === \"MacIntel\" && maxTouchPoints > 1);\n\n // Limit canvas size to 5 mega-pixels on mobile.\n // Support: Android, iOS\n (function checkCanvasSizeLimitation() {\n if (isIOS || isAndroid) {\n compatibilityParams.maxCanvasPixels = 5242880;\n }\n })();\n}\n\nconst OptionKind = {\n VIEWER: 0x02,\n API: 0x04,\n WORKER: 0x08,\n PREFERENCE: 0x80,\n};\n\n/**\n * NOTE: These options are used to generate the `default_preferences.json` file,\n * see `OptionKind.PREFERENCE`, hence the values below must use only\n * primitive types and cannot rely on any imported types.\n */\nconst defaultOptions = {\n annotationEditorMode: {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n annotationMode: {\n /** @type {number} */\n value: 2,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n cursorToolOnLoad: {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n defaultZoomDelay: {\n /** @type {number} */\n value: 400,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n defaultZoomValue: {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n disableHistory: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER,\n },\n disablePageLabels: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enableFloatingToolbar: {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enablePermissions: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enablePrintAutoRotate: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enableScripting: {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n externalLinkRel: {\n /** @type {string} */\n value: \"noopener noreferrer nofollow\",\n kind: OptionKind.VIEWER,\n },\n externalLinkTarget: {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n historyUpdateUrl: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ignoreDestinationZoom: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n imageResourcesPath: {\n /** @type {string} */\n value:\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/web/images/\"\n : \"./images/\",\n kind: OptionKind.VIEWER,\n },\n maxCanvasPixels: {\n /** @type {number} */\n value: 16777216,\n kind: OptionKind.VIEWER,\n },\n forcePageColors: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n pageColorsBackground: {\n /** @type {string} */\n value: \"Canvas\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n pageColorsForeground: {\n /** @type {string} */\n value: \"CanvasText\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n pdfBugEnabled: {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n printResolution: {\n /** @type {number} */\n value: 150,\n kind: OptionKind.VIEWER,\n },\n sidebarViewOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n scrollModeOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n spreadModeOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n textLayerMode: {\n /** @type {number} */\n value: 1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n useOnlyCssZoom: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n viewerCssTheme: {\n /** @type {number} */\n value: typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\") ? 2 : 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n viewOnLoad: {\n /** @type {boolean} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n\n cMapPacked: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n cMapUrl: {\n /** @type {string} */\n value:\n // eslint-disable-next-line no-nested-ternary\n typeof PDFJSDev === \"undefined\"\n ? \"../external/bcmaps/\"\n : PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/web/cmaps/\"\n : \"../web/cmaps/\",\n kind: OptionKind.API,\n },\n disableAutoFetch: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableFontFace: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableRange: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableStream: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n docBaseUrl: {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.API,\n },\n enableXfa: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n fontExtraProperties: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API,\n },\n isEvalSupported: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n isOffscreenCanvasSupported: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n maxImageSize: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.API,\n },\n pdfBug: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API,\n },\n standardFontDataUrl: {\n /** @type {string} */\n value:\n // eslint-disable-next-line no-nested-ternary\n typeof PDFJSDev === \"undefined\"\n ? \"../external/standard_fonts/\"\n : PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/web/standard_fonts/\"\n : \"../web/standard_fonts/\",\n kind: OptionKind.API,\n },\n verbosity: {\n /** @type {number} */\n value: 1,\n kind: OptionKind.API,\n },\n\n workerPort: {\n /** @type {Object} */\n value: null,\n kind: OptionKind.WORKER,\n },\n workerSrc: {\n /** @type {string} */\n value:\n // eslint-disable-next-line no-nested-ternary\n typeof PDFJSDev === \"undefined\"\n ? \"../src/pdf.worker.js\"\n : PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/build/pdf.worker.js\"\n : \"../build/pdf.worker.js\",\n kind: OptionKind.WORKER,\n },\n};\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n defaultOptions.defaultUrl = {\n /** @type {string} */\n value: \"compressed.tracemonkey-pldi-09.pdf\",\n kind: OptionKind.VIEWER,\n };\n defaultOptions.disablePreferences = {\n /** @type {boolean} */\n value: typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\"),\n kind: OptionKind.VIEWER,\n };\n defaultOptions.locale = {\n /** @type {string} */\n value: navigator.language || \"en-US\",\n kind: OptionKind.VIEWER,\n };\n defaultOptions.sandboxBundleSrc = {\n /** @type {string} */\n value:\n typeof PDFJSDev === \"undefined\"\n ? \"../build/dev-sandbox/pdf.sandbox.js\"\n : \"../build/pdf.sandbox.js\",\n kind: OptionKind.VIEWER,\n };\n} else if (PDFJSDev.test(\"CHROME\")) {\n defaultOptions.defaultUrl = {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.VIEWER,\n };\n defaultOptions.disableTelemetry = {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n };\n defaultOptions.sandboxBundleSrc = {\n /** @type {string} */\n value: \"../build/pdf.sandbox.js\",\n kind: OptionKind.VIEWER,\n };\n}\n\nconst userOptions = Object.create(null);\n\nclass AppOptions {\n constructor() {\n throw new Error(\"Cannot initialize AppOptions.\");\n }\n\n static get(name) {\n const userOption = userOptions[name];\n if (userOption !== undefined) {\n return userOption;\n }\n const defaultOption = defaultOptions[name];\n if (defaultOption !== undefined) {\n return compatibilityParams[name] ?? defaultOption.value;\n }\n return undefined;\n }\n\n static getAll(kind = null) {\n const options = Object.create(null);\n for (const name in defaultOptions) {\n const defaultOption = defaultOptions[name];\n if (kind) {\n if ((kind & defaultOption.kind) === 0) {\n continue;\n }\n if (kind === OptionKind.PREFERENCE) {\n const value = defaultOption.value,\n valueType = typeof value;\n\n if (\n valueType === \"boolean\" ||\n valueType === \"string\" ||\n (valueType === \"number\" && Number.isInteger(value))\n ) {\n options[name] = value;\n continue;\n }\n throw new Error(`Invalid type for preference: ${name}`);\n }\n }\n const userOption = userOptions[name];\n options[name] =\n userOption !== undefined\n ? userOption\n : compatibilityParams[name] ?? defaultOption.value;\n }\n return options;\n }\n\n static set(name, value) {\n userOptions[name] = value;\n }\n\n static setAll(options) {\n for (const name in options) {\n userOptions[name] = options[name];\n }\n }\n\n static remove(name) {\n delete userOptions[name];\n }\n}\n\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n AppOptions._hasUserOptions = function () {\n return Object.keys(userOptions).length > 0;\n };\n}\n\nexport { AppOptions, compatibilityParams, OptionKind };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst WaitOnType = {\n EVENT: \"event\",\n TIMEOUT: \"timeout\",\n};\n\n/**\n * @typedef {Object} WaitOnEventOrTimeoutParameters\n * @property {Object} target - The event target, can for example be:\n * `window`, `document`, a DOM element, or an {EventBus} instance.\n * @property {string} name - The name of the event.\n * @property {number} delay - The delay, in milliseconds, after which the\n * timeout occurs (if the event wasn't already dispatched).\n */\n\n/**\n * Allows waiting for an event or a timeout, whichever occurs first.\n * Can be used to ensure that an action always occurs, even when an event\n * arrives late or not at all.\n *\n * @param {WaitOnEventOrTimeoutParameters}\n * @returns {Promise} A promise that is resolved with a {WaitOnType} value.\n */\nfunction waitOnEventOrTimeout({ target, name, delay = 0 }) {\n return new Promise(function (resolve, reject) {\n if (\n typeof target !== \"object\" ||\n !(name && typeof name === \"string\") ||\n !(Number.isInteger(delay) && delay >= 0)\n ) {\n throw new Error(\"waitOnEventOrTimeout - invalid parameters.\");\n }\n\n function handler(type) {\n if (target instanceof EventBus) {\n target._off(name, eventHandler);\n } else {\n target.removeEventListener(name, eventHandler);\n }\n\n if (timeout) {\n clearTimeout(timeout);\n }\n resolve(type);\n }\n\n const eventHandler = handler.bind(null, WaitOnType.EVENT);\n if (target instanceof EventBus) {\n target._on(name, eventHandler);\n } else {\n target.addEventListener(name, eventHandler);\n }\n\n const timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT);\n const timeout = setTimeout(timeoutHandler, delay);\n });\n}\n\n/**\n * Simple event bus for an application. Listeners are attached using the `on`\n * and `off` methods. To raise an event, the `dispatch` method shall be used.\n */\nclass EventBus {\n #listeners = Object.create(null);\n\n /**\n * @param {string} eventName\n * @param {function} listener\n * @param {Object} [options]\n */\n on(eventName, listener, options = null) {\n this._on(eventName, listener, {\n external: true,\n once: options?.once,\n });\n }\n\n /**\n * @param {string} eventName\n * @param {function} listener\n * @param {Object} [options]\n */\n off(eventName, listener, options = null) {\n this._off(eventName, listener, {\n external: true,\n once: options?.once,\n });\n }\n\n /**\n * @param {string} eventName\n * @param {Object} data\n */\n dispatch(eventName, data) {\n const eventListeners = this.#listeners[eventName];\n if (!eventListeners || eventListeners.length === 0) {\n return;\n }\n let externalListeners;\n // Making copy of the listeners array in case if it will be modified\n // during dispatch.\n for (const { listener, external, once } of eventListeners.slice(0)) {\n if (once) {\n this._off(eventName, listener);\n }\n if (external) {\n (externalListeners ||= []).push(listener);\n continue;\n }\n listener(data);\n }\n // Dispatch any \"external\" listeners *after* the internal ones, to give the\n // viewer components time to handle events and update their state first.\n if (externalListeners) {\n for (const listener of externalListeners) {\n listener(data);\n }\n externalListeners = null;\n }\n }\n\n /**\n * @ignore\n */\n _on(eventName, listener, options = null) {\n const eventListeners = (this.#listeners[eventName] ||= []);\n eventListeners.push({\n listener,\n external: options?.external === true,\n once: options?.once === true,\n });\n }\n\n /**\n * @ignore\n */\n _off(eventName, listener, options = null) {\n const eventListeners = this.#listeners[eventName];\n if (!eventListeners) {\n return;\n }\n for (let i = 0, ii = eventListeners.length; i < ii; i++) {\n if (eventListeners[i].listener === listener) {\n eventListeners.splice(i, 1);\n return;\n }\n }\n }\n}\n\n/**\n * NOTE: Only used to support various PDF viewer tests in `mozilla-central`.\n */\nclass AutomationEventBus extends EventBus {\n dispatch(eventName, data) {\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: AutomationEventBus.dispatch\");\n }\n super.dispatch(eventName, data);\n\n const detail = Object.create(null);\n if (data) {\n for (const key in data) {\n const value = data[key];\n if (key === \"source\") {\n if (value === window || value === document) {\n return; // No need to re-dispatch (already) global events.\n }\n continue; // Ignore the `source` property.\n }\n detail[key] = value;\n }\n }\n const event = new CustomEvent(eventName, {\n bubbles: true,\n cancelable: true,\n detail,\n });\n document.dispatchEvent(event);\n }\n}\n\nexport { AutomationEventBus, EventBus, waitOnEventOrTimeout, WaitOnType };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { parseQueryString, removeNullCharacters } from \"./ui_utils.js\";\n\nconst DEFAULT_LINK_REL = \"noopener noreferrer nofollow\";\n\nconst LinkTarget = {\n NONE: 0, // Default value.\n SELF: 1,\n BLANK: 2,\n PARENT: 3,\n TOP: 4,\n};\n\n/**\n * @typedef {Object} ExternalLinkParameters\n * @property {string} url - An absolute URL.\n * @property {LinkTarget} [target] - The link target. The default value is\n * `LinkTarget.NONE`.\n * @property {string} [rel] - The link relationship. The default value is\n * `DEFAULT_LINK_REL`.\n * @property {boolean} [enabled] - Whether the link should be enabled. The\n * default value is true.\n */\n\n/**\n * Adds various attributes (href, title, target, rel) to hyperlinks.\n * @param {HTMLAnchorElement} link - The link element.\n * @param {ExternalLinkParameters} params\n */\nfunction addLinkAttributes(link, { url, target, rel, enabled = true } = {}) {\n if (!url || typeof url !== \"string\") {\n throw new Error('A valid \"url\" parameter must provided.');\n }\n\n const urlNullRemoved = removeNullCharacters(url);\n if (enabled) {\n link.href = link.title = urlNullRemoved;\n } else {\n link.href = \"\";\n link.title = `Disabled: ${urlNullRemoved}`;\n link.onclick = () => {\n return false;\n };\n }\n\n let targetStr = \"\"; // LinkTarget.NONE\n switch (target) {\n case LinkTarget.NONE:\n break;\n case LinkTarget.SELF:\n targetStr = \"_self\";\n break;\n case LinkTarget.BLANK:\n targetStr = \"_blank\";\n break;\n case LinkTarget.PARENT:\n targetStr = \"_parent\";\n break;\n case LinkTarget.TOP:\n targetStr = \"_top\";\n break;\n }\n link.target = targetStr;\n\n link.rel = typeof rel === \"string\" ? rel : DEFAULT_LINK_REL;\n}\n\n/**\n * @typedef {Object} PDFLinkServiceOptions\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} [externalLinkTarget] - Specifies the `target` attribute\n * for external links. Must use one of the values from {LinkTarget}.\n * Defaults to using no target.\n * @property {string} [externalLinkRel] - Specifies the `rel` attribute for\n * external links. Defaults to stripping the referrer.\n * @property {boolean} [ignoreDestinationZoom] - Ignores the zoom argument,\n * thus preserving the current zoom level in the viewer, when navigating\n * to internal destinations. The default value is `false`.\n */\n\n/**\n * Performs navigation functions inside PDF, such as opening specified page,\n * or destination.\n * @implements {IPDFLinkService}\n */\nclass PDFLinkService {\n #pagesRefCache = new Map();\n\n /**\n * @param {PDFLinkServiceOptions} options\n */\n constructor({\n eventBus,\n externalLinkTarget = null,\n externalLinkRel = null,\n ignoreDestinationZoom = false,\n } = {}) {\n this.eventBus = eventBus;\n this.externalLinkTarget = externalLinkTarget;\n this.externalLinkRel = externalLinkRel;\n this.externalLinkEnabled = true;\n this._ignoreDestinationZoom = ignoreDestinationZoom;\n\n this.baseUrl = null;\n this.pdfDocument = null;\n this.pdfViewer = null;\n this.pdfHistory = null;\n }\n\n setDocument(pdfDocument, baseUrl = null) {\n this.baseUrl = baseUrl;\n this.pdfDocument = pdfDocument;\n this.#pagesRefCache.clear();\n }\n\n setViewer(pdfViewer) {\n this.pdfViewer = pdfViewer;\n }\n\n setHistory(pdfHistory) {\n this.pdfHistory = pdfHistory;\n }\n\n /**\n * @type {number}\n */\n get pagesCount() {\n return this.pdfDocument ? this.pdfDocument.numPages : 0;\n }\n\n /**\n * @type {number}\n */\n get page() {\n return this.pdfViewer.currentPageNumber;\n }\n\n /**\n * @param {number} value\n */\n set page(value) {\n this.pdfViewer.currentPageNumber = value;\n }\n\n /**\n * @type {number}\n */\n get rotation() {\n return this.pdfViewer.pagesRotation;\n }\n\n /**\n * @param {number} value\n */\n set rotation(value) {\n this.pdfViewer.pagesRotation = value;\n }\n\n /**\n * @type {boolean}\n */\n get isInPresentationMode() {\n return this.pdfViewer.isInPresentationMode;\n }\n\n #goToDestinationHelper(rawDest, namedDest = null, explicitDest) {\n // Dest array looks like that: <page-ref> </XYZ|/FitXXX> <args..>\n const destRef = explicitDest[0];\n let pageNumber;\n\n if (typeof destRef === \"object\" && destRef !== null) {\n pageNumber = this._cachedPageNumber(destRef);\n\n if (!pageNumber) {\n // Fetch the page reference if it's not yet available. This could\n // only occur during loading, before all pages have been resolved.\n this.pdfDocument\n .getPageIndex(destRef)\n .then(pageIndex => {\n this.cachePageRef(pageIndex + 1, destRef);\n this.#goToDestinationHelper(rawDest, namedDest, explicitDest);\n })\n .catch(() => {\n console.error(\n `PDFLinkService.#goToDestinationHelper: \"${destRef}\" is not ` +\n `a valid page reference, for dest=\"${rawDest}\".`\n );\n });\n return;\n }\n } else if (Number.isInteger(destRef)) {\n pageNumber = destRef + 1;\n } else {\n console.error(\n `PDFLinkService.#goToDestinationHelper: \"${destRef}\" is not ` +\n `a valid destination reference, for dest=\"${rawDest}\".`\n );\n return;\n }\n if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {\n console.error(\n `PDFLinkService.#goToDestinationHelper: \"${pageNumber}\" is not ` +\n `a valid page number, for dest=\"${rawDest}\".`\n );\n return;\n }\n\n if (this.pdfHistory) {\n // Update the browser history before scrolling the new destination into\n // view, to be able to accurately capture the current document position.\n this.pdfHistory.pushCurrentPosition();\n this.pdfHistory.push({ namedDest, explicitDest, pageNumber });\n }\n\n this.pdfViewer.scrollPageIntoView({\n pageNumber,\n destArray: explicitDest,\n ignoreDestinationZoom: this._ignoreDestinationZoom,\n });\n }\n\n /**\n * This method will, when available, also update the browser history.\n *\n * @param {string|Array} dest - The named, or explicit, PDF destination.\n */\n async goToDestination(dest) {\n if (!this.pdfDocument) {\n return;\n }\n let namedDest, explicitDest;\n if (typeof dest === \"string\") {\n namedDest = dest;\n explicitDest = await this.pdfDocument.getDestination(dest);\n } else {\n namedDest = null;\n explicitDest = await dest;\n }\n if (!Array.isArray(explicitDest)) {\n console.error(\n `PDFLinkService.goToDestination: \"${explicitDest}\" is not ` +\n `a valid destination array, for dest=\"${dest}\".`\n );\n return;\n }\n this.#goToDestinationHelper(dest, namedDest, explicitDest);\n }\n\n /**\n * This method will, when available, also update the browser history.\n *\n * @param {number|string} val - The page number, or page label.\n */\n goToPage(val) {\n if (!this.pdfDocument) {\n return;\n }\n const pageNumber =\n (typeof val === \"string\" && this.pdfViewer.pageLabelToPageNumber(val)) ||\n val | 0;\n if (\n !(\n Number.isInteger(pageNumber) &&\n pageNumber > 0 &&\n pageNumber <= this.pagesCount\n )\n ) {\n console.error(`PDFLinkService.goToPage: \"${val}\" is not a valid page.`);\n return;\n }\n\n if (this.pdfHistory) {\n // Update the browser history before scrolling the new page into view,\n // to be able to accurately capture the current document position.\n this.pdfHistory.pushCurrentPosition();\n this.pdfHistory.pushPage(pageNumber);\n }\n\n this.pdfViewer.scrollPageIntoView({ pageNumber });\n }\n\n /**\n * Wrapper around the `addLinkAttributes` helper function.\n * @param {HTMLAnchorElement} link\n * @param {string} url\n * @param {boolean} [newWindow]\n */\n addLinkAttributes(link, url, newWindow = false) {\n addLinkAttributes(link, {\n url,\n target: newWindow ? LinkTarget.BLANK : this.externalLinkTarget,\n rel: this.externalLinkRel,\n enabled: this.externalLinkEnabled,\n });\n }\n\n /**\n * @param {string|Array} dest - The PDF destination object.\n * @returns {string} The hyperlink to the PDF object.\n */\n getDestinationHash(dest) {\n if (typeof dest === \"string\") {\n if (dest.length > 0) {\n return this.getAnchorUrl(\"#\" + escape(dest));\n }\n } else if (Array.isArray(dest)) {\n const str = JSON.stringify(dest);\n if (str.length > 0) {\n return this.getAnchorUrl(\"#\" + escape(str));\n }\n }\n return this.getAnchorUrl(\"\");\n }\n\n /**\n * Prefix the full url on anchor links to make sure that links are resolved\n * relative to the current URL instead of the one defined in <base href>.\n * @param {string} anchor - The anchor hash, including the #.\n * @returns {string} The hyperlink to the PDF object.\n */\n getAnchorUrl(anchor) {\n return this.baseUrl ? this.baseUrl + anchor : anchor;\n }\n\n /**\n * @param {string} hash\n */\n setHash(hash) {\n if (!this.pdfDocument) {\n return;\n }\n let pageNumber, dest;\n if (hash.includes(\"=\")) {\n const params = parseQueryString(hash);\n if (params.has(\"search\")) {\n const query = params.get(\"search\").replaceAll('\"', \"\"),\n phrase = params.get(\"phrase\") === \"true\";\n\n this.eventBus.dispatch(\"findfromurlhash\", {\n source: this,\n query: phrase ? query : query.match(/\\S+/g),\n });\n }\n // borrowing syntax from \"Parameters for Opening PDF Files\"\n if (params.has(\"page\")) {\n pageNumber = params.get(\"page\") | 0 || 1;\n }\n if (params.has(\"zoom\")) {\n // Build the destination array.\n const zoomArgs = params.get(\"zoom\").split(\",\"); // scale,left,top\n const zoomArg = zoomArgs[0];\n const zoomArgNumber = parseFloat(zoomArg);\n\n if (!zoomArg.includes(\"Fit\")) {\n // If the zoomArg is a number, it has to get divided by 100. If it's\n // a string, it should stay as it is.\n dest = [\n null,\n { name: \"XYZ\" },\n zoomArgs.length > 1 ? zoomArgs[1] | 0 : null,\n zoomArgs.length > 2 ? zoomArgs[2] | 0 : null,\n zoomArgNumber ? zoomArgNumber / 100 : zoomArg,\n ];\n } else {\n if (zoomArg === \"Fit\" || zoomArg === \"FitB\") {\n dest = [null, { name: zoomArg }];\n } else if (\n zoomArg === \"FitH\" ||\n zoomArg === \"FitBH\" ||\n zoomArg === \"FitV\" ||\n zoomArg === \"FitBV\"\n ) {\n dest = [\n null,\n { name: zoomArg },\n zoomArgs.length > 1 ? zoomArgs[1] | 0 : null,\n ];\n } else if (zoomArg === \"FitR\") {\n if (zoomArgs.length !== 5) {\n console.error(\n 'PDFLinkService.setHash: Not enough parameters for \"FitR\".'\n );\n } else {\n dest = [\n null,\n { name: zoomArg },\n zoomArgs[1] | 0,\n zoomArgs[2] | 0,\n zoomArgs[3] | 0,\n zoomArgs[4] | 0,\n ];\n }\n } else {\n console.error(\n `PDFLinkService.setHash: \"${zoomArg}\" is not a valid zoom value.`\n );\n }\n }\n }\n if (dest) {\n this.pdfViewer.scrollPageIntoView({\n pageNumber: pageNumber || this.page,\n destArray: dest,\n allowNegativeOffset: true,\n });\n } else if (pageNumber) {\n this.page = pageNumber; // simple page\n }\n if (params.has(\"pagemode\")) {\n this.eventBus.dispatch(\"pagemode\", {\n source: this,\n mode: params.get(\"pagemode\"),\n });\n }\n // Ensure that this parameter is *always* handled last, in order to\n // guarantee that it won't be overridden (e.g. by the \"page\" parameter).\n if (params.has(\"nameddest\")) {\n this.goToDestination(params.get(\"nameddest\"));\n }\n } else {\n // Named (or explicit) destination.\n dest = unescape(hash);\n try {\n dest = JSON.parse(dest);\n\n if (!Array.isArray(dest)) {\n // Avoid incorrectly rejecting a valid named destination, such as\n // e.g. \"4.3\" or \"true\", because `JSON.parse` converted its type.\n dest = dest.toString();\n }\n } catch (ex) {}\n\n if (\n typeof dest === \"string\" ||\n PDFLinkService.#isValidExplicitDestination(dest)\n ) {\n this.goToDestination(dest);\n return;\n }\n console.error(\n `PDFLinkService.setHash: \"${unescape(\n hash\n )}\" is not a valid destination.`\n );\n }\n }\n\n /**\n * @param {string} action\n */\n executeNamedAction(action) {\n // See PDF reference, table 8.45 - Named action\n switch (action) {\n case \"GoBack\":\n this.pdfHistory?.back();\n break;\n\n case \"GoForward\":\n this.pdfHistory?.forward();\n break;\n\n case \"NextPage\":\n this.pdfViewer.nextPage();\n break;\n\n case \"PrevPage\":\n this.pdfViewer.previousPage();\n break;\n\n case \"LastPage\":\n this.page = this.pagesCount;\n break;\n\n case \"FirstPage\":\n this.page = 1;\n break;\n\n default:\n break; // No action according to spec\n }\n\n this.eventBus.dispatch(\"namedaction\", {\n source: this,\n action,\n });\n }\n\n /**\n * @param {Object} action\n */\n async executeSetOCGState(action) {\n const pdfDocument = this.pdfDocument;\n const optionalContentConfig = await this.pdfViewer\n .optionalContentConfigPromise;\n\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the optional content resolved.\n }\n let operator;\n\n for (const elem of action.state) {\n switch (elem) {\n case \"ON\":\n case \"OFF\":\n case \"Toggle\":\n operator = elem;\n continue;\n }\n switch (operator) {\n case \"ON\":\n optionalContentConfig.setVisibility(elem, true);\n break;\n case \"OFF\":\n optionalContentConfig.setVisibility(elem, false);\n break;\n case \"Toggle\":\n const group = optionalContentConfig.getGroup(elem);\n if (group) {\n optionalContentConfig.setVisibility(elem, !group.visible);\n }\n break;\n }\n }\n\n this.pdfViewer.optionalContentConfigPromise = Promise.resolve(\n optionalContentConfig\n );\n }\n\n /**\n * @param {number} pageNum - page number.\n * @param {Object} pageRef - reference to the page.\n */\n cachePageRef(pageNum, pageRef) {\n if (!pageRef) {\n return;\n }\n const refStr =\n pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;\n this.#pagesRefCache.set(refStr, pageNum);\n }\n\n /**\n * @ignore\n */\n _cachedPageNumber(pageRef) {\n if (!pageRef) {\n return null;\n }\n const refStr =\n pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;\n return this.#pagesRefCache.get(refStr) || null;\n }\n\n static #isValidExplicitDestination(dest) {\n if (!Array.isArray(dest)) {\n return false;\n }\n const destLength = dest.length;\n if (destLength < 2) {\n return false;\n }\n const page = dest[0];\n if (\n !(\n typeof page === \"object\" &&\n Number.isInteger(page.num) &&\n Number.isInteger(page.gen)\n ) &&\n !(Number.isInteger(page) && page >= 0)\n ) {\n return false;\n }\n const zoom = dest[1];\n if (!(typeof zoom === \"object\" && typeof zoom.name === \"string\")) {\n return false;\n }\n let allowNull = true;\n switch (zoom.name) {\n case \"XYZ\":\n if (destLength !== 5) {\n return false;\n }\n break;\n case \"Fit\":\n case \"FitB\":\n return destLength === 2;\n case \"FitH\":\n case \"FitBH\":\n case \"FitV\":\n case \"FitBV\":\n if (destLength !== 3) {\n return false;\n }\n break;\n case \"FitR\":\n if (destLength !== 6) {\n return false;\n }\n allowNull = false;\n break;\n default:\n return false;\n }\n for (let i = 2; i < destLength; i++) {\n const param = dest[i];\n if (!(typeof param === \"number\" || (allowNull && param === null))) {\n return false;\n }\n }\n return true;\n }\n}\n\n/**\n * @implements {IPDFLinkService}\n */\nclass SimpleLinkService {\n constructor() {\n this.externalLinkEnabled = true;\n }\n\n /**\n * @type {number}\n */\n get pagesCount() {\n return 0;\n }\n\n /**\n * @type {number}\n */\n get page() {\n return 0;\n }\n\n /**\n * @param {number} value\n */\n set page(value) {}\n\n /**\n * @type {number}\n */\n get rotation() {\n return 0;\n }\n\n /**\n * @param {number} value\n */\n set rotation(value) {}\n\n /**\n * @type {boolean}\n */\n get isInPresentationMode() {\n return false;\n }\n\n /**\n * @param {string|Array} dest - The named, or explicit, PDF destination.\n */\n async goToDestination(dest) {}\n\n /**\n * @param {number|string} val - The page number, or page label.\n */\n goToPage(val) {}\n\n /**\n * @param {HTMLAnchorElement} link\n * @param {string} url\n * @param {boolean} [newWindow]\n */\n addLinkAttributes(link, url, newWindow = false) {\n addLinkAttributes(link, { url, enabled: this.externalLinkEnabled });\n }\n\n /**\n * @param dest - The PDF destination object.\n * @returns {string} The hyperlink to the PDF object.\n */\n getDestinationHash(dest) {\n return \"#\";\n }\n\n /**\n * @param hash - The PDF parameters/hash.\n * @returns {string} The hyperlink to the PDF object.\n */\n getAnchorUrl(hash) {\n return \"#\";\n }\n\n /**\n * @param {string} hash\n */\n setHash(hash) {}\n\n /**\n * @param {string} action\n */\n executeNamedAction(action) {}\n\n /**\n * @param {Object} action\n */\n executeSetOCGState(action) {}\n\n /**\n * @param {number} pageNum - page number.\n * @param {Object} pageRef - reference to the page.\n */\n cachePageRef(pageNum, pageRef) {}\n}\n\nexport { LinkTarget, PDFLinkService, SimpleLinkService };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AnnotationEditorParamsType } from \"pdfjs-lib\";\n\nclass AnnotationEditorParams {\n /**\n * @param {AnnotationEditorParamsOptions} options\n * @param {EventBus} eventBus\n */\n constructor(options, eventBus) {\n this.eventBus = eventBus;\n this.#bindListeners(options);\n }\n\n #bindListeners({\n editorFreeTextFontSize,\n editorFreeTextColor,\n editorInkColor,\n editorInkThickness,\n editorInkOpacity,\n }) {\n const dispatchEvent = (typeStr, value) => {\n this.eventBus.dispatch(\"switchannotationeditorparams\", {\n source: this,\n type: AnnotationEditorParamsType[typeStr],\n value,\n });\n };\n editorFreeTextFontSize.addEventListener(\"input\", function () {\n dispatchEvent(\"FREETEXT_SIZE\", this.valueAsNumber);\n });\n editorFreeTextColor.addEventListener(\"input\", function () {\n dispatchEvent(\"FREETEXT_COLOR\", this.value);\n });\n editorInkColor.addEventListener(\"input\", function () {\n dispatchEvent(\"INK_COLOR\", this.value);\n });\n editorInkThickness.addEventListener(\"input\", function () {\n dispatchEvent(\"INK_THICKNESS\", this.valueAsNumber);\n });\n editorInkOpacity.addEventListener(\"input\", function () {\n dispatchEvent(\"INK_OPACITY\", this.valueAsNumber);\n });\n\n this.eventBus._on(\"annotationeditorparamschanged\", evt => {\n for (const [type, value] of evt.details) {\n switch (type) {\n case AnnotationEditorParamsType.FREETEXT_SIZE:\n editorFreeTextFontSize.value = value;\n break;\n case AnnotationEditorParamsType.FREETEXT_COLOR:\n editorFreeTextColor.value = value;\n break;\n case AnnotationEditorParamsType.INK_COLOR:\n editorInkColor.value = value;\n break;\n case AnnotationEditorParamsType.INK_THICKNESS:\n editorInkThickness.value = value;\n break;\n case AnnotationEditorParamsType.INK_OPACITY:\n editorInkOpacity.value = value;\n break;\n }\n }\n });\n }\n}\n\nexport { AnnotationEditorParams };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nclass OverlayManager {\n #overlays = new WeakMap();\n\n #active = null;\n\n get active() {\n return this.#active;\n }\n\n /**\n * @param {HTMLDialogElement} dialog - The overlay's DOM element.\n * @param {boolean} [canForceClose] - Indicates if opening the overlay closes\n * an active overlay. The default is `false`.\n * @returns {Promise} A promise that is resolved when the overlay has been\n * registered.\n */\n async register(dialog, canForceClose = false) {\n if (typeof dialog !== \"object\") {\n throw new Error(\"Not enough parameters.\");\n } else if (this.#overlays.has(dialog)) {\n throw new Error(\"The overlay is already registered.\");\n }\n this.#overlays.set(dialog, { canForceClose });\n\n dialog.addEventListener(\"cancel\", evt => {\n this.#active = null;\n });\n }\n\n /**\n * @param {HTMLDialogElement} dialog - The overlay's DOM element.\n * @returns {Promise} A promise that is resolved when the overlay has been\n * unregistered.\n */\n async unregister(dialog) {\n if (!this.#overlays.has(dialog)) {\n throw new Error(\"The overlay does not exist.\");\n } else if (this.#active === dialog) {\n throw new Error(\"The overlay cannot be removed while it is active.\");\n }\n this.#overlays.delete(dialog);\n }\n\n /**\n * @param {HTMLDialogElement} dialog - The overlay's DOM element.\n * @returns {Promise} A promise that is resolved when the overlay has been\n * opened.\n */\n async open(dialog) {\n if (!this.#overlays.has(dialog)) {\n throw new Error(\"The overlay does not exist.\");\n } else if (this.#active) {\n if (this.#active === dialog) {\n throw new Error(\"The overlay is already active.\");\n } else if (this.#overlays.get(dialog).canForceClose) {\n await this.close();\n } else {\n throw new Error(\"Another overlay is currently active.\");\n }\n }\n this.#active = dialog;\n dialog.showModal();\n }\n\n /**\n * @param {HTMLDialogElement} dialog - The overlay's DOM element.\n * @returns {Promise} A promise that is resolved when the overlay has been\n * closed.\n */\n async close(dialog = this.#active) {\n if (!this.#overlays.has(dialog)) {\n throw new Error(\"The overlay does not exist.\");\n } else if (!this.#active) {\n throw new Error(\"The overlay is currently not active.\");\n } else if (this.#active !== dialog) {\n throw new Error(\"Another overlay is currently active.\");\n }\n dialog.close();\n this.#active = null;\n }\n}\n\nexport { OverlayManager };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { PasswordResponses, PromiseCapability } from \"pdfjs-lib\";\n\n/**\n * @typedef {Object} PasswordPromptOptions\n * @property {HTMLDialogElement} dialog - The overlay's DOM element.\n * @property {HTMLParagraphElement} label - Label containing instructions for\n * entering the password.\n * @property {HTMLInputElement} input - Input field for entering the password.\n * @property {HTMLButtonElement} submitButton - Button for submitting the\n * password.\n * @property {HTMLButtonElement} cancelButton - Button for cancelling password\n * entry.\n */\n\nclass PasswordPrompt {\n #activeCapability = null;\n\n #updateCallback = null;\n\n #reason = null;\n\n /**\n * @param {PasswordPromptOptions} options\n * @param {OverlayManager} overlayManager - Manager for the viewer overlays.\n * @param {IL10n} l10n - Localization service.\n * @param {boolean} [isViewerEmbedded] - If the viewer is embedded, in e.g.\n * an <iframe> or an <object>. The default value is `false`.\n */\n constructor(options, overlayManager, l10n, isViewerEmbedded = false) {\n this.dialog = options.dialog;\n this.label = options.label;\n this.input = options.input;\n this.submitButton = options.submitButton;\n this.cancelButton = options.cancelButton;\n this.overlayManager = overlayManager;\n this.l10n = l10n;\n this._isViewerEmbedded = isViewerEmbedded;\n\n // Attach the event listeners.\n this.submitButton.addEventListener(\"click\", this.#verify.bind(this));\n this.cancelButton.addEventListener(\"click\", this.close.bind(this));\n this.input.addEventListener(\"keydown\", e => {\n if (e.keyCode === /* Enter = */ 13) {\n this.#verify();\n }\n });\n\n this.overlayManager.register(this.dialog, /* canForceClose = */ true);\n\n this.dialog.addEventListener(\"close\", this.#cancel.bind(this));\n }\n\n async open() {\n if (this.#activeCapability) {\n await this.#activeCapability.promise;\n }\n this.#activeCapability = new PromiseCapability();\n\n try {\n await this.overlayManager.open(this.dialog);\n } catch (ex) {\n this.#activeCapability = null;\n throw ex;\n }\n\n const passwordIncorrect =\n this.#reason === PasswordResponses.INCORRECT_PASSWORD;\n\n if (!this._isViewerEmbedded || passwordIncorrect) {\n this.input.focus();\n }\n this.label.textContent = await this.l10n.get(\n `password_${passwordIncorrect ? \"invalid\" : \"label\"}`\n );\n }\n\n async close() {\n if (this.overlayManager.active === this.dialog) {\n this.overlayManager.close(this.dialog);\n }\n }\n\n #verify() {\n const password = this.input.value;\n if (password?.length > 0) {\n this.#invokeCallback(password);\n }\n }\n\n #cancel() {\n this.#invokeCallback(new Error(\"PasswordPrompt cancelled.\"));\n this.#activeCapability.resolve();\n }\n\n #invokeCallback(password) {\n if (!this.#updateCallback) {\n return; // Ensure that the callback is only invoked once.\n }\n this.close();\n this.input.value = \"\";\n\n this.#updateCallback(password);\n this.#updateCallback = null;\n }\n\n async setUpdateCallback(updateCallback, reason) {\n if (this.#activeCapability) {\n await this.#activeCapability.promise;\n }\n this.#updateCallback = updateCallback;\n this.#reason = reason;\n }\n}\n\nexport { PasswordPrompt };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getFilenameFromUrl, PromiseCapability } from \"pdfjs-lib\";\nimport { BaseTreeViewer } from \"./base_tree_viewer.js\";\nimport { waitOnEventOrTimeout } from \"./event_utils.js\";\n\n/**\n * @typedef {Object} PDFAttachmentViewerOptions\n * @property {HTMLDivElement} container - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {DownloadManager} downloadManager - The download manager.\n */\n\n/**\n * @typedef {Object} PDFAttachmentViewerRenderParameters\n * @property {Object|null} attachments - A lookup table of attachment objects.\n */\n\nclass PDFAttachmentViewer extends BaseTreeViewer {\n /**\n * @param {PDFAttachmentViewerOptions} options\n */\n constructor(options) {\n super(options);\n this.downloadManager = options.downloadManager;\n\n this.eventBus._on(\n \"fileattachmentannotation\",\n this.#appendAttachment.bind(this)\n );\n }\n\n reset(keepRenderedCapability = false) {\n super.reset();\n this._attachments = null;\n\n if (!keepRenderedCapability) {\n // The only situation in which the `_renderedCapability` should *not* be\n // replaced is when appending FileAttachment annotations.\n this._renderedCapability = new PromiseCapability();\n }\n this._pendingDispatchEvent = false;\n }\n\n /**\n * @private\n */\n async _dispatchEvent(attachmentsCount) {\n this._renderedCapability.resolve();\n\n if (attachmentsCount === 0 && !this._pendingDispatchEvent) {\n // Delay the event when no \"regular\" attachments exist, to allow time for\n // parsing of any FileAttachment annotations that may be present on the\n // *initially* rendered page; this reduces the likelihood of temporarily\n // disabling the attachmentsView when the `PDFSidebar` handles the event.\n this._pendingDispatchEvent = true;\n\n await waitOnEventOrTimeout({\n target: this.eventBus,\n name: \"annotationlayerrendered\",\n delay: 1000,\n });\n\n if (!this._pendingDispatchEvent) {\n return; // There was already another `_dispatchEvent`-call`.\n }\n }\n this._pendingDispatchEvent = false;\n\n this.eventBus.dispatch(\"attachmentsloaded\", {\n source: this,\n attachmentsCount,\n });\n }\n\n /**\n * @private\n */\n _bindLink(element, { content, filename }) {\n element.onclick = () => {\n this.downloadManager.openOrDownloadData(element, content, filename);\n return false;\n };\n }\n\n /**\n * @param {PDFAttachmentViewerRenderParameters} params\n */\n render({ attachments, keepRenderedCapability = false }) {\n if (this._attachments) {\n this.reset(keepRenderedCapability);\n }\n this._attachments = attachments || null;\n\n if (!attachments) {\n this._dispatchEvent(/* attachmentsCount = */ 0);\n return;\n }\n\n const fragment = document.createDocumentFragment();\n let attachmentsCount = 0;\n for (const name in attachments) {\n const item = attachments[name];\n const content = item.content,\n filename = getFilenameFromUrl(\n item.filename,\n /* onlyStripPath = */ true\n );\n\n const div = document.createElement(\"div\");\n div.className = \"treeItem\";\n\n const element = document.createElement(\"a\");\n this._bindLink(element, { content, filename });\n element.textContent = this._normalizeTextContent(filename);\n\n div.append(element);\n\n fragment.append(div);\n attachmentsCount++;\n }\n\n this._finishRendering(fragment, attachmentsCount);\n }\n\n /**\n * Used to append FileAttachment annotations to the sidebar.\n */\n #appendAttachment({ filename, content }) {\n const renderedPromise = this._renderedCapability.promise;\n\n renderedPromise.then(() => {\n if (renderedPromise !== this._renderedCapability.promise) {\n return; // The FileAttachment annotation belongs to a previous document.\n }\n const attachments = this._attachments || Object.create(null);\n\n for (const name in attachments) {\n if (filename === name) {\n return; // Ignore the new attachment if it already exists.\n }\n }\n attachments[filename] = {\n filename,\n content,\n };\n this.render({\n attachments,\n keepRenderedCapability: true,\n });\n });\n }\n}\n\nexport { PDFAttachmentViewer };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { removeNullCharacters } from \"./ui_utils.js\";\n\nconst TREEITEM_OFFSET_TOP = -100; // px\nconst TREEITEM_SELECTED_CLASS = \"selected\";\n\nclass BaseTreeViewer {\n constructor(options) {\n if (this.constructor === BaseTreeViewer) {\n throw new Error(\"Cannot initialize BaseTreeViewer.\");\n }\n this.container = options.container;\n this.eventBus = options.eventBus;\n\n this.reset();\n }\n\n reset() {\n this._pdfDocument = null;\n this._lastToggleIsShow = true;\n this._currentTreeItem = null;\n\n // Remove the tree from the DOM.\n this.container.textContent = \"\";\n // Ensure that the left (right in RTL locales) margin is always reset,\n // to prevent incorrect tree alignment if a new document is opened.\n this.container.classList.remove(\"treeWithDeepNesting\");\n }\n\n /**\n * @private\n */\n _dispatchEvent(count) {\n throw new Error(\"Not implemented: _dispatchEvent\");\n }\n\n /**\n * @private\n */\n _bindLink(element, params) {\n throw new Error(\"Not implemented: _bindLink\");\n }\n\n /**\n * @private\n */\n _normalizeTextContent(str) {\n // Chars in range [0x01-0x1F] will be replaced with a white space\n // and 0x00 by \"\".\n return (\n removeNullCharacters(str, /* replaceInvisible */ true) ||\n /* en dash = */ \"\\u2013\"\n );\n }\n\n /**\n * Prepend a button before a tree item which allows the user to collapse or\n * expand all tree items at that level; see `_toggleTreeItem`.\n * @private\n */\n _addToggleButton(div, hidden = false) {\n const toggler = document.createElement(\"div\");\n toggler.className = \"treeItemToggler\";\n if (hidden) {\n toggler.classList.add(\"treeItemsHidden\");\n }\n toggler.onclick = evt => {\n evt.stopPropagation();\n toggler.classList.toggle(\"treeItemsHidden\");\n\n if (evt.shiftKey) {\n const shouldShowAll = !toggler.classList.contains(\"treeItemsHidden\");\n this._toggleTreeItem(div, shouldShowAll);\n }\n };\n div.prepend(toggler);\n }\n\n /**\n * Collapse or expand the subtree of a tree item.\n *\n * @param {Element} root - the root of the item (sub)tree.\n * @param {boolean} show - whether to show the item (sub)tree. If false,\n * the item subtree rooted at `root` will be collapsed.\n * @private\n */\n _toggleTreeItem(root, show = false) {\n this._lastToggleIsShow = show;\n for (const toggler of root.querySelectorAll(\".treeItemToggler\")) {\n toggler.classList.toggle(\"treeItemsHidden\", !show);\n }\n }\n\n /**\n * Collapse or expand all subtrees of the `container`.\n * @private\n */\n _toggleAllTreeItems() {\n this._toggleTreeItem(this.container, !this._lastToggleIsShow);\n }\n\n /**\n * @private\n */\n _finishRendering(fragment, count, hasAnyNesting = false) {\n if (hasAnyNesting) {\n this.container.classList.add(\"treeWithDeepNesting\");\n\n this._lastToggleIsShow = !fragment.querySelector(\".treeItemsHidden\");\n }\n this.container.append(fragment);\n\n this._dispatchEvent(count);\n }\n\n render(params) {\n throw new Error(\"Not implemented: render\");\n }\n\n /**\n * @private\n */\n _updateCurrentTreeItem(treeItem = null) {\n if (this._currentTreeItem) {\n // Ensure that the current treeItem-selection is always removed.\n this._currentTreeItem.classList.remove(TREEITEM_SELECTED_CLASS);\n this._currentTreeItem = null;\n }\n if (treeItem) {\n treeItem.classList.add(TREEITEM_SELECTED_CLASS);\n this._currentTreeItem = treeItem;\n }\n }\n\n /**\n * @private\n */\n _scrollToCurrentTreeItem(treeItem) {\n if (!treeItem) {\n return;\n }\n // Ensure that the treeItem is *fully* expanded, such that it will first of\n // all be visible and secondly that scrolling it into view works correctly.\n let currentNode = treeItem.parentNode;\n while (currentNode && currentNode !== this.container) {\n if (currentNode.classList.contains(\"treeItem\")) {\n const toggler = currentNode.firstElementChild;\n toggler?.classList.remove(\"treeItemsHidden\");\n }\n currentNode = currentNode.parentNode;\n }\n this._updateCurrentTreeItem(treeItem);\n\n this.container.scrollTo(\n treeItem.offsetLeft,\n treeItem.offsetTop + TREEITEM_OFFSET_TOP\n );\n }\n}\n\nexport { BaseTreeViewer };\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CursorTool, PresentationModeState } from \"./ui_utils.js\";\nimport { AnnotationEditorType } from \"pdfjs-lib\";\nimport { GrabToPan } from \"./grab_to_pan.js\";\n\n/**\n * @typedef {Object} PDFCursorToolsOptions\n * @property {HTMLDivElement} container - The document container.\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} [cursorToolOnLoad] - The cursor tool that will be enabled\n * on load; the constants from {CursorTool} should be used. The default value\n * is `CursorTool.SELECT`.\n */\n\nclass PDFCursorTools {\n /**\n * @param {PDFCursorToolsOptions} options\n */\n constructor({ container, eventBus, cursorToolOnLoad = CursorTool.SELECT }) {\n this.container = container;\n this.eventBus = eventBus;\n\n this.active = CursorTool.SELECT;\n this.previouslyActive = null;\n\n this.handTool = new GrabToPan({\n element: this.container,\n });\n\n this.#addEventListeners();\n\n // Defer the initial `switchTool` call, to give other viewer components\n // time to initialize *and* register 'cursortoolchanged' event listeners.\n Promise.resolve().then(() => {\n this.switchTool(cursorToolOnLoad);\n });\n }\n\n /**\n * @type {number} One of the values in {CursorTool}.\n */\n get activeTool() {\n return this.active;\n }\n\n /**\n * @param {number} tool - The cursor mode that should be switched to,\n * must be one of the values in {CursorTool}.\n */\n switchTool(tool) {\n if (this.previouslyActive !== null) {\n // Cursor tools cannot be used in PresentationMode/AnnotationEditor.\n return;\n }\n if (tool === this.active) {\n return; // The requested tool is already active.\n }\n\n const disableActiveTool = () => {\n switch (this.active) {\n case CursorTool.SELECT:\n break;\n case CursorTool.HAND:\n this.handTool.deactivate();\n break;\n case CursorTool.ZOOM:\n /* falls through */\n }\n };\n\n // Enable the new cursor tool.\n switch (tool) {\n case CursorTool.SELECT:\n disableActiveTool();\n break;\n case CursorTool.HAND:\n disableActiveTool();\n this.handTool.activate();\n break;\n case CursorTool.ZOOM:\n /* falls through */\n default:\n console.error(`switchTool: \"${tool}\" is an unsupported value.`);\n return;\n }\n // Update the active tool *after* it has been validated above,\n // in order to prevent setting it to an invalid state.\n this.active = tool;\n\n this.#dispatchEvent();\n }\n\n #dispatchEvent() {\n this.eventBus.dispatch(\"cursortoolchanged\", {\n source: this,\n tool: this.active,\n });\n }\n\n #addEventListeners() {\n this.eventBus._on(\"switchcursortool\", evt => {\n this.switchTool(evt.tool);\n });\n\n let annotationEditorMode = AnnotationEditorType.NONE,\n presentationModeState = PresentationModeState.NORMAL;\n\n const disableActive = () => {\n const previouslyActive = this.active;\n\n this.switchTool(CursorTool.SELECT);\n this.previouslyActive ??= previouslyActive; // Keep track of the first one.\n };\n const enableActive = () => {\n const previouslyActive = this.previouslyActive;\n\n if (\n previouslyActive !== null &&\n annotationEditorMode === AnnotationEditorType.NONE &&\n presentationModeState === PresentationModeState.NORMAL\n ) {\n this.previouslyActive = null;\n this.switchTool(previouslyActive);\n }\n };\n\n this.eventBus._on(\"secondarytoolbarreset\", evt => {\n if (this.previouslyActive !== null) {\n annotationEditorMode = AnnotationEditorType.NONE;\n presentationModeState = PresentationModeState.NORMAL;\n\n enableActive();\n }\n });\n\n this.eventBus._on(\"annotationeditormodechanged\", ({ mode }) => {\n annotationEditorMode = mode;\n\n if (mode === AnnotationEditorType.NONE) {\n enableActive();\n } else {\n disableActive();\n }\n });\n\n this.eventBus._on(\"presentationmodechanged\", ({ state }) => {\n presentationModeState = state;\n\n if (state === PresentationModeState.NORMAL) {\n enableActive();\n } else if (state === PresentationModeState.FULLSCREEN) {\n disableActive();\n }\n });\n }\n}\n\nexport { PDFCursorTools };\n","/* Copyright 2013 Rob Wu <rob@robwu.nl>\n * https://github.com/Rob--W/grab-to-pan.js\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Class name of element which can be grabbed.\nconst CSS_CLASS_GRAB = \"grab-to-pan-grab\";\n\nclass GrabToPan {\n /**\n * Construct a GrabToPan instance for a given HTML element.\n * @param {Element} options.element\n * @param {function} [options.ignoreTarget] - See `ignoreTarget(node)`.\n * @param {function(boolean)} [options.onActiveChanged] - Called when\n * grab-to-pan is (de)activated. The first argument is a boolean that\n * shows whether grab-to-pan is activated.\n */\n constructor(options) {\n this.element = options.element;\n this.document = options.element.ownerDocument;\n if (typeof options.ignoreTarget === \"function\") {\n this.ignoreTarget = options.ignoreTarget;\n }\n this.onActiveChanged = options.onActiveChanged;\n\n // Bind the contexts to ensure that `this` always points to\n // the GrabToPan instance.\n this.activate = this.activate.bind(this);\n this.deactivate = this.deactivate.bind(this);\n this.toggle = this.toggle.bind(this);\n this._onMouseDown = this.#onMouseDown.bind(this);\n this._onMouseMove = this.#onMouseMove.bind(this);\n this._endPan = this.#endPan.bind(this);\n\n // This overlay will be inserted in the document when the mouse moves during\n // a grab operation, to ensure that the cursor has the desired appearance.\n const overlay = (this.overlay = document.createElement(\"div\"));\n overlay.className = \"grab-to-pan-grabbing\";\n }\n\n /**\n * Bind a mousedown event to the element to enable grab-detection.\n */\n activate() {\n if (!this.active) {\n this.active = true;\n this.element.addEventListener(\"mousedown\", this._onMouseDown, true);\n this.element.classList.add(CSS_CLASS_GRAB);\n\n this.onActiveChanged?.(true);\n }\n }\n\n /**\n * Removes all events. Any pending pan session is immediately stopped.\n */\n deactivate() {\n if (this.active) {\n this.active = false;\n this.element.removeEventListener(\"mousedown\", this._onMouseDown, true);\n this._endPan();\n this.element.classList.remove(CSS_CLASS_GRAB);\n\n this.onActiveChanged?.(false);\n }\n }\n\n toggle() {\n if (this.active) {\n this.deactivate();\n } else {\n this.activate();\n }\n }\n\n /**\n * Whether to not pan if the target element is clicked.\n * Override this method to change the default behaviour.\n *\n * @param {Element} node - The target of the event.\n * @returns {boolean} Whether to not react to the click event.\n */\n ignoreTarget(node) {\n // Check whether the clicked element is, a child of, an input element/link.\n return node.matches(\n \"a[href], a[href] *, input, textarea, button, button *, select, option\"\n );\n }\n\n #onMouseDown(event) {\n if (event.button !== 0 || this.ignoreTarget(event.target)) {\n return;\n }\n if (event.originalTarget) {\n try {\n // eslint-disable-next-line no-unused-expressions\n event.originalTarget.tagName;\n } catch (e) {\n // Mozilla-specific: element is a scrollbar (XUL element)\n return;\n }\n }\n\n this.scrollLeftStart = this.element.scrollLeft;\n this.scrollTopStart = this.element.scrollTop;\n this.clientXStart = event.clientX;\n this.clientYStart = event.clientY;\n this.document.addEventListener(\"mousemove\", this._onMouseMove, true);\n this.document.addEventListener(\"mouseup\", this._endPan, true);\n // When a scroll event occurs before a mousemove, assume that the user\n // dragged a scrollbar (necessary for Opera Presto, Safari and IE)\n // (not needed for Chrome/Firefox)\n this.element.addEventListener(\"scroll\", this._endPan, true);\n event.preventDefault();\n event.stopPropagation();\n\n const focusedElement = document.activeElement;\n if (focusedElement && !focusedElement.contains(event.target)) {\n focusedElement.blur();\n }\n }\n\n #onMouseMove(event) {\n this.element.removeEventListener(\"scroll\", this._endPan, true);\n if (!(event.buttons & 1)) {\n // The left mouse button is released.\n this._endPan();\n return;\n }\n const xDiff = event.clientX - this.clientXStart;\n const yDiff = event.clientY - this.clientYStart;\n const scrollTop = this.scrollTopStart - yDiff;\n const scrollLeft = this.scrollLeftStart - xDiff;\n if (this.element.scrollTo) {\n this.element.scrollTo({\n top: scrollTop,\n left: scrollLeft,\n behavior: \"instant\",\n });\n } else {\n this.element.scrollTop = scrollTop;\n this.element.scrollLeft = scrollLeft;\n }\n if (!this.overlay.parentNode) {\n document.body.append(this.overlay);\n }\n }\n\n #endPan() {\n this.element.removeEventListener(\"scroll\", this._endPan, true);\n this.document.removeEventListener(\"mousemove\", this._onMouseMove, true);\n this.document.removeEventListener(\"mouseup\", this._endPan, true);\n // Note: ChildNode.remove doesn't throw if the parentNode is undefined.\n this.overlay.remove();\n }\n}\n\nexport { GrabToPan };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getPageSizeInches, isPortraitOrientation } from \"./ui_utils.js\";\nimport { PDFDateString, PromiseCapability } from \"pdfjs-lib\";\n\nconst DEFAULT_FIELD_CONTENT = \"-\";\n\n// See https://en.wikibooks.org/wiki/Lentis/Conversion_to_the_Metric_Standard_in_the_United_States\nconst NON_METRIC_LOCALES = [\"en-us\", \"en-lr\", \"my\"];\n\n// Should use the format: `width x height`, in portrait orientation.\n// See https://en.wikipedia.org/wiki/Paper_size\nconst US_PAGE_NAMES = {\n \"8.5x11\": \"Letter\",\n \"8.5x14\": \"Legal\",\n};\nconst METRIC_PAGE_NAMES = {\n \"297x420\": \"A3\",\n \"210x297\": \"A4\",\n};\n\nfunction getPageName(size, isPortrait, pageNames) {\n const width = isPortrait ? size.width : size.height;\n const height = isPortrait ? size.height : size.width;\n\n return pageNames[`${width}x${height}`];\n}\n\n/**\n * @typedef {Object} PDFDocumentPropertiesOptions\n * @property {HTMLDialogElement} dialog - The overlay's DOM element.\n * @property {Object} fields - Names and elements of the overlay's fields.\n * @property {HTMLButtonElement} closeButton - Button for closing the overlay.\n */\n\nclass PDFDocumentProperties {\n #fieldData = null;\n\n /**\n * @param {PDFDocumentPropertiesOptions} options\n * @param {OverlayManager} overlayManager - Manager for the viewer overlays.\n * @param {EventBus} eventBus - The application event bus.\n * @param {IL10n} l10n - Localization service.\n * @param {function} fileNameLookup - The function that is used to lookup\n * the document fileName.\n */\n constructor(\n { dialog, fields, closeButton },\n overlayManager,\n eventBus,\n l10n,\n fileNameLookup\n ) {\n this.dialog = dialog;\n this.fields = fields;\n this.overlayManager = overlayManager;\n this.l10n = l10n;\n this._fileNameLookup = fileNameLookup;\n\n this.#reset();\n // Bind the event listener for the Close button.\n closeButton.addEventListener(\"click\", this.close.bind(this));\n\n this.overlayManager.register(this.dialog);\n\n eventBus._on(\"pagechanging\", evt => {\n this._currentPageNumber = evt.pageNumber;\n });\n eventBus._on(\"rotationchanging\", evt => {\n this._pagesRotation = evt.pagesRotation;\n });\n\n this._isNonMetricLocale = true; // The default viewer locale is 'en-us'.\n l10n.getLanguage().then(locale => {\n this._isNonMetricLocale = NON_METRIC_LOCALES.includes(locale);\n });\n }\n\n /**\n * Open the document properties overlay.\n */\n async open() {\n await Promise.all([\n this.overlayManager.open(this.dialog),\n this._dataAvailableCapability.promise,\n ]);\n const currentPageNumber = this._currentPageNumber;\n const pagesRotation = this._pagesRotation;\n\n // If the document properties were previously fetched (for this PDF file),\n // just update the dialog immediately to avoid redundant lookups.\n if (\n this.#fieldData &&\n currentPageNumber === this.#fieldData._currentPageNumber &&\n pagesRotation === this.#fieldData._pagesRotation\n ) {\n this.#updateUI();\n return;\n }\n\n // Get the document properties.\n const {\n info,\n /* metadata, */\n /* contentDispositionFilename, */\n contentLength,\n } = await this.pdfDocument.getMetadata();\n\n const [\n fileName,\n fileSize,\n creationDate,\n modificationDate,\n pageSize,\n isLinearized,\n ] = await Promise.all([\n this._fileNameLookup(),\n this.#parseFileSize(contentLength),\n this.#parseDate(info.CreationDate),\n this.#parseDate(info.ModDate),\n this.pdfDocument.getPage(currentPageNumber).then(pdfPage => {\n return this.#parsePageSize(getPageSizeInches(pdfPage), pagesRotation);\n }),\n this.#parseLinearization(info.IsLinearized),\n ]);\n\n this.#fieldData = Object.freeze({\n fileName,\n fileSize,\n title: info.Title,\n author: info.Author,\n subject: info.Subject,\n keywords: info.Keywords,\n creationDate,\n modificationDate,\n creator: info.Creator,\n producer: info.Producer,\n version: info.PDFFormatVersion,\n pageCount: this.pdfDocument.numPages,\n pageSize,\n linearized: isLinearized,\n _currentPageNumber: currentPageNumber,\n _pagesRotation: pagesRotation,\n });\n this.#updateUI();\n\n // Get the correct fileSize, since it may not have been available\n // or could potentially be wrong.\n const { length } = await this.pdfDocument.getDownloadInfo();\n if (contentLength === length) {\n return; // The fileSize has already been correctly set.\n }\n const data = Object.assign(Object.create(null), this.#fieldData);\n data.fileSize = await this.#parseFileSize(length);\n\n this.#fieldData = Object.freeze(data);\n this.#updateUI();\n }\n\n /**\n * Close the document properties overlay.\n */\n async close() {\n this.overlayManager.close(this.dialog);\n }\n\n /**\n * Set a reference to the PDF document in order to populate the dialog fields\n * with the document properties. Note that the dialog will contain no\n * information if this method is not called.\n *\n * @param {PDFDocumentProxy} pdfDocument - A reference to the PDF document.\n */\n setDocument(pdfDocument) {\n if (this.pdfDocument) {\n this.#reset();\n this.#updateUI(true);\n }\n if (!pdfDocument) {\n return;\n }\n this.pdfDocument = pdfDocument;\n\n this._dataAvailableCapability.resolve();\n }\n\n #reset() {\n this.pdfDocument = null;\n\n this.#fieldData = null;\n this._dataAvailableCapability = new PromiseCapability();\n this._currentPageNumber = 1;\n this._pagesRotation = 0;\n }\n\n /**\n * Always updates all of the dialog fields, to prevent inconsistent UI state.\n * NOTE: If the contents of a particular field is neither a non-empty string,\n * nor a number, it will fall back to `DEFAULT_FIELD_CONTENT`.\n */\n #updateUI(reset = false) {\n if (reset || !this.#fieldData) {\n for (const id in this.fields) {\n this.fields[id].textContent = DEFAULT_FIELD_CONTENT;\n }\n return;\n }\n if (this.overlayManager.active !== this.dialog) {\n // Don't bother updating the dialog if has already been closed,\n // since it will be updated the next time `this.open` is called.\n return;\n }\n for (const id in this.fields) {\n const content = this.#fieldData[id];\n this.fields[id].textContent =\n content || content === 0 ? content : DEFAULT_FIELD_CONTENT;\n }\n }\n\n async #parseFileSize(fileSize = 0) {\n const kb = fileSize / 1024,\n mb = kb / 1024;\n if (!kb) {\n return undefined;\n }\n return this.l10n.get(`document_properties_${mb >= 1 ? \"mb\" : \"kb\"}`, {\n size_mb: mb >= 1 && (+mb.toPrecision(3)).toLocaleString(),\n size_kb: mb < 1 && (+kb.toPrecision(3)).toLocaleString(),\n size_b: fileSize.toLocaleString(),\n });\n }\n\n async #parsePageSize(pageSizeInches, pagesRotation) {\n if (!pageSizeInches) {\n return undefined;\n }\n // Take the viewer rotation into account as well; compare with Adobe Reader.\n if (pagesRotation % 180 !== 0) {\n pageSizeInches = {\n width: pageSizeInches.height,\n height: pageSizeInches.width,\n };\n }\n const isPortrait = isPortraitOrientation(pageSizeInches);\n\n let sizeInches = {\n width: Math.round(pageSizeInches.width * 100) / 100,\n height: Math.round(pageSizeInches.height * 100) / 100,\n };\n // 1in == 25.4mm; no need to round to 2 decimals for millimeters.\n let sizeMillimeters = {\n width: Math.round(pageSizeInches.width * 25.4 * 10) / 10,\n height: Math.round(pageSizeInches.height * 25.4 * 10) / 10,\n };\n\n let rawName =\n getPageName(sizeInches, isPortrait, US_PAGE_NAMES) ||\n getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES);\n\n if (\n !rawName &&\n !(\n Number.isInteger(sizeMillimeters.width) &&\n Number.isInteger(sizeMillimeters.height)\n )\n ) {\n // Attempt to improve the page name detection by falling back to fuzzy\n // matching of the metric dimensions, to account for e.g. rounding errors\n // and/or PDF files that define the page sizes in an imprecise manner.\n const exactMillimeters = {\n width: pageSizeInches.width * 25.4,\n height: pageSizeInches.height * 25.4,\n };\n const intMillimeters = {\n width: Math.round(sizeMillimeters.width),\n height: Math.round(sizeMillimeters.height),\n };\n\n // Try to avoid false positives, by only considering \"small\" differences.\n if (\n Math.abs(exactMillimeters.width - intMillimeters.width) < 0.1 &&\n Math.abs(exactMillimeters.height - intMillimeters.height) < 0.1\n ) {\n rawName = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES);\n if (rawName) {\n // Update *both* sizes, computed above, to ensure that the displayed\n // dimensions always correspond to the detected page name.\n sizeInches = {\n width: Math.round((intMillimeters.width / 25.4) * 100) / 100,\n height: Math.round((intMillimeters.height / 25.4) * 100) / 100,\n };\n sizeMillimeters = intMillimeters;\n }\n }\n }\n\n const [{ width, height }, unit, name, orientation] = await Promise.all([\n this._isNonMetricLocale ? sizeInches : sizeMillimeters,\n this.l10n.get(\n `document_properties_page_size_unit_${\n this._isNonMetricLocale ? \"inches\" : \"millimeters\"\n }`\n ),\n rawName &&\n this.l10n.get(\n `document_properties_page_size_name_${rawName.toLowerCase()}`\n ),\n this.l10n.get(\n `document_properties_page_size_orientation_${\n isPortrait ? \"portrait\" : \"landscape\"\n }`\n ),\n ]);\n\n return this.l10n.get(\n `document_properties_page_size_dimension_${name ? \"name_\" : \"\"}string`,\n {\n width: width.toLocaleString(),\n height: height.toLocaleString(),\n unit,\n name,\n orientation,\n }\n );\n }\n\n async #parseDate(inputDate) {\n const dateObject = PDFDateString.toDateObject(inputDate);\n if (!dateObject) {\n return undefined;\n }\n return this.l10n.get(\"document_properties_date_string\", {\n date: dateObject.toLocaleDateString(),\n time: dateObject.toLocaleTimeString(),\n });\n }\n\n #parseLinearization(isLinearized) {\n return this.l10n.get(\n `document_properties_linearized_${isLinearized ? \"yes\" : \"no\"}`\n );\n }\n}\n\nexport { PDFDocumentProperties };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FindState } from \"./pdf_find_controller.js\";\nimport { toggleExpandedBtn } from \"./ui_utils.js\";\n\nconst MATCHES_COUNT_LIMIT = 1000;\n\n/**\n * Creates a \"search bar\" given a set of DOM elements that act as controls\n * for searching or for setting search preferences in the UI. This object\n * also sets up the appropriate events for the controls. Actual searching\n * is done by PDFFindController.\n */\nclass PDFFindBar {\n constructor(options, eventBus, l10n) {\n this.opened = false;\n\n this.bar = options.bar;\n this.toggleButton = options.toggleButton;\n this.findField = options.findField;\n this.highlightAll = options.highlightAllCheckbox;\n this.caseSensitive = options.caseSensitiveCheckbox;\n this.matchDiacritics = options.matchDiacriticsCheckbox;\n this.entireWord = options.entireWordCheckbox;\n this.findMsg = options.findMsg;\n this.findResultsCount = options.findResultsCount;\n this.findPreviousButton = options.findPreviousButton;\n this.findNextButton = options.findNextButton;\n this.eventBus = eventBus;\n this.l10n = l10n;\n\n // Add event listeners to the DOM elements.\n this.toggleButton.addEventListener(\"click\", () => {\n this.toggle();\n });\n\n this.findField.addEventListener(\"input\", () => {\n this.dispatchEvent(\"\");\n });\n\n this.bar.addEventListener(\"keydown\", e => {\n switch (e.keyCode) {\n case 13: // Enter\n if (e.target === this.findField) {\n this.dispatchEvent(\"again\", e.shiftKey);\n }\n break;\n case 27: // Escape\n this.close();\n break;\n }\n });\n\n this.findPreviousButton.addEventListener(\"click\", () => {\n this.dispatchEvent(\"again\", true);\n });\n\n this.findNextButton.addEventListener(\"click\", () => {\n this.dispatchEvent(\"again\", false);\n });\n\n this.highlightAll.addEventListener(\"click\", () => {\n this.dispatchEvent(\"highlightallchange\");\n });\n\n this.caseSensitive.addEventListener(\"click\", () => {\n this.dispatchEvent(\"casesensitivitychange\");\n });\n\n this.entireWord.addEventListener(\"click\", () => {\n this.dispatchEvent(\"entirewordchange\");\n });\n\n this.matchDiacritics.addEventListener(\"click\", () => {\n this.dispatchEvent(\"diacriticmatchingchange\");\n });\n\n this.eventBus._on(\"resize\", this.#adjustWidth.bind(this));\n }\n\n reset() {\n this.updateUIState();\n }\n\n dispatchEvent(type, findPrev = false) {\n this.eventBus.dispatch(\"find\", {\n source: this,\n type,\n query: this.findField.value,\n caseSensitive: this.caseSensitive.checked,\n entireWord: this.entireWord.checked,\n highlightAll: this.highlightAll.checked,\n findPrevious: findPrev,\n matchDiacritics: this.matchDiacritics.checked,\n });\n }\n\n updateUIState(state, previous, matchesCount) {\n let findMsg = Promise.resolve(\"\");\n let status = \"\";\n\n switch (state) {\n case FindState.FOUND:\n break;\n case FindState.PENDING:\n status = \"pending\";\n break;\n case FindState.NOT_FOUND:\n findMsg = this.l10n.get(\"find_not_found\");\n status = \"notFound\";\n break;\n case FindState.WRAPPED:\n findMsg = this.l10n.get(`find_reached_${previous ? \"top\" : \"bottom\"}`);\n break;\n }\n this.findField.setAttribute(\"data-status\", status);\n this.findField.setAttribute(\"aria-invalid\", state === FindState.NOT_FOUND);\n\n findMsg.then(msg => {\n this.findMsg.setAttribute(\"data-status\", status);\n this.findMsg.textContent = msg;\n this.#adjustWidth();\n });\n\n this.updateResultsCount(matchesCount);\n }\n\n updateResultsCount({ current = 0, total = 0 } = {}) {\n const limit = MATCHES_COUNT_LIMIT;\n let matchCountMsg = Promise.resolve(\"\");\n\n if (total > 0) {\n if (total > limit) {\n let key = \"find_match_count_limit\";\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n // TODO: Remove this hard-coded `[other]` form once plural support has\n // been implemented in the mozilla-central specific `l10n.js` file.\n key += \"[other]\";\n }\n matchCountMsg = this.l10n.get(key, { limit });\n } else {\n let key = \"find_match_count\";\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n // TODO: Remove this hard-coded `[other]` form once plural support has\n // been implemented in the mozilla-central specific `l10n.js` file.\n key += \"[other]\";\n }\n matchCountMsg = this.l10n.get(key, { current, total });\n }\n }\n matchCountMsg.then(msg => {\n this.findResultsCount.textContent = msg;\n // Since `updateResultsCount` may be called from `PDFFindController`,\n // ensure that the width of the findbar is always updated correctly.\n this.#adjustWidth();\n });\n }\n\n open() {\n if (!this.opened) {\n this.opened = true;\n toggleExpandedBtn(this.toggleButton, true, this.bar);\n }\n this.findField.select();\n this.findField.focus();\n\n this.#adjustWidth();\n }\n\n close() {\n if (!this.opened) {\n return;\n }\n this.opened = false;\n toggleExpandedBtn(this.toggleButton, false, this.bar);\n\n this.eventBus.dispatch(\"findbarclose\", { source: this });\n }\n\n toggle() {\n if (this.opened) {\n this.close();\n } else {\n this.open();\n }\n }\n\n #adjustWidth() {\n if (!this.opened) {\n return;\n }\n\n // The find bar has an absolute position and thus the browser extends\n // its width to the maximum possible width once the find bar does not fit\n // entirely within the window anymore (and its elements are automatically\n // wrapped). Here we detect and fix that.\n this.bar.classList.remove(\"wrapContainers\");\n\n const findbarHeight = this.bar.clientHeight;\n const inputContainerHeight = this.bar.firstElementChild.clientHeight;\n\n if (findbarHeight > inputContainerHeight) {\n // The findbar is taller than the input container, which means that\n // the browser wrapped some of the elements. For a consistent look,\n // wrap all of them to adjust the width of the find bar.\n this.bar.classList.add(\"wrapContainers\");\n }\n }\n}\n\nexport { PDFFindBar };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { binarySearchFirstItem, scrollIntoView } from \"./ui_utils.js\";\nimport { getCharacterType, getNormalizeWithNFKC } from \"./pdf_find_utils.js\";\nimport { PromiseCapability } from \"pdfjs-lib\";\n\nconst FindState = {\n FOUND: 0,\n NOT_FOUND: 1,\n WRAPPED: 2,\n PENDING: 3,\n};\n\nconst FIND_TIMEOUT = 250; // ms\nconst MATCH_SCROLL_OFFSET_TOP = -50; // px\nconst MATCH_SCROLL_OFFSET_LEFT = -400; // px\n\nconst CHARACTERS_TO_NORMALIZE = {\n \"\\u2010\": \"-\", // Hyphen\n \"\\u2018\": \"'\", // Left single quotation mark\n \"\\u2019\": \"'\", // Right single quotation mark\n \"\\u201A\": \"'\", // Single low-9 quotation mark\n \"\\u201B\": \"'\", // Single high-reversed-9 quotation mark\n \"\\u201C\": '\"', // Left double quotation mark\n \"\\u201D\": '\"', // Right double quotation mark\n \"\\u201E\": '\"', // Double low-9 quotation mark\n \"\\u201F\": '\"', // Double high-reversed-9 quotation mark\n \"\\u00BC\": \"1/4\", // Vulgar fraction one quarter\n \"\\u00BD\": \"1/2\", // Vulgar fraction one half\n \"\\u00BE\": \"3/4\", // Vulgar fraction three quarters\n};\n\n// These diacritics aren't considered as combining diacritics\n// when searching in a document:\n// https://searchfox.org/mozilla-central/source/intl/unicharutil/util/is_combining_diacritic.py.\n// The combining class definitions can be found:\n// https://www.unicode.org/reports/tr44/#Canonical_Combining_Class_Values\n// Category 0 corresponds to [^\\p{Mn}].\nconst DIACRITICS_EXCEPTION = new Set([\n // UNICODE_COMBINING_CLASS_KANA_VOICING\n // https://www.compart.com/fr/unicode/combining/8\n 0x3099, 0x309a,\n // UNICODE_COMBINING_CLASS_VIRAMA (under 0xFFFF)\n // https://www.compart.com/fr/unicode/combining/9\n 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b,\n 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714,\n 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f,\n 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed,\n // 91\n // https://www.compart.com/fr/unicode/combining/91\n 0x0c56,\n // 129\n // https://www.compart.com/fr/unicode/combining/129\n 0x0f71,\n // 130\n // https://www.compart.com/fr/unicode/combining/130\n 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80,\n // 132\n // https://www.compart.com/fr/unicode/combining/132\n 0x0f74,\n]);\nlet DIACRITICS_EXCEPTION_STR; // Lazily initialized, see below.\n\nconst DIACRITICS_REG_EXP = /\\p{M}+/gu;\nconst SPECIAL_CHARS_REG_EXP =\n /([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})/gu;\nconst NOT_DIACRITIC_FROM_END_REG_EXP = /([^\\p{M}])\\p{M}*$/u;\nconst NOT_DIACRITIC_FROM_START_REG_EXP = /^\\p{M}*([^\\p{M}])/u;\n\n// The range [AC00-D7AF] corresponds to the Hangul syllables.\n// The few other chars are some CJK Compatibility Ideographs.\nconst SYLLABLES_REG_EXP = /[\\uAC00-\\uD7AF\\uFA6C\\uFACF-\\uFAD1\\uFAD5-\\uFAD7]+/g;\nconst SYLLABLES_LENGTHS = new Map();\n// When decomposed (in using NFD) the above syllables will start\n// with one of the chars in this regexp.\nconst FIRST_CHAR_SYLLABLES_REG_EXP =\n \"[\\\\u1100-\\\\u1112\\\\ud7a4-\\\\ud7af\\\\ud84a\\\\ud84c\\\\ud850\\\\ud854\\\\ud857\\\\ud85f]\";\n\nconst NFKC_CHARS_TO_NORMALIZE = new Map();\n\nlet noSyllablesRegExp = null;\nlet withSyllablesRegExp = null;\n\nfunction normalize(text) {\n // The diacritics in the text or in the query can be composed or not.\n // So we use a decomposed text using NFD (and the same for the query)\n // in order to be sure that diacritics are in the same order.\n\n // Collect syllables length and positions.\n const syllablePositions = [];\n let m;\n while ((m = SYLLABLES_REG_EXP.exec(text)) !== null) {\n let { index } = m;\n for (const char of m[0]) {\n let len = SYLLABLES_LENGTHS.get(char);\n if (!len) {\n len = char.normalize(\"NFD\").length;\n SYLLABLES_LENGTHS.set(char, len);\n }\n syllablePositions.push([len, index++]);\n }\n }\n\n let normalizationRegex;\n if (syllablePositions.length === 0 && noSyllablesRegExp) {\n normalizationRegex = noSyllablesRegExp;\n } else if (syllablePositions.length > 0 && withSyllablesRegExp) {\n normalizationRegex = withSyllablesRegExp;\n } else {\n // Compile the regular expression for text normalization once.\n const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join(\"\");\n const toNormalizeWithNFKC = getNormalizeWithNFKC();\n\n // 3040-309F: Hiragana\n // 30A0-30FF: Katakana\n const CJK = \"(?:\\\\p{Ideographic}|[\\u3040-\\u30FF])\";\n const HKDiacritics = \"(?:\\u3099|\\u309A)\";\n const regexp = `([${replace}])|([${toNormalizeWithNFKC}])|(${HKDiacritics}\\\\n)|(\\\\p{M}+(?:-\\\\n)?)|(\\\\S-\\\\n)|(${CJK}\\\\n)|(\\\\n)`;\n\n if (syllablePositions.length === 0) {\n // Most of the syllables belong to Hangul so there are no need\n // to search for them in a non-Hangul document.\n // We use the \\0 in order to have the same number of groups.\n normalizationRegex = noSyllablesRegExp = new RegExp(\n regexp + \"|(\\\\u0000)\",\n \"gum\"\n );\n } else {\n normalizationRegex = withSyllablesRegExp = new RegExp(\n regexp + `|(${FIRST_CHAR_SYLLABLES_REG_EXP})`,\n \"gum\"\n );\n }\n }\n\n // The goal of this function is to normalize the string and\n // be able to get from an index in the new string the\n // corresponding index in the old string.\n // For example if we have: abCd12ef456gh where C is replaced by ccc\n // and numbers replaced by nothing (it's the case for diacritics), then\n // we'll obtain the normalized string: abcccdefgh.\n // So here the reverse map is: [0,1,2,2,2,3,6,7,11,12].\n\n // The goal is to obtain the array: [[0, 0], [3, -1], [4, -2],\n // [6, 0], [8, 3]].\n // which can be used like this:\n // - let say that i is the index in new string and j the index\n // the old string.\n // - if i is in [0; 3[ then j = i + 0\n // - if i is in [3; 4[ then j = i - 1\n // - if i is in [4; 6[ then j = i - 2\n // ...\n // Thanks to a binary search it's easy to know where is i and what's the\n // shift.\n // Let say that the last entry in the array is [x, s] and we have a\n // substitution at index y (old string) which will replace o chars by n chars.\n // Firstly, if o === n, then no need to add a new entry: the shift is\n // the same.\n // Secondly, if o < n, then we push the n - o elements:\n // [y - (s - 1), s - 1], [y - (s - 2), s - 2], ...\n // Thirdly, if o > n, then we push the element: [y - (s - n), o + s - n]\n\n // Collect diacritics length and positions.\n const rawDiacriticsPositions = [];\n while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) {\n rawDiacriticsPositions.push([m[0].length, m.index]);\n }\n\n let normalized = text.normalize(\"NFD\");\n const positions = [[0, 0]];\n let rawDiacriticsIndex = 0;\n let syllableIndex = 0;\n let shift = 0;\n let shiftOrigin = 0;\n let eol = 0;\n let hasDiacritics = false;\n\n normalized = normalized.replace(\n normalizationRegex,\n (match, p1, p2, p3, p4, p5, p6, p7, p8, i) => {\n i -= shiftOrigin;\n if (p1) {\n // Maybe fractions or quotations mark...\n const replacement = CHARACTERS_TO_NORMALIZE[p1];\n const jj = replacement.length;\n for (let j = 1; j < jj; j++) {\n positions.push([i - shift + j, shift - j]);\n }\n shift -= jj - 1;\n return replacement;\n }\n\n if (p2) {\n // Use the NFKC representation to normalize the char.\n let replacement = NFKC_CHARS_TO_NORMALIZE.get(p2);\n if (!replacement) {\n replacement = p2.normalize(\"NFKC\");\n NFKC_CHARS_TO_NORMALIZE.set(p2, replacement);\n }\n const jj = replacement.length;\n for (let j = 1; j < jj; j++) {\n positions.push([i - shift + j, shift - j]);\n }\n shift -= jj - 1;\n return replacement;\n }\n\n if (p3) {\n // We've a Katakana-Hiragana diacritic followed by a \\n so don't replace\n // the \\n by a whitespace.\n hasDiacritics = true;\n\n // Diacritic.\n if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {\n ++rawDiacriticsIndex;\n } else {\n // i is the position of the first diacritic\n // so (i - 1) is the position for the letter before.\n positions.push([i - 1 - shift + 1, shift - 1]);\n shift -= 1;\n shiftOrigin += 1;\n }\n\n // End-of-line.\n positions.push([i - shift + 1, shift]);\n shiftOrigin += 1;\n eol += 1;\n\n return p3.charAt(0);\n }\n\n if (p4) {\n const hasTrailingDashEOL = p4.endsWith(\"\\n\");\n const len = hasTrailingDashEOL ? p4.length - 2 : p4.length;\n\n // Diacritics.\n hasDiacritics = true;\n let jj = len;\n if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {\n jj -= rawDiacriticsPositions[rawDiacriticsIndex][0];\n ++rawDiacriticsIndex;\n }\n\n for (let j = 1; j <= jj; j++) {\n // i is the position of the first diacritic\n // so (i - 1) is the position for the letter before.\n positions.push([i - 1 - shift + j, shift - j]);\n }\n shift -= jj;\n shiftOrigin += jj;\n\n if (hasTrailingDashEOL) {\n // Diacritics are followed by a -\\n.\n // See comments in `if (p5)` block.\n i += len - 1;\n positions.push([i - shift + 1, 1 + shift]);\n shift += 1;\n shiftOrigin += 1;\n eol += 1;\n return p4.slice(0, len);\n }\n\n return p4;\n }\n\n if (p5) {\n // \"X-\\n\" is removed because an hyphen at the end of a line\n // with not a space before is likely here to mark a break\n // in a word.\n // If X is encoded with UTF-32 then it can have a length greater than 1.\n // The \\n isn't in the original text so here y = i, n = X.len - 2 and\n // o = X.len - 1.\n const len = p5.length - 2;\n positions.push([i - shift + len, 1 + shift]);\n shift += 1;\n shiftOrigin += 1;\n eol += 1;\n return p5.slice(0, -2);\n }\n\n if (p6) {\n // An ideographic at the end of a line doesn't imply adding an extra\n // white space.\n // A CJK can be encoded in UTF-32, hence their length isn't always 1.\n const len = p6.length - 1;\n positions.push([i - shift + len, shift]);\n shiftOrigin += 1;\n eol += 1;\n return p6.slice(0, -1);\n }\n\n if (p7) {\n // eol is replaced by space: \"foo\\nbar\" is likely equivalent to\n // \"foo bar\".\n positions.push([i - shift + 1, shift - 1]);\n shift -= 1;\n shiftOrigin += 1;\n eol += 1;\n return \" \";\n }\n\n // p8\n if (i + eol === syllablePositions[syllableIndex]?.[1]) {\n // A syllable (1 char) is replaced with several chars (n) so\n // newCharsLen = n - 1.\n const newCharLen = syllablePositions[syllableIndex][0] - 1;\n ++syllableIndex;\n for (let j = 1; j <= newCharLen; j++) {\n positions.push([i - (shift - j), shift - j]);\n }\n shift -= newCharLen;\n shiftOrigin += newCharLen;\n }\n return p8;\n }\n );\n\n positions.push([normalized.length, shift]);\n\n return [normalized, positions, hasDiacritics];\n}\n\n// Determine the original, non-normalized, match index such that highlighting of\n// search results is correct in the `textLayer` for strings containing e.g. \"½\"\n// characters; essentially \"inverting\" the result of the `normalize` function.\nfunction getOriginalIndex(diffs, pos, len) {\n if (!diffs) {\n return [pos, len];\n }\n\n // First char in the new string.\n const start = pos;\n // Last char in the new string.\n const end = pos + len - 1;\n let i = binarySearchFirstItem(diffs, x => x[0] >= start);\n if (diffs[i][0] > start) {\n --i;\n }\n\n let j = binarySearchFirstItem(diffs, x => x[0] >= end, i);\n if (diffs[j][0] > end) {\n --j;\n }\n\n // First char in the old string.\n const oldStart = start + diffs[i][1];\n\n // Last char in the old string.\n const oldEnd = end + diffs[j][1];\n const oldLen = oldEnd + 1 - oldStart;\n\n return [oldStart, oldLen];\n}\n\n/**\n * @typedef {Object} PDFFindControllerOptions\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {EventBus} eventBus - The application event bus.\n * @property {boolean} [updateMatchesCountOnProgress] - True if the matches\n * count must be updated on progress or only when the last page is reached.\n * The default value is `true`.\n */\n\n/**\n * Provides search functionality to find a given string in a PDF document.\n */\nclass PDFFindController {\n #state = null;\n\n #updateMatchesCountOnProgress = true;\n\n #visitedPagesCount = 0;\n\n /**\n * @param {PDFFindControllerOptions} options\n */\n constructor({ linkService, eventBus, updateMatchesCountOnProgress = true }) {\n this._linkService = linkService;\n this._eventBus = eventBus;\n this.#updateMatchesCountOnProgress = updateMatchesCountOnProgress;\n\n /**\n * Callback used to check if a `pageNumber` is currently visible.\n * @type {function}\n */\n this.onIsPageVisible = null;\n\n this.#reset();\n eventBus._on(\"find\", this.#onFind.bind(this));\n eventBus._on(\"findbarclose\", this.#onFindBarClose.bind(this));\n }\n\n get highlightMatches() {\n return this._highlightMatches;\n }\n\n get pageMatches() {\n return this._pageMatches;\n }\n\n get pageMatchesLength() {\n return this._pageMatchesLength;\n }\n\n get selected() {\n return this._selected;\n }\n\n get state() {\n return this.#state;\n }\n\n /**\n * Set a reference to the PDF document in order to search it.\n * Note that searching is not possible if this method is not called.\n *\n * @param {PDFDocumentProxy} pdfDocument - The PDF document to search.\n */\n setDocument(pdfDocument) {\n if (this._pdfDocument) {\n this.#reset();\n }\n if (!pdfDocument) {\n return;\n }\n this._pdfDocument = pdfDocument;\n this._firstPageCapability.resolve();\n }\n\n #onFind(state) {\n if (!state) {\n return;\n }\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n state.phraseSearch === false\n ) {\n console.error(\n \"The `phraseSearch`-parameter was removed, please provide \" +\n \"an Array of strings in the `query`-parameter instead.\"\n );\n if (typeof state.query === \"string\") {\n state.query = state.query.match(/\\S+/g);\n }\n }\n const pdfDocument = this._pdfDocument;\n const { type } = state;\n\n if (this.#state === null || this.#shouldDirtyMatch(state)) {\n this._dirtyMatch = true;\n }\n this.#state = state;\n if (type !== \"highlightallchange\") {\n this.#updateUIState(FindState.PENDING);\n }\n\n this._firstPageCapability.promise.then(() => {\n // If the document was closed before searching began, or if the search\n // operation was relevant for a previously opened document, do nothing.\n if (\n !this._pdfDocument ||\n (pdfDocument && this._pdfDocument !== pdfDocument)\n ) {\n return;\n }\n this.#extractText();\n\n const findbarClosed = !this._highlightMatches;\n const pendingTimeout = !!this._findTimeout;\n\n if (this._findTimeout) {\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n }\n if (!type) {\n // Trigger the find action with a small delay to avoid starting the\n // search when the user is still typing (saving resources).\n this._findTimeout = setTimeout(() => {\n this.#nextMatch();\n this._findTimeout = null;\n }, FIND_TIMEOUT);\n } else if (this._dirtyMatch) {\n // Immediately trigger searching for non-'find' operations, when the\n // current state needs to be reset and matches re-calculated.\n this.#nextMatch();\n } else if (type === \"again\") {\n this.#nextMatch();\n\n // When the findbar was previously closed, and `highlightAll` is set,\n // ensure that the matches on all active pages are highlighted again.\n if (findbarClosed && this.#state.highlightAll) {\n this.#updateAllPages();\n }\n } else if (type === \"highlightallchange\") {\n // If there was a pending search operation, synchronously trigger a new\n // search *first* to ensure that the correct matches are highlighted.\n if (pendingTimeout) {\n this.#nextMatch();\n } else {\n this._highlightMatches = true;\n }\n this.#updateAllPages(); // Update the highlighting on all active pages.\n } else {\n this.#nextMatch();\n }\n });\n }\n\n /**\n * @typedef {Object} PDFFindControllerScrollMatchIntoViewParams\n * @property {HTMLElement} element\n * @property {number} selectedLeft\n * @property {number} pageIndex\n * @property {number} matchIndex\n */\n\n /**\n * Scroll the current match into view.\n * @param {PDFFindControllerScrollMatchIntoViewParams}\n */\n scrollMatchIntoView({\n element = null,\n selectedLeft = 0,\n pageIndex = -1,\n matchIndex = -1,\n }) {\n if (!this._scrollMatches || !element) {\n return;\n } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) {\n return;\n } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) {\n return;\n }\n this._scrollMatches = false; // Ensure that scrolling only happens once.\n\n const spot = {\n top: MATCH_SCROLL_OFFSET_TOP,\n left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT,\n };\n scrollIntoView(element, spot, /* scrollMatches = */ true);\n }\n\n #reset() {\n this._highlightMatches = false;\n this._scrollMatches = false;\n this._pdfDocument = null;\n this._pageMatches = [];\n this._pageMatchesLength = [];\n this.#visitedPagesCount = 0;\n this.#state = null;\n // Currently selected match.\n this._selected = {\n pageIdx: -1,\n matchIdx: -1,\n };\n // Where the find algorithm currently is in the document.\n this._offset = {\n pageIdx: null,\n matchIdx: null,\n wrapped: false,\n };\n this._extractTextPromises = [];\n this._pageContents = []; // Stores the normalized text for each page.\n this._pageDiffs = [];\n this._hasDiacritics = [];\n this._matchesCountTotal = 0;\n this._pagesToSearch = null;\n this._pendingFindMatches = new Set();\n this._resumePageIdx = null;\n this._dirtyMatch = false;\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n\n this._firstPageCapability = new PromiseCapability();\n }\n\n /**\n * @type {string|Array} The (current) normalized search query.\n */\n get #query() {\n const { query } = this.#state;\n if (typeof query === \"string\") {\n if (query !== this._rawQuery) {\n this._rawQuery = query;\n [this._normalizedQuery] = normalize(query);\n }\n return this._normalizedQuery;\n }\n // We don't bother caching the normalized search query in the Array-case,\n // since this code-path is *essentially* unused in the default viewer.\n return (query || []).filter(q => !!q).map(q => normalize(q)[0]);\n }\n\n #shouldDirtyMatch(state) {\n // When the search query changes, regardless of the actual search command\n // used, always re-calculate matches to avoid errors (fixes bug 1030622).\n const newQuery = state.query,\n prevQuery = this.#state.query;\n const newType = typeof newQuery,\n prevType = typeof prevQuery;\n\n if (newType !== prevType) {\n return true;\n }\n if (newType === \"string\") {\n if (newQuery !== prevQuery) {\n return true;\n }\n } else {\n // Array\n if (JSON.stringify(newQuery) !== JSON.stringify(prevQuery)) {\n return true;\n }\n }\n\n switch (state.type) {\n case \"again\":\n const pageNumber = this._selected.pageIdx + 1;\n const linkService = this._linkService;\n // Only treat a 'findagain' event as a new search operation when it's\n // *absolutely* certain that the currently selected match is no longer\n // visible, e.g. as a result of the user scrolling in the document.\n //\n // NOTE: If only a simple `this._linkService.page` check was used here,\n // there's a risk that consecutive 'findagain' operations could \"skip\"\n // over matches at the top/bottom of pages thus making them completely\n // inaccessible when there's multiple pages visible in the viewer.\n return (\n pageNumber >= 1 &&\n pageNumber <= linkService.pagesCount &&\n pageNumber !== linkService.page &&\n !(this.onIsPageVisible?.(pageNumber) ?? true)\n );\n case \"highlightallchange\":\n return false;\n }\n return true;\n }\n\n /**\n * Determine if the search query constitutes a \"whole word\", by comparing the\n * first/last character type with the preceding/following character type.\n */\n #isEntireWord(content, startIdx, length) {\n let match = content\n .slice(0, startIdx)\n .match(NOT_DIACRITIC_FROM_END_REG_EXP);\n if (match) {\n const first = content.charCodeAt(startIdx);\n const limit = match[1].charCodeAt(0);\n if (getCharacterType(first) === getCharacterType(limit)) {\n return false;\n }\n }\n\n match = content\n .slice(startIdx + length)\n .match(NOT_DIACRITIC_FROM_START_REG_EXP);\n if (match) {\n const last = content.charCodeAt(startIdx + length - 1);\n const limit = match[1].charCodeAt(0);\n if (getCharacterType(last) === getCharacterType(limit)) {\n return false;\n }\n }\n\n return true;\n }\n\n #calculateRegExpMatch(query, entireWord, pageIndex, pageContent) {\n const matches = (this._pageMatches[pageIndex] = []);\n const matchesLength = (this._pageMatchesLength[pageIndex] = []);\n if (!query) {\n // The query can be empty because some chars like diacritics could have\n // been stripped out.\n return;\n }\n const diffs = this._pageDiffs[pageIndex];\n let match;\n while ((match = query.exec(pageContent)) !== null) {\n if (\n entireWord &&\n !this.#isEntireWord(pageContent, match.index, match[0].length)\n ) {\n continue;\n }\n\n const [matchPos, matchLen] = getOriginalIndex(\n diffs,\n match.index,\n match[0].length\n );\n\n if (matchLen) {\n matches.push(matchPos);\n matchesLength.push(matchLen);\n }\n }\n }\n\n #convertToRegExpString(query, hasDiacritics) {\n const { matchDiacritics } = this.#state;\n let isUnicode = false;\n query = query.replaceAll(\n SPECIAL_CHARS_REG_EXP,\n (\n match,\n p1 /* to escape */,\n p2 /* punctuation */,\n p3 /* whitespaces */,\n p4 /* diacritics */,\n p5 /* letters */\n ) => {\n // We don't need to use a \\s for whitespaces since all the different\n // kind of whitespaces are replaced by a single \" \".\n\n if (p1) {\n // Escape characters like *+?... to not interfer with regexp syntax.\n return `[ ]*\\\\${p1}[ ]*`;\n }\n if (p2) {\n // Allow whitespaces around punctuation signs.\n return `[ ]*${p2}[ ]*`;\n }\n if (p3) {\n // Replace spaces by \\s+ to be sure to match any spaces.\n return \"[ ]+\";\n }\n if (matchDiacritics) {\n return p4 || p5;\n }\n\n if (p4) {\n // Diacritics are removed with few exceptions.\n return DIACRITICS_EXCEPTION.has(p4.charCodeAt(0)) ? p4 : \"\";\n }\n\n // A letter has been matched and it can be followed by any diacritics\n // in normalized text.\n if (hasDiacritics) {\n isUnicode = true;\n return `${p5}\\\\p{M}*`;\n }\n return p5;\n }\n );\n\n const trailingSpaces = \"[ ]*\";\n if (query.endsWith(trailingSpaces)) {\n // The [ ]* has been added in order to help to match \"foo . bar\" but\n // it doesn't make sense to match some whitespaces after the dot\n // when it's the last character.\n query = query.slice(0, query.length - trailingSpaces.length);\n }\n\n if (matchDiacritics) {\n // aX must not match aXY.\n if (hasDiacritics) {\n DIACRITICS_EXCEPTION_STR ||= String.fromCharCode(\n ...DIACRITICS_EXCEPTION\n );\n\n isUnicode = true;\n query = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\\\p{M}]|$)`;\n }\n }\n\n return [isUnicode, query];\n }\n\n #calculateMatch(pageIndex) {\n let query = this.#query;\n if (query.length === 0) {\n return; // Do nothing: the matches should be wiped out already.\n }\n const { caseSensitive, entireWord } = this.#state;\n const pageContent = this._pageContents[pageIndex];\n const hasDiacritics = this._hasDiacritics[pageIndex];\n\n let isUnicode = false;\n if (typeof query === \"string\") {\n [isUnicode, query] = this.#convertToRegExpString(query, hasDiacritics);\n } else {\n // Words are sorted in reverse order to be sure that \"foobar\" is matched\n // before \"foo\" in case the query is \"foobar foo\".\n query = query\n .sort()\n .reverse()\n .map(q => {\n const [isUnicodePart, queryPart] = this.#convertToRegExpString(\n q,\n hasDiacritics\n );\n isUnicode ||= isUnicodePart;\n return `(${queryPart})`;\n })\n .join(\"|\");\n }\n\n const flags = `g${isUnicode ? \"u\" : \"\"}${caseSensitive ? \"\" : \"i\"}`;\n query = query ? new RegExp(query, flags) : null;\n\n this.#calculateRegExpMatch(query, entireWord, pageIndex, pageContent);\n\n // When `highlightAll` is set, ensure that the matches on previously\n // rendered (and still active) pages are correctly highlighted.\n if (this.#state.highlightAll) {\n this.#updatePage(pageIndex);\n }\n if (this._resumePageIdx === pageIndex) {\n this._resumePageIdx = null;\n this.#nextPageMatch();\n }\n\n // Update the match count.\n const pageMatchesCount = this._pageMatches[pageIndex].length;\n this._matchesCountTotal += pageMatchesCount;\n if (this.#updateMatchesCountOnProgress) {\n if (pageMatchesCount > 0) {\n this.#updateUIResultsCount();\n }\n } else if (++this.#visitedPagesCount === this._linkService.pagesCount) {\n // For example, in GeckoView we want to have only the final update because\n // the Java side provides only one object to update the counts.\n this.#updateUIResultsCount();\n }\n }\n\n #extractText() {\n // Perform text extraction once if this method is called multiple times.\n if (this._extractTextPromises.length > 0) {\n return;\n }\n\n let promise = Promise.resolve();\n const textOptions = { disableNormalization: true };\n for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {\n const extractTextCapability = new PromiseCapability();\n this._extractTextPromises[i] = extractTextCapability.promise;\n\n promise = promise.then(() => {\n return this._pdfDocument\n .getPage(i + 1)\n .then(pdfPage => {\n return pdfPage.getTextContent(textOptions);\n })\n .then(\n textContent => {\n const strBuf = [];\n\n for (const textItem of textContent.items) {\n strBuf.push(textItem.str);\n if (textItem.hasEOL) {\n strBuf.push(\"\\n\");\n }\n }\n\n // Store the normalized page content (text items) as one string.\n [\n this._pageContents[i],\n this._pageDiffs[i],\n this._hasDiacritics[i],\n ] = normalize(strBuf.join(\"\"));\n extractTextCapability.resolve();\n },\n reason => {\n console.error(\n `Unable to get text content for page ${i + 1}`,\n reason\n );\n // Page error -- assuming no text content.\n this._pageContents[i] = \"\";\n this._pageDiffs[i] = null;\n this._hasDiacritics[i] = false;\n extractTextCapability.resolve();\n }\n );\n });\n }\n }\n\n #updatePage(index) {\n if (this._scrollMatches && this._selected.pageIdx === index) {\n // If the page is selected, scroll the page into view, which triggers\n // rendering the page, which adds the text layer. Once the text layer\n // is built, it will attempt to scroll the selected match into view.\n this._linkService.page = index + 1;\n }\n\n this._eventBus.dispatch(\"updatetextlayermatches\", {\n source: this,\n pageIndex: index,\n });\n }\n\n #updateAllPages() {\n this._eventBus.dispatch(\"updatetextlayermatches\", {\n source: this,\n pageIndex: -1,\n });\n }\n\n #nextMatch() {\n const previous = this.#state.findPrevious;\n const currentPageIndex = this._linkService.page - 1;\n const numPages = this._linkService.pagesCount;\n\n this._highlightMatches = true;\n\n if (this._dirtyMatch) {\n // Need to recalculate the matches, reset everything.\n this._dirtyMatch = false;\n this._selected.pageIdx = this._selected.matchIdx = -1;\n this._offset.pageIdx = currentPageIndex;\n this._offset.matchIdx = null;\n this._offset.wrapped = false;\n this._resumePageIdx = null;\n this._pageMatches.length = 0;\n this._pageMatchesLength.length = 0;\n this.#visitedPagesCount = 0;\n this._matchesCountTotal = 0;\n\n this.#updateAllPages(); // Wipe out any previously highlighted matches.\n\n for (let i = 0; i < numPages; i++) {\n // Start finding the matches as soon as the text is extracted.\n if (this._pendingFindMatches.has(i)) {\n continue;\n }\n this._pendingFindMatches.add(i);\n this._extractTextPromises[i].then(() => {\n this._pendingFindMatches.delete(i);\n this.#calculateMatch(i);\n });\n }\n }\n\n // If there's no query there's no point in searching.\n const query = this.#query;\n if (query.length === 0) {\n this.#updateUIState(FindState.FOUND);\n return;\n }\n // If we're waiting on a page, we return since we can't do anything else.\n if (this._resumePageIdx) {\n return;\n }\n\n const offset = this._offset;\n // Keep track of how many pages we should maximally iterate through.\n this._pagesToSearch = numPages;\n // If there's already a `matchIdx` that means we are iterating through a\n // page's matches.\n if (offset.matchIdx !== null) {\n const numPageMatches = this._pageMatches[offset.pageIdx].length;\n if (\n (!previous && offset.matchIdx + 1 < numPageMatches) ||\n (previous && offset.matchIdx > 0)\n ) {\n // The simple case; we just have advance the matchIdx to select\n // the next match on the page.\n offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1;\n this.#updateMatch(/* found = */ true);\n return;\n }\n // We went beyond the current page's matches, so we advance to\n // the next page.\n this.#advanceOffsetPage(previous);\n }\n // Start searching through the page.\n this.#nextPageMatch();\n }\n\n #matchesReady(matches) {\n const offset = this._offset;\n const numMatches = matches.length;\n const previous = this.#state.findPrevious;\n\n if (numMatches) {\n // There were matches for the page, so initialize `matchIdx`.\n offset.matchIdx = previous ? numMatches - 1 : 0;\n this.#updateMatch(/* found = */ true);\n return true;\n }\n // No matches, so attempt to search the next page.\n this.#advanceOffsetPage(previous);\n if (offset.wrapped) {\n offset.matchIdx = null;\n if (this._pagesToSearch < 0) {\n // No point in wrapping again, there were no matches.\n this.#updateMatch(/* found = */ false);\n // While matches were not found, searching for a page\n // with matches should nevertheless halt.\n return true;\n }\n }\n // Matches were not found (and searching is not done).\n return false;\n }\n\n #nextPageMatch() {\n if (this._resumePageIdx !== null) {\n console.error(\"There can only be one pending page.\");\n }\n\n let matches = null;\n do {\n const pageIdx = this._offset.pageIdx;\n matches = this._pageMatches[pageIdx];\n if (!matches) {\n // The matches don't exist yet for processing by `_matchesReady`,\n // so set a resume point for when they do exist.\n this._resumePageIdx = pageIdx;\n break;\n }\n } while (!this.#matchesReady(matches));\n }\n\n #advanceOffsetPage(previous) {\n const offset = this._offset;\n const numPages = this._linkService.pagesCount;\n offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1;\n offset.matchIdx = null;\n\n this._pagesToSearch--;\n\n if (offset.pageIdx >= numPages || offset.pageIdx < 0) {\n offset.pageIdx = previous ? numPages - 1 : 0;\n offset.wrapped = true;\n }\n }\n\n #updateMatch(found = false) {\n let state = FindState.NOT_FOUND;\n const wrapped = this._offset.wrapped;\n this._offset.wrapped = false;\n\n if (found) {\n const previousPage = this._selected.pageIdx;\n this._selected.pageIdx = this._offset.pageIdx;\n this._selected.matchIdx = this._offset.matchIdx;\n state = wrapped ? FindState.WRAPPED : FindState.FOUND;\n\n // Update the currently selected page to wipe out any selected matches.\n if (previousPage !== -1 && previousPage !== this._selected.pageIdx) {\n this.#updatePage(previousPage);\n }\n }\n\n this.#updateUIState(state, this.#state.findPrevious);\n if (this._selected.pageIdx !== -1) {\n // Ensure that the match will be scrolled into view.\n this._scrollMatches = true;\n\n this.#updatePage(this._selected.pageIdx);\n }\n }\n\n #onFindBarClose(evt) {\n const pdfDocument = this._pdfDocument;\n // Since searching is asynchronous, ensure that the removal of highlighted\n // matches (from the UI) is async too such that the 'updatetextlayermatches'\n // events will always be dispatched in the expected order.\n this._firstPageCapability.promise.then(() => {\n // Only update the UI if the document is open, and is the current one.\n if (\n !this._pdfDocument ||\n (pdfDocument && this._pdfDocument !== pdfDocument)\n ) {\n return;\n }\n // Ensure that a pending, not yet started, search operation is aborted.\n if (this._findTimeout) {\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n }\n // Abort any long running searches, to avoid a match being scrolled into\n // view *after* the findbar has been closed. In this case `this._offset`\n // will most likely differ from `this._selected`, hence we also ensure\n // that any new search operation will always start with a clean slate.\n if (this._resumePageIdx) {\n this._resumePageIdx = null;\n this._dirtyMatch = true;\n }\n // Avoid the UI being in a pending state when the findbar is re-opened.\n this.#updateUIState(FindState.FOUND);\n\n this._highlightMatches = false;\n this.#updateAllPages(); // Wipe out any previously highlighted matches.\n });\n }\n\n #requestMatchesCount() {\n const { pageIdx, matchIdx } = this._selected;\n let current = 0,\n total = this._matchesCountTotal;\n if (matchIdx !== -1) {\n for (let i = 0; i < pageIdx; i++) {\n current += this._pageMatches[i]?.length || 0;\n }\n current += matchIdx + 1;\n }\n // When searching starts, this method may be called before the `pageMatches`\n // have been counted (in `_calculateMatch`). Ensure that the UI won't show\n // temporarily broken state when the active find result doesn't make sense.\n if (current < 1 || current > total) {\n current = total = 0;\n }\n return { current, total };\n }\n\n #updateUIResultsCount() {\n this._eventBus.dispatch(\"updatefindmatchescount\", {\n source: this,\n matchesCount: this.#requestMatchesCount(),\n });\n }\n\n #updateUIState(state, previous = false) {\n if (\n !this.#updateMatchesCountOnProgress &&\n (this.#visitedPagesCount !== this._linkService.pagesCount ||\n state === FindState.PENDING)\n ) {\n // When this.#updateMatchesCountOnProgress is false we only send an update\n // when everything is ready.\n return;\n }\n\n this._eventBus.dispatch(\"updatefindcontrolstate\", {\n source: this,\n state,\n previous,\n matchesCount: this.#requestMatchesCount(),\n rawQuery: this.#state?.query ?? null,\n });\n }\n}\n\nexport { FindState, PDFFindController };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst CharacterType = {\n SPACE: 0,\n ALPHA_LETTER: 1,\n PUNCT: 2,\n HAN_LETTER: 3,\n KATAKANA_LETTER: 4,\n HIRAGANA_LETTER: 5,\n HALFWIDTH_KATAKANA_LETTER: 6,\n THAI_LETTER: 7,\n};\n\nfunction isAlphabeticalScript(charCode) {\n return charCode < 0x2e80;\n}\n\nfunction isAscii(charCode) {\n return (charCode & 0xff80) === 0;\n}\n\nfunction isAsciiAlpha(charCode) {\n return (\n (charCode >= /* a = */ 0x61 && charCode <= /* z = */ 0x7a) ||\n (charCode >= /* A = */ 0x41 && charCode <= /* Z = */ 0x5a)\n );\n}\n\nfunction isAsciiDigit(charCode) {\n return charCode >= /* 0 = */ 0x30 && charCode <= /* 9 = */ 0x39;\n}\n\nfunction isAsciiSpace(charCode) {\n return (\n charCode === /* SPACE = */ 0x20 ||\n charCode === /* TAB = */ 0x09 ||\n charCode === /* CR = */ 0x0d ||\n charCode === /* LF = */ 0x0a\n );\n}\n\nfunction isHan(charCode) {\n return (\n (charCode >= 0x3400 && charCode <= 0x9fff) ||\n (charCode >= 0xf900 && charCode <= 0xfaff)\n );\n}\n\nfunction isKatakana(charCode) {\n return charCode >= 0x30a0 && charCode <= 0x30ff;\n}\n\nfunction isHiragana(charCode) {\n return charCode >= 0x3040 && charCode <= 0x309f;\n}\n\nfunction isHalfwidthKatakana(charCode) {\n return charCode >= 0xff60 && charCode <= 0xff9f;\n}\n\nfunction isThai(charCode) {\n return (charCode & 0xff80) === 0x0e00;\n}\n\n/**\n * This function is based on the word-break detection implemented in:\n * https://hg.mozilla.org/mozilla-central/file/tip/intl/lwbrk/WordBreaker.cpp\n */\nfunction getCharacterType(charCode) {\n if (isAlphabeticalScript(charCode)) {\n if (isAscii(charCode)) {\n if (isAsciiSpace(charCode)) {\n return CharacterType.SPACE;\n } else if (\n isAsciiAlpha(charCode) ||\n isAsciiDigit(charCode) ||\n charCode === /* UNDERSCORE = */ 0x5f\n ) {\n return CharacterType.ALPHA_LETTER;\n }\n return CharacterType.PUNCT;\n } else if (isThai(charCode)) {\n return CharacterType.THAI_LETTER;\n } else if (charCode === /* NBSP = */ 0xa0) {\n return CharacterType.SPACE;\n }\n return CharacterType.ALPHA_LETTER;\n }\n\n if (isHan(charCode)) {\n return CharacterType.HAN_LETTER;\n } else if (isKatakana(charCode)) {\n return CharacterType.KATAKANA_LETTER;\n } else if (isHiragana(charCode)) {\n return CharacterType.HIRAGANA_LETTER;\n } else if (isHalfwidthKatakana(charCode)) {\n return CharacterType.HALFWIDTH_KATAKANA_LETTER;\n }\n return CharacterType.ALPHA_LETTER;\n}\n\nlet NormalizeWithNFKC;\nfunction getNormalizeWithNFKC() {\n /* eslint-disable no-irregular-whitespace */\n NormalizeWithNFKC ||= ` ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n const ranges = [];\n const range = [];\n const diacriticsRegex = /^\\p{M}$/u;\n // Some chars must be replaced by their NFKC counterpart during a search.\n for (let i = 0; i < 65536; i++) {\n const c = String.fromCharCode(i);\n if (c.normalize(\"NFKC\") !== c && !diacriticsRegex.test(c)) {\n if (range.length !== 2) {\n range[0] = range[1] = i;\n continue;\n }\n if (range[1] + 1 !== i) {\n if (range[0] === range[1]) {\n ranges.push(String.fromCharCode(range[0]));\n } else {\n ranges.push(\n `${String.fromCharCode(range[0])}-${String.fromCharCode(\n range[1]\n )}`\n );\n }\n range[0] = range[1] = i;\n } else {\n range[1] = i;\n }\n }\n }\n if (ranges.join(\"\") !== NormalizeWithNFKC) {\n throw new Error(\n \"getNormalizeWithNFKC - update the `NormalizeWithNFKC` string.\"\n );\n }\n }\n return NormalizeWithNFKC;\n}\n\nexport { CharacterType, getCharacterType, getNormalizeWithNFKC };\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { isValidRotation, parseQueryString } from \"./ui_utils.js\";\nimport { waitOnEventOrTimeout } from \"./event_utils.js\";\n\n// Heuristic value used when force-resetting `this._blockHashChange`.\nconst HASH_CHANGE_TIMEOUT = 1000; // milliseconds\n// Heuristic value used when adding the current position to the browser history.\nconst POSITION_UPDATED_THRESHOLD = 50;\n// Heuristic value used when adding a temporary position to the browser history.\nconst UPDATE_VIEWAREA_TIMEOUT = 1000; // milliseconds\n\n/**\n * @typedef {Object} PDFHistoryOptions\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {EventBus} eventBus - The application event bus.\n */\n\n/**\n * @typedef {Object} InitializeParameters\n * @property {string} fingerprint - The PDF document's unique fingerprint.\n * @property {boolean} [resetHistory] - Reset the browsing history.\n * @property {boolean} [updateUrl] - Attempt to update the document URL, with\n * the current hash, when pushing/replacing browser history entries.\n */\n\n/**\n * @typedef {Object} PushParameters\n * @property {string} [namedDest] - The named destination. If absent, a\n * stringified version of `explicitDest` is used.\n * @property {Array} explicitDest - The explicit destination array.\n * @property {number} pageNumber - The page to which the destination points.\n */\n\nfunction getCurrentHash() {\n return document.location.hash;\n}\n\nclass PDFHistory {\n /**\n * @param {PDFHistoryOptions} options\n */\n constructor({ linkService, eventBus }) {\n this.linkService = linkService;\n this.eventBus = eventBus;\n\n this._initialized = false;\n this._fingerprint = \"\";\n this.reset();\n\n this._boundEvents = null;\n // Ensure that we don't miss a \"pagesinit\" event,\n // by registering the listener immediately.\n this.eventBus._on(\"pagesinit\", () => {\n this._isPagesLoaded = false;\n\n this.eventBus._on(\n \"pagesloaded\",\n evt => {\n this._isPagesLoaded = !!evt.pagesCount;\n },\n { once: true }\n );\n });\n }\n\n /**\n * Initialize the history for the PDF document, using either the current\n * browser history entry or the document hash, whichever is present.\n * @param {InitializeParameters} params\n */\n initialize({ fingerprint, resetHistory = false, updateUrl = false }) {\n if (!fingerprint || typeof fingerprint !== \"string\") {\n console.error(\n 'PDFHistory.initialize: The \"fingerprint\" must be a non-empty string.'\n );\n return;\n }\n // Ensure that any old state is always reset upon initialization.\n if (this._initialized) {\n this.reset();\n }\n const reInitialized =\n this._fingerprint !== \"\" && this._fingerprint !== fingerprint;\n this._fingerprint = fingerprint;\n this._updateUrl = updateUrl === true;\n\n this._initialized = true;\n this._bindEvents();\n const state = window.history.state;\n\n this._popStateInProgress = false;\n this._blockHashChange = 0;\n this._currentHash = getCurrentHash();\n this._numPositionUpdates = 0;\n\n this._uid = this._maxUid = 0;\n this._destination = null;\n this._position = null;\n\n if (!this._isValidState(state, /* checkReload = */ true) || resetHistory) {\n const { hash, page, rotation } = this._parseCurrentHash(\n /* checkNameddest = */ true\n );\n\n if (!hash || reInitialized || resetHistory) {\n // Ensure that the browser history is reset on PDF document load.\n this._pushOrReplaceState(null, /* forceReplace = */ true);\n return;\n }\n // Ensure that the browser history is initialized correctly when\n // the document hash is present on PDF document load.\n this._pushOrReplaceState(\n { hash, page, rotation },\n /* forceReplace = */ true\n );\n return;\n }\n\n // The browser history contains a valid entry, ensure that the history is\n // initialized correctly on PDF document load.\n const destination = state.destination;\n this._updateInternalState(\n destination,\n state.uid,\n /* removeTemporary = */ true\n );\n\n if (destination.rotation !== undefined) {\n this._initialRotation = destination.rotation;\n }\n if (destination.dest) {\n this._initialBookmark = JSON.stringify(destination.dest);\n\n // If the history is updated, e.g. through the user changing the hash,\n // before the initial destination has become visible, then we do *not*\n // want to potentially add `this._position` to the browser history.\n this._destination.page = null;\n } else if (destination.hash) {\n this._initialBookmark = destination.hash;\n } else if (destination.page) {\n // Fallback case; shouldn't be necessary, but better safe than sorry.\n this._initialBookmark = `page=${destination.page}`;\n }\n }\n\n /**\n * Reset the current `PDFHistory` instance, and consequently prevent any\n * further updates and/or navigation of the browser history.\n */\n reset() {\n if (this._initialized) {\n this._pageHide(); // Simulate a 'pagehide' event when resetting.\n\n this._initialized = false;\n this._unbindEvents();\n }\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n this._initialBookmark = null;\n this._initialRotation = null;\n }\n\n /**\n * Push an internal destination to the browser history.\n * @param {PushParameters}\n */\n push({ namedDest = null, explicitDest, pageNumber }) {\n if (!this._initialized) {\n return;\n }\n if (namedDest && typeof namedDest !== \"string\") {\n console.error(\n \"PDFHistory.push: \" +\n `\"${namedDest}\" is not a valid namedDest parameter.`\n );\n return;\n } else if (!Array.isArray(explicitDest)) {\n console.error(\n \"PDFHistory.push: \" +\n `\"${explicitDest}\" is not a valid explicitDest parameter.`\n );\n return;\n } else if (!this._isValidPage(pageNumber)) {\n // Allow an unset `pageNumber` if and only if the history is still empty;\n // please refer to the `this._destination.page = null;` comment above.\n if (pageNumber !== null || this._destination) {\n console.error(\n \"PDFHistory.push: \" +\n `\"${pageNumber}\" is not a valid pageNumber parameter.`\n );\n return;\n }\n }\n\n const hash = namedDest || JSON.stringify(explicitDest);\n if (!hash) {\n // The hash *should* never be undefined, but if that were to occur,\n // avoid any possible issues by not updating the browser history.\n return;\n }\n\n let forceReplace = false;\n if (\n this._destination &&\n (isDestHashesEqual(this._destination.hash, hash) ||\n isDestArraysEqual(this._destination.dest, explicitDest))\n ) {\n // When the new destination is identical to `this._destination`, and\n // its `page` is undefined, replace the current browser history entry.\n // NOTE: This can only occur if `this._destination` was set either:\n // - through the document hash being specified on load.\n // - through the user changing the hash of the document.\n if (this._destination.page) {\n return;\n }\n forceReplace = true;\n }\n if (this._popStateInProgress && !forceReplace) {\n return;\n }\n\n this._pushOrReplaceState(\n {\n dest: explicitDest,\n hash,\n page: pageNumber,\n rotation: this.linkService.rotation,\n },\n forceReplace\n );\n\n if (!this._popStateInProgress) {\n // Prevent the browser history from updating while the new destination is\n // being scrolled into view, to avoid potentially inconsistent state.\n this._popStateInProgress = true;\n // We defer the resetting of `this._popStateInProgress`, to account for\n // e.g. zooming occurring when the new destination is being navigated to.\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n }\n\n /**\n * Push a page to the browser history; generally the `push` method should be\n * used instead.\n * @param {number} pageNumber\n */\n pushPage(pageNumber) {\n if (!this._initialized) {\n return;\n }\n if (!this._isValidPage(pageNumber)) {\n console.error(\n `PDFHistory.pushPage: \"${pageNumber}\" is not a valid page number.`\n );\n return;\n }\n\n if (this._destination?.page === pageNumber) {\n // When the new page is identical to the one in `this._destination`, we\n // don't want to add a potential duplicate entry in the browser history.\n return;\n }\n if (this._popStateInProgress) {\n return;\n }\n\n this._pushOrReplaceState({\n // Simulate an internal destination, for `this._tryPushCurrentPosition`:\n dest: null,\n hash: `page=${pageNumber}`,\n page: pageNumber,\n rotation: this.linkService.rotation,\n });\n\n if (!this._popStateInProgress) {\n // Prevent the browser history from updating while the new page is\n // being scrolled into view, to avoid potentially inconsistent state.\n this._popStateInProgress = true;\n // We defer the resetting of `this._popStateInProgress`, to account for\n // e.g. zooming occurring when the new page is being navigated to.\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n }\n\n /**\n * Push the current position to the browser history.\n */\n pushCurrentPosition() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n this._tryPushCurrentPosition();\n }\n\n /**\n * Go back one step in the browser history.\n * NOTE: Avoids navigating away from the document, useful for \"named actions\".\n */\n back() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n const state = window.history.state;\n if (this._isValidState(state) && state.uid > 0) {\n window.history.back();\n }\n }\n\n /**\n * Go forward one step in the browser history.\n * NOTE: Avoids navigating away from the document, useful for \"named actions\".\n */\n forward() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n const state = window.history.state;\n if (this._isValidState(state) && state.uid < this._maxUid) {\n window.history.forward();\n }\n }\n\n /**\n * @type {boolean} Indicating if the user is currently moving through the\n * browser history, useful e.g. for skipping the next 'hashchange' event.\n */\n get popStateInProgress() {\n return (\n this._initialized &&\n (this._popStateInProgress || this._blockHashChange > 0)\n );\n }\n\n get initialBookmark() {\n return this._initialized ? this._initialBookmark : null;\n }\n\n get initialRotation() {\n return this._initialized ? this._initialRotation : null;\n }\n\n /**\n * @private\n */\n _pushOrReplaceState(destination, forceReplace = false) {\n const shouldReplace = forceReplace || !this._destination;\n const newState = {\n fingerprint: this._fingerprint,\n uid: shouldReplace ? this._uid : this._uid + 1,\n destination,\n };\n\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"CHROME\") &&\n window.history.state?.chromecomState\n ) {\n // history.state.chromecomState is managed by chromecom.js.\n newState.chromecomState = window.history.state.chromecomState;\n }\n this._updateInternalState(destination, newState.uid);\n\n let newUrl;\n if (this._updateUrl && destination?.hash) {\n const baseUrl = document.location.href.split(\"#\")[0];\n // Prevent errors in Firefox.\n if (!baseUrl.startsWith(\"file://\")) {\n newUrl = `${baseUrl}#${destination.hash}`;\n }\n }\n if (shouldReplace) {\n window.history.replaceState(newState, \"\", newUrl);\n } else {\n window.history.pushState(newState, \"\", newUrl);\n }\n\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"CHROME\") &&\n top === window\n ) {\n // eslint-disable-next-line no-undef\n chrome.runtime.sendMessage(\"showPageAction\");\n }\n }\n\n /**\n * @private\n */\n _tryPushCurrentPosition(temporary = false) {\n if (!this._position) {\n return;\n }\n let position = this._position;\n if (temporary) {\n position = Object.assign(Object.create(null), this._position);\n position.temporary = true;\n }\n\n if (!this._destination) {\n this._pushOrReplaceState(position);\n return;\n }\n if (this._destination.temporary) {\n // Always replace a previous *temporary* position.\n this._pushOrReplaceState(position, /* forceReplace = */ true);\n return;\n }\n if (this._destination.hash === position.hash) {\n return; // The current document position has not changed.\n }\n if (\n !this._destination.page &&\n (POSITION_UPDATED_THRESHOLD <= 0 ||\n this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)\n ) {\n // `this._destination` was set through the user changing the hash of\n // the document. Do not add `this._position` to the browser history,\n // to avoid \"flooding\" it with lots of (nearly) identical entries,\n // since we cannot ensure that the document position has changed.\n return;\n }\n\n let forceReplace = false;\n if (\n this._destination.page >= position.first &&\n this._destination.page <= position.page\n ) {\n // When the `page` of `this._destination` is still visible, do not\n // update the browsing history when `this._destination` either:\n // - contains an internal destination, since in this case we\n // cannot ensure that the document position has actually changed.\n // - was set through the user changing the hash of the document.\n if (this._destination.dest !== undefined || !this._destination.first) {\n return;\n }\n // To avoid \"flooding\" the browser history, replace the current entry.\n forceReplace = true;\n }\n this._pushOrReplaceState(position, forceReplace);\n }\n\n /**\n * @private\n */\n _isValidPage(val) {\n return (\n Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount\n );\n }\n\n /**\n * @private\n */\n _isValidState(state, checkReload = false) {\n if (!state) {\n return false;\n }\n if (state.fingerprint !== this._fingerprint) {\n if (checkReload) {\n // Potentially accept the history entry, even if the fingerprints don't\n // match, when the viewer was reloaded (see issue 6847).\n if (\n typeof state.fingerprint !== \"string\" ||\n state.fingerprint.length !== this._fingerprint.length\n ) {\n return false;\n }\n const [perfEntry] = performance.getEntriesByType(\"navigation\");\n if (perfEntry?.type !== \"reload\") {\n return false;\n }\n } else {\n // This should only occur in viewers with support for opening more than\n // one PDF document, e.g. the GENERIC viewer.\n return false;\n }\n }\n if (!Number.isInteger(state.uid) || state.uid < 0) {\n return false;\n }\n if (state.destination === null || typeof state.destination !== \"object\") {\n return false;\n }\n return true;\n }\n\n /**\n * @private\n */\n _updateInternalState(destination, uid, removeTemporary = false) {\n if (this._updateViewareaTimeout) {\n // When updating `this._destination`, make sure that we always wait for\n // the next 'updateviewarea' event before (potentially) attempting to\n // push the current position to the browser history.\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n if (removeTemporary && destination?.temporary) {\n // When the `destination` comes from the browser history,\n // we no longer treat it as a *temporary* position.\n delete destination.temporary;\n }\n this._destination = destination;\n this._uid = uid;\n this._maxUid = Math.max(this._maxUid, uid);\n // This should always be reset when `this._destination` is updated.\n this._numPositionUpdates = 0;\n }\n\n /**\n * @private\n */\n _parseCurrentHash(checkNameddest = false) {\n const hash = unescape(getCurrentHash()).substring(1);\n const params = parseQueryString(hash);\n\n const nameddest = params.get(\"nameddest\") || \"\";\n let page = params.get(\"page\") | 0;\n\n if (!this._isValidPage(page) || (checkNameddest && nameddest.length > 0)) {\n page = null;\n }\n return { hash, page, rotation: this.linkService.rotation };\n }\n\n /**\n * @private\n */\n _updateViewarea({ location }) {\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n\n this._position = {\n hash: location.pdfOpenParams.substring(1),\n page: this.linkService.page,\n first: location.pageNumber,\n rotation: location.rotation,\n };\n\n if (this._popStateInProgress) {\n return;\n }\n\n if (\n POSITION_UPDATED_THRESHOLD > 0 &&\n this._isPagesLoaded &&\n this._destination &&\n !this._destination.page\n ) {\n // If the current destination was set through the user changing the hash\n // of the document, we will usually not try to push the current position\n // to the browser history; see `this._tryPushCurrentPosition()`.\n //\n // To prevent `this._tryPushCurrentPosition()` from effectively being\n // reduced to a no-op in this case, we will assume that the position\n // *did* in fact change if the 'updateviewarea' event was dispatched\n // more than `POSITION_UPDATED_THRESHOLD` times.\n this._numPositionUpdates++;\n }\n\n if (UPDATE_VIEWAREA_TIMEOUT > 0) {\n // When closing the browser, a 'pagehide' event will be dispatched which\n // *should* allow us to push the current position to the browser history.\n // In practice, it seems that the event is arriving too late in order for\n // the session history to be successfully updated.\n // (For additional details, please refer to the discussion in\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1153393.)\n //\n // To workaround this we attempt to *temporarily* add the current position\n // to the browser history only when the viewer is *idle*,\n // i.e. when scrolling and/or zooming does not occur.\n //\n // PLEASE NOTE: It's absolutely imperative that the browser history is\n // *not* updated too often, since that would render the viewer more or\n // less unusable. Hence the use of a timeout to delay the update until\n // the viewer has been idle for `UPDATE_VIEWAREA_TIMEOUT` milliseconds.\n this._updateViewareaTimeout = setTimeout(() => {\n if (!this._popStateInProgress) {\n this._tryPushCurrentPosition(/* temporary = */ true);\n }\n this._updateViewareaTimeout = null;\n }, UPDATE_VIEWAREA_TIMEOUT);\n }\n }\n\n /**\n * @private\n */\n _popState({ state }) {\n const newHash = getCurrentHash(),\n hashChanged = this._currentHash !== newHash;\n this._currentHash = newHash;\n\n if (\n (typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"CHROME\") &&\n state?.chromecomState &&\n !this._isValidState(state)) ||\n !state\n ) {\n // This case corresponds to the user changing the hash of the document.\n this._uid++;\n\n const { hash, page, rotation } = this._parseCurrentHash();\n this._pushOrReplaceState(\n { hash, page, rotation },\n /* forceReplace = */ true\n );\n return;\n }\n if (!this._isValidState(state)) {\n // This should only occur in viewers with support for opening more than\n // one PDF document, e.g. the GENERIC viewer.\n return;\n }\n\n // Prevent the browser history from updating until the new destination,\n // as stored in the browser history, has been scrolled into view.\n this._popStateInProgress = true;\n\n if (hashChanged) {\n // When the hash changed, implying that the 'popstate' event will be\n // followed by a 'hashchange' event, then we do *not* want to update the\n // browser history when handling the 'hashchange' event (in web/app.js)\n // since that would *overwrite* the new destination navigated to below.\n //\n // To avoid accidentally disabling all future user-initiated hash changes,\n // if there's e.g. another 'hashchange' listener that stops the event\n // propagation, we make sure to always force-reset `this._blockHashChange`\n // after `HASH_CHANGE_TIMEOUT` milliseconds have passed.\n this._blockHashChange++;\n waitOnEventOrTimeout({\n target: window,\n name: \"hashchange\",\n delay: HASH_CHANGE_TIMEOUT,\n }).then(() => {\n this._blockHashChange--;\n });\n }\n\n // Navigate to the new destination.\n const destination = state.destination;\n this._updateInternalState(\n destination,\n state.uid,\n /* removeTemporary = */ true\n );\n\n if (isValidRotation(destination.rotation)) {\n this.linkService.rotation = destination.rotation;\n }\n if (destination.dest) {\n this.linkService.goToDestination(destination.dest);\n } else if (destination.hash) {\n this.linkService.setHash(destination.hash);\n } else if (destination.page) {\n // Fallback case; shouldn't be necessary, but better safe than sorry.\n this.linkService.page = destination.page;\n }\n\n // Since `PDFLinkService.goToDestination` is asynchronous, we thus defer the\n // resetting of `this._popStateInProgress` slightly.\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n\n /**\n * @private\n */\n _pageHide() {\n // Attempt to push the `this._position` into the browser history when\n // navigating away from the document. This is *only* done if the history\n // is empty/temporary, since otherwise an existing browser history entry\n // will end up being overwritten (given that new entries cannot be pushed\n // into the browser history when the 'unload' event has already fired).\n if (!this._destination || this._destination.temporary) {\n this._tryPushCurrentPosition();\n }\n }\n\n /**\n * @private\n */\n _bindEvents() {\n if (this._boundEvents) {\n return; // The event listeners were already added.\n }\n this._boundEvents = {\n updateViewarea: this._updateViewarea.bind(this),\n popState: this._popState.bind(this),\n pageHide: this._pageHide.bind(this),\n };\n\n this.eventBus._on(\"updateviewarea\", this._boundEvents.updateViewarea);\n window.addEventListener(\"popstate\", this._boundEvents.popState);\n window.addEventListener(\"pagehide\", this._boundEvents.pageHide);\n }\n\n /**\n * @private\n */\n _unbindEvents() {\n if (!this._boundEvents) {\n return; // The event listeners were already removed.\n }\n this.eventBus._off(\"updateviewarea\", this._boundEvents.updateViewarea);\n window.removeEventListener(\"popstate\", this._boundEvents.popState);\n window.removeEventListener(\"pagehide\", this._boundEvents.pageHide);\n\n this._boundEvents = null;\n }\n}\n\nfunction isDestHashesEqual(destHash, pushHash) {\n if (typeof destHash !== \"string\" || typeof pushHash !== \"string\") {\n return false;\n }\n if (destHash === pushHash) {\n return true;\n }\n const nameddest = parseQueryString(destHash).get(\"nameddest\");\n if (nameddest === pushHash) {\n return true;\n }\n return false;\n}\n\nfunction isDestArraysEqual(firstDest, secondDest) {\n function isEntryEqual(first, second) {\n if (typeof first !== typeof second) {\n return false;\n }\n if (Array.isArray(first) || Array.isArray(second)) {\n return false;\n }\n if (first !== null && typeof first === \"object\" && second !== null) {\n if (Object.keys(first).length !== Object.keys(second).length) {\n return false;\n }\n for (const key in first) {\n if (!isEntryEqual(first[key], second[key])) {\n return false;\n }\n }\n return true;\n }\n return first === second || (Number.isNaN(first) && Number.isNaN(second));\n }\n\n if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) {\n return false;\n }\n if (firstDest.length !== secondDest.length) {\n return false;\n }\n for (let i = 0, ii = firstDest.length; i < ii; i++) {\n if (!isEntryEqual(firstDest[i], secondDest[i])) {\n return false;\n }\n }\n return true;\n}\n\nexport { isDestArraysEqual, isDestHashesEqual, PDFHistory };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BaseTreeViewer } from \"./base_tree_viewer.js\";\n\n/**\n * @typedef {Object} PDFLayerViewerOptions\n * @property {HTMLDivElement} container - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {IL10n} l10n - Localization service.\n */\n\n/**\n * @typedef {Object} PDFLayerViewerRenderParameters\n * @property {OptionalContentConfig|null} optionalContentConfig - An\n * {OptionalContentConfig} instance.\n * @property {PDFDocument} pdfDocument - A {PDFDocument} instance.\n */\n\nclass PDFLayerViewer extends BaseTreeViewer {\n constructor(options) {\n super(options);\n this.l10n = options.l10n;\n\n this.eventBus._on(\"optionalcontentconfigchanged\", evt => {\n this.#updateLayers(evt.promise);\n });\n this.eventBus._on(\"resetlayers\", () => {\n this.#updateLayers();\n });\n this.eventBus._on(\"togglelayerstree\", this._toggleAllTreeItems.bind(this));\n }\n\n reset() {\n super.reset();\n this._optionalContentConfig = null;\n this._optionalContentHash = null;\n }\n\n /**\n * @private\n */\n _dispatchEvent(layersCount) {\n this.eventBus.dispatch(\"layersloaded\", {\n source: this,\n layersCount,\n });\n }\n\n /**\n * @private\n */\n _bindLink(element, { groupId, input }) {\n const setVisibility = () => {\n this._optionalContentConfig.setVisibility(groupId, input.checked);\n this._optionalContentHash = this._optionalContentConfig.getHash();\n\n this.eventBus.dispatch(\"optionalcontentconfig\", {\n source: this,\n promise: Promise.resolve(this._optionalContentConfig),\n });\n };\n\n element.onclick = evt => {\n if (evt.target === input) {\n setVisibility();\n return true;\n } else if (evt.target !== element) {\n return true; // The target is the \"label\", which is handled above.\n }\n input.checked = !input.checked;\n setVisibility();\n return false;\n };\n }\n\n /**\n * @private\n */\n async _setNestedName(element, { name = null }) {\n if (typeof name === \"string\") {\n element.textContent = this._normalizeTextContent(name);\n return;\n }\n element.textContent = await this.l10n.get(\"additional_layers\");\n element.style.fontStyle = \"italic\";\n }\n\n /**\n * @private\n */\n _addToggleButton(div, { name = null }) {\n super._addToggleButton(div, /* hidden = */ name === null);\n }\n\n /**\n * @private\n */\n _toggleAllTreeItems() {\n if (!this._optionalContentConfig) {\n return;\n }\n super._toggleAllTreeItems();\n }\n\n /**\n * @param {PDFLayerViewerRenderParameters} params\n */\n render({ optionalContentConfig, pdfDocument }) {\n if (this._optionalContentConfig) {\n this.reset();\n }\n this._optionalContentConfig = optionalContentConfig || null;\n this._pdfDocument = pdfDocument || null;\n\n const groups = optionalContentConfig?.getOrder();\n if (!groups) {\n this._dispatchEvent(/* layersCount = */ 0);\n return;\n }\n this._optionalContentHash = optionalContentConfig.getHash();\n\n const fragment = document.createDocumentFragment(),\n queue = [{ parent: fragment, groups }];\n let layersCount = 0,\n hasAnyNesting = false;\n while (queue.length > 0) {\n const levelData = queue.shift();\n for (const groupId of levelData.groups) {\n const div = document.createElement(\"div\");\n div.className = \"treeItem\";\n\n const element = document.createElement(\"a\");\n div.append(element);\n\n if (typeof groupId === \"object\") {\n hasAnyNesting = true;\n this._addToggleButton(div, groupId);\n this._setNestedName(element, groupId);\n\n const itemsDiv = document.createElement(\"div\");\n itemsDiv.className = \"treeItems\";\n div.append(itemsDiv);\n\n queue.push({ parent: itemsDiv, groups: groupId.order });\n } else {\n const group = optionalContentConfig.getGroup(groupId);\n\n const input = document.createElement(\"input\");\n this._bindLink(element, { groupId, input });\n input.type = \"checkbox\";\n input.checked = group.visible;\n\n const label = document.createElement(\"label\");\n label.textContent = this._normalizeTextContent(group.name);\n\n label.append(input);\n element.append(label);\n layersCount++;\n }\n\n levelData.parent.append(div);\n }\n }\n\n this._finishRendering(fragment, layersCount, hasAnyNesting);\n }\n\n async #updateLayers(promise = null) {\n if (!this._optionalContentConfig) {\n return;\n }\n const pdfDocument = this._pdfDocument;\n const optionalContentConfig = await (promise ||\n pdfDocument.getOptionalContentConfig());\n\n if (pdfDocument !== this._pdfDocument) {\n return; // The document was closed while the optional content resolved.\n }\n if (promise) {\n if (optionalContentConfig.getHash() === this._optionalContentHash) {\n return; // The optional content didn't change, hence no need to reset the UI.\n }\n } else {\n this.eventBus.dispatch(\"optionalcontentconfig\", {\n source: this,\n promise: Promise.resolve(optionalContentConfig),\n });\n }\n\n // Reset the sidebarView to the new state.\n this.render({\n optionalContentConfig,\n pdfDocument: this._pdfDocument,\n });\n }\n}\n\nexport { PDFLayerViewer };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BaseTreeViewer } from \"./base_tree_viewer.js\";\nimport { PromiseCapability } from \"pdfjs-lib\";\nimport { SidebarView } from \"./ui_utils.js\";\n\n/**\n * @typedef {Object} PDFOutlineViewerOptions\n * @property {HTMLDivElement} container - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {DownloadManager} downloadManager - The download manager.\n */\n\n/**\n * @typedef {Object} PDFOutlineViewerRenderParameters\n * @property {Array|null} outline - An array of outline objects.\n * @property {PDFDocument} pdfDocument - A {PDFDocument} instance.\n */\n\nclass PDFOutlineViewer extends BaseTreeViewer {\n /**\n * @param {PDFOutlineViewerOptions} options\n */\n constructor(options) {\n super(options);\n this.linkService = options.linkService;\n this.downloadManager = options.downloadManager;\n\n this.eventBus._on(\"toggleoutlinetree\", this._toggleAllTreeItems.bind(this));\n this.eventBus._on(\n \"currentoutlineitem\",\n this._currentOutlineItem.bind(this)\n );\n\n this.eventBus._on(\"pagechanging\", evt => {\n this._currentPageNumber = evt.pageNumber;\n });\n this.eventBus._on(\"pagesloaded\", evt => {\n this._isPagesLoaded = !!evt.pagesCount;\n\n // If the capability is still pending, see the `_dispatchEvent`-method,\n // we know that the `currentOutlineItem`-button can be enabled here.\n if (\n this._currentOutlineItemCapability &&\n !this._currentOutlineItemCapability.settled\n ) {\n this._currentOutlineItemCapability.resolve(\n /* enabled = */ this._isPagesLoaded\n );\n }\n });\n this.eventBus._on(\"sidebarviewchanged\", evt => {\n this._sidebarView = evt.view;\n });\n }\n\n reset() {\n super.reset();\n this._outline = null;\n\n this._pageNumberToDestHashCapability = null;\n this._currentPageNumber = 1;\n this._isPagesLoaded = null;\n\n if (\n this._currentOutlineItemCapability &&\n !this._currentOutlineItemCapability.settled\n ) {\n this._currentOutlineItemCapability.resolve(/* enabled = */ false);\n }\n this._currentOutlineItemCapability = null;\n }\n\n /**\n * @private\n */\n _dispatchEvent(outlineCount) {\n this._currentOutlineItemCapability = new PromiseCapability();\n if (\n outlineCount === 0 ||\n this._pdfDocument?.loadingParams.disableAutoFetch\n ) {\n this._currentOutlineItemCapability.resolve(/* enabled = */ false);\n } else if (this._isPagesLoaded !== null) {\n this._currentOutlineItemCapability.resolve(\n /* enabled = */ this._isPagesLoaded\n );\n }\n\n this.eventBus.dispatch(\"outlineloaded\", {\n source: this,\n outlineCount,\n currentOutlineItemPromise: this._currentOutlineItemCapability.promise,\n });\n }\n\n /**\n * @private\n */\n _bindLink(\n element,\n { url, newWindow, action, attachment, dest, setOCGState }\n ) {\n const { linkService } = this;\n\n if (url) {\n linkService.addLinkAttributes(element, url, newWindow);\n return;\n }\n if (action) {\n element.href = linkService.getAnchorUrl(\"\");\n element.onclick = () => {\n linkService.executeNamedAction(action);\n return false;\n };\n return;\n }\n if (attachment) {\n element.href = linkService.getAnchorUrl(\"\");\n element.onclick = () => {\n this.downloadManager.openOrDownloadData(\n element,\n attachment.content,\n attachment.filename\n );\n return false;\n };\n return;\n }\n if (setOCGState) {\n element.href = linkService.getAnchorUrl(\"\");\n element.onclick = () => {\n linkService.executeSetOCGState(setOCGState);\n return false;\n };\n return;\n }\n\n element.href = linkService.getDestinationHash(dest);\n element.onclick = evt => {\n this._updateCurrentTreeItem(evt.target.parentNode);\n\n if (dest) {\n linkService.goToDestination(dest);\n }\n return false;\n };\n }\n\n /**\n * @private\n */\n _setStyles(element, { bold, italic }) {\n if (bold) {\n element.style.fontWeight = \"bold\";\n }\n if (italic) {\n element.style.fontStyle = \"italic\";\n }\n }\n\n /**\n * @private\n */\n _addToggleButton(div, { count, items }) {\n let hidden = false;\n if (count < 0) {\n let totalCount = items.length;\n if (totalCount > 0) {\n const queue = [...items];\n while (queue.length > 0) {\n const { count: nestedCount, items: nestedItems } = queue.shift();\n if (nestedCount > 0 && nestedItems.length > 0) {\n totalCount += nestedItems.length;\n queue.push(...nestedItems);\n }\n }\n }\n if (Math.abs(count) === totalCount) {\n hidden = true;\n }\n }\n super._addToggleButton(div, hidden);\n }\n\n /**\n * @private\n */\n _toggleAllTreeItems() {\n if (!this._outline) {\n return;\n }\n super._toggleAllTreeItems();\n }\n\n /**\n * @param {PDFOutlineViewerRenderParameters} params\n */\n render({ outline, pdfDocument }) {\n if (this._outline) {\n this.reset();\n }\n this._outline = outline || null;\n this._pdfDocument = pdfDocument || null;\n\n if (!outline) {\n this._dispatchEvent(/* outlineCount = */ 0);\n return;\n }\n\n const fragment = document.createDocumentFragment();\n const queue = [{ parent: fragment, items: outline }];\n let outlineCount = 0,\n hasAnyNesting = false;\n while (queue.length > 0) {\n const levelData = queue.shift();\n for (const item of levelData.items) {\n const div = document.createElement(\"div\");\n div.className = \"treeItem\";\n\n const element = document.createElement(\"a\");\n this._bindLink(element, item);\n this._setStyles(element, item);\n element.textContent = this._normalizeTextContent(item.title);\n\n div.append(element);\n\n if (item.items.length > 0) {\n hasAnyNesting = true;\n this._addToggleButton(div, item);\n\n const itemsDiv = document.createElement(\"div\");\n itemsDiv.className = \"treeItems\";\n div.append(itemsDiv);\n\n queue.push({ parent: itemsDiv, items: item.items });\n }\n\n levelData.parent.append(div);\n outlineCount++;\n }\n }\n\n this._finishRendering(fragment, outlineCount, hasAnyNesting);\n }\n\n /**\n * Find/highlight the current outline item, corresponding to the active page.\n * @private\n */\n async _currentOutlineItem() {\n if (!this._isPagesLoaded) {\n throw new Error(\"_currentOutlineItem: All pages have not been loaded.\");\n }\n if (!this._outline || !this._pdfDocument) {\n return;\n }\n\n const pageNumberToDestHash = await this._getPageNumberToDestHash(\n this._pdfDocument\n );\n if (!pageNumberToDestHash) {\n return;\n }\n this._updateCurrentTreeItem(/* treeItem = */ null);\n\n if (this._sidebarView !== SidebarView.OUTLINE) {\n return; // The outline view is no longer visible, hence do nothing.\n }\n // When there is no destination on the current page, always check the\n // previous ones in (reverse) order.\n for (let i = this._currentPageNumber; i > 0; i--) {\n const destHash = pageNumberToDestHash.get(i);\n if (!destHash) {\n continue;\n }\n const linkElement = this.container.querySelector(`a[href=\"${destHash}\"]`);\n if (!linkElement) {\n continue;\n }\n this._scrollToCurrentTreeItem(linkElement.parentNode);\n break;\n }\n }\n\n /**\n * To (significantly) simplify the overall implementation, we will only\n * consider *one* destination per page when finding/highlighting the current\n * outline item (similar to e.g. Adobe Reader); more specifically, we choose\n * the *first* outline item at the *lowest* level of the outline tree.\n * @private\n */\n async _getPageNumberToDestHash(pdfDocument) {\n if (this._pageNumberToDestHashCapability) {\n return this._pageNumberToDestHashCapability.promise;\n }\n this._pageNumberToDestHashCapability = new PromiseCapability();\n\n const pageNumberToDestHash = new Map(),\n pageNumberNesting = new Map();\n const queue = [{ nesting: 0, items: this._outline }];\n while (queue.length > 0) {\n const levelData = queue.shift(),\n currentNesting = levelData.nesting;\n for (const { dest, items } of levelData.items) {\n let explicitDest, pageNumber;\n if (typeof dest === \"string\") {\n explicitDest = await pdfDocument.getDestination(dest);\n\n if (pdfDocument !== this._pdfDocument) {\n return null; // The document was closed while the data resolved.\n }\n } else {\n explicitDest = dest;\n }\n if (Array.isArray(explicitDest)) {\n const [destRef] = explicitDest;\n\n if (typeof destRef === \"object\" && destRef !== null) {\n pageNumber = this.linkService._cachedPageNumber(destRef);\n\n if (!pageNumber) {\n try {\n pageNumber = (await pdfDocument.getPageIndex(destRef)) + 1;\n\n if (pdfDocument !== this._pdfDocument) {\n return null; // The document was closed while the data resolved.\n }\n this.linkService.cachePageRef(pageNumber, destRef);\n } catch (ex) {\n // Invalid page reference, ignore it and continue parsing.\n }\n }\n } else if (Number.isInteger(destRef)) {\n pageNumber = destRef + 1;\n }\n\n if (\n Number.isInteger(pageNumber) &&\n (!pageNumberToDestHash.has(pageNumber) ||\n currentNesting > pageNumberNesting.get(pageNumber))\n ) {\n const destHash = this.linkService.getDestinationHash(dest);\n pageNumberToDestHash.set(pageNumber, destHash);\n pageNumberNesting.set(pageNumber, currentNesting);\n }\n }\n\n if (items.length > 0) {\n queue.push({ nesting: currentNesting + 1, items });\n }\n }\n }\n\n this._pageNumberToDestHashCapability.resolve(\n pageNumberToDestHash.size > 0 ? pageNumberToDestHash : null\n );\n return this._pageNumberToDestHashCapability.promise;\n }\n}\n\nexport { PDFOutlineViewer };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n normalizeWheelEventDelta,\n PresentationModeState,\n ScrollMode,\n SpreadMode,\n} from \"./ui_utils.js\";\nimport { AnnotationEditorType } from \"pdfjs-lib\";\n\nconst DELAY_BEFORE_HIDING_CONTROLS = 3000; // in ms\nconst ACTIVE_SELECTOR = \"pdfPresentationMode\";\nconst CONTROLS_SELECTOR = \"pdfPresentationModeControls\";\nconst MOUSE_SCROLL_COOLDOWN_TIME = 50; // in ms\nconst PAGE_SWITCH_THRESHOLD = 0.1;\n\n// Number of CSS pixels for a movement to count as a swipe.\nconst SWIPE_MIN_DISTANCE_THRESHOLD = 50;\n\n// Swipe angle deviation from the x or y axis before it is not\n// considered a swipe in that direction any more.\nconst SWIPE_ANGLE_THRESHOLD = Math.PI / 6;\n\n/**\n * @typedef {Object} PDFPresentationModeOptions\n * @property {HTMLDivElement} container - The container for the viewer element.\n * @property {PDFViewer} pdfViewer - The document viewer.\n * @property {EventBus} eventBus - The application event bus.\n */\n\nclass PDFPresentationMode {\n #state = PresentationModeState.UNKNOWN;\n\n #args = null;\n\n /**\n * @param {PDFPresentationModeOptions} options\n */\n constructor({ container, pdfViewer, eventBus }) {\n this.container = container;\n this.pdfViewer = pdfViewer;\n this.eventBus = eventBus;\n\n this.contextMenuOpen = false;\n this.mouseScrollTimeStamp = 0;\n this.mouseScrollDelta = 0;\n this.touchSwipeState = null;\n }\n\n /**\n * Request the browser to enter fullscreen mode.\n * @returns {Promise<boolean>} Indicating if the request was successful.\n */\n async request() {\n const { container, pdfViewer } = this;\n\n if (this.active || !pdfViewer.pagesCount || !container.requestFullscreen) {\n return false;\n }\n this.#addFullscreenChangeListeners();\n this.#notifyStateChange(PresentationModeState.CHANGING);\n\n const promise = container.requestFullscreen();\n\n this.#args = {\n pageNumber: pdfViewer.currentPageNumber,\n scaleValue: pdfViewer.currentScaleValue,\n scrollMode: pdfViewer.scrollMode,\n spreadMode: null,\n annotationEditorMode: null,\n };\n\n if (\n pdfViewer.spreadMode !== SpreadMode.NONE &&\n !(pdfViewer.pageViewsReady && pdfViewer.hasEqualPageSizes)\n ) {\n console.warn(\n \"Ignoring Spread modes when entering PresentationMode, \" +\n \"since the document may contain varying page sizes.\"\n );\n this.#args.spreadMode = pdfViewer.spreadMode;\n }\n if (pdfViewer.annotationEditorMode !== AnnotationEditorType.DISABLE) {\n this.#args.annotationEditorMode = pdfViewer.annotationEditorMode;\n }\n\n try {\n await promise;\n pdfViewer.focus(); // Fixes bug 1787456.\n return true;\n } catch (reason) {\n this.#removeFullscreenChangeListeners();\n this.#notifyStateChange(PresentationModeState.NORMAL);\n }\n return false;\n }\n\n get active() {\n return (\n this.#state === PresentationModeState.CHANGING ||\n this.#state === PresentationModeState.FULLSCREEN\n );\n }\n\n #mouseWheel(evt) {\n if (!this.active) {\n return;\n }\n evt.preventDefault();\n\n const delta = normalizeWheelEventDelta(evt);\n const currentTime = Date.now();\n const storedTime = this.mouseScrollTimeStamp;\n\n // If we've already switched page, avoid accidentally switching again.\n if (\n currentTime > storedTime &&\n currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME\n ) {\n return;\n }\n // If the scroll direction changed, reset the accumulated scroll delta.\n if (\n (this.mouseScrollDelta > 0 && delta < 0) ||\n (this.mouseScrollDelta < 0 && delta > 0)\n ) {\n this.#resetMouseScrollState();\n }\n this.mouseScrollDelta += delta;\n\n if (Math.abs(this.mouseScrollDelta) >= PAGE_SWITCH_THRESHOLD) {\n const totalDelta = this.mouseScrollDelta;\n this.#resetMouseScrollState();\n const success =\n totalDelta > 0\n ? this.pdfViewer.previousPage()\n : this.pdfViewer.nextPage();\n if (success) {\n this.mouseScrollTimeStamp = currentTime;\n }\n }\n }\n\n #notifyStateChange(state) {\n this.#state = state;\n\n this.eventBus.dispatch(\"presentationmodechanged\", { source: this, state });\n }\n\n #enter() {\n this.#notifyStateChange(PresentationModeState.FULLSCREEN);\n this.container.classList.add(ACTIVE_SELECTOR);\n\n // Ensure that the correct page is scrolled into view when entering\n // Presentation Mode, by waiting until fullscreen mode in enabled.\n setTimeout(() => {\n this.pdfViewer.scrollMode = ScrollMode.PAGE;\n if (this.#args.spreadMode !== null) {\n this.pdfViewer.spreadMode = SpreadMode.NONE;\n }\n this.pdfViewer.currentPageNumber = this.#args.pageNumber;\n this.pdfViewer.currentScaleValue = \"page-fit\";\n\n if (this.#args.annotationEditorMode !== null) {\n this.pdfViewer.annotationEditorMode = AnnotationEditorType.NONE;\n }\n }, 0);\n\n this.#addWindowListeners();\n this.#showControls();\n this.contextMenuOpen = false;\n\n // Text selection is disabled in Presentation Mode, thus it's not possible\n // for the user to deselect text that is selected (e.g. with \"Select all\")\n // when entering Presentation Mode, hence we remove any active selection.\n window.getSelection().removeAllRanges();\n }\n\n #exit() {\n const pageNumber = this.pdfViewer.currentPageNumber;\n this.container.classList.remove(ACTIVE_SELECTOR);\n\n // Ensure that the correct page is scrolled into view when exiting\n // Presentation Mode, by waiting until fullscreen mode is disabled.\n setTimeout(() => {\n this.#removeFullscreenChangeListeners();\n this.#notifyStateChange(PresentationModeState.NORMAL);\n\n this.pdfViewer.scrollMode = this.#args.scrollMode;\n if (this.#args.spreadMode !== null) {\n this.pdfViewer.spreadMode = this.#args.spreadMode;\n }\n this.pdfViewer.currentScaleValue = this.#args.scaleValue;\n this.pdfViewer.currentPageNumber = pageNumber;\n\n if (this.#args.annotationEditorMode !== null) {\n this.pdfViewer.annotationEditorMode = this.#args.annotationEditorMode;\n }\n this.#args = null;\n }, 0);\n\n this.#removeWindowListeners();\n this.#hideControls();\n this.#resetMouseScrollState();\n this.contextMenuOpen = false;\n }\n\n #mouseDown(evt) {\n if (this.contextMenuOpen) {\n this.contextMenuOpen = false;\n evt.preventDefault();\n return;\n }\n if (evt.button !== 0) {\n return;\n }\n // Enable clicking of links in presentation mode. Note: only links\n // pointing to destinations in the current PDF document work.\n if (\n evt.target.href &&\n evt.target.parentNode?.hasAttribute(\"data-internal-link\")\n ) {\n return;\n }\n // Unless an internal link was clicked, advance one page.\n evt.preventDefault();\n\n if (evt.shiftKey) {\n this.pdfViewer.previousPage();\n } else {\n this.pdfViewer.nextPage();\n }\n }\n\n #contextMenu() {\n this.contextMenuOpen = true;\n }\n\n #showControls() {\n if (this.controlsTimeout) {\n clearTimeout(this.controlsTimeout);\n } else {\n this.container.classList.add(CONTROLS_SELECTOR);\n }\n this.controlsTimeout = setTimeout(() => {\n this.container.classList.remove(CONTROLS_SELECTOR);\n delete this.controlsTimeout;\n }, DELAY_BEFORE_HIDING_CONTROLS);\n }\n\n #hideControls() {\n if (!this.controlsTimeout) {\n return;\n }\n clearTimeout(this.controlsTimeout);\n this.container.classList.remove(CONTROLS_SELECTOR);\n delete this.controlsTimeout;\n }\n\n /**\n * Resets the properties used for tracking mouse scrolling events.\n */\n #resetMouseScrollState() {\n this.mouseScrollTimeStamp = 0;\n this.mouseScrollDelta = 0;\n }\n\n #touchSwipe(evt) {\n if (!this.active) {\n return;\n }\n if (evt.touches.length > 1) {\n // Multiple touch points detected; cancel the swipe.\n this.touchSwipeState = null;\n return;\n }\n\n switch (evt.type) {\n case \"touchstart\":\n this.touchSwipeState = {\n startX: evt.touches[0].pageX,\n startY: evt.touches[0].pageY,\n endX: evt.touches[0].pageX,\n endY: evt.touches[0].pageY,\n };\n break;\n case \"touchmove\":\n if (this.touchSwipeState === null) {\n return;\n }\n this.touchSwipeState.endX = evt.touches[0].pageX;\n this.touchSwipeState.endY = evt.touches[0].pageY;\n // Avoid the swipe from triggering browser gestures (Chrome in\n // particular has some sort of swipe gesture in fullscreen mode).\n evt.preventDefault();\n break;\n case \"touchend\":\n if (this.touchSwipeState === null) {\n return;\n }\n let delta = 0;\n const dx = this.touchSwipeState.endX - this.touchSwipeState.startX;\n const dy = this.touchSwipeState.endY - this.touchSwipeState.startY;\n const absAngle = Math.abs(Math.atan2(dy, dx));\n if (\n Math.abs(dx) > SWIPE_MIN_DISTANCE_THRESHOLD &&\n (absAngle <= SWIPE_ANGLE_THRESHOLD ||\n absAngle >= Math.PI - SWIPE_ANGLE_THRESHOLD)\n ) {\n // Horizontal swipe.\n delta = dx;\n } else if (\n Math.abs(dy) > SWIPE_MIN_DISTANCE_THRESHOLD &&\n Math.abs(absAngle - Math.PI / 2) <= SWIPE_ANGLE_THRESHOLD\n ) {\n // Vertical swipe.\n delta = dy;\n }\n if (delta > 0) {\n this.pdfViewer.previousPage();\n } else if (delta < 0) {\n this.pdfViewer.nextPage();\n }\n break;\n }\n }\n\n #addWindowListeners() {\n this.showControlsBind = this.#showControls.bind(this);\n this.mouseDownBind = this.#mouseDown.bind(this);\n this.mouseWheelBind = this.#mouseWheel.bind(this);\n this.resetMouseScrollStateBind = this.#resetMouseScrollState.bind(this);\n this.contextMenuBind = this.#contextMenu.bind(this);\n this.touchSwipeBind = this.#touchSwipe.bind(this);\n\n window.addEventListener(\"mousemove\", this.showControlsBind);\n window.addEventListener(\"mousedown\", this.mouseDownBind);\n window.addEventListener(\"wheel\", this.mouseWheelBind, { passive: false });\n window.addEventListener(\"keydown\", this.resetMouseScrollStateBind);\n window.addEventListener(\"contextmenu\", this.contextMenuBind);\n window.addEventListener(\"touchstart\", this.touchSwipeBind);\n window.addEventListener(\"touchmove\", this.touchSwipeBind);\n window.addEventListener(\"touchend\", this.touchSwipeBind);\n }\n\n #removeWindowListeners() {\n window.removeEventListener(\"mousemove\", this.showControlsBind);\n window.removeEventListener(\"mousedown\", this.mouseDownBind);\n window.removeEventListener(\"wheel\", this.mouseWheelBind, {\n passive: false,\n });\n window.removeEventListener(\"keydown\", this.resetMouseScrollStateBind);\n window.removeEventListener(\"contextmenu\", this.contextMenuBind);\n window.removeEventListener(\"touchstart\", this.touchSwipeBind);\n window.removeEventListener(\"touchmove\", this.touchSwipeBind);\n window.removeEventListener(\"touchend\", this.touchSwipeBind);\n\n delete this.showControlsBind;\n delete this.mouseDownBind;\n delete this.mouseWheelBind;\n delete this.resetMouseScrollStateBind;\n delete this.contextMenuBind;\n delete this.touchSwipeBind;\n }\n\n #fullscreenChange() {\n if (/* isFullscreen = */ document.fullscreenElement) {\n this.#enter();\n } else {\n this.#exit();\n }\n }\n\n #addFullscreenChangeListeners() {\n this.fullscreenChangeBind = this.#fullscreenChange.bind(this);\n window.addEventListener(\"fullscreenchange\", this.fullscreenChangeBind);\n }\n\n #removeFullscreenChangeListeners() {\n window.removeEventListener(\"fullscreenchange\", this.fullscreenChangeBind);\n delete this.fullscreenChangeBind;\n }\n}\n\nexport { PDFPresentationMode };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./interfaces\").IRenderableView} IRenderableView */\n/** @typedef {import(\"./pdf_viewer\").PDFViewer} PDFViewer */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_thumbnail_viewer\").PDFThumbnailViewer} PDFThumbnailViewer */\n\nimport { RenderingCancelledException } from \"pdfjs-lib\";\nimport { RenderingStates } from \"./ui_utils.js\";\n\nconst CLEANUP_TIMEOUT = 30000;\n\n/**\n * Controls rendering of the views for pages and thumbnails.\n */\nclass PDFRenderingQueue {\n constructor() {\n this.pdfViewer = null;\n this.pdfThumbnailViewer = null;\n this.onIdle = null;\n this.highestPriorityPage = null;\n /** @type {number} */\n this.idleTimeout = null;\n this.printing = false;\n this.isThumbnailViewEnabled = false;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n Object.defineProperty(this, \"hasViewer\", {\n value: () => !!this.pdfViewer,\n });\n }\n }\n\n /**\n * @param {PDFViewer} pdfViewer\n */\n setViewer(pdfViewer) {\n this.pdfViewer = pdfViewer;\n }\n\n /**\n * @param {PDFThumbnailViewer} pdfThumbnailViewer\n */\n setThumbnailViewer(pdfThumbnailViewer) {\n this.pdfThumbnailViewer = pdfThumbnailViewer;\n }\n\n /**\n * @param {IRenderableView} view\n * @returns {boolean}\n */\n isHighestPriority(view) {\n return this.highestPriorityPage === view.renderingId;\n }\n\n /**\n * @param {Object} currentlyVisiblePages\n */\n renderHighestPriority(currentlyVisiblePages) {\n if (this.idleTimeout) {\n clearTimeout(this.idleTimeout);\n this.idleTimeout = null;\n }\n\n // Pages have a higher priority than thumbnails, so check them first.\n if (this.pdfViewer.forceRendering(currentlyVisiblePages)) {\n return;\n }\n // No pages needed rendering, so check thumbnails.\n if (\n this.isThumbnailViewEnabled &&\n this.pdfThumbnailViewer?.forceRendering()\n ) {\n return;\n }\n\n if (this.printing) {\n // If printing is currently ongoing do not reschedule cleanup.\n return;\n }\n\n if (this.onIdle) {\n this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT);\n }\n }\n\n /**\n * @param {Object} visible\n * @param {Array} views\n * @param {boolean} scrolledDown\n * @param {boolean} [preRenderExtra]\n */\n getHighestPriority(visible, views, scrolledDown, preRenderExtra = false) {\n /**\n * The state has changed. Figure out which page has the highest priority to\n * render next (if any).\n *\n * Priority:\n * 1. visible pages\n * 2. if last scrolled down, the page after the visible pages, or\n * if last scrolled up, the page before the visible pages\n */\n const visibleViews = visible.views,\n numVisible = visibleViews.length;\n\n if (numVisible === 0) {\n return null;\n }\n for (let i = 0; i < numVisible; i++) {\n const view = visibleViews[i].view;\n if (!this.isViewFinished(view)) {\n return view;\n }\n }\n const firstId = visible.first.id,\n lastId = visible.last.id;\n\n // All the visible views have rendered; try to handle any \"holes\" in the\n // page layout (can happen e.g. with spreadModes at higher zoom levels).\n if (lastId - firstId + 1 > numVisible) {\n const visibleIds = visible.ids;\n for (let i = 1, ii = lastId - firstId; i < ii; i++) {\n const holeId = scrolledDown ? firstId + i : lastId - i;\n if (visibleIds.has(holeId)) {\n continue;\n }\n const holeView = views[holeId - 1];\n if (!this.isViewFinished(holeView)) {\n return holeView;\n }\n }\n }\n\n // All the visible views have rendered; try to render next/previous page.\n // (IDs start at 1, so no need to add 1 when `scrolledDown === true`.)\n let preRenderIndex = scrolledDown ? lastId : firstId - 2;\n let preRenderView = views[preRenderIndex];\n\n if (preRenderView && !this.isViewFinished(preRenderView)) {\n return preRenderView;\n }\n if (preRenderExtra) {\n preRenderIndex += scrolledDown ? 1 : -1;\n preRenderView = views[preRenderIndex];\n\n if (preRenderView && !this.isViewFinished(preRenderView)) {\n return preRenderView;\n }\n }\n // Everything that needs to be rendered has been.\n return null;\n }\n\n /**\n * @param {IRenderableView} view\n * @returns {boolean}\n */\n isViewFinished(view) {\n return view.renderingState === RenderingStates.FINISHED;\n }\n\n /**\n * Render a page or thumbnail view. This calls the appropriate function\n * based on the views state. If the view is already rendered it will return\n * `false`.\n *\n * @param {IRenderableView} view\n */\n renderView(view) {\n switch (view.renderingState) {\n case RenderingStates.FINISHED:\n return false;\n case RenderingStates.PAUSED:\n this.highestPriorityPage = view.renderingId;\n view.resume();\n break;\n case RenderingStates.RUNNING:\n this.highestPriorityPage = view.renderingId;\n break;\n case RenderingStates.INITIAL:\n this.highestPriorityPage = view.renderingId;\n view\n .draw()\n .finally(() => {\n this.renderHighestPriority();\n })\n .catch(reason => {\n if (reason instanceof RenderingCancelledException) {\n return;\n }\n console.error(`renderView: \"${reason}\"`);\n });\n break;\n }\n return true;\n }\n}\n\nexport { PDFRenderingQueue };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n\nimport { apiPageLayoutToViewerModes, RenderingStates } from \"./ui_utils.js\";\nimport { PromiseCapability, shadow } from \"pdfjs-lib\";\n\n/**\n * @typedef {Object} PDFScriptingManagerOptions\n * @property {EventBus} eventBus - The application event bus.\n * @property {string} sandboxBundleSrc - The path and filename of the scripting\n * bundle.\n * @property {Object} [scriptingFactory] - The factory that is used when\n * initializing scripting; must contain a `createScripting` method.\n * PLEASE NOTE: Primarily intended for the default viewer use-case.\n * @property {function} [docPropertiesLookup] - The function that is used to\n * lookup the necessary document properties.\n */\n\nclass PDFScriptingManager {\n /**\n * @param {PDFScriptingManagerOptions} options\n */\n constructor({\n eventBus,\n sandboxBundleSrc = null,\n scriptingFactory = null,\n docPropertiesLookup = null,\n }) {\n this._pdfDocument = null;\n this._pdfViewer = null;\n this._closeCapability = null;\n this._destroyCapability = null;\n\n this._scripting = null;\n this._ready = false;\n\n this._eventBus = eventBus;\n this._sandboxBundleSrc = sandboxBundleSrc;\n this._scriptingFactory = scriptingFactory;\n this._docPropertiesLookup = docPropertiesLookup;\n\n // The default viewer already handles adding/removing of DOM events,\n // hence limit this to only the viewer components.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"COMPONENTS\") &&\n !this._scriptingFactory\n ) {\n window.addEventListener(\"updatefromsandbox\", event => {\n this._eventBus.dispatch(\"updatefromsandbox\", {\n source: window,\n detail: event.detail,\n });\n });\n }\n }\n\n setViewer(pdfViewer) {\n this._pdfViewer = pdfViewer;\n }\n\n async setDocument(pdfDocument) {\n if (this._pdfDocument) {\n await this._destroyScripting();\n }\n this._pdfDocument = pdfDocument;\n\n if (!pdfDocument) {\n return;\n }\n const [objects, calculationOrder, docActions] = await Promise.all([\n pdfDocument.getFieldObjects(),\n pdfDocument.getCalculationOrderIds(),\n pdfDocument.getJSActions(),\n ]);\n\n if (!objects && !docActions) {\n // No FieldObjects or JavaScript actions were found in the document.\n await this._destroyScripting();\n return;\n }\n if (pdfDocument !== this._pdfDocument) {\n return; // The document was closed while the data resolved.\n }\n try {\n this._scripting = this._createScripting();\n } catch (error) {\n console.error(`PDFScriptingManager.setDocument: \"${error?.message}\".`);\n\n await this._destroyScripting();\n return;\n }\n\n this._internalEvents.set(\"updatefromsandbox\", event => {\n if (event?.source !== window) {\n return;\n }\n this._updateFromSandbox(event.detail);\n });\n this._internalEvents.set(\"dispatcheventinsandbox\", event => {\n this._scripting?.dispatchEventInSandbox(event.detail);\n });\n\n this._internalEvents.set(\"pagechanging\", ({ pageNumber, previous }) => {\n if (pageNumber === previous) {\n return; // The current page didn't change.\n }\n this._dispatchPageClose(previous);\n this._dispatchPageOpen(pageNumber);\n });\n this._internalEvents.set(\"pagerendered\", ({ pageNumber }) => {\n if (!this._pageOpenPending.has(pageNumber)) {\n return; // No pending \"PageOpen\" event for the newly rendered page.\n }\n if (pageNumber !== this._pdfViewer.currentPageNumber) {\n return; // The newly rendered page is no longer the current one.\n }\n this._dispatchPageOpen(pageNumber);\n });\n this._internalEvents.set(\"pagesdestroy\", async event => {\n await this._dispatchPageClose(this._pdfViewer.currentPageNumber);\n\n await this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillClose\",\n });\n\n this._closeCapability?.resolve();\n });\n\n for (const [name, listener] of this._internalEvents) {\n this._eventBus._on(name, listener);\n }\n\n try {\n const docProperties = await this._getDocProperties();\n if (pdfDocument !== this._pdfDocument) {\n return; // The document was closed while the properties resolved.\n }\n\n await this._scripting.createSandbox({\n objects,\n calculationOrder,\n appInfo: {\n platform: navigator.platform,\n language: navigator.language,\n },\n docInfo: {\n ...docProperties,\n actions: docActions,\n },\n });\n\n this._eventBus.dispatch(\"sandboxcreated\", { source: this });\n } catch (error) {\n console.error(`PDFScriptingManager.setDocument: \"${error?.message}\".`);\n\n await this._destroyScripting();\n return;\n }\n\n await this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"Open\",\n });\n await this._dispatchPageOpen(\n this._pdfViewer.currentPageNumber,\n /* initialize = */ true\n );\n\n // Defer this slightly, to ensure that scripting is *fully* initialized.\n Promise.resolve().then(() => {\n if (pdfDocument === this._pdfDocument) {\n this._ready = true;\n }\n });\n }\n\n async dispatchWillSave(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillSave\",\n });\n }\n\n async dispatchDidSave(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"DidSave\",\n });\n }\n\n async dispatchWillPrint(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillPrint\",\n });\n }\n\n async dispatchDidPrint(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"DidPrint\",\n });\n }\n\n get destroyPromise() {\n return this._destroyCapability?.promise || null;\n }\n\n get ready() {\n return this._ready;\n }\n\n /**\n * @private\n */\n get _internalEvents() {\n return shadow(this, \"_internalEvents\", new Map());\n }\n\n /**\n * @private\n */\n get _pageOpenPending() {\n return shadow(this, \"_pageOpenPending\", new Set());\n }\n\n /**\n * @private\n */\n get _visitedPages() {\n return shadow(this, \"_visitedPages\", new Map());\n }\n\n /**\n * @private\n */\n async _updateFromSandbox(detail) {\n // Ignore some events, see below, that don't make sense in PresentationMode.\n const isInPresentationMode =\n this._pdfViewer.isInPresentationMode ||\n this._pdfViewer.isChangingPresentationMode;\n\n const { id, siblings, command, value } = detail;\n if (!id) {\n switch (command) {\n case \"clear\":\n console.clear();\n break;\n case \"error\":\n console.error(value);\n break;\n case \"layout\": {\n // NOTE: Always ignore the pageLayout in GeckoView since there's\n // no UI available to change Scroll/Spread modes for the user.\n if (\n (typeof PDFJSDev === \"undefined\"\n ? window.isGECKOVIEW\n : PDFJSDev.test(\"GECKOVIEW\")) ||\n isInPresentationMode\n ) {\n return;\n }\n const modes = apiPageLayoutToViewerModes(value);\n this._pdfViewer.spreadMode = modes.spreadMode;\n break;\n }\n case \"page-num\":\n this._pdfViewer.currentPageNumber = value + 1;\n break;\n case \"print\":\n await this._pdfViewer.pagesPromise;\n this._eventBus.dispatch(\"print\", { source: this });\n break;\n case \"println\":\n console.log(value);\n break;\n case \"zoom\":\n if (isInPresentationMode) {\n return;\n }\n this._pdfViewer.currentScaleValue = value;\n break;\n case \"SaveAs\":\n this._eventBus.dispatch(\"download\", { source: this });\n break;\n case \"FirstPage\":\n this._pdfViewer.currentPageNumber = 1;\n break;\n case \"LastPage\":\n this._pdfViewer.currentPageNumber = this._pdfViewer.pagesCount;\n break;\n case \"NextPage\":\n this._pdfViewer.nextPage();\n break;\n case \"PrevPage\":\n this._pdfViewer.previousPage();\n break;\n case \"ZoomViewIn\":\n if (isInPresentationMode) {\n return;\n }\n this._pdfViewer.increaseScale();\n break;\n case \"ZoomViewOut\":\n if (isInPresentationMode) {\n return;\n }\n this._pdfViewer.decreaseScale();\n break;\n }\n return;\n }\n\n if (isInPresentationMode) {\n if (detail.focus) {\n return;\n }\n }\n delete detail.id;\n delete detail.siblings;\n\n const ids = siblings ? [id, ...siblings] : [id];\n for (const elementId of ids) {\n const element = document.querySelector(\n `[data-element-id=\"${elementId}\"]`\n );\n if (element) {\n element.dispatchEvent(new CustomEvent(\"updatefromsandbox\", { detail }));\n } else {\n // The element hasn't been rendered yet, use the AnnotationStorage.\n this._pdfDocument?.annotationStorage.setValue(elementId, detail);\n }\n }\n }\n\n /**\n * @private\n */\n async _dispatchPageOpen(pageNumber, initialize = false) {\n const pdfDocument = this._pdfDocument,\n visitedPages = this._visitedPages;\n\n if (initialize) {\n this._closeCapability = new PromiseCapability();\n }\n if (!this._closeCapability) {\n return; // Scripting isn't fully initialized yet.\n }\n const pageView = this._pdfViewer.getPageView(/* index = */ pageNumber - 1);\n\n if (pageView?.renderingState !== RenderingStates.FINISHED) {\n this._pageOpenPending.add(pageNumber);\n return; // Wait for the page to finish rendering.\n }\n this._pageOpenPending.delete(pageNumber);\n\n const actionsPromise = (async () => {\n // Avoid sending, and thus serializing, the `actions` data more than once.\n const actions = await (!visitedPages.has(pageNumber)\n ? pageView.pdfPage?.getJSActions()\n : null);\n if (pdfDocument !== this._pdfDocument) {\n return; // The document was closed while the actions resolved.\n }\n\n await this._scripting?.dispatchEventInSandbox({\n id: \"page\",\n name: \"PageOpen\",\n pageNumber,\n actions,\n });\n })();\n visitedPages.set(pageNumber, actionsPromise);\n }\n\n /**\n * @private\n */\n async _dispatchPageClose(pageNumber) {\n const pdfDocument = this._pdfDocument,\n visitedPages = this._visitedPages;\n\n if (!this._closeCapability) {\n return; // Scripting isn't fully initialized yet.\n }\n if (this._pageOpenPending.has(pageNumber)) {\n return; // The page is still rendering; no \"PageOpen\" event dispatched.\n }\n const actionsPromise = visitedPages.get(pageNumber);\n if (!actionsPromise) {\n return; // The \"PageClose\" event must be preceded by a \"PageOpen\" event.\n }\n visitedPages.set(pageNumber, null);\n\n // Ensure that the \"PageOpen\" event is dispatched first.\n await actionsPromise;\n if (pdfDocument !== this._pdfDocument) {\n return; // The document was closed while the actions resolved.\n }\n\n await this._scripting?.dispatchEventInSandbox({\n id: \"page\",\n name: \"PageClose\",\n pageNumber,\n });\n }\n\n /**\n * @returns {Promise<Object>} A promise that is resolved with an {Object}\n * containing the necessary document properties; please find the expected\n * format in `PDFViewerApplication._scriptingDocProperties`.\n * @private\n */\n async _getDocProperties() {\n if (this._docPropertiesLookup) {\n return this._docPropertiesLookup(this._pdfDocument);\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"COMPONENTS\")) {\n const { docPropertiesLookup } = require(\"./generic_scripting.js\");\n\n return docPropertiesLookup(this._pdfDocument);\n }\n throw new Error(\"_getDocProperties: Unable to lookup properties.\");\n }\n\n /**\n * @private\n */\n _createScripting() {\n this._destroyCapability = new PromiseCapability();\n\n if (this._scripting) {\n throw new Error(\"_createScripting: Scripting already exists.\");\n }\n if (this._scriptingFactory) {\n return this._scriptingFactory.createScripting({\n sandboxBundleSrc: this._sandboxBundleSrc,\n });\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"COMPONENTS\")) {\n const { GenericScripting } = require(\"./generic_scripting.js\");\n\n return new GenericScripting(this._sandboxBundleSrc);\n }\n throw new Error(\"_createScripting: Cannot create scripting.\");\n }\n\n /**\n * @private\n */\n async _destroyScripting() {\n if (!this._scripting) {\n this._pdfDocument = null;\n\n this._destroyCapability?.resolve();\n return;\n }\n if (this._closeCapability) {\n await Promise.race([\n this._closeCapability.promise,\n new Promise(resolve => {\n // Avoid the scripting/sandbox-destruction hanging indefinitely.\n setTimeout(resolve, 1000);\n }),\n ]).catch(reason => {\n // Ignore any errors, to ensure that the sandbox is always destroyed.\n });\n this._closeCapability = null;\n }\n this._pdfDocument = null;\n\n try {\n await this._scripting.destroySandbox();\n } catch (ex) {}\n\n for (const [name, listener] of this._internalEvents) {\n this._eventBus._off(name, listener);\n }\n this._internalEvents.clear();\n\n this._pageOpenPending.clear();\n this._visitedPages.clear();\n\n this._scripting = null;\n this._ready = false;\n\n this._destroyCapability?.resolve();\n }\n}\n\nexport { PDFScriptingManager };\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n docStyle,\n PresentationModeState,\n SidebarView,\n toggleCheckedBtn,\n toggleExpandedBtn,\n} from \"./ui_utils.js\";\n\nconst SIDEBAR_WIDTH_VAR = \"--sidebar-width\";\nconst SIDEBAR_MIN_WIDTH = 200; // pixels\nconst SIDEBAR_RESIZING_CLASS = \"sidebarResizing\";\nconst UI_NOTIFICATION_CLASS = \"pdfSidebarNotification\";\n\n/**\n * @typedef {Object} PDFSidebarOptions\n * @property {PDFSidebarElements} elements - The DOM elements.\n * @property {EventBus} eventBus - The application event bus.\n * @property {IL10n} l10n - The localization service.\n */\n\n/**\n * @typedef {Object} PDFSidebarElements\n * @property {HTMLDivElement} outerContainer - The outer container\n * (encasing both the viewer and sidebar elements).\n * @property {HTMLDivElement} sidebarContainer - The sidebar container\n * (in which the views are placed).\n * @property {HTMLButtonElement} toggleButton - The button used for\n * opening/closing the sidebar.\n * @property {HTMLDivElement} resizer - The DOM element that can be dragged in\n * order to adjust the width of the sidebar.\n * @property {HTMLButtonElement} thumbnailButton - The button used to show\n * the thumbnail view.\n * @property {HTMLButtonElement} outlineButton - The button used to show\n * the outline view.\n * @property {HTMLButtonElement} attachmentsButton - The button used to show\n * the attachments view.\n * @property {HTMLButtonElement} layersButton - The button used to show\n * the layers view.\n * @property {HTMLDivElement} thumbnailView - The container in which\n * the thumbnails are placed.\n * @property {HTMLDivElement} outlineView - The container in which\n * the outline is placed.\n * @property {HTMLDivElement} attachmentsView - The container in which\n * the attachments are placed.\n * @property {HTMLDivElement} layersView - The container in which\n * the layers are placed.\n * @property {HTMLDivElement} outlineOptionsContainer - The container in which\n * the outline view-specific option button(s) are placed.\n * @property {HTMLButtonElement} currentOutlineItemButton - The button used to\n * find the current outline item.\n */\n\nclass PDFSidebar {\n #isRTL = false;\n\n #mouseMoveBound = this.#mouseMove.bind(this);\n\n #mouseUpBound = this.#mouseUp.bind(this);\n\n #outerContainerWidth = null;\n\n #width = null;\n\n /**\n * @param {PDFSidebarOptions} options\n */\n constructor({ elements, eventBus, l10n }) {\n this.isOpen = false;\n this.active = SidebarView.THUMBS;\n this.isInitialViewSet = false;\n this.isInitialEventDispatched = false;\n\n /**\n * Callback used when the sidebar has been opened/closed, to ensure that\n * the viewers (PDFViewer/PDFThumbnailViewer) are updated correctly.\n */\n this.onToggled = null;\n this.onUpdateThumbnails = null;\n\n this.outerContainer = elements.outerContainer;\n this.sidebarContainer = elements.sidebarContainer;\n this.toggleButton = elements.toggleButton;\n this.resizer = elements.resizer;\n\n this.thumbnailButton = elements.thumbnailButton;\n this.outlineButton = elements.outlineButton;\n this.attachmentsButton = elements.attachmentsButton;\n this.layersButton = elements.layersButton;\n\n this.thumbnailView = elements.thumbnailView;\n this.outlineView = elements.outlineView;\n this.attachmentsView = elements.attachmentsView;\n this.layersView = elements.layersView;\n\n this._outlineOptionsContainer = elements.outlineOptionsContainer;\n this._currentOutlineItemButton = elements.currentOutlineItemButton;\n\n this.eventBus = eventBus;\n this.l10n = l10n;\n\n l10n.getDirection().then(dir => {\n this.#isRTL = dir === \"rtl\";\n });\n this.#addEventListeners();\n }\n\n reset() {\n this.isInitialViewSet = false;\n this.isInitialEventDispatched = false;\n\n this.#hideUINotification(/* reset = */ true);\n this.switchView(SidebarView.THUMBS);\n\n this.outlineButton.disabled = false;\n this.attachmentsButton.disabled = false;\n this.layersButton.disabled = false;\n this._currentOutlineItemButton.disabled = true;\n }\n\n /**\n * @type {number} One of the values in {SidebarView}.\n */\n get visibleView() {\n return this.isOpen ? this.active : SidebarView.NONE;\n }\n\n /**\n * @param {number} view - The sidebar view that should become visible,\n * must be one of the values in {SidebarView}.\n */\n setInitialView(view = SidebarView.NONE) {\n if (this.isInitialViewSet) {\n return;\n }\n this.isInitialViewSet = true;\n\n // If the user has already manually opened the sidebar, immediately closing\n // it would be bad UX; also ignore the \"unknown\" sidebar view value.\n if (view === SidebarView.NONE || view === SidebarView.UNKNOWN) {\n this.#dispatchEvent();\n return;\n }\n this.switchView(view, /* forceOpen = */ true);\n\n // Prevent dispatching two back-to-back \"sidebarviewchanged\" events,\n // since `this.switchView` dispatched the event if the view changed.\n if (!this.isInitialEventDispatched) {\n this.#dispatchEvent();\n }\n }\n\n /**\n * @param {number} view - The sidebar view that should be switched to,\n * must be one of the values in {SidebarView}.\n * @param {boolean} [forceOpen] - Ensure that the sidebar is open.\n * The default value is `false`.\n */\n switchView(view, forceOpen = false) {\n const isViewChanged = view !== this.active;\n let forceRendering = false;\n\n switch (view) {\n case SidebarView.NONE:\n if (this.isOpen) {\n this.close();\n }\n return; // Closing will trigger rendering and dispatch the event.\n case SidebarView.THUMBS:\n if (this.isOpen && isViewChanged) {\n forceRendering = true;\n }\n break;\n case SidebarView.OUTLINE:\n if (this.outlineButton.disabled) {\n return;\n }\n break;\n case SidebarView.ATTACHMENTS:\n if (this.attachmentsButton.disabled) {\n return;\n }\n break;\n case SidebarView.LAYERS:\n if (this.layersButton.disabled) {\n return;\n }\n break;\n default:\n console.error(`PDFSidebar.switchView: \"${view}\" is not a valid view.`);\n return;\n }\n // Update the active view *after* it has been validated above,\n // in order to prevent setting it to an invalid state.\n this.active = view;\n\n // Update the CSS classes (and aria attributes), for all buttons and views.\n toggleCheckedBtn(\n this.thumbnailButton,\n view === SidebarView.THUMBS,\n this.thumbnailView\n );\n toggleCheckedBtn(\n this.outlineButton,\n view === SidebarView.OUTLINE,\n this.outlineView\n );\n toggleCheckedBtn(\n this.attachmentsButton,\n view === SidebarView.ATTACHMENTS,\n this.attachmentsView\n );\n toggleCheckedBtn(\n this.layersButton,\n view === SidebarView.LAYERS,\n this.layersView\n );\n\n // Finally, update view-specific CSS classes.\n this._outlineOptionsContainer.classList.toggle(\n \"hidden\",\n view !== SidebarView.OUTLINE\n );\n\n if (forceOpen && !this.isOpen) {\n this.open();\n return; // Opening will trigger rendering and dispatch the event.\n }\n if (forceRendering) {\n this.onUpdateThumbnails();\n this.onToggled();\n }\n if (isViewChanged) {\n this.#dispatchEvent();\n }\n }\n\n open() {\n if (this.isOpen) {\n return;\n }\n this.isOpen = true;\n toggleExpandedBtn(this.toggleButton, true);\n\n this.outerContainer.classList.add(\"sidebarMoving\", \"sidebarOpen\");\n\n if (this.active === SidebarView.THUMBS) {\n this.onUpdateThumbnails();\n }\n this.onToggled();\n this.#dispatchEvent();\n\n this.#hideUINotification();\n }\n\n close() {\n if (!this.isOpen) {\n return;\n }\n this.isOpen = false;\n toggleExpandedBtn(this.toggleButton, false);\n\n this.outerContainer.classList.add(\"sidebarMoving\");\n this.outerContainer.classList.remove(\"sidebarOpen\");\n\n this.onToggled();\n this.#dispatchEvent();\n }\n\n toggle() {\n if (this.isOpen) {\n this.close();\n } else {\n this.open();\n }\n }\n\n #dispatchEvent() {\n if (this.isInitialViewSet) {\n this.isInitialEventDispatched ||= true;\n }\n\n this.eventBus.dispatch(\"sidebarviewchanged\", {\n source: this,\n view: this.visibleView,\n });\n }\n\n #showUINotification() {\n this.toggleButton.setAttribute(\n \"data-l10n-id\",\n \"toggle_sidebar_notification2\"\n );\n this.l10n.translate(this.toggleButton);\n\n if (!this.isOpen) {\n // Only show the notification on the `toggleButton` if the sidebar is\n // currently closed, to avoid unnecessarily bothering the user.\n this.toggleButton.classList.add(UI_NOTIFICATION_CLASS);\n }\n }\n\n #hideUINotification(reset = false) {\n if (this.isOpen || reset) {\n // Only hide the notification on the `toggleButton` if the sidebar is\n // currently open, or when the current PDF document is being closed.\n this.toggleButton.classList.remove(UI_NOTIFICATION_CLASS);\n }\n\n if (reset) {\n this.toggleButton.setAttribute(\"data-l10n-id\", \"toggle_sidebar\");\n this.l10n.translate(this.toggleButton);\n }\n }\n\n #addEventListeners() {\n this.sidebarContainer.addEventListener(\"transitionend\", evt => {\n if (evt.target === this.sidebarContainer) {\n this.outerContainer.classList.remove(\"sidebarMoving\");\n }\n });\n\n this.toggleButton.addEventListener(\"click\", () => {\n this.toggle();\n });\n\n // Buttons for switching views.\n this.thumbnailButton.addEventListener(\"click\", () => {\n this.switchView(SidebarView.THUMBS);\n });\n\n this.outlineButton.addEventListener(\"click\", () => {\n this.switchView(SidebarView.OUTLINE);\n });\n this.outlineButton.addEventListener(\"dblclick\", () => {\n this.eventBus.dispatch(\"toggleoutlinetree\", { source: this });\n });\n\n this.attachmentsButton.addEventListener(\"click\", () => {\n this.switchView(SidebarView.ATTACHMENTS);\n });\n\n this.layersButton.addEventListener(\"click\", () => {\n this.switchView(SidebarView.LAYERS);\n });\n this.layersButton.addEventListener(\"dblclick\", () => {\n this.eventBus.dispatch(\"resetlayers\", { source: this });\n });\n\n // Buttons for view-specific options.\n this._currentOutlineItemButton.addEventListener(\"click\", () => {\n this.eventBus.dispatch(\"currentoutlineitem\", { source: this });\n });\n\n // Disable/enable views.\n const onTreeLoaded = (count, button, view) => {\n button.disabled = !count;\n\n if (count) {\n this.#showUINotification();\n } else if (this.active === view) {\n // If the `view` was opened by the user during document load,\n // switch away from it if it turns out to be empty.\n this.switchView(SidebarView.THUMBS);\n }\n };\n\n this.eventBus._on(\"outlineloaded\", evt => {\n onTreeLoaded(evt.outlineCount, this.outlineButton, SidebarView.OUTLINE);\n\n evt.currentOutlineItemPromise.then(enabled => {\n if (!this.isInitialViewSet) {\n return;\n }\n this._currentOutlineItemButton.disabled = !enabled;\n });\n });\n\n this.eventBus._on(\"attachmentsloaded\", evt => {\n onTreeLoaded(\n evt.attachmentsCount,\n this.attachmentsButton,\n SidebarView.ATTACHMENTS\n );\n });\n\n this.eventBus._on(\"layersloaded\", evt => {\n onTreeLoaded(evt.layersCount, this.layersButton, SidebarView.LAYERS);\n });\n\n // Update the thumbnailViewer, if visible, when exiting presentation mode.\n this.eventBus._on(\"presentationmodechanged\", evt => {\n if (\n evt.state === PresentationModeState.NORMAL &&\n this.visibleView === SidebarView.THUMBS\n ) {\n this.onUpdateThumbnails();\n }\n });\n\n // Handle resizing of the sidebar.\n this.resizer.addEventListener(\"mousedown\", evt => {\n if (evt.button !== 0) {\n return;\n }\n // Disable the `transition-duration` rules when sidebar resizing begins,\n // in order to improve responsiveness and to avoid visual glitches.\n this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);\n\n window.addEventListener(\"mousemove\", this.#mouseMoveBound);\n window.addEventListener(\"mouseup\", this.#mouseUpBound);\n });\n\n this.eventBus._on(\"resize\", evt => {\n // When the *entire* viewer is resized, such that it becomes narrower,\n // ensure that the sidebar doesn't end up being too wide.\n if (evt.source !== window) {\n return;\n }\n // Always reset the cached width when the viewer is resized.\n this.#outerContainerWidth = null;\n\n if (!this.#width) {\n // The sidebar hasn't been resized, hence no need to adjust its width.\n return;\n }\n // NOTE: If the sidebar is closed, we don't need to worry about\n // visual glitches nor ensure that rendering is triggered.\n if (!this.isOpen) {\n this.#updateWidth(this.#width);\n return;\n }\n this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);\n const updated = this.#updateWidth(this.#width);\n\n Promise.resolve().then(() => {\n this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);\n // Trigger rendering if the sidebar width changed, to avoid\n // depending on the order in which 'resize' events are handled.\n if (updated) {\n this.eventBus.dispatch(\"resize\", { source: this });\n }\n });\n });\n }\n\n /**\n * @type {number}\n */\n get outerContainerWidth() {\n return (this.#outerContainerWidth ||= this.outerContainer.clientWidth);\n }\n\n /**\n * returns {boolean} Indicating if the sidebar width was updated.\n */\n #updateWidth(width = 0) {\n // Prevent the sidebar from becoming too narrow, or from occupying more\n // than half of the available viewer width.\n const maxWidth = Math.floor(this.outerContainerWidth / 2);\n if (width > maxWidth) {\n width = maxWidth;\n }\n if (width < SIDEBAR_MIN_WIDTH) {\n width = SIDEBAR_MIN_WIDTH;\n }\n // Only update the UI when the sidebar width did in fact change.\n if (width === this.#width) {\n return false;\n }\n this.#width = width;\n\n docStyle.setProperty(SIDEBAR_WIDTH_VAR, `${width}px`);\n return true;\n }\n\n #mouseMove(evt) {\n let width = evt.clientX;\n // For sidebar resizing to work correctly in RTL mode, invert the width.\n if (this.#isRTL) {\n width = this.outerContainerWidth - width;\n }\n this.#updateWidth(width);\n }\n\n #mouseUp(evt) {\n // Re-enable the `transition-duration` rules when sidebar resizing ends...\n this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);\n // ... and ensure that rendering will always be triggered.\n this.eventBus.dispatch(\"resize\", { source: this });\n\n window.removeEventListener(\"mousemove\", this.#mouseMoveBound);\n window.removeEventListener(\"mouseup\", this.#mouseUpBound);\n }\n}\n\nexport { PDFSidebar };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_rendering_queue\").PDFRenderingQueue} PDFRenderingQueue */\n\nimport {\n getVisibleElements,\n isValidRotation,\n RenderingStates,\n scrollIntoView,\n watchScroll,\n} from \"./ui_utils.js\";\nimport { PDFThumbnailView, TempImageFactory } from \"./pdf_thumbnail_view.js\";\n\nconst THUMBNAIL_SCROLL_MARGIN = -19;\nconst THUMBNAIL_SELECTED_CLASS = \"selected\";\n\n/**\n * @typedef {Object} PDFThumbnailViewerOptions\n * @property {HTMLDivElement} container - The container for the thumbnail\n * elements.\n * @property {EventBus} eventBus - The application event bus.\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {PDFRenderingQueue} renderingQueue - The rendering queue object.\n * @property {IL10n} l10n - Localization service.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n */\n\n/**\n * Viewer control to display thumbnails for pages in a PDF document.\n */\nclass PDFThumbnailViewer {\n /**\n * @param {PDFThumbnailViewerOptions} options\n */\n constructor({\n container,\n eventBus,\n linkService,\n renderingQueue,\n l10n,\n pageColors,\n }) {\n this.container = container;\n this.eventBus = eventBus;\n this.linkService = linkService;\n this.renderingQueue = renderingQueue;\n this.l10n = l10n;\n this.pageColors = pageColors || null;\n\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n if (\n this.pageColors &&\n !(\n CSS.supports(\"color\", this.pageColors.background) &&\n CSS.supports(\"color\", this.pageColors.foreground)\n )\n ) {\n if (this.pageColors.background || this.pageColors.foreground) {\n console.warn(\n \"PDFThumbnailViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used.\"\n );\n }\n this.pageColors = null;\n }\n }\n\n this.scroll = watchScroll(this.container, this._scrollUpdated.bind(this));\n this._resetView();\n }\n\n /**\n * @private\n */\n _scrollUpdated() {\n this.renderingQueue.renderHighestPriority();\n }\n\n getThumbnail(index) {\n return this._thumbnails[index];\n }\n\n /**\n * @private\n */\n _getVisibleThumbs() {\n return getVisibleElements({\n scrollEl: this.container,\n views: this._thumbnails,\n });\n }\n\n scrollThumbnailIntoView(pageNumber) {\n if (!this.pdfDocument) {\n return;\n }\n const thumbnailView = this._thumbnails[pageNumber - 1];\n\n if (!thumbnailView) {\n console.error('scrollThumbnailIntoView: Invalid \"pageNumber\" parameter.');\n return;\n }\n\n if (pageNumber !== this._currentPageNumber) {\n const prevThumbnailView = this._thumbnails[this._currentPageNumber - 1];\n // Remove the highlight from the previous thumbnail...\n prevThumbnailView.div.classList.remove(THUMBNAIL_SELECTED_CLASS);\n // ... and add the highlight to the new thumbnail.\n thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);\n }\n const { first, last, views } = this._getVisibleThumbs();\n\n // If the thumbnail isn't currently visible, scroll it into view.\n if (views.length > 0) {\n let shouldScroll = false;\n if (pageNumber <= first.id || pageNumber >= last.id) {\n shouldScroll = true;\n } else {\n for (const { id, percent } of views) {\n if (id !== pageNumber) {\n continue;\n }\n shouldScroll = percent < 100;\n break;\n }\n }\n if (shouldScroll) {\n scrollIntoView(thumbnailView.div, { top: THUMBNAIL_SCROLL_MARGIN });\n }\n }\n\n this._currentPageNumber = pageNumber;\n }\n\n get pagesRotation() {\n return this._pagesRotation;\n }\n\n set pagesRotation(rotation) {\n if (!isValidRotation(rotation)) {\n throw new Error(\"Invalid thumbnails rotation angle.\");\n }\n if (!this.pdfDocument) {\n return;\n }\n if (this._pagesRotation === rotation) {\n return; // The rotation didn't change.\n }\n this._pagesRotation = rotation;\n\n const updateArgs = { rotation };\n for (const thumbnail of this._thumbnails) {\n thumbnail.update(updateArgs);\n }\n }\n\n cleanup() {\n for (const thumbnail of this._thumbnails) {\n if (thumbnail.renderingState !== RenderingStates.FINISHED) {\n thumbnail.reset();\n }\n }\n TempImageFactory.destroyCanvas();\n }\n\n /**\n * @private\n */\n _resetView() {\n this._thumbnails = [];\n this._currentPageNumber = 1;\n this._pageLabels = null;\n this._pagesRotation = 0;\n\n // Remove the thumbnails from the DOM.\n this.container.textContent = \"\";\n }\n\n /**\n * @param {PDFDocumentProxy} pdfDocument\n */\n setDocument(pdfDocument) {\n if (this.pdfDocument) {\n this._cancelRendering();\n this._resetView();\n }\n\n this.pdfDocument = pdfDocument;\n if (!pdfDocument) {\n return;\n }\n const firstPagePromise = pdfDocument.getPage(1);\n const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();\n\n firstPagePromise\n .then(firstPdfPage => {\n const pagesCount = pdfDocument.numPages;\n const viewport = firstPdfPage.getViewport({ scale: 1 });\n\n for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {\n const thumbnail = new PDFThumbnailView({\n container: this.container,\n eventBus: this.eventBus,\n id: pageNum,\n defaultViewport: viewport.clone(),\n optionalContentConfigPromise,\n linkService: this.linkService,\n renderingQueue: this.renderingQueue,\n l10n: this.l10n,\n pageColors: this.pageColors,\n });\n this._thumbnails.push(thumbnail);\n }\n // Set the first `pdfPage` immediately, since it's already loaded,\n // rather than having to repeat the `PDFDocumentProxy.getPage` call in\n // the `this.#ensurePdfPageLoaded` method before rendering can start.\n this._thumbnails[0]?.setPdfPage(firstPdfPage);\n\n // Ensure that the current thumbnail is always highlighted on load.\n const thumbnailView = this._thumbnails[this._currentPageNumber - 1];\n thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);\n })\n .catch(reason => {\n console.error(\"Unable to initialize thumbnail viewer\", reason);\n });\n }\n\n /**\n * @private\n */\n _cancelRendering() {\n for (const thumbnail of this._thumbnails) {\n thumbnail.cancelRendering();\n }\n }\n\n /**\n * @param {Array|null} labels\n */\n setPageLabels(labels) {\n if (!this.pdfDocument) {\n return;\n }\n if (!labels) {\n this._pageLabels = null;\n } else if (\n !(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)\n ) {\n this._pageLabels = null;\n console.error(\"PDFThumbnailViewer_setPageLabels: Invalid page labels.\");\n } else {\n this._pageLabels = labels;\n }\n // Update all the `PDFThumbnailView` instances.\n for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {\n this._thumbnails[i].setPageLabel(this._pageLabels?.[i] ?? null);\n }\n }\n\n /**\n * @param {PDFThumbnailView} thumbView\n * @returns {Promise<PDFPageProxy | null>}\n */\n async #ensurePdfPageLoaded(thumbView) {\n if (thumbView.pdfPage) {\n return thumbView.pdfPage;\n }\n try {\n const pdfPage = await this.pdfDocument.getPage(thumbView.id);\n if (!thumbView.pdfPage) {\n thumbView.setPdfPage(pdfPage);\n }\n return pdfPage;\n } catch (reason) {\n console.error(\"Unable to get page for thumb view\", reason);\n return null; // Page error -- there is nothing that can be done.\n }\n }\n\n #getScrollAhead(visible) {\n if (visible.first?.id === 1) {\n return true;\n } else if (visible.last?.id === this._thumbnails.length) {\n return false;\n }\n return this.scroll.down;\n }\n\n forceRendering() {\n const visibleThumbs = this._getVisibleThumbs();\n const scrollAhead = this.#getScrollAhead(visibleThumbs);\n const thumbView = this.renderingQueue.getHighestPriority(\n visibleThumbs,\n this._thumbnails,\n scrollAhead\n );\n if (thumbView) {\n this.#ensurePdfPageLoaded(thumbView).then(() => {\n this.renderingQueue.renderView(thumbView);\n });\n return true;\n }\n return false;\n }\n}\n\nexport { PDFThumbnailViewer };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n/** @typedef {import(\"./interfaces\").IRenderableView} IRenderableView */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_rendering_queue\").PDFRenderingQueue} PDFRenderingQueue */\n\nimport { OutputScale, RenderingStates } from \"./ui_utils.js\";\nimport { RenderingCancelledException } from \"pdfjs-lib\";\n\nconst DRAW_UPSCALE_FACTOR = 2; // See comment in `PDFThumbnailView.draw` below.\nconst MAX_NUM_SCALING_STEPS = 3;\nconst THUMBNAIL_WIDTH = 98; // px\n\n/**\n * @typedef {Object} PDFThumbnailViewOptions\n * @property {HTMLDivElement} container - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} id - The thumbnail's unique ID (normally its number).\n * @property {PageViewport} defaultViewport - The page viewport.\n * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -\n * A promise that is resolved with an {@link OptionalContentConfig} instance.\n * The default value is `null`.\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {PDFRenderingQueue} renderingQueue - The rendering queue object.\n * @property {IL10n} l10n - Localization service.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n */\n\nclass TempImageFactory {\n static #tempCanvas = null;\n\n static getCanvas(width, height) {\n const tempCanvas = (this.#tempCanvas ||= document.createElement(\"canvas\"));\n tempCanvas.width = width;\n tempCanvas.height = height;\n\n // Since this is a temporary canvas, we need to fill it with a white\n // background ourselves. `_getPageDrawContext` uses CSS rules for this.\n const ctx = tempCanvas.getContext(\"2d\", { alpha: false });\n ctx.save();\n ctx.fillStyle = \"rgb(255, 255, 255)\";\n ctx.fillRect(0, 0, width, height);\n ctx.restore();\n return [tempCanvas, tempCanvas.getContext(\"2d\")];\n }\n\n static destroyCanvas() {\n const tempCanvas = this.#tempCanvas;\n if (tempCanvas) {\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n tempCanvas.width = 0;\n tempCanvas.height = 0;\n }\n this.#tempCanvas = null;\n }\n}\n\n/**\n * @implements {IRenderableView}\n */\nclass PDFThumbnailView {\n /**\n * @param {PDFThumbnailViewOptions} options\n */\n constructor({\n container,\n eventBus,\n id,\n defaultViewport,\n optionalContentConfigPromise,\n linkService,\n renderingQueue,\n l10n,\n pageColors,\n }) {\n this.id = id;\n this.renderingId = \"thumbnail\" + id;\n this.pageLabel = null;\n\n this.pdfPage = null;\n this.rotation = 0;\n this.viewport = defaultViewport;\n this.pdfPageRotate = defaultViewport.rotation;\n this._optionalContentConfigPromise = optionalContentConfigPromise || null;\n this.pageColors = pageColors || null;\n\n this.eventBus = eventBus;\n this.linkService = linkService;\n this.renderingQueue = renderingQueue;\n\n this.renderTask = null;\n this.renderingState = RenderingStates.INITIAL;\n this.resume = null;\n this.l10n = l10n;\n\n const anchor = document.createElement(\"a\");\n anchor.href = linkService.getAnchorUrl(\"#page=\" + id);\n this._thumbPageTitle.then(msg => {\n anchor.title = msg;\n });\n anchor.onclick = function () {\n linkService.goToPage(id);\n return false;\n };\n this.anchor = anchor;\n\n const div = document.createElement(\"div\");\n div.className = \"thumbnail\";\n div.setAttribute(\"data-page-number\", this.id);\n this.div = div;\n this.#updateDims();\n\n const img = document.createElement(\"div\");\n img.className = \"thumbnailImage\";\n this._placeholderImg = img;\n\n div.append(img);\n anchor.append(div);\n container.append(anchor);\n }\n\n #updateDims() {\n const { width, height } = this.viewport;\n const ratio = width / height;\n\n this.canvasWidth = THUMBNAIL_WIDTH;\n this.canvasHeight = (this.canvasWidth / ratio) | 0;\n this.scale = this.canvasWidth / width;\n\n const { style } = this.div;\n style.setProperty(\"--thumbnail-width\", `${this.canvasWidth}px`);\n style.setProperty(\"--thumbnail-height\", `${this.canvasHeight}px`);\n }\n\n setPdfPage(pdfPage) {\n this.pdfPage = pdfPage;\n this.pdfPageRotate = pdfPage.rotate;\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = pdfPage.getViewport({ scale: 1, rotation: totalRotation });\n this.reset();\n }\n\n reset() {\n this.cancelRendering();\n this.renderingState = RenderingStates.INITIAL;\n\n this.div.removeAttribute(\"data-loaded\");\n this.image?.replaceWith(this._placeholderImg);\n this.#updateDims();\n\n if (this.image) {\n this.image.removeAttribute(\"src\");\n delete this.image;\n }\n }\n\n update({ rotation = null }) {\n if (typeof rotation === \"number\") {\n this.rotation = rotation; // The rotation may be zero.\n }\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = this.viewport.clone({\n scale: 1,\n rotation: totalRotation,\n });\n this.reset();\n }\n\n /**\n * PLEASE NOTE: Most likely you want to use the `this.reset()` method,\n * rather than calling this one directly.\n */\n cancelRendering() {\n if (this.renderTask) {\n this.renderTask.cancel();\n this.renderTask = null;\n }\n this.resume = null;\n }\n\n /**\n * @private\n */\n _getPageDrawContext(upscaleFactor = 1) {\n // Keep the no-thumbnail outline visible, i.e. `data-loaded === false`,\n // until rendering/image conversion is complete, to avoid display issues.\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\", { alpha: false });\n const outputScale = new OutputScale();\n\n canvas.width = (upscaleFactor * this.canvasWidth * outputScale.sx) | 0;\n canvas.height = (upscaleFactor * this.canvasHeight * outputScale.sy) | 0;\n\n const transform = outputScale.scaled\n ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0]\n : null;\n\n return { ctx, canvas, transform };\n }\n\n /**\n * @private\n */\n _convertCanvasToImage(canvas) {\n if (this.renderingState !== RenderingStates.FINISHED) {\n throw new Error(\"_convertCanvasToImage: Rendering has not finished.\");\n }\n const reducedCanvas = this._reduceImage(canvas);\n\n const image = document.createElement(\"img\");\n image.className = \"thumbnailImage\";\n this._thumbPageCanvas.then(msg => {\n image.setAttribute(\"aria-label\", msg);\n });\n image.src = reducedCanvas.toDataURL();\n this.image = image;\n\n this.div.setAttribute(\"data-loaded\", true);\n this._placeholderImg.replaceWith(image);\n\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n reducedCanvas.width = 0;\n reducedCanvas.height = 0;\n }\n\n async #finishRenderTask(renderTask, canvas, error = null) {\n // The renderTask may have been replaced by a new one, so only remove\n // the reference to the renderTask if it matches the one that is\n // triggering this callback.\n if (renderTask === this.renderTask) {\n this.renderTask = null;\n }\n\n if (error instanceof RenderingCancelledException) {\n return;\n }\n this.renderingState = RenderingStates.FINISHED;\n this._convertCanvasToImage(canvas);\n\n if (error) {\n throw error;\n }\n }\n\n async draw() {\n if (this.renderingState !== RenderingStates.INITIAL) {\n console.error(\"Must be in new state before drawing\");\n return undefined;\n }\n const { pdfPage } = this;\n\n if (!pdfPage) {\n this.renderingState = RenderingStates.FINISHED;\n throw new Error(\"pdfPage is not loaded\");\n }\n\n this.renderingState = RenderingStates.RUNNING;\n\n // Render the thumbnail at a larger size and downsize the canvas (similar\n // to `setImage`), to improve consistency between thumbnails created by\n // the `draw` and `setImage` methods (fixes issue 8233).\n // NOTE: To primarily avoid increasing memory usage too much, but also to\n // reduce downsizing overhead, we purposely limit the up-scaling factor.\n const { ctx, canvas, transform } =\n this._getPageDrawContext(DRAW_UPSCALE_FACTOR);\n const drawViewport = this.viewport.clone({\n scale: DRAW_UPSCALE_FACTOR * this.scale,\n });\n const renderContinueCallback = cont => {\n if (!this.renderingQueue.isHighestPriority(this)) {\n this.renderingState = RenderingStates.PAUSED;\n this.resume = () => {\n this.renderingState = RenderingStates.RUNNING;\n cont();\n };\n return;\n }\n cont();\n };\n\n const renderContext = {\n canvasContext: ctx,\n transform,\n viewport: drawViewport,\n optionalContentConfigPromise: this._optionalContentConfigPromise,\n pageColors: this.pageColors,\n };\n const renderTask = (this.renderTask = pdfPage.render(renderContext));\n renderTask.onContinue = renderContinueCallback;\n\n const resultPromise = renderTask.promise.then(\n () => this.#finishRenderTask(renderTask, canvas),\n error => this.#finishRenderTask(renderTask, canvas, error)\n );\n resultPromise.finally(() => {\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n canvas.width = 0;\n canvas.height = 0;\n\n this.eventBus.dispatch(\"thumbnailrendered\", {\n source: this,\n pageNumber: this.id,\n pdfPage: this.pdfPage,\n });\n });\n\n return resultPromise;\n }\n\n setImage(pageView) {\n if (this.renderingState !== RenderingStates.INITIAL) {\n return;\n }\n const { thumbnailCanvas: canvas, pdfPage, scale } = pageView;\n if (!canvas) {\n return;\n }\n if (!this.pdfPage) {\n this.setPdfPage(pdfPage);\n }\n if (scale < this.scale) {\n // Avoid upscaling the image, since that makes the thumbnail look blurry.\n return;\n }\n this.renderingState = RenderingStates.FINISHED;\n this._convertCanvasToImage(canvas);\n }\n\n /**\n * @private\n */\n _reduceImage(img) {\n const { ctx, canvas } = this._getPageDrawContext();\n\n if (img.width <= 2 * canvas.width) {\n ctx.drawImage(\n img,\n 0,\n 0,\n img.width,\n img.height,\n 0,\n 0,\n canvas.width,\n canvas.height\n );\n return canvas;\n }\n // drawImage does an awful job of rescaling the image, doing it gradually.\n let reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS;\n let reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS;\n const [reducedImage, reducedImageCtx] = TempImageFactory.getCanvas(\n reducedWidth,\n reducedHeight\n );\n\n while (reducedWidth > img.width || reducedHeight > img.height) {\n reducedWidth >>= 1;\n reducedHeight >>= 1;\n }\n reducedImageCtx.drawImage(\n img,\n 0,\n 0,\n img.width,\n img.height,\n 0,\n 0,\n reducedWidth,\n reducedHeight\n );\n while (reducedWidth > 2 * canvas.width) {\n reducedImageCtx.drawImage(\n reducedImage,\n 0,\n 0,\n reducedWidth,\n reducedHeight,\n 0,\n 0,\n reducedWidth >> 1,\n reducedHeight >> 1\n );\n reducedWidth >>= 1;\n reducedHeight >>= 1;\n }\n ctx.drawImage(\n reducedImage,\n 0,\n 0,\n reducedWidth,\n reducedHeight,\n 0,\n 0,\n canvas.width,\n canvas.height\n );\n return canvas;\n }\n\n get _thumbPageTitle() {\n return this.l10n.get(\"thumb_page_title\", {\n page: this.pageLabel ?? this.id,\n });\n }\n\n get _thumbPageCanvas() {\n return this.l10n.get(\"thumb_page_canvas\", {\n page: this.pageLabel ?? this.id,\n });\n }\n\n /**\n * @param {string|null} label\n */\n setPageLabel(label) {\n this.pageLabel = typeof label === \"string\" ? label : null;\n\n this._thumbPageTitle.then(msg => {\n this.anchor.title = msg;\n });\n\n if (this.renderingState !== RenderingStates.FINISHED) {\n return;\n }\n\n this._thumbPageCanvas.then(msg => {\n this.image?.setAttribute(\"aria-label\", msg);\n });\n }\n}\n\nexport { PDFThumbnailView, TempImageFactory };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/optional_content_config\").OptionalContentConfig} OptionalContentConfig */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IDownloadManager} IDownloadManager */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport {\n AnnotationEditorType,\n AnnotationEditorUIManager,\n AnnotationMode,\n PermissionFlag,\n PixelsPerInch,\n PromiseCapability,\n version,\n} from \"pdfjs-lib\";\nimport {\n DEFAULT_SCALE,\n DEFAULT_SCALE_DELTA,\n DEFAULT_SCALE_VALUE,\n docStyle,\n getVisibleElements,\n isPortraitOrientation,\n isValidRotation,\n isValidScrollMode,\n isValidSpreadMode,\n MAX_AUTO_SCALE,\n MAX_SCALE,\n MIN_SCALE,\n PresentationModeState,\n removeNullCharacters,\n RenderingStates,\n SCROLLBAR_PADDING,\n scrollIntoView,\n ScrollMode,\n SpreadMode,\n TextLayerMode,\n UNKNOWN_SCALE,\n VERTICAL_PADDING,\n watchScroll,\n} from \"./ui_utils.js\";\nimport { NullL10n } from \"./l10n_utils.js\";\nimport { PDFPageView } from \"./pdf_page_view.js\";\nimport { PDFRenderingQueue } from \"./pdf_rendering_queue.js\";\nimport { SimpleLinkService } from \"./pdf_link_service.js\";\n\nconst DEFAULT_CACHE_SIZE = 10;\n\nconst PagesCountLimit = {\n FORCE_SCROLL_MODE_PAGE: 15000,\n FORCE_LAZY_PAGE_INIT: 7500,\n PAUSE_EAGER_PAGE_INIT: 250,\n};\n\nfunction isValidAnnotationEditorMode(mode) {\n return (\n Object.values(AnnotationEditorType).includes(mode) &&\n mode !== AnnotationEditorType.DISABLE\n );\n}\n\n/**\n * @typedef {Object} PDFViewerOptions\n * @property {HTMLDivElement} container - The container for the viewer element.\n * @property {HTMLDivElement} [viewer] - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {IPDFLinkService} [linkService] - The navigation/linking service.\n * @property {IDownloadManager} [downloadManager] - The download manager\n * component.\n * @property {PDFFindController} [findController] - The find controller\n * component.\n * @property {PDFScriptingManager} [scriptingManager] - The scripting manager\n * component.\n * @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object.\n * @property {boolean} [removePageBorders] - Removes the border shadow around\n * the pages. The default value is `false`.\n * @property {number} [textLayerMode] - Controls if the text layer used for\n * selection and searching is created. The constants from {TextLayerMode}\n * should be used. The default value is `TextLayerMode.ENABLE`.\n * @property {number} [annotationMode] - Controls if the annotation layer is\n * created, and if interactive form elements or `AnnotationStorage`-data are\n * being rendered. The constants from {@link AnnotationMode} should be used;\n * see also {@link RenderParameters} and {@link GetOperatorListParameters}.\n * The default value is `AnnotationMode.ENABLE_FORMS`.\n * @property {number} [annotationEditorMode] - Enables the creation and editing\n * of new Annotations. The constants from {@link AnnotationEditorType} should\n * be used. The default value is `AnnotationEditorType.NONE`.\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * mainly for annotation icons. Include trailing slash.\n * @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of\n * landscape pages upon printing. The default is `false`.\n * @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default\n * value is `false`.\n * @property {boolean} [isOffscreenCanvasSupported] - Allows to use an\n * OffscreenCanvas if needed.\n * @property {number} [maxCanvasPixels] - The maximum supported canvas size in\n * total pixels, i.e. width * height. Use -1 for no limit. The default value\n * is 4096 * 4096 (16 mega-pixels).\n * @property {IL10n} [l10n] - Localization service.\n * @property {boolean} [enablePermissions] - Enables PDF document permissions,\n * when they exist. The default value is `false`.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n */\n\nclass PDFPageViewBuffer {\n // Here we rely on the fact that `Set`s preserve the insertion order.\n #buf = new Set();\n\n #size = 0;\n\n constructor(size) {\n this.#size = size;\n }\n\n push(view) {\n const buf = this.#buf;\n if (buf.has(view)) {\n buf.delete(view); // Move the view to the \"end\" of the buffer.\n }\n buf.add(view);\n\n if (buf.size > this.#size) {\n this.#destroyFirstView();\n }\n }\n\n /**\n * After calling resize, the size of the buffer will be `newSize`.\n * The optional parameter `idsToKeep` is, if present, a Set of page-ids to\n * push to the back of the buffer, delaying their destruction. The size of\n * `idsToKeep` has no impact on the final size of the buffer; if `idsToKeep`\n * is larger than `newSize`, some of those pages will be destroyed anyway.\n */\n resize(newSize, idsToKeep = null) {\n this.#size = newSize;\n\n const buf = this.#buf;\n if (idsToKeep) {\n const ii = buf.size;\n let i = 1;\n for (const view of buf) {\n if (idsToKeep.has(view.id)) {\n buf.delete(view); // Move the view to the \"end\" of the buffer.\n buf.add(view);\n }\n if (++i > ii) {\n break;\n }\n }\n }\n\n while (buf.size > this.#size) {\n this.#destroyFirstView();\n }\n }\n\n has(view) {\n return this.#buf.has(view);\n }\n\n [Symbol.iterator]() {\n return this.#buf.keys();\n }\n\n #destroyFirstView() {\n const firstView = this.#buf.keys().next().value;\n\n firstView?.destroy();\n this.#buf.delete(firstView);\n }\n}\n\n/**\n * Simple viewer control to display PDF content/pages.\n */\nclass PDFViewer {\n #buffer = null;\n\n #annotationEditorMode = AnnotationEditorType.NONE;\n\n #annotationEditorUIManager = null;\n\n #annotationMode = AnnotationMode.ENABLE_FORMS;\n\n #containerTopLeft = null;\n\n #copyCallbackBound = null;\n\n #enablePermissions = false;\n\n #getAllTextInProgress = false;\n\n #hiddenCopyElement = null;\n\n #interruptCopyCondition = false;\n\n #previousContainerHeight = 0;\n\n #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this));\n\n #scrollModePageState = null;\n\n #onVisibilityChange = null;\n\n #scaleTimeoutId = null;\n\n #textLayerMode = TextLayerMode.ENABLE;\n\n /**\n * @param {PDFViewerOptions} options\n */\n constructor(options) {\n const viewerVersion =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : null;\n if (version !== viewerVersion) {\n throw new Error(\n `The API version \"${version}\" does not match the Viewer version \"${viewerVersion}\".`\n );\n }\n this.container = options.container;\n this.viewer = options.viewer || options.container.firstElementChild;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (this.container?.tagName !== \"DIV\" || this.viewer?.tagName !== \"DIV\") {\n throw new Error(\"Invalid `container` and/or `viewer` option.\");\n }\n\n if (\n this.container.offsetParent &&\n getComputedStyle(this.container).position !== \"absolute\"\n ) {\n throw new Error(\"The `container` must be absolutely positioned.\");\n }\n }\n this.#resizeObserver.observe(this.container);\n\n this.eventBus = options.eventBus;\n this.linkService = options.linkService || new SimpleLinkService();\n this.downloadManager = options.downloadManager || null;\n this.findController = options.findController || null;\n\n if (this.findController) {\n this.findController.onIsPageVisible = pageNumber =>\n this._getVisiblePages().ids.has(pageNumber);\n }\n this._scriptingManager = options.scriptingManager || null;\n this.#textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE;\n this.#annotationMode =\n options.annotationMode ?? AnnotationMode.ENABLE_FORMS;\n this.#annotationEditorMode =\n options.annotationEditorMode ?? AnnotationEditorType.NONE;\n this.imageResourcesPath = options.imageResourcesPath || \"\";\n this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this.removePageBorders = options.removePageBorders || false;\n }\n this.useOnlyCssZoom = options.useOnlyCssZoom || false;\n this.isOffscreenCanvasSupported =\n options.isOffscreenCanvasSupported ?? true;\n this.maxCanvasPixels = options.maxCanvasPixels;\n this.l10n = options.l10n || NullL10n;\n this.#enablePermissions = options.enablePermissions || false;\n this.pageColors = options.pageColors || null;\n\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n if (\n this.pageColors &&\n !(\n CSS.supports(\"color\", this.pageColors.background) &&\n CSS.supports(\"color\", this.pageColors.foreground)\n )\n ) {\n if (this.pageColors.background || this.pageColors.foreground) {\n console.warn(\n \"PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used.\"\n );\n }\n this.pageColors = null;\n }\n }\n\n this.defaultRenderingQueue = !options.renderingQueue;\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.defaultRenderingQueue\n ) {\n // Custom rendering queue is not specified, using default one\n this.renderingQueue = new PDFRenderingQueue();\n this.renderingQueue.setViewer(this);\n } else {\n this.renderingQueue = options.renderingQueue;\n }\n\n this.scroll = watchScroll(this.container, this._scrollUpdate.bind(this));\n this.presentationModeState = PresentationModeState.UNKNOWN;\n this._onBeforeDraw = this._onAfterDraw = null;\n this._resetView();\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.removePageBorders\n ) {\n this.viewer.classList.add(\"removePageBorders\");\n }\n\n this.#updateContainerHeightCss();\n\n // Trigger API-cleanup, once thumbnail rendering has finished,\n // if the relevant pageView is *not* cached in the buffer.\n this.eventBus._on(\"thumbnailrendered\", ({ pageNumber, pdfPage }) => {\n const pageView = this._pages[pageNumber - 1];\n if (!this.#buffer.has(pageView)) {\n pdfPage?.cleanup();\n }\n });\n }\n\n get pagesCount() {\n return this._pages.length;\n }\n\n getPageView(index) {\n return this._pages[index];\n }\n\n getCachedPageViews() {\n return new Set(this.#buffer);\n }\n\n /**\n * @type {boolean} - True if all {PDFPageView} objects are initialized.\n */\n get pageViewsReady() {\n // Prevent printing errors when 'disableAutoFetch' is set, by ensuring\n // that *all* pages have in fact been completely loaded.\n return (\n this._pagesCapability.settled &&\n this._pages.every(pageView => pageView?.pdfPage)\n );\n }\n\n /**\n * @type {boolean}\n */\n get renderForms() {\n return this.#annotationMode === AnnotationMode.ENABLE_FORMS;\n }\n\n /**\n * @type {boolean}\n */\n get enableScripting() {\n return !!this._scriptingManager;\n }\n\n /**\n * @type {number}\n */\n get currentPageNumber() {\n return this._currentPageNumber;\n }\n\n /**\n * @param {number} val - The page number.\n */\n set currentPageNumber(val) {\n if (!Number.isInteger(val)) {\n throw new Error(\"Invalid page number.\");\n }\n if (!this.pdfDocument) {\n return;\n }\n // The intent can be to just reset a scroll position and/or scale.\n if (!this._setCurrentPageNumber(val, /* resetCurrentPageView = */ true)) {\n console.error(`currentPageNumber: \"${val}\" is not a valid page.`);\n }\n }\n\n /**\n * @returns {boolean} Whether the pageNumber is valid (within bounds).\n * @private\n */\n _setCurrentPageNumber(val, resetCurrentPageView = false) {\n if (this._currentPageNumber === val) {\n if (resetCurrentPageView) {\n this.#resetCurrentPageView();\n }\n return true;\n }\n\n if (!(0 < val && val <= this.pagesCount)) {\n return false;\n }\n const previous = this._currentPageNumber;\n this._currentPageNumber = val;\n\n this.eventBus.dispatch(\"pagechanging\", {\n source: this,\n pageNumber: val,\n pageLabel: this._pageLabels?.[val - 1] ?? null,\n previous,\n });\n\n if (resetCurrentPageView) {\n this.#resetCurrentPageView();\n }\n return true;\n }\n\n /**\n * @type {string|null} Returns the current page label, or `null` if no page\n * labels exist.\n */\n get currentPageLabel() {\n return this._pageLabels?.[this._currentPageNumber - 1] ?? null;\n }\n\n /**\n * @param {string} val - The page label.\n */\n set currentPageLabel(val) {\n if (!this.pdfDocument) {\n return;\n }\n let page = val | 0; // Fallback page number.\n if (this._pageLabels) {\n const i = this._pageLabels.indexOf(val);\n if (i >= 0) {\n page = i + 1;\n }\n }\n // The intent can be to just reset a scroll position and/or scale.\n if (!this._setCurrentPageNumber(page, /* resetCurrentPageView = */ true)) {\n console.error(`currentPageLabel: \"${val}\" is not a valid page.`);\n }\n }\n\n /**\n * @type {number}\n */\n get currentScale() {\n return this._currentScale !== UNKNOWN_SCALE\n ? this._currentScale\n : DEFAULT_SCALE;\n }\n\n /**\n * @param {number} val - Scale of the pages in percents.\n */\n set currentScale(val) {\n if (isNaN(val)) {\n throw new Error(\"Invalid numeric scale.\");\n }\n if (!this.pdfDocument) {\n return;\n }\n this.#setScale(val, { noScroll: false });\n }\n\n /**\n * @type {string}\n */\n get currentScaleValue() {\n return this._currentScaleValue;\n }\n\n /**\n * @param val - The scale of the pages (in percent or predefined value).\n */\n set currentScaleValue(val) {\n if (!this.pdfDocument) {\n return;\n }\n this.#setScale(val, { noScroll: false });\n }\n\n /**\n * @type {number}\n */\n get pagesRotation() {\n return this._pagesRotation;\n }\n\n /**\n * @param {number} rotation - The rotation of the pages (0, 90, 180, 270).\n */\n set pagesRotation(rotation) {\n if (!isValidRotation(rotation)) {\n throw new Error(\"Invalid pages rotation angle.\");\n }\n if (!this.pdfDocument) {\n return;\n }\n // Normalize the rotation, by clamping it to the [0, 360) range.\n rotation %= 360;\n if (rotation < 0) {\n rotation += 360;\n }\n if (this._pagesRotation === rotation) {\n return; // The rotation didn't change.\n }\n this._pagesRotation = rotation;\n\n const pageNumber = this._currentPageNumber;\n\n this.refresh(true, { rotation });\n\n // Prevent errors in case the rotation changes *before* the scale has been\n // set to a non-default value.\n if (this._currentScaleValue) {\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n\n this.eventBus.dispatch(\"rotationchanging\", {\n source: this,\n pagesRotation: rotation,\n pageNumber,\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n }\n\n get firstPagePromise() {\n return this.pdfDocument ? this._firstPageCapability.promise : null;\n }\n\n get onePageRendered() {\n return this.pdfDocument ? this._onePageRenderedCapability.promise : null;\n }\n\n get pagesPromise() {\n return this.pdfDocument ? this._pagesCapability.promise : null;\n }\n\n #layerProperties() {\n const self = this;\n return {\n get annotationEditorUIManager() {\n return self.#annotationEditorUIManager;\n },\n get annotationStorage() {\n return self.pdfDocument?.annotationStorage;\n },\n get downloadManager() {\n return self.downloadManager;\n },\n get enableScripting() {\n return !!self._scriptingManager;\n },\n get fieldObjectsPromise() {\n return self.pdfDocument?.getFieldObjects();\n },\n get findController() {\n return self.findController;\n },\n get hasJSActionsPromise() {\n return self.pdfDocument?.hasJSActions();\n },\n get linkService() {\n return self.linkService;\n },\n };\n }\n\n /**\n * Currently only *some* permissions are supported.\n * @returns {Object}\n */\n #initializePermissions(permissions) {\n const params = {\n annotationEditorMode: this.#annotationEditorMode,\n annotationMode: this.#annotationMode,\n textLayerMode: this.#textLayerMode,\n };\n if (!permissions) {\n return params;\n }\n\n if (\n !permissions.includes(PermissionFlag.COPY) &&\n this.#textLayerMode === TextLayerMode.ENABLE\n ) {\n params.textLayerMode = TextLayerMode.ENABLE_PERMISSIONS;\n }\n\n if (!permissions.includes(PermissionFlag.MODIFY_CONTENTS)) {\n params.annotationEditorMode = AnnotationEditorType.DISABLE;\n }\n\n if (\n !permissions.includes(PermissionFlag.MODIFY_ANNOTATIONS) &&\n !permissions.includes(PermissionFlag.FILL_INTERACTIVE_FORMS) &&\n this.#annotationMode === AnnotationMode.ENABLE_FORMS\n ) {\n params.annotationMode = AnnotationMode.ENABLE;\n }\n\n return params;\n }\n\n #onePageRenderedOrForceFetch() {\n // Unless the viewer *and* its pages are visible, rendering won't start and\n // `this._onePageRenderedCapability` thus won't be resolved.\n // To ensure that automatic printing, on document load, still works even in\n // those cases we force-allow fetching of all pages when:\n // - The current window/tab is inactive, which will prevent rendering since\n // `requestAnimationFrame` is being used; fixes bug 1746213.\n // - The viewer is hidden in the DOM, e.g. in a `display: none` <iframe>\n // element; fixes bug 1618621.\n // - The viewer is visible, but none of the pages are (e.g. if the\n // viewer is very small); fixes bug 1618955.\n if (\n document.visibilityState === \"hidden\" ||\n !this.container.offsetParent ||\n this._getVisiblePages().views.length === 0\n ) {\n return Promise.resolve();\n }\n\n // Handle the window/tab becoming inactive *after* rendering has started;\n // fixes (another part of) bug 1746213.\n const visibilityChangePromise = new Promise(resolve => {\n this.#onVisibilityChange = () => {\n if (document.visibilityState !== \"hidden\") {\n return;\n }\n resolve();\n\n document.removeEventListener(\n \"visibilitychange\",\n this.#onVisibilityChange\n );\n this.#onVisibilityChange = null;\n };\n document.addEventListener(\"visibilitychange\", this.#onVisibilityChange);\n });\n\n return Promise.race([\n this._onePageRenderedCapability.promise,\n visibilityChangePromise,\n ]);\n }\n\n async getAllText() {\n const texts = [];\n const buffer = [];\n for (\n let pageNum = 1, pagesCount = this.pdfDocument.numPages;\n pageNum <= pagesCount;\n ++pageNum\n ) {\n if (this.#interruptCopyCondition) {\n return null;\n }\n buffer.length = 0;\n const page = await this.pdfDocument.getPage(pageNum);\n // By default getTextContent pass disableNormalization equals to false\n // which is fine because we want a normalized string.\n const { items } = await page.getTextContent();\n for (const item of items) {\n if (item.str) {\n buffer.push(item.str);\n }\n if (item.hasEOL) {\n buffer.push(\"\\n\");\n }\n }\n texts.push(removeNullCharacters(buffer.join(\"\")));\n }\n\n return texts.join(\"\\n\");\n }\n\n #copyCallback(textLayerMode, event) {\n const selection = document.getSelection();\n const { focusNode, anchorNode } = selection;\n if (\n anchorNode &&\n focusNode &&\n selection.containsNode(this.#hiddenCopyElement)\n ) {\n // About the condition above:\n // - having non-null anchorNode and focusNode are here to guaranty that\n // we have at least a kind of selection.\n // - this.#hiddenCopyElement is an invisible element which is impossible\n // to select manually (its display is none) but ctrl+A will select all\n // including this element so having it in the selection means that all\n // has been selected.\n\n if (\n this.#getAllTextInProgress ||\n textLayerMode === TextLayerMode.ENABLE_PERMISSIONS\n ) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n this.#getAllTextInProgress = true;\n\n // TODO: if all the pages are rendered we don't need to wait for\n // getAllText and we could just get text from the Selection object.\n\n // Select all the document.\n const savedCursor = this.container.style.cursor;\n this.container.style.cursor = \"wait\";\n\n const interruptCopy = ev =>\n (this.#interruptCopyCondition = ev.key === \"Escape\");\n window.addEventListener(\"keydown\", interruptCopy);\n\n this.getAllText()\n .then(async text => {\n if (text !== null) {\n await navigator.clipboard.writeText(text);\n }\n })\n .catch(reason => {\n console.warn(\n `Something goes wrong when extracting the text: ${reason.message}`\n );\n })\n .finally(() => {\n this.#getAllTextInProgress = false;\n this.#interruptCopyCondition = false;\n window.removeEventListener(\"keydown\", interruptCopy);\n this.container.style.cursor = savedCursor;\n });\n\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n /**\n * @param {PDFDocumentProxy} pdfDocument\n */\n setDocument(pdfDocument) {\n if (this.pdfDocument) {\n this.eventBus.dispatch(\"pagesdestroy\", { source: this });\n\n this._cancelRendering();\n this._resetView();\n\n this.findController?.setDocument(null);\n this._scriptingManager?.setDocument(null);\n\n if (this.#annotationEditorUIManager) {\n this.#annotationEditorUIManager.destroy();\n this.#annotationEditorUIManager = null;\n }\n }\n\n this.pdfDocument = pdfDocument;\n if (!pdfDocument) {\n return;\n }\n const pagesCount = pdfDocument.numPages;\n const firstPagePromise = pdfDocument.getPage(1);\n // Rendering (potentially) depends on this, hence fetching it immediately.\n const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();\n const permissionsPromise = this.#enablePermissions\n ? pdfDocument.getPermissions()\n : Promise.resolve();\n\n // Given that browsers don't handle huge amounts of DOM-elements very well,\n // enforce usage of PAGE-scrolling when loading *very* long/large documents.\n if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {\n console.warn(\n \"Forcing PAGE-scrolling for performance reasons, given the length of the document.\"\n );\n const mode = (this._scrollMode = ScrollMode.PAGE);\n this.eventBus.dispatch(\"scrollmodechanged\", { source: this, mode });\n }\n\n this._pagesCapability.promise.then(\n () => {\n this.eventBus.dispatch(\"pagesloaded\", { source: this, pagesCount });\n },\n () => {\n /* Prevent \"Uncaught (in promise)\"-messages in the console. */\n }\n );\n\n this._onBeforeDraw = evt => {\n const pageView = this._pages[evt.pageNumber - 1];\n if (!pageView) {\n return;\n }\n // Add the page to the buffer at the start of drawing. That way it can be\n // evicted from the buffer and destroyed even if we pause its rendering.\n this.#buffer.push(pageView);\n };\n this.eventBus._on(\"pagerender\", this._onBeforeDraw);\n\n this._onAfterDraw = evt => {\n if (evt.cssTransform || this._onePageRenderedCapability.settled) {\n return;\n }\n this._onePageRenderedCapability.resolve({ timestamp: evt.timestamp });\n\n this.eventBus._off(\"pagerendered\", this._onAfterDraw);\n this._onAfterDraw = null;\n\n if (this.#onVisibilityChange) {\n document.removeEventListener(\n \"visibilitychange\",\n this.#onVisibilityChange\n );\n this.#onVisibilityChange = null;\n }\n };\n this.eventBus._on(\"pagerendered\", this._onAfterDraw);\n\n // Fetch a single page so we can get a viewport that will be the default\n // viewport for all pages\n Promise.all([firstPagePromise, permissionsPromise])\n .then(([firstPdfPage, permissions]) => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the first page resolved.\n }\n this._firstPageCapability.resolve(firstPdfPage);\n this._optionalContentConfigPromise = optionalContentConfigPromise;\n\n const { annotationEditorMode, annotationMode, textLayerMode } =\n this.#initializePermissions(permissions);\n\n if (textLayerMode !== TextLayerMode.DISABLE) {\n const element = (this.#hiddenCopyElement =\n document.createElement(\"div\"));\n element.id = \"hiddenCopyElement\";\n this.viewer.before(element);\n }\n\n if (annotationEditorMode !== AnnotationEditorType.DISABLE) {\n const mode = annotationEditorMode;\n\n if (pdfDocument.isPureXfa) {\n console.warn(\"Warning: XFA-editing is not implemented.\");\n } else if (isValidAnnotationEditorMode(mode)) {\n this.#annotationEditorUIManager = new AnnotationEditorUIManager(\n this.container,\n this.eventBus,\n pdfDocument?.annotationStorage\n );\n if (mode !== AnnotationEditorType.NONE) {\n this.#annotationEditorUIManager.updateMode(mode);\n }\n } else {\n console.error(`Invalid AnnotationEditor mode: ${mode}`);\n }\n }\n\n const layerProperties = this.#layerProperties.bind(this);\n const viewerElement =\n this._scrollMode === ScrollMode.PAGE ? null : this.viewer;\n const scale = this.currentScale;\n const viewport = firstPdfPage.getViewport({\n scale: scale * PixelsPerInch.PDF_TO_CSS_UNITS,\n });\n // Ensure that the various layers always get the correct initial size,\n // see issue 15795.\n this.viewer.style.setProperty(\"--scale-factor\", viewport.scale);\n\n for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {\n const pageView = new PDFPageView({\n container: viewerElement,\n eventBus: this.eventBus,\n id: pageNum,\n scale,\n defaultViewport: viewport.clone(),\n optionalContentConfigPromise,\n renderingQueue: this.renderingQueue,\n textLayerMode,\n annotationMode,\n imageResourcesPath: this.imageResourcesPath,\n useOnlyCssZoom: this.useOnlyCssZoom,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n maxCanvasPixels: this.maxCanvasPixels,\n pageColors: this.pageColors,\n l10n: this.l10n,\n layerProperties,\n });\n this._pages.push(pageView);\n }\n // Set the first `pdfPage` immediately, since it's already loaded,\n // rather than having to repeat the `PDFDocumentProxy.getPage` call in\n // the `this.#ensurePdfPageLoaded` method before rendering can start.\n const firstPageView = this._pages[0];\n if (firstPageView) {\n firstPageView.setPdfPage(firstPdfPage);\n this.linkService.cachePageRef(1, firstPdfPage.ref);\n }\n\n if (this._scrollMode === ScrollMode.PAGE) {\n // Ensure that the current page becomes visible on document load.\n this.#ensurePageViewVisible();\n } else if (this._spreadMode !== SpreadMode.NONE) {\n this._updateSpreadMode();\n }\n\n // Fetch all the pages since the viewport is needed before printing\n // starts to create the correct size canvas. Wait until one page is\n // rendered so we don't tie up too many resources early on.\n this.#onePageRenderedOrForceFetch().then(async () => {\n this.findController?.setDocument(pdfDocument); // Enable searching.\n this._scriptingManager?.setDocument(pdfDocument); // Enable scripting.\n\n if (this.#hiddenCopyElement) {\n this.#copyCallbackBound = this.#copyCallback.bind(\n this,\n textLayerMode\n );\n document.addEventListener(\"copy\", this.#copyCallbackBound);\n }\n\n if (this.#annotationEditorUIManager) {\n // Ensure that the Editor buttons, in the toolbar, are updated.\n this.eventBus.dispatch(\"annotationeditormodechanged\", {\n source: this,\n mode: this.#annotationEditorMode,\n });\n }\n\n // In addition to 'disableAutoFetch' being set, also attempt to reduce\n // resource usage when loading *very* long/large documents.\n if (\n pdfDocument.loadingParams.disableAutoFetch ||\n pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT\n ) {\n // XXX: Printing is semi-broken with auto fetch disabled.\n this._pagesCapability.resolve();\n return;\n }\n let getPagesLeft = pagesCount - 1; // The first page was already loaded.\n\n if (getPagesLeft <= 0) {\n this._pagesCapability.resolve();\n return;\n }\n for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) {\n const promise = pdfDocument.getPage(pageNum).then(\n pdfPage => {\n const pageView = this._pages[pageNum - 1];\n if (!pageView.pdfPage) {\n pageView.setPdfPage(pdfPage);\n }\n this.linkService.cachePageRef(pageNum, pdfPage.ref);\n if (--getPagesLeft === 0) {\n this._pagesCapability.resolve();\n }\n },\n reason => {\n console.error(\n `Unable to get page ${pageNum} to initialize viewer`,\n reason\n );\n if (--getPagesLeft === 0) {\n this._pagesCapability.resolve();\n }\n }\n );\n\n if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) {\n await promise;\n }\n }\n });\n\n this.eventBus.dispatch(\"pagesinit\", { source: this });\n\n pdfDocument.getMetadata().then(({ info }) => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the metadata resolved.\n }\n if (info.Language) {\n this.viewer.lang = info.Language;\n }\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n })\n .catch(reason => {\n console.error(\"Unable to initialize viewer\", reason);\n\n this._pagesCapability.reject(reason);\n });\n }\n\n /**\n * @param {Array|null} labels\n */\n setPageLabels(labels) {\n if (!this.pdfDocument) {\n return;\n }\n if (!labels) {\n this._pageLabels = null;\n } else if (\n !(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)\n ) {\n this._pageLabels = null;\n console.error(`setPageLabels: Invalid page labels.`);\n } else {\n this._pageLabels = labels;\n }\n // Update all the `PDFPageView` instances.\n for (let i = 0, ii = this._pages.length; i < ii; i++) {\n this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null);\n }\n }\n\n _resetView() {\n this._pages = [];\n this._currentPageNumber = 1;\n this._currentScale = UNKNOWN_SCALE;\n this._currentScaleValue = null;\n this._pageLabels = null;\n this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);\n this._location = null;\n this._pagesRotation = 0;\n this._optionalContentConfigPromise = null;\n this._firstPageCapability = new PromiseCapability();\n this._onePageRenderedCapability = new PromiseCapability();\n this._pagesCapability = new PromiseCapability();\n this._scrollMode = ScrollMode.VERTICAL;\n this._previousScrollMode = ScrollMode.UNKNOWN;\n this._spreadMode = SpreadMode.NONE;\n\n this.#scrollModePageState = {\n previousPageNumber: 1,\n scrollDown: true,\n pages: [],\n };\n\n if (this._onBeforeDraw) {\n this.eventBus._off(\"pagerender\", this._onBeforeDraw);\n this._onBeforeDraw = null;\n }\n if (this._onAfterDraw) {\n this.eventBus._off(\"pagerendered\", this._onAfterDraw);\n this._onAfterDraw = null;\n }\n if (this.#onVisibilityChange) {\n document.removeEventListener(\n \"visibilitychange\",\n this.#onVisibilityChange\n );\n this.#onVisibilityChange = null;\n }\n // Remove the pages from the DOM...\n this.viewer.textContent = \"\";\n // ... and reset the Scroll mode CSS class(es) afterwards.\n this._updateScrollMode();\n\n this.viewer.removeAttribute(\"lang\");\n\n if (this.#hiddenCopyElement) {\n document.removeEventListener(\"copy\", this.#copyCallbackBound);\n this.#copyCallbackBound = null;\n\n this.#hiddenCopyElement.remove();\n this.#hiddenCopyElement = null;\n }\n }\n\n #ensurePageViewVisible() {\n if (this._scrollMode !== ScrollMode.PAGE) {\n throw new Error(\"#ensurePageViewVisible: Invalid scrollMode value.\");\n }\n const pageNumber = this._currentPageNumber,\n state = this.#scrollModePageState,\n viewer = this.viewer;\n\n // Temporarily remove all the pages from the DOM...\n viewer.textContent = \"\";\n // ... and clear out the active ones.\n state.pages.length = 0;\n\n if (this._spreadMode === SpreadMode.NONE && !this.isInPresentationMode) {\n // Finally, append the new page to the viewer.\n const pageView = this._pages[pageNumber - 1];\n viewer.append(pageView.div);\n\n state.pages.push(pageView);\n } else {\n const pageIndexSet = new Set(),\n parity = this._spreadMode - 1;\n\n // Determine the pageIndices in the new spread.\n if (parity === -1) {\n // PresentationMode is active, with `SpreadMode.NONE` set.\n pageIndexSet.add(pageNumber - 1);\n } else if (pageNumber % 2 !== parity) {\n // Left-hand side page.\n pageIndexSet.add(pageNumber - 1);\n pageIndexSet.add(pageNumber);\n } else {\n // Right-hand side page.\n pageIndexSet.add(pageNumber - 2);\n pageIndexSet.add(pageNumber - 1);\n }\n\n // Finally, append the new pages to the viewer and apply the spreadMode.\n const spread = document.createElement(\"div\");\n spread.className = \"spread\";\n\n if (this.isInPresentationMode) {\n const dummyPage = document.createElement(\"div\");\n dummyPage.className = \"dummyPage\";\n spread.append(dummyPage);\n }\n\n for (const i of pageIndexSet) {\n const pageView = this._pages[i];\n if (!pageView) {\n continue;\n }\n spread.append(pageView.div);\n\n state.pages.push(pageView);\n }\n viewer.append(spread);\n }\n\n state.scrollDown = pageNumber >= state.previousPageNumber;\n state.previousPageNumber = pageNumber;\n }\n\n _scrollUpdate() {\n if (this.pagesCount === 0) {\n return;\n }\n this.update();\n }\n\n #scrollIntoView(pageView, pageSpot = null) {\n const { div, id } = pageView;\n\n // Ensure that `this._currentPageNumber` is correct, when `#scrollIntoView`\n // is called directly (and not from `#resetCurrentPageView`).\n if (this._currentPageNumber !== id) {\n this._setCurrentPageNumber(id);\n }\n if (this._scrollMode === ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n // Ensure that rendering always occurs, to avoid showing a blank page,\n // even if the current position doesn't change when the page is scrolled.\n this.update();\n }\n\n if (!pageSpot && !this.isInPresentationMode) {\n const left = div.offsetLeft + div.clientLeft,\n right = left + div.clientWidth;\n const { scrollLeft, clientWidth } = this.container;\n if (\n this._scrollMode === ScrollMode.HORIZONTAL ||\n left < scrollLeft ||\n right > scrollLeft + clientWidth\n ) {\n pageSpot = { left: 0, top: 0 };\n }\n }\n scrollIntoView(div, pageSpot);\n\n // Ensure that the correct *initial* document position is set, when any\n // OpenParameters are used, for documents with non-default Scroll/Spread\n // modes (fixes issue 15695). This is necessary since the scroll-handler\n // invokes the `update`-method asynchronously, and `this._location` could\n // thus be wrong when the initial zooming occurs in the default viewer.\n if (!this._currentScaleValue && this._location) {\n this._location = null;\n }\n }\n\n /**\n * Prevent unnecessary re-rendering of all pages when the scale changes\n * only because of limited numerical precision.\n */\n #isSameScale(newScale) {\n return (\n newScale === this._currentScale ||\n Math.abs(newScale - this._currentScale) < 1e-15\n );\n }\n\n #setScaleUpdatePages(\n newScale,\n newValue,\n { noScroll = false, preset = false, drawingDelay = -1 }\n ) {\n this._currentScaleValue = newValue.toString();\n\n if (this.#isSameScale(newScale)) {\n if (preset) {\n this.eventBus.dispatch(\"scalechanging\", {\n source: this,\n scale: newScale,\n presetValue: newValue,\n });\n }\n return;\n }\n\n this.viewer.style.setProperty(\n \"--scale-factor\",\n newScale * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n\n const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000;\n this.refresh(true, {\n scale: newScale,\n drawingDelay: postponeDrawing ? drawingDelay : -1,\n });\n\n if (postponeDrawing) {\n this.#scaleTimeoutId = setTimeout(() => {\n this.#scaleTimeoutId = null;\n this.refresh();\n }, drawingDelay);\n }\n\n this._currentScale = newScale;\n\n if (!noScroll) {\n let page = this._currentPageNumber,\n dest;\n if (\n this._location &&\n !(this.isInPresentationMode || this.isChangingPresentationMode)\n ) {\n page = this._location.pageNumber;\n dest = [\n null,\n { name: \"XYZ\" },\n this._location.left,\n this._location.top,\n null,\n ];\n }\n this.scrollPageIntoView({\n pageNumber: page,\n destArray: dest,\n allowNegativeOffset: true,\n });\n }\n\n this.eventBus.dispatch(\"scalechanging\", {\n source: this,\n scale: newScale,\n presetValue: preset ? newValue : undefined,\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n }\n\n get #pageWidthScaleFactor() {\n if (\n this._spreadMode !== SpreadMode.NONE &&\n this._scrollMode !== ScrollMode.HORIZONTAL\n ) {\n return 2;\n }\n return 1;\n }\n\n #setScale(value, options) {\n let scale = parseFloat(value);\n\n if (scale > 0) {\n options.preset = false;\n this.#setScaleUpdatePages(scale, value, options);\n } else {\n const currentPage = this._pages[this._currentPageNumber - 1];\n if (!currentPage) {\n return;\n }\n let hPadding = SCROLLBAR_PADDING,\n vPadding = VERTICAL_PADDING;\n\n if (this.isInPresentationMode) {\n // Pages have a 2px (transparent) border in PresentationMode, see\n // the `web/pdf_viewer.css` file.\n hPadding = vPadding = 4; // 2 * 2px\n if (this._spreadMode !== SpreadMode.NONE) {\n // Account for two pages being visible in PresentationMode, thus\n // \"doubling\" the total border width.\n hPadding *= 2;\n }\n } else if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.removePageBorders\n ) {\n hPadding = vPadding = 0;\n } else if (this._scrollMode === ScrollMode.HORIZONTAL) {\n [hPadding, vPadding] = [vPadding, hPadding]; // Swap the padding values.\n }\n const pageWidthScale =\n (((this.container.clientWidth - hPadding) / currentPage.width) *\n currentPage.scale) /\n this.#pageWidthScaleFactor;\n const pageHeightScale =\n ((this.container.clientHeight - vPadding) / currentPage.height) *\n currentPage.scale;\n switch (value) {\n case \"page-actual\":\n scale = 1;\n break;\n case \"page-width\":\n scale = pageWidthScale;\n break;\n case \"page-height\":\n scale = pageHeightScale;\n break;\n case \"page-fit\":\n scale = Math.min(pageWidthScale, pageHeightScale);\n break;\n case \"auto\":\n // For pages in landscape mode, fit the page height to the viewer\n // *unless* the page would thus become too wide to fit horizontally.\n const horizontalScale = isPortraitOrientation(currentPage)\n ? pageWidthScale\n : Math.min(pageHeightScale, pageWidthScale);\n scale = Math.min(MAX_AUTO_SCALE, horizontalScale);\n break;\n default:\n console.error(`#setScale: \"${value}\" is an unknown zoom value.`);\n return;\n }\n options.preset = true;\n this.#setScaleUpdatePages(scale, value, options);\n }\n }\n\n /**\n * Refreshes page view: scrolls to the current page and updates the scale.\n */\n #resetCurrentPageView() {\n const pageView = this._pages[this._currentPageNumber - 1];\n\n if (this.isInPresentationMode) {\n // Fixes the case when PDF has different page sizes.\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n this.#scrollIntoView(pageView);\n }\n\n /**\n * @param {string} label - The page label.\n * @returns {number|null} The page number corresponding to the page label,\n * or `null` when no page labels exist and/or the input is invalid.\n */\n pageLabelToPageNumber(label) {\n if (!this._pageLabels) {\n return null;\n }\n const i = this._pageLabels.indexOf(label);\n if (i < 0) {\n return null;\n }\n return i + 1;\n }\n\n /**\n * @typedef {Object} ScrollPageIntoViewParameters\n * @property {number} pageNumber - The page number.\n * @property {Array} [destArray] - The original PDF destination array, in the\n * format: <page-ref> </XYZ|/FitXXX> <args..>\n * @property {boolean} [allowNegativeOffset] - Allow negative page offsets.\n * The default value is `false`.\n * @property {boolean} [ignoreDestinationZoom] - Ignore the zoom argument in\n * the destination array. The default value is `false`.\n */\n\n /**\n * Scrolls page into view.\n * @param {ScrollPageIntoViewParameters} params\n */\n scrollPageIntoView({\n pageNumber,\n destArray = null,\n allowNegativeOffset = false,\n ignoreDestinationZoom = false,\n }) {\n if (!this.pdfDocument) {\n return;\n }\n const pageView =\n Number.isInteger(pageNumber) && this._pages[pageNumber - 1];\n if (!pageView) {\n console.error(\n `scrollPageIntoView: \"${pageNumber}\" is not a valid pageNumber parameter.`\n );\n return;\n }\n\n if (this.isInPresentationMode || !destArray) {\n this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);\n return;\n }\n let x = 0,\n y = 0;\n let width = 0,\n height = 0,\n widthScale,\n heightScale;\n const changeOrientation = pageView.rotation % 180 !== 0;\n const pageWidth =\n (changeOrientation ? pageView.height : pageView.width) /\n pageView.scale /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n const pageHeight =\n (changeOrientation ? pageView.width : pageView.height) /\n pageView.scale /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n let scale = 0;\n switch (destArray[1].name) {\n case \"XYZ\":\n x = destArray[2];\n y = destArray[3];\n scale = destArray[4];\n // If x and/or y coordinates are not supplied, default to\n // _top_ left of the page (not the obvious bottom left,\n // since aligning the bottom of the intended page with the\n // top of the window is rarely helpful).\n x = x !== null ? x : 0;\n y = y !== null ? y : pageHeight;\n break;\n case \"Fit\":\n case \"FitB\":\n scale = \"page-fit\";\n break;\n case \"FitH\":\n case \"FitBH\":\n y = destArray[2];\n scale = \"page-width\";\n // According to the PDF spec, section 12.3.2.2, a `null` value in the\n // parameter should maintain the position relative to the new page.\n if (y === null && this._location) {\n x = this._location.left;\n y = this._location.top;\n } else if (typeof y !== \"number\" || y < 0) {\n // The \"top\" value isn't optional, according to the spec, however some\n // bad PDF generators will pretend that it is (fixes bug 1663390).\n y = pageHeight;\n }\n break;\n case \"FitV\":\n case \"FitBV\":\n x = destArray[2];\n width = pageWidth;\n height = pageHeight;\n scale = \"page-height\";\n break;\n case \"FitR\":\n x = destArray[2];\n y = destArray[3];\n width = destArray[4] - x;\n height = destArray[5] - y;\n let hPadding = SCROLLBAR_PADDING,\n vPadding = VERTICAL_PADDING;\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.removePageBorders\n ) {\n hPadding = vPadding = 0;\n }\n widthScale =\n (this.container.clientWidth - hPadding) /\n width /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n heightScale =\n (this.container.clientHeight - vPadding) /\n height /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));\n break;\n default:\n console.error(\n `scrollPageIntoView: \"${destArray[1].name}\" is not a valid destination type.`\n );\n return;\n }\n\n if (!ignoreDestinationZoom) {\n if (scale && scale !== this._currentScale) {\n this.currentScaleValue = scale;\n } else if (this._currentScale === UNKNOWN_SCALE) {\n this.currentScaleValue = DEFAULT_SCALE_VALUE;\n }\n }\n\n if (scale === \"page-fit\" && !destArray[4]) {\n this.#scrollIntoView(pageView);\n return;\n }\n\n const boundingRect = [\n pageView.viewport.convertToViewportPoint(x, y),\n pageView.viewport.convertToViewportPoint(x + width, y + height),\n ];\n let left = Math.min(boundingRect[0][0], boundingRect[1][0]);\n let top = Math.min(boundingRect[0][1], boundingRect[1][1]);\n\n if (!allowNegativeOffset) {\n // Some bad PDF generators will create destinations with e.g. top values\n // that exceeds the page height. Ensure that offsets are not negative,\n // to prevent a previous page from becoming visible (fixes bug 874482).\n left = Math.max(left, 0);\n top = Math.max(top, 0);\n }\n this.#scrollIntoView(pageView, /* pageSpot = */ { left, top });\n }\n\n _updateLocation(firstPage) {\n const currentScale = this._currentScale;\n const currentScaleValue = this._currentScaleValue;\n const normalizedScaleValue =\n parseFloat(currentScaleValue) === currentScale\n ? Math.round(currentScale * 10000) / 100\n : currentScaleValue;\n\n const pageNumber = firstPage.id;\n const currentPageView = this._pages[pageNumber - 1];\n const container = this.container;\n const topLeft = currentPageView.getPagePoint(\n container.scrollLeft - firstPage.x,\n container.scrollTop - firstPage.y\n );\n const intLeft = Math.round(topLeft[0]);\n const intTop = Math.round(topLeft[1]);\n\n let pdfOpenParams = `#page=${pageNumber}`;\n if (!this.isInPresentationMode) {\n pdfOpenParams += `&zoom=${normalizedScaleValue},${intLeft},${intTop}`;\n }\n\n this._location = {\n pageNumber,\n scale: normalizedScaleValue,\n top: intTop,\n left: intLeft,\n rotation: this._pagesRotation,\n pdfOpenParams,\n };\n }\n\n update() {\n const visible = this._getVisiblePages();\n const visiblePages = visible.views,\n numVisiblePages = visiblePages.length;\n\n if (numVisiblePages === 0) {\n return;\n }\n const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);\n this.#buffer.resize(newCacheSize, visible.ids);\n\n this.renderingQueue.renderHighestPriority(visible);\n\n const isSimpleLayout =\n this._spreadMode === SpreadMode.NONE &&\n (this._scrollMode === ScrollMode.PAGE ||\n this._scrollMode === ScrollMode.VERTICAL);\n const currentId = this._currentPageNumber;\n let stillFullyVisible = false;\n\n for (const page of visiblePages) {\n if (page.percent < 100) {\n break;\n }\n if (page.id === currentId && isSimpleLayout) {\n stillFullyVisible = true;\n break;\n }\n }\n this._setCurrentPageNumber(\n stillFullyVisible ? currentId : visiblePages[0].id\n );\n\n this._updateLocation(visible.first);\n this.eventBus.dispatch(\"updateviewarea\", {\n source: this,\n location: this._location,\n });\n }\n\n containsElement(element) {\n return this.container.contains(element);\n }\n\n focus() {\n this.container.focus();\n }\n\n get _isContainerRtl() {\n return getComputedStyle(this.container).direction === \"rtl\";\n }\n\n get isInPresentationMode() {\n return this.presentationModeState === PresentationModeState.FULLSCREEN;\n }\n\n get isChangingPresentationMode() {\n return this.presentationModeState === PresentationModeState.CHANGING;\n }\n\n get isHorizontalScrollbarEnabled() {\n return this.isInPresentationMode\n ? false\n : this.container.scrollWidth > this.container.clientWidth;\n }\n\n get isVerticalScrollbarEnabled() {\n return this.isInPresentationMode\n ? false\n : this.container.scrollHeight > this.container.clientHeight;\n }\n\n _getVisiblePages() {\n const views =\n this._scrollMode === ScrollMode.PAGE\n ? this.#scrollModePageState.pages\n : this._pages,\n horizontal = this._scrollMode === ScrollMode.HORIZONTAL,\n rtl = horizontal && this._isContainerRtl;\n\n return getVisibleElements({\n scrollEl: this.container,\n views,\n sortByVisibility: true,\n horizontal,\n rtl,\n });\n }\n\n cleanup() {\n for (const pageView of this._pages) {\n if (pageView.renderingState !== RenderingStates.FINISHED) {\n pageView.reset();\n }\n }\n }\n\n /**\n * @private\n */\n _cancelRendering() {\n for (const pageView of this._pages) {\n pageView.cancelRendering();\n }\n }\n\n /**\n * @param {PDFPageView} pageView\n * @returns {Promise<PDFPageProxy | null>}\n */\n async #ensurePdfPageLoaded(pageView) {\n if (pageView.pdfPage) {\n return pageView.pdfPage;\n }\n try {\n const pdfPage = await this.pdfDocument.getPage(pageView.id);\n if (!pageView.pdfPage) {\n pageView.setPdfPage(pdfPage);\n }\n if (!this.linkService._cachedPageNumber?.(pdfPage.ref)) {\n this.linkService.cachePageRef(pageView.id, pdfPage.ref);\n }\n return pdfPage;\n } catch (reason) {\n console.error(\"Unable to get page for page view\", reason);\n return null; // Page error -- there is nothing that can be done.\n }\n }\n\n #getScrollAhead(visible) {\n if (visible.first?.id === 1) {\n return true;\n } else if (visible.last?.id === this.pagesCount) {\n return false;\n }\n switch (this._scrollMode) {\n case ScrollMode.PAGE:\n return this.#scrollModePageState.scrollDown;\n case ScrollMode.HORIZONTAL:\n return this.scroll.right;\n }\n return this.scroll.down;\n }\n\n forceRendering(currentlyVisiblePages) {\n const visiblePages = currentlyVisiblePages || this._getVisiblePages();\n const scrollAhead = this.#getScrollAhead(visiblePages);\n const preRenderExtra =\n this._spreadMode !== SpreadMode.NONE &&\n this._scrollMode !== ScrollMode.HORIZONTAL;\n\n const pageView = this.renderingQueue.getHighestPriority(\n visiblePages,\n this._pages,\n scrollAhead,\n preRenderExtra\n );\n\n if (pageView) {\n this.#ensurePdfPageLoaded(pageView).then(() => {\n this.renderingQueue.renderView(pageView);\n });\n return true;\n }\n return false;\n }\n\n /**\n * @type {boolean} Whether all pages of the PDF document have identical\n * widths and heights.\n */\n get hasEqualPageSizes() {\n const firstPageView = this._pages[0];\n for (let i = 1, ii = this._pages.length; i < ii; ++i) {\n const pageView = this._pages[i];\n if (\n pageView.width !== firstPageView.width ||\n pageView.height !== firstPageView.height\n ) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Returns sizes of the pages.\n * @returns {Array} Array of objects with width/height/rotation fields.\n */\n getPagesOverview() {\n let initialOrientation;\n return this._pages.map(pageView => {\n const viewport = pageView.pdfPage.getViewport({ scale: 1 });\n const orientation = isPortraitOrientation(viewport);\n if (initialOrientation === undefined) {\n initialOrientation = orientation;\n } else if (\n this.enablePrintAutoRotate &&\n orientation !== initialOrientation\n ) {\n // Rotate to fit the initial orientation.\n return {\n width: viewport.height,\n height: viewport.width,\n rotation: (viewport.rotation - 90) % 360,\n };\n }\n return {\n width: viewport.width,\n height: viewport.height,\n rotation: viewport.rotation,\n };\n });\n }\n\n /**\n * @type {Promise<OptionalContentConfig | null>}\n */\n get optionalContentConfigPromise() {\n if (!this.pdfDocument) {\n return Promise.resolve(null);\n }\n if (!this._optionalContentConfigPromise) {\n console.error(\"optionalContentConfigPromise: Not initialized yet.\");\n // Prevent issues if the getter is accessed *before* the `onePageRendered`\n // promise has resolved; won't (normally) happen in the default viewer.\n return this.pdfDocument.getOptionalContentConfig();\n }\n return this._optionalContentConfigPromise;\n }\n\n /**\n * @param {Promise<OptionalContentConfig>} promise - A promise that is\n * resolved with an {@link OptionalContentConfig} instance.\n */\n set optionalContentConfigPromise(promise) {\n if (!(promise instanceof Promise)) {\n throw new Error(`Invalid optionalContentConfigPromise: ${promise}`);\n }\n if (!this.pdfDocument) {\n return;\n }\n if (!this._optionalContentConfigPromise) {\n // Ignore the setter *before* the `onePageRendered` promise has resolved,\n // since it'll be overwritten anyway; won't happen in the default viewer.\n return;\n }\n this._optionalContentConfigPromise = promise;\n\n this.refresh(false, { optionalContentConfigPromise: promise });\n\n this.eventBus.dispatch(\"optionalcontentconfigchanged\", {\n source: this,\n promise,\n });\n }\n\n /**\n * @type {number} One of the values in {ScrollMode}.\n */\n get scrollMode() {\n return this._scrollMode;\n }\n\n /**\n * @param {number} mode - The direction in which the document pages should be\n * laid out within the scrolling container.\n * The constants from {ScrollMode} should be used.\n */\n set scrollMode(mode) {\n if (this._scrollMode === mode) {\n return; // The Scroll mode didn't change.\n }\n if (!isValidScrollMode(mode)) {\n throw new Error(`Invalid scroll mode: ${mode}`);\n }\n if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {\n return; // Disabled for performance reasons.\n }\n this._previousScrollMode = this._scrollMode;\n\n this._scrollMode = mode;\n this.eventBus.dispatch(\"scrollmodechanged\", { source: this, mode });\n\n this._updateScrollMode(/* pageNumber = */ this._currentPageNumber);\n }\n\n _updateScrollMode(pageNumber = null) {\n const scrollMode = this._scrollMode,\n viewer = this.viewer;\n\n viewer.classList.toggle(\n \"scrollHorizontal\",\n scrollMode === ScrollMode.HORIZONTAL\n );\n viewer.classList.toggle(\"scrollWrapped\", scrollMode === ScrollMode.WRAPPED);\n\n if (!this.pdfDocument || !pageNumber) {\n return;\n }\n\n if (scrollMode === ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n } else if (this._previousScrollMode === ScrollMode.PAGE) {\n // Ensure that the current spreadMode is still applied correctly when\n // the *previous* scrollMode was `ScrollMode.PAGE`.\n this._updateSpreadMode();\n }\n // Non-numeric scale values can be sensitive to the scroll orientation.\n // Call this before re-scrolling to the current page, to ensure that any\n // changes in scale don't move the current page.\n if (this._currentScaleValue && isNaN(this._currentScaleValue)) {\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);\n this.update();\n }\n\n /**\n * @type {number} One of the values in {SpreadMode}.\n */\n get spreadMode() {\n return this._spreadMode;\n }\n\n /**\n * @param {number} mode - Group the pages in spreads, starting with odd- or\n * even-number pages (unless `SpreadMode.NONE` is used).\n * The constants from {SpreadMode} should be used.\n */\n set spreadMode(mode) {\n if (this._spreadMode === mode) {\n return; // The Spread mode didn't change.\n }\n if (!isValidSpreadMode(mode)) {\n throw new Error(`Invalid spread mode: ${mode}`);\n }\n this._spreadMode = mode;\n this.eventBus.dispatch(\"spreadmodechanged\", { source: this, mode });\n\n this._updateSpreadMode(/* pageNumber = */ this._currentPageNumber);\n }\n\n _updateSpreadMode(pageNumber = null) {\n if (!this.pdfDocument) {\n return;\n }\n const viewer = this.viewer,\n pages = this._pages;\n\n if (this._scrollMode === ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n } else {\n // Temporarily remove all the pages from the DOM.\n viewer.textContent = \"\";\n\n if (this._spreadMode === SpreadMode.NONE) {\n for (const pageView of this._pages) {\n viewer.append(pageView.div);\n }\n } else {\n const parity = this._spreadMode - 1;\n let spread = null;\n for (let i = 0, ii = pages.length; i < ii; ++i) {\n if (spread === null) {\n spread = document.createElement(\"div\");\n spread.className = \"spread\";\n viewer.append(spread);\n } else if (i % 2 === parity) {\n spread = spread.cloneNode(false);\n viewer.append(spread);\n }\n spread.append(pages[i].div);\n }\n }\n }\n\n if (!pageNumber) {\n return;\n }\n // Non-numeric scale values can be sensitive to the scroll orientation.\n // Call this before re-scrolling to the current page, to ensure that any\n // changes in scale don't move the current page.\n if (this._currentScaleValue && isNaN(this._currentScaleValue)) {\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);\n this.update();\n }\n\n /**\n * @private\n */\n _getPageAdvance(currentPageNumber, previous = false) {\n switch (this._scrollMode) {\n case ScrollMode.WRAPPED: {\n const { views } = this._getVisiblePages(),\n pageLayout = new Map();\n\n // Determine the current (visible) page layout.\n for (const { id, y, percent, widthPercent } of views) {\n if (percent === 0 || widthPercent < 100) {\n continue;\n }\n let yArray = pageLayout.get(y);\n if (!yArray) {\n pageLayout.set(y, (yArray ||= []));\n }\n yArray.push(id);\n }\n // Find the row of the current page.\n for (const yArray of pageLayout.values()) {\n const currentIndex = yArray.indexOf(currentPageNumber);\n if (currentIndex === -1) {\n continue;\n }\n const numPages = yArray.length;\n if (numPages === 1) {\n break;\n }\n // Handle documents with varying page sizes.\n if (previous) {\n for (let i = currentIndex - 1, ii = 0; i >= ii; i--) {\n const currentId = yArray[i],\n expectedId = yArray[i + 1] - 1;\n if (currentId < expectedId) {\n return currentPageNumber - expectedId;\n }\n }\n } else {\n for (let i = currentIndex + 1, ii = numPages; i < ii; i++) {\n const currentId = yArray[i],\n expectedId = yArray[i - 1] + 1;\n if (currentId > expectedId) {\n return expectedId - currentPageNumber;\n }\n }\n }\n // The current row is \"complete\", advance to the previous/next one.\n if (previous) {\n const firstId = yArray[0];\n if (firstId < currentPageNumber) {\n return currentPageNumber - firstId + 1;\n }\n } else {\n const lastId = yArray[numPages - 1];\n if (lastId > currentPageNumber) {\n return lastId - currentPageNumber + 1;\n }\n }\n break;\n }\n break;\n }\n case ScrollMode.HORIZONTAL: {\n break;\n }\n case ScrollMode.PAGE:\n case ScrollMode.VERTICAL: {\n if (this._spreadMode === SpreadMode.NONE) {\n break; // Normal vertical scrolling.\n }\n const parity = this._spreadMode - 1;\n\n if (previous && currentPageNumber % 2 !== parity) {\n break; // Left-hand side page.\n } else if (!previous && currentPageNumber % 2 === parity) {\n break; // Right-hand side page.\n }\n const { views } = this._getVisiblePages(),\n expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1;\n\n for (const { id, percent, widthPercent } of views) {\n if (id !== expectedId) {\n continue;\n }\n if (percent > 0 && widthPercent === 100) {\n return 2;\n }\n break;\n }\n break;\n }\n }\n return 1;\n }\n\n /**\n * Go to the next page, taking scroll/spread-modes into account.\n * @returns {boolean} Whether navigation occurred.\n */\n nextPage() {\n const currentPageNumber = this._currentPageNumber,\n pagesCount = this.pagesCount;\n\n if (currentPageNumber >= pagesCount) {\n return false;\n }\n const advance =\n this._getPageAdvance(currentPageNumber, /* previous = */ false) || 1;\n\n this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);\n return true;\n }\n\n /**\n * Go to the previous page, taking scroll/spread-modes into account.\n * @returns {boolean} Whether navigation occurred.\n */\n previousPage() {\n const currentPageNumber = this._currentPageNumber;\n\n if (currentPageNumber <= 1) {\n return false;\n }\n const advance =\n this._getPageAdvance(currentPageNumber, /* previous = */ true) || 1;\n\n this.currentPageNumber = Math.max(currentPageNumber - advance, 1);\n return true;\n }\n\n /**\n * @typedef {Object} ChangeScaleOptions\n * @property {number} [drawingDelay]\n * @property {number} [scaleFactor]\n * @property {number} [steps]\n */\n\n /**\n * Increase the current zoom level one, or more, times.\n * @param {ChangeScaleOptions} [options]\n */\n increaseScale({ drawingDelay, scaleFactor, steps } = {}) {\n if (!this.pdfDocument) {\n return;\n }\n let newScale = this._currentScale;\n if (scaleFactor > 1) {\n newScale = Math.round(newScale * scaleFactor * 100) / 100;\n } else {\n steps ??= 1;\n do {\n newScale =\n Math.ceil((newScale * DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;\n } while (--steps > 0 && newScale < MAX_SCALE);\n }\n this.#setScale(Math.min(MAX_SCALE, newScale), {\n noScroll: false,\n drawingDelay,\n });\n }\n\n /**\n * Decrease the current zoom level one, or more, times.\n * @param {ChangeScaleOptions} [options]\n */\n decreaseScale({ drawingDelay, scaleFactor, steps } = {}) {\n if (!this.pdfDocument) {\n return;\n }\n let newScale = this._currentScale;\n if (scaleFactor > 0 && scaleFactor < 1) {\n newScale = Math.round(newScale * scaleFactor * 100) / 100;\n } else {\n steps ??= 1;\n do {\n newScale =\n Math.floor((newScale / DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;\n } while (--steps > 0 && newScale > MIN_SCALE);\n }\n this.#setScale(Math.max(MIN_SCALE, newScale), {\n noScroll: false,\n drawingDelay,\n });\n }\n\n #updateContainerHeightCss(height = this.container.clientHeight) {\n if (height !== this.#previousContainerHeight) {\n this.#previousContainerHeight = height;\n docStyle.setProperty(\"--viewer-container-height\", `${height}px`);\n }\n }\n\n #resizeObserverCallback(entries) {\n for (const entry of entries) {\n if (entry.target === this.container) {\n this.#updateContainerHeightCss(\n Math.floor(entry.borderBoxSize[0].blockSize)\n );\n this.#containerTopLeft = null;\n break;\n }\n }\n }\n\n get containerTopLeft() {\n return (this.#containerTopLeft ||= [\n this.container.offsetTop,\n this.container.offsetLeft,\n ]);\n }\n\n /**\n * @type {number}\n */\n get annotationEditorMode() {\n return this.#annotationEditorUIManager\n ? this.#annotationEditorMode\n : AnnotationEditorType.DISABLE;\n }\n\n /**\n * @param {number} mode - AnnotationEditor mode (None, FreeText, Ink, ...)\n */\n set annotationEditorMode(mode) {\n if (!this.#annotationEditorUIManager) {\n throw new Error(`The AnnotationEditor is not enabled.`);\n }\n if (this.#annotationEditorMode === mode) {\n return; // The AnnotationEditor mode didn't change.\n }\n if (!isValidAnnotationEditorMode(mode)) {\n throw new Error(`Invalid AnnotationEditor mode: ${mode}`);\n }\n if (!this.pdfDocument) {\n return;\n }\n this.#annotationEditorMode = mode;\n this.eventBus.dispatch(\"annotationeditormodechanged\", {\n source: this,\n mode,\n });\n\n this.#annotationEditorUIManager.updateMode(mode);\n }\n\n // eslint-disable-next-line accessor-pairs\n set annotationEditorParams({ type, value }) {\n if (!this.#annotationEditorUIManager) {\n throw new Error(`The AnnotationEditor is not enabled.`);\n }\n this.#annotationEditorUIManager.updateParams(type, value);\n }\n\n refresh(noUpdate = false, updateArgs = Object.create(null)) {\n if (!this.pdfDocument) {\n return;\n }\n for (const pageView of this._pages) {\n pageView.update(updateArgs);\n }\n if (this.#scaleTimeoutId !== null) {\n clearTimeout(this.#scaleTimeoutId);\n this.#scaleTimeoutId = null;\n }\n if (!noUpdate) {\n this.update();\n }\n }\n}\n\nexport { PagesCountLimit, PDFPageViewBuffer, PDFViewer };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A subset of the l10n strings in the `l10n/en-US/viewer.properties` file.\n */\nconst DEFAULT_L10N_STRINGS = {\n of_pages: \"of {{pagesCount}}\",\n page_of_pages: \"({{pageNumber}} of {{pagesCount}})\",\n\n document_properties_kb: \"{{size_kb}} KB ({{size_b}} bytes)\",\n document_properties_mb: \"{{size_mb}} MB ({{size_b}} bytes)\",\n document_properties_date_string: \"{{date}}, {{time}}\",\n document_properties_page_size_unit_inches: \"in\",\n document_properties_page_size_unit_millimeters: \"mm\",\n document_properties_page_size_orientation_portrait: \"portrait\",\n document_properties_page_size_orientation_landscape: \"landscape\",\n document_properties_page_size_name_a3: \"A3\",\n document_properties_page_size_name_a4: \"A4\",\n document_properties_page_size_name_letter: \"Letter\",\n document_properties_page_size_name_legal: \"Legal\",\n document_properties_page_size_dimension_string:\n \"{{width}} × {{height}} {{unit}} ({{orientation}})\",\n document_properties_page_size_dimension_name_string:\n \"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})\",\n document_properties_linearized_yes: \"Yes\",\n document_properties_linearized_no: \"No\",\n\n additional_layers: \"Additional Layers\",\n page_landmark: \"Page {{page}}\",\n thumb_page_title: \"Page {{page}}\",\n thumb_page_canvas: \"Thumbnail of Page {{page}}\",\n\n find_reached_top: \"Reached top of document, continued from bottom\",\n find_reached_bottom: \"Reached end of document, continued from top\",\n \"find_match_count[one]\": \"{{current}} of {{total}} match\",\n \"find_match_count[other]\": \"{{current}} of {{total}} matches\",\n \"find_match_count_limit[one]\": \"More than {{limit}} match\",\n \"find_match_count_limit[other]\": \"More than {{limit}} matches\",\n find_not_found: \"Phrase not found\",\n\n page_scale_width: \"Page Width\",\n page_scale_fit: \"Page Fit\",\n page_scale_auto: \"Automatic Zoom\",\n page_scale_actual: \"Actual Size\",\n page_scale_percent: \"{{scale}}%\",\n\n loading_error: \"An error occurred while loading the PDF.\",\n invalid_file_error: \"Invalid or corrupted PDF file.\",\n missing_file_error: \"Missing PDF file.\",\n unexpected_response_error: \"Unexpected server response.\",\n rendering_error: \"An error occurred while rendering the page.\",\n\n printing_not_supported:\n \"Warning: Printing is not fully supported by this browser.\",\n printing_not_ready: \"Warning: The PDF is not fully loaded for printing.\",\n web_fonts_disabled:\n \"Web fonts are disabled: unable to use embedded PDF fonts.\",\n\n free_text2_default_content: \"Start typing…\",\n editor_free_text2_aria_label: \"Text Editor\",\n editor_ink2_aria_label: \"Draw Editor\",\n editor_ink_canvas_aria_label: \"User-created image\",\n};\nif (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n DEFAULT_L10N_STRINGS.print_progress_percent = \"{{progress}}%\";\n}\n\nfunction getL10nFallback(key, args) {\n switch (key) {\n case \"find_match_count\":\n key = `find_match_count[${args.total === 1 ? \"one\" : \"other\"}]`;\n break;\n case \"find_match_count_limit\":\n key = `find_match_count_limit[${args.limit === 1 ? \"one\" : \"other\"}]`;\n break;\n }\n return DEFAULT_L10N_STRINGS[key] || \"\";\n}\n\nconst PARTIAL_LANG_CODES = {\n en: \"en-US\",\n es: \"es-ES\",\n fy: \"fy-NL\",\n ga: \"ga-IE\",\n gu: \"gu-IN\",\n hi: \"hi-IN\",\n hy: \"hy-AM\",\n nb: \"nb-NO\",\n ne: \"ne-NP\",\n nn: \"nn-NO\",\n pa: \"pa-IN\",\n pt: \"pt-PT\",\n sv: \"sv-SE\",\n zh: \"zh-CN\",\n};\n\n// Try to support \"incompletely\" specified language codes (see issue 13689).\nfunction fixupLangCode(langCode) {\n return PARTIAL_LANG_CODES[langCode?.toLowerCase()] || langCode;\n}\n\n// Replaces {{arguments}} with their values.\nfunction formatL10nValue(text, args) {\n if (!args) {\n return text;\n }\n return text.replaceAll(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (all, name) => {\n return name in args ? args[name] : \"{{\" + name + \"}}\";\n });\n}\n\n/**\n * No-op implementation of the localization service.\n * @implements {IL10n}\n */\nconst NullL10n = {\n async getLanguage() {\n return \"en-us\";\n },\n\n async getDirection() {\n return \"ltr\";\n },\n\n async get(key, args = null, fallback = getL10nFallback(key, args)) {\n return formatL10nValue(fallback, args);\n },\n\n async translate(element) {},\n};\n\nexport { fixupLangCode, getL10nFallback, NullL10n };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/optional_content_config\").OptionalContentConfig} OptionalContentConfig */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IRenderableView} IRenderableView */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_rendering_queue\").PDFRenderingQueue} PDFRenderingQueue */\n\nimport {\n AbortException,\n AnnotationMode,\n PixelsPerInch,\n RenderingCancelledException,\n setLayerDimensions,\n shadow,\n} from \"pdfjs-lib\";\nimport {\n approximateFraction,\n DEFAULT_SCALE,\n OutputScale,\n RenderingStates,\n roundToDivide,\n TextLayerMode,\n} from \"./ui_utils.js\";\nimport { AnnotationEditorLayerBuilder } from \"./annotation_editor_layer_builder.js\";\nimport { AnnotationLayerBuilder } from \"./annotation_layer_builder.js\";\nimport { compatibilityParams } from \"./app_options.js\";\nimport { NullL10n } from \"./l10n_utils.js\";\nimport { SimpleLinkService } from \"./pdf_link_service.js\";\nimport { StructTreeLayerBuilder } from \"./struct_tree_layer_builder.js\";\nimport { TextAccessibilityManager } from \"./text_accessibility.js\";\nimport { TextHighlighter } from \"./text_highlighter.js\";\nimport { TextLayerBuilder } from \"./text_layer_builder.js\";\nimport { XfaLayerBuilder } from \"./xfa_layer_builder.js\";\n\n/**\n * @typedef {Object} PDFPageViewOptions\n * @property {HTMLDivElement} [container] - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} id - The page unique ID (normally its number).\n * @property {number} [scale] - The page scale display.\n * @property {PageViewport} defaultViewport - The page viewport.\n * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -\n * A promise that is resolved with an {@link OptionalContentConfig} instance.\n * The default value is `null`.\n * @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object.\n * @property {number} [textLayerMode] - Controls if the text layer used for\n * selection and searching is created. The constants from {TextLayerMode}\n * should be used. The default value is `TextLayerMode.ENABLE`.\n * @property {number} [annotationMode] - Controls if the annotation layer is\n * created, and if interactive form elements or `AnnotationStorage`-data are\n * being rendered. The constants from {@link AnnotationMode} should be used;\n * see also {@link RenderParameters} and {@link GetOperatorListParameters}.\n * The default value is `AnnotationMode.ENABLE_FORMS`.\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * for annotation icons. Include trailing slash.\n * @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default\n * value is `false`.\n * @property {boolean} [isOffscreenCanvasSupported] - Allows to use an\n * OffscreenCanvas if needed.\n * @property {number} [maxCanvasPixels] - The maximum supported canvas size in\n * total pixels, i.e. width * height. Use -1 for no limit. The default value\n * is 4096 * 4096 (16 mega-pixels).\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n * @property {IL10n} [l10n] - Localization service.\n * @property {function} [layerProperties] - The function that is used to lookup\n * the necessary layer-properties.\n */\n\nconst MAX_CANVAS_PIXELS = compatibilityParams.maxCanvasPixels || 16777216;\n\nconst DEFAULT_LAYER_PROPERTIES = () => {\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"COMPONENTS\")) {\n return null;\n }\n return {\n annotationEditorUIManager: null,\n annotationStorage: null,\n downloadManager: null,\n enableScripting: false,\n fieldObjectsPromise: null,\n findController: null,\n hasJSActionsPromise: null,\n get linkService() {\n return new SimpleLinkService();\n },\n };\n};\n\n/**\n * @implements {IRenderableView}\n */\nclass PDFPageView {\n #annotationMode = AnnotationMode.ENABLE_FORMS;\n\n #layerProperties = null;\n\n #loadingId = null;\n\n #previousRotation = null;\n\n #renderError = null;\n\n #renderingState = RenderingStates.INITIAL;\n\n #textLayerMode = TextLayerMode.ENABLE;\n\n #useThumbnailCanvas = {\n directDrawing: true,\n initialOptionalContent: true,\n regularAnnotations: true,\n };\n\n #viewportMap = new WeakMap();\n\n /**\n * @param {PDFPageViewOptions} options\n */\n constructor(options) {\n const container = options.container;\n const defaultViewport = options.defaultViewport;\n\n this.id = options.id;\n this.renderingId = \"page\" + this.id;\n this.#layerProperties = options.layerProperties || DEFAULT_LAYER_PROPERTIES;\n\n this.pdfPage = null;\n this.pageLabel = null;\n this.rotation = 0;\n this.scale = options.scale || DEFAULT_SCALE;\n this.viewport = defaultViewport;\n this.pdfPageRotate = defaultViewport.rotation;\n this._optionalContentConfigPromise =\n options.optionalContentConfigPromise || null;\n this.hasRestrictedScaling = false;\n this.#textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE;\n this.#annotationMode =\n options.annotationMode ?? AnnotationMode.ENABLE_FORMS;\n this.imageResourcesPath = options.imageResourcesPath || \"\";\n this.useOnlyCssZoom = options.useOnlyCssZoom || false;\n this.isOffscreenCanvasSupported =\n options.isOffscreenCanvasSupported ?? true;\n this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;\n this.pageColors = options.pageColors || null;\n\n this.eventBus = options.eventBus;\n this.renderingQueue = options.renderingQueue;\n this.l10n = options.l10n || NullL10n;\n\n this.renderTask = null;\n this.resume = null;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this._isStandalone = !this.renderingQueue?.hasViewer();\n }\n\n this._annotationCanvasMap = null;\n\n this.annotationLayer = null;\n this.annotationEditorLayer = null;\n this.textLayer = null;\n this.zoomLayer = null;\n this.xfaLayer = null;\n this.structTreeLayer = null;\n\n const div = document.createElement(\"div\");\n div.className = \"page\";\n div.setAttribute(\"data-page-number\", this.id);\n div.setAttribute(\"role\", \"region\");\n this.l10n.get(\"page_landmark\", { page: this.id }).then(msg => {\n div.setAttribute(\"aria-label\", msg);\n });\n this.div = div;\n\n this.#setDimensions();\n container?.append(div);\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this._isStandalone\n ) {\n // Ensure that the various layers always get the correct initial size,\n // see issue 15795.\n container?.style.setProperty(\n \"--scale-factor\",\n this.scale * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n\n const { optionalContentConfigPromise } = options;\n if (optionalContentConfigPromise) {\n // Ensure that the thumbnails always display the *initial* document\n // state, for documents with optional content.\n optionalContentConfigPromise.then(optionalContentConfig => {\n if (\n optionalContentConfigPromise !== this._optionalContentConfigPromise\n ) {\n return;\n }\n this.#useThumbnailCanvas.initialOptionalContent =\n optionalContentConfig.hasInitialVisibility;\n });\n }\n }\n }\n\n get renderingState() {\n return this.#renderingState;\n }\n\n set renderingState(state) {\n if (state === this.#renderingState) {\n return;\n }\n this.#renderingState = state;\n\n if (this.#loadingId) {\n clearTimeout(this.#loadingId);\n this.#loadingId = null;\n }\n\n switch (state) {\n case RenderingStates.PAUSED:\n this.div.classList.remove(\"loading\");\n break;\n case RenderingStates.RUNNING:\n this.div.classList.add(\"loadingIcon\");\n this.#loadingId = setTimeout(() => {\n // Adding the loading class is slightly postponed in order to not have\n // it with loadingIcon.\n // If we don't do that the visibility of the background is changed but\n // the transition isn't triggered.\n this.div.classList.add(\"loading\");\n this.#loadingId = null;\n }, 0);\n break;\n case RenderingStates.INITIAL:\n case RenderingStates.FINISHED:\n this.div.classList.remove(\"loadingIcon\", \"loading\");\n break;\n }\n }\n\n #setDimensions() {\n const { viewport } = this;\n if (this.pdfPage) {\n if (this.#previousRotation === viewport.rotation) {\n return;\n }\n this.#previousRotation = viewport.rotation;\n }\n\n setLayerDimensions(\n this.div,\n viewport,\n /* mustFlip = */ true,\n /* mustRotate = */ false\n );\n }\n\n setPdfPage(pdfPage) {\n this.pdfPage = pdfPage;\n this.pdfPageRotate = pdfPage.rotate;\n\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = pdfPage.getViewport({\n scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: totalRotation,\n });\n this.#setDimensions();\n this.reset();\n }\n\n destroy() {\n this.reset();\n this.pdfPage?.cleanup();\n }\n\n get _textHighlighter() {\n return shadow(\n this,\n \"_textHighlighter\",\n new TextHighlighter({\n pageIndex: this.id - 1,\n eventBus: this.eventBus,\n findController: this.#layerProperties().findController,\n })\n );\n }\n\n async #renderAnnotationLayer() {\n let error = null;\n try {\n await this.annotationLayer.render(this.viewport, \"display\");\n } catch (ex) {\n console.error(`#renderAnnotationLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"annotationlayerrendered\", {\n source: this,\n pageNumber: this.id,\n error,\n });\n }\n }\n\n async #renderAnnotationEditorLayer() {\n let error = null;\n try {\n await this.annotationEditorLayer.render(this.viewport, \"display\");\n } catch (ex) {\n console.error(`#renderAnnotationEditorLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"annotationeditorlayerrendered\", {\n source: this,\n pageNumber: this.id,\n error,\n });\n }\n }\n\n async #renderXfaLayer() {\n let error = null;\n try {\n const result = await this.xfaLayer.render(this.viewport, \"display\");\n if (result?.textDivs && this._textHighlighter) {\n this.#buildXfaTextContentItems(result.textDivs);\n }\n } catch (ex) {\n console.error(`#renderXfaLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"xfalayerrendered\", {\n source: this,\n pageNumber: this.id,\n error,\n });\n }\n }\n\n async #renderTextLayer() {\n const { pdfPage, textLayer, viewport } = this;\n if (!textLayer) {\n return;\n }\n\n let error = null;\n try {\n if (!textLayer.renderingDone) {\n const readableStream = pdfPage.streamTextContent({\n includeMarkedContent: true,\n disableNormalization: true,\n });\n textLayer.setTextContentSource(readableStream);\n }\n await textLayer.render(viewport);\n } catch (ex) {\n if (ex instanceof AbortException) {\n return;\n }\n console.error(`#renderTextLayer: \"${ex}\".`);\n error = ex;\n }\n\n this.eventBus.dispatch(\"textlayerrendered\", {\n source: this,\n pageNumber: this.id,\n numTextDivs: textLayer.numTextDivs,\n error,\n });\n\n this.#renderStructTreeLayer();\n }\n\n /**\n * The structure tree is currently only supported when the text layer is\n * enabled and a canvas is used for rendering.\n *\n * The structure tree must be generated after the text layer for the\n * aria-owns to work.\n */\n async #renderStructTreeLayer() {\n if (!this.textLayer) {\n return;\n }\n this.structTreeLayer ||= new StructTreeLayerBuilder();\n\n const tree = await (!this.structTreeLayer.renderingDone\n ? this.pdfPage.getStructTree()\n : null);\n const treeDom = this.structTreeLayer?.render(tree);\n if (treeDom) {\n this.canvas?.append(treeDom);\n }\n this.structTreeLayer?.show();\n }\n\n async #buildXfaTextContentItems(textDivs) {\n const text = await this.pdfPage.getTextContent();\n const items = [];\n for (const item of text.items) {\n items.push(item.str);\n }\n this._textHighlighter.setTextMapping(textDivs, items);\n this._textHighlighter.enable();\n }\n\n /**\n * @private\n */\n _resetZoomLayer(removeFromDOM = false) {\n if (!this.zoomLayer) {\n return;\n }\n const zoomLayerCanvas = this.zoomLayer.firstChild;\n this.#viewportMap.delete(zoomLayerCanvas);\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n zoomLayerCanvas.width = 0;\n zoomLayerCanvas.height = 0;\n\n if (removeFromDOM) {\n // Note: `ChildNode.remove` doesn't throw if the parent node is undefined.\n this.zoomLayer.remove();\n }\n this.zoomLayer = null;\n }\n\n reset({\n keepZoomLayer = false,\n keepAnnotationLayer = false,\n keepAnnotationEditorLayer = false,\n keepXfaLayer = false,\n keepTextLayer = false,\n } = {}) {\n this.cancelRendering({\n keepAnnotationLayer,\n keepAnnotationEditorLayer,\n keepXfaLayer,\n keepTextLayer,\n });\n this.renderingState = RenderingStates.INITIAL;\n\n const div = this.div;\n\n const childNodes = div.childNodes,\n zoomLayerNode = (keepZoomLayer && this.zoomLayer) || null,\n annotationLayerNode =\n (keepAnnotationLayer && this.annotationLayer?.div) || null,\n annotationEditorLayerNode =\n (keepAnnotationEditorLayer && this.annotationEditorLayer?.div) || null,\n xfaLayerNode = (keepXfaLayer && this.xfaLayer?.div) || null,\n textLayerNode = (keepTextLayer && this.textLayer?.div) || null;\n for (let i = childNodes.length - 1; i >= 0; i--) {\n const node = childNodes[i];\n switch (node) {\n case zoomLayerNode:\n case annotationLayerNode:\n case annotationEditorLayerNode:\n case xfaLayerNode:\n case textLayerNode:\n continue;\n }\n node.remove();\n }\n div.removeAttribute(\"data-loaded\");\n\n if (annotationLayerNode) {\n // Hide the annotation layer until all elements are resized\n // so they are not displayed on the already resized page.\n this.annotationLayer.hide();\n }\n if (annotationEditorLayerNode) {\n this.annotationEditorLayer.hide();\n }\n if (xfaLayerNode) {\n // Hide the XFA layer until all elements are resized\n // so they are not displayed on the already resized page.\n this.xfaLayer.hide();\n }\n if (textLayerNode) {\n this.textLayer.hide();\n }\n this.structTreeLayer?.hide();\n\n if (!zoomLayerNode) {\n if (this.canvas) {\n this.#viewportMap.delete(this.canvas);\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n this.canvas.width = 0;\n this.canvas.height = 0;\n delete this.canvas;\n }\n this._resetZoomLayer();\n }\n }\n\n /**\n * @typedef {Object} PDFPageViewUpdateParameters\n * @property {number} [scale] The new scale, if specified.\n * @property {number} [rotation] The new rotation, if specified.\n * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise]\n * A promise that is resolved with an {@link OptionalContentConfig}\n * instance. The default value is `null`.\n * @property {number} [drawingDelay]\n */\n\n /**\n * Update e.g. the scale and/or rotation of the page.\n * @param {PDFPageViewUpdateParameters}\n */\n update({\n scale = 0,\n rotation = null,\n optionalContentConfigPromise = null,\n drawingDelay = -1,\n }) {\n this.scale = scale || this.scale;\n if (typeof rotation === \"number\") {\n this.rotation = rotation; // The rotation may be zero.\n }\n if (optionalContentConfigPromise instanceof Promise) {\n this._optionalContentConfigPromise = optionalContentConfigPromise;\n\n // Ensure that the thumbnails always display the *initial* document state,\n // for documents with optional content.\n optionalContentConfigPromise.then(optionalContentConfig => {\n if (\n optionalContentConfigPromise !== this._optionalContentConfigPromise\n ) {\n return;\n }\n this.#useThumbnailCanvas.initialOptionalContent =\n optionalContentConfig.hasInitialVisibility;\n });\n }\n this.#useThumbnailCanvas.directDrawing = true;\n\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = this.viewport.clone({\n scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: totalRotation,\n });\n this.#setDimensions();\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this._isStandalone\n ) {\n this.div.parentNode?.style.setProperty(\n \"--scale-factor\",\n this.viewport.scale\n );\n }\n\n let isScalingRestricted = false;\n if (this.canvas && this.maxCanvasPixels > 0) {\n const { width, height } = this.viewport;\n const { sx, sy } = this.outputScale;\n if (\n ((Math.floor(width) * sx) | 0) * ((Math.floor(height) * sy) | 0) >\n this.maxCanvasPixels\n ) {\n isScalingRestricted = true;\n }\n }\n const onlyCssZoom =\n this.useOnlyCssZoom || (this.hasRestrictedScaling && isScalingRestricted);\n const postponeDrawing =\n !onlyCssZoom && drawingDelay >= 0 && drawingDelay < 1000;\n\n if (this.canvas) {\n if (postponeDrawing || onlyCssZoom) {\n if (\n postponeDrawing &&\n this.renderingState !== RenderingStates.FINISHED\n ) {\n this.cancelRendering({\n keepZoomLayer: true,\n keepAnnotationLayer: true,\n keepAnnotationEditorLayer: true,\n keepXfaLayer: true,\n keepTextLayer: true,\n cancelExtraDelay: drawingDelay,\n });\n // It isn't really finished, but once we have finished\n // to postpone, we'll call this.reset(...) which will set\n // the rendering state to INITIAL, hence the next call to\n // PDFViewer.update() will trigger a redraw (if it's mandatory).\n this.renderingState = RenderingStates.FINISHED;\n // Ensure that the thumbnails won't become partially (or fully) blank,\n // if the sidebar is opened before the actual rendering is done.\n this.#useThumbnailCanvas.directDrawing = false;\n }\n\n this.cssTransform({\n target: this.canvas,\n redrawAnnotationLayer: true,\n redrawAnnotationEditorLayer: true,\n redrawXfaLayer: true,\n redrawTextLayer: !postponeDrawing,\n hideTextLayer: postponeDrawing,\n });\n\n if (postponeDrawing) {\n // The \"pagerendered\"-event will be dispatched once the actual\n // rendering is done, hence don't dispatch it here as well.\n return;\n }\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform: true,\n timestamp: performance.now(),\n error: this.#renderError,\n });\n return;\n }\n if (!this.zoomLayer && !this.canvas.hidden) {\n this.zoomLayer = this.canvas.parentNode;\n this.zoomLayer.style.position = \"absolute\";\n }\n }\n if (this.zoomLayer) {\n this.cssTransform({ target: this.zoomLayer.firstChild });\n }\n this.reset({\n keepZoomLayer: true,\n keepAnnotationLayer: true,\n keepAnnotationEditorLayer: true,\n keepXfaLayer: true,\n keepTextLayer: true,\n });\n }\n\n /**\n * PLEASE NOTE: Most likely you want to use the `this.reset()` method,\n * rather than calling this one directly.\n */\n cancelRendering({\n keepAnnotationLayer = false,\n keepAnnotationEditorLayer = false,\n keepXfaLayer = false,\n keepTextLayer = false,\n cancelExtraDelay = 0,\n } = {}) {\n if (this.renderTask) {\n this.renderTask.cancel(cancelExtraDelay);\n this.renderTask = null;\n }\n this.resume = null;\n\n if (this.textLayer && (!keepTextLayer || !this.textLayer.div)) {\n this.textLayer.cancel();\n this.textLayer = null;\n }\n if (this.structTreeLayer && !this.textLayer) {\n this.structTreeLayer = null;\n }\n if (\n this.annotationLayer &&\n (!keepAnnotationLayer || !this.annotationLayer.div)\n ) {\n this.annotationLayer.cancel();\n this.annotationLayer = null;\n this._annotationCanvasMap = null;\n }\n if (\n this.annotationEditorLayer &&\n (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)\n ) {\n this.annotationEditorLayer.cancel();\n this.annotationEditorLayer = null;\n }\n if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) {\n this.xfaLayer.cancel();\n this.xfaLayer = null;\n this._textHighlighter?.disable();\n }\n }\n\n cssTransform({\n target,\n redrawAnnotationLayer = false,\n redrawAnnotationEditorLayer = false,\n redrawXfaLayer = false,\n redrawTextLayer = false,\n hideTextLayer = false,\n }) {\n // Scale target (canvas), its wrapper and page container.\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n !(target instanceof HTMLCanvasElement)\n ) {\n throw new Error(\"Expected `target` to be a canvas.\");\n }\n if (!target.hasAttribute(\"zooming\")) {\n target.setAttribute(\"zooming\", true);\n const { style } = target;\n style.width = style.height = \"\";\n }\n\n const originalViewport = this.#viewportMap.get(target);\n if (this.viewport !== originalViewport) {\n // The canvas may have been originally rotated; rotate relative to that.\n const relativeRotation =\n this.viewport.rotation - originalViewport.rotation;\n const absRotation = Math.abs(relativeRotation);\n let scaleX = 1,\n scaleY = 1;\n if (absRotation === 90 || absRotation === 270) {\n const { width, height } = this.viewport;\n // Scale x and y because of the rotation.\n scaleX = height / width;\n scaleY = width / height;\n }\n target.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX}, ${scaleY})`;\n }\n\n if (redrawAnnotationLayer && this.annotationLayer) {\n this.#renderAnnotationLayer();\n }\n if (redrawAnnotationEditorLayer && this.annotationEditorLayer) {\n this.#renderAnnotationEditorLayer();\n }\n if (redrawXfaLayer && this.xfaLayer) {\n this.#renderXfaLayer();\n }\n\n if (this.textLayer) {\n if (hideTextLayer) {\n this.textLayer.hide();\n this.structTreeLayer?.hide();\n } else if (redrawTextLayer) {\n this.#renderTextLayer();\n }\n }\n }\n\n get width() {\n return this.viewport.width;\n }\n\n get height() {\n return this.viewport.height;\n }\n\n getPagePoint(x, y) {\n return this.viewport.convertToPdfPoint(x, y);\n }\n\n async #finishRenderTask(renderTask, error = null) {\n // The renderTask may have been replaced by a new one, so only remove\n // the reference to the renderTask if it matches the one that is\n // triggering this callback.\n if (renderTask === this.renderTask) {\n this.renderTask = null;\n }\n\n if (error instanceof RenderingCancelledException) {\n this.#renderError = null;\n return;\n }\n this.#renderError = error;\n\n this.renderingState = RenderingStates.FINISHED;\n this._resetZoomLayer(/* removeFromDOM = */ true);\n\n // Ensure that the thumbnails won't become partially (or fully) blank,\n // for documents that contain interactive form elements.\n this.#useThumbnailCanvas.regularAnnotations = !renderTask.separateAnnots;\n\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform: false,\n timestamp: performance.now(),\n error: this.#renderError,\n });\n\n if (error) {\n throw error;\n }\n }\n\n async draw() {\n if (this.renderingState !== RenderingStates.INITIAL) {\n console.error(\"Must be in new state before drawing\");\n this.reset(); // Ensure that we reset all state to prevent issues.\n }\n const { div, l10n, pageColors, pdfPage, viewport } = this;\n\n if (!pdfPage) {\n this.renderingState = RenderingStates.FINISHED;\n throw new Error(\"pdfPage is not loaded\");\n }\n\n this.renderingState = RenderingStates.RUNNING;\n\n // Wrap the canvas so that if it has a CSS transform for high DPI the\n // overflow will be hidden in Firefox.\n const canvasWrapper = document.createElement(\"div\");\n canvasWrapper.classList.add(\"canvasWrapper\");\n div.append(canvasWrapper);\n\n if (\n !this.textLayer &&\n this.#textLayerMode !== TextLayerMode.DISABLE &&\n !pdfPage.isPureXfa\n ) {\n this._accessibilityManager ||= new TextAccessibilityManager();\n\n this.textLayer = new TextLayerBuilder({\n highlighter: this._textHighlighter,\n accessibilityManager: this._accessibilityManager,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n enablePermissions:\n this.#textLayerMode === TextLayerMode.ENABLE_PERMISSIONS,\n });\n div.append(this.textLayer.div);\n }\n\n if (\n !this.annotationLayer &&\n this.#annotationMode !== AnnotationMode.DISABLE\n ) {\n const {\n annotationStorage,\n downloadManager,\n enableScripting,\n fieldObjectsPromise,\n hasJSActionsPromise,\n linkService,\n } = this.#layerProperties();\n\n this._annotationCanvasMap ||= new Map();\n this.annotationLayer = new AnnotationLayerBuilder({\n pageDiv: div,\n pdfPage,\n annotationStorage,\n imageResourcesPath: this.imageResourcesPath,\n renderForms: this.#annotationMode === AnnotationMode.ENABLE_FORMS,\n linkService,\n downloadManager,\n l10n,\n enableScripting,\n hasJSActionsPromise,\n fieldObjectsPromise,\n annotationCanvasMap: this._annotationCanvasMap,\n accessibilityManager: this._accessibilityManager,\n });\n }\n\n const renderContinueCallback = cont => {\n showCanvas?.(false);\n if (this.renderingQueue && !this.renderingQueue.isHighestPriority(this)) {\n this.renderingState = RenderingStates.PAUSED;\n this.resume = () => {\n this.renderingState = RenderingStates.RUNNING;\n cont();\n };\n return;\n }\n cont();\n };\n\n const { width, height } = viewport;\n const canvas = document.createElement(\"canvas\");\n canvas.setAttribute(\"role\", \"presentation\");\n\n // Keep the canvas hidden until the first draw callback, or until drawing\n // is complete when `!this.renderingQueue`, to prevent black flickering.\n canvas.hidden = true;\n const hasHCM = !!(pageColors?.background && pageColors?.foreground);\n\n let showCanvas = isLastShow => {\n // In HCM, a final filter is applied on the canvas which means that\n // before it's applied we've normal colors. Consequently, to avoid to have\n // a final flash we just display it once all the drawing is done.\n if (!hasHCM || isLastShow) {\n canvas.hidden = false;\n showCanvas = null; // Only invoke the function once.\n }\n };\n canvasWrapper.append(canvas);\n this.canvas = canvas;\n\n const ctx = canvas.getContext(\"2d\", { alpha: false });\n const outputScale = (this.outputScale = new OutputScale());\n\n if (this.useOnlyCssZoom) {\n const actualSizeViewport = viewport.clone({\n scale: PixelsPerInch.PDF_TO_CSS_UNITS,\n });\n // Use a scale that makes the canvas have the originally intended size\n // of the page.\n outputScale.sx *= actualSizeViewport.width / width;\n outputScale.sy *= actualSizeViewport.height / height;\n }\n\n if (this.maxCanvasPixels > 0) {\n const pixelsInViewport = width * height;\n const maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport);\n if (outputScale.sx > maxScale || outputScale.sy > maxScale) {\n outputScale.sx = maxScale;\n outputScale.sy = maxScale;\n this.hasRestrictedScaling = true;\n } else {\n this.hasRestrictedScaling = false;\n }\n }\n const sfx = approximateFraction(outputScale.sx);\n const sfy = approximateFraction(outputScale.sy);\n\n canvas.width = roundToDivide(width * outputScale.sx, sfx[0]);\n canvas.height = roundToDivide(height * outputScale.sy, sfy[0]);\n const { style } = canvas;\n style.width = roundToDivide(width, sfx[1]) + \"px\";\n style.height = roundToDivide(height, sfy[1]) + \"px\";\n\n // Add the viewport so it's known what it was originally drawn with.\n this.#viewportMap.set(canvas, viewport);\n\n // Rendering area\n const transform = outputScale.scaled\n ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0]\n : null;\n const renderContext = {\n canvasContext: ctx,\n transform,\n viewport,\n annotationMode: this.#annotationMode,\n optionalContentConfigPromise: this._optionalContentConfigPromise,\n annotationCanvasMap: this._annotationCanvasMap,\n pageColors,\n };\n const renderTask = (this.renderTask = this.pdfPage.render(renderContext));\n renderTask.onContinue = renderContinueCallback;\n\n const resultPromise = renderTask.promise.then(\n async () => {\n showCanvas?.(true);\n await this.#finishRenderTask(renderTask);\n\n this.#renderTextLayer();\n\n if (this.annotationLayer) {\n await this.#renderAnnotationLayer();\n }\n\n if (!this.annotationEditorLayer) {\n const { annotationEditorUIManager } = this.#layerProperties();\n\n if (!annotationEditorUIManager) {\n return;\n }\n this.annotationEditorLayer = new AnnotationEditorLayerBuilder({\n uiManager: annotationEditorUIManager,\n pageDiv: div,\n pdfPage,\n l10n,\n accessibilityManager: this._accessibilityManager,\n annotationLayer: this.annotationLayer?.annotationLayer,\n });\n }\n this.#renderAnnotationEditorLayer();\n },\n error => {\n // When zooming with a `drawingDelay` set, avoid temporarily showing\n // a black canvas if rendering was cancelled before the `onContinue`-\n // callback had been invoked at least once.\n if (!(error instanceof RenderingCancelledException)) {\n showCanvas?.(true);\n }\n return this.#finishRenderTask(renderTask, error);\n }\n );\n\n if (pdfPage.isPureXfa) {\n if (!this.xfaLayer) {\n const { annotationStorage, linkService } = this.#layerProperties();\n\n this.xfaLayer = new XfaLayerBuilder({\n pageDiv: div,\n pdfPage,\n annotationStorage,\n linkService,\n });\n } else if (this.xfaLayer.div) {\n // The xfa layer needs to stay on top.\n div.append(this.xfaLayer.div);\n }\n this.#renderXfaLayer();\n }\n\n div.setAttribute(\"data-loaded\", true);\n\n this.eventBus.dispatch(\"pagerender\", {\n source: this,\n pageNumber: this.id,\n });\n return resultPromise;\n }\n\n /**\n * @param {string|null} label\n */\n setPageLabel(label) {\n this.pageLabel = typeof label === \"string\" ? label : null;\n\n if (this.pageLabel !== null) {\n this.div.setAttribute(\"data-page-label\", this.pageLabel);\n } else {\n this.div.removeAttribute(\"data-page-label\");\n }\n }\n\n /**\n * For use by the `PDFThumbnailView.setImage`-method.\n * @ignore\n */\n get thumbnailCanvas() {\n const { directDrawing, initialOptionalContent, regularAnnotations } =\n this.#useThumbnailCanvas;\n return directDrawing && initialOptionalContent && regularAnnotations\n ? this.canvas\n : null;\n }\n}\n\nexport { PDFPageView };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/editor/tools.js\").AnnotationEditorUIManager} AnnotationEditorUIManager */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/annotation_layer.js\").AnnotationLayer} AnnotationLayer */\n\nimport { AnnotationEditorLayer } from \"pdfjs-lib\";\nimport { NullL10n } from \"./l10n_utils.js\";\n\n/**\n * @typedef {Object} AnnotationEditorLayerBuilderOptions\n * @property {AnnotationEditorUIManager} [uiManager]\n * @property {HTMLDivElement} pageDiv\n * @property {PDFPageProxy} pdfPage\n * @property {IL10n} [l10n]\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {AnnotationLayer} [annotationLayer]\n */\n\nclass AnnotationEditorLayerBuilder {\n #annotationLayer = null;\n\n #uiManager;\n\n /**\n * @param {AnnotationEditorLayerBuilderOptions} options\n */\n constructor(options) {\n this.pageDiv = options.pageDiv;\n this.pdfPage = options.pdfPage;\n this.accessibilityManager = options.accessibilityManager;\n this.l10n = options.l10n || NullL10n;\n this.annotationEditorLayer = null;\n this.div = null;\n this._cancelled = false;\n this.#uiManager = options.uiManager;\n this.#annotationLayer = options.annotationLayer || null;\n }\n\n /**\n * @param {PageViewport} viewport\n * @param {string} intent (default value is 'display')\n */\n async render(viewport, intent = \"display\") {\n if (intent !== \"display\") {\n return;\n }\n\n if (this._cancelled) {\n return;\n }\n\n const clonedViewport = viewport.clone({ dontFlip: true });\n if (this.div) {\n this.annotationEditorLayer.update({ viewport: clonedViewport });\n this.show();\n return;\n }\n\n // Create an AnnotationEditor layer div\n const div = (this.div = document.createElement(\"div\"));\n div.className = \"annotationEditorLayer\";\n div.tabIndex = 0;\n div.hidden = true;\n this.pageDiv.append(div);\n\n this.annotationEditorLayer = new AnnotationEditorLayer({\n uiManager: this.#uiManager,\n div,\n accessibilityManager: this.accessibilityManager,\n pageIndex: this.pdfPage.pageNumber - 1,\n l10n: this.l10n,\n viewport: clonedViewport,\n annotationLayer: this.#annotationLayer,\n });\n\n const parameters = {\n viewport: clonedViewport,\n div,\n annotations: null,\n intent,\n };\n\n this.annotationEditorLayer.render(parameters);\n this.show();\n }\n\n cancel() {\n this._cancelled = true;\n\n if (!this.div) {\n return;\n }\n this.pageDiv = null;\n this.annotationEditorLayer.destroy();\n this.div.remove();\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n this.div.hidden = true;\n }\n\n show() {\n if (!this.div || this.annotationEditorLayer.isEmpty) {\n return;\n }\n this.div.hidden = false;\n }\n}\n\nexport { AnnotationEditorLayerBuilder };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./interfaces\").IDownloadManager} IDownloadManager */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./textaccessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n\nimport { AnnotationLayer } from \"pdfjs-lib\";\nimport { NullL10n } from \"./l10n_utils.js\";\nimport { PresentationModeState } from \"./ui_utils.js\";\n\n/**\n * @typedef {Object} AnnotationLayerBuilderOptions\n * @property {HTMLDivElement} pageDiv\n * @property {PDFPageProxy} pdfPage\n * @property {AnnotationStorage} [annotationStorage]\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * for annotation icons. Include trailing slash.\n * @property {boolean} renderForms\n * @property {IPDFLinkService} linkService\n * @property {IDownloadManager} downloadManager\n * @property {IL10n} l10n - Localization service.\n * @property {boolean} [enableScripting]\n * @property {Promise<boolean>} [hasJSActionsPromise]\n * @property {Promise<Object<string, Array<Object>> | null>}\n * [fieldObjectsPromise]\n * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]\n * @property {TextAccessibilityManager} [accessibilityManager]\n */\n\nclass AnnotationLayerBuilder {\n #onPresentationModeChanged = null;\n\n /**\n * @param {AnnotationLayerBuilderOptions} options\n */\n constructor({\n pageDiv,\n pdfPage,\n linkService,\n downloadManager,\n annotationStorage = null,\n imageResourcesPath = \"\",\n renderForms = true,\n l10n = NullL10n,\n enableScripting = false,\n hasJSActionsPromise = null,\n fieldObjectsPromise = null,\n annotationCanvasMap = null,\n accessibilityManager = null,\n }) {\n this.pageDiv = pageDiv;\n this.pdfPage = pdfPage;\n this.linkService = linkService;\n this.downloadManager = downloadManager;\n this.imageResourcesPath = imageResourcesPath;\n this.renderForms = renderForms;\n this.l10n = l10n;\n this.annotationStorage = annotationStorage;\n this.enableScripting = enableScripting;\n this._hasJSActionsPromise = hasJSActionsPromise || Promise.resolve(false);\n this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null);\n this._annotationCanvasMap = annotationCanvasMap;\n this._accessibilityManager = accessibilityManager;\n\n this.annotationLayer = null;\n this.div = null;\n this._cancelled = false;\n this._eventBus = linkService.eventBus;\n }\n\n /**\n * @param {PageViewport} viewport\n * @param {string} intent (default value is 'display')\n * @returns {Promise<void>} A promise that is resolved when rendering of the\n * annotations is complete.\n */\n async render(viewport, intent = \"display\") {\n if (this.div) {\n if (this._cancelled || !this.annotationLayer) {\n return;\n }\n // If an annotationLayer already exists, refresh its children's\n // transformation matrices.\n this.annotationLayer.update({\n viewport: viewport.clone({ dontFlip: true }),\n });\n return;\n }\n\n const [annotations, hasJSActions, fieldObjects] = await Promise.all([\n this.pdfPage.getAnnotations({ intent }),\n this._hasJSActionsPromise,\n this._fieldObjectsPromise,\n ]);\n if (this._cancelled) {\n return;\n }\n\n // Create an annotation layer div and render the annotations\n // if there is at least one annotation.\n const div = (this.div = document.createElement(\"div\"));\n div.className = \"annotationLayer\";\n this.pageDiv.append(div);\n\n if (annotations.length === 0) {\n this.hide();\n return;\n }\n\n this.annotationLayer = new AnnotationLayer({\n div,\n accessibilityManager: this._accessibilityManager,\n annotationCanvasMap: this._annotationCanvasMap,\n });\n\n this.annotationLayer.render({\n viewport: viewport.clone({ dontFlip: true }),\n annotations,\n page: this.pdfPage,\n imageResourcesPath: this.imageResourcesPath,\n renderForms: this.renderForms,\n linkService: this.linkService,\n downloadManager: this.downloadManager,\n annotationStorage: this.annotationStorage,\n enableScripting: this.enableScripting,\n hasJSActions,\n fieldObjects,\n });\n this.l10n.translate(div);\n\n // Ensure that interactive form elements in the annotationLayer are\n // disabled while PresentationMode is active (see issue 12232).\n if (this.linkService.isInPresentationMode) {\n this.#updatePresentationModeState(PresentationModeState.FULLSCREEN);\n }\n if (!this.#onPresentationModeChanged) {\n this.#onPresentationModeChanged = evt => {\n this.#updatePresentationModeState(evt.state);\n };\n this._eventBus?._on(\n \"presentationmodechanged\",\n this.#onPresentationModeChanged\n );\n }\n }\n\n cancel() {\n this._cancelled = true;\n\n if (this.#onPresentationModeChanged) {\n this._eventBus?._off(\n \"presentationmodechanged\",\n this.#onPresentationModeChanged\n );\n this.#onPresentationModeChanged = null;\n }\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n this.div.hidden = true;\n }\n\n #updatePresentationModeState(state) {\n if (!this.div) {\n return;\n }\n let disableFormElements = false;\n\n switch (state) {\n case PresentationModeState.FULLSCREEN:\n disableFormElements = true;\n break;\n case PresentationModeState.NORMAL:\n break;\n default:\n return;\n }\n for (const section of this.div.childNodes) {\n if (section.hasAttribute(\"data-internal-link\")) {\n continue;\n }\n section.inert = disableFormElements;\n }\n }\n}\n\nexport { AnnotationLayerBuilder };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PDF_ROLE_TO_HTML_ROLE = {\n // Document level structure types\n Document: null, // There's a \"document\" role, but it doesn't make sense here.\n DocumentFragment: null,\n // Grouping level structure types\n Part: \"group\",\n Sect: \"group\", // XXX: There's a \"section\" role, but it's abstract.\n Div: \"group\",\n Aside: \"note\",\n NonStruct: \"none\",\n // Block level structure types\n P: null,\n // H<n>,\n H: \"heading\",\n Title: null,\n FENote: \"note\",\n // Sub-block level structure type\n Sub: \"group\",\n // General inline level structure types\n Lbl: null,\n Span: null,\n Em: null,\n Strong: null,\n Link: \"link\",\n Annot: \"note\",\n Form: \"form\",\n // Ruby and Warichu structure types\n Ruby: null,\n RB: null,\n RT: null,\n RP: null,\n Warichu: null,\n WT: null,\n WP: null,\n // List standard structure types\n L: \"list\",\n LI: \"listitem\",\n LBody: null,\n // Table standard structure types\n Table: \"table\",\n TR: \"row\",\n TH: \"columnheader\",\n TD: \"cell\",\n THead: \"columnheader\",\n TBody: null,\n TFoot: null,\n // Standard structure type Caption\n Caption: null,\n // Standard structure type Figure\n Figure: \"figure\",\n // Standard structure type Formula\n Formula: null,\n // standard structure type Artifact\n Artifact: null,\n};\n\nconst HEADING_PATTERN = /^H(\\d+)$/;\n\nclass StructTreeLayerBuilder {\n #treeDom = undefined;\n\n get renderingDone() {\n return this.#treeDom !== undefined;\n }\n\n render(structTree) {\n if (this.#treeDom !== undefined) {\n return this.#treeDom;\n }\n const treeDom = this.#walk(structTree);\n treeDom?.classList.add(\"structTree\");\n return (this.#treeDom = treeDom);\n }\n\n hide() {\n if (this.#treeDom && !this.#treeDom.hidden) {\n this.#treeDom.hidden = true;\n }\n }\n\n show() {\n if (this.#treeDom?.hidden) {\n this.#treeDom.hidden = false;\n }\n }\n\n #setAttributes(structElement, htmlElement) {\n if (structElement.alt !== undefined) {\n htmlElement.setAttribute(\"aria-label\", structElement.alt);\n }\n if (structElement.id !== undefined) {\n htmlElement.setAttribute(\"aria-owns\", structElement.id);\n }\n if (structElement.lang !== undefined) {\n htmlElement.setAttribute(\"lang\", structElement.lang);\n }\n }\n\n #walk(node) {\n if (!node) {\n return null;\n }\n\n const element = document.createElement(\"span\");\n if (\"role\" in node) {\n const { role } = node;\n const match = role.match(HEADING_PATTERN);\n if (match) {\n element.setAttribute(\"role\", \"heading\");\n element.setAttribute(\"aria-level\", match[1]);\n } else if (PDF_ROLE_TO_HTML_ROLE[role]) {\n element.setAttribute(\"role\", PDF_ROLE_TO_HTML_ROLE[role]);\n }\n }\n\n this.#setAttributes(node, element);\n\n if (node.children) {\n if (node.children.length === 1 && \"id\" in node.children[0]) {\n // Often there is only one content node so just set the values on the\n // parent node to avoid creating an extra span.\n this.#setAttributes(node.children[0], element);\n } else {\n for (const kid of node.children) {\n element.append(this.#walk(kid));\n }\n }\n }\n return element;\n }\n}\n\nexport { StructTreeLayerBuilder };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { binarySearchFirstItem } from \"./ui_utils.js\";\n\n/**\n * This class aims to provide some methods:\n * - to reorder elements in the DOM with respect to the visual order;\n * - to create a link, using aria-owns, between spans in the textLayer and\n * annotations in the annotationLayer. The goal is to help to know\n * where the annotations are in the text flow.\n */\nclass TextAccessibilityManager {\n #enabled = false;\n\n #textChildren = null;\n\n #textNodes = new Map();\n\n #waitingElements = new Map();\n\n setTextMapping(textDivs) {\n this.#textChildren = textDivs;\n }\n\n /**\n * Compare the positions of two elements, it must correspond to\n * the visual ordering.\n *\n * @param {HTMLElement} e1\n * @param {HTMLElement} e2\n * @returns {number}\n */\n static #compareElementPositions(e1, e2) {\n const rect1 = e1.getBoundingClientRect();\n const rect2 = e2.getBoundingClientRect();\n\n if (rect1.width === 0 && rect1.height === 0) {\n return +1;\n }\n\n if (rect2.width === 0 && rect2.height === 0) {\n return -1;\n }\n\n const top1 = rect1.y;\n const bot1 = rect1.y + rect1.height;\n const mid1 = rect1.y + rect1.height / 2;\n\n const top2 = rect2.y;\n const bot2 = rect2.y + rect2.height;\n const mid2 = rect2.y + rect2.height / 2;\n\n if (mid1 <= top2 && mid2 >= bot1) {\n return -1;\n }\n\n if (mid2 <= top1 && mid1 >= bot2) {\n return +1;\n }\n\n const centerX1 = rect1.x + rect1.width / 2;\n const centerX2 = rect2.x + rect2.width / 2;\n\n return centerX1 - centerX2;\n }\n\n /**\n * Function called when the text layer has finished rendering.\n */\n enable() {\n if (this.#enabled) {\n throw new Error(\"TextAccessibilityManager is already enabled.\");\n }\n if (!this.#textChildren) {\n throw new Error(\"Text divs and strings have not been set.\");\n }\n\n this.#enabled = true;\n this.#textChildren = this.#textChildren.slice();\n this.#textChildren.sort(TextAccessibilityManager.#compareElementPositions);\n\n if (this.#textNodes.size > 0) {\n // Some links have been made before this manager has been disabled, hence\n // we restore them.\n const textChildren = this.#textChildren;\n for (const [id, nodeIndex] of this.#textNodes) {\n const element = document.getElementById(id);\n if (!element) {\n // If the page was *fully* reset the element no longer exists, and it\n // will be re-inserted later (i.e. when the annotationLayer renders).\n this.#textNodes.delete(id);\n continue;\n }\n this.#addIdToAriaOwns(id, textChildren[nodeIndex]);\n }\n }\n\n for (const [element, isRemovable] of this.#waitingElements) {\n this.addPointerInTextLayer(element, isRemovable);\n }\n this.#waitingElements.clear();\n }\n\n disable() {\n if (!this.#enabled) {\n return;\n }\n\n // Don't clear this.#textNodes which is used to rebuild the aria-owns\n // in case it's re-enabled at some point.\n\n this.#waitingElements.clear();\n this.#textChildren = null;\n this.#enabled = false;\n }\n\n /**\n * Remove an aria-owns id from a node in the text layer.\n * @param {HTMLElement} element\n */\n removePointerInTextLayer(element) {\n if (!this.#enabled) {\n this.#waitingElements.delete(element);\n return;\n }\n\n const children = this.#textChildren;\n if (!children || children.length === 0) {\n return;\n }\n\n const { id } = element;\n const nodeIndex = this.#textNodes.get(id);\n if (nodeIndex === undefined) {\n return;\n }\n\n const node = children[nodeIndex];\n\n this.#textNodes.delete(id);\n let owns = node.getAttribute(\"aria-owns\");\n if (owns?.includes(id)) {\n owns = owns\n .split(\" \")\n .filter(x => x !== id)\n .join(\" \");\n if (owns) {\n node.setAttribute(\"aria-owns\", owns);\n } else {\n node.removeAttribute(\"aria-owns\");\n node.setAttribute(\"role\", \"presentation\");\n }\n }\n }\n\n #addIdToAriaOwns(id, node) {\n const owns = node.getAttribute(\"aria-owns\");\n if (!owns?.includes(id)) {\n node.setAttribute(\"aria-owns\", owns ? `${owns} ${id}` : id);\n }\n node.removeAttribute(\"role\");\n }\n\n /**\n * Find the text node which is the nearest and add an aria-owns attribute\n * in order to correctly position this editor in the text flow.\n * @param {HTMLElement} element\n * @param {boolean} isRemovable\n */\n addPointerInTextLayer(element, isRemovable) {\n const { id } = element;\n if (!id) {\n return;\n }\n\n if (!this.#enabled) {\n // The text layer needs to be there, so we postpone the association.\n this.#waitingElements.set(element, isRemovable);\n return;\n }\n\n if (isRemovable) {\n this.removePointerInTextLayer(element);\n }\n\n const children = this.#textChildren;\n if (!children || children.length === 0) {\n return;\n }\n\n const index = binarySearchFirstItem(\n children,\n node =>\n TextAccessibilityManager.#compareElementPositions(element, node) < 0\n );\n\n const nodeIndex = Math.max(0, index - 1);\n this.#addIdToAriaOwns(id, children[nodeIndex]);\n this.#textNodes.set(id, nodeIndex);\n }\n\n /**\n * Move a div in the DOM in order to respect the visual order.\n * @param {HTMLDivElement} element\n */\n moveElementInDOM(container, element, contentElement, isRemovable) {\n this.addPointerInTextLayer(contentElement, isRemovable);\n\n if (!container.hasChildNodes()) {\n container.append(element);\n return;\n }\n\n const children = Array.from(container.childNodes).filter(\n node => node !== element\n );\n\n if (children.length === 0) {\n return;\n }\n\n const elementToCompare = contentElement || element;\n const index = binarySearchFirstItem(\n children,\n node =>\n TextAccessibilityManager.#compareElementPositions(\n elementToCompare,\n node\n ) < 0\n );\n\n if (index === 0) {\n children[0].before(element);\n } else {\n children[index - 1].after(element);\n }\n }\n}\n\nexport { TextAccessibilityManager };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_find_controller\").PDFFindController} PDFFindController */\n\n/**\n * @typedef {Object} TextHighlighterOptions\n * @property {PDFFindController} findController\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} pageIndex - The page index.\n */\n\n/**\n * TextHighlighter handles highlighting matches from the FindController in\n * either the text layer or XFA layer depending on the type of document.\n */\nclass TextHighlighter {\n /**\n * @param {TextHighlighterOptions} options\n */\n constructor({ findController, eventBus, pageIndex }) {\n this.findController = findController;\n this.matches = [];\n this.eventBus = eventBus;\n this.pageIdx = pageIndex;\n this._onUpdateTextLayerMatches = null;\n this.textDivs = null;\n this.textContentItemsStr = null;\n this.enabled = false;\n }\n\n /**\n * Store two arrays that will map DOM nodes to text they should contain.\n * The arrays should be of equal length and the array element at each index\n * should correspond to the other. e.g.\n * `items[0] = \"<span>Item 0</span>\" and texts[0] = \"Item 0\";\n *\n * @param {Array<Node>} divs\n * @param {Array<string>} texts\n */\n setTextMapping(divs, texts) {\n this.textDivs = divs;\n this.textContentItemsStr = texts;\n }\n\n /**\n * Start listening for events to update the highlighter and check if there are\n * any current matches that need be highlighted.\n */\n enable() {\n if (!this.textDivs || !this.textContentItemsStr) {\n throw new Error(\"Text divs and strings have not been set.\");\n }\n if (this.enabled) {\n throw new Error(\"TextHighlighter is already enabled.\");\n }\n this.enabled = true;\n if (!this._onUpdateTextLayerMatches) {\n this._onUpdateTextLayerMatches = evt => {\n if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) {\n this._updateMatches();\n }\n };\n this.eventBus._on(\n \"updatetextlayermatches\",\n this._onUpdateTextLayerMatches\n );\n }\n this._updateMatches();\n }\n\n disable() {\n if (!this.enabled) {\n return;\n }\n this.enabled = false;\n if (this._onUpdateTextLayerMatches) {\n this.eventBus._off(\n \"updatetextlayermatches\",\n this._onUpdateTextLayerMatches\n );\n this._onUpdateTextLayerMatches = null;\n }\n this._updateMatches(/* reset = */ true);\n }\n\n _convertMatches(matches, matchesLength) {\n // Early exit if there is nothing to convert.\n if (!matches) {\n return [];\n }\n const { textContentItemsStr } = this;\n\n let i = 0,\n iIndex = 0;\n const end = textContentItemsStr.length - 1;\n const result = [];\n\n for (let m = 0, mm = matches.length; m < mm; m++) {\n // Calculate the start position.\n let matchIdx = matches[m];\n\n // Loop over the divIdxs.\n while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) {\n iIndex += textContentItemsStr[i].length;\n i++;\n }\n\n if (i === textContentItemsStr.length) {\n console.error(\"Could not find a matching mapping\");\n }\n\n const match = {\n begin: {\n divIdx: i,\n offset: matchIdx - iIndex,\n },\n };\n\n // Calculate the end position.\n matchIdx += matchesLength[m];\n\n // Somewhat the same array as above, but use > instead of >= to get\n // the end position right.\n while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {\n iIndex += textContentItemsStr[i].length;\n i++;\n }\n\n match.end = {\n divIdx: i,\n offset: matchIdx - iIndex,\n };\n result.push(match);\n }\n return result;\n }\n\n _renderMatches(matches) {\n // Early exit if there is nothing to render.\n if (matches.length === 0) {\n return;\n }\n const { findController, pageIdx } = this;\n const { textContentItemsStr, textDivs } = this;\n\n const isSelectedPage = pageIdx === findController.selected.pageIdx;\n const selectedMatchIdx = findController.selected.matchIdx;\n const highlightAll = findController.state.highlightAll;\n let prevEnd = null;\n const infinity = {\n divIdx: -1,\n offset: undefined,\n };\n\n function beginText(begin, className) {\n const divIdx = begin.divIdx;\n textDivs[divIdx].textContent = \"\";\n return appendTextToDiv(divIdx, 0, begin.offset, className);\n }\n\n function appendTextToDiv(divIdx, fromOffset, toOffset, className) {\n let div = textDivs[divIdx];\n if (div.nodeType === Node.TEXT_NODE) {\n const span = document.createElement(\"span\");\n div.before(span);\n span.append(div);\n textDivs[divIdx] = span;\n div = span;\n }\n const content = textContentItemsStr[divIdx].substring(\n fromOffset,\n toOffset\n );\n const node = document.createTextNode(content);\n if (className) {\n const span = document.createElement(\"span\");\n span.className = `${className} appended`;\n span.append(node);\n div.append(span);\n return className.includes(\"selected\") ? span.offsetLeft : 0;\n }\n div.append(node);\n return 0;\n }\n\n let i0 = selectedMatchIdx,\n i1 = i0 + 1;\n if (highlightAll) {\n i0 = 0;\n i1 = matches.length;\n } else if (!isSelectedPage) {\n // Not highlighting all and this isn't the selected page, so do nothing.\n return;\n }\n\n let lastDivIdx = -1;\n let lastOffset = -1;\n for (let i = i0; i < i1; i++) {\n const match = matches[i];\n const begin = match.begin;\n if (begin.divIdx === lastDivIdx && begin.offset === lastOffset) {\n // It's possible to be in this situation if we searched for a 'f' and we\n // have a ligature 'ff' in the text. The 'ff' has to be highlighted two\n // times.\n continue;\n }\n lastDivIdx = begin.divIdx;\n lastOffset = begin.offset;\n\n const end = match.end;\n const isSelected = isSelectedPage && i === selectedMatchIdx;\n const highlightSuffix = isSelected ? \" selected\" : \"\";\n let selectedLeft = 0;\n\n // Match inside new div.\n if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {\n // If there was a previous div, then add the text at the end.\n if (prevEnd !== null) {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);\n }\n // Clear the divs and set the content until the starting point.\n beginText(begin);\n } else {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset);\n }\n\n if (begin.divIdx === end.divIdx) {\n selectedLeft = appendTextToDiv(\n begin.divIdx,\n begin.offset,\n end.offset,\n \"highlight\" + highlightSuffix\n );\n } else {\n selectedLeft = appendTextToDiv(\n begin.divIdx,\n begin.offset,\n infinity.offset,\n \"highlight begin\" + highlightSuffix\n );\n for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) {\n textDivs[n0].className = \"highlight middle\" + highlightSuffix;\n }\n beginText(end, \"highlight end\" + highlightSuffix);\n }\n prevEnd = end;\n\n if (isSelected) {\n // Attempt to scroll the selected match into view.\n findController.scrollMatchIntoView({\n element: textDivs[begin.divIdx],\n selectedLeft,\n pageIndex: pageIdx,\n matchIndex: selectedMatchIdx,\n });\n }\n }\n\n if (prevEnd) {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);\n }\n }\n\n _updateMatches(reset = false) {\n if (!this.enabled && !reset) {\n return;\n }\n const { findController, matches, pageIdx } = this;\n const { textContentItemsStr, textDivs } = this;\n let clearedUntilDivIdx = -1;\n\n // Clear all current matches.\n for (const match of matches) {\n const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);\n for (let n = begin, end = match.end.divIdx; n <= end; n++) {\n const div = textDivs[n];\n div.textContent = textContentItemsStr[n];\n div.className = \"\";\n }\n clearedUntilDivIdx = match.end.divIdx + 1;\n }\n\n if (!findController?.highlightMatches || reset) {\n return;\n }\n // Convert the matches on the `findController` into the match format\n // used for the textLayer.\n const pageMatches = findController.pageMatches[pageIdx] || null;\n const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null;\n\n this.matches = this._convertMatches(pageMatches, pageMatchesLength);\n this._renderMatches(this.matches);\n }\n}\n\nexport { TextHighlighter };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"../src/display/api\").TextContent} TextContent */\n/** @typedef {import(\"./text_highlighter\").TextHighlighter} TextHighlighter */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n\nimport { normalizeUnicode, renderTextLayer, updateTextLayer } from \"pdfjs-lib\";\nimport { removeNullCharacters } from \"./ui_utils.js\";\n\n/**\n * @typedef {Object} TextLayerBuilderOptions\n * @property {TextHighlighter} highlighter - Optional object that will handle\n * highlighting text from the find controller.\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {boolean} [isOffscreenCanvasSupported] - Allows to use an\n * OffscreenCanvas if needed.\n */\n\n/**\n * The text layer builder provides text selection functionality for the PDF.\n * It does this by creating overlay divs over the PDF's text. These divs\n * contain text that matches the PDF text they are overlaying.\n */\nclass TextLayerBuilder {\n #enablePermissions = false;\n\n #rotation = 0;\n\n #scale = 0;\n\n #textContentSource = null;\n\n constructor({\n highlighter = null,\n accessibilityManager = null,\n isOffscreenCanvasSupported = true,\n enablePermissions = false,\n }) {\n this.textContentItemsStr = [];\n this.renderingDone = false;\n this.textDivs = [];\n this.textDivProperties = new WeakMap();\n this.textLayerRenderTask = null;\n this.highlighter = highlighter;\n this.accessibilityManager = accessibilityManager;\n this.isOffscreenCanvasSupported = isOffscreenCanvasSupported;\n this.#enablePermissions = enablePermissions === true;\n\n this.div = document.createElement(\"div\");\n this.div.className = \"textLayer\";\n this.hide();\n }\n\n #finishRendering() {\n this.renderingDone = true;\n\n const endOfContent = document.createElement(\"div\");\n endOfContent.className = \"endOfContent\";\n this.div.append(endOfContent);\n\n this.#bindMouse();\n }\n\n get numTextDivs() {\n return this.textDivs.length;\n }\n\n /**\n * Renders the text layer.\n * @param {PageViewport} viewport\n */\n async render(viewport) {\n if (!this.#textContentSource) {\n throw new Error('No \"textContentSource\" parameter specified.');\n }\n\n const scale = viewport.scale * (globalThis.devicePixelRatio || 1);\n const { rotation } = viewport;\n if (this.renderingDone) {\n const mustRotate = rotation !== this.#rotation;\n const mustRescale = scale !== this.#scale;\n if (mustRotate || mustRescale) {\n this.hide();\n updateTextLayer({\n container: this.div,\n viewport,\n textDivs: this.textDivs,\n textDivProperties: this.textDivProperties,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n mustRescale,\n mustRotate,\n });\n this.#scale = scale;\n this.#rotation = rotation;\n }\n this.show();\n return;\n }\n\n this.cancel();\n this.highlighter?.setTextMapping(this.textDivs, this.textContentItemsStr);\n this.accessibilityManager?.setTextMapping(this.textDivs);\n\n this.textLayerRenderTask = renderTextLayer({\n textContentSource: this.#textContentSource,\n container: this.div,\n viewport,\n textDivs: this.textDivs,\n textDivProperties: this.textDivProperties,\n textContentItemsStr: this.textContentItemsStr,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n });\n\n await this.textLayerRenderTask.promise;\n this.#finishRendering();\n this.#scale = scale;\n this.#rotation = rotation;\n this.show();\n this.accessibilityManager?.enable();\n }\n\n hide() {\n if (!this.div.hidden) {\n // We turn off the highlighter in order to avoid to scroll into view an\n // element of the text layer which could be hidden.\n this.highlighter?.disable();\n this.div.hidden = true;\n }\n }\n\n show() {\n if (this.div.hidden && this.renderingDone) {\n this.div.hidden = false;\n this.highlighter?.enable();\n }\n }\n\n /**\n * Cancel rendering of the text layer.\n */\n cancel() {\n if (this.textLayerRenderTask) {\n this.textLayerRenderTask.cancel();\n this.textLayerRenderTask = null;\n }\n this.highlighter?.disable();\n this.accessibilityManager?.disable();\n this.textContentItemsStr.length = 0;\n this.textDivs.length = 0;\n this.textDivProperties = new WeakMap();\n }\n\n /**\n * @param {ReadableStream | TextContent} source\n */\n setTextContentSource(source) {\n this.cancel();\n this.#textContentSource = source;\n }\n\n /**\n * Improves text selection by adding an additional div where the mouse was\n * clicked. This reduces flickering of the content if the mouse is slowly\n * dragged up or down.\n */\n #bindMouse() {\n const { div } = this;\n\n div.addEventListener(\"mousedown\", evt => {\n const end = div.querySelector(\".endOfContent\");\n if (!end) {\n return;\n }\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n // On non-Firefox browsers, the selection will feel better if the height\n // of the `endOfContent` div is adjusted to start at mouse click\n // location. This avoids flickering when the selection moves up.\n // However it does not work when selection is started on empty space.\n let adjustTop = evt.target !== div;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n adjustTop &&=\n getComputedStyle(end).getPropertyValue(\"-moz-user-select\") !==\n \"none\";\n }\n if (adjustTop) {\n const divBounds = div.getBoundingClientRect();\n const r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height);\n end.style.top = (r * 100).toFixed(2) + \"%\";\n }\n }\n end.classList.add(\"active\");\n });\n\n div.addEventListener(\"mouseup\", () => {\n const end = div.querySelector(\".endOfContent\");\n if (!end) {\n return;\n }\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n end.style.top = \"\";\n }\n end.classList.remove(\"active\");\n });\n\n div.addEventListener(\"copy\", event => {\n if (!this.#enablePermissions) {\n const selection = document.getSelection();\n event.clipboardData.setData(\n \"text/plain\",\n removeNullCharacters(normalizeUnicode(selection.toString()))\n );\n }\n event.preventDefault();\n event.stopPropagation();\n });\n }\n}\n\nexport { TextLayerBuilder };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { XfaLayer } from \"pdfjs-lib\";\n\n/**\n * @typedef {Object} XfaLayerBuilderOptions\n * @property {HTMLDivElement} pageDiv\n * @property {PDFPageProxy} pdfPage\n * @property {AnnotationStorage} [annotationStorage]\n * @property {IPDFLinkService} linkService\n * @property {Object} [xfaHtml]\n */\n\nclass XfaLayerBuilder {\n /**\n * @param {XfaLayerBuilderOptions} options\n */\n constructor({\n pageDiv,\n pdfPage,\n annotationStorage = null,\n linkService,\n xfaHtml = null,\n }) {\n this.pageDiv = pageDiv;\n this.pdfPage = pdfPage;\n this.annotationStorage = annotationStorage;\n this.linkService = linkService;\n this.xfaHtml = xfaHtml;\n\n this.div = null;\n this._cancelled = false;\n }\n\n /**\n * @param {PageViewport} viewport\n * @param {string} intent (default value is 'display')\n * @returns {Promise<Object | void>} A promise that is resolved when rendering\n * of the XFA layer is complete. The first rendering will return an object\n * with a `textDivs` property that can be used with the TextHighlighter.\n */\n async render(viewport, intent = \"display\") {\n if (intent === \"print\") {\n const parameters = {\n viewport: viewport.clone({ dontFlip: true }),\n div: this.div,\n xfaHtml: this.xfaHtml,\n annotationStorage: this.annotationStorage,\n linkService: this.linkService,\n intent,\n };\n\n // Create an xfa layer div and render the form\n const div = document.createElement(\"div\");\n this.pageDiv.append(div);\n parameters.div = div;\n\n return XfaLayer.render(parameters);\n }\n\n // intent === \"display\"\n const xfaHtml = await this.pdfPage.getXfa();\n if (this._cancelled || !xfaHtml) {\n return { textDivs: [] };\n }\n\n const parameters = {\n viewport: viewport.clone({ dontFlip: true }),\n div: this.div,\n xfaHtml,\n annotationStorage: this.annotationStorage,\n linkService: this.linkService,\n intent,\n };\n\n if (this.div) {\n return XfaLayer.update(parameters);\n }\n // Create an xfa layer div and render the form\n this.div = document.createElement(\"div\");\n this.pageDiv.append(this.div);\n parameters.div = this.div;\n\n return XfaLayer.render(parameters);\n }\n\n cancel() {\n this._cancelled = true;\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n this.div.hidden = true;\n }\n}\n\nexport { XfaLayerBuilder };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CursorTool,\n ScrollMode,\n SpreadMode,\n toggleCheckedBtn,\n toggleExpandedBtn,\n} from \"./ui_utils.js\";\nimport { PagesCountLimit } from \"./pdf_viewer.js\";\n\n/**\n * @typedef {Object} SecondaryToolbarOptions\n * @property {HTMLDivElement} toolbar - Container for the secondary toolbar.\n * @property {HTMLButtonElement} toggleButton - Button to toggle the visibility\n * of the secondary toolbar.\n * @property {HTMLButtonElement} presentationModeButton - Button for entering\n * presentation mode.\n * @property {HTMLButtonElement} openFileButton - Button to open a file.\n * @property {HTMLButtonElement} printButton - Button to print the document.\n * @property {HTMLButtonElement} downloadButton - Button to download the\n * document.\n * @property {HTMLAnchorElement} viewBookmarkButton - Button to obtain a\n * bookmark link to the current location in the document.\n * @property {HTMLButtonElement} firstPageButton - Button to go to the first\n * page in the document.\n * @property {HTMLButtonElement} lastPageButton - Button to go to the last page\n * in the document.\n * @property {HTMLButtonElement} pageRotateCwButton - Button to rotate the pages\n * clockwise.\n * @property {HTMLButtonElement} pageRotateCcwButton - Button to rotate the\n * pages counterclockwise.\n * @property {HTMLButtonElement} cursorSelectToolButton - Button to enable the\n * select tool.\n * @property {HTMLButtonElement} cursorHandToolButton - Button to enable the\n * hand tool.\n * @property {HTMLButtonElement} documentPropertiesButton - Button for opening\n * the document properties dialog.\n */\n\nclass SecondaryToolbar {\n /**\n * @param {SecondaryToolbarOptions} options\n * @param {EventBus} eventBus\n */\n constructor(options, eventBus, externalServices) {\n this.toolbar = options.toolbar;\n this.toggleButton = options.toggleButton;\n this.buttons = [\n {\n element: options.presentationModeButton,\n eventName: \"presentationmode\",\n close: true,\n },\n { element: options.printButton, eventName: \"print\", close: true },\n { element: options.downloadButton, eventName: \"download\", close: true },\n { element: options.viewBookmarkButton, eventName: null, close: true },\n { element: options.firstPageButton, eventName: \"firstpage\", close: true },\n { element: options.lastPageButton, eventName: \"lastpage\", close: true },\n {\n element: options.pageRotateCwButton,\n eventName: \"rotatecw\",\n close: false,\n },\n {\n element: options.pageRotateCcwButton,\n eventName: \"rotateccw\",\n close: false,\n },\n {\n element: options.cursorSelectToolButton,\n eventName: \"switchcursortool\",\n eventDetails: { tool: CursorTool.SELECT },\n close: true,\n },\n {\n element: options.cursorHandToolButton,\n eventName: \"switchcursortool\",\n eventDetails: { tool: CursorTool.HAND },\n close: true,\n },\n {\n element: options.scrollPageButton,\n eventName: \"switchscrollmode\",\n eventDetails: { mode: ScrollMode.PAGE },\n close: true,\n },\n {\n element: options.scrollVerticalButton,\n eventName: \"switchscrollmode\",\n eventDetails: { mode: ScrollMode.VERTICAL },\n close: true,\n },\n {\n element: options.scrollHorizontalButton,\n eventName: \"switchscrollmode\",\n eventDetails: { mode: ScrollMode.HORIZONTAL },\n close: true,\n },\n {\n element: options.scrollWrappedButton,\n eventName: \"switchscrollmode\",\n eventDetails: { mode: ScrollMode.WRAPPED },\n close: true,\n },\n {\n element: options.spreadNoneButton,\n eventName: \"switchspreadmode\",\n eventDetails: { mode: SpreadMode.NONE },\n close: true,\n },\n {\n element: options.spreadOddButton,\n eventName: \"switchspreadmode\",\n eventDetails: { mode: SpreadMode.ODD },\n close: true,\n },\n {\n element: options.spreadEvenButton,\n eventName: \"switchspreadmode\",\n eventDetails: { mode: SpreadMode.EVEN },\n close: true,\n },\n {\n element: options.documentPropertiesButton,\n eventName: \"documentproperties\",\n close: true,\n },\n ];\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this.buttons.push({\n element: options.openFileButton,\n eventName: \"openfile\",\n close: true,\n });\n }\n this.items = {\n firstPage: options.firstPageButton,\n lastPage: options.lastPageButton,\n pageRotateCw: options.pageRotateCwButton,\n pageRotateCcw: options.pageRotateCcwButton,\n };\n\n this.eventBus = eventBus;\n this.externalServices = externalServices;\n this.opened = false;\n\n // Bind the event listeners for click, cursor tool, and scroll/spread mode\n // actions.\n this.#bindClickListeners();\n this.#bindCursorToolsListener(options);\n this.#bindScrollModeListener(options);\n this.#bindSpreadModeListener(options);\n\n this.reset();\n }\n\n /**\n * @type {boolean}\n */\n get isOpen() {\n return this.opened;\n }\n\n setPageNumber(pageNumber) {\n this.pageNumber = pageNumber;\n this.#updateUIState();\n }\n\n setPagesCount(pagesCount) {\n this.pagesCount = pagesCount;\n this.#updateUIState();\n }\n\n reset() {\n this.pageNumber = 0;\n this.pagesCount = 0;\n this.#updateUIState();\n\n // Reset the Scroll/Spread buttons too, since they're document specific.\n this.eventBus.dispatch(\"secondarytoolbarreset\", { source: this });\n }\n\n #updateUIState() {\n this.items.firstPage.disabled = this.pageNumber <= 1;\n this.items.lastPage.disabled = this.pageNumber >= this.pagesCount;\n this.items.pageRotateCw.disabled = this.pagesCount === 0;\n this.items.pageRotateCcw.disabled = this.pagesCount === 0;\n }\n\n #bindClickListeners() {\n // Button to toggle the visibility of the secondary toolbar.\n this.toggleButton.addEventListener(\"click\", this.toggle.bind(this));\n\n // All items within the secondary toolbar.\n for (const { element, eventName, close, eventDetails } of this.buttons) {\n element.addEventListener(\"click\", evt => {\n if (eventName !== null) {\n this.eventBus.dispatch(eventName, { source: this, ...eventDetails });\n }\n if (close) {\n this.close();\n }\n this.externalServices.reportTelemetry({\n type: \"buttons\",\n data: { id: element.id },\n });\n });\n }\n }\n\n #bindCursorToolsListener({ cursorSelectToolButton, cursorHandToolButton }) {\n this.eventBus._on(\"cursortoolchanged\", ({ tool }) => {\n toggleCheckedBtn(cursorSelectToolButton, tool === CursorTool.SELECT);\n toggleCheckedBtn(cursorHandToolButton, tool === CursorTool.HAND);\n });\n }\n\n #bindScrollModeListener({\n scrollPageButton,\n scrollVerticalButton,\n scrollHorizontalButton,\n scrollWrappedButton,\n spreadNoneButton,\n spreadOddButton,\n spreadEvenButton,\n }) {\n const scrollModeChanged = ({ mode }) => {\n toggleCheckedBtn(scrollPageButton, mode === ScrollMode.PAGE);\n toggleCheckedBtn(scrollVerticalButton, mode === ScrollMode.VERTICAL);\n toggleCheckedBtn(scrollHorizontalButton, mode === ScrollMode.HORIZONTAL);\n toggleCheckedBtn(scrollWrappedButton, mode === ScrollMode.WRAPPED);\n\n // Permanently *disable* the Scroll buttons when PAGE-scrolling is being\n // enforced for *very* long/large documents; please see the `BaseViewer`.\n const forceScrollModePage =\n this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE;\n scrollPageButton.disabled = forceScrollModePage;\n scrollVerticalButton.disabled = forceScrollModePage;\n scrollHorizontalButton.disabled = forceScrollModePage;\n scrollWrappedButton.disabled = forceScrollModePage;\n\n // Temporarily *disable* the Spread buttons when horizontal scrolling is\n // enabled, since the non-default Spread modes doesn't affect the layout.\n const isHorizontal = mode === ScrollMode.HORIZONTAL;\n spreadNoneButton.disabled = isHorizontal;\n spreadOddButton.disabled = isHorizontal;\n spreadEvenButton.disabled = isHorizontal;\n };\n this.eventBus._on(\"scrollmodechanged\", scrollModeChanged);\n\n this.eventBus._on(\"secondarytoolbarreset\", evt => {\n if (evt.source === this) {\n scrollModeChanged({ mode: ScrollMode.VERTICAL });\n }\n });\n }\n\n #bindSpreadModeListener({\n spreadNoneButton,\n spreadOddButton,\n spreadEvenButton,\n }) {\n const spreadModeChanged = ({ mode }) => {\n toggleCheckedBtn(spreadNoneButton, mode === SpreadMode.NONE);\n toggleCheckedBtn(spreadOddButton, mode === SpreadMode.ODD);\n toggleCheckedBtn(spreadEvenButton, mode === SpreadMode.EVEN);\n };\n this.eventBus._on(\"spreadmodechanged\", spreadModeChanged);\n\n this.eventBus._on(\"secondarytoolbarreset\", evt => {\n if (evt.source === this) {\n spreadModeChanged({ mode: SpreadMode.NONE });\n }\n });\n }\n\n open() {\n if (this.opened) {\n return;\n }\n this.opened = true;\n toggleExpandedBtn(this.toggleButton, true, this.toolbar);\n }\n\n close() {\n if (!this.opened) {\n return;\n }\n this.opened = false;\n toggleExpandedBtn(this.toggleButton, false, this.toolbar);\n }\n\n toggle() {\n if (this.opened) {\n this.close();\n } else {\n this.open();\n }\n }\n}\n\nexport { SecondaryToolbar };\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n animationStarted,\n DEFAULT_SCALE,\n DEFAULT_SCALE_VALUE,\n MAX_SCALE,\n MIN_SCALE,\n noContextMenuHandler,\n toggleCheckedBtn,\n} from \"./ui_utils.js\";\nimport { AnnotationEditorType } from \"pdfjs-lib\";\n\nconst PAGE_NUMBER_LOADING_INDICATOR = \"visiblePageIsLoading\";\n\n/**\n * @typedef {Object} ToolbarOptions\n * @property {HTMLDivElement} container - Container for the secondary toolbar.\n * @property {HTMLSpanElement} numPages - Label that contains number of pages.\n * @property {HTMLInputElement} pageNumber - Control for display and user input\n * of the current page number.\n * @property {HTMLSelectElement} scaleSelect - Scale selection control.\n * Its width is adjusted, when necessary, on UI localization.\n * @property {HTMLOptionElement} customScaleOption - The item used to display\n * a non-predefined scale.\n * @property {HTMLButtonElement} previous - Button to go to the previous page.\n * @property {HTMLButtonElement} next - Button to go to the next page.\n * @property {HTMLButtonElement} zoomIn - Button to zoom in the pages.\n * @property {HTMLButtonElement} zoomOut - Button to zoom out the pages.\n * @property {HTMLButtonElement} viewFind - Button to open find bar.\n * @property {HTMLButtonElement} openFile - Button to open a new document.\n * @property {HTMLButtonElement} editorFreeTextButton - Button to switch to\n * FreeText editing.\n * @property {HTMLButtonElement} download - Button to download the document.\n */\n\nclass Toolbar {\n #wasLocalized = false;\n\n /**\n * @param {ToolbarOptions} options\n * @param {EventBus} eventBus\n * @param {IL10n} l10n - Localization service.\n */\n constructor(options, eventBus, l10n) {\n this.toolbar = options.container;\n this.eventBus = eventBus;\n this.l10n = l10n;\n this.buttons = [\n { element: options.previous, eventName: \"previouspage\" },\n { element: options.next, eventName: \"nextpage\" },\n { element: options.zoomIn, eventName: \"zoomin\" },\n { element: options.zoomOut, eventName: \"zoomout\" },\n { element: options.print, eventName: \"print\" },\n { element: options.download, eventName: \"download\" },\n {\n element: options.editorFreeTextButton,\n eventName: \"switchannotationeditormode\",\n eventDetails: {\n get mode() {\n const { classList } = options.editorFreeTextButton;\n return classList.contains(\"toggled\")\n ? AnnotationEditorType.NONE\n : AnnotationEditorType.FREETEXT;\n },\n },\n },\n {\n element: options.editorInkButton,\n eventName: \"switchannotationeditormode\",\n eventDetails: {\n get mode() {\n const { classList } = options.editorInkButton;\n return classList.contains(\"toggled\")\n ? AnnotationEditorType.NONE\n : AnnotationEditorType.INK;\n },\n },\n },\n ];\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this.buttons.push({ element: options.openFile, eventName: \"openfile\" });\n }\n this.items = {\n numPages: options.numPages,\n pageNumber: options.pageNumber,\n scaleSelect: options.scaleSelect,\n customScaleOption: options.customScaleOption,\n previous: options.previous,\n next: options.next,\n zoomIn: options.zoomIn,\n zoomOut: options.zoomOut,\n };\n\n // Bind the event listeners for click and various other actions.\n this.#bindListeners(options);\n\n this.reset();\n }\n\n setPageNumber(pageNumber, pageLabel) {\n this.pageNumber = pageNumber;\n this.pageLabel = pageLabel;\n this.#updateUIState(false);\n }\n\n setPagesCount(pagesCount, hasPageLabels) {\n this.pagesCount = pagesCount;\n this.hasPageLabels = hasPageLabels;\n this.#updateUIState(true);\n }\n\n setPageScale(pageScaleValue, pageScale) {\n this.pageScaleValue = (pageScaleValue || pageScale).toString();\n this.pageScale = pageScale;\n this.#updateUIState(false);\n }\n\n reset() {\n this.pageNumber = 0;\n this.pageLabel = null;\n this.hasPageLabels = false;\n this.pagesCount = 0;\n this.pageScaleValue = DEFAULT_SCALE_VALUE;\n this.pageScale = DEFAULT_SCALE;\n this.#updateUIState(true);\n this.updateLoadingIndicatorState();\n\n // Reset the Editor buttons too, since they're document specific.\n this.eventBus.dispatch(\"toolbarreset\", { source: this });\n }\n\n #bindListeners(options) {\n const { pageNumber, scaleSelect } = this.items;\n const self = this;\n\n // The buttons within the toolbar.\n for (const { element, eventName, eventDetails } of this.buttons) {\n element.addEventListener(\"click\", evt => {\n if (eventName !== null) {\n this.eventBus.dispatch(eventName, { source: this, ...eventDetails });\n }\n });\n }\n // The non-button elements within the toolbar.\n pageNumber.addEventListener(\"click\", function () {\n this.select();\n });\n pageNumber.addEventListener(\"change\", function () {\n self.eventBus.dispatch(\"pagenumberchanged\", {\n source: self,\n value: this.value,\n });\n });\n\n scaleSelect.addEventListener(\"change\", function () {\n if (this.value === \"custom\") {\n return;\n }\n self.eventBus.dispatch(\"scalechanged\", {\n source: self,\n value: this.value,\n });\n });\n // Here we depend on browsers dispatching the \"click\" event *after* the\n // \"change\" event, when the <select>-element changes.\n scaleSelect.addEventListener(\"click\", function (evt) {\n const target = evt.target;\n // Remove focus when an <option>-element was *clicked*, to improve the UX\n // for mouse users (fixes bug 1300525 and issue 4923).\n if (\n this.value === self.pageScaleValue &&\n target.tagName.toUpperCase() === \"OPTION\"\n ) {\n this.blur();\n }\n });\n // Suppress context menus for some controls.\n scaleSelect.oncontextmenu = noContextMenuHandler;\n\n this.eventBus._on(\"localized\", () => {\n this.#wasLocalized = true;\n this.#adjustScaleWidth();\n this.#updateUIState(true);\n });\n\n this.#bindEditorToolsListener(options);\n }\n\n #bindEditorToolsListener({\n editorFreeTextButton,\n editorFreeTextParamsToolbar,\n editorInkButton,\n editorInkParamsToolbar,\n }) {\n const editorModeChanged = ({ mode }) => {\n toggleCheckedBtn(\n editorFreeTextButton,\n mode === AnnotationEditorType.FREETEXT,\n editorFreeTextParamsToolbar\n );\n toggleCheckedBtn(\n editorInkButton,\n mode === AnnotationEditorType.INK,\n editorInkParamsToolbar\n );\n\n const isDisable = mode === AnnotationEditorType.DISABLE;\n editorFreeTextButton.disabled = isDisable;\n editorInkButton.disabled = isDisable;\n };\n this.eventBus._on(\"annotationeditormodechanged\", editorModeChanged);\n\n this.eventBus._on(\"toolbarreset\", evt => {\n if (evt.source === this) {\n editorModeChanged({ mode: AnnotationEditorType.DISABLE });\n }\n });\n }\n\n #updateUIState(resetNumPages = false) {\n if (!this.#wasLocalized) {\n // Don't update the UI state until we localize the toolbar.\n return;\n }\n const { pageNumber, pagesCount, pageScaleValue, pageScale, items } = this;\n\n if (resetNumPages) {\n if (this.hasPageLabels) {\n items.pageNumber.type = \"text\";\n } else {\n items.pageNumber.type = \"number\";\n this.l10n.get(\"of_pages\", { pagesCount }).then(msg => {\n items.numPages.textContent = msg;\n });\n }\n items.pageNumber.max = pagesCount;\n }\n\n if (this.hasPageLabels) {\n items.pageNumber.value = this.pageLabel;\n this.l10n.get(\"page_of_pages\", { pageNumber, pagesCount }).then(msg => {\n items.numPages.textContent = msg;\n });\n } else {\n items.pageNumber.value = pageNumber;\n }\n\n items.previous.disabled = pageNumber <= 1;\n items.next.disabled = pageNumber >= pagesCount;\n\n items.zoomOut.disabled = pageScale <= MIN_SCALE;\n items.zoomIn.disabled = pageScale >= MAX_SCALE;\n\n this.l10n\n .get(\"page_scale_percent\", { scale: Math.round(pageScale * 10000) / 100 })\n .then(msg => {\n let predefinedValueFound = false;\n for (const option of items.scaleSelect.options) {\n if (option.value !== pageScaleValue) {\n option.selected = false;\n continue;\n }\n option.selected = true;\n predefinedValueFound = true;\n }\n if (!predefinedValueFound) {\n items.customScaleOption.textContent = msg;\n items.customScaleOption.selected = true;\n }\n });\n }\n\n updateLoadingIndicatorState(loading = false) {\n const { pageNumber } = this.items;\n\n pageNumber.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading);\n }\n\n /**\n * Increase the width of the zoom dropdown DOM element if, and only if, it's\n * too narrow to fit the *longest* of the localized strings.\n */\n async #adjustScaleWidth() {\n const { items, l10n } = this;\n\n const predefinedValuesPromise = Promise.all([\n l10n.get(\"page_scale_auto\"),\n l10n.get(\"page_scale_actual\"),\n l10n.get(\"page_scale_fit\"),\n l10n.get(\"page_scale_width\"),\n ]);\n await animationStarted;\n\n const style = getComputedStyle(items.scaleSelect);\n const scaleSelectWidth = parseFloat(\n style.getPropertyValue(\"--scale-select-width\")\n );\n\n // The temporary canvas is used to measure text length in the DOM.\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\", { alpha: false });\n ctx.font = `${style.fontSize} ${style.fontFamily}`;\n\n let maxWidth = 0;\n for (const predefinedValue of await predefinedValuesPromise) {\n const { width } = ctx.measureText(predefinedValue);\n if (width > maxWidth) {\n maxWidth = width;\n }\n }\n // Account for the icon width, and ensure that there's always some spacing\n // between the text and the icon.\n maxWidth += 0.3 * scaleSelectWidth;\n\n if (maxWidth > scaleSelectWidth) {\n const container = items.scaleSelect.parentNode;\n container.style.setProperty(\"--scale-select-width\", `${maxWidth}px`);\n }\n // Zeroing the width and height cause Firefox to release graphics resources\n // immediately, which can greatly reduce memory consumption.\n canvas.width = 0;\n canvas.height = 0;\n }\n}\n\nexport { Toolbar };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20;\n\n/**\n * View History - This is a utility for saving various view parameters for\n * recently opened files.\n *\n * The way that the view parameters are stored depends on how PDF.js is built,\n * for 'gulp <flag>' the following cases exist:\n * - MOZCENTRAL - uses sessionStorage.\n * - GENERIC or CHROME - uses localStorage, if it is available.\n */\nclass ViewHistory {\n constructor(fingerprint, cacheSize = DEFAULT_VIEW_HISTORY_CACHE_SIZE) {\n this.fingerprint = fingerprint;\n this.cacheSize = cacheSize;\n\n this._initializedPromise = this._readFromStorage().then(databaseStr => {\n const database = JSON.parse(databaseStr || \"{}\");\n let index = -1;\n if (!Array.isArray(database.files)) {\n database.files = [];\n } else {\n while (database.files.length >= this.cacheSize) {\n database.files.shift();\n }\n\n for (let i = 0, ii = database.files.length; i < ii; i++) {\n const branch = database.files[i];\n if (branch.fingerprint === this.fingerprint) {\n index = i;\n break;\n }\n }\n }\n if (index === -1) {\n index = database.files.push({ fingerprint: this.fingerprint }) - 1;\n }\n this.file = database.files[index];\n this.database = database;\n });\n }\n\n async _writeToStorage() {\n const databaseStr = JSON.stringify(this.database);\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n sessionStorage.setItem(\"pdfjs.history\", databaseStr);\n return;\n }\n localStorage.setItem(\"pdfjs.history\", databaseStr);\n }\n\n async _readFromStorage() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return sessionStorage.getItem(\"pdfjs.history\");\n }\n return localStorage.getItem(\"pdfjs.history\");\n }\n\n async set(name, val) {\n await this._initializedPromise;\n this.file[name] = val;\n return this._writeToStorage();\n }\n\n async setMultiple(properties) {\n await this._initializedPromise;\n for (const name in properties) {\n this.file[name] = properties[name];\n }\n return this._writeToStorage();\n }\n\n async get(name, defaultValue) {\n await this._initializedPromise;\n const val = this.file[name];\n return val !== undefined ? val : defaultValue;\n }\n\n async getMultiple(properties) {\n await this._initializedPromise;\n const values = Object.create(null);\n\n for (const name in properties) {\n const val = this.file[name];\n values[name] = val !== undefined ? val : properties[name];\n }\n return values;\n }\n}\n\nexport { ViewHistory };\n","/* Copyright 2013 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AppOptions, OptionKind } from \"./app_options.js\";\n\n/**\n * BasePreferences - Abstract base class for storing persistent settings.\n * Used for settings that should be applied to all opened documents,\n * or every time the viewer is loaded.\n */\nclass BasePreferences {\n #defaults = Object.freeze(\n typeof PDFJSDev === \"undefined\"\n ? AppOptions.getAll(OptionKind.PREFERENCE)\n : PDFJSDev.eval(\"DEFAULT_PREFERENCES\")\n );\n\n #prefs = Object.create(null);\n\n #initializedPromise = null;\n\n constructor() {\n if (this.constructor === BasePreferences) {\n throw new Error(\"Cannot initialize BasePreferences.\");\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\")) {\n Object.defineProperty(this, \"defaults\", {\n get() {\n return this.#defaults;\n },\n });\n }\n\n this.#initializedPromise = this._readFromStorage(this.#defaults).then(\n prefs => {\n for (const name in this.#defaults) {\n const prefValue = prefs?.[name];\n // Ignore preferences whose types don't match the default values.\n if (typeof prefValue === typeof this.#defaults[name]) {\n this.#prefs[name] = prefValue;\n }\n }\n }\n );\n }\n\n /**\n * Stub function for writing preferences to storage.\n * @param {Object} prefObj The preferences that should be written to storage.\n * @returns {Promise} A promise that is resolved when the preference values\n * have been written.\n */\n async _writeToStorage(prefObj) {\n throw new Error(\"Not implemented: _writeToStorage\");\n }\n\n /**\n * Stub function for reading preferences from storage.\n * @param {Object} prefObj The preferences that should be read from storage.\n * @returns {Promise} A promise that is resolved with an {Object} containing\n * the preferences that have been read.\n */\n async _readFromStorage(prefObj) {\n throw new Error(\"Not implemented: _readFromStorage\");\n }\n\n /**\n * Reset the preferences to their default values and update storage.\n * @returns {Promise} A promise that is resolved when the preference values\n * have been reset.\n */\n async reset() {\n await this.#initializedPromise;\n const prefs = this.#prefs;\n\n this.#prefs = Object.create(null);\n return this._writeToStorage(this.#defaults).catch(reason => {\n // Revert all preference values, since writing to storage failed.\n this.#prefs = prefs;\n throw reason;\n });\n }\n\n /**\n * Set the value of a preference.\n * @param {string} name The name of the preference that should be changed.\n * @param {boolean|number|string} value The new value of the preference.\n * @returns {Promise} A promise that is resolved when the value has been set,\n * provided that the preference exists and the types match.\n */\n async set(name, value) {\n await this.#initializedPromise;\n const defaultValue = this.#defaults[name],\n prefs = this.#prefs;\n\n if (defaultValue === undefined) {\n throw new Error(`Set preference: \"${name}\" is undefined.`);\n } else if (value === undefined) {\n throw new Error(\"Set preference: no value is specified.\");\n }\n const valueType = typeof value,\n defaultType = typeof defaultValue;\n\n if (valueType !== defaultType) {\n if (valueType === \"number\" && defaultType === \"string\") {\n value = value.toString();\n } else {\n throw new Error(\n `Set preference: \"${value}\" is a ${valueType}, expected a ${defaultType}.`\n );\n }\n } else {\n if (valueType === \"number\" && !Number.isInteger(value)) {\n throw new Error(`Set preference: \"${value}\" must be an integer.`);\n }\n }\n\n this.#prefs[name] = value;\n return this._writeToStorage(this.#prefs).catch(reason => {\n // Revert all preference values, since writing to storage failed.\n this.#prefs = prefs;\n throw reason;\n });\n }\n\n /**\n * Get the value of a preference.\n * @param {string} name The name of the preference whose value is requested.\n * @returns {Promise} A promise resolved with a {boolean|number|string}\n * containing the value of the preference.\n */\n async get(name) {\n await this.#initializedPromise;\n const defaultValue = this.#defaults[name];\n\n if (defaultValue === undefined) {\n throw new Error(`Get preference: \"${name}\" is undefined.`);\n }\n return this.#prefs[name] ?? defaultValue;\n }\n\n /**\n * Get the values of all preferences.\n * @returns {Promise} A promise that is resolved with an {Object} containing\n * the values of all preferences.\n */\n async getAll() {\n await this.#initializedPromise;\n const obj = Object.create(null);\n\n for (const name in this.#defaults) {\n obj[name] = this.#prefs[name] ?? this.#defaults[name];\n }\n return obj;\n }\n}\n\nexport { BasePreferences };\n","/* Copyright 2013 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./interfaces\").IDownloadManager} IDownloadManager */\n\nimport { createValidAbsoluteUrl, isPdfFile } from \"pdfjs-lib\";\n\nif (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"CHROME || GENERIC\")) {\n throw new Error(\n 'Module \"pdfjs-web/download_manager\" shall not be used ' +\n \"outside CHROME and GENERIC builds.\"\n );\n}\n\nfunction download(blobUrl, filename) {\n const a = document.createElement(\"a\");\n if (!a.click) {\n throw new Error('DownloadManager: \"a.click()\" is not supported.');\n }\n a.href = blobUrl;\n a.target = \"_parent\";\n // Use a.download if available. This increases the likelihood that\n // the file is downloaded instead of opened by another PDF plugin.\n if (\"download\" in a) {\n a.download = filename;\n }\n // <a> must be in the document for recent Firefox versions,\n // otherwise .click() is ignored.\n (document.body || document.documentElement).append(a);\n a.click();\n a.remove();\n}\n\n/**\n * @implements {IDownloadManager}\n */\nclass DownloadManager {\n #openBlobUrls = new WeakMap();\n\n downloadUrl(url, filename, _options) {\n if (!createValidAbsoluteUrl(url, \"http://example.com\")) {\n console.error(`downloadUrl - not a valid URL: ${url}`);\n return; // restricted/invalid URL\n }\n download(url + \"#pdfjs.action=download\", filename);\n }\n\n downloadData(data, filename, contentType) {\n const blobUrl = URL.createObjectURL(\n new Blob([data], { type: contentType })\n );\n download(blobUrl, filename);\n }\n\n /**\n * @returns {boolean} Indicating if the data was opened.\n */\n openOrDownloadData(element, data, filename) {\n const isPdfData = isPdfFile(filename);\n const contentType = isPdfData ? \"application/pdf\" : \"\";\n\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"COMPONENTS\")) &&\n isPdfData\n ) {\n let blobUrl = this.#openBlobUrls.get(element);\n if (!blobUrl) {\n blobUrl = URL.createObjectURL(new Blob([data], { type: contentType }));\n this.#openBlobUrls.set(element, blobUrl);\n }\n let viewerUrl;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // The current URL is the viewer, let's use it and append the file.\n viewerUrl = \"?file=\" + encodeURIComponent(blobUrl + \"#\" + filename);\n } else if (PDFJSDev.test(\"CHROME\")) {\n // In the Chrome extension, the URL is rewritten using the history API\n // in viewer.js, so an absolute URL must be generated.\n viewerUrl =\n // eslint-disable-next-line no-undef\n chrome.runtime.getURL(\"/content/web/viewer.html\") +\n \"?file=\" +\n encodeURIComponent(blobUrl + \"#\" + filename);\n }\n\n try {\n window.open(viewerUrl);\n return true;\n } catch (ex) {\n console.error(`openOrDownloadData: ${ex}`);\n // Release the `blobUrl`, since opening it failed, and fallback to\n // downloading the PDF file.\n URL.revokeObjectURL(blobUrl);\n this.#openBlobUrls.delete(element);\n }\n }\n\n this.downloadData(data, filename, contentType);\n return false;\n }\n\n download(blob, url, filename, _options) {\n const blobUrl = URL.createObjectURL(blob);\n download(blobUrl, filename);\n }\n}\n\nexport { DownloadManager };\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n\nimport \"../external/webL10n/l10n.js\";\nimport { fixupLangCode, getL10nFallback } from \"./l10n_utils.js\";\n\nconst webL10n = document.webL10n;\n\n/**\n * @implements {IL10n}\n */\nclass GenericL10n {\n constructor(lang) {\n this._lang = lang;\n this._ready = new Promise((resolve, reject) => {\n webL10n.setLanguage(fixupLangCode(lang), () => {\n resolve(webL10n);\n });\n });\n }\n\n async getLanguage() {\n const l10n = await this._ready;\n return l10n.getLanguage();\n }\n\n async getDirection() {\n const l10n = await this._ready;\n return l10n.getDirection();\n }\n\n async get(key, args = null, fallback = getL10nFallback(key, args)) {\n const l10n = await this._ready;\n return l10n.get(key, args, fallback);\n }\n\n async translate(element) {\n const l10n = await this._ready;\n return l10n.translate(element);\n }\n}\n\nexport { GenericL10n };\n","/**\n * Copyright (c) 2011-2013 Fabien Cazenave, Mozilla.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n/*\n Additional modifications for PDF.js project:\n - Disables language initialization on page loading.\n - Disables document translation on page loading.\n - Removes consoleWarn and consoleLog and use console.log/warn directly.\n - Removes window._ assignment.\n - Remove compatibility code for OldIE.\n - Replaces `String.prototype.substr()` with `String.prototype.substring()`.\n - Replaces one `Node.insertBefore()` with `Element.prepend()`.\n - Removes `fireL10nReadyEvent` since the \"localized\" event it dispatches\n is unused and may clash with an identically named event in the viewer.\n*/\n\n/*jshint browser: true, devel: true, es5: true, globalstrict: true */\n'use strict';\n\ndocument.webL10n = (function(window, document, undefined) {\n var gL10nData = {};\n var gTextData = '';\n var gTextProp = 'textContent';\n var gLanguage = '';\n var gMacros = {};\n var gReadyState = 'loading';\n\n\n /**\n * Synchronously loading l10n resources significantly minimizes flickering\n * from displaying the app with non-localized strings and then updating the\n * strings. Although this will block all script execution on this page, we\n * expect that the l10n resources are available locally on flash-storage.\n *\n * As synchronous XHR is generally considered as a bad idea, we're still\n * loading l10n resources asynchronously -- but we keep this in a setting,\n * just in case... and applications using this library should hide their\n * content until the `localized' event happens.\n */\n\n var gAsyncResourceLoading = true; // read-only\n\n\n /**\n * DOM helpers for the so-called \"HTML API\".\n *\n * These functions are written for modern browsers. For old versions of IE,\n * they're overridden in the 'startup' section at the end of this file.\n */\n\n function getL10nResourceLinks() {\n return document.querySelectorAll('link[type=\"application/l10n\"]');\n }\n\n function getL10nDictionary() {\n var script = document.querySelector('script[type=\"application/l10n\"]');\n // TODO: support multiple and external JSON dictionaries\n return script ? JSON.parse(script.innerHTML) : null;\n }\n\n function getTranslatableChildren(element) {\n return element ? element.querySelectorAll('*[data-l10n-id]') : [];\n }\n\n function getL10nAttributes(element) {\n if (!element)\n return {};\n\n var l10nId = element.getAttribute('data-l10n-id');\n var l10nArgs = element.getAttribute('data-l10n-args');\n var args = {};\n if (l10nArgs) {\n try {\n args = JSON.parse(l10nArgs);\n } catch (e) {\n console.warn('could not parse arguments for #' + l10nId);\n }\n }\n return { id: l10nId, args: args };\n }\n\n function xhrLoadText(url, onSuccess, onFailure) {\n onSuccess = onSuccess || function _onSuccess(data) {};\n onFailure = onFailure || function _onFailure() {};\n\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, gAsyncResourceLoading);\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=utf-8');\n }\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n if (xhr.status == 200 || xhr.status === 0) {\n onSuccess(xhr.responseText);\n } else {\n onFailure();\n }\n }\n };\n xhr.onerror = onFailure;\n xhr.ontimeout = onFailure;\n\n // in Firefox OS with the app:// protocol, trying to XHR a non-existing\n // URL will raise an exception here -- hence this ugly try...catch.\n try {\n xhr.send(null);\n } catch (e) {\n onFailure();\n }\n }\n\n\n /**\n * l10n resource parser:\n * - reads (async XHR) the l10n resource matching `lang';\n * - imports linked resources (synchronously) when specified;\n * - parses the text data (fills `gL10nData' and `gTextData');\n * - triggers success/failure callbacks when done.\n *\n * @param {string} href\n * URL of the l10n resource to parse.\n *\n * @param {string} lang\n * locale (language) to parse. Must be a lowercase string.\n *\n * @param {Function} successCallback\n * triggered when the l10n resource has been successfully parsed.\n *\n * @param {Function} failureCallback\n * triggered when the an error has occurred.\n *\n * @return {void}\n * uses the following global variables: gL10nData, gTextData, gTextProp.\n */\n\n function parseResource(href, lang, successCallback, failureCallback) {\n var baseURL = href.replace(/[^\\/]*$/, '') || './';\n\n // handle escaped characters (backslashes) in a string\n function evalString(text) {\n if (text.lastIndexOf('\\\\') < 0)\n return text;\n return text.replace(/\\\\\\\\/g, '\\\\')\n .replace(/\\\\n/g, '\\n')\n .replace(/\\\\r/g, '\\r')\n .replace(/\\\\t/g, '\\t')\n .replace(/\\\\b/g, '\\b')\n .replace(/\\\\f/g, '\\f')\n .replace(/\\\\{/g, '{')\n .replace(/\\\\}/g, '}')\n .replace(/\\\\\"/g, '\"')\n .replace(/\\\\'/g, \"'\");\n }\n\n // parse *.properties text data into an l10n dictionary\n // If gAsyncResourceLoading is false, then the callback will be called\n // synchronously. Otherwise it is called asynchronously.\n function parseProperties(text, parsedPropertiesCallback) {\n var dictionary = {};\n\n // token expressions\n var reBlank = /^\\s*|\\s*$/;\n var reComment = /^\\s*#|^\\s*$/;\n var reSection = /^\\s*\\[(.*)\\]\\s*$/;\n var reImport = /^\\s*@import\\s+url\\((.*)\\)\\s*$/i;\n var reSplit = /^([^=\\s]*)\\s*=\\s*(.+)$/; // TODO: escape EOLs with '\\'\n\n // parse the *.properties file into an associative array\n function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {\n var entries = rawText.replace(reBlank, '').split(/[\\r\\n]+/);\n var currentLang = '*';\n var genericLang = lang.split('-', 1)[0];\n var skipLang = false;\n var match = '';\n\n function nextEntry() {\n // Use infinite loop instead of recursion to avoid reaching the\n // maximum recursion limit for content with many lines.\n while (true) {\n if (!entries.length) {\n parsedRawLinesCallback();\n return;\n }\n var line = entries.shift();\n\n // comment or blank line?\n if (reComment.test(line))\n continue;\n\n // the extended syntax supports [lang] sections and @import rules\n if (extendedSyntax) {\n match = reSection.exec(line);\n if (match) { // section start?\n // RFC 4646, section 4.4, \"All comparisons MUST be performed\n // in a case-insensitive manner.\"\n\n currentLang = match[1].toLowerCase();\n skipLang = (currentLang !== '*') &&\n (currentLang !== lang) && (currentLang !== genericLang);\n continue;\n } else if (skipLang) {\n continue;\n }\n match = reImport.exec(line);\n if (match) { // @import rule?\n loadImport(baseURL + match[1], nextEntry);\n return;\n }\n }\n\n // key-value pair\n var tmp = line.match(reSplit);\n if (tmp && tmp.length == 3) {\n dictionary[tmp[1]] = evalString(tmp[2]);\n }\n }\n }\n nextEntry();\n }\n\n // import another *.properties file\n function loadImport(url, callback) {\n xhrLoadText(url, function(content) {\n parseRawLines(content, false, callback); // don't allow recursive imports\n }, function () {\n console.warn(url + ' not found.');\n callback();\n });\n }\n\n // fill the dictionary\n parseRawLines(text, true, function() {\n parsedPropertiesCallback(dictionary);\n });\n }\n\n // load and parse l10n data (warning: global variables are used here)\n xhrLoadText(href, function(response) {\n gTextData += response; // mostly for debug\n\n // parse *.properties text data into an l10n dictionary\n parseProperties(response, function(data) {\n\n // find attribute descriptions, if any\n for (var key in data) {\n var id, prop, index = key.lastIndexOf('.');\n if (index > 0) { // an attribute has been specified\n id = key.substring(0, index);\n prop = key.substring(index + 1);\n } else { // no attribute: assuming text content by default\n id = key;\n prop = gTextProp;\n }\n if (!gL10nData[id]) {\n gL10nData[id] = {};\n }\n gL10nData[id][prop] = data[key];\n }\n\n // trigger callback\n if (successCallback) {\n successCallback();\n }\n });\n }, failureCallback);\n }\n\n // load and parse all resources for the specified locale\n function loadLocale(lang, callback) {\n // RFC 4646, section 2.1 states that language tags have to be treated as\n // case-insensitive. Convert to lowercase for case-insensitive comparisons.\n if (lang) {\n lang = lang.toLowerCase();\n }\n\n callback = callback || function _callback() {};\n\n clear();\n gLanguage = lang;\n\n // check all <link type=\"application/l10n\" href=\"...\" /> nodes\n // and load the resource files\n var langLinks = getL10nResourceLinks();\n var langCount = langLinks.length;\n if (langCount === 0) {\n // we might have a pre-compiled dictionary instead\n var dict = getL10nDictionary();\n if (dict && dict.locales && dict.default_locale) {\n console.log('using the embedded JSON directory, early way out');\n gL10nData = dict.locales[lang];\n if (!gL10nData) {\n var defaultLocale = dict.default_locale.toLowerCase();\n for (var anyCaseLang in dict.locales) {\n anyCaseLang = anyCaseLang.toLowerCase();\n if (anyCaseLang === lang) {\n gL10nData = dict.locales[lang];\n break;\n } else if (anyCaseLang === defaultLocale) {\n gL10nData = dict.locales[defaultLocale];\n }\n }\n }\n callback();\n } else {\n console.log('no resource to load, early way out');\n }\n // early way out\n gReadyState = 'complete';\n return;\n }\n\n // start the callback when all resources are loaded\n var onResourceLoaded = null;\n var gResourceCount = 0;\n onResourceLoaded = function() {\n gResourceCount++;\n if (gResourceCount >= langCount) {\n callback();\n gReadyState = 'complete';\n }\n };\n\n // load all resource files\n function L10nResourceLink(link) {\n var href = link.href;\n // Note: If |gAsyncResourceLoading| is false, then the following callbacks\n // are synchronously called.\n this.load = function(lang, callback) {\n parseResource(href, lang, callback, function() {\n console.warn(href + ' not found.');\n // lang not found, used default resource instead\n console.warn('\"' + lang + '\" resource not found');\n gLanguage = '';\n // Resource not loaded, but we still need to call the callback.\n callback();\n });\n };\n }\n\n for (var i = 0; i < langCount; i++) {\n var resource = new L10nResourceLink(langLinks[i]);\n resource.load(lang, onResourceLoaded);\n }\n }\n\n // clear all l10n data\n function clear() {\n gL10nData = {};\n gTextData = '';\n gLanguage = '';\n // TODO: clear all non predefined macros.\n // There's no such macro /yet/ but we're planning to have some...\n }\n\n\n /**\n * Get rules for plural forms (shared with JetPack), see:\n * http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html\n * https://github.com/mozilla/addon-sdk/blob/master/python-lib/plural-rules-generator.p\n *\n * @param {string} lang\n * locale (language) used.\n *\n * @return {Function}\n * returns a function that gives the plural form name for a given integer:\n * var fun = getPluralRules('en');\n * fun(1) -> 'one'\n * fun(0) -> 'other'\n * fun(1000) -> 'other'.\n */\n\n function getPluralRules(lang) {\n var locales2rules = {\n 'af': 3,\n 'ak': 4,\n 'am': 4,\n 'ar': 1,\n 'asa': 3,\n 'az': 0,\n 'be': 11,\n 'bem': 3,\n 'bez': 3,\n 'bg': 3,\n 'bh': 4,\n 'bm': 0,\n 'bn': 3,\n 'bo': 0,\n 'br': 20,\n 'brx': 3,\n 'bs': 11,\n 'ca': 3,\n 'cgg': 3,\n 'chr': 3,\n 'cs': 12,\n 'cy': 17,\n 'da': 3,\n 'de': 3,\n 'dv': 3,\n 'dz': 0,\n 'ee': 3,\n 'el': 3,\n 'en': 3,\n 'eo': 3,\n 'es': 3,\n 'et': 3,\n 'eu': 3,\n 'fa': 0,\n 'ff': 5,\n 'fi': 3,\n 'fil': 4,\n 'fo': 3,\n 'fr': 5,\n 'fur': 3,\n 'fy': 3,\n 'ga': 8,\n 'gd': 24,\n 'gl': 3,\n 'gsw': 3,\n 'gu': 3,\n 'guw': 4,\n 'gv': 23,\n 'ha': 3,\n 'haw': 3,\n 'he': 2,\n 'hi': 4,\n 'hr': 11,\n 'hu': 0,\n 'id': 0,\n 'ig': 0,\n 'ii': 0,\n 'is': 3,\n 'it': 3,\n 'iu': 7,\n 'ja': 0,\n 'jmc': 3,\n 'jv': 0,\n 'ka': 0,\n 'kab': 5,\n 'kaj': 3,\n 'kcg': 3,\n 'kde': 0,\n 'kea': 0,\n 'kk': 3,\n 'kl': 3,\n 'km': 0,\n 'kn': 0,\n 'ko': 0,\n 'ksb': 3,\n 'ksh': 21,\n 'ku': 3,\n 'kw': 7,\n 'lag': 18,\n 'lb': 3,\n 'lg': 3,\n 'ln': 4,\n 'lo': 0,\n 'lt': 10,\n 'lv': 6,\n 'mas': 3,\n 'mg': 4,\n 'mk': 16,\n 'ml': 3,\n 'mn': 3,\n 'mo': 9,\n 'mr': 3,\n 'ms': 0,\n 'mt': 15,\n 'my': 0,\n 'nah': 3,\n 'naq': 7,\n 'nb': 3,\n 'nd': 3,\n 'ne': 3,\n 'nl': 3,\n 'nn': 3,\n 'no': 3,\n 'nr': 3,\n 'nso': 4,\n 'ny': 3,\n 'nyn': 3,\n 'om': 3,\n 'or': 3,\n 'pa': 3,\n 'pap': 3,\n 'pl': 13,\n 'ps': 3,\n 'pt': 3,\n 'rm': 3,\n 'ro': 9,\n 'rof': 3,\n 'ru': 11,\n 'rwk': 3,\n 'sah': 0,\n 'saq': 3,\n 'se': 7,\n 'seh': 3,\n 'ses': 0,\n 'sg': 0,\n 'sh': 11,\n 'shi': 19,\n 'sk': 12,\n 'sl': 14,\n 'sma': 7,\n 'smi': 7,\n 'smj': 7,\n 'smn': 7,\n 'sms': 7,\n 'sn': 3,\n 'so': 3,\n 'sq': 3,\n 'sr': 11,\n 'ss': 3,\n 'ssy': 3,\n 'st': 3,\n 'sv': 3,\n 'sw': 3,\n 'syr': 3,\n 'ta': 3,\n 'te': 3,\n 'teo': 3,\n 'th': 0,\n 'ti': 4,\n 'tig': 3,\n 'tk': 3,\n 'tl': 4,\n 'tn': 3,\n 'to': 0,\n 'tr': 0,\n 'ts': 3,\n 'tzm': 22,\n 'uk': 11,\n 'ur': 3,\n 've': 3,\n 'vi': 0,\n 'vun': 3,\n 'wa': 4,\n 'wae': 3,\n 'wo': 0,\n 'xh': 3,\n 'xog': 3,\n 'yo': 0,\n 'zh': 0,\n 'zu': 3\n };\n\n // utility functions for plural rules methods\n function isIn(n, list) {\n return list.indexOf(n) !== -1;\n }\n function isBetween(n, start, end) {\n return start <= n && n <= end;\n }\n\n // list of all plural rules methods:\n // map an integer to the plural form name to use\n var pluralRules = {\n '0': function(n) {\n return 'other';\n },\n '1': function(n) {\n if ((isBetween((n % 100), 3, 10)))\n return 'few';\n if (n === 0)\n return 'zero';\n if ((isBetween((n % 100), 11, 99)))\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '2': function(n) {\n if (n !== 0 && (n % 10) === 0)\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '3': function(n) {\n if (n == 1)\n return 'one';\n return 'other';\n },\n '4': function(n) {\n if ((isBetween(n, 0, 1)))\n return 'one';\n return 'other';\n },\n '5': function(n) {\n if ((isBetween(n, 0, 2)) && n != 2)\n return 'one';\n return 'other';\n },\n '6': function(n) {\n if (n === 0)\n return 'zero';\n if ((n % 10) == 1 && (n % 100) != 11)\n return 'one';\n return 'other';\n },\n '7': function(n) {\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '8': function(n) {\n if ((isBetween(n, 3, 6)))\n return 'few';\n if ((isBetween(n, 7, 10)))\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '9': function(n) {\n if (n === 0 || n != 1 && (isBetween((n % 100), 1, 19)))\n return 'few';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '10': function(n) {\n if ((isBetween((n % 10), 2, 9)) && !(isBetween((n % 100), 11, 19)))\n return 'few';\n if ((n % 10) == 1 && !(isBetween((n % 100), 11, 19)))\n return 'one';\n return 'other';\n },\n '11': function(n) {\n if ((isBetween((n % 10), 2, 4)) && !(isBetween((n % 100), 12, 14)))\n return 'few';\n if ((n % 10) === 0 ||\n (isBetween((n % 10), 5, 9)) ||\n (isBetween((n % 100), 11, 14)))\n return 'many';\n if ((n % 10) == 1 && (n % 100) != 11)\n return 'one';\n return 'other';\n },\n '12': function(n) {\n if ((isBetween(n, 2, 4)))\n return 'few';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '13': function(n) {\n if ((isBetween((n % 10), 2, 4)) && !(isBetween((n % 100), 12, 14)))\n return 'few';\n if (n != 1 && (isBetween((n % 10), 0, 1)) ||\n (isBetween((n % 10), 5, 9)) ||\n (isBetween((n % 100), 12, 14)))\n return 'many';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '14': function(n) {\n if ((isBetween((n % 100), 3, 4)))\n return 'few';\n if ((n % 100) == 2)\n return 'two';\n if ((n % 100) == 1)\n return 'one';\n return 'other';\n },\n '15': function(n) {\n if (n === 0 || (isBetween((n % 100), 2, 10)))\n return 'few';\n if ((isBetween((n % 100), 11, 19)))\n return 'many';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '16': function(n) {\n if ((n % 10) == 1 && n != 11)\n return 'one';\n return 'other';\n },\n '17': function(n) {\n if (n == 3)\n return 'few';\n if (n === 0)\n return 'zero';\n if (n == 6)\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '18': function(n) {\n if (n === 0)\n return 'zero';\n if ((isBetween(n, 0, 2)) && n !== 0 && n != 2)\n return 'one';\n return 'other';\n },\n '19': function(n) {\n if ((isBetween(n, 2, 10)))\n return 'few';\n if ((isBetween(n, 0, 1)))\n return 'one';\n return 'other';\n },\n '20': function(n) {\n if ((isBetween((n % 10), 3, 4) || ((n % 10) == 9)) && !(\n isBetween((n % 100), 10, 19) ||\n isBetween((n % 100), 70, 79) ||\n isBetween((n % 100), 90, 99)\n ))\n return 'few';\n if ((n % 1000000) === 0 && n !== 0)\n return 'many';\n if ((n % 10) == 2 && !isIn((n % 100), [12, 72, 92]))\n return 'two';\n if ((n % 10) == 1 && !isIn((n % 100), [11, 71, 91]))\n return 'one';\n return 'other';\n },\n '21': function(n) {\n if (n === 0)\n return 'zero';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '22': function(n) {\n if ((isBetween(n, 0, 1)) || (isBetween(n, 11, 99)))\n return 'one';\n return 'other';\n },\n '23': function(n) {\n if ((isBetween((n % 10), 1, 2)) || (n % 20) === 0)\n return 'one';\n return 'other';\n },\n '24': function(n) {\n if ((isBetween(n, 3, 10) || isBetween(n, 13, 19)))\n return 'few';\n if (isIn(n, [2, 12]))\n return 'two';\n if (isIn(n, [1, 11]))\n return 'one';\n return 'other';\n }\n };\n\n // return a function that gives the plural form name for a given integer\n var index = locales2rules[lang.replace(/-.*$/, '')];\n if (!(index in pluralRules)) {\n console.warn('plural form unknown for [' + lang + ']');\n return function() { return 'other'; };\n }\n return pluralRules[index];\n }\n\n // pre-defined 'plural' macro\n gMacros.plural = function(str, param, key, prop) {\n var n = parseFloat(param);\n if (isNaN(n))\n return str;\n\n // TODO: support other properties (l20n still doesn't...)\n if (prop != gTextProp)\n return str;\n\n // initialize _pluralRules\n if (!gMacros._pluralRules) {\n gMacros._pluralRules = getPluralRules(gLanguage);\n }\n var index = '[' + gMacros._pluralRules(n) + ']';\n\n // try to find a [zero|one|two] key if it's defined\n if (n === 0 && (key + '[zero]') in gL10nData) {\n str = gL10nData[key + '[zero]'][prop];\n } else if (n == 1 && (key + '[one]') in gL10nData) {\n str = gL10nData[key + '[one]'][prop];\n } else if (n == 2 && (key + '[two]') in gL10nData) {\n str = gL10nData[key + '[two]'][prop];\n } else if ((key + index) in gL10nData) {\n str = gL10nData[key + index][prop];\n } else if ((key + '[other]') in gL10nData) {\n str = gL10nData[key + '[other]'][prop];\n }\n\n return str;\n };\n\n\n /**\n * l10n dictionary functions\n */\n\n // fetch an l10n object, warn if not found, apply `args' if possible\n function getL10nData(key, args, fallback) {\n var data = gL10nData[key];\n if (!data) {\n console.warn('#' + key + ' is undefined.');\n if (!fallback) {\n return null;\n }\n data = fallback;\n }\n\n /** This is where l10n expressions should be processed.\n * The plan is to support C-style expressions from the l20n project;\n * until then, only two kinds of simple expressions are supported:\n * {[ index ]} and {{ arguments }}.\n */\n var rv = {};\n for (var prop in data) {\n var str = data[prop];\n str = substIndexes(str, args, key, prop);\n str = substArguments(str, args, key);\n rv[prop] = str;\n }\n return rv;\n }\n\n // replace {[macros]} with their values\n function substIndexes(str, args, key, prop) {\n var reIndex = /\\{\\[\\s*([a-zA-Z]+)\\(([a-zA-Z]+)\\)\\s*\\]\\}/;\n var reMatch = reIndex.exec(str);\n if (!reMatch || !reMatch.length)\n return str;\n\n // an index/macro has been found\n // Note: at the moment, only one parameter is supported\n var macroName = reMatch[1];\n var paramName = reMatch[2];\n var param;\n if (args && paramName in args) {\n param = args[paramName];\n } else if (paramName in gL10nData) {\n param = gL10nData[paramName];\n }\n\n // there's no macro parser yet: it has to be defined in gMacros\n if (macroName in gMacros) {\n var macro = gMacros[macroName];\n str = macro(str, param, key, prop);\n }\n return str;\n }\n\n // replace {{arguments}} with their values\n function substArguments(str, args, key) {\n var reArgs = /\\{\\{\\s*(.+?)\\s*\\}\\}/g;\n return str.replace(reArgs, function(matched_text, arg) {\n if (args && arg in args) {\n return args[arg];\n }\n if (arg in gL10nData) {\n return gL10nData[arg];\n }\n console.log('argument {{' + arg + '}} for #' + key + ' is undefined.');\n return matched_text;\n });\n }\n\n // translate an HTML element\n function translateElement(element) {\n var l10n = getL10nAttributes(element);\n if (!l10n.id)\n return;\n\n // get the related l10n object\n var data = getL10nData(l10n.id, l10n.args);\n if (!data) {\n console.warn('#' + l10n.id + ' is undefined.');\n return;\n }\n\n // translate element (TODO: security checks?)\n if (data[gTextProp]) { // XXX\n if (getChildElementCount(element) === 0) {\n element[gTextProp] = data[gTextProp];\n } else {\n // this element has element children: replace the content of the first\n // (non-empty) child textNode and clear other child textNodes\n var children = element.childNodes;\n var found = false;\n for (var i = 0, l = children.length; i < l; i++) {\n if (children[i].nodeType === 3 && /\\S/.test(children[i].nodeValue)) {\n if (found) {\n children[i].nodeValue = '';\n } else {\n children[i].nodeValue = data[gTextProp];\n found = true;\n }\n }\n }\n // if no (non-empty) textNode is found, insert a textNode before the\n // first element child.\n if (!found) {\n var textNode = document.createTextNode(data[gTextProp]);\n element.prepend(textNode);\n }\n }\n delete data[gTextProp];\n }\n\n for (var k in data) {\n element[k] = data[k];\n }\n }\n\n // webkit browsers don't currently support 'children' on SVG elements...\n function getChildElementCount(element) {\n if (element.children) {\n return element.children.length;\n }\n if (typeof element.childElementCount !== 'undefined') {\n return element.childElementCount;\n }\n var count = 0;\n for (var i = 0; i < element.childNodes.length; i++) {\n count += element.nodeType === 1 ? 1 : 0;\n }\n return count;\n }\n\n // translate an HTML subtree\n function translateFragment(element) {\n element = element || document.documentElement;\n\n // check all translatable children (= w/ a `data-l10n-id' attribute)\n var children = getTranslatableChildren(element);\n var elementCount = children.length;\n for (var i = 0; i < elementCount; i++) {\n translateElement(children[i]);\n }\n\n // translate element itself if necessary\n translateElement(element);\n }\n\n return {\n // get a localized string\n get: function(key, args, fallbackString) {\n var index = key.lastIndexOf('.');\n var prop = gTextProp;\n if (index > 0) { // An attribute has been specified\n prop = key.substring(index + 1);\n key = key.substring(0, index);\n }\n var fallback;\n if (fallbackString) {\n fallback = {};\n fallback[prop] = fallbackString;\n }\n var data = getL10nData(key, args, fallback);\n if (data && prop in data) {\n return data[prop];\n }\n return '{{' + key + '}}';\n },\n\n // debug\n getData: function() { return gL10nData; },\n getText: function() { return gTextData; },\n\n // get|set the document language\n getLanguage: function() { return gLanguage; },\n setLanguage: function(lang, callback) {\n loadLocale(lang, function() {\n if (callback)\n callback();\n });\n },\n\n // get the direction (ltr|rtl) of the current language\n getDirection: function() {\n // http://www.w3.org/International/questions/qa-scripts\n // Arabic, Hebrew, Farsi, Pashto, Urdu\n var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];\n var shortCode = gLanguage.split('-', 1)[0];\n return (rtlList.indexOf(shortCode) >= 0) ? 'rtl' : 'ltr';\n },\n\n // translate an element or document fragment\n translate: translateFragment,\n\n // this can be used to prevent race conditions\n getReadyState: function() { return gReadyState; },\n ready: function(callback) {\n if (!callback) {\n return;\n } else if (gReadyState == 'complete' || gReadyState == 'interactive') {\n window.setTimeout(function() {\n callback();\n });\n } else if (document.addEventListener) {\n document.addEventListener('localized', function once() {\n document.removeEventListener('localized', once);\n callback();\n });\n }\n }\n };\n}) (window, document);\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getPdfFilenameFromUrl, loadScript } from \"pdfjs-lib\";\n\nasync function docPropertiesLookup(pdfDocument) {\n const url = \"\",\n baseUrl = url.split(\"#\")[0];\n // eslint-disable-next-line prefer-const\n let { info, metadata, contentDispositionFilename, contentLength } =\n await pdfDocument.getMetadata();\n\n if (!contentLength) {\n const { length } = await pdfDocument.getDownloadInfo();\n contentLength = length;\n }\n\n return {\n ...info,\n baseURL: baseUrl,\n filesize: contentLength,\n filename: contentDispositionFilename || getPdfFilenameFromUrl(url),\n metadata: metadata?.getRaw(),\n authors: metadata?.get(\"dc:creator\"),\n numPages: pdfDocument.numPages,\n URL: url,\n };\n}\n\nclass GenericScripting {\n constructor(sandboxBundleSrc) {\n this._ready = loadScript(\n sandboxBundleSrc,\n /* removeScriptElement = */ true\n ).then(() => {\n return window.pdfjsSandbox.QuickJSSandbox();\n });\n }\n\n async createSandbox(data) {\n const sandbox = await this._ready;\n sandbox.create(data);\n }\n\n async dispatchEventInSandbox(event) {\n const sandbox = await this._ready;\n setTimeout(() => sandbox.dispatchEvent(event), 0);\n }\n\n async destroySandbox() {\n const sandbox = await this._ready;\n sandbox.nukeSandbox();\n }\n}\n\nexport { docPropertiesLookup, GenericScripting };\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AnnotationMode, PixelsPerInch } from \"pdfjs-lib\";\nimport { PDFPrintServiceFactory, PDFViewerApplication } from \"./app.js\";\nimport { getXfaHtmlForPrinting } from \"./print_utils.js\";\n\nlet activeService = null;\nlet dialog = null;\nlet overlayManager = null;\n\n// Renders the page to the canvas of the given print service, and returns\n// the suggested dimensions of the output page.\nfunction renderPage(\n activeServiceOnEntry,\n pdfDocument,\n pageNumber,\n size,\n printResolution,\n optionalContentConfigPromise,\n printAnnotationStoragePromise\n) {\n const scratchCanvas = activeService.scratchCanvas;\n\n // The size of the canvas in pixels for printing.\n const PRINT_UNITS = printResolution / PixelsPerInch.PDF;\n scratchCanvas.width = Math.floor(size.width * PRINT_UNITS);\n scratchCanvas.height = Math.floor(size.height * PRINT_UNITS);\n\n const ctx = scratchCanvas.getContext(\"2d\");\n ctx.save();\n ctx.fillStyle = \"rgb(255, 255, 255)\";\n ctx.fillRect(0, 0, scratchCanvas.width, scratchCanvas.height);\n ctx.restore();\n\n return Promise.all([\n pdfDocument.getPage(pageNumber),\n printAnnotationStoragePromise,\n ]).then(function ([pdfPage, printAnnotationStorage]) {\n const renderContext = {\n canvasContext: ctx,\n transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0],\n viewport: pdfPage.getViewport({ scale: 1, rotation: size.rotation }),\n intent: \"print\",\n annotationMode: AnnotationMode.ENABLE_STORAGE,\n optionalContentConfigPromise,\n printAnnotationStorage,\n };\n return pdfPage.render(renderContext).promise;\n });\n}\n\nclass PDFPrintService {\n constructor(\n pdfDocument,\n pagesOverview,\n printContainer,\n printResolution,\n optionalContentConfigPromise = null,\n printAnnotationStoragePromise = null,\n l10n\n ) {\n this.pdfDocument = pdfDocument;\n this.pagesOverview = pagesOverview;\n this.printContainer = printContainer;\n this._printResolution = printResolution || 150;\n this._optionalContentConfigPromise =\n optionalContentConfigPromise || pdfDocument.getOptionalContentConfig();\n this._printAnnotationStoragePromise =\n printAnnotationStoragePromise || Promise.resolve();\n this.l10n = l10n;\n this.currentPage = -1;\n // The temporary canvas where renderPage paints one page at a time.\n this.scratchCanvas = document.createElement(\"canvas\");\n }\n\n layout() {\n this.throwIfInactive();\n\n const body = document.querySelector(\"body\");\n body.setAttribute(\"data-pdfjsprinting\", true);\n\n const { width, height } = this.pagesOverview[0];\n const hasEqualPageSizes = this.pagesOverview.every(\n size => size.width === width && size.height === height\n );\n if (!hasEqualPageSizes) {\n console.warn(\n \"Not all pages have the same size. The printed result may be incorrect!\"\n );\n }\n\n // Insert a @page + size rule to make sure that the page size is correctly\n // set. Note that we assume that all pages have the same size, because\n // variable-size pages are not supported yet (e.g. in Chrome & Firefox).\n // TODO(robwu): Use named pages when size calculation bugs get resolved\n // (e.g. https://crbug.com/355116) AND when support for named pages is\n // added (http://www.w3.org/TR/css3-page/#using-named-pages).\n // In browsers where @page + size is not supported, the next stylesheet\n // will be ignored and the user has to select the correct paper size in\n // the UI if wanted.\n this.pageStyleSheet = document.createElement(\"style\");\n this.pageStyleSheet.textContent = `@page { size: ${width}pt ${height}pt;}`;\n body.append(this.pageStyleSheet);\n }\n\n destroy() {\n if (activeService !== this) {\n // |activeService| cannot be replaced without calling destroy() first,\n // so if it differs then an external consumer has a stale reference to us.\n return;\n }\n this.printContainer.textContent = \"\";\n\n const body = document.querySelector(\"body\");\n body.removeAttribute(\"data-pdfjsprinting\");\n\n if (this.pageStyleSheet) {\n this.pageStyleSheet.remove();\n this.pageStyleSheet = null;\n }\n this.scratchCanvas.width = this.scratchCanvas.height = 0;\n this.scratchCanvas = null;\n activeService = null;\n ensureOverlay().then(function () {\n if (overlayManager.active === dialog) {\n overlayManager.close(dialog);\n }\n });\n }\n\n renderPages() {\n if (this.pdfDocument.isPureXfa) {\n getXfaHtmlForPrinting(this.printContainer, this.pdfDocument);\n return Promise.resolve();\n }\n\n const pageCount = this.pagesOverview.length;\n const renderNextPage = (resolve, reject) => {\n this.throwIfInactive();\n if (++this.currentPage >= pageCount) {\n renderProgress(pageCount, pageCount, this.l10n);\n resolve();\n return;\n }\n const index = this.currentPage;\n renderProgress(index, pageCount, this.l10n);\n renderPage(\n this,\n this.pdfDocument,\n /* pageNumber = */ index + 1,\n this.pagesOverview[index],\n this._printResolution,\n this._optionalContentConfigPromise,\n this._printAnnotationStoragePromise\n )\n .then(this.useRenderedPage.bind(this))\n .then(function () {\n renderNextPage(resolve, reject);\n }, reject);\n };\n return new Promise(renderNextPage);\n }\n\n useRenderedPage() {\n this.throwIfInactive();\n const img = document.createElement(\"img\");\n const scratchCanvas = this.scratchCanvas;\n if (\"toBlob\" in scratchCanvas) {\n scratchCanvas.toBlob(function (blob) {\n img.src = URL.createObjectURL(blob);\n });\n } else {\n img.src = scratchCanvas.toDataURL();\n }\n\n const wrapper = document.createElement(\"div\");\n wrapper.className = \"printedPage\";\n wrapper.append(img);\n this.printContainer.append(wrapper);\n\n return new Promise(function (resolve, reject) {\n img.onload = resolve;\n img.onerror = reject;\n });\n }\n\n performPrint() {\n this.throwIfInactive();\n return new Promise(resolve => {\n // Push window.print in the macrotask queue to avoid being affected by\n // the deprecation of running print() code in a microtask, see\n // https://github.com/mozilla/pdf.js/issues/7547.\n setTimeout(() => {\n if (!this.active) {\n resolve();\n return;\n }\n print.call(window);\n // Delay promise resolution in case print() was not synchronous.\n setTimeout(resolve, 20); // Tidy-up.\n }, 0);\n });\n }\n\n get active() {\n return this === activeService;\n }\n\n throwIfInactive() {\n if (!this.active) {\n throw new Error(\"This print request was cancelled or completed.\");\n }\n }\n}\n\nconst print = window.print;\nwindow.print = function () {\n if (activeService) {\n console.warn(\"Ignored window.print() because of a pending print job.\");\n return;\n }\n ensureOverlay().then(function () {\n if (activeService) {\n overlayManager.open(dialog);\n }\n });\n\n try {\n dispatchEvent(\"beforeprint\");\n } finally {\n if (!activeService) {\n console.error(\"Expected print service to be initialized.\");\n ensureOverlay().then(function () {\n if (overlayManager.active === dialog) {\n overlayManager.close(dialog);\n }\n });\n return; // eslint-disable-line no-unsafe-finally\n }\n const activeServiceOnEntry = activeService;\n activeService\n .renderPages()\n .then(function () {\n return activeServiceOnEntry.performPrint();\n })\n .catch(function () {\n // Ignore any error messages.\n })\n .then(function () {\n // aborts acts on the \"active\" print request, so we need to check\n // whether the print request (activeServiceOnEntry) is still active.\n // Without the check, an unrelated print request (created after aborting\n // this print request while the pages were being generated) would be\n // aborted.\n if (activeServiceOnEntry.active) {\n abort();\n }\n });\n }\n};\n\nfunction dispatchEvent(eventType) {\n const event = new CustomEvent(eventType, {\n bubbles: false,\n cancelable: false,\n detail: \"custom\",\n });\n window.dispatchEvent(event);\n}\n\nfunction abort() {\n if (activeService) {\n activeService.destroy();\n dispatchEvent(\"afterprint\");\n }\n}\n\nfunction renderProgress(index, total, l10n) {\n dialog ||= document.getElementById(\"printServiceDialog\");\n const progress = Math.round((100 * index) / total);\n const progressBar = dialog.querySelector(\"progress\");\n const progressPerc = dialog.querySelector(\".relative-progress\");\n progressBar.value = progress;\n l10n.get(\"print_progress_percent\", { progress }).then(msg => {\n progressPerc.textContent = msg;\n });\n}\n\nwindow.addEventListener(\n \"keydown\",\n function (event) {\n // Intercept Cmd/Ctrl + P in all browsers.\n // Also intercept Cmd/Ctrl + Shift + P in Chrome and Opera\n if (\n event.keyCode === /* P= */ 80 &&\n (event.ctrlKey || event.metaKey) &&\n !event.altKey &&\n (!event.shiftKey || window.chrome || window.opera)\n ) {\n window.print();\n\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n },\n true\n);\n\nif (\"onbeforeprint\" in window) {\n // Do not propagate before/afterprint events when they are not triggered\n // from within this polyfill. (FF / Chrome 63+).\n const stopPropagationIfNeeded = function (event) {\n if (event.detail !== \"custom\") {\n event.stopImmediatePropagation();\n }\n };\n window.addEventListener(\"beforeprint\", stopPropagationIfNeeded);\n window.addEventListener(\"afterprint\", stopPropagationIfNeeded);\n}\n\nlet overlayPromise;\nfunction ensureOverlay() {\n if (!overlayPromise) {\n overlayManager = PDFViewerApplication.overlayManager;\n if (!overlayManager) {\n throw new Error(\"The overlay manager has not yet been initialized.\");\n }\n dialog ||= document.getElementById(\"printServiceDialog\");\n\n overlayPromise = overlayManager.register(\n dialog,\n /* canForceClose = */ true\n );\n\n document.getElementById(\"printCancel\").onclick = abort;\n dialog.addEventListener(\"close\", abort);\n }\n return overlayPromise;\n}\n\nPDFPrintServiceFactory.instance = {\n supportsPrinting: true,\n\n createPrintService(\n pdfDocument,\n pagesOverview,\n printContainer,\n printResolution,\n optionalContentConfigPromise,\n printAnnotationStoragePromise,\n l10n\n ) {\n if (activeService) {\n throw new Error(\"The print service is created and active.\");\n }\n activeService = new PDFPrintService(\n pdfDocument,\n pagesOverview,\n printContainer,\n printResolution,\n optionalContentConfigPromise,\n printAnnotationStoragePromise,\n l10n\n );\n return activeService;\n },\n};\n\nexport { PDFPrintService };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getXfaPageViewport, PixelsPerInch } from \"pdfjs-lib\";\nimport { SimpleLinkService } from \"./pdf_link_service.js\";\nimport { XfaLayerBuilder } from \"./xfa_layer_builder.js\";\n\nfunction getXfaHtmlForPrinting(printContainer, pdfDocument) {\n const xfaHtml = pdfDocument.allXfaHtml;\n const linkService = new SimpleLinkService();\n const scale = Math.round(PixelsPerInch.PDF_TO_CSS_UNITS * 100) / 100;\n\n for (const xfaPage of xfaHtml.children) {\n const page = document.createElement(\"div\");\n page.className = \"xfaPrintedPage\";\n printContainer.append(page);\n\n const builder = new XfaLayerBuilder({\n pageDiv: page,\n pdfPage: null,\n annotationStorage: pdfDocument.annotationStorage,\n linkService,\n xfaHtml: xfaPage,\n });\n const viewport = getXfaPageViewport(xfaPage, { scale });\n\n builder.render(viewport, \"print\");\n }\n}\n\nexport { getXfaHtmlForPrinting };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport \"web-com\";\nimport \"web-print_service\";\nimport { RenderingStates, ScrollMode, SpreadMode } from \"./ui_utils.js\";\nimport { AppOptions } from \"./app_options.js\";\nimport { LinkTarget } from \"./pdf_link_service.js\";\nimport { PDFViewerApplication } from \"./app.js\";\n\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsVersion =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : void 0;\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsBuild =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_BUILD\") : void 0;\n\nconst AppConstants =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? { LinkTarget, RenderingStates, ScrollMode, SpreadMode }\n : null;\n\nwindow.PDFViewerApplication = PDFViewerApplication;\nwindow.PDFViewerApplicationConstants = AppConstants;\nwindow.PDFViewerApplicationOptions = AppOptions;\n\nfunction getViewerConfiguration() {\n return {\n appContainer: document.body,\n mainContainer: document.getElementById(\"viewerContainer\"),\n viewerContainer: document.getElementById(\"viewer\"),\n toolbar: {\n container: document.getElementById(\"toolbarViewer\"),\n numPages: document.getElementById(\"numPages\"),\n pageNumber: document.getElementById(\"pageNumber\"),\n scaleSelect: document.getElementById(\"scaleSelect\"),\n customScaleOption: document.getElementById(\"customScaleOption\"),\n previous: document.getElementById(\"previous\"),\n next: document.getElementById(\"next\"),\n zoomIn: document.getElementById(\"zoomIn\"),\n zoomOut: document.getElementById(\"zoomOut\"),\n viewFind: document.getElementById(\"viewFind\"),\n openFile:\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? document.getElementById(\"openFile\")\n : null,\n print: document.getElementById(\"print\"),\n editorFreeTextButton: document.getElementById(\"editorFreeText\"),\n editorFreeTextParamsToolbar: document.getElementById(\n \"editorFreeTextParamsToolbar\"\n ),\n editorInkButton: document.getElementById(\"editorInk\"),\n editorInkParamsToolbar: document.getElementById(\"editorInkParamsToolbar\"),\n download: document.getElementById(\"download\"),\n },\n secondaryToolbar: {\n toolbar: document.getElementById(\"secondaryToolbar\"),\n toggleButton: document.getElementById(\"secondaryToolbarToggle\"),\n presentationModeButton: document.getElementById(\"presentationMode\"),\n openFileButton:\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? document.getElementById(\"secondaryOpenFile\")\n : null,\n printButton: document.getElementById(\"secondaryPrint\"),\n downloadButton: document.getElementById(\"secondaryDownload\"),\n viewBookmarkButton: document.getElementById(\"viewBookmark\"),\n firstPageButton: document.getElementById(\"firstPage\"),\n lastPageButton: document.getElementById(\"lastPage\"),\n pageRotateCwButton: document.getElementById(\"pageRotateCw\"),\n pageRotateCcwButton: document.getElementById(\"pageRotateCcw\"),\n cursorSelectToolButton: document.getElementById(\"cursorSelectTool\"),\n cursorHandToolButton: document.getElementById(\"cursorHandTool\"),\n scrollPageButton: document.getElementById(\"scrollPage\"),\n scrollVerticalButton: document.getElementById(\"scrollVertical\"),\n scrollHorizontalButton: document.getElementById(\"scrollHorizontal\"),\n scrollWrappedButton: document.getElementById(\"scrollWrapped\"),\n spreadNoneButton: document.getElementById(\"spreadNone\"),\n spreadOddButton: document.getElementById(\"spreadOdd\"),\n spreadEvenButton: document.getElementById(\"spreadEven\"),\n documentPropertiesButton: document.getElementById(\"documentProperties\"),\n },\n sidebar: {\n // Divs (and sidebar button)\n outerContainer: document.getElementById(\"outerContainer\"),\n sidebarContainer: document.getElementById(\"sidebarContainer\"),\n toggleButton: document.getElementById(\"sidebarToggle\"),\n resizer: document.getElementById(\"sidebarResizer\"),\n // Buttons\n thumbnailButton: document.getElementById(\"viewThumbnail\"),\n outlineButton: document.getElementById(\"viewOutline\"),\n attachmentsButton: document.getElementById(\"viewAttachments\"),\n layersButton: document.getElementById(\"viewLayers\"),\n // Views\n thumbnailView: document.getElementById(\"thumbnailView\"),\n outlineView: document.getElementById(\"outlineView\"),\n attachmentsView: document.getElementById(\"attachmentsView\"),\n layersView: document.getElementById(\"layersView\"),\n // View-specific options\n outlineOptionsContainer: document.getElementById(\n \"outlineOptionsContainer\"\n ),\n currentOutlineItemButton: document.getElementById(\"currentOutlineItem\"),\n },\n findBar: {\n bar: document.getElementById(\"findbar\"),\n toggleButton: document.getElementById(\"viewFind\"),\n findField: document.getElementById(\"findInput\"),\n highlightAllCheckbox: document.getElementById(\"findHighlightAll\"),\n caseSensitiveCheckbox: document.getElementById(\"findMatchCase\"),\n matchDiacriticsCheckbox: document.getElementById(\"findMatchDiacritics\"),\n entireWordCheckbox: document.getElementById(\"findEntireWord\"),\n findMsg: document.getElementById(\"findMsg\"),\n findResultsCount: document.getElementById(\"findResultsCount\"),\n findPreviousButton: document.getElementById(\"findPrevious\"),\n findNextButton: document.getElementById(\"findNext\"),\n },\n passwordOverlay: {\n dialog: document.getElementById(\"passwordDialog\"),\n label: document.getElementById(\"passwordText\"),\n input: document.getElementById(\"password\"),\n submitButton: document.getElementById(\"passwordSubmit\"),\n cancelButton: document.getElementById(\"passwordCancel\"),\n },\n documentProperties: {\n dialog: document.getElementById(\"documentPropertiesDialog\"),\n closeButton: document.getElementById(\"documentPropertiesClose\"),\n fields: {\n fileName: document.getElementById(\"fileNameField\"),\n fileSize: document.getElementById(\"fileSizeField\"),\n title: document.getElementById(\"titleField\"),\n author: document.getElementById(\"authorField\"),\n subject: document.getElementById(\"subjectField\"),\n keywords: document.getElementById(\"keywordsField\"),\n creationDate: document.getElementById(\"creationDateField\"),\n modificationDate: document.getElementById(\"modificationDateField\"),\n creator: document.getElementById(\"creatorField\"),\n producer: document.getElementById(\"producerField\"),\n version: document.getElementById(\"versionField\"),\n pageCount: document.getElementById(\"pageCountField\"),\n pageSize: document.getElementById(\"pageSizeField\"),\n linearized: document.getElementById(\"linearizedField\"),\n },\n },\n annotationEditorParams: {\n editorFreeTextFontSize: document.getElementById(\"editorFreeTextFontSize\"),\n editorFreeTextColor: document.getElementById(\"editorFreeTextColor\"),\n editorInkColor: document.getElementById(\"editorInkColor\"),\n editorInkThickness: document.getElementById(\"editorInkThickness\"),\n editorInkOpacity: document.getElementById(\"editorInkOpacity\"),\n },\n printContainer: document.getElementById(\"printContainer\"),\n openFileInput:\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? document.getElementById(\"fileInput\")\n : null,\n debuggerScriptPath: \"./debugger.js\",\n };\n}\n\nfunction webViewerLoad() {\n const config = getViewerConfiguration();\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\")) {\n // Give custom implementations of the default viewer a simpler way to\n // set various `AppOptions`, by dispatching an event once all viewer\n // files are loaded but *before* the viewer initialization has run.\n const event = new CustomEvent(\"webviewerloaded\", {\n bubbles: true,\n cancelable: true,\n detail: {\n source: window,\n },\n });\n try {\n // Attempt to dispatch the event at the embedding `document`,\n // in order to support cases where the viewer is embedded in\n // a *dynamically* created <iframe> element.\n parent.document.dispatchEvent(event);\n } catch (ex) {\n // The viewer could be in e.g. a cross-origin <iframe> element,\n // fallback to dispatching the event at the current `document`.\n console.error(`webviewerloaded: ${ex}`);\n document.dispatchEvent(event);\n }\n }\n PDFViewerApplication.run(config);\n}\n\n// Block the \"load\" event until all pages are loaded, to ensure that printing\n// works in Firefox; see https://bugzilla.mozilla.org/show_bug.cgi?id=1618553\ndocument.blockUnblockOnload?.(true);\n\nif (\n document.readyState === \"interactive\" ||\n document.readyState === \"complete\"\n) {\n webViewerLoad();\n} else {\n document.addEventListener(\"DOMContentLoaded\", webViewerLoad, true);\n}\n\nexport {\n PDFViewerApplication,\n AppConstants as PDFViewerApplicationConstants,\n AppOptions as PDFViewerApplicationOptions,\n};\n"],"names":["_app","require","_preferences","_download_manager","_genericl10n","_generic_scripting","GenericCom","exports","GenericPreferences","BasePreferences","_writeToStorage","prefObj","localStorage","setItem","JSON","stringify","_readFromStorage","parse","getItem","GenericExternalServices","DefaultExternalServices","createDownloadManager","DownloadManager","createPreferences","createL10n","locale","GenericL10n","createScripting","sandboxBundleSrc","GenericScripting","PDFViewerApplication","externalServices","_ui_utils","_pdfjsLib","_app_options","_event_utils","_pdf_link_service","_webAnnotation_editor_params","_overlay_manager","_password_prompt","_webPdf_attachment_viewer","_webPdf_cursor_tools","_webPdf_document_properties","_webPdf_find_bar","_pdf_find_controller","_pdf_history","_webPdf_layer_viewer","_webPdf_outline_viewer","_webPdf_presentation_mode","_pdf_rendering_queue","_pdf_scripting_manager","_webPdf_sidebar","_webPdf_thumbnail_viewer","_pdf_viewer","_webSecondary_toolbar","_webToolbar","_view_history","FORCE_PAGES_LOADED_TIMEOUT","WHEEL_ZOOM_DISABLED_TIMEOUT","ViewOnLoad","UNKNOWN","PREVIOUS","INITIAL","ViewerCssTheme","AUTOMATIC","LIGHT","DARK","constructor","Error","updateFindControlState","data","updateFindMatchesCount","initPassiveLoading","callbacks","reportTelemetry","options","supportsPinchToZoom","shadow","supportsIntegratedFind","supportsDocumentFonts","supportedMouseWheelZoomModifierKeys","ctrlKey","metaKey","isInAutomation","updateEditorStates","canvasMaxAreaInBytes","getNimbusExperimentData","Promise","resolve","initialBookmark","document","location","hash","substring","_initializedCapability","PromiseCapability","appConfig","pdfDocument","pdfLoadingTask","printService","pdfViewer","pdfThumbnailViewer","pdfRenderingQueue","pdfPresentationMode","pdfDocumentProperties","pdfLinkService","pdfHistory","pdfSidebar","pdfOutlineViewer","pdfAttachmentViewer","pdfLayerViewer","pdfCursorTools","pdfScriptingManager","store","downloadManager","overlayManager","preferences","toolbar","secondaryToolbar","eventBus","l10n","annotationEditorParams","isInitialViewSet","downloadComplete","isViewerEmbedded","window","parent","url","baseUrl","_downloadUrl","_boundEvents","Object","create","documentInfo","metadata","_contentDispositionFilename","_contentLength","_saveInProgress","_wheelUnusedTicks","_wheelUnusedFactor","_touchUnusedTicks","_touchUnusedFactor","_PDFBug","_hasAnnotationEditors","_title","title","_printAnnotationStoragePromise","_touchInfo","_isCtrlKeyDown","_nimbusDataPromise","initialize","_initializeOptions","_forceCssTheme","_initializeL10n","AppOptions","get","LinkTarget","NONE","set","TOP","_initializeViewerComponents","bindEvents","bindWindowEvents","appContainer","documentElement","translate","then","dispatch","source","_parseHashParams","_hasUserOptions","console","warn","setAll","getAll","reason","error","message","mainContainer","viewerContainer","params","parseQueryString","loadFakeWorker","ex","has","TextLayerMode","DISABLE","classList","add","loadPDFBug","loadCSS","enabled","split","init","OPS","dir","getDirection","getElementsByTagName","cssTheme","values","includes","styleSheet","styleSheets","cssRules","i","ii","length","rule","CSSMediaRule","media","deleteRule","darkRules","exec","cssText","insertRule","AutomationEventBus","EventBus","OverlayManager","PDFRenderingQueue","onIdle","_cleanup","bind","PDFLinkService","externalLinkTarget","externalLinkRel","ignoreDestinationZoom","findController","PDFFindController","linkService","updateMatchesCountOnProgress","PDFScriptingManager","scriptingFactory","docPropertiesLookup","_scriptingDocProperties","container","viewer","annotationEditorMode","pageColors","matchMedia","matches","background","foreground","PDFViewer","renderingQueue","scriptingManager","textLayerMode","annotationMode","imageResourcesPath","enablePrintAutoRotate","useOnlyCssZoom","isOffscreenCanvasSupported","maxCanvasPixels","enablePermissions","setViewer","sidebar","thumbnailView","PDFThumbnailViewer","setThumbnailViewer","PDFHistory","setHistory","findBar","PDFFindBar","AnnotationEditorType","AnnotationEditorParams","id","getElementById","documentProperties","PDFDocumentProperties","_docFilename","cursorHandToolButton","PDFCursorTools","cursorToolOnLoad","Toolbar","SecondaryToolbar","supportsFullscreen","presentationModeButton","PDFPresentationMode","passwordOverlay","passwordPrompt","PasswordPrompt","outlineView","PDFOutlineViewer","attachmentsView","PDFAttachmentViewer","layersView","PDFLayerViewer","PDFSidebar","elements","onToggled","forceRendering","onUpdateThumbnails","pageView","getCachedPageViews","renderingState","RenderingStates","FINISHED","getThumbnail","setImage","scrollThumbnailIntoView","currentPageNumber","run","config","webViewerInitialized","initialized","settled","initializedPromise","promise","zoomIn","steps","scaleFactor","isInPresentationMode","increaseScale","drawingDelay","zoomOut","decreaseScale","zoomReset","currentScaleValue","DEFAULT_SCALE_VALUE","pagesCount","numPages","page","val","supportsPrinting","PDFPrintServiceFactory","instance","fullscreenEnabled","loadingBar","barElement","bar","ProgressBar","setTitleUsingUrl","downloadUrl","isDataScheme","_hideViewBookmark","getPdfFilenameFromUrl","decodeURIComponent","getFilenameFromUrl","setTitle","editorIndicator","printing","viewBookmarkButton","contains","close","_unblockDocumentLoadEvent","annotationStorage","size","_annotationStorageModified","save","promises","push","destroy","setDocument","externalLinkEnabled","destroyPromise","reset","cleanup","all","open","args","deprecatedArgs","byteLength","workerParams","OptionKind","WORKER","assign","GlobalWorkerOptions","originalUrl","apiParams","API","loadingTask","getDocument","onPassword","updateCallback","setUpdateCallback","onProgress","loaded","total","progress","load","undefined","key","InvalidPDFException","MissingPDFException","UnexpectedResponseException","msg","_documentError","_ensureDownloadComplete","download","filename","getData","blob","Blob","type","dispatchWillSave","saveDocument","dispatchDidSave","downloadOrSave","openInExternalApp","moreInfo","_otherError","moreInfoText","version","build","stack","lineNumber","join","level","percent","Math","round","loadingParams","disableAutoFetch","setDisableAutoFetch","getDownloadInfo","hide","firstPagePromise","pageLayoutPromise","getPageLayout","catch","pageModePromise","getPageMode","openActionPromise","getOpenAction","setPagesCount","onePageRendered","pagesPromise","storedPromise","ViewHistory","fingerprints","getMultiple","zoom","scrollLeft","scrollTop","rotation","sidebarView","SidebarView","scrollMode","ScrollMode","spreadMode","SpreadMode","pdfPage","setWidth","_initializeAnnotationStorageCallbacks","animationStarted","timeStamp","stored","pageLayout","pageMode","openAction","viewOnLoad","_initializePdfHistory","fingerprint","initialDest","dest","parseInt","apiPageModeToSidebarView","modes","apiPageLayoutToViewerModes","setInitialView","focus","race","setTimeout","hasEqualPageSizes","update","_initializeAutoPrint","timestamp","getOutline","outline","render","getAttachments","attachments","optionalContentConfigPromise","optionalContentConfig","_initializePageLabels","_initializeMetadata","_on","once","baseURL","filesize","getRaw","authors","URL","javaScript","enableScripting","getJavaScript","triggerAutoPrint","action","some","js","AutoPrintRegExp","test","triggerPrinting","info","contentDispositionFilename","contentLength","getMetadata","log","PDFFormatVersion","Producer","trim","Creator","pdfTitle","Title","metadataTitle","IsXFAPresent","IsAcroFormPresent","isPureXfa","enableXfa","renderForms","IsSignaturesPresent","labels","getPageLabels","numLabels","standardLabels","emptyLabels","label","toString","setPageLabels","setPageNumber","currentPageLabel","resetHistory","updateUrl","initialRotation","explicitDest","pageNumber","onSetModified","addEventListener","beforeUnload","onResetModified","removeEventListener","onAnnotationEditor","typeStr","storedHash","setRotation","angle","isValidRotation","pagesRotation","setViewerModes","scroll","spread","isValidScrollMode","isValidSpreadMode","setHash","isThumbnailViewEnabled","visibleView","THUMBS","renderHighestPriority","beforePrint","dispatchWillPrint","print","pageViewsReady","alert","pagesOverview","getPagesOverview","printContainer","printResolution","createPrintService","layout","afterPrint","dispatchDidPrint","resetModified","rotatePages","delta","requestPresentationMode","request","webViewerResize","webViewerHashchange","webViewerPageRender","webViewerPageRendered","webViewerUpdateViewarea","webViewerPageChanging","webViewerScaleChanging","webViewerRotationChanging","webViewerSidebarViewChanged","webViewerPageMode","webViewerNamedAction","webViewerPresentationModeChanged","webViewerPresentationMode","webViewerSwitchAnnotationEditorMode","webViewerSwitchAnnotationEditorParams","webViewerPrint","webViewerDownload","webViewerOpenInExternalApp","webViewerFirstPage","webViewerLastPage","webViewerNextPage","webViewerPreviousPage","webViewerZoomIn","webViewerZoomOut","webViewerZoomReset","webViewerPageNumberChanged","webViewerScaleChanged","webViewerRotateCw","webViewerRotateCcw","webViewerOptionalContentConfig","webViewerSwitchScrollMode","webViewerScrollModeChanged","webViewerSwitchSpreadMode","webViewerSpreadModeChanged","webViewerDocumentProperties","webViewerFindFromUrlHash","webViewerUpdateFindMatchesCount","webViewerUpdateFindControlState","reportPageStatsPDFBug","webViewerFileInputChange","webViewerOpenFile","addWindowResolutionChange","evt","webViewerResolutionChange","mediaQueryList","devicePixelRatio","removeWindowResolutionChange","windowResize","windowHashChange","windowBeforePrint","windowAfterPrint","windowUpdateFromSandbox","event","detail","webViewerVisibilityChange","webViewerWheel","passive","webViewerTouchStart","webViewerTouchMove","webViewerTouchEnd","webViewerClick","webViewerKeyDown","webViewerKeyUp","unbindEvents","_off","unbindWindowEvents","_accumulateTicks","ticks","prop","wholeTicks","trunc","_accumulateFactor","previousScale","factor","newFactor","floor","_centerAtPos","x","y","scaleDiff","currentScale","top","left","containerTopLeft","blockUnblockOnload","scriptingReady","ready","HOSTED_VIEWER_ORIGINS","validateFileURL","file","viewerOrigin","href","origin","fileOrigin","workerSrc","loadScript","PDFWorker","self","debuggerScriptPath","PDFBug","import","globalThis","Stats","getPageView","stats","queryString","search","fileInput","openFileInput","value","files","target","preventDefault","dataTransfer","dropEffect","effectAllowed","printButton","viewFind","updateLoadingIndicatorState","mode","view","OUTLINE","ATTACHMENTS","LAYERS","switchView","select","toggle","presentationModeState","state","setMultiple","scale","getAnchorUrl","pdfOpenParams","popStateInProgress","createObjectURL","name","click","nextPage","previousPage","goToPage","query","caseSensitive","entireWord","highlightAll","findPrevious","matchDiacritics","matchesCount","updateResultsCount","previous","rawQuery","result","updateUIState","setPageScale","presetValue","pageLabel","currentPage","RUNNING","refresh","visibilityState","setZoomDisabledTimeout","zoomDisabledTimeout","clearTimeout","deltaMode","exp","deltaY","isBuiltInMac","isPinchToZoom","WheelEvent","DOM_DELTA_PIXEL","deltaX","abs","deltaZ","normalizeWheelEventDirection","DOM_DELTA_LINE","DOM_DELTA_PAGE","sign","PIXELS_PER_LINE_SCALE","clientX","clientY","touches","touch0","touch1","identifier","touch0X","pageX","touch0Y","pageY","touch1X","touch1Y","page0X","page0Y","page1X","page1Y","pTouch0X","pTouch0Y","pTouch1X","pTouch1Y","v1X","v1Y","v2X","v2Y","det","hypot","diff0X","diff1X","diff0Y","diff1Y","dotProduct","distance","pDistance","newScaleFactor","isOpen","containsElement","toggleButton","active","isViewerInPresentationMode","handled","ensureViewerFocused","cmd","altKey","shiftKey","keyCode","newState","curElement","getActiveOrFocusedElement","curElementTagName","tagName","toUpperCase","isContentEditable","turnPage","turnOnlyIfPageFit","isVerticalScrollbarEnabled","isHorizontalScrollbarEnabled","opened","switchTool","CursorTool","SELECT","HAND","returnValue","webViewerAnnotationEditorStatesChanged","DEFAULT_SCALE","DEFAULT_SCALE_DELTA","MIN_SCALE","MAX_SCALE","UNKNOWN_SCALE","MAX_AUTO_SCALE","SCROLLBAR_PADDING","VERTICAL_PADDING","PAUSED","PresentationModeState","NORMAL","CHANGING","FULLSCREEN","ENABLE","ENABLE_PERMISSIONS","VERTICAL","HORIZONTAL","WRAPPED","PAGE","ODD","EVEN","ZOOM","OutputScale","pixelRatio","sx","sy","scaled","scrollIntoView","element","spot","scrollMatches","offsetParent","offsetY","offsetTop","clientTop","offsetX","offsetLeft","clientLeft","clientHeight","scrollHeight","clientWidth","scrollWidth","getComputedStyle","overflow","watchScroll","viewAreaElement","callback","debounceScroll","rAF","requestAnimationFrame","viewAreaElementScrolled","currentX","lastX","right","currentY","lastY","down","_eventHandler","Map","URLSearchParams","toLowerCase","InvisibleCharactersRegExp","removeNullCharacters","str","replaceInvisible","replaceAll","binarySearchFirstItem","items","condition","start","minIndex","maxIndex","currentIndex","currentItem","approximateFraction","xinv","limit","x_","a","b","c","d","p","q","roundToDivide","div","r","getPageSizeInches","userUnit","rotate","x1","y1","x2","y2","changeOrientation","width","height","backtrackBeforeAllVisibleElements","index","views","elt","pageTop","getVisibleElements","scrollEl","sortByVisibility","horizontal","rtl","bottom","isElementBottomAfterViewTop","elementBottom","isElementNextAfterViewHorizontally","elementLeft","elementRight","visible","ids","Set","numViews","firstVisibleElementInd","lastEdge","currentWidth","currentHeight","viewWidth","viewHeight","viewRight","viewBottom","hiddenHeight","max","hiddenWidth","fractionHeight","fractionWidth","widthPercent","first","last","at","sort","pc","noContextMenuHandler","atan2","PI","normalizeWheelEventDelta","MOUSE_PIXELS_PER_LINE","MOUSE_LINES_PER_PAGE","Number","isInteger","isPortraitOrientation","docStyle","style","clamp","v","min","disableAutoFetchTimeout","isNaN","remove","setProperty","parentNode","scrollbarWidth","offsetWidth","delay","show","curRoot","curActiveOrFocused","activeElement","querySelector","shadowRoot","toggleCheckedBtn","button","setAttribute","toggleExpandedBtn","pdfjsLib","__non_webpack_require__","module","compatibilityParams","userAgent","navigator","platform","maxTouchPoints","isAndroid","isIOS","checkCanvasSizeLimitation","VIEWER","PREFERENCE","defaultOptions","kind","defaultZoomDelay","defaultZoomValue","disableHistory","disablePageLabels","enableFloatingToolbar","historyUpdateUrl","forcePageColors","pageColorsBackground","pageColorsForeground","pdfBugEnabled","sidebarViewOnLoad","scrollModeOnLoad","spreadModeOnLoad","viewerCssTheme","cMapPacked","cMapUrl","disableFontFace","disableRange","disableStream","docBaseUrl","fontExtraProperties","isEvalSupported","maxImageSize","pdfBug","standardFontDataUrl","verbosity","workerPort","defaultUrl","disablePreferences","language","userOptions","userOption","defaultOption","valueType","keys","WaitOnType","EVENT","TIMEOUT","waitOnEventOrTimeout","reject","handler","eventHandler","timeout","timeoutHandler","listeners","on","eventName","listener","external","off","eventListeners","externalListeners","slice","splice","DEFAULT_LINK_REL","SELF","BLANK","PARENT","addLinkAttributes","link","rel","urlNullRemoved","onclick","targetStr","pagesRefCache","_ignoreDestinationZoom","clear","goToDestinationHelper","rawDest","namedDest","destRef","_cachedPageNumber","getPageIndex","pageIndex","cachePageRef","pushCurrentPosition","scrollPageIntoView","destArray","goToDestination","getDestination","Array","isArray","pageLabelToPageNumber","pushPage","newWindow","getDestinationHash","escape","anchor","phrase","match","zoomArgs","zoomArg","zoomArgNumber","parseFloat","allowNegativeOffset","unescape","isValidExplicitDestination","executeNamedAction","back","forward","executeSetOCGState","operator","elem","setVisibility","group","getGroup","pageNum","pageRef","refStr","gen","num","destLength","allowNull","param","SimpleLinkService","bindListeners","editorFreeTextFontSize","editorFreeTextColor","editorInkColor","editorInkThickness","editorInkOpacity","dispatchEvent","AnnotationEditorParamsType","valueAsNumber","details","FREETEXT_SIZE","FREETEXT_COLOR","INK_COLOR","INK_THICKNESS","INK_OPACITY","overlays","WeakMap","register","dialog","canForceClose","unregister","delete","showModal","activeCapability","input","submitButton","cancelButton","_isViewerEmbedded","verify","e","cancel","passwordIncorrect","PasswordResponses","INCORRECT_PASSWORD","textContent","password","invokeCallback","_base_tree_viewer","BaseTreeViewer","appendAttachment","keepRenderedCapability","_attachments","_renderedCapability","_pendingDispatchEvent","_dispatchEvent","attachmentsCount","_bindLink","content","openOrDownloadData","fragment","createDocumentFragment","item","createElement","className","_normalizeTextContent","append","_finishRendering","renderedPromise","TREEITEM_OFFSET_TOP","TREEITEM_SELECTED_CLASS","_pdfDocument","_lastToggleIsShow","_currentTreeItem","count","_addToggleButton","hidden","toggler","stopPropagation","shouldShowAll","_toggleTreeItem","prepend","root","querySelectorAll","_toggleAllTreeItems","hasAnyNesting","_updateCurrentTreeItem","treeItem","_scrollToCurrentTreeItem","currentNode","firstElementChild","scrollTo","_grab_to_pan","previouslyActive","handTool","GrabToPan","addEventListeners","activeTool","tool","disableActiveTool","deactivate","activate","disableActive","enableActive","CSS_CLASS_GRAB","ownerDocument","ignoreTarget","onActiveChanged","_onMouseDown","onMouseDown","_onMouseMove","onMouseMove","_endPan","endPan","overlay","node","originalTarget","scrollLeftStart","scrollTopStart","clientXStart","clientYStart","focusedElement","blur","buttons","xDiff","yDiff","behavior","body","DEFAULT_FIELD_CONTENT","NON_METRIC_LOCALES","US_PAGE_NAMES","METRIC_PAGE_NAMES","getPageName","isPortrait","pageNames","fieldData","fields","closeButton","fileNameLookup","_fileNameLookup","_currentPageNumber","_pagesRotation","_isNonMetricLocale","getLanguage","_dataAvailableCapability","updateUI","fileName","fileSize","creationDate","modificationDate","pageSize","isLinearized","parseFileSize","parseDate","CreationDate","ModDate","getPage","parsePageSize","parseLinearization","IsLinearized","freeze","author","Author","subject","Subject","keywords","Keywords","creator","producer","pageCount","linearized","kb","mb","size_mb","toPrecision","toLocaleString","size_kb","size_b","pageSizeInches","sizeInches","sizeMillimeters","rawName","exactMillimeters","intMillimeters","unit","orientation","inputDate","dateObject","PDFDateString","toDateObject","date","toLocaleDateString","time","toLocaleTimeString","MATCHES_COUNT_LIMIT","findField","highlightAllCheckbox","caseSensitiveCheckbox","matchDiacriticsCheckbox","entireWordCheckbox","findMsg","findResultsCount","findPreviousButton","findNextButton","adjustWidth","findPrev","checked","status","FindState","FOUND","PENDING","NOT_FOUND","current","matchCountMsg","findbarHeight","inputContainerHeight","_pdf_find_utils","FIND_TIMEOUT","MATCH_SCROLL_OFFSET_TOP","MATCH_SCROLL_OFFSET_LEFT","CHARACTERS_TO_NORMALIZE","DIACRITICS_EXCEPTION","DIACRITICS_EXCEPTION_STR","DIACRITICS_REG_EXP","SPECIAL_CHARS_REG_EXP","NOT_DIACRITIC_FROM_END_REG_EXP","NOT_DIACRITIC_FROM_START_REG_EXP","SYLLABLES_REG_EXP","SYLLABLES_LENGTHS","FIRST_CHAR_SYLLABLES_REG_EXP","NFKC_CHARS_TO_NORMALIZE","noSyllablesRegExp","withSyllablesRegExp","normalize","text","syllablePositions","m","char","len","normalizationRegex","replace","toNormalizeWithNFKC","getNormalizeWithNFKC","CJK","HKDiacritics","regexp","RegExp","rawDiacriticsPositions","normalized","positions","rawDiacriticsIndex","syllableIndex","shift","shiftOrigin","eol","hasDiacritics","p1","p2","p3","p4","p5","p6","p7","p8","replacement","jj","j","charAt","hasTrailingDashEOL","endsWith","newCharLen","getOriginalIndex","diffs","pos","end","oldStart","oldEnd","oldLen","visitedPagesCount","_linkService","_eventBus","onIsPageVisible","onFind","onFindBarClose","highlightMatches","_highlightMatches","pageMatches","_pageMatches","pageMatchesLength","_pageMatchesLength","selected","_selected","_firstPageCapability","phraseSearch","shouldDirtyMatch","_dirtyMatch","extractText","findbarClosed","pendingTimeout","_findTimeout","nextMatch","updateAllPages","scrollMatchIntoView","selectedLeft","matchIndex","_scrollMatches","matchIdx","pageIdx","_offset","wrapped","_extractTextPromises","_pageContents","_pageDiffs","_hasDiacritics","_matchesCountTotal","_pagesToSearch","_pendingFindMatches","_resumePageIdx","_rawQuery","_normalizedQuery","filter","map","newQuery","prevQuery","newType","prevType","isEntireWord","startIdx","charCodeAt","getCharacterType","calculateRegExpMatch","pageContent","matchesLength","matchPos","matchLen","convertToRegExpString","isUnicode","trailingSpaces","String","fromCharCode","calculateMatch","reverse","isUnicodePart","queryPart","flags","updatePage","nextPageMatch","pageMatchesCount","updateUIResultsCount","textOptions","disableNormalization","extractTextCapability","getTextContent","strBuf","textItem","hasEOL","currentPageIndex","offset","numPageMatches","updateMatch","advanceOffsetPage","matchesReady","numMatches","found","requestMatchesCount","CharacterType","SPACE","ALPHA_LETTER","PUNCT","HAN_LETTER","KATAKANA_LETTER","HIRAGANA_LETTER","HALFWIDTH_KATAKANA_LETTER","THAI_LETTER","isAlphabeticalScript","charCode","isAscii","isAsciiAlpha","isAsciiDigit","isAsciiSpace","isHan","isKatakana","isHiragana","isHalfwidthKatakana","isThai","NormalizeWithNFKC","HASH_CHANGE_TIMEOUT","POSITION_UPDATED_THRESHOLD","UPDATE_VIEWAREA_TIMEOUT","getCurrentHash","_initialized","_fingerprint","_isPagesLoaded","reInitialized","_updateUrl","_bindEvents","history","_popStateInProgress","_blockHashChange","_currentHash","_numPositionUpdates","_uid","_maxUid","_destination","_position","_isValidState","_parseCurrentHash","_pushOrReplaceState","destination","_updateInternalState","uid","_initialRotation","_initialBookmark","_pageHide","_unbindEvents","_updateViewareaTimeout","_isValidPage","forceReplace","isDestHashesEqual","isDestArraysEqual","_tryPushCurrentPosition","shouldReplace","newUrl","startsWith","replaceState","pushState","temporary","position","checkReload","perfEntry","performance","getEntriesByType","removeTemporary","checkNameddest","nameddest","_updateViewarea","_popState","newHash","hashChanged","updateViewarea","popState","pageHide","destHash","pushHash","firstDest","secondDest","isEntryEqual","second","updateLayers","_optionalContentConfig","_optionalContentHash","layersCount","groupId","getHash","_setNestedName","fontStyle","groups","getOrder","queue","levelData","itemsDiv","order","getOptionalContentConfig","_currentOutlineItem","_currentOutlineItemCapability","_sidebarView","_outline","_pageNumberToDestHashCapability","outlineCount","currentOutlineItemPromise","attachment","setOCGState","_setStyles","bold","italic","fontWeight","totalCount","nestedCount","nestedItems","pageNumberToDestHash","_getPageNumberToDestHash","linkElement","pageNumberNesting","nesting","currentNesting","DELAY_BEFORE_HIDING_CONTROLS","ACTIVE_SELECTOR","CONTROLS_SELECTOR","MOUSE_SCROLL_COOLDOWN_TIME","PAGE_SWITCH_THRESHOLD","SWIPE_MIN_DISTANCE_THRESHOLD","SWIPE_ANGLE_THRESHOLD","contextMenuOpen","mouseScrollTimeStamp","mouseScrollDelta","touchSwipeState","requestFullscreen","addFullscreenChangeListeners","notifyStateChange","scaleValue","removeFullscreenChangeListeners","mouseWheel","currentTime","Date","now","storedTime","resetMouseScrollState","totalDelta","success","enter","addWindowListeners","showControls","getSelection","removeAllRanges","exit","removeWindowListeners","hideControls","mouseDown","hasAttribute","contextMenu","controlsTimeout","touchSwipe","startX","startY","endX","endY","dx","dy","absAngle","showControlsBind","mouseDownBind","mouseWheelBind","resetMouseScrollStateBind","contextMenuBind","touchSwipeBind","fullscreenChange","fullscreenElement","fullscreenChangeBind","CLEANUP_TIMEOUT","highestPriorityPage","idleTimeout","defineProperty","isHighestPriority","renderingId","currentlyVisiblePages","getHighestPriority","scrolledDown","preRenderExtra","visibleViews","numVisible","isViewFinished","firstId","lastId","visibleIds","holeId","holeView","preRenderIndex","preRenderView","renderView","resume","draw","finally","RenderingCancelledException","_pdfViewer","_closeCapability","_destroyCapability","_scripting","_ready","_sandboxBundleSrc","_scriptingFactory","_docPropertiesLookup","_destroyScripting","objects","calculationOrder","docActions","getFieldObjects","getCalculationOrderIds","getJSActions","_createScripting","_internalEvents","_updateFromSandbox","dispatchEventInSandbox","_dispatchPageClose","_dispatchPageOpen","_pageOpenPending","docProperties","_getDocProperties","createSandbox","appInfo","docInfo","actions","_visitedPages","isChangingPresentationMode","siblings","command","elementId","CustomEvent","setValue","visitedPages","actionsPromise","destroySandbox","SIDEBAR_WIDTH_VAR","SIDEBAR_MIN_WIDTH","SIDEBAR_RESIZING_CLASS","UI_NOTIFICATION_CLASS","isRTL","mouseMoveBound","mouseMove","mouseUpBound","mouseUp","outerContainerWidth","isInitialEventDispatched","outerContainer","sidebarContainer","resizer","thumbnailButton","outlineButton","attachmentsButton","layersButton","_outlineOptionsContainer","outlineOptionsContainer","_currentOutlineItemButton","currentOutlineItemButton","hideUINotification","disabled","forceOpen","isViewChanged","showUINotification","onTreeLoaded","updateWidth","updated","maxWidth","_pdf_thumbnail_view","THUMBNAIL_SCROLL_MARGIN","THUMBNAIL_SELECTED_CLASS","CSS","supports","_scrollUpdated","_resetView","_thumbnails","_getVisibleThumbs","prevThumbnailView","shouldScroll","updateArgs","thumbnail","TempImageFactory","destroyCanvas","_pageLabels","_cancelRendering","firstPdfPage","viewport","getViewport","PDFThumbnailView","defaultViewport","clone","setPdfPage","cancelRendering","setPageLabel","ensurePdfPageLoaded","thumbView","getScrollAhead","visibleThumbs","scrollAhead","DRAW_UPSCALE_FACTOR","MAX_NUM_SCALING_STEPS","THUMBNAIL_WIDTH","tempCanvas","getCanvas","ctx","getContext","alpha","fillStyle","fillRect","restore","pdfPageRotate","_optionalContentConfigPromise","renderTask","_thumbPageTitle","updateDims","img","_placeholderImg","ratio","canvasWidth","canvasHeight","totalRotation","removeAttribute","image","replaceWith","_getPageDrawContext","upscaleFactor","canvas","outputScale","transform","_convertCanvasToImage","reducedCanvas","_reduceImage","_thumbPageCanvas","src","toDataURL","finishRenderTask","drawViewport","renderContinueCallback","cont","renderContext","canvasContext","onContinue","resultPromise","thumbnailCanvas","drawImage","reducedWidth","reducedHeight","reducedImage","reducedImageCtx","_l10n_utils","_pdf_page_view","DEFAULT_CACHE_SIZE","PagesCountLimit","FORCE_SCROLL_MODE_PAGE","FORCE_LAZY_PAGE_INIT","PAUSE_EAGER_PAGE_INIT","isValidAnnotationEditorMode","PDFPageViewBuffer","buf","destroyFirstView","resize","newSize","idsToKeep","Symbol","iterator","firstView","next","buffer","annotationEditorUIManager","AnnotationMode","ENABLE_FORMS","copyCallbackBound","getAllTextInProgress","hiddenCopyElement","interruptCopyCondition","previousContainerHeight","resizeObserver","ResizeObserver","resizeObserverCallback","scrollModePageState","onVisibilityChange","scaleTimeoutId","viewerVersion","observe","_getVisiblePages","_scriptingManager","removePageBorders","NullL10n","defaultRenderingQueue","_scrollUpdate","_onBeforeDraw","_onAfterDraw","updateContainerHeightCss","_pages","_pagesCapability","every","_setCurrentPageNumber","resetCurrentPageView","indexOf","_currentScale","setScale","noScroll","_currentScaleValue","_onePageRenderedCapability","layerProperties","fieldObjectsPromise","hasJSActionsPromise","hasJSActions","initializePermissions","permissions","PermissionFlag","COPY","MODIFY_CONTENTS","MODIFY_ANNOTATIONS","FILL_INTERACTIVE_FORMS","onePageRenderedOrForceFetch","visibilityChangePromise","getAllText","texts","copyCallback","selection","focusNode","anchorNode","containsNode","savedCursor","cursor","interruptCopy","ev","clipboard","writeText","permissionsPromise","getPermissions","_scrollMode","cssTransform","before","AnnotationEditorUIManager","updateMode","viewerElement","PixelsPerInch","PDF_TO_CSS_UNITS","PDFPageView","firstPageView","ref","ensurePageViewVisible","_spreadMode","_updateSpreadMode","getPagesLeft","Language","lang","_location","_previousScrollMode","previousPageNumber","scrollDown","pages","_updateScrollMode","pageIndexSet","parity","dummyPage","pageSpot","isSameScale","newScale","setScaleUpdatePages","newValue","preset","postponeDrawing","pageWidthScaleFactor","hPadding","vPadding","pageWidthScale","pageHeightScale","horizontalScale","widthScale","heightScale","pageWidth","pageHeight","boundingRect","convertToViewportPoint","_updateLocation","firstPage","normalizedScaleValue","currentPageView","topLeft","getPagePoint","intLeft","intTop","visiblePages","numVisiblePages","newCacheSize","isSimpleLayout","currentId","stillFullyVisible","_isContainerRtl","direction","initialOrientation","cloneNode","_getPageAdvance","yArray","expectedId","advance","ceil","toFixed","entries","entry","borderBoxSize","blockSize","updateParams","noUpdate","DEFAULT_L10N_STRINGS","of_pages","page_of_pages","document_properties_kb","document_properties_mb","document_properties_date_string","document_properties_page_size_unit_inches","document_properties_page_size_unit_millimeters","document_properties_page_size_orientation_portrait","document_properties_page_size_orientation_landscape","document_properties_page_size_name_a3","document_properties_page_size_name_a4","document_properties_page_size_name_letter","document_properties_page_size_name_legal","document_properties_page_size_dimension_string","document_properties_page_size_dimension_name_string","document_properties_linearized_yes","document_properties_linearized_no","additional_layers","page_landmark","thumb_page_title","thumb_page_canvas","find_reached_top","find_reached_bottom","find_not_found","page_scale_width","page_scale_fit","page_scale_auto","page_scale_actual","page_scale_percent","loading_error","invalid_file_error","missing_file_error","unexpected_response_error","rendering_error","printing_not_supported","printing_not_ready","web_fonts_disabled","free_text2_default_content","editor_free_text2_aria_label","editor_ink2_aria_label","editor_ink_canvas_aria_label","print_progress_percent","getL10nFallback","PARTIAL_LANG_CODES","en","es","fy","ga","gu","hi","hy","nb","ne","nn","pa","pt","sv","zh","fixupLangCode","langCode","formatL10nValue","fallback","_annotation_editor_layer_builder","_annotation_layer_builder","_struct_tree_layer_builder","_text_accessibility","_text_highlighter","_text_layer_builder","_xfa_layer_builder","MAX_CANVAS_PIXELS","DEFAULT_LAYER_PROPERTIES","loadingId","previousRotation","renderError","useThumbnailCanvas","directDrawing","initialOptionalContent","regularAnnotations","viewportMap","hasRestrictedScaling","_isStandalone","hasViewer","_annotationCanvasMap","annotationLayer","annotationEditorLayer","textLayer","zoomLayer","xfaLayer","structTreeLayer","setDimensions","hasInitialVisibility","setLayerDimensions","_textHighlighter","TextHighlighter","renderAnnotationLayer","renderAnnotationEditorLayer","renderXfaLayer","textDivs","buildXfaTextContentItems","renderTextLayer","renderingDone","readableStream","streamTextContent","includeMarkedContent","setTextContentSource","AbortException","numTextDivs","renderStructTreeLayer","StructTreeLayerBuilder","tree","getStructTree","treeDom","setTextMapping","enable","_resetZoomLayer","removeFromDOM","zoomLayerCanvas","firstChild","keepZoomLayer","keepAnnotationLayer","keepAnnotationEditorLayer","keepXfaLayer","keepTextLayer","childNodes","zoomLayerNode","annotationLayerNode","annotationEditorLayerNode","xfaLayerNode","textLayerNode","isScalingRestricted","onlyCssZoom","cancelExtraDelay","redrawAnnotationLayer","redrawAnnotationEditorLayer","redrawXfaLayer","redrawTextLayer","hideTextLayer","disable","originalViewport","relativeRotation","absRotation","scaleX","scaleY","convertToPdfPoint","separateAnnots","canvasWrapper","_accessibilityManager","TextAccessibilityManager","TextLayerBuilder","highlighter","accessibilityManager","AnnotationLayerBuilder","pageDiv","annotationCanvasMap","showCanvas","hasHCM","isLastShow","actualSizeViewport","pixelsInViewport","maxScale","sqrt","sfx","sfy","AnnotationEditorLayerBuilder","uiManager","XfaLayerBuilder","_cancelled","intent","clonedViewport","dontFlip","tabIndex","AnnotationEditorLayer","parameters","annotations","isEmpty","onPresentationModeChanged","_hasJSActionsPromise","_fieldObjectsPromise","fieldObjects","getAnnotations","AnnotationLayer","updatePresentationModeState","disableFormElements","section","inert","PDF_ROLE_TO_HTML_ROLE","Document","DocumentFragment","Part","Sect","Div","Aside","NonStruct","P","H","FENote","Sub","Lbl","Span","Em","Strong","Link","Annot","Form","Ruby","RB","RT","RP","Warichu","WT","WP","L","LI","LBody","Table","TR","TH","TD","THead","TBody","TFoot","Caption","Figure","Formula","Artifact","HEADING_PATTERN","structTree","walk","setAttributes","structElement","htmlElement","alt","role","children","kid","textChildren","textNodes","waitingElements","compareElementPositions","e1","e2","rect1","getBoundingClientRect","rect2","top1","bot1","mid1","top2","bot2","mid2","centerX1","centerX2","nodeIndex","addIdToAriaOwns","isRemovable","addPointerInTextLayer","removePointerInTextLayer","owns","getAttribute","moveElementInDOM","contentElement","hasChildNodes","from","elementToCompare","after","_onUpdateTextLayerMatches","textContentItemsStr","divs","_updateMatches","_convertMatches","iIndex","mm","begin","divIdx","_renderMatches","isSelectedPage","selectedMatchIdx","prevEnd","infinity","beginText","appendTextToDiv","fromOffset","toOffset","nodeType","Node","TEXT_NODE","span","createTextNode","i0","i1","lastDivIdx","lastOffset","isSelected","highlightSuffix","n0","n1","clearedUntilDivIdx","n","textContentSource","textDivProperties","textLayerRenderTask","finishRendering","endOfContent","bindMouse","mustRotate","mustRescale","updateTextLayer","adjustTop","getPropertyValue","divBounds","clipboardData","setData","normalizeUnicode","xfaHtml","XfaLayer","getXfa","downloadButton","firstPageButton","lastPageButton","pageRotateCwButton","pageRotateCcwButton","cursorSelectToolButton","eventDetails","scrollPageButton","scrollVerticalButton","scrollHorizontalButton","scrollWrappedButton","spreadNoneButton","spreadOddButton","spreadEvenButton","documentPropertiesButton","openFileButton","lastPage","pageRotateCw","pageRotateCcw","bindClickListeners","bindCursorToolsListener","bindScrollModeListener","bindSpreadModeListener","scrollModeChanged","forceScrollModePage","isHorizontal","spreadModeChanged","PAGE_NUMBER_LOADING_INDICATOR","wasLocalized","editorFreeTextButton","FREETEXT","editorInkButton","INK","openFile","scaleSelect","customScaleOption","hasPageLabels","pageScaleValue","pageScale","oncontextmenu","adjustScaleWidth","bindEditorToolsListener","editorFreeTextParamsToolbar","editorInkParamsToolbar","editorModeChanged","isDisable","resetNumPages","predefinedValueFound","option","loading","predefinedValuesPromise","scaleSelectWidth","font","fontSize","fontFamily","predefinedValue","measureText","DEFAULT_VIEW_HISTORY_CACHE_SIZE","cacheSize","_initializedPromise","databaseStr","database","branch","properties","defaultValue","defaults","prefs","prefValue","defaultType","obj","blobUrl","openBlobUrls","_options","createValidAbsoluteUrl","downloadData","contentType","isPdfData","isPdfFile","viewerUrl","encodeURIComponent","revokeObjectURL","webL10n","_lang","setLanguage","gL10nData","gTextData","gTextProp","gLanguage","gMacros","gReadyState","gAsyncResourceLoading","getL10nResourceLinks","getL10nDictionary","script","innerHTML","getTranslatableChildren","getL10nAttributes","l10nId","l10nArgs","xhrLoadText","onSuccess","onFailure","_onSuccess","_onFailure","xhr","XMLHttpRequest","overrideMimeType","onreadystatechange","readyState","responseText","onerror","ontimeout","send","parseResource","successCallback","failureCallback","evalString","lastIndexOf","parseProperties","parsedPropertiesCallback","dictionary","reBlank","reComment","reSection","reImport","reSplit","parseRawLines","rawText","extendedSyntax","parsedRawLinesCallback","currentLang","genericLang","skipLang","nextEntry","line","loadImport","tmp","response","loadLocale","_callback","langLinks","langCount","dict","locales","default_locale","defaultLocale","anyCaseLang","onResourceLoaded","gResourceCount","L10nResourceLink","resource","getPluralRules","locales2rules","isIn","list","isBetween","pluralRules","0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","plural","_pluralRules","getL10nData","rv","substIndexes","substArguments","reIndex","reMatch","macroName","paramName","macro","reArgs","matched_text","arg","translateElement","getChildElementCount","l","nodeValue","textNode","k","childElementCount","translateFragment","elementCount","fallbackString","getText","rtlList","shortCode","getReadyState","pdfjsSandbox","QuickJSSandbox","sandbox","nukeSandbox","_print_utils","activeService","renderPage","activeServiceOnEntry","printAnnotationStoragePromise","scratchCanvas","PRINT_UNITS","PDF","printAnnotationStorage","ENABLE_STORAGE","PDFPrintService","_printResolution","throwIfInactive","pageStyleSheet","ensureOverlay","renderPages","getXfaHtmlForPrinting","renderNextPage","renderProgress","useRenderedPage","toBlob","wrapper","onload","performPrint","call","abort","eventType","bubbles","cancelable","progressBar","progressPerc","chrome","opera","stopImmediatePropagation","stopPropagationIfNeeded","overlayPromise","allXfaHtml","xfaPage","builder","getXfaPageViewport","pdfjsVersion","pdfjsBuild","AppConstants","PDFViewerApplicationConstants","PDFViewerApplicationOptions","getViewerConfiguration","webViewerLoad"],"sourceRoot":""} |