: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
} else if (zoomArg === "FitH" || zoomArg === "FitBH" || zoomArg === "FitV" || zoomArg === "FitBV") {
}, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null];
} else if (zoomArg === "FitR") {
if (zoomArgs.length !== 5) {
console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');
}, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];
console.error(`PDFLinkService.setHash: "${zoomArg}" is not a valid zoom value.`);
this.pdfViewer.scrollPageIntoView({
pageNumber: pageNumber || this.page,
allowNegativeOffset: true
if (params.has("pagemode")) {
this.eventBus.dispatch("pagemode", {
mode: params.get("pagemode")
if (params.has("nameddest")) {
this.goToDestination(params.get("nameddest"));
if (!Array.isArray(dest)) {
if (typeof dest === "string" || PDFLinkService.#isValidExplicitDest(dest)) {
this.goToDestination(dest);
console.error(`PDFLinkService.setHash: "${unescape(hash)}" is not a valid destination.`);
executeNamedAction(action) {
this.pdfHistory?.forward();
this.pdfViewer.nextPage();
this.pdfViewer.previousPage();
this.page = this.pagesCount;
this.eventBus.dispatch("namedaction", {
async executeSetOCGState(action) {
const pdfDocument = this.pdfDocument,
optionalContentConfig = await this.pdfViewer.optionalContentConfigPromise;
if (pdfDocument !== this.pdfDocument) {
optionalContentConfig.setOCGState(action);
this.pdfViewer.optionalContentConfigPromise = Promise.resolve(optionalContentConfig);
static #isValidExplicitDest(dest) {
if (!Array.isArray(dest) || dest.length < 2) {
const [page, zoom, ...args] = dest;
if (!(typeof page === "object" && Number.isInteger(page?.num) && Number.isInteger(page?.gen)) && !Number.isInteger(page)) {
if (!(typeof zoom === "object" && typeof zoom?.name === "string")) {
return args.length === 0;
for (const arg of args) {
if (!(typeof arg === "number" || allowNull && arg === null)) {
class SimpleLinkService extends PDFLinkService {
setDocument(pdfDocument, baseUrl = null) {}
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.with-resolvers.js
var es_promise_with_resolvers = __webpack_require__(4628);
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.constructor.js
var esnext_iterator_constructor = __webpack_require__(8992);
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.some.js
var esnext_iterator_some = __webpack_require__(7550);
;// CONCATENATED MODULE: ./web/pdfjs.js
AnnotationEditorParamsType,
AnnotationEditorUIManager,
getPdfFilenameFromUrl: pdfjs_getPdfFilenameFromUrl,
RenderingCancelledException,
UnexpectedResponseException,
;// CONCATENATED MODULE: ./web/event_utils.js
async function waitOnEventOrTimeout({
if (typeof target !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) {
throw new Error("waitOnEventOrTimeout - invalid parameters.");
} = Promise.withResolvers();
const ac = new AbortController();
const evtMethod = target instanceof EventBus ? "_on" : "addEventListener";
target[evtMethod](name, handler.bind(null, WaitOnType.EVENT), {
const timeout = setTimeout(handler.bind(null, WaitOnType.TIMEOUT), delay);
#listeners = Object.create(null);
on(eventName, listener, options = null) {
this._on(eventName, listener, {
off(eventName, listener, options = null) {
this._off(eventName, listener);
dispatch(eventName, data) {
const eventListeners = this.#listeners[eventName];
if (!eventListeners || eventListeners.length === 0) {
} of eventListeners.slice(0)) {
this._off(eventName, listener);
(externalListeners ||= []).push(listener);
for (const listener of externalListeners) {
externalListeners = null;
_on(eventName, listener, options = null) {
if (options?.signal instanceof AbortSignal) {
console.error("Cannot use an `aborted` signal.");
const onAbort = () => this._off(eventName, listener);
rmAbort = () => signal.removeEventListener("abort", onAbort);
signal.addEventListener("abort", onAbort);
const eventListeners = this.#listeners[eventName] ||= [];
external: options?.external === true,
once: options?.once === true,
_off(eventName, listener, options = null) {
const eventListeners = this.#listeners[eventName];
for (let i = 0, ii = eventListeners.length; i < ii; i++) {
const evt = eventListeners[i];
if (evt.listener === listener) {
eventListeners.splice(i, 1);
class AutomationEventBus extends EventBus {
dispatch(eventName, data) {
throw new Error("Not implemented: AutomationEventBus.dispatch");
;// CONCATENATED MODULE: ./web/external_services.js
class BaseExternalServices {
if (this.constructor === BaseExternalServices) {
throw new Error("Cannot initialize BaseExternalServices.");
updateFindControlState(data) {}
updateFindMatchesCount(data) {}
throw new Error("Not implemented: createL10n");
throw new Error("Not implemented: createScripting");
updateEditorStates(data) {
throw new Error("Not implemented: updateEditorStates");
async getNimbusExperimentData() {}
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-exception.stack.js
var web_dom_exception_stack = __webpack_require__(4979);
;// CONCATENATED MODULE: ./web/preferences.js
#browserDefaults = Object.freeze({
canvasMaxAreaInBytes: -1,
supportsCaretBrowsingMode: false,
supportsDocumentFonts: true,
supportsIntegratedFind: false,
supportsMouseWheelZoomCtrlKey: true,
supportsMouseWheelZoomMetaKey: true,
supportsPinchToZoom: true
#defaults = Object.freeze({
disablePageLabels: false,
enableHighlightEditor: false,
enableHighlightFloatingButton: false,
enablePermissions: false,
enablePrintAutoRotate: true,
highlightEditorColors: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
ignoreDestinationZoom: false,
pageColorsBackground: "Canvas",
pageColorsForeground: "CanvasText",
#prefs = Object.create(null);
#initializedPromise = null;
if (this.constructor === BasePreferences) {
throw new Error("Cannot initialize BasePreferences.");
this.#initializedPromise = this._readFromStorage(this.#defaults).then(({
const options = Object.create(null);
for (const [name, val] of Object.entries(this.#browserDefaults)) {
const prefVal = browserPrefs?.[name];
options[name] = typeof prefVal === typeof val ? prefVal : val;
for (const [name, val] of Object.entries(this.#defaults)) {
const prefVal = prefs?.[name];
options[name] = this.#prefs[name] = typeof prefVal === typeof val ? prefVal : val;
AppOptions.setAll(options, true);
async _writeToStorage(prefObj) {
throw new Error("Not implemented: _writeToStorage");
async _readFromStorage(prefObj) {
throw new Error("Not implemented: _readFromStorage");
throw new Error("Not implemented: #updatePref");
await this.#initializedPromise;
const oldPrefs = structuredClone(this.#prefs);
this.#prefs = Object.create(null);
await this._writeToStorage(this.#defaults);
await this.#initializedPromise;
const defaultValue = this.#defaults[name],
oldPrefs = structuredClone(this.#prefs);
if (defaultValue === undefined) {
throw new Error(`Set preference: "${name}" is undefined.`);
} else if (value === undefined) {
throw new Error("Set preference: no value is specified.");
const valueType = typeof value,
defaultType = typeof defaultValue;
if (valueType !== defaultType) {
if (valueType === "number" && defaultType === "string") {
value = value.toString();
throw new Error(`Set preference: "${value}" is a ${valueType}, expected a ${defaultType}.`);
} else if (valueType === "number" && !Number.isInteger(value)) {
throw new Error(`Set preference: "${value}" must be an integer.`);
this.#prefs[name] = value;
await this._writeToStorage(this.#prefs);
await this.#initializedPromise;
const defaultValue = this.#defaults[name];
if (defaultValue === undefined) {
throw new Error(`Get preference: "${name}" is undefined.`);
return this.#prefs[name] ?? defaultValue;
get initializedPromise() {
return this.#initializedPromise;
;// CONCATENATED MODULE: ./node_modules/@fluent/bundle/esm/types.js
class FluentNone extends FluentType {
constructor(value = "???") {
return `{${this.value}}`;
class FluentNumber extends FluentType {
constructor(value, opts = {}) {
const nf = scope.memoizeIntlObject(Intl.NumberFormat, this.opts);
return nf.format(this.value);