Edit D:\chineseall_products\bak\digitalLib6\pages\readers\js\pdfjs\js\webpdf.min.js
var serverUrl; var pdfUrl; var contentUrl; var pageUrl; var pageCount = -1; var DEFAULT_URL; var showPages = 5; var loadQueue = ","; var documentCache; var lastPageNum = -1; var lastLoadTime = 1; var loadTime = 100; (function (a) { var b = {}; function c(e) { if (b[e]) { return b[e].exports } var d = b[e] = { i: e, l: false, exports: {} }; a[e].call(d.exports, d, d.exports, c); d.l = true; return d.exports } c.m = a; c.c = b; c.i = function (d) { return d }; c.d = function (e, f, d) { if (!c.o(e, f)) { Object.defineProperty(e, f, { configurable: false, enumerable: true, get: d }) } }; c.n = function (e) { var d = e && e.__esModule ? function f() { return e["default"] } : function g() { return e }; c.d(d, "a", d); return d }; c.o = function (d, e) { return Object.prototype.hasOwnProperty.call(d, e) }; c.p = ""; return c(c.s = 30) })([(function (d, F, f) { var h = f(1); var x = 96 / 72; var c = "auto"; var t = 1; var v = 0.25; var D = 10; var l = 0; var y = 1.25; var a = 40; var C = 5; var E = { CANVAS: "canvas", SVG: "svg" }; var A = document.mozL10n || document.webL10n; var w = h.PDFJS; w.disableFullscreen = w.disableFullscreen === undefined ? false : w.disableFullscreen; w.useOnlyCssZoom = w.useOnlyCssZoom === undefined ? false : w.useOnlyCssZoom; w.maxCanvasPixels = w.maxCanvasPixels === undefined ? 16777216 : w.maxCanvasPixels; w.disableHistory = w.disableHistory === undefined ? false : w.disableHistory; w.disableTextLayer = w.disableTextLayer === undefined ? false : w.disableTextLayer; w.ignoreCurrentPositionOnZoom = w.ignoreCurrentPositionOnZoom === undefined ? false : w.ignoreCurrentPositionOnZoom; w.locale = w.locale === undefined ? navigator.language : w.locale; function s(I) { var H = window.devicePixelRatio || 1; var J = I.webkitBackingStorePixelRatio || I.mozBackingStorePixelRatio || I.msBackingStorePixelRatio || I.oBackingStorePixelRatio || I.backingStorePixelRatio || 1; var K = H / J; return { sx: K, sy: K, scaled: K !== 1 } } function e(I, K, L) { var J = I.offsetParent; if (!J) { console.error("offsetParent is not set -- cannot scroll"); return } var M = L || false; var N = I.offsetTop + I.clientTop; var H = I.offsetLeft + I.clientLeft; while (J.clientHeight === J.scrollHeight || M && getComputedStyle(J).overflow === "hidden") { if (J.dataset._scaleY) { N /= J.dataset._scaleY; H /= J.dataset._scaleX } N += J.offsetTop; H += J.offsetLeft; J = J.offsetParent; if (!J) { return } } if (K) { if (K.top !== undefined) { N += K.top } if (K.left !== undefined) { H += K.left; J.scrollLeft = H } } J.scrollTop = N } function r(L, K) { var H = function H(M) { if (J) { return } J = window.requestAnimationFrame(function N() { J = null; var O = L.scrollTop; var P = I.lastY; if (O !== P) { I.down = O > P } I.lastY = O; K(I) }) }; var I = { down: true, lastY: L.scrollTop, _eventHandler: H }; var J = null; L.addEventListener("scroll", H, true); return I } function z(L) { var M = L.split("&"); var O = {}; for (var I = 0, J = M.length; I < J; ++I) { var N = M[I].split("="); var H = N[0].toLowerCase(); var K = N.length > 1 ? N[1] : null; O[decodeURIComponent(H)] = decodeURIComponent(K) } return O } function q(I, M) { var J = 0; var L = I.length - 1; if (I.length === 0 || !M(I[L])) { return I.length } if (M(I[J])) { return J } while (J < L) { var H = J + L >> 1; var K = I[H]; if (M(K)) { L = H } else { J = H + 1 } } return J } function j(Q) { if (Math.floor(Q) === Q) { return [Q, 1] } var J = 1 / Q; var L = 8; if (J > L) { return [1, L] } else { if (Math.floor(J) === J) { return [1, J] } } var K = Q > 1 ? J : Q; var P = 0, O = 1, N = 1, M = 1; while (true) { var I = P + N, H = O + M; if (H > L) { break } if (K <= I / H) { N = I; M = H } else { P = I; O = H } } var R; if (K - P / O < N / M - K) { R = K === Q ? [P, O] : [O, P] } else { R = K === Q ? [N, M] : [M, N] } return R } function b(H, J) { var I = H % J; return I === 0 ? H : Math.round(H - I + J) } function u(H, P, aa) { var V = H.scrollTop, O = V + H.clientHeight; var M = H.scrollLeft, ac = M + H.clientWidth; function ab(ad) { var ae = ad.div; var af = ae.offsetTop + ae.clientTop + ae.clientHeight; return af > V } var K = [], U, I; var L, X, S, J; var Q, Y; var W = P.length === 0 ? 0 : q(P, ab); for (var Z = W, T = P.length; Z < T; Z++) { U = P[Z]; I = U.div; L = I.offsetTop + I.clientTop; X = I.clientHeight; if (L > O) { break } Q = I.offsetLeft + I.clientLeft; Y = I.clientWidth; if (Q + Y < M || Q > ac) { continue } S = Math.max(0, V - L) + Math.max(0, L + X - O); J = (X - S) * 100 / X | 0; K.push({ id: U.id, x: Q, y: L, view: U, percent: J }) } var N = K[0]; var R = K[K.length - 1]; if (aa) { K.sort(function (ae, ad) { var af = ae.percent - ad.percent; if (Math.abs(af) > 0.001) { return -af } return ae.id - ad.id }) } return { first: N, last: R, views: K } } function g(H) { H.preventDefault() } function G(J, I) { if (typeof I === "undefined") { I = "document.pdf" } var N = /^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/; var K = /[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i; var H = N.exec(J); var L = K.exec(H[1]) || K.exec(H[2]) || K.exec(H[3]); if (L) { L = L[0]; if (L.indexOf("%") !== -1) { try { L = K.exec(decodeURIComponent(L))[0] } catch (M) {} } } return L || I } function m(J) { var N = Math.sqrt(J.deltaX * J.deltaX + J.deltaY * J.deltaY); var M = Math.atan2(J.deltaY, J.deltaX); if (-0.25 * Math.PI < M && M < 0.75 * Math.PI) { N = -N } var L = 0; var I = 1; var K = 30; var H = 30; if (J.deltaMode === L) { N /= K * H } else { if (J.deltaMode === I) { N /= H } } return N } var B = new Promise(function (H) { window.requestAnimationFrame(H) }); var o = new Promise(function (J, I) { if (!A) { J(); return } if (A.getReadyState() !== "loading") { J(); return } window.addEventListener("localized", function H(K) { J() }) }); var i = function p() { function H() { this._listeners = Object.create(null) } H.prototype = { on: function I(K, L) { var M = this._listeners[K]; if (!M) { M = []; this._listeners[K] = M } M.push(L) }, off: function I(K, M) { var N = this._listeners[K]; var L; if (!N || (L = N.indexOf(M)) < 0) { return } N.splice(L, 1) }, dispatch: function J(K) { var M = this._listeners[K]; if (!M || M.length === 0) { return } var L = Array.prototype.slice.call(arguments, 1); M.slice(0).forEach(function (N) { N.apply(null, L) }) } }; return H }(); var k = function n() { function M(O, P, N) { return Math.min(Math.max(O, P), N) } function H(O, N) { this.visible = true; this.div = document.querySelector(O + " .progress"); this.bar = this.div.parentNode; this.height = N.height || 100; this.width = N.width || 100; this.units = N.units || "%"; this.div.style.height = this.height + this.units; this.percent = 0 } H.prototype = { updateBar: function I() { if (this._indeterminate) { this.div.classList.add("indeterminate"); this.div.style.width = this.width + this.units; return } this.div.classList.remove("indeterminate"); var N = this.width * this._percent / 100; this.div.style.width = N + this.units }, get percent() { return this._percent }, set percent(N) { this._indeterminate = isNaN(N); this._percent = M(N, 0, 100); this.updateBar() }, setWidth: function J(P) { if (P) { var N = P.parentNode; var O = N.offsetWidth - P.offsetWidth; if (O > 0) { this.bar.setAttribute("style", "width: calc(100% - " + O + "px);") } } }, hide: function L() { if (!this.visible) { return } this.visible = false; this.bar.classList.add("hidden"); document.body.classList.remove("loadingInProgress") }, show: function K() { if (this.visible) { return } this.visible = true; document.body.classList.add("loadingInProgress"); this.bar.classList.remove("hidden") } }; return H }(); F.CSS_UNITS = x; F.DEFAULT_SCALE_VALUE = c; F.DEFAULT_SCALE = t; F.MIN_SCALE = v; F.MAX_SCALE = D; F.UNKNOWN_SCALE = l; F.MAX_AUTO_SCALE = y; F.SCROLLBAR_PADDING = a; F.VERTICAL_PADDING = C; F.RendererType = E; F.mozL10n = A; F.EventBus = i; F.ProgressBar = k; F.getPDFFileNameFromURL = G; F.noContextMenuHandler = g; F.parseQueryString = z; F.getVisibleElements = u; F.roundToDivide = b; F.approximateFraction = j; F.getOutputScale = s; F.scrollIntoView = e; F.watchScroll = r; F.binarySearchFirstItem = q; F.normalizeWheelEventDelta = m; F.animationStarted = B; F.localized = o }), (function (b, a, d) { var c; if (typeof __pdfjsdev_webpack__ === "undefined") { if (typeof window !== "undefined" && window["js/pdf"]) { c = window["js/pdf"] } else { if (typeof require === "function") { c = require("./pdf.js") } else { throw new Error("Neither `require` nor `window` found") } } } b.exports = c }), (function (d, b, g) { var c = g(0); var a = c.EventBus; function f(i) { i.on("documentload", function () { var j = document.createEvent("CustomEvent"); j.initCustomEvent("documentload", true, true, {}); window.dispatchEvent(j) }); i.on("pagerendered", function (k) { var j = document.createEvent("CustomEvent"); j.initCustomEvent("pagerendered", true, true, { pageNumber: k.pageNumber, cssTransform: k.cssTransform }); k.source.div.dispatchEvent(j) }); i.on("textlayerrendered", function (k) { var j = document.createEvent("CustomEvent"); j.initCustomEvent("textlayerrendered", true, true, { pageNumber: k.pageNumber }); k.source.textLayerDiv.dispatchEvent(j) }); i.on("pagechange", function (k) { var j = document.createEvent("UIEvents"); j.initUIEvent("pagechange", true, true, window, 0); j.pageNumber = k.pageNumber; pageChanged(k.pageNumber); k.source.container.dispatchEvent(j) }); i.on("pagesinit", function (k) { var j = document.createEvent("CustomEvent"); j.initCustomEvent("pagesinit", true, true, null); k.source.container.dispatchEvent(j) }); i.on("pagesloaded", function (k) { var j = document.createEvent("CustomEvent"); j.initCustomEvent("pagesloaded", true, true, { pagesCount: k.pagesCount }); k.source.container.dispatchEvent(j) }); i.on("scalechange", function (k) { var j = document.createEvent("UIEvents"); j.initUIEvent("scalechange", true, true, window, 0); j.scale = k.scale; j.presetValue = k.presetValue; k.source.container.dispatchEvent(j) }); i.on("updateviewarea", function (k) { var j = document.createEvent("UIEvents"); j.initUIEvent("updateviewarea", true, true, window, 0); j.location = k.location; k.source.container.dispatchEvent(j) }); i.on("find", function (k) { if (k.source === window) { return } var j = document.createEvent("CustomEvent"); j.initCustomEvent("find" + k.type, true, true, { query: k.query, phraseSearch: k.phraseSearch, caseSensitive: k.caseSensitive, highlightAll: k.highlightAll, findPrevious: k.findPrevious }); window.dispatchEvent(j) }); i.on("sidebarviewchanged", function (k) { var j = document.createEvent("CustomEvent"); j.initCustomEvent("sidebarviewchanged", true, true, { view: k.view }); k.source.outerContainer.dispatchEvent(j) }); i.on("pagemode", function (k) { var j = document.createEvent("CustomEvent"); j.initCustomEvent("pagemode", true, true, { mode: k.mode }); k.source.pdfViewer.container.dispatchEvent(j) }); i.on("namedaction", function (k) { var j = document.createEvent("CustomEvent"); j.initCustomEvent("namedaction", true, true, { action: k.action }); k.source.pdfViewer.container.dispatchEvent(j) }); i.on("presentationmodechanged", function (k) { var j = document.createEvent("CustomEvent"); j.initCustomEvent("presentationmodechanged", true, true, { active: k.active, switchInProgress: k.switchInProgress }); window.dispatchEvent(j) }); i.on("outlineloaded", function (k) { var j = document.createEvent("CustomEvent"); j.initCustomEvent("outlineloaded", true, true, { outlineCount: k.outlineCount }); k.source.container.dispatchEvent(j) }) } var e = null; function h() { if (e) { return e } e = new a(); f(e); return e } b.attachDOMEventsToEventBus = f; b.getGlobalEventBus = h }), (function (c, a, e) { var b = 30000; var f = { INITIAL: 0, RUNNING: 1, PAUSED: 2, FINISHED: 3 }; var d = function g() { function i() { this.pdfViewer = null; this.pdfThumbnailViewer = null; this.onIdle = null; this.highestPriorityPage = null; this.idleTimeout = null; this.printing = false; this.isThumbnailViewEnabled = false } i.prototype = { setViewer: function k(p) { this.pdfViewer = p }, setThumbnailViewer: function n(p) {}, isHighestPriority: function m(p) { return this.highestPriorityPage === p.renderingId }, renderHighestPriority: function j(p) { if (this.idleTimeout) { clearTimeout(this.idleTimeout); this.idleTimeout = null } if (this.pdfViewer.forceRendering(p)) { return } if (this.printing) { return } if (this.onIdle) { this.idleTimeout = setTimeout(this.onIdle.bind(this), b) } }, getHighestPriority: function l(r, w, s) { var q = r.views; var x = q.length; if (x === 0) { return false } for (var t = 0; t < x; ++t) { var u = q[t].view; if (!this.isViewFinished(u)) { return u } } if (s) { var v = r.last.id; if (w[v] && !this.isViewFinished(w[v])) { return w[v] } } else { var p = r.first.id - 2; if (w[p] && !this.isViewFinished(w[p])) { return w[p] } } return null }, isViewFinished: function h(p) { return p.renderingState === f.FINISHED }, renderView: function o(p) { var q = p.renderingState; switch (q) { case f.FINISHED: return false; case f.PAUSED: this.highestPriorityPage = p.renderingId; p.resume(); break; case f.RUNNING: this.highestPriorityPage = p.renderingId; break; case f.INITIAL: this.highestPriorityPage = p.renderingId; var r = function () { this.renderHighestPriority() }.bind(this); p.draw().then(r, r); break } return true } }; return i }(); a.RenderingStates = f; a.PDFRenderingQueue = d }), (function (d, f, c) { var e = { overlays: {}, active: null, register: function b(l, n, k, m) { return new Promise(function (p) { var o; if (!l || !n || !(o = n.parentNode)) { throw new Error("Not enough parameters.") } else { if (this.overlays[l]) { throw new Error("The overlay is already registered.") } } this.overlays[l] = { element: n, container: o, callerCloseMethod: k || null, canForceClose: m || false }; p() }.bind(this)) }, unregister: function i(k) { return new Promise(function (l) { if (!this.overlays[k]) { throw new Error("The overlay does not exist.") } else { if (this.active === k) { throw new Error("The overlay cannot be removed while it is active.") } } delete this.overlays[k]; l() }.bind(this)) }, open: function h(k) { return new Promise(function (l) { if (!this.overlays[k]) { throw new Error("The overlay does not exist.") } else { if (this.active) { if (this.overlays[k].canForceClose) { this._closeThroughCaller() } else { if (this.active === k) { throw new Error("The overlay is already active.") } else { throw new Error("Another overlay is currently active.") } } } } this.active = k; this.overlays[this.active].element.classList.remove("hidden"); this.overlays[this.active].container.classList.remove("hidden"); window.addEventListener("keydown", this._keyDown); l() }.bind(this)) }, close: function j(k) { return new Promise(function (l) { if (!this.overlays[k]) { throw new Error("The overlay does not exist.") } else { if (!this.active) { throw new Error("The overlay is currently not active.") } else { if (this.active !== k) { throw new Error("Another overlay is currently active.") } } } this.overlays[this.active].container.classList.add("hidden"); this.overlays[this.active].element.classList.add("hidden"); this.active = null; window.removeEventListener("keydown", this._keyDown); l() }.bind(this)) }, _keyDown: function a(k) { var l = e; if (l.active && k.keyCode === 27) { l._closeThroughCaller(); k.preventDefault() } }, _closeThroughCaller: function g() { if (this.overlays[this.active].callerCloseMethod) { this.overlays[this.active].callerCloseMethod() } if (this.active) { this.close(this.active) } } }; f.OverlayManager = e }), (function (d, h, c) { var e = c(0); var i = c(2); var g = e.parseQueryString; var f = /^\d+$/; function j(m) { return f.test(m) } var k = function b() { function s(y) { y = y || {}; this.eventBus = y.eventBus || i.getGlobalEventBus(); this.baseUrl = null; this.pdfDocument = null; this.pdfViewer = null; this.pdfHistory = null; this._pagesRefCache = null } s.prototype = { setDocument: function o(y, z) { this.baseUrl = z; this.pdfDocument = y; this._pagesRefCache = Object.create(null) }, setViewer: function v(y) { this.pdfViewer = y }, setHistory: function m(y) { this.pdfHistory = y }, get pagesCount() { return this.pdfDocument ? this.pdfDocument.numPages : 0 }, get page() { return this.pdfViewer.currentPageNumber }, set page(y) { this.pdfViewer.currentPageNumber = y }, navigateTo: function q(A) { var z = ""; var y = this; var C = function (E) { var D; if (E instanceof Object) { D = E.num } else { if ((E | 0) === E) { D = E + 1 } else { console.error('PDFLinkService_navigateTo: "' + E + '" is not a valid destination reference.'); return } } if (D) { if (D < 1 || D > y.pagesCount) { console.error('PDFLinkService_navigateTo: "' + D + '" is a non-existent page number.'); return } y.pdfViewer.scrollPageIntoView({ pageNumber: D, destArray: A }); if (y.pdfHistory) { y.pdfHistory.push({ dest: A, hash: z, page: D }) } } else { y.pdfDocument.getPageIndex(E).then(function (F) { y.cachePageRef(F + 1, E); C(E) }, function () { console.error('PDFLinkService_navigateTo: "' + E + '" is not a valid page reference.') }) } }; var B; if (typeof A === "string") { z = A; B = this.pdfDocument.getDestination(A) } else { B = Promise.resolve(A) } B.then(function (D) { A = D; if (!(D instanceof Array)) { console.error('PDFLinkService_navigateTo: "' + D + '" is not a valid destination array.'); return } C(D[0]) }) }, getDestinationHash: function p(y) { if (typeof y === "string") { return this.getAnchorUrl("#" + (j(y) ? "nameddest=" : "") + escape(y)) } if (y instanceof Array) { var z = JSON.stringify(y); return this.getAnchorUrl("#" + escape(z)) } return this.getAnchorUrl("") }, getAnchorUrl: function n(y) { return (this.baseUrl || "") + y }, setHash: function t(C) { var y, z; if (C.indexOf("=") >= 0) { var E = g(C); if ("search" in E) { this.eventBus.dispatch("findfromurlhash", { source: this, query: E.search.replace(/"/g, ""), phraseSearch: E.phrase === "true" }) } if ("nameddest" in E) { if (this.pdfHistory) { this.pdfHistory.updateNextHashParam(E.nameddest) } this.navigateTo(E.nameddest); return } if ("page" in E) { y = E.page | 0 || 1 } if ("zoom" in E) { var F = E.zoom.split(","); var D = F[0]; var B = parseFloat(D); if (D.indexOf("Fit") === -1) { z = [null, { name: "XYZ" }, F.length > 1 ? F[1] | 0 : null, F.length > 2 ? F[2] | 0 : null, B ? B / 100 : D ] } else { if (D === "Fit" || D === "FitB") { z = [null, { name: D }] } else { if (D === "FitH" || D === "FitBH" || D === "FitV" || D === "FitBV") { z = [null, { name: D }, F.length > 1 ? F[1] | 0 : null ] } else { if (D === "FitR") { if (F.length !== 5) { console.error("PDFLinkService_setHash: Not enough parameters for 'FitR'.") } else { z = [null, { name: D }, F[1] | 0, F[2] | 0, F[3] | 0, F[4] | 0 ] } } else { console.error("PDFLinkService_setHash: '" + D + "' is not a valid zoom value.") } } } } } if (z) { this.pdfViewer.scrollPageIntoView({ pageNumber: y || this.page, destArray: z, allowNegativeOffset: true }) } else { if (y) { this.page = y } } if ("pagemode" in E) { this.eventBus.dispatch("pagemode", { source: this, mode: E.pagemode }) } } else { if (j(C) && C <= this.pagesCount) { console.warn('PDFLinkService_setHash: specifying a page number directly after the hash symbol (#) is deprecated, please use the "#page=' + C + '" form instead.'); this.page = C | 0 } z = unescape(C); try { z = JSON.parse(z); if (!(z instanceof Array)) { z = z.toString() } } catch (A) {} if (typeof z === "string" || u(z)) { if (this.pdfHistory) { this.pdfHistory.updateNextHashParam(z) } this.navigateTo(z); return } console.error("PDFLinkService_setHash: '" + unescape(C) + "' is not a valid destination.") } }, executeNamedAction: function x(y) { switch (y) { case "GoBack": if (this.pdfHistory) { this.pdfHistory.back() } break; case "GoForward": if (this.pdfHistory) { this.pdfHistory.forward() } break; case "NextPage": if (this.page < this.pagesCount) { this.page++ } break; case "PrevPage": if (this.page > 1) { this.page-- } break; case "LastPage": this.page = this.pagesCount; break; case "FirstPage": this.page = 1; break; default: break } this.eventBus.dispatch("namedaction", { source: this, action: y }) }, onFileAttachmentAnnotation: function (y) { this.eventBus.dispatch("fileattachmentannotation", { source: this, id: y.id, filename: y.filename, content: y.content }) }, cachePageRef: function w(z, A) { var y = A.num + " " + A.gen + " R"; this._pagesRefCache[y] = z }, _cachedPageNumber: function r(z) { var y = z.num + " " + z.gen + " R"; return this._pagesRefCache && this._pagesRefCache[y] || null } }; function u(z) { if (!(z instanceof Array)) { return false } var B = z.length, y = true; if (B < 2) { return false } var D = z[0]; if (!(typeof D === "object" && typeof D.num === "number" && (D.num | 0) === D.num && typeof D.gen === "number" && (D.gen | 0) === D.gen) && !(typeof D === "number" && (D | 0) === D && D >= 0)) { return false } var C = z[1]; if (!(typeof C === "object" && typeof C.name === "string")) { return false } switch (C.name) { case "XYZ": if (B !== 5) { return false } break; case "Fit": case "FitB": return B === 2; case "FitH": case "FitBH": case "FitV": case "FitBV": if (B !== 3) { return false } break; case "FitR": if (B !== 6) { return false } y = false; break; default: return false } for (var A = 2; A < B; A++) { var E = z[A]; if (!(typeof E === "number" || y && E === null)) { return false } } return true } return s }(); var a = function l() { function m() {} m.prototype = { get page() { return 0 }, set page(n) {}, navigateTo: function (n) {}, getDestinationHash: function (n) { return "#" }, getAnchorUrl: function (n) { return "#" }, setHash: function (n) {}, executeNamedAction: function (n) {}, onFileAttachmentAnnotation: function (n) {}, cachePageRef: function (n, o) {} }; return m }(); h.PDFLinkService = k; h.SimpleLinkService = a }), (function (bo, ac, a8) { var l = a8(0); var a = a8(11); var aZ = a8(18); var ap = a8(8); var H = a8(22); var bm = a8(29); var bc = a8(28); var ai = a8(26); var A = a8(14); var bf = a8(21); var u = a8(16); var bh = a8(13); var i = a8(25); var a0 = a8(3); var x = a8(5); var bl = a8(19); var S = a8(4); var N = a8(15); var aK = a8(7); var y = a8(17); var g = a8(2); var Z = a8(1); var aA = l.UNKNOWN_SCALE; var s = l.DEFAULT_SCALE_VALUE; var ae = l.MIN_SCALE; var bi = l.MAX_SCALE; var B = l.ProgressBar; var bg = l.getPDFFileNameFromURL; var J = l.noContextMenuHandler; var bn = l.mozL10n; var au = l.parseQueryString; var k = aZ.PDFHistory; var I = ap.Preferences; var U = H.SidebarView; var aS = H.PDFSidebar; var at = bm.ViewHistory; var aX = bc.Toolbar; var bj = ai.SecondaryToolbar; var a7 = A.PasswordPrompt; var ak = bf.PDFPresentationMode; var C = u.PDFDocumentProperties; var aL = bh.HandTool; var aW = i.PresentationModeState; var L = i.PDFViewer; var aR = a0.RenderingStates; var G = a0.PDFRenderingQueue; var W = x.PDFLinkService; var aI = bl.PDFOutlineViewer; var d = S.OverlayManager; var aU = N.PDFAttachmentViewer; var n = aK.PDFFindController; var t = y.PDFFindBar; var o = g.getGlobalEventBus; var aH = l.normalizeWheelEventDelta; var a5 = l.animationStarted; var al = l.localized; var F = l.RendererType; var a9 = 1.1; var af = 5000; function aN(bq) { bq.imageResourcesPath = "./pages/readers/js/pdfjs/images/"; bq.workerSrc = "./pages/readers/js/pdfjs/js/pdf.worker.js" bq.cMapUrl = "./pages/readers/js/pdfjs/cmaps/"; bq.cMapPacked = true } var K = { updateFindControlState: function (bq) {}, initPassiveLoading: function (bq) {}, fallback: function (bq, br) {}, reportTelemetry: function (bq) {}, createDownloadManager: function () { return new a.DownloadManager() }, supportsIntegratedFind: false, supportsDocumentFonts: true, supportsDocumentColors: true, supportedMouseWheelZoomModifierKeys: { ctrlKey: true, metaKey: true } }; var P = { initialBookmark: document.location.search.substring(1), initialDestination: null, initialized: false, fellback: false, appConfig: null, pdfDocument: null, pdfLoadingTask: null, printService: null, pdfViewer: null, pdfThumbnailViewer: null, pdfRenderingQueue: null, pdfPresentationMode: null, pdfDocumentProperties: null, pdfLinkService: null, pdfHistory: null, pdfSidebar: null, pdfOutlineViewer: null, pdfAttachmentViewer: null, store: null, downloadManager: null, toolbar: null, secondaryToolbar: null, eventBus: null, pageRotation: 0, isInitialViewSet: false, viewerPrefs: { sidebarViewOnLoad: U.NONE, pdfBugEnabled: false, showPreviousViewOnLoad: true, defaultZoomValue: "", disablePageLabels: false, renderer: "canvas", enhanceTextSelection: false, renderInteractiveForms: false, enablePrintAutoRotate: false }, isViewerEmbedded: window.parent !== window, url: "", baseUrl: "", externalServices: K, initialize: function f(bq) { var br = this; var bs = Z.PDFJS; I.initialize(); this.preferences = I; aN(bs); this.appConfig = bq; return this._readPreferences().then(function () { return br._initializeViewerComponents() }).then(function () { br.bindEvents(); br.bindWindowEvents(); al.then(function () { br.eventBus.dispatch("localized") }); if (br.isViewerEmbedded && !bs.isExternalLinkTargetSet()) { bs.externalLinkTarget = bs.LinkTarget.TOP } br.initialized = true }) }, _readPreferences: function () { var br = this; var bs = Z.PDFJS; return Promise.all([I.get("enableWebGL").then(function bq(bt) { bs.disableWebGL = !bt }), I.get("sidebarViewOnLoad").then(function bq(bt) { br.viewerPrefs.sidebarViewOnLoad = bt }), I.get("pdfBugEnabled").then(function bq(bt) { br.viewerPrefs.pdfBugEnabled = bt }), I.get("showPreviousViewOnLoad").then(function bq(bt) { br.viewerPrefs.showPreviousViewOnLoad = bt }), I.get("defaultZoomValue").then(function bq(bt) { br.viewerPrefs.defaultZoomValue = bt }), I.get("enhanceTextSelection").then(function bq(bt) { br.viewerPrefs.enhanceTextSelection = bt }), I.get("disableTextLayer").then(function bq(bt) { if (bs.disableTextLayer === true) { return } bs.disableTextLayer = bt }), I.get("disableRange").then(function bq(bt) { if (bs.disableRange === true) { return } bs.disableRange = bt }), I.get("disableStream").then(function bq(bt) { if (bs.disableStream === true) { return } bs.disableStream = bt }), I.get("disableAutoFetch").then(function bq(bt) { bs.disableAutoFetch = bt }), I.get("disableFontFace").then(function bq(bt) { if (bs.disableFontFace === true) { return } bs.disableFontFace = bt }), I.get("useOnlyCssZoom").then(function bq(bt) { bs.useOnlyCssZoom = bt }), I.get("externalLinkTarget").then(function bq(bt) { if (bs.isExternalLinkTargetSet()) { return } bs.externalLinkTarget = bt }), I.get("renderer").then(function bq(bt) { br.viewerPrefs.renderer = bt }), I.get("renderInteractiveForms").then(function bq(bt) { br.viewerPrefs.renderInteractiveForms = bt }), I.get("disablePageLabels").then(function bq(bt) { br.viewerPrefs.disablePageLabels = bt }), I.get("enablePrintAutoRotate").then(function bq(bt) { br.viewerPrefs.enablePrintAutoRotate = bt })]) }, _initializeViewerComponents: function () { var br = this; var bq = this.appConfig; return new Promise(function (bA, bB) { var bz = bq.eventBus || o(); br.eventBus = bz; var bx = new G(); bx.onIdle = br.cleanup.bind(br); br.pdfRenderingQueue = bx; var bu = new W({ eventBus: bz }); br.pdfLinkService = bu; var bs = br.externalServices.createDownloadManager(); br.downloadManager = bs; var bt = bq.mainContainer; var bw = bq.viewerContainer; br.pdfViewer = new L({ container: bt, viewer: bw, eventBus: bz, renderingQueue: bx, linkService: bu, downloadManager: bs, renderer: br.viewerPrefs.renderer, enhanceTextSelection: br.viewerPrefs.enhanceTextSelection, renderInteractiveForms: br.viewerPrefs.renderInteractiveForms, enablePrintAutoRotate: br.viewerPrefs.enablePrintAutoRotate }); bx.setViewer(br.pdfViewer); bu.setViewer(br.pdfViewer); br.pdfHistory = new k({ linkService: bu, eventBus: bz }); bu.setHistory(br.pdfHistory); br.findController = new n({ pdfViewer: br.pdfViewer }); br.findController.onUpdateResultsCount = function (bC) { if (br.supportsIntegratedFind) { return } br.findBar.updateResultsCount(bC) }; br.findController.onUpdateState = function (bE, bD, bC) { if (br.supportsIntegratedFind) { br.externalServices.updateFindControlState({ result: bE, findPrevious: bD }) } else { br.findBar.updateUIState(bE, bD, bC) } }; br.pdfViewer.setFindController(br.findController); var by = Object.create(bq.findBar); by.findController = br.findController; by.eventBus = bz; br.overlayManager = d; br.handTool = new aL({ container: bt, eventBus: bz }); br.pdfDocumentProperties = new C(bq.documentProperties); br.toolbar = new aX(bq.toolbar, bt, bz); br.secondaryToolbar = new bj(bq.secondaryToolbar, bt, bz); br.pdfOutlineViewer = new aI({ container: bq.sidebar.outlineView, eventBus: bz, linkService: bu }); var bv = Object.create(bq.sidebar); bv.pdfViewer = br.pdfViewer; bv.pdfOutlineViewer = br.pdfOutlineViewer; bv.eventBus = bz; br.pdfSidebar = new aS(bv); br.pdfSidebar.onToggled = br.forceRendering.bind(br); bA(undefined) }) }, run: function aG(bq) { this.initialize(bq).then(a1) }, zoomIn: function E(bq) { var br = this.pdfViewer.currentScale; do { br = (br * a9).toFixed(2); br = Math.ceil(br * 10) / 10; br = Math.min(bi, br) } while (--bq > 0 && br < bi); this.pdfViewer.currentScaleValue = br }, zoomOut: function X(bq) { var br = this.pdfViewer.currentScale; do { br = (br / a9).toFixed(2); br = Math.floor(br * 10) / 10; br = Math.max(ae, br) } while (--bq > 0 && br > ae); this.pdfViewer.currentScaleValue = br }, get pagesCount() { return this.pdfDocument ? this.pdfDocument.numPages : 0 }, set page(bq) { this.pdfViewer.scrollPageIntoView({ pageNumber: bq }) }, get page() { return this.pdfViewer.currentPageNumber }, get printing() { return !!this.printService }, get supportsPrinting() { return aY.instance.supportsPrinting }, get supportsFullscreen() { var bq; var br = document.documentElement; bq = !!(br.requestFullscreen || br.mozRequestFullScreen || br.webkitRequestFullScreen || br.msRequestFullscreen); if (document.fullscreenEnabled === false || document.mozFullScreenEnabled === false || document.webkitFullscreenEnabled === false || document.msFullscreenEnabled === false) { bq = false } if (bq && Z.PDFJS.disableFullscreen === true) { bq = false } return Z.shadow(this, "supportsFullscreen", bq) }, get supportsIntegratedFind() { return this.externalServices.supportsIntegratedFind }, get supportsDocumentFonts() { return this.externalServices.supportsDocumentFonts }, get supportsDocumentColors() { return this.externalServices.supportsDocumentColors }, get loadingBar() { var bq = new B("#loadingBar", {}); return Z.shadow(this, "loadingBar", bq) }, get supportedMouseWheelZoomModifierKeys() { return this.externalServices.supportedMouseWheelZoomModifierKeys }, initPassiveLoading: function T() { throw new Error("Not implemented: initPassiveLoading") }, setTitleUsingUrl: function z(bq) {}, setTitle: function bk(bq) { if (this.isViewerEmbedded) { return } document.title = bq }, close: function az() { var bq = this.appConfig.errorWrapper.container; bq.setAttribute("hidden", "true"); if (!this.pdfLoadingTask) { return Promise.resolve() } var br = this.pdfLoadingTask.destroy(); this.pdfLoadingTask = null; if (this.pdfDocument) { this.pdfDocument = null; this.pdfViewer.setDocument(null); this.pdfLinkService.setDocument(null, null) } this.store = null; this.isInitialViewSet = false; this.pdfSidebar.reset(); this.pdfOutlineViewer.reset(); this.pdfAttachmentViewer.reset(); this.findController.reset(); this.toolbar.reset(); this.secondaryToolbar.reset(); if (typeof PDFBug !== "undefined") { PDFBug.cleanup() } return br }, open: function w(bv, by) { if (arguments.length > 2 || typeof by === "number") { return Promise.reject(new Error("Call of open() with obsolete signature.")) } if (this.pdfLoadingTask) { return this.close().then(function () { I.reload(); return this.open(bv, by) }.bind(this)) } var bz = Object.create(null), bw; if (typeof bv === "string") { this.setTitleUsingUrl(bv); bz.url = bv } else { if (bv && "byteLength" in bv) { bz.data = bv } else { if (bv.url && bv.originalUrl) { this.setTitleUsingUrl(bv.originalUrl); bz.url = bv.url } } } if (by) { for (var br in by) { bz[br] = by[br] } if (by.scale) { bw = by.scale } if (by.length) { this.pdfDocumentProperties.setFileSize(by.length) } } var bA = this; ajax(contentUrl).then(function (bD) { var bC = bD.responseText; if (bC !== null && bC !== "") { var bB = JSON.parse(bC); if (bB.result === 1) { bA.pdfOutlineViewer.render({ outline: bB.content }) } } }, function (bB) { console.log(bB) }); bA.downloadComplete = false; var bx = Z.getDocument(bz); this.pdfLoadingTask = bx; bx.onPassword = function bs(bC, bB) { bA.passwordPrompt.setUpdateCallback(bC, bB); bA.passwordPrompt.open() }; bx.onProgress = function bu(bB) { bA.progress(bB.loaded / bB.total) }; bx.onUnsupportedFeature = this.fallback.bind(this); return bx.promise.then(function bq(bB) { bA.load(bB, bw) }, function bt(bD) { var bE = bD && bD.message; var bC = bn.get("loading_error", null, "An error occurred while loading the PDF."); if (bD instanceof Z.InvalidPDFException) { bC = bn.get("invalid_file_error", null, "Invalid or corrupted PDF file.") } else { if (bD instanceof Z.MissingPDFException) { bC = bn.get("missing_file_error", null, "Missing PDF file.") } else { if (bD instanceof Z.UnexpectedResponseException) { bC = bn.get("unexpected_response_error", null, "Unexpected server response.") } } } var bB = { message: bE }; bA.error(bC, bB); throw new Error(bC) }) }, download: function aT() { function bt() { bq.downloadUrl(bs, br) } var bs = this.baseUrl; var br = bg(this.url); var bq = this.downloadManager; bq.onerror = function (bv) { P.error("PDF failed to download.") }; if (!this.pdfDocument) { bt(); return } if (!this.downloadComplete) { bt(); return } this.pdfDocument.getData().then(function bu(bw) { var bv = Z.createBlob(bw, "application/pdf"); bq.download(bv, bs, br) }, bt).then(null, bt) }, fallback: function aD(bq) {}, error: function ba(bz, bt) { var bu = bn.get("error_version_info", { version: Z.version || "?", build: Z.build || "?" }, "PDF.js v{{version}} (build: {{build}})") + "\n"; if (bt) { bu += bn.get("error_message", { message: bt.message }, "Message: {{message}}"); if (bt.stack) { bu += "\n" + bn.get("error_stack", { stack: bt.stack }, "Stack: {{stack}}") } else { if (bt.filename) { bu += "\n" + bn.get("error_file", { file: bt.filename }, "File: {{file}}") } if (bt.lineNumber) { bu += "\n" + bn.get("error_line", { line: bt.lineNumber }, "Line: {{line}}") } } } var bw = this.appConfig.errorWrapper; var bx = bw.container; bx.removeAttribute("hidden"); var bv = bw.errorMessage; bv.textContent = bz; var bq = bw.closeButton; bq.onclick = function () { bx.setAttribute("hidden", "true") }; var by = bw.errorMoreInfo; var br = bw.moreInfoButton; var bs = bw.lessInfoButton; br.onclick = function () { by.removeAttribute("hidden"); br.setAttribute("hidden", "true"); bs.removeAttribute("hidden"); by.style.height = by.scrollHeight + "px" }; bs.onclick = function () { by.setAttribute("hidden", "true"); br.removeAttribute("hidden"); bs.setAttribute("hidden", "true") }; br.oncontextmenu = J; bs.oncontextmenu = J; bq.oncontextmenu = J; br.removeAttribute("hidden"); bs.setAttribute("hidden", "true"); by.value = bu }, progress: function M(br) { var bq = Math.round(br * 100); if (bq > this.loadingBar.percent || isNaN(bq)) { this.loadingBar.percent = bq; if (Z.PDFJS.disableAutoFetch && bq) { if (this.disableAutoFetchLoadingBarTimeout) { clearTimeout(this.disableAutoFetchLoadingBarTimeout); this.disableAutoFetchLoadingBarTimeout = null } this.loadingBar.show(); this.disableAutoFetchLoadingBarTimeout = setTimeout(function () { this.loadingBar.hide(); this.disableAutoFetchLoadingBarTimeout = null }.bind(this), af) } } }, load: function be(bt, bu) { var bA = this; bu = bu || aA; this.pdfDocument = bt; this.pdfDocumentProperties.setDocumentAndUrl(bt, this.url); var bx = bt.getDownloadInfo().then(function () { bA.downloadComplete = true; bA.loadingBar.hide() }); this.toolbar.setPagesCount(bt.numPages, false); this.secondaryToolbar.setPagesCount(bt.numPages); var bq = this.documentFingerprint = bt.fingerprint; var by = this.store = new at(bq); var bv; bv = null; this.pdfLinkService.setDocument(bt, bv); var bw = this.pdfViewer; bw.currentScale = bu; bw.setDocument(bt); var br = bw.firstPagePromise; var bz = bw.pagesPromise; var bs = bw.onePageRendered; this.pageRotation = 0; br.then(function (bE) { bx.then(function () { bA.eventBus.dispatch("documentload", { source: bA }) }); bA.loadingBar.setWidth(bA.appConfig.viewerContainer); if (!Z.PDFJS.disableHistory && !bA.isViewerEmbedded) { if (!bA.viewerPrefs.showPreviousViewOnLoad) { bA.pdfHistory.clearHistoryState() } bA.pdfHistory.initialize(bA.documentFingerprint); if (bA.pdfHistory.initialDestination) { bA.initialDestination = bA.pdfHistory.initialDestination } else { if (bA.pdfHistory.initialBookmark) { bA.initialBookmark = bA.pdfHistory.initialBookmark } } } var bC = { destination: bA.initialDestination, bookmark: bA.initialBookmark, hash: null }; by.initializedPromise.then(function bB() { var bK = null, bF = null; if (bA.viewerPrefs.showPreviousViewOnLoad && by.get("exists", false)) { var bH = by.get("page", "1"); var bG = bA.viewerPrefs.defaultZoomValue || by.get("zoom", s); var bJ = by.get("scrollLeft", "0"); var bI = by.get("scrollTop", "0"); bK = "page=" + bH + "&zoom=" + bG + "," + bJ + "," + bI; bF = by.get("sidebarView", U.NONE) } else { if (bA.viewerPrefs.defaultZoomValue) { bK = "page=1&zoom=" + bA.viewerPrefs.defaultZoomValue } } bA.setInitialView(bK, { scale: bu, sidebarView: bF }); bC.hash = bK; if (!bA.isViewerEmbedded) { bA.pdfViewer.focus() } }, function bD(bF) { console.error(bF); bA.setInitialView(null, { scale: bu }) }); bz.then(function bB() { if (!bC.destination && !bC.bookmark && !bC.hash) { return } if (bA.hasEqualPageSizes) { return } bA.initialDestination = bC.destination; bA.initialBookmark = bC.bookmark; bA.pdfViewer.currentScaleValue = bA.pdfViewer.currentScaleValue; bA.setInitialView(bC.hash) }) }); bt.getPageLabels().then(function (bD) { if (!bD || bA.viewerPrefs.disablePageLabels) { return } var bB = 0, bC = bD.length; if (bC !== bA.pagesCount) { console.error("The number of Page Labels does not match the number of pages in the document."); return } while (bB < bC && bD[bB] === (bB + 1).toString()) { bB++ } if (bB === bC) { return } bw.setPageLabels(bD); bA.toolbar.setPagesCount(bt.numPages, true); bA.toolbar.setPageNumber(bw.currentPageNumber, bw.currentPageLabel) }); bz.then(function () { if (bA.supportsPrinting) { bt.getJavaScript().then(function (bF) { if (bF.length) { console.warn("Warning: JavaScript is not supported"); bA.fallback(Z.UNSUPPORTED_FEATURES.javaScript) } var bD = /\bprint\s*\(/; for (var bB = 0, bC = bF.length; bB < bC; bB++) { var bE = bF[bB]; if (bE && bD.test(bE)) { setTimeout(function () { window.print() }); return } } }) } }); bt.getMetadata().then(function (bD) { var bE = bD.info, bC = bD.metadata; bA.documentInfo = bE; bA.metadata = bC; var bB; if (bC && bC.has("dc:title")) { var bF = bC.get("dc:title"); if (bF !== "Untitled") { bB = bF } } if (!bB && bE && bE.Title) { bB = bE.Title } if (bB) { bA.setTitle(bB + " - " + document.title) } if (bE.IsAcroFormPresent) { console.warn("Warning: AcroForm/XFA is not supported"); bA.fallback(Z.UNSUPPORTED_FEATURES.forms) } }) }, setInitialView: function aF(bt, bq) { var bs = bq && bq.scale; var br = bq && bq.sidebarView; this.isInitialViewSet = true; this.pdfSidebar.setInitialView(this.viewerPrefs.sidebarViewOnLoad || br | 0); if (this.initialDestination) { this.pdfLinkService.navigateTo(this.initialDestination); this.initialDestination = null } else { if (this.initialBookmark) { this.pdfLinkService.setHash(this.initialBookmark); this.pdfHistory.push({ hash: this.initialBookmark }, true); this.initialBookmark = null } else { if (bt) { this.pdfLinkService.setHash(bt) } else { if (bs) { this.pdfViewer.currentScaleValue = bs; this.page = 1 } } } } this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber, this.pdfViewer.currentPageLabel); this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber); if (!this.pdfViewer.currentScaleValue) { this.pdfViewer.currentScaleValue = s } }, cleanup: function ay() { if (!this.pdfDocument) { return } this.pdfViewer.cleanup(); if (this.pdfViewer.renderer !== F.SVG) { this.pdfDocument.cleanup() } }, forceRendering: function aq() { this.pdfRenderingQueue.printing = this.printing; this.pdfRenderingQueue.isThumbnailViewEnabled = this.pdfSidebar.isThumbnailViewVisible; this.pdfRenderingQueue.renderHighestPriority() }, beforePrint: function v() { if (this.printService) { return } if (!this.supportsPrinting) { var bu = bn.get("printing_not_supported", null, "Warning: Printing is not fully supported by this browser."); this.error(bu); return } if (!this.pdfViewer.pageViewsReady) { var bt = bn.get("printing_not_ready", null, "Warning: The PDF is not fully loaded for printing."); window.alert(bt); return } var br = this.pdfViewer.getPagesOverview(); var bs = this.appConfig.printContainer; var bq = aY.instance.createPrintService(this.pdfDocument, br, bs); this.printService = bq; this.forceRendering(); bq.layout() }, get hasEqualPageSizes() { var bt = this.pdfViewer.getPageView(0); for (var bq = 1, br = this.pagesCount; bq < br; ++bq) { var bs = this.pdfViewer.getPageView(bq); if (bs.width !== bt.width || bs.height !== bt.height) { return false } } return true }, afterPrint: function a4() { if (this.printService) { this.printService.destroy(); this.printService = null } this.forceRendering() }, rotatePages: function h(br) { var bq = this.page; this.pageRotation = (this.pageRotation + 360 + br) % 360; this.pdfViewer.pagesRotation = this.pageRotation; this.forceRendering(); this.pdfViewer.currentPageNumber = bq }, requestPresentationMode: function aV() { if (!this.pdfPresentationMode) { return } this.pdfPresentationMode.request() }, bindEvents: function r() { var bq = this.eventBus; bq.on("resize", ar); bq.on("hashchange", am); bq.on("beforeprint", this.beforePrint.bind(this)); bq.on("afterprint", this.afterPrint.bind(this)); bq.on("pagerendered", aE); bq.on("textlayerrendered", aw); bq.on("updateviewarea", an); bq.on("pagechanging", b); bq.on("scalechanging", j); bq.on("sidebarviewchanged", ah); bq.on("pagemode", aO); bq.on("namedaction", ao); bq.on("presentationmodechanged", aM); bq.on("presentationmode", aP); bq.on("openfile", q); bq.on("print", R); bq.on("download", ax); bq.on("firstpage", m); bq.on("lastpage", bd); bq.on("nextpage", a2); bq.on("previouspage", p); bq.on("zoomin", aC); bq.on("zoomout", aB); bq.on("pagenumberchanged", D); bq.on("scalechanged", ab); bq.on("rotatecw", ad); bq.on("rotateccw", ag); bq.on("documentproperties", aJ); bq.on("find", c); bq.on("findfromurlhash", av); bq.on("fileinputchange", V) }, bindWindowEvents: function bb() { var bq = this.eventBus; window.addEventListener("wheel", Y); window.addEventListener("click", aj); window.addEventListener("keydown", aa); window.addEventListener("resize", function br() { bq.dispatch("resize") }); window.addEventListener("hashchange", function bs() { bq.dispatch("hashchange", { hash: document.location.hash.substring(1) }) }); window.addEventListener("beforeprint", function bt() { bq.dispatch("beforeprint") }); window.addEventListener("afterprint", function bu() { bq.dispatch("afterprint") }); window.addEventListener("change", function bv(bw) { var bx = bw.target.files; if (!bx || bx.length === 0) { return } bq.dispatch("fileinputchange", { fileInput: bw.target }) }) } }; var bp; var O = ["null", "http://mozilla.github.io", "https://mozilla.github.io"]; bp = function bp(bt) { try { var bq = new URL(window.location.href).origin || "null"; if (O.indexOf(bq) >= 0) { return } } catch (bv) { var bu = bv && bv.message; var bs = bn.get("loading_error", null, "An error occurred while loading the PDF."); var br = { message: bu }; P.error(bs, br); throw bv } }; function a3(bq) { return new Promise(function (bu, bt) { var br = P.appConfig; var bs = document.createElement("script"); bs.src = br.debuggerScriptPath; bs.onload = function () { PDFBug.enable(bq); PDFBug.init(Z, br.mainContainer); bu() }; bs.onerror = function () { bt(new Error("Cannot load debugger at " + bs.src)) }; (document.getElementsByTagName("head")[0] || document.body).appendChild(bs) }) } function a1() { var bB = P.appConfig; var bu; var br = document.location.search.substring(1); var bv = au(br); bu = "file" in bv ? bv.file : bB.defaultUrl; bp(bu); var bA = []; var bx = document.createElement("input"); bx.id = bB.openFileInputName; bx.className = "fileInput"; bx.setAttribute("type", "file"); bx.oncontextmenu = J; document.body.appendChild(bx); if (!window.File || !window.FileReader || !window.FileList || !window.Blob) { bB.toolbar.openFile.setAttribute("hidden", "true"); bB.secondaryToolbar.openFileButton.setAttribute("hidden", "true") } else { bx.value = null } var bs = Z.PDFJS; if (P.viewerPrefs.pdfBugEnabled) { var bw = document.location.hash.substring(1); var bq = au(bw); if ("disableworker" in bq) { bs.disableWorker = bq.disableworker === "true" } if ("disablerange" in bq) { bs.disableRange = bq.disablerange === "true" } if ("disablestream" in bq) { bs.disableStream = bq.disablestream === "true" } if ("disableautofetch" in bq) { bs.disableAutoFetch = bq.disableautofetch === "true" } if ("disablefontface" in bq) { bs.disableFontFace = bq.disablefontface === "true" } if ("disablehistory" in bq) { bs.disableHistory = bq.disablehistory === "true" } if ("webgl" in bq) { bs.disableWebGL = bq.webgl !== "true" } if ("useonlycsszoom" in bq) { bs.useOnlyCssZoom = bq.useonlycsszoom === "true" } if ("verbosity" in bq) { bs.verbosity = bq.verbosity | 0 } if ("ignorecurrentpositiononzoom" in bq) { bs.ignoreCurrentPositionOnZoom = bq.ignorecurrentpositiononzoom === "true" } if ("locale" in bq) { bs.locale = bq.locale } if ("textlayer" in bq) { switch (bq.textlayer) { case "off": bs.disableTextLayer = true; break; case "visible": case "shadow": case "hover": var by = bB.viewerContainer; by.classList.add("textLayer-" + bq.textlayer); break } } if ("pdfbug" in bq) { bs.pdfBug = true; var bt = bq.pdfbug; var bz = bt.split(","); bA.push(a3(bz)) } } bn.setLanguage(bs.locale); if (!P.supportsPrinting) { bB.toolbar.print.classList.add("hidden"); bB.secondaryToolbar.printButton.classList.add("hidden") } if (!P.supportsFullscreen) { bB.toolbar.presentationModeButton.classList.add("hidden"); bB.secondaryToolbar.presentationModeButton.classList.add("hidden") } if (P.supportsIntegratedFind) { bB.toolbar.viewFind.classList.add("hidden") } bB.sidebar.mainContainer.addEventListener("transitionend", function (bC) { if (bC.target === this) { P.eventBus.dispatch("resize") } }, true); Promise.all(bA).then(function () { a6(bu) }, function (bC) { P.error(bn.get("loading_error", null, "An error occurred while opening."), bC) }) } var a6; a6 = function a6(bq) { if (bq && bq.lastIndexOf("file:", 0) === 0) { P.setTitleUsingUrl(bq); var bs = new XMLHttpRequest(); bs.onload = function () { P.open(new Uint8Array(bs.response)) }; try { bs.open("GET", bq); bs.responseType = "arraybuffer"; bs.send() } catch (br) { P.error(bn.get("loading_error", null, "An error occurred while loading the PDF."), br) } return } if (bq) { P.open(bq) } }; function aE(bs) { var br = bs.pageNumber; var bq = br - 1; var bt = P.pdfViewer.getPageView(bq); if (br === P.page) { P.toolbar.updateLoadingIndicatorState(false) } if (!bt) { return } if (Z.PDFJS.pdfBug && Stats.enabled && bt.stats) { Stats.add(br, bt.stats) } if (bt.error) { P.error(bn.get("rendering_error", null, "An error occurred while rendering the page."), bt.error) } } function aw(bq) {} function aO(br) { var bs = br.mode, bq; switch (bs) { case "thumbs": bq = U.THUMBS; break; case "bookmarks": case "outline": bq = U.OUTLINE; break; case "attachments": bq = U.ATTACHMENTS; break; case "none": bq = U.NONE; break; default: console.error('Invalid "pagemode" hash parameter: ' + bs); return } P.pdfSidebar.switchView(bq, true) } function ao(br) { var bq = br.action; switch (bq) { case "GoToPage": P.appConfig.toolbar.pageNumber.select(); break; case "Find": if (!P.supportsIntegratedFind) { P.findBar.toggle() } break } } function aM(bs) { var br = bs.active; var bq = bs.switchInProgress; P.pdfViewer.presentationModeState = bq ? aW.CHANGING : br ? aW.FULLSCREEN : aW.NORMAL } function ah(br) { P.pdfRenderingQueue.isThumbnailViewEnabled = P.pdfSidebar.isThumbnailViewVisible; var bq = P.store; if (!bq || !P.isInitialViewSet) { return } bq.initializedPromise.then(function () { bq.set("sidebarView", br.view) }) } function an(bt) { var bq = bt.location, br = P.store; if (br) { br.initializedPromise.then(function () { br.setMultiple({ exists: true, page: bq.pageNumber, zoom: bq.scale, scrollLeft: bq.left, scrollTop: bq.top }) }) } P.pdfHistory.updateCurrentBookmark(bq.pdfOpenParams, bq.pageNumber); var bs = P.pdfViewer.getPageView(P.page - 1); var bu = bs.renderingState !== aR.FINISHED; P.toolbar.updateLoadingIndicatorState(bu) } function ar() { var bq = P.pdfViewer.currentScaleValue; if (bq === "auto" || bq === "page-fit" || bq === "page-width") { P.pdfViewer.currentScaleValue = bq } else { if (!bq) { P.pdfViewer.currentScaleValue = s } } P.pdfViewer.update() } function am(br) { if (P.pdfHistory.isHashChangeUnlocked) { var bq = br.hash; if (!bq) { return } if (!P.isInitialViewSet) { P.initialBookmark = bq } else { P.pdfLinkService.setHash(bq) } } } var V; V = function V(bu) { var bt = bu.fileInput.files[0]; if (!Z.PDFJS.disableCreateObjectURL && typeof URL !== "undefined" && URL.createObjectURL) { P.open(URL.createObjectURL(bt)) } else { var br = new FileReader(); br.onload = function bs(bw) { var bv = bw.target.result; var bx = new Uint8Array(bv); P.open(bx) }; br.readAsArrayBuffer(bt) } P.setTitleUsingUrl(bt.name); var bq = P.appConfig; bq.toolbar.download.setAttribute("hidden", "true"); bq.secondaryToolbar.downloadButton.setAttribute("hidden", "true") }; function aP() { P.requestPresentationMode() } function q() { var bq = P.appConfig.openFileInputName; document.getElementById(bq).click() } function R() { window.print() } function ax() { P.download() } function m() { if (P.pdfDocument) { P.page = 1 } } function bd() { if (P.pdfDocument) { P.page = P.pagesCount } } function a2() { P.page++ } function p() { P.page-- } function aC() { P.zoomIn() } function aB() { P.zoomOut() } function D(br) { var bq = P.pdfViewer; bq.scrollPageIntoView({ pageNumber: br.value }); if (br.value !== bq.currentPageNumber.toString() && br.value !== bq.currentPageLabel) { P.toolbar.setPageNumber(bq.currentPageNumber, bq.currentPageLabel) } } function ab(bq) { P.pdfViewer.currentScaleValue = bq.value } function ad() { P.rotatePages(90) } function ag() { P.rotatePages(-90) } function aJ() { P.pdfDocumentProperties.open() } function c(bq) { P.findController.executeCommand("find" + bq.type, { query: bq.query, phraseSearch: bq.phraseSearch, caseSensitive: bq.caseSensitive, highlightAll: bq.highlightAll, findPrevious: bq.findPrevious }) } function av(bq) { P.findController.executeCommand("find", { query: bq.query, phraseSearch: bq.phraseSearch, caseSensitive: false, highlightAll: true, findPrevious: false }) } function j(bq) { P.toolbar.setPageScale(bq.presetValue, bq.scale); P.pdfViewer.update() } function b(br) { var bq = br.pageNumber; P.toolbar.setPageNumber(bq, br.pageLabel || null); P.secondaryToolbar.setPageNumber(bq); if (Z.PDFJS.pdfBug && Stats.enabled) { var bs = P.pdfViewer.getPageView(bq - 1); if (bs.stats) { Stats.add(bq, bs.stats) } } } var aQ = false, e; function Y(by) { var bs = P.pdfViewer; if (bs.isInPresentationMode) { return } if (by.ctrlKey || by.metaKey) { var bx = P.supportedMouseWheelZoomModifierKeys; if (by.ctrlKey && !bx.ctrlKey || by.metaKey && !bx.metaKey) { return } by.preventDefault(); if (aQ) { return } var bu = bs.currentScale; var bw = aH(by); var bq = 3; var bv = bw * bq; if (bv < 0) { P.zoomOut(-bv) } else { P.zoomIn(bv) } var br = bs.currentScale; if (bu !== br) { var bz = br / bu - 1; var bt = bs.container.getBoundingClientRect(); var bB = by.clientX - bt.left; var bA = by.clientY - bt.top; bs.container.scrollLeft += bB * bz; bs.container.scrollTop += bA * bz } } else { aQ = true; clearTimeout(e); e = setTimeout(function () { aQ = false }, 1000) } } function aj(br) { if (!P.secondaryToolbar.isOpen) { return } var bq = P.appConfig; if (P.pdfViewer.containsElement(br.target) || bq.toolbar.container.contains(br.target) && br.target !== bq.secondaryToolbar.toggleButton) { P.secondaryToolbar.close() } } function aa(by) { if (d.active) { return } var bt = false, bs = false; var br = (by.ctrlKey ? 1 : 0) | (by.altKey ? 2 : 0) | (by.shiftKey ? 4 : 0) | (by.metaKey ? 8 : 0); var bv = P.pdfViewer; var bx = bv && bv.isInPresentationMode; if (br === 1 || br === 8 || br === 5 || br === 12) { switch (by.keyCode) { case 70: if (!P.supportsIntegratedFind) { bt = true } break; case 71: if (!P.supportsIntegratedFind) { var bu = P.findController.state; if (bu) { P.findController.executeCommand("findagain", { query: bu.query, phraseSearch: bu.phraseSearch, caseSensitive: bu.caseSensitive, highlightAll: bu.highlightAll, findPrevious: br === 5 || br === 12 }) } bt = true } break; case 61: case 107: case 187: case 171: if (!bx) { P.zoomIn() } bt = true; break; case 173: case 109: case 189: if (!bx) { P.zoomOut() } bt = true; break; case 48: case 96: if (!bx) { setTimeout(function () { bv.currentScaleValue = s }); bt = false } break; case 38: if (bx || P.page > 1) { P.page = 1; bt = true; bs = true } break; case 40: if (bx || P.page < P.pagesCount) { P.page = P.pagesCount; bt = true; bs = true } break } } if (br === 1 || br === 8) { switch (by.keyCode) { case 83: P.download(); bt = true; break } } if (br === 3 || br === 10) { switch (by.keyCode) { case 80: P.requestPresentationMode(); bt = true; break; case 71: P.appConfig.toolbar.pageNumber.select(); bt = true; break } } if (bt) { if (bs && !bx) { bv.focus() } by.preventDefault(); return } var bw = document.activeElement || document.querySelector(":focus"); var bq = bw && bw.tagName.toUpperCase(); if (bq === "INPUT" || bq === "TEXTAREA" || bq === "SELECT") { if (by.keyCode !== 27) { return } } if (br === 0) { switch (by.keyCode) { case 38: case 33: case 8: if (!bx && bv.currentScaleValue !== "page-fit") { break } case 37: if (bv.isHorizontalScrollbarEnabled) { break } case 75: case 80: if (P.page > 1) { P.page-- } bt = true; break; case 27: if (P.secondaryToolbar.isOpen) { P.secondaryToolbar.close(); bt = true } if (!P.supportsIntegratedFind && P.findBar.opened) { P.findBar.close(); bt = true } break; case 40: case 34: case 32: if (!bx && bv.currentScaleValue !== "page-fit") { break } case 39: if (bv.isHorizontalScrollbarEnabled) { break } case 74: case 78: if (P.page < P.pagesCount) { P.page++ } bt = true; break; case 36: if (bx || P.page > 1) { P.page = 1; bt = true; bs = true } break; case 35: if (bx || P.page < P.pagesCount) { P.page = P.pagesCount; bt = true; bs = true } break; case 72: if (!bx) { P.handTool.toggle() } break; case 82: P.rotatePages(90); break } } if (br === 4) { switch (by.keyCode) { case 32: if (!bx && bv.currentScaleValue !== "page-fit") { break } if (P.page > 1) { P.page-- } bt = true; break; case 82: P.rotatePages(-90); break } } if (!bt && !bx) { if (by.keyCode >= 33 && by.keyCode <= 40 || by.keyCode === 32 && bq !== "BUTTON") { bs = true } } if (br === 2) { switch (by.keyCode) { case 37: if (bx) { P.pdfHistory.back(); bt = true } break; case 39: if (bx) { P.pdfHistory.forward(); bt = true } break } } if (bs && !bv.containsElement(bw)) { bv.focus() } if (bt) { by.preventDefault() } } al.then(function Q() { document.getElementsByTagName("html")[0].dir = bn.getDirection() }); var aY = { instance: { supportsPrinting: false, createPrintService: function () { throw new Error("Not implemented: createPrintService") } } }; ac.PDFViewerApplication = P; ac.DefaultExernalServices = K; ac.PDFPrintServiceFactory = aY }), (function (c, h, b) { var e = b(0); var d = e.scrollIntoView; var k = { FIND_FOUND: 0, FIND_NOTFOUND: 1, FIND_WRAPPED: 2, FIND_PENDING: 3 }; var g = -50; var a = -400; var j = { "\u2018": "'", "\u2019": "'", "\u201A": "'", "\u201B": "'", "\u201C": '"', "\u201D": '"', "\u201E": '"', "\u201F": '"', "\u00BC": "1/4", "\u00BD": "1/2", "\u00BE": "3/4" }; var i = function f() { function o(D) { this.pdfViewer = D.pdfViewer || null; this.onUpdateResultsCount = null; this.onUpdateState = null; this.reset(); var E = Object.keys(j).join(""); this.normalizationRegex = new RegExp("[" + E + "]", "g") } o.prototype = { reset: function A() { this.startedTextExtraction = false; this.extractTextPromises = []; this.pendingFindMatches = Object.create(null); this.active = false; this.pageContents = []; this.pageMatches = []; this.pageMatchesLength = null; this.matchCount = 0; this.selected = { pageIdx: -1, matchIdx: -1 }; this.offset = { pageIdx: null, matchIdx: null }; this.pagesToSearch = null; this.resumePageIdx = null; this.state = null; this.dirtyMatch = false; this.findTimeout = null; this.firstPagePromise = new Promise(function (D) { this.resolveFirstPage = D }.bind(this)) }, normalize: function s(D) { return D.replace(this.normalizationRegex, function (E) { return j[E] }) }, _prepareMatches: function q(I, G, F) { function H(O, L) { var N, K, J; N = O[L]; J = O[L + 1]; if (L < O.length - 1 && N.match === J.match) { N.skipped = true; return true } for (var M = L - 1; M >= 0; M--) { K = O[M]; if (K.skipped) { continue } if (K.match + K.matchLength < N.match) { break } if (K.match + K.matchLength >= N.match + N.matchLength) { N.skipped = true; return true } } return false } var E, D; I.sort(function (K, J) { return K.match === J.match ? K.matchLength - J.matchLength : K.match - J.match }); for (E = 0, D = I.length; E < D; E++) { if (H(I, E)) { continue } G.push(I[E].match); F.push(I[E].matchLength) } }, calcFindPhraseMatch: function n(I, E, G) { var H = []; var D = I.length; var F = -D; while (true) { F = G.indexOf(I, F + D); if (F === -1) { break } H.push(F) } this.pageMatches[E] = H }, calcFindWordMatch: function t(J, G, D) { var E = []; var F = J.match(/\S+/g); var K, L, M; for (var H = 0, I = F.length; H < I; H++) { K = F[H]; L = K.length; M = -L; while (true) { M = D.indexOf(K, M + L); if (M === -1) { break } E.push({ match: M, matchLength: L, skipped: false }) } } if (!this.pageMatchesLength) { this.pageMatchesLength = [] } this.pageMatchesLength[G] = []; this.pageMatches[G] = []; this._prepareMatches(E, this.pageMatches[G], this.pageMatchesLength[G]) }, calcFindMatch: function r(F) { var H = this.normalize(this.pageContents[F]); var I = this.normalize(this.state.query); var G = this.state.caseSensitive; var E = this.state.phraseSearch; var D = I.length; if (D === 0) { return } if (!G) { H = H.toLowerCase(); I = I.toLowerCase() } if (E) { this.calcFindPhraseMatch(I, F, H) } else { this.calcFindWordMatch(I, F, H) } this.updatePage(F); if (this.resumePageIdx === F) { this.resumePageIdx = null; this.nextPageMatch() } if (this.pageMatches[F].length > 0) { this.matchCount += this.pageMatches[F].length; this.updateUIResultsCount() } }, extractText: function u() { if (this.startedTextExtraction) { return } this.startedTextExtraction = true; this.pageContents = []; var H = []; var E = this.pdfViewer.pagesCount; for (var F = 0; F < E; F++) { this.extractTextPromises.push(new Promise(function (I) { H.push(I) })) } var D = this; function G(I) { D.pdfViewer.getPageTextContent(I).then(function J(N) { var M = N.items; var O = []; for (var L = 0, K = M.length; L < K; L++) { O.push(M[L].str) } D.pageContents.push(O.join("")); H[I](I); if (I + 1 < D.pdfViewer.pagesCount) { G(I + 1) } }) } G(0) }, executeCommand: function y(E, D) { if (this.state === null || E !== "findagain") { this.dirtyMatch = true } this.state = D; this.updateUIState(k.FIND_PENDING); this.firstPagePromise.then(function () { this.extractText(); clearTimeout(this.findTimeout); if (E === "find") { this.findTimeout = setTimeout(this.nextMatch.bind(this), 250) } else { this.nextMatch() } }.bind(this)) }, updatePage: function x(D) { if (this.selected.pageIdx === D) { this.pdfViewer.currentPageNumber = D + 1 } var E = this.pdfViewer.getPageView(D); if (E.textLayer) { E.textLayer.updateMatches() } }, nextMatch: function v() { var G = this.state.findPrevious; var J = this.pdfViewer.currentPageNumber - 1; var E = this.pdfViewer.pagesCount; this.active = true; if (this.dirtyMatch) { this.dirtyMatch = false; this.selected.pageIdx = this.selected.matchIdx = -1; this.offset.pageIdx = J; this.offset.matchIdx = null; this.hadMatch = false; this.resumePageIdx = null; this.pageMatches = []; this.matchCount = 0; this.pageMatchesLength = null; var D = this; for (var F = 0; F < E; F++) { this.updatePage(F); if (!(F in this.pendingFindMatches)) { this.pendingFindMatches[F] = true; this.extractTextPromises[F].then(function (K) { delete D.pendingFindMatches[K]; D.calcFindMatch(K) }) } } } if (this.state.query === "") { this.updateUIState(k.FIND_FOUND); return } if (this.resumePageIdx) { return } var I = this.offset; this.pagesToSearch = E; if (I.matchIdx !== null) { var H = this.pageMatches[I.pageIdx].length; if (!G && I.matchIdx + 1 < H || G && I.matchIdx > 0) { this.hadMatch = true; I.matchIdx = G ? I.matchIdx - 1 : I.matchIdx + 1; this.updateMatch(true); return } this.advanceOffsetPage(G) } this.nextPageMatch() }, matchesReady: function z(F) { var G = this.offset; var E = F.length; var D = this.state.findPrevious; if (E) { this.hadMatch = true; G.matchIdx = D ? E - 1 : 0; this.updateMatch(true); return true } this.advanceOffsetPage(D); if (G.wrapped) { G.matchIdx = null; if (this.pagesToSearch < 0) { this.updateMatch(false); return true } } return false }, updateMatchPosition: function p(D, F, H, E) { if (this.selected.matchIdx === F && this.selected.pageIdx === D) { var G = { top: g, left: a }; d(H[E], G, true) } }, nextPageMatch: function C() { if (this.resumePageIdx !== null) { console.error("There can only be one pending page.") } do { var D = this.offset.pageIdx; var E = this.pageMatches[D]; if (!E) { this.resumePageIdx = D; break } } while (!this.matchesReady(E)) }, advanceOffsetPage: function m(E) { var F = this.offset; var D = this.extractTextPromises.length; F.pageIdx = E ? F.pageIdx - 1 : F.pageIdx + 1; F.matchIdx = null; this.pagesToSearch--; if (F.pageIdx >= D || F.pageIdx < 0) { F.pageIdx = E ? D - 1 : 0; F.wrapped = true } }, updateMatch: function l(G) { var F = k.FIND_NOTFOUND; var E = this.offset.wrapped; this.offset.wrapped = false; if (G) { var D = this.selected.pageIdx; this.selected.pageIdx = this.offset.pageIdx; this.selected.matchIdx = this.offset.matchIdx; F = E ? k.FIND_WRAPPED : k.FIND_FOUND; if (D !== -1 && D !== this.selected.pageIdx) { this.updatePage(D) } } this.updateUIState(F, this.state.findPrevious); if (this.selected.pageIdx !== -1) { this.updatePage(this.selected.pageIdx) } }, updateUIResultsCount: function w() { if (this.onUpdateResultsCount) { this.onUpdateResultsCount(this.matchCount) } }, updateUIState: function B(E, D) { if (this.onUpdateState) { this.onUpdateState(E, D, this.matchCount) } } }; return o }(); h.FindStates = k; h.PDFFindController = i }), (function (c, d, b) { var f = null; function l() { if (!f) { f = Promise.resolve({ showPreviousViewOnLoad: true, defaultZoomValue: "", sidebarViewOnLoad: 0, enableHandToolOnLoad: false, enableWebGL: false, pdfBugEnabled: false, disableRange: false, disableStream: false, disableAutoFetch: false, disableFontFace: false, disableTextLayer: false, useOnlyCssZoom: false, externalLinkTarget: 0, enhanceTextSelection: false, renderer: "canvas", renderInteractiveForms: false, enablePrintAutoRotate: false, disablePageLabels: false }) } return f } function e(q) { var o = {}; for (var p in q) { if (Object.prototype.hasOwnProperty.call(q, p)) { o[p] = q[p] } } return o } var m = { prefs: null, isInitializedPromiseResolved: false, initializedPromise: null, initialize: function k() { return this.initializedPromise = l().then(function (o) { Object.defineProperty(this, "defaults", { value: Object.freeze(o), writable: false, enumerable: true, configurable: false }); this.prefs = e(o); return this._readFromStorage(o) }.bind(this)).then(function (o) { this.isInitializedPromiseResolved = true; if (o) { this.prefs = o } }.bind(this)) }, _writeToStorage: function g(o) { return Promise.resolve() }, _readFromStorage: function n(o) { return Promise.resolve() }, reset: function i() { return this.initializedPromise.then(function () { this.prefs = e(this.defaults); return this._writeToStorage(this.defaults) }.bind(this)) }, reload: function h() { return this.initializedPromise.then(function () { this._readFromStorage(this.defaults).then(function (o) { if (o) { this.prefs = o } }.bind(this)) }.bind(this)) }, set: function j(o, p) { return this.initializedPromise.then(function () { if (this.defaults[o] === undefined) { throw new Error("preferencesSet: '" + o + "' is undefined.") } else { if (p === undefined) { throw new Error("preferencesSet: no value is specified.") } } var r = typeof p; var q = typeof this.defaults[o]; if (r !== q) { if (r === "number" && q === "string") { p = p.toString() } else { throw new Error("Preferences_set: '" + p + "' is a \"" + r + '", expected "' + q + '".') } } else { if (r === "number" && (p | 0) !== p) { throw new Error("Preferences_set: '" + p + '\' must be an "integer".') } } this.prefs[o] = p; return this._writeToStorage(this.prefs) }.bind(this)) }, get: function a(o) { return this.initializedPromise.then(function () { var p = this.defaults[o]; if (p === undefined) { throw new Error("preferencesGet: '" + o + "' is undefined.") } else { var q = this.prefs[o]; if (q !== undefined) { return q } } return p }.bind(this)) } }; m._writeToStorage = function (o) { return new Promise(function (p) { localStorage.setItem("pdfjs.preferences", JSON.stringify(o)); p() }) }; m._readFromStorage = function (o) { return new Promise(function (q) { var p = JSON.parse(localStorage.getItem("pdfjs.preferences")); q(p) }) }; d.Preferences = m }), (function (b, v, c) { var k = c(0); var h = c(4); var j = c(6); var e = c(1); var r = k.mozL10n; var n = k.CSS_UNITS; var t = j.PDFPrintServiceFactory; var o = h.OverlayManager; var m = null; function u(D, x, A, F) { var z = m.scratchCanvas; var B = 150; var y = B / 72; z.width = Math.floor(F.width * y); z.height = Math.floor(F.height * y); var w = Math.floor(F.width * n) + "px"; var C = Math.floor(F.height * n) + "px"; var E = z.getContext("2d"); E.save(); E.fillStyle = "rgb(255, 255, 255)"; E.fillRect(0, 0, z.width, z.height); E.restore(); return x.getPage(A).then(function (H) { var G = { canvasContext: E, transform: [y, 0, 0, y, 0, 0], viewport: H.getViewport(1, F.rotation), intent: "print" }; return H.render(G).promise }).then(function () { return { width: w, height: C } }) } function q(w, x, y) { this.pdfDocument = w; this.pagesOverview = x; this.printContainer = y; this.currentPage = -1; this.scratchCanvas = document.createElement("canvas") } q.prototype = { layout: function () { this.throwIfInactive(); var w = document.querySelector("body"); w.setAttribute("data-pdfjsprinting", true); var y = this.pagesOverview.every(function (z) { return z.width === this.pagesOverview[0].width && z.height === this.pagesOverview[0].height }, this); if (!y) { console.warn("Not all pages have the same size. The printed result may be incorrect!") } this.pageStyleSheet = document.createElement("style"); var x = this.pagesOverview[0]; this.pageStyleSheet.textContent = "@supports ((size:A4) and (size:1pt 1pt)) {@page { size: " + x.width + "pt " + x.height + "pt;}}"; w.appendChild(this.pageStyleSheet) }, destroy: function () { if (m !== this) { return } this.printContainer.textContent = ""; if (this.pageStyleSheet && this.pageStyleSheet.parentNode) { this.pageStyleSheet.parentNode.removeChild(this.pageStyleSheet); this.pageStyleSheet = null } this.scratchCanvas.width = this.scratchCanvas.height = 0; this.scratchCanvas = null; m = null; s().then(function () { if (o.active !== "printServiceOverlay") { return } o.close("printServiceOverlay") }) }, renderPages: function () { var w = this.pagesOverview.length; var x = function (A, z) { this.throwIfInactive(); if (++this.currentPage >= w) { p(w, w); A(); return } var y = this.currentPage; p(y, w); u(this, this.pdfDocument, y + 1, this.pagesOverview[y]).then(this.useRenderedPage.bind(this)).then(function () { x(A, z) }, z) }.bind(this); return new Promise(x) }, useRenderedPage: function (z) { this.throwIfInactive(); var w = document.createElement("img"); w.style.width = z.width; w.style.height = z.height; var x = this.scratchCanvas; if ("toBlob" in x && !e.PDFJS.disableCreateObjectURL) { x.toBlob(function (A) { w.src = URL.createObjectURL(A) }) } else { w.src = x.toDataURL() } var y = document.createElement("div"); y.appendChild(w); this.printContainer.appendChild(y); return new Promise(function (B, A) { w.onload = B; w.onerror = A }) }, performPrint: function () { this.throwIfInactive(); return new Promise(function (w) { setTimeout(function () { if (!this.active) { w(); return } d.call(window); setTimeout(w, 20) }.bind(this), 0) }.bind(this)) }, get active() { return this === m }, throwIfInactive: function () { if (!this.active) { throw new Error("This print request was cancelled or completed.") } } }; var d = window.print; window.print = function d() { if (m) { console.warn("Ignored window.print() because of a pending print job."); return } s().then(function () { if (m) { o.open("printServiceOverlay") } }); try { a("beforeprint") } finally { if (!m) { console.error("Expected print service to be initialized."); if (o.active === "printServiceOverlay") { o.close("printServiceOverlay") } return } var w = m; m.renderPages().then(function () { return w.performPrint() }, function () {}).then(function () { if (w.active) { f() } }) } }; function a(w) { var x = document.createEvent("CustomEvent"); x.initCustomEvent(w, false, false, "custom"); window.dispatchEvent(x) } function f() { if (m) { m.destroy(); a("afterprint") } } function p(y, z) { var x = document.getElementById("printServiceOverlay"); var w = Math.round(100 * y / z); var A = x.querySelector("progress"); var B = x.querySelector(".relative-progress"); A.value = w; B.textContent = r.get("print_progress_percent", { progress: w }, w + "%") } var l = !!document.attachEvent; window.addEventListener("keydown", function (w) { if (w.keyCode === 80 && (w.ctrlKey || w.metaKey) && !w.altKey && (!w.shiftKey || window.chrome || window.opera)) { window.print(); if (l) { return } w.preventDefault(); if (w.stopImmediatePropagation) { w.stopImmediatePropagation() } else { w.stopPropagation() } return } }, true); if (l) { document.attachEvent("onkeydown", function (w) { w = w || window.event; if (w.keyCode === 80 && w.ctrlKey) { w.keyCode = 0; return false } }) } if ("onbeforeprint" in window) { var g = function (w) { if (w.detail !== "custom" && w.stopImmediatePropagation) { w.stopImmediatePropagation() } }; window.addEventListener("beforeprint", g); window.addEventListener("afterprint", g) } var i; function s() { if (!i) { i = o.register("printServiceOverlay", document.getElementById("printServiceOverlay"), f, true); document.getElementById("printCancel").onclick = f } return i } t.instance = { supportsPrinting: true, createPrintService: function (w, x, y) { if (m) { throw new Error("The print service is created and active.") } m = new q(w, x, y); return m } }; v.PDFPrintService = q }), (function (e, h, c) { var f = c(0); var d = c(5); var k = c(1); var j = f.mozL10n; var a = d.SimpleLinkService; var g = function i() { function m(o) { this.pageDiv = o.pageDiv; this.pdfPage = o.pdfPage; this.renderInteractiveForms = o.renderInteractiveForms; this.linkService = o.linkService; this.downloadManager = o.downloadManager; this.div = null } m.prototype = { render: function n(o, r) { var p = this; var q = { intent: r === undefined ? "display" : r }; this.pdfPage.getAnnotations(q).then(function (s) { o = o.clone({ dontFlip: true }); q = { viewport: o, div: p.div, annotations: s, page: p.pdfPage, renderInteractiveForms: p.renderInteractiveForms, linkService: p.linkService, downloadManager: p.downloadManager }; if (p.div) { k.AnnotationLayer.update(q) } else { if (s.length === 0) { return } p.div = document.createElement("div"); p.div.className = "annotationLayer"; p.pageDiv.appendChild(p.div); q.div = p.div; k.AnnotationLayer.render(q); if (typeof j !== "undefined") { j.translate(p.div) } } }) }, hide: function l() { if (!this.div) { return } this.div.setAttribute("hidden", "true") } }; return m }(); function b() {} b.prototype = { createAnnotationLayerBuilder: function (l, n, m) { return new g({ pageDiv: l, pdfPage: n, renderInteractiveForms: m, linkService: new a() }) } }; h.AnnotationLayerBuilder = g; h.DefaultAnnotationLayerFactory = b }), (function (c, d, b) { var h = b(1); function a(l, k) { var j = document.createElement("a"); if (j.click) { j.href = l; j.target = "_parent"; if ("download" in j) { j.download = k }(document.body || document.documentElement).appendChild(j); j.click(); j.parentNode.removeChild(j) } else { if (window.top === window && l.split("#")[0] === window.location.href.split("#")[0]) { var m = l.indexOf("?") === -1 ? "?" : "&"; l = l.replace(/#|$/, m + "$&") } window.open(l, "_parent") } } function f() {} f.prototype = { downloadUrl: function e(k, j) { if (!h.createValidAbsoluteUrl(k, "http://example.com")) { return } a(k + "#pdfjs.action=download", j) }, downloadData: function g(l, k, m) { if (navigator.msSaveBlob) { return navigator.msSaveBlob(new Blob([l], { type: m }), k) } var j = h.createObjectURL(l, m, h.PDFJS.disableCreateObjectURL); a(j, k) }, download: function i(l, m, k) { if (navigator.msSaveBlob) { if (!navigator.msSaveBlob(l, k)) { this.downloadUrl(m, k) } return } if (h.PDFJS.disableCreateObjectURL) { this.downloadUrl(m, k); return } var j = URL.createObjectURL(l); a(j, k) } }; d.DownloadManager = f }), (function (e, i, c) { function m(s) { this.element = s.element; this.document = s.element.ownerDocument; if (typeof s.ignoreTarget === "function") { this.ignoreTarget = s.ignoreTarget } this.onActiveChanged = s.onActiveChanged; this.activate = this.activate.bind(this); this.deactivate = this.deactivate.bind(this); this.toggle = this.toggle.bind(this); this._onmousedown = this._onmousedown.bind(this); this._onmousemove = this._onmousemove.bind(this); this._endPan = this._endPan.bind(this); var r = this.overlay = document.createElement("div"); r.className = "grab-to-pan-grabbing" } m.prototype = { CSS_CLASS_GRAB: "grab-to-pan-grab", activate: function f() { if (!this.active) { this.active = true; this.element.addEventListener("mousedown", this._onmousedown, true); this.element.classList.add(this.CSS_CLASS_GRAB); if (this.onActiveChanged) { this.onActiveChanged(true) } } }, deactivate: function d() { if (this.active) { this.active = false; this.element.removeEventListener("mousedown", this._onmousedown, true); this._endPan(); this.element.classList.remove(this.CSS_CLASS_GRAB); if (this.onActiveChanged) { this.onActiveChanged(false) } } }, toggle: function h() { if (this.active) { this.deactivate() } else { this.activate() } }, ignoreTarget: function b(r) { return r[q]("a[href], a[href] *, input, textarea, button, button *, select, option") }, _onmousedown: function a(r) { if (r.button !== 0 || this.ignoreTarget(r.target)) { return } if (r.originalTarget) { try { r.originalTarget.tagName } catch (s) { return } } this.scrollLeftStart = this.element.scrollLeft; this.scrollTopStart = this.element.scrollTop; this.clientXStart = r.clientX; this.clientYStart = r.clientY; this.document.addEventListener("mousemove", this._onmousemove, true); this.document.addEventListener("mouseup", this._endPan, true); this.element.addEventListener("scroll", this._endPan, true); r.preventDefault(); r.stopPropagation(); var t = document.activeElement; if (t && !t.contains(r.target)) { t.blur() } }, _onmousemove: function k(s) { this.element.removeEventListener("scroll", this._endPan, true); if (l(s)) { this._endPan(); return } var v = s.clientX - this.clientXStart; var r = s.clientY - this.clientYStart; var t = this.scrollTopStart - r; var u = this.scrollLeftStart - v; if (this.element.scrollTo) { this.element.scrollTo({ top: t, left: u, behavior: "instant" }) } else { this.element.scrollTop = t; this.element.scrollLeft = u } if (!this.overlay.parentNode) { document.body.appendChild(this.overlay) } }, _endPan: function g() { this.element.removeEventListener("scroll", this._endPan, true); this.document.removeEventListener("mousemove", this._onmousemove, true); this.document.removeEventListener("mouseup", this._endPan, true); this.overlay.remove() } }; var q; ["webkitM", "mozM", "msM", "oM", "m"].some(function (s) { var r = s + "atches"; if (r in document.documentElement) { q = r } r += "Selector"; if (r in document.documentElement) { q = r } return q }); var n = !document.documentMode || document.documentMode > 9; var j = window.chrome; var o = j && (j.webstore || j.app); var p = /Apple/.test(navigator.vendor) && /Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent); function l(r) { if ("buttons" in r && n) { return !(r.buttons & 1) } if (o || p) { return r.which === 0 } } i.GrabToPan = m }), (function (b, e, a) { var f = a(12); var g = a(8); var c = a(0); var i = f.GrabToPan; var k = g.Preferences; var h = c.localized; var j = function d() { function n(q) { this.container = q.container; this.eventBus = q.eventBus; this.wasActive = false; this.handTool = new i({ element: this.container, onActiveChanged: function (s) { this.eventBus.dispatch("handtoolchanged", { isActive: s }) }.bind(this) }); this.eventBus.on("togglehandtool", this.toggle.bind(this)); Promise.all([h, k.get("enableHandToolOnLoad")]).then(function p(s) { if (s[1] === true) { this.handTool.activate() } }.bind(this), function r(s) {}); this.eventBus.on("presentationmodechanged", function (s) { if (s.switchInProgress) { return } if (s.active) { this.enterPresentationMode() } else { this.exitPresentationMode() } }.bind(this)) } n.prototype = { get isActive() { return !!this.handTool.active }, toggle: function o() { this.handTool.toggle() }, enterPresentationMode: function m() { if (this.isActive) { this.wasActive = true; this.handTool.deactivate() } }, exitPresentationMode: function l() { if (this.wasActive) { this.wasActive = false; this.handTool.activate() } } }; return n }(); e.HandTool = j }), (function (b, e, a) { var c = a(0); var h = a(4); var j = a(1); var i = c.mozL10n; var d = h.OverlayManager; var g = function f() { function n(p) { this.overlayName = p.overlayName; this.container = p.container; this.label = p.label; this.input = p.input; this.submitButton = p.submitButton; this.cancelButton = p.cancelButton; this.updateCallback = null; this.reason = null; this.submitButton.addEventListener("click", this.verify.bind(this)); this.cancelButton.addEventListener("click", this.close.bind(this)); this.input.addEventListener("keydown", function (q) { if (q.keyCode === 13) { this.verify() } }.bind(this)); d.register(this.overlayName, this.container, this.close.bind(this), true) } n.prototype = { open: function o() { d.open(this.overlayName).then(function () { this.input.type = "password"; this.input.focus(); var p = i.get("password_label", null, "Enter the password to open this PDF file."); if (this.reason === j.PasswordResponses.INCORRECT_PASSWORD) { p = i.get("password_invalid", null, "Invalid password. Please try again.") } this.label.textContent = p }.bind(this)) }, close: function l() { d.close(this.overlayName).then(function () { this.input.value = ""; this.input.type = "" }.bind(this)) }, verify: function m() { var p = this.input.value; if (p && p.length > 0) { this.close(); return this.updateCallback(p) } }, setUpdateCallback: function k(q, p) { this.updateCallback = q; this.reason = p } }; return n }(); e.PasswordPrompt = g }), (function (b, a, e) { var c = e(1); var f = function d() { function m(n) { this.attachments = null; this.container = n.container; this.eventBus = n.eventBus; this.downloadManager = n.downloadManager; this._renderedCapability = c.createPromiseCapability(); this.eventBus.on("fileattachmentannotation", this._appendAttachment.bind(this)) } m.prototype = { reset: function i(n) { this.attachments = null; this.container.textContent = ""; if (!n) { this._renderedCapability = c.createPromiseCapability() } }, _dispatchEvent: function h(n) { this.eventBus.dispatch("attachmentsloaded", { source: this, attachmentsCount: n }); this._renderedCapability.resolve() }, _bindPdfLink: function j(p, q, o) { var n; p.onclick = function () { if (!n) { n = c.createObjectURL(q, "application/pdf", c.PDFJS.disableCreateObjectURL) } var r; r = "?file=" + encodeURIComponent(n + "#" + o); window.open(r); return false } }, _bindLink: function k(o, p, n) { o.onclick = function q(r) { this.downloadManager.downloadData(p, n, ""); return false }.bind(this) }, render: function g(p) { p = p || {}; var r = p.attachments || null; var q = 0; if (this.attachments) { var u = p.keepRenderedCapability === true; this.reset(u) } this.attachments = r; if (!r) { this._dispatchEvent(q); return } var v = Object.keys(r).sort(function (y, x) { return y.toLowerCase().localeCompare(x.toLowerCase()) }); q = v.length; for (var s = 0; s < q; s++) { var w = r[v[s]]; var n = c.getFilenameFromUrl(w.filename); n = c.removeNullCharacters(n); var o = document.createElement("div"); o.className = "attachmentsItem"; var t = document.createElement("button"); t.textContent = n; if (/\.pdf$/i.test(n)) { this._bindPdfLink(t, w.content, n) } else { this._bindLink(t, w.content, n) } o.appendChild(t); this.container.appendChild(o) } this._dispatchEvent(q) }, _appendAttachment: function l(n) { this._renderedCapability.promise.then(function (s, p, r) { var o = this.attachments; if (!o) { o = Object.create(null) } else { for (var q in o) { if (s === q) { return } } } o[s] = { filename: p, content: r }; this.render({ attachments: o, keepRenderedCapability: true }) }.bind(this, n.id, n.filename, n.content)) } }; return m }(); a.PDFAttachmentViewer = f }), (function (d, g, c) { var e = c(0); var h = c(4); var a = e.getPDFFileNameFromURL; var j = e.mozL10n; var f = h.OverlayManager; var i = function b() { function p(t) { this.fields = t.fields; this.overlayName = t.overlayName; this.container = t.container; this.rawFileSize = 0; this.url = null; this.pdfDocument = null; if (t.closeButton) { t.closeButton.addEventListener("click", this.close.bind(this)) } this.dataAvailablePromise = new Promise(function (u) { this.resolveDataAvailable = u }.bind(this)); f.register(this.overlayName, this.container, this.close.bind(this)) } p.prototype = { open: function l() { Promise.all([f.open(this.overlayName), this.dataAvailablePromise]).then(function () { this._getProperties() }.bind(this)) }, close: function r() { f.close(this.overlayName) }, setFileSize: function q(t) { if (t > 0) { this.rawFileSize = t } }, setDocumentAndUrl: function s(t, u) { this.pdfDocument = t; this.url = u; this.resolveDataAvailable() }, _getProperties: function o() { if (!f.active) { return } this.pdfDocument.getDownloadInfo().then(function (t) { if (t.length === this.rawFileSize) { return } this.setFileSize(t.length); this._updateUI(this.fields.fileSize, this._parseFileSize()) }.bind(this)); this.pdfDocument.getMetadata().then(function (v) { var u = { fileName: a(this.url), fileSize: this._parseFileSize(), title: v.info.Title, author: v.info.Author, subject: v.info.Subject, keywords: v.info.Keywords, creationDate: this._parseDate(v.info.CreationDate), modificationDate: this._parseDate(v.info.ModDate), creator: v.info.Creator, producer: v.info.Producer, version: v.info.PDFFormatVersion, pageCount: this.pdfDocument.numPages }; for (var t in u) { this._updateUI(this.fields[t], u[t]) } }.bind(this)) }, _updateUI: function m(u, t) { if (u && t !== undefined && t !== "") { u.textContent = t } }, _parseFileSize: function k() { var t = this.rawFileSize, u = t / 1024; if (!u) { return } else { if (u < 1024) { return j.get("document_properties_kb", { size_kb: (+u.toPrecision(3)).toLocaleString(), size_b: t.toLocaleString() }, "{{size_kb}} KB ({{size_b}} bytes)") } } return j.get("document_properties_mb", { size_mb: (+(u / 1024).toPrecision(3)).toLocaleString(), size_b: t.toLocaleString() }, "{{size_mb}} MB ({{size_b}} bytes)") }, _parseDate: function n(D) { var y = D; if (y === undefined) { return "" } if (y.substring(0, 2) === "D:") { y = y.substring(2) } var A = parseInt(y.substring(0, 4), 10); var z = parseInt(y.substring(4, 6), 10) - 1; var B = parseInt(y.substring(6, 8), 10); var E = parseInt(y.substring(8, 10), 10); var w = parseInt(y.substring(10, 12), 10); var G = parseInt(y.substring(12, 14), 10); var x = y.substring(14, 15); var v = parseInt(y.substring(15, 17), 10); var F = parseInt(y.substring(18, 20), 10); if (x === "-") { E += v; w += F } else { if (x === "+") { E -= v; w -= F } } var u = new Date(Date.UTC(A, z, B, E, w, G)); var C = u.toLocaleDateString(); var t = u.toLocaleTimeString(); return j.get("document_properties_date_string", { date: C, time: t }, "{{date}}, {{time}}") } }; return p }(); g.PDFDocumentProperties = i }), (function (c, f, b) { var d = b(0); var a = b(7); var i = d.mozL10n; var g = a.FindStates; var h = function e() { function q(s) { this.opened = false; this.bar = s.bar || null; this.toggleButton = s.toggleButton || null; this.findField = s.findField || null; this.highlightAll = s.highlightAllCheckbox || null; this.caseSensitive = s.caseSensitiveCheckbox || null; this.findMsg = s.findMsg || null; this.findResultsCount = s.findResultsCount || null; this.findStatusIcon = s.findStatusIcon || null; this.findPreviousButton = s.findPreviousButton || null; this.findNextButton = s.findNextButton || null; this.findController = s.findController || null; this.eventBus = s.eventBus; if (this.findController === null) { throw new Error("PDFFindBar cannot be used without a PDFFindController instance.") } var r = this; this.toggleButton.addEventListener("click", function () { r.toggle() }); this.findField.addEventListener("input", function () { r.dispatchEvent("") }); this.bar.addEventListener("keydown", function (t) { switch (t.keyCode) { case 13: if (t.target === r.findField) { r.dispatchEvent("again", t.shiftKey) } break; case 27: r.close(); break } }); this.findPreviousButton.addEventListener("click", function () { r.dispatchEvent("again", true) }); this.findNextButton.addEventListener("click", function () { r.dispatchEvent("again", false) }); this.highlightAll.addEventListener("click", function () { r.dispatchEvent("highlightallchange") }); this.caseSensitive.addEventListener("click", function () { r.dispatchEvent("casesensitivitychange") }); this.eventBus.on("resize", this._adjustWidth.bind(this)) } q.prototype = { reset: function p() { this.updateUIState() }, dispatchEvent: function n(s, r) { this.eventBus.dispatch("find", { source: this, type: s, query: this.findField.value, caseSensitive: this.caseSensitive.checked, phraseSearch: true, highlightAll: this.highlightAll.checked, findPrevious: r }) }, updateUIState: function m(w, v, t) { var u = false; var r = ""; var s = ""; switch (w) { case g.FIND_FOUND: break; case g.FIND_PENDING: s = "pending"; break; case g.FIND_NOTFOUND: r = i.get("find_not_found", null, "Phrase not found"); u = true; break; case g.FIND_WRAPPED: if (v) { r = i.get("find_reached_top", null, "Reached top of document, continued from bottom") } else { r = i.get("find_reached_bottom", null, "Reached end of document, continued from top") } break } if (u) { this.findField.classList.add("notFound") } else { this.findField.classList.remove("notFound") } this.findField.setAttribute("data-status", s); this.findMsg.textContent = r; this.updateResultsCount(t); this._adjustWidth() }, updateResultsCount: function (r) { if (!this.findResultsCount) { return } if (!r) { this.findResultsCount.classList.add("hidden"); return } this.findResultsCount.textContent = r.toLocaleString(); this.findResultsCount.classList.remove("hidden") }, open: function k() { if (!this.opened) { this.opened = true; this.toggleButton.classList.add("toggled"); this.bar.classList.remove("hidden") } this.findField.select(); this.findField.focus(); this._adjustWidth() }, close: function j() { if (!this.opened) { return } this.opened = false; this.toggleButton.classList.remove("toggled"); this.bar.classList.add("hidden"); this.findController.active = false }, toggle: function l() { if (this.opened) { this.close() } else { this.open() } }, _adjustWidth: function o() { if (!this.opened) { return } this.bar.classList.remove("wrapContainers"); var r = this.bar.clientHeight; var s = this.bar.firstElementChild.clientHeight; if (r > s) { this.bar.classList.add("wrapContainers") } } }; return q }(); f.PDFFindBar = h }), (function (b, t, d) { var a = d(2); function k(u) { this.linkService = u.linkService; this.eventBus = u.eventBus || a.getGlobalEventBus(); this.initialized = false; this.initialDestination = null; this.initialBookmark = null } k.prototype = { initialize: function f(y) { this.initialized = true; this.reInitialized = false; this.allowHashChange = true; this.historyUnlocked = true; this.isViewerInPresentationMode = false; this.previousHash = window.location.hash.substring(1); this.currentBookmark = ""; this.currentPage = 0; this.updatePreviousBookmark = false; this.previousBookmark = ""; this.previousPage = 0; this.nextHashParam = ""; this.fingerprint = y; this.currentUid = this.uid = 0; this.current = {}; var B = window.history.state; if (this._isStateObjectDefined(B)) { if (B.target.dest) { this.initialDestination = B.target.dest } else { this.initialBookmark = B.target.hash } this.currentUid = B.uid; this.uid = B.uid + 1; this.current = B.target } else { if (B && B.fingerprint && this.fingerprint !== B.fingerprint) { this.reInitialized = true } this._pushOrReplaceState({ fingerprint: this.fingerprint }, true) } var w = this; window.addEventListener("popstate", function v(C) { if (!w.historyUnlocked) { return } if (C.state) { w._goTo(C.state); return } if (w.uid === 0) { var D = w.previousHash && w.currentBookmark && w.previousHash !== w.currentBookmark ? { hash: w.currentBookmark, page: w.currentPage } : { page: 1 }; z(D, function () { x() }) } else { x() } }); function x() { w.previousHash = window.location.hash.slice(1); w._pushToHistory({ hash: w.previousHash }, false, true); w._updatePreviousBookmark() } function z(E, F) { w.historyUnlocked = false; w.allowHashChange = false; window.addEventListener("popstate", D); history.back(); function D() { window.removeEventListener("popstate", D); window.addEventListener("popstate", C); w._pushToHistory(E, false, true); history.forward() } function C() { window.removeEventListener("popstate", C); w.allowHashChange = true; w.historyUnlocked = true; F() } } function u() { var D = w._getPreviousParams(null, true); if (D) { var C = !w.current.dest && w.current.hash !== w.previousHash; w._pushToHistory(D, false, C); w._updatePreviousBookmark() } window.removeEventListener("beforeunload", u) } window.addEventListener("beforeunload", u); window.addEventListener("pageshow", function A(C) { window.addEventListener("beforeunload", u) }); w.eventBus.on("presentationmodechanged", function (C) { w.isViewerInPresentationMode = C.active }) }, clearHistoryState: function o() { this._pushOrReplaceState(null, true) }, _isStateObjectDefined: function g(u) { return u && u.uid >= 0 && u.fingerprint && this.fingerprint === u.fingerprint && u.target && u.target.hash ? true : false }, _pushOrReplaceState: function r(u, v) { if (v) { window.history.replaceState(u, "", document.URL) } else { window.history.pushState(u, "", document.URL) } }, get isHashChangeUnlocked() { if (!this.initialized) { return true } return this.allowHashChange }, _updatePreviousBookmark: function i() { if (this.updatePreviousBookmark && this.currentBookmark && this.currentPage) { this.previousBookmark = this.currentBookmark; this.previousPage = this.currentPage; this.updatePreviousBookmark = false } }, updateCurrentBookmark: function j(u, v) { if (this.initialized) { this.currentBookmark = u.substring(1); this.currentPage = v | 0; this._updatePreviousBookmark() } }, updateNextHashParam: function c(u) { if (this.initialized) { this.nextHashParam = u } }, push: function p(w, u) { if (!(this.initialized && this.historyUnlocked)) { return } if (w.dest && !w.hash) { w.hash = this.current.hash && this.current.dest && this.current.dest === w.dest ? this.current.hash : this.linkService.getDestinationHash(w.dest).split("#")[1] } if (w.page) { w.page |= 0 } if (u) { var v = window.history.state.target; if (!v) { this._pushToHistory(w, false); this.previousHash = window.location.hash.substring(1) } this.updatePreviousBookmark = this.nextHashParam ? false : true; if (v) { this._updatePreviousBookmark() } return } if (this.nextHashParam) { if (this.nextHashParam === w.hash) { this.nextHashParam = null; this.updatePreviousBookmark = true; return } this.nextHashParam = null } if (w.hash) { if (this.current.hash) { if (this.current.hash !== w.hash) { this._pushToHistory(w, true) } else { if (!this.current.page && w.page) { this._pushToHistory(w, false, true) } this.updatePreviousBookmark = true } } else { this._pushToHistory(w, true) } } else { if (this.current.page && w.page && this.current.page !== w.page) { this._pushToHistory(w, true) } } }, _getPreviousParams: function n(w, u) { if (!(this.currentBookmark && this.currentPage)) { return null } else { if (this.updatePreviousBookmark) { this.updatePreviousBookmark = false } } if (this.uid > 0 && !(this.previousBookmark && this.previousPage)) { return null } if (!this.current.dest && !w || u) { if (this.previousBookmark === this.currentBookmark) { return null } } else { if (this.current.page || w) { if (this.previousPage === this.currentPage) { return null } } else { return null } } var v = { hash: this.currentBookmark, page: this.currentPage }; if (this.isViewerInPresentationMode) { v.hash = null } return v }, _stateObj: function m(u) { return { fingerprint: this.fingerprint, uid: this.uid, target: u } }, _pushToHistory: function l(y, u, v) { if (!this.initialized) { return } if (!y.hash && y.page) { y.hash = "page=" + y.page } if (u && !v) { var x = this._getPreviousParams(); if (x) { var w = !this.current.dest && this.current.hash !== this.previousHash; this._pushToHistory(x, false, w) } } this._pushOrReplaceState(this._stateObj(y), v || this.uid === 0); this.currentUid = this.uid++; this.current = y; this.updatePreviousBookmark = true }, _goTo: function q(w) { if (!(this.initialized && this.historyUnlocked && this._isStateObjectDefined(w))) { return } if (!this.reInitialized && w.uid < this.currentUid) { var u = this._getPreviousParams(true); if (u) { this._pushToHistory(this.current, false); this._pushToHistory(u, false); this.currentUid = w.uid; window.history.back(); return } } this.historyUnlocked = false; if (w.target.dest) { this.linkService.navigateTo(w.target.dest) } else { this.linkService.setHash(w.target.hash) } this.currentUid = w.uid; if (w.uid > this.uid) { this.uid = w.uid } this.current = w.target; this.updatePreviousBookmark = true; var v = window.location.hash.substring(1); if (this.previousHash !== v) { this.allowHashChange = false } this.previousHash = v; this.historyUnlocked = true }, back: function e() { this.go(-1) }, forward: function s() { this.go(1) }, go: function h(v) { if (this.initialized && this.historyUnlocked) { var u = window.history.state; if (v === -1 && u && u.uid > 0) { window.history.back() } else { if (v === 1 && u && u.uid < this.uid - 1) { window.history.forward() } } } } }; t.PDFHistory = k }), (function (b, a, g) { var f = g(1); var d = f.PDFJS; var c = "\u2013"; var e = function h() { function p(r) { this.outline = null; this.lastToggleIsShow = true; this.container = r.container; this.linkService = r.linkService; this.eventBus = r.eventBus } p.prototype = { reset: function l() { this.outline = null; this.lastToggleIsShow = true; this.container.textContent = ""; this.container.classList.remove("outlineWithDeepNesting") }, _dispatchEvent: function o(r) { this.eventBus.dispatch("outlineloaded", { source: this, outlineCount: r }) }, _bindLink: function n(t, u) { if (u.url) { f.addLinkAttributes(t, { url: u.url, target: u.newWindow ? d.LinkTarget.BLANK : undefined }); return } var s = this, r = u.dest; t.href = s.linkService.getDestinationHash(r); t.onclick = function () { if (r) { s.linkService.navigateTo(r) } return false } }, _setStyles: function k(r, s) { var t = ""; if (s.bold) { t += "font-weight: bold;" } if (s.italic) { t += "font-style: italic;" } if (t) { r.setAttribute("style", t) } }, _addToggleButton: function m(s) { var r = document.createElement("div"); r.className = "outlineItemToggler"; r.onclick = function (u) { u.stopPropagation(); r.classList.toggle("outlineItemsHidden"); if (u.shiftKey) { var t = !r.classList.contains("outlineItemsHidden"); this._toggleOutlineItem(s, t) } }.bind(this); s.insertBefore(r, s.firstChild) }, _toggleOutlineItem: function q(s, r) { this.lastToggleIsShow = r; var v = s.querySelectorAll(".outlineItemToggler"); for (var t = 0, u = v.length; t < u; ++t) { v[t].classList[r ? "remove" : "add"]("outlineItemsHidden") } }, toggleOutlineTree: function j() { if (!this.outline) { return } this._toggleOutlineItem(this.container, !this.lastToggleIsShow) }, render: function i(v) { var r = v && v.outline || null; var u = 0; if (this.outline) { this.reset() } this.outline = r; if (!r) { this._dispatchEvent(u); return } var B = document.createDocumentFragment(); var z = [{ parent: B, items: this.outline }]; var y = false; while (z.length > 0) { var s = z.shift(); for (var x = 0, A = s.items.length; x < A; x++) { var D = s.items[x]; var t = document.createElement("div"); t.className = "outlineItem"; var w = document.createElement("a"); this._bindLink(w, D); this._setStyles(w, D); w.textContent = f.removeNullCharacters(D.title) || c; t.appendChild(w); if (D.items.length > 0) { y = true; this._addToggleButton(t); var C = document.createElement("div"); C.className = "outlineItems"; t.appendChild(C); z.push({ parent: C, items: D.items }) } s.parent.appendChild(t); u++ } } if (y) { this.container.classList.add("outlineWithDeepNesting") } this.container.appendChild(B); this._dispatchEvent(u) } }; return p }(); a.PDFOutlineViewer = e }), (function (c, i, b) { var d = b(0); var m = b(3); var k = b(2); var q = b(1); var n = d.CSS_UNITS; var h = d.DEFAULT_SCALE; var e = d.getOutputScale; var g = d.approximateFraction; var a = d.roundToDivide; var f = d.RendererType; var j = m.RenderingStates; var p = 200; var l = function o() { function u(N) { var E = N.container; var F = N.id; var G = N.scale; var L = N.defaultViewport; var J = N.renderingQueue; var K = N.textLayerFactory; var H = N.annotationLayerFactory; var M = N.enhanceTextSelection || false; var I = N.renderInteractiveForms || false; this.id = F; this.renderingId = "page" + F; this.pageLabel = null; this.rotation = 0; this.scale = G || h; this.viewport = L; this.pdfPageRotate = L.rotation; this.hasRestrictedScaling = false; this.enhanceTextSelection = M; this.renderInteractiveForms = I; this.eventBus = N.eventBus || k.getGlobalEventBus(); this.renderingQueue = J; this.textLayerFactory = K; this.annotationLayerFactory = H; this.renderer = N.renderer || f.CANVAS; this.paintTask = null; this.paintedViewportMap = new WeakMap(); this.renderingState = j.INITIAL; this.resume = null; this.error = null; this.onBeforeDraw = null; this.onAfterDraw = null; this.textLayer = null; this.zoomLayer = null; this.annotationLayer = null; var D = document.createElement("div"); D.className = "page"; D.style.width = Math.floor(this.viewport.width) + "px"; D.style.height = Math.floor(this.viewport.height) + "px"; D.setAttribute("data-page-number", this.id); this.div = D; E.appendChild(D) } u.prototype = { setPdfPage: function A(E) { this.pdfPage = E; this.pdfPageRotate = E.rotate; var D = (this.rotation + this.pdfPageRotate) % 360; this.viewport = E.getViewport(this.scale * n, D); this.stats = E.stats; this.reset() }, destroy: function B() { this.reset(); if (this.pdfPage) { this.pdfPage.cleanup() } }, _resetZoomLayer: function (D) { if (!this.zoomLayer) { return } var E = this.zoomLayer.firstChild; E.width = 0; E.height = 0; if (D) { this.zoomLayer.remove() } this.zoomLayer = null }, reset: function w(H, G) { this.cancelRendering(); var K = this.div; K.style.width = Math.floor(this.viewport.width) + "px"; K.style.height = Math.floor(this.viewport.height) + "px"; var J = K.childNodes; var E = H && this.zoomLayer || null; var D = G && this.annotationLayer && this.annotationLayer.div || null; for (var F = J.length - 1; F >= 0; F--) { var I = J[F]; if (E === I || D === I) { continue } K.removeChild(I) } K.removeAttribute("data-loaded"); if (D) { this.annotationLayer.hide() } else { this.annotationLayer = null } if (!E) { if (this.canvas) { this.canvas.width = 0; this.canvas.height = 0; delete this.canvas } this._resetZoomLayer() } if (this.svg) { delete this.svg } this.loadingIconDiv = document.createElement("div"); this.loadingIconDiv.className = "loadingIcon"; K.appendChild(this.loadingIconDiv) }, update: function s(G, E) { this.scale = G || this.scale; if (typeof E !== "undefined") { this.rotation = E } var F = (this.rotation + this.pdfPageRotate) % 360; this.viewport = this.viewport.clone({ scale: this.scale * n, rotation: F }); if (this.svg) { this.cssTransform(this.svg, true); this.eventBus.dispatch("pagerendered", { source: this, pageNumber: this.id, cssTransform: true }); return } var H = false; if (this.canvas && q.PDFJS.maxCanvasPixels > 0) { var D = this.outputScale; if ((Math.floor(this.viewport.width) * D.sx | 0) * (Math.floor(this.viewport.height) * D.sy | 0) > q.PDFJS.maxCanvasPixels) { H = true } } if (this.canvas) { if (q.PDFJS.useOnlyCssZoom || this.hasRestrictedScaling && H) { this.cssTransform(this.canvas, true); this.eventBus.dispatch("pagerendered", { source: this, pageNumber: this.id, cssTransform: true }); return } if (!this.zoomLayer) { this.zoomLayer = this.canvas.parentNode; this.zoomLayer.style.position = "absolute" } } if (this.zoomLayer) { this.cssTransform(this.zoomLayer.firstChild) } this.reset(true, true) }, cancelRendering: function C() { if (this.paintTask) { this.paintTask.cancel(); this.paintTask = null } this.renderingState = j.INITIAL; this.resume = null; if (this.textLayer) { this.textLayer.cancel(); this.textLayer = null } }, updatePosition: function y() { if (this.textLayer) { this.textLayer.render(p) } }, cssTransform: function x(T, E) { var M = q.CustomStyle; var N = this.viewport.width; var L = this.viewport.height; var J = this.div; T.style.width = T.parentNode.style.width = J.style.width = Math.floor(N) + "px"; T.style.height = T.parentNode.style.height = J.style.height = Math.floor(L) + "px"; var P = this.viewport.rotation - this.paintedViewportMap.get(T).rotation; var O = Math.abs(P); var R = 1, Q = 1; if (O === 90 || O === 270) { R = L / N; Q = N / L } var H = "rotate(" + P + "deg) scale(" + R + "," + Q + ")"; M.setProp("transform", T, H); if (this.textLayer) { var D = this.textLayer.viewport; var I = this.viewport.rotation - D.rotation; var K = Math.abs(I); var U = N / D.width; if (K === 90 || K === 270) { U = N / D.height } var S = this.textLayer.textLayerDiv; var G, F; switch (K) { case 0: G = F = 0; break; case 90: G = 0; F = "-" + S.style.height; break; case 180: G = "-" + S.style.width; F = "-" + S.style.height; break; case 270: G = "-" + S.style.width; F = 0; break; default: console.error("Bad rotation value."); break } M.setProp("transform", S, "rotate(" + K + "deg) scale(" + U + ", " + U + ") translate(" + G + ", " + F + ")"); M.setProp("transformOrigin", S, "0% 0%") } if (E && this.annotationLayer) { this.annotationLayer.render(this.viewport, "display") } }, get width() { return this.viewport.width }, get height() { return this.viewport.height }, getPagePoint: function t(D, E) { return this.viewport.convertToPdfPoint(D, E) }, draw: function r() { if (this.renderingState !== j.INITIAL) { console.error("Must be in new state before drawing"); this.reset() } this.renderingState = j.RUNNING; var M = this; var J = this.pdfPage; var E = this.div; var G = document.createElement("div"); G.style.width = E.style.width; G.style.height = E.style.height; G.classList.add("canvasWrapper"); if (this.annotationLayer && this.annotationLayer.div) { E.insertBefore(G, this.annotationLayer.div) } else { E.appendChild(G) } var K = null; var D = null; if (this.textLayerFactory) { K = document.createElement("div"); K.className = "textLayer"; K.style.width = G.style.width; K.style.height = G.style.height; if (this.annotationLayer && this.annotationLayer.div) { E.insertBefore(K, this.annotationLayer.div) } else { E.appendChild(K) } D = this.textLayerFactory.createTextLayerBuilder(K, this.id - 1, this.viewport, this.enhanceTextSelection) } this.textLayer = D; var H = null; if (this.renderingQueue) { H = function H(N) { if (!M.renderingQueue.isHighestPriority(M)) { M.renderingState = j.PAUSED; M.resume = function O() { M.renderingState = j.RUNNING; N() }; return } N() } } var L = function L(N) { if (F === M.paintTask) { M.paintTask = null } if (N === "cancelled" || N instanceof q.RenderingCancelledException) { M.error = null; return Promise.resolve(undefined) } M.renderingState = j.FINISHED; if (M.loadingIconDiv) { E.removeChild(M.loadingIconDiv); delete M.loadingIconDiv } M._resetZoomLayer(true); M.error = N; M.stats = J.stats; if (M.onAfterDraw) { M.onAfterDraw() } M.eventBus.dispatch("pagerendered", { source: M, pageNumber: M.id, cssTransform: false }); if (N) { return Promise.reject(N) } return Promise.resolve(undefined) }; var F = this.renderer === f.SVG ? this.paintOnSvg(G) : this.paintOnCanvas(G); F.onRenderContinue = H; this.paintTask = F; var I = F.promise.then(function () { return L(null).then(function () { if (D) { J.getTextContent({ normalizeWhitespace: true }).then(function N(O) { D.setTextContent(O); D.render(p) }) } }) }, function (N) { return L(N) }); if (this.annotationLayerFactory) { if (!this.annotationLayer) { this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder(E, J, this.renderInteractiveForms) } this.annotationLayer.render(this.viewport, "display") } E.setAttribute("data-loaded", true); if (this.onBeforeDraw) { this.onBeforeDraw() } return I }, paintOnCanvas: function (M) { var W, F; var N = new Promise(function (Z, Y) { W = Z; F = Y }); var J = { promise: N, onRenderContinue: function (Y) { Y() }, cancel: function () { I.cancel() } }; var U = this.viewport; var E = document.createElement("canvas"); E.id = "page" + this.id; E.setAttribute("hidden", "hidden"); var X = true; var V = function () { if (X) { E.removeAttribute("hidden"); X = false } }; M.appendChild(E); this.canvas = E; E.mozOpaque = true; var Q = E.getContext("2d", { alpha: false }); var H = e(Q); this.outputScale = H; if (q.PDFJS.useOnlyCssZoom) { var P = U.clone({ scale: n }); H.sx *= P.width / U.width; H.sy *= P.height / U.height; H.scaled = true } if (q.PDFJS.maxCanvasPixels > 0) { var R = U.width * U.height; var D = Math.sqrt(q.PDFJS.maxCanvasPixels / R); if (H.sx > D || H.sy > D) { H.sx = D; H.sy = D; H.scaled = true; this.hasRestrictedScaling = true } else { this.hasRestrictedScaling = false } } var T = g(H.sx); var S = g(H.sy); E.width = a(U.width * H.sx, T[0]); E.height = a(U.height * H.sy, S[0]); E.style.width = a(U.width, T[1]) + "px"; E.style.height = a(U.height, S[1]) + "px"; this.paintedViewportMap.set(E, U); var K = !H.scaled ? null : [H.sx, 0, 0, H.sy, 0, 0]; var G = { canvasContext: Q, transform: K, viewport: this.viewport, renderInteractiveForms: this.renderInteractiveForms }; var I = this.pdfPage.render(G); I.onContinue = function (Y) { V(); if (J.onRenderContinue) { J.onRenderContinue(Y) } else { Y() } }; I.promise.then(function O() { V(); W(undefined) }, function L(Y) { V(); F(Y) }); return J }, paintOnSvg: function z(K) { var H = false; var F = function () { if (H) { if (q.PDFJS.pdfjsNext) { throw new q.RenderingCancelledException("Rendering cancelled, page " + E.id, "svg") } else { throw "cancelled" } } }; var E = this; var J = this.pdfPage; var D = q.SVGGraphics; var G = this.viewport.clone({ scale: n }); var I = J.getOperatorList().then(function (L) { F(); var M = new D(J.commonObjs, J.objs); return M.getSVG(L, G).then(function (N) { F(); E.svg = N; E.paintedViewportMap.set(N, G); N.style.width = K.style.width; N.style.height = K.style.height; E.renderingState = j.FINISHED; K.appendChild(N) }) }); return { promise: I, onRenderContinue: function (L) { L() }, cancel: function () { H = true } } }, setPageLabel: function v(D) { this.pageLabel = typeof D === "string" ? D : null; if (this.pageLabel !== null) { this.div.setAttribute("data-page-label", this.pageLabel) } else { this.div.removeAttribute("data-page-label") } } }; return u }(); i.PDFPageView = l }), (function (c, e, b) { var d = b(0); var k = d.normalizeWheelEventDelta; var g = 1500; var h = 3000; var i = "pdfPresentationMode"; var j = "pdfPresentationModeControls"; var a = function f() { function p(H) { this.container = H.container; this.viewer = H.viewer || H.container.firstElementChild; this.pdfViewer = H.pdfViewer; this.eventBus = H.eventBus; var J = H.contextMenuItems || null; this.active = false; this.args = null; this.contextMenuOpen = false; this.mouseScrollTimeStamp = 0; this.mouseScrollDelta = 0; this.touchSwipeState = null; if (J) { J.contextFirstPage.addEventListener("click", function G(M) { this.contextMenuOpen = false; this.eventBus.dispatch("firstpage") }.bind(this)); J.contextLastPage.addEventListener("click", function L(M) { this.contextMenuOpen = false; this.eventBus.dispatch("lastpage") }.bind(this)); J.contextPageRotateCw.addEventListener("click", function K(M) { this.contextMenuOpen = false; this.eventBus.dispatch("rotatecw") }.bind(this)); J.contextPageRotateCcw.addEventListener("click", function I(M) { this.contextMenuOpen = false; this.eventBus.dispatch("rotateccw") }.bind(this)) } } p.prototype = { request: function v() { if (this.switchInProgress || this.active || !this.viewer.hasChildNodes()) { return false } this._addFullscreenChangeListeners(); this._setSwitchInProgress(); this._notifyStateChange(); if (this.container.requestFullscreen) { this.container.requestFullscreen() } else { if (this.container.mozRequestFullScreen) { this.container.mozRequestFullScreen() } else { if (this.container.webkitRequestFullscreen) { this.container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) } else { if (this.container.msRequestFullscreen) { this.container.msRequestFullscreen() } else { return false } } } } this.args = { page: this.pdfViewer.currentPageNumber, previousScale: this.pdfViewer.currentScaleValue }; return true }, _mouseWheel: function A(H) { H.preventDefault(); var N = k(H); var G = 50; var K = 0.1; var J = new Date().getTime(); var M = this.mouseScrollTimeStamp; if (J > M && J - M < G) { return } if (this.mouseScrollDelta > 0 && N < 0 || this.mouseScrollDelta < 0 && N > 0) { this._resetMouseScrollState() } this.mouseScrollDelta += N; if (Math.abs(this.mouseScrollDelta) >= K) { var I = this.mouseScrollDelta; this._resetMouseScrollState(); var L = I > 0 ? this._goToPreviousPage() : this._goToNextPage(); if (L) { this.mouseScrollTimeStamp = J } } }, get isFullscreen() { return !!(document.fullscreenElement || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement) }, _goToPreviousPage: function s() { var G = this.pdfViewer.currentPageNumber; if (G <= 1) { return false } this.pdfViewer.scrollPageIntoView({ pageNumber: G - 1 }); return true }, _goToNextPage: function x() { var G = this.pdfViewer.currentPageNumber; if (G >= this.pdfViewer.pagesCount) { return false } this.pdfViewer.scrollPageIntoView({ pageNumber: G + 1 }); return true }, _notifyStateChange: function u() { this.eventBus.dispatch("presentationmodechanged", { source: this, active: this.active, switchInProgress: !!this.switchInProgress }) }, _setSwitchInProgress: function z() { if (this.switchInProgress) { clearTimeout(this.switchInProgress) } this.switchInProgress = setTimeout(function G() { this._removeFullscreenChangeListeners(); delete this.switchInProgress; this._notifyStateChange() }.bind(this), g) }, _resetSwitchInProgress: function o() { if (this.switchInProgress) { clearTimeout(this.switchInProgress); delete this.switchInProgress } }, _enter: function w() { this.active = true; this._resetSwitchInProgress(); this._notifyStateChange(); this.container.classList.add(i); setTimeout(function G() { this.pdfViewer.currentPageNumber = this.args.page; this.pdfViewer.currentScaleValue = "page-fit" }.bind(this), 0); this._addWindowListeners(); this._showControls(); this.contextMenuOpen = false; this.container.setAttribute("contextmenu", "viewerContextMenu"); window.getSelection().removeAllRanges() }, _exit: function F() { var H = this.pdfViewer.currentPageNumber; this.container.classList.remove(i); setTimeout(function G() { this.active = false; this._removeFullscreenChangeListeners(); this._notifyStateChange(); this.pdfViewer.currentScaleValue = this.args.previousScale; this.pdfViewer.scrollPageIntoView({ pageNumber: H }); lastLoadTime = 0; this.args = null }.bind(this), 0); this._removeWindowListeners(); this._hideControls(); this._resetMouseScrollState(); this.container.removeAttribute("contextmenu"); this.contextMenuOpen = false }, _mouseDown: function C(G) { if (this.contextMenuOpen) { this.contextMenuOpen = false; G.preventDefault(); return } if (G.button === 0) { var H = G.target.href && G.target.classList.contains("internalLink"); if (!H) { G.preventDefault(); this.pdfViewer.currentPageNumber += G.shiftKey ? -1 : 1 } } }, _contextMenu: function D() { this.contextMenuOpen = true }, _showControls: function l() { if (this.controlsTimeout) { clearTimeout(this.controlsTimeout) } else { this.container.classList.add(j) } this.controlsTimeout = setTimeout(function G() { this.container.classList.remove(j); delete this.controlsTimeout }.bind(this), h) }, _hideControls: function q() { if (!this.controlsTimeout) { return } clearTimeout(this.controlsTimeout); this.container.classList.remove(j); delete this.controlsTimeout }, _resetMouseScrollState: function n() { this.mouseScrollTimeStamp = 0; this.mouseScrollDelta = 0 }, _touchSwipe: function E(J) { if (!this.active) { return } var I = 50; var G = Math.PI / 6; if (J.touches.length > 1) { this.touchSwipeState = null; return } switch (J.type) { case "touchstart": this.touchSwipeState = { startX: J.touches[0].pageX, startY: J.touches[0].pageY, endX: J.touches[0].pageX, endY: J.touches[0].pageY }; break; case "touchmove": if (this.touchSwipeState === null) { return } this.touchSwipeState.endX = J.touches[0].pageX; this.touchSwipeState.endY = J.touches[0].pageY; J.preventDefault(); break; case "touchend": if (this.touchSwipeState === null) { return } var M = 0; var K = this.touchSwipeState.endX - this.touchSwipeState.startX; var H = this.touchSwipeState.endY - this.touchSwipeState.startY; var L = Math.abs(Math.atan2(H, K)); if (Math.abs(K) > I && (L <= G || L >= Math.PI - G)) { M = K } else { if (Math.abs(H) > I && Math.abs(L - Math.PI / 2) <= G) { M = H } } if (M > 0) { this._goToPreviousPage() } else { if (M < 0) { this._goToNextPage() } } break } }, _addWindowListeners: function t() { this.showControlsBind = this._showControls.bind(this); this.mouseDownBind = this._mouseDown.bind(this); this.mouseWheelBind = this._mouseWheel.bind(this); this.resetMouseScrollStateBind = this._resetMouseScrollState.bind(this); this.contextMenuBind = this._contextMenu.bind(this); this.touchSwipeBind = this._touchSwipe.bind(this); window.addEventListener("mousemove", this.showControlsBind); window.addEventListener("mousedown", this.mouseDownBind); window.addEventListener("wheel", this.mouseWheelBind); window.addEventListener("keydown", this.resetMouseScrollStateBind); window.addEventListener("contextmenu", this.contextMenuBind); window.addEventListener("touchstart", this.touchSwipeBind); window.addEventListener("touchmove", this.touchSwipeBind); window.addEventListener("touchend", this.touchSwipeBind) }, _removeWindowListeners: function m() { window.removeEventListener("mousemove", this.showControlsBind); window.removeEventListener("mousedown", this.mouseDownBind); window.removeEventListener("wheel", this.mouseWheelBind); window.removeEventListener("keydown", this.resetMouseScrollStateBind); window.removeEventListener("contextmenu", this.contextMenuBind); window.removeEventListener("touchstart", this.touchSwipeBind); window.removeEventListener("touchmove", this.touchSwipeBind); window.removeEventListener("touchend", this.touchSwipeBind); delete this.showControlsBind; delete this.mouseDownBind; delete this.mouseWheelBind; delete this.resetMouseScrollStateBind; delete this.contextMenuBind; delete this.touchSwipeBind }, _fullscreenChange: function B() { if (this.isFullscreen) { this._enter() } else { this._exit() } }, _addFullscreenChangeListeners: function y() { this.fullscreenChangeBind = this._fullscreenChange.bind(this); window.addEventListener("fullscreenchange", this.fullscreenChangeBind); window.addEventListener("mozfullscreenchange", this.fullscreenChangeBind); window.addEventListener("webkitfullscreenchange", this.fullscreenChangeBind); window.addEventListener("MSFullscreenChange", this.fullscreenChangeBind) }, _removeFullscreenChangeListeners: function r() { window.removeEventListener("fullscreenchange", this.fullscreenChangeBind); window.removeEventListener("mozfullscreenchange", this.fullscreenChangeBind); window.removeEventListener("webkitfullscreenchange", this.fullscreenChangeBind); window.removeEventListener("MSFullscreenChange", this.fullscreenChangeBind); delete this.fullscreenChangeBind } }; return p }(); e.PDFPresentationMode = a }), (function (b, d, a) { var f = a(3); var c = a(0); var e = f.RenderingStates; var j = c.mozL10n; var k = "pdfSidebarNotification"; var g = { NONE: 0, THUMBS: 1, OUTLINE: 2, ATTACHMENTS: 3 }; var h = function i() { function t(w) { this.isOpen = false; this.active = g.THUMBS; this.isInitialViewSet = false; this.onToggled = null; this.pdfViewer = w.pdfViewer; this.pdfOutlineViewer = w.pdfOutlineViewer; this.mainContainer = w.mainContainer; this.outerContainer = w.outerContainer; this.eventBus = w.eventBus; this.toggleButton = w.toggleButton; this.outlineButton = w.outlineButton; this.attachmentsButton = w.attachmentsButton; this.thumbnailView = w.thumbnailView; this.outlineView = w.outlineView; this.attachmentsView = w.attachmentsView; this.disableNotification = w.disableNotification || false; this._addEventListeners() } t.prototype = { reset: function u() { this.isInitialViewSet = false; this._hideUINotification(null); this.switchView(g.THUMBS); this.outlineButton.disabled = false; this.attachmentsButton.disabled = false }, get visibleView() { return this.isOpen ? this.active : g.NONE }, get isThumbnailViewVisible() { return this.isOpen && this.active === g.THUMBS }, get isOutlineViewVisible() { return this.isOpen && this.active === g.OUTLINE }, get isAttachmentsViewVisible() { return this.isOpen && this.active === g.ATTACHMENTS }, setInitialView: function m(w) { if (this.isInitialViewSet) { return } this.isInitialViewSet = true; if (this.isOpen && w === g.NONE) { this._dispatchEvent(); return } var x = w === this.visibleView; this.switchView(w, true); if (x) { this._dispatchEvent() } }, switchView: function v(w, y) { if (w === g.NONE) { this.close(); return } var x = w !== this.active; var z = false; switch (w) { case g.THUMBS: this.outlineButton.classList.remove("toggled"); this.outlineView.classList.add("hidden"); if (this.isOpen && x) { this._updateThumbnailViewer(); z = true } break; case g.OUTLINE: if (this.outlineButton.disabled) { return } this.outlineButton.classList.add("toggled"); this.outlineView.classList.remove("hidden"); break; case g.ATTACHMENTS: if (this.attachmentsButton.disabled) { return } this.outlineButton.classList.remove("toggled"); this.outlineView.classList.add("hidden"); break; default: console.error('PDFSidebar_switchView: "' + w + '" is an unsupported value.'); return } this.active = w | 0; if (y && !this.isOpen) { this.open(); return } if (z) { this._forceRendering() } if (x) { this._dispatchEvent() } this._hideUINotification(this.active) }, open: function s() { if (this.isOpen) { return } this.isOpen = true; this.toggleButton.classList.add("toggled"); this.outerContainer.classList.add("sidebarMoving"); this.outerContainer.classList.add("sidebarOpen"); if (this.active === g.THUMBS) { this._updateThumbnailViewer() } this._forceRendering(); this._dispatchEvent(); this._hideUINotification(this.active) }, close: function l() { if (!this.isOpen) { return } this.isOpen = false; this.toggleButton.classList.remove("toggled"); this.outerContainer.classList.add("sidebarMoving"); this.outerContainer.classList.remove("sidebarOpen"); this._forceRendering(); this._dispatchEvent() }, toggle: function p() { if (this.isOpen) { this.close() } else { this.open() } }, _dispatchEvent: function o() { this.eventBus.dispatch("sidebarviewchanged", { source: this, view: this.visibleView }) }, _forceRendering: function n() { if (this.onToggled) { this.onToggled() } else { this.pdfViewer.forceRendering(); this.outlineView.forceRendering() } }, _updateThumbnailViewer: function r() {}, _showUINotification: function (w) {}, _hideUINotification: function (w) { if (this.disableNotification) { return } var x = function (y) { switch (y) { case g.OUTLINE: this.outlineButton.classList.remove(k); break; case g.ATTACHMENTS: this.attachmentsButton.classList.remove(k); break } }.bind(this); if (!this.isOpen && w !== null) { return } this.toggleButton.classList.remove(k); if (w !== null) { x(w); return } for (w in g) { x(g[w]) } this.toggleButton.title = j.get("toggle_sidebar.title", null, "Toggle Sidebar") }, _addEventListeners: function q() { var w = this; w.mainContainer.addEventListener("transitionend", function (x) { if (x.target === this) { w.outerContainer.classList.remove("sidebarMoving") } }) } }; return t }(); d.SidebarView = g; d.PDFSidebar = h }), (function (c, f, b) { var d = b(0); var h = b(3); var l = d.mozL10n; var e = d.getOutputScale; var g = h.RenderingStates; var i = 98; var j = 1; var k = function a() { function n(z, x) { var A = v.tempImageCache; if (!A) { A = document.createElement("canvas"); v.tempImageCache = A } A.width = z; A.height = x; A.mozOpaque = true; var y = A.getContext("2d", { alpha: false }); y.save(); y.fillStyle = "rgb(255, 255, 255)"; y.fillRect(0, 0, z, x); y.restore(); return A } function v(I) { var y = I.container; var z = I.id; var H = I.defaultViewport; var E = I.linkService; var G = I.renderingQueue; var B = I.disableCanvasToImageConversion || false; this.id = z; this.renderingId = "thumbnail" + z; this.pageLabel = null; this.pdfPage = null; this.rotation = 0; this.viewport = H; this.pdfPageRotate = H.rotation; this.linkService = E; this.renderingQueue = G; this.renderTask = null; this.renderingState = g.INITIAL; this.resume = null; this.disableCanvasToImageConversion = B; this.pageWidth = this.viewport.width; this.pageHeight = this.viewport.height; this.pageRatio = this.pageWidth / this.pageHeight; this.canvasWidth = i; this.canvasHeight = this.canvasWidth / this.pageRatio | 0; this.scale = this.canvasWidth / this.pageWidth; var F = document.createElement("a"); F.href = "#"; F.title = l.get("thumb_page_title", { page: z }, "Page {{page}}"); F.onclick = function C() { E.pdfViewer.scrollPageIntoView({ pageNumber: z }); return false }; this.anchor = F; var x = document.createElement("div"); x.className = "thumbnail"; x.setAttribute("data-page-number", this.id); this.div = x; if (z === 1) { x.classList.add("selected") } var D = document.createElement("div"); D.className = "thumbnailSelectionRing"; var A = 2 * j; D.style.width = this.canvasWidth + A + "px"; D.style.height = this.canvasHeight + A + "px"; this.ring = D; x.appendChild(D); F.appendChild(x); y.appendChild(F) } v.prototype = { setPdfPage: function s(y) { this.pdfPage = y; this.pdfPageRotate = y.rotate; var x = (this.rotation + this.pdfPageRotate) % 360; this.viewport = y.getViewport(1, x); this.reset() }, reset: function m() { this.cancelRendering(); this.pageWidth = this.viewport.width; this.pageHeight = this.viewport.height; this.pageRatio = this.pageWidth / this.pageHeight; this.canvasHeight = this.canvasWidth / this.pageRatio | 0; this.scale = this.canvasWidth / this.pageWidth; this.div.removeAttribute("data-loaded"); var y = this.ring; var A = y.childNodes; for (var z = A.length - 1; z >= 0; z--) { y.removeChild(A[z]) } var x = 2 * j; y.style.width = this.canvasWidth + x + "px"; y.style.height = this.canvasHeight + x + "px"; if (this.canvas) { this.canvas.width = 0; this.canvas.height = 0; delete this.canvas } if (this.image) { this.image.removeAttribute("src"); delete this.image } }, update: function w(x) { if (typeof x !== "undefined") { this.rotation = x } var y = (this.rotation + this.pdfPageRotate) % 360; this.viewport = this.viewport.clone({ scale: 1, rotation: y }); this.reset() }, cancelRendering: function u() { if (this.renderTask) { this.renderTask.cancel(); this.renderTask = null } this.renderingState = g.INITIAL; this.resume = null }, _getPageDrawContext: function o(A) { var z = document.createElement("canvas"); this.canvas = z; z.mozOpaque = true; var x = z.getContext("2d", { alpha: false }); var y = e(x); z.width = this.canvasWidth * y.sx | 0; z.height = this.canvasHeight * y.sy | 0; z.style.width = this.canvasWidth + "px"; z.style.height = this.canvasHeight + "px"; if (!A && y.scaled) { x.scale(y.sx, y.sy) } return x }, _convertCanvasToImage: function p() { if (this.ring.hasChildNodes()) { return } var D = this.renderingId; var A = "thumbnailImage"; var y = l.get("thumb_page_canvas", { page: this.pageId }, "Thumbnail of Page {{page}}"); var C = document.createElement("img"); C.id = D; C.className = A; C.setAttribute("aria-label", y); var z = this.canvasWidth; var x = this.canvasHeight; var B = (this.rotation + this.pdfPageRotate) % 360; if (B % 180 !== 0) { z = this.canvasHeight; x = this.canvasWidth; if (z < x) { C.style.marginTop = "-14px"; C.style.marginLeft = "14px" } else { C.style.marginTop = "20px"; C.style.marginLeft = "-20px" } } C.style.transform = "rotate(" + B + "deg)"; C.style.width = z + "px"; C.style.height = x + "px"; this.image = C; this.div.setAttribute("data-loaded", true); this.ring.appendChild(C) }, draw: function q() { if (this.renderingState !== g.INITIAL) { console.error("Must be in new state before drawing"); return Promise.resolve(undefined) } this.renderingState = g.RUNNING; var x, y; var z = new Promise(function (B, A) { x = B; y = A }); this._convertCanvasToImage(); return z }, setImage: function t(A) { if (this.renderingState !== g.INITIAL) { return } var B = A.canvas; if (!B) { return } if (!this.pdfPage) { this.setPdfPage(A.pdfPage) } this.renderingState = g.FINISHED; var F = this._getPageDrawContext(true); var y = F.canvas; if (B.width <= 2 * y.width) { F.drawImage(B, 0, 0, B.width, B.height, 0, 0, y.width, y.height); this._convertCanvasToImage(); return } var z = 3; var E = y.width << z; var D = y.height << z; var x = n(E, D); var C = x.getContext("2d"); while (E > B.width || D > B.height) { E >>= 1; D >>= 1 } C.drawImage(B, 0, 0, B.width, B.height, 0, 0, E, D); while (E > 2 * y.width) { C.drawImage(x, 0, 0, E, D, 0, 0, E >> 1, D >> 1); E >>= 1; D >>= 1 } F.drawImage(x, 0, 0, E, D, 0, 0, y.width, y.height); this._convertCanvasToImage() }, get pageId() { return this.pageLabel !== null ? this.pageLabel : this.id }, setPageLabel: function r(y) { this.pageLabel = typeof y === "string" ? y : null; this.anchor.title = l.get("thumb_page_title", { page: this.pageId }, "Page {{page}}"); if (this.renderingState !== g.FINISHED) { return } var x = l.get("thumb_page_canvas", { page: this.pageId }, "Thumbnail of Page {{page}}"); if (this.image) { this.image.setAttribute("aria-label", x) } else { if (this.disableCanvasToImageConversion && this.canvas) { this.canvas.setAttribute("aria-label", x) } } } }; return v }(); k.tempImageCache = null; f.PDFThumbnailView = k }), (function (c, g, b) { var e = b(0); var i = b(23); var j = e.watchScroll; var l = e.getVisibleElements; var d = e.scrollIntoView; var k = i.PDFThumbnailView; var h = -19; var a = function f() { function m(w) { this.container = w.container; this.renderingQueue = w.renderingQueue; this.linkService = w.linkService; this.scroll = j(this.container, this._scrollUpdated.bind(this)); this._resetView() } m.prototype = { _scrollUpdated: function o() { this.renderingQueue.renderHighestPriority() }, getThumbnail: function v(w) { return this.thumbnails[w] }, _getVisibleThumbs: function t() { return l(this.container, this.thumbnails) }, scrollThumbnailIntoView: function u(A) { var y = document.querySelector(".thumbnail.selected"); if (y) { y.classList.remove("selected") } var C = document.querySelector('div.thumbnail[data-page-number="' + A + '"]'); if (C) { C.classList.add("selected") } var x = this._getVisibleThumbs(); var w = x.views.length; if (w > 0) { var B = x.first.id; var z = w > 1 ? x.last.id : B; if (A <= B || A >= z) { d(C, { top: h }) } } }, get pagesRotation() { return this._pagesRotation }, set pagesRotation(z) { this._pagesRotation = z; for (var y = 0, w = this.thumbnails.length; y < w; y++) { var x = this.thumbnails[y]; x.update(z) } }, cleanup: function q() { var w = k.tempImageCache; if (w) { w.width = 0; w.height = 0 } k.tempImageCache = null }, _resetView: function r() { this.thumbnails = []; this._pageLabels = null; this._pagesRotation = 0; this._pagesRequests = []; this.container.textContent = "" }, setDocument: function p(w) { if (this.pdfDocument) { this._cancelRendering(); this._resetView() } this.pdfDocument = w; if (!w) { return Promise.resolve() } return w.getPage(1).then(function (A) { var z = w.numPages; var x = A.getViewport(1); for (var y = 1; y <= z; ++y) { var B = new k({ container: this.container, id: y, defaultViewport: x.clone(), linkService: this.linkService, renderingQueue: this.renderingQueue, disableCanvasToImageConversion: false }); this.thumbnails.push(B) } }.bind(this)) }, _cancelRendering: function s() { for (var w = 0, x = this.thumbnails.length; w < x; w++) { if (this.thumbnails[w]) { this.thumbnails[w].cancelRendering() } } }, setPageLabels: function n(A) { if (!this.pdfDocument) { return } if (!A) { this._pageLabels = null } else { if (!(A instanceof Array && this.pdfDocument.numPages === A.length)) { this._pageLabels = null; console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.") } else { this._pageLabels = A } } for (var x = 0, y = this.thumbnails.length; x < y; x++) { var z = this.thumbnails[x]; var w = this._pageLabels && this._pageLabels[x]; z.setPageLabel(w) } }, forceRendering: function () { var w = this._getVisibleThumbs().views; for (var x = 0; x < w.length; x++) { w[x].view._convertCanvasToImage() } return false } }; return m }(); g.PDFThumbnailViewer = a }), (function (e, D, g) { var o = g(0); var x = g(20); var l = g(3); var C = g(27); var m = g(10); var u = g(5); var c = g(2); var h = g(1); var k = o.UNKNOWN_SCALE; var b = o.SCROLLBAR_PADDING; var B = o.VERTICAL_PADDING; var t = o.MAX_AUTO_SCALE; var s = o.CSS_UNITS; var p = o.DEFAULT_SCALE; var d = o.DEFAULT_SCALE_VALUE; var A = o.RendererType; var f = o.scrollIntoView; var n = o.watchScroll; var r = o.getVisibleElements; var z = x.PDFPageView; var i = l.RenderingStates; var a = l.PDFRenderingQueue; var F = C.TextLayerBuilder; var j = m.AnnotationLayerBuilder; var y = u.SimpleLinkService; var q = { UNKNOWN: 0, NORMAL: 1, CHANGING: 2, FULLSCREEN: 3 }; var w = 5; var E = function v() { function H(T) { var U = []; this.push = function V(W) { var X = U.indexOf(W); if (X >= 0) { U.splice(X, 1) } U.push(W); if (U.length > T) { U.shift().destroy() } }; this.resize = function (W) { T = W; while (U.length > T) { U.shift().destroy() } } } function I(T, U) { if (U === T) { return true } if (Math.abs(U - T) < 1e-15) { return true } return false } function K(T) { return T.width <= T.height } function S(T) { this.container = T.container; this.viewer = T.viewer || T.container.firstElementChild; this.eventBus = T.eventBus || c.getGlobalEventBus(); this.linkService = T.linkService || new y(); this.downloadManager = T.downloadManager || null; this.removePageBorders = T.removePageBorders || false; this.enhanceTextSelection = T.enhanceTextSelection || false; this.renderInteractiveForms = T.renderInteractiveForms || false; this.enablePrintAutoRotate = T.enablePrintAutoRotate || false; this.renderer = T.renderer || A.CANVAS; this.defaultRenderingQueue = !T.renderingQueue; if (this.defaultRenderingQueue) { this.renderingQueue = new a(); this.renderingQueue.setViewer(this) } else { this.renderingQueue = T.renderingQueue } this.scroll = n(this.container, this._scrollUpdate.bind(this)); this.presentationModeState = q.UNKNOWN; this._resetView(); if (this.removePageBorders) { this.viewer.classList.add("removePageBorders") } } S.prototype = { get pagesCount() { return this._pages.length }, getPageView: function (T) { return this._pages[T] }, get pageViewsReady() { return this._pageViewsReady }, get currentPageNumber() { return this._currentPageNumber }, set currentPageNumber(T) { if ((T | 0) !== T) { throw new Error("Invalid page number.") } if (!this.pdfDocument) { this._currentPageNumber = T; return } this._setCurrentPageNumber(T, true) }, _setCurrentPageNumber: function J(V, U) { if (this._currentPageNumber === V) { if (U) { this._resetCurrentPageView() } return } if (!(0 < V && V <= this.pagesCount)) { console.error('PDFViewer_setCurrentPageNumber: "' + V + '" is out of bounds.'); return } var T = { source: this, pageNumber: V, pageLabel: this._pageLabels && this._pageLabels[V - 1] }; this._currentPageNumber = V; this.eventBus.dispatch("pagechanging", T); this.eventBus.dispatch("pagechange", T); if (U) { this._resetCurrentPageView() } }, get currentPageLabel() { return this._pageLabels && this._pageLabels[this._currentPageNumber - 1] }, set currentPageLabel(V) { var T = V | 0; if (this._pageLabels) { var U = this._pageLabels.indexOf(V); if (U >= 0) { T = U + 1 } } this.currentPageNumber = T }, get currentScale() { return this._currentScale !== k ? this._currentScale : p }, set currentScale(T) { if (isNaN(T)) { throw new Error("Invalid numeric scale") } if (!this.pdfDocument) { this._currentScale = T; this._currentScaleValue = T !== k ? T.toString() : null; return } this._setScale(T, false) }, get currentScaleValue() { return this._currentScaleValue }, set currentScaleValue(T) { this._setScale(T, false) }, get pagesRotation() { return this._pagesRotation }, set pagesRotation(V) { if (!(typeof V === "number" && V % 90 === 0)) { throw new Error("Invalid pages rotation angle.") } this._pagesRotation = V; for (var U = 0, T = this._pages.length; U < T; U++) { var W = this._pages[U]; W.update(W.scale, V) } this._setScale(this._currentScaleValue, true); if (this.defaultRenderingQueue) { this.update() } }, setDocument: function (W) { if (this.pdfDocument) { this._cancelRendering(); this._resetView() } this.pdfDocument = W; if (!W) { return } var T = W.numPages; var ab = this; var Z; var aa = new Promise(function (ad) { Z = ad }); this.pagesPromise = aa; aa.then(function () { ab._pageViewsReady = true; ab.eventBus.dispatch("pagesloaded", { source: ab, pagesCount: T }) }); var ac = false; var Y = null; var V = new Promise(function (ad) { Y = ad }); this.onePageRendered = V; var X = function (af) { af.onBeforeDraw = function ad() { ab._buffer.push(this) }; af.onAfterDraw = function ae() { if (!ac) { ac = true; Y() } } }; var U = W.getPage(1); this.firstPagePromise = U; return U.then(function (aj) { var ai = this.currentScale; var ad = aj.getViewport(ai * s); for (var ae = 1; ae <= T; ++ae) { var ah = null; if (!h.PDFJS.disableTextLayer) { ah = this } var ag = new z({ container: this.viewer, eventBus: this.eventBus, id: ae, scale: ai, defaultViewport: ad.clone(), renderingQueue: this.renderingQueue, textLayerFactory: ah, annotationLayerFactory: this, enhanceTextSelection: this.enhanceTextSelection, renderInteractiveForms: this.renderInteractiveForms, renderer: this.renderer }); X(ag); this._pages.push(ag) } var af = this.linkService; V.then(function () { if (!h.PDFJS.disableAutoFetch) {} else { Z() } }); ab.eventBus.dispatch("pagesinit", { source: ab }); if (this.defaultRenderingQueue) { this.update() } if (this.findController) { this.findController.resolveFirstPage() } }.bind(this)) }, setPageLabels: function N(X) { if (!this.pdfDocument) { return } if (!X) { this._pageLabels = null } else { if (!(X instanceof Array && this.pdfDocument.numPages === X.length)) { this._pageLabels = null; console.error("PDFViewer_setPageLabels: Invalid page labels.") } else { this._pageLabels = X } } for (var U = 0, V = this._pages.length; U < V; U++) { var W = this._pages[U]; var T = this._pageLabels && this._pageLabels[U]; W.setPageLabel(T) } }, _resetView: function () { this._pages = []; this._currentPageNumber = 1; this._currentScale = k; this._currentScaleValue = null; this._pageLabels = null; this._buffer = new H(w); this._location = null; this._pagesRotation = 0; this._pagesRequests = []; this._pageViewsReady = false; this.viewer.textContent = "" }, _scrollUpdate: function R() { if (this.pagesCount === 0) { return } this.update(); for (var T = 0, U = this._pages.length; T < U; T++) { this._pages[T].updatePosition() } }, _setScaleDispatchEvent: function O(W, V, U) { var T = { source: this, scale: W, presetValue: U ? V : undefined }; this.eventBus.dispatch("scalechanging", T); this.eventBus.dispatch("scalechange", T) }, _setScaleUpdatePages: function G(aa, Z, Y, W) { this._currentScaleValue = Z.toString(); if (I(this._currentScale, aa)) { if (W) { this._setScaleDispatchEvent(aa, Z, true) } return } for (var U = 0, V = this._pages.length; U < V; U++) { this._pages[U].update(aa) } this._currentScale = aa; if (!Y) { var X = this._currentPageNumber, T; if (this._location && !h.PDFJS.ignoreCurrentPositionOnZoom && !(this.isInPresentationMode || this.isChangingPresentationMode)) { X = this._location.pageNumber; T = [null, { name: "XYZ" }, this._location.left, this._location.top, null ] } this.scrollPageIntoView({ pageNumber: X, destArray: T, allowNegativeOffset: true }) } this._setScaleDispatchEvent(aa, Z, W); if (this.defaultRenderingQueue) { this.update() } }, _setScale: function L(ab, V) { var T = parseFloat(ab); if (T > 0) { this._setScaleUpdatePages(T, ab, V, false) } else { var W = this._pages[this._currentPageNumber - 1]; if (!W) { return } var Z = this.isInPresentationMode || this.removePageBorders ? 0 : b; var U = this.isInPresentationMode || this.removePageBorders ? 0 : B; var Y = (this.container.clientWidth - Z) / W.width * W.scale; var aa = (this.container.clientHeight - U) / W.height * W.scale; switch (ab) { case "page-actual": T = 1; break; case "page-width": T = Y; break; case "page-height": T = aa; break; case "page-fit": T = Math.min(Y, aa); break; case "auto": var X = W.width > W.height; var ac = X ? Math.min(aa, Y) : Y; T = Math.min(t, ac); break; default: console.error('PDFViewer_setScale: "' + ab + '" is an unknown zoom value.'); return } this._setScaleUpdatePages(T, ab, V, true) } }, _resetCurrentPageView: function () { if (this.isInPresentationMode) { this._setScale(this._currentScaleValue, true) } var T = this._pages[this._currentPageNumber - 1]; f(T.div) }, scrollPageIntoView: function M(ak) { if (arguments.length > 1 || typeof ak === "number") { console.warn("Call of scrollPageIntoView() with obsolete signature."); var X = {}; if (typeof ak === "number") { X.pageNumber = ak } if (arguments[1] instanceof Array) { X.destArray = arguments[1] } ak = X } var am = ak.pageNumber || 0; var ad = ak.destArray || null; var U = ak.allowNegativeOffset || false; if (this.isInPresentationMode || !ad) { this._setCurrentPageNumber(am, true); return } var aj = this._pages[am - 1]; if (!aj) { console.error('PDFViewer_scrollPageIntoView: Invalid "pageNumber" parameter.'); return } var ae = 0, ab = 0; var ai = 0, ah = 0, Y, V; var Z = aj.rotation % 180 === 0 ? false : true; var al = (Z ? aj.height : aj.width) / aj.scale / s; var ac = (Z ? aj.width : aj.height) / aj.scale / s; var an = 0; switch (ad[1].name) { case "XYZ": ae = ad[2]; ab = ad[3]; an = ad[4]; ae = ae !== null ? ae : 0; ab = ab !== null ? ab : ac; break; case "Fit": case "FitB": an = "page-fit"; break; case "FitH": case "FitBH": ab = ad[2]; an = "page-width"; if (ab === null && this._location) { ae = this._location.left; ab = this._location.top } break; case "FitV": case "FitBV": ae = ad[2]; ai = al; ah = ac; an = "page-height"; break; case "FitR": ae = ad[2]; ab = ad[3]; ai = ad[4] - ae; ah = ad[5] - ab; var W = this.removePageBorders ? 0 : b; var T = this.removePageBorders ? 0 : B; Y = (this.container.clientWidth - W) / ai / s; V = (this.container.clientHeight - T) / ah / s; an = Math.min(Math.abs(Y), Math.abs(V)); break; default: console.error("PDFViewer_scrollPageIntoView: '" + ad[1].name + "' is not a valid destination type."); return } if (an && an !== this._currentScale) { this.currentScaleValue = an } else { if (this._currentScale === k) { this.currentScaleValue = d } } if (an === "page-fit" && !ad[4]) { f(aj.div); return } var af = [aj.viewport.convertToViewportPoint(ae, ab), aj.viewport.convertToViewportPoint(ae + ai, ab + ah)]; var aa = Math.min(af[0][0], af[1][0]); var ag = Math.min(af[0][1], af[1][1]); if (!U) { aa = Math.max(aa, 0); ag = Math.max(ag, 0) } f(aj.div, { left: aa, top: ag }) }, _updateLocation: function (aa) { var X = this._currentScale; var Y = this._currentScaleValue; var ab = parseFloat(Y) === X ? Math.round(X * 10000) / 100 : Y; var ac = aa.id; var Z = "&page=" + ac; Z += "&zoom=" + ab; var W = this._pages[ac - 1]; var T = this.container; var ad = W.getPagePoint(T.scrollLeft - aa.x, T.scrollTop - aa.y); var U = Math.round(ad[0]); var V = Math.round(ad[1]); Z += "," + U + "," + V; this._location = { pageNumber: ac, scale: ab, top: V, left: U, pdfOpenParams: Z } }, update: function Q() { var T = this._getVisiblePages(); var W = T.views; if (W.length === 0) { return } var aa = Math.max(w, 2 * W.length + 1); this._buffer.resize(aa); this.renderingQueue.renderHighestPriority(T); var Z = this._currentPageNumber; var U = T.first; for (var V = 0, ab = W.length, Y = false; V < ab; ++V) { var X = W[V]; if (X.percent < 100) { break } if (X.id === Z) { Y = true; break } } if (!Y) { Z = W[0].id } if (!this.isInPresentationMode) { this._setCurrentPageNumber(Z) } this._updateLocation(U); this.eventBus.dispatch("updateviewarea", { source: this, location: this._location }) }, containsElement: function (T) { return this.container.contains(T) }, focus: function () { this.container.focus() }, get isInPresentationMode() { return this.presentationModeState === q.FULLSCREEN }, get isChangingPresentationMode() { return this.presentationModeState === q.CHANGING }, get isHorizontalScrollbarEnabled() { return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth }, _getVisiblePages: function () { if (!this.isInPresentationMode) { return r(this.container, this._pages, true) } var U = []; var T = this._pages[this._currentPageNumber - 1]; U.push({ id: T.id, view: T }); return { first: T, last: T, views: U } }, cleanup: function () { for (var T = 0, U = this._pages.length; T < U; T++) { if (this._pages[T] && this._pages[T].renderingState !== i.FINISHED) { this._pages[T].reset() } } }, _cancelRendering: function P() { for (var T = 0, U = this._pages.length; T < U; T++) { if (this._pages[T]) { this._pages[T].cancelRendering() } } }, _ensurePdfPageLoaded: function (Z) { if (Z.pdfPage) { return Promise.resolve(Z.pdfPage) } var V = Z.id; if (this._pagesRequests[V]) { return this._pagesRequests[V] } var U = pdfUrl + V; var W = this; var T = documentCache[V - 1]; if (T !== undefined && T !== null) { var Y = T.getPage(1).then(function (aa) { if (!Z.pdfPage) { Z.setPdfPage(aa) } W._pagesRequests[V] = null; return aa }.bind(W)); W._pagesRequests[V] = Y; return Y } else { var X = h.PDFJS.getDocument(U); if (loadQueue.indexOf("," + V + ",") === -1) { loadQueue += V + "," } return X.promise.then(function (aa) { documentCache[V - 1] = aa; var ab = aa.getPage(1).then(function (ac) { if (!Z.pdfPage) { Z.setPdfPage(ac) } W._pagesRequests[V] = null; return ac }.bind(W)); W._pagesRequests[V] = ab; loadQueue = loadQueue.replace("," + V + ",", ","); return ab }) } }, forceRendering: function (T) { var Z = T || this._getVisiblePages(); var Y = this.renderingQueue.getHighestPriority(Z, this._pages, this.scroll.down); if (Y) { var W = Y.id; if (lastPageNum === -1) { lastPageNum = W } if (lastPageNum !== W) { var U = new Date(); var X = U - lastLoadTime; if (X < loadTime) { lastLoadTime = U; return } } lastLoadTime = U; if (Math.abs(W - lastPageNum) > 4) { for (var V = 0; V < W - showPages; V++) { this.clearCache(V) } for (var V = W + showPages - 1; V < pageCount; V++) { this.clearCache(V) } } if (this.scroll.down) { this.clearCache(W - showPages - 1) } else { this.clearCache(W + showPages - 1) } lastPageNum = W; if (loadQueue.indexOf("," + W + ",") > -1) { return false } this._ensurePdfPageLoaded(Y).then(function () { this.renderingQueue.renderView(Y) }.bind(this)); return true } return false }, clearCache: function (T) { if (T >= 0 && T < pageCount && lastPageNum !== T) { var U = documentCache[T]; documentCache[T] = null; if (U !== undefined && U !== null) { U.loadingTask.destroy(); U.transport.destroy(); U.destroy() } if (this._pages[T] !== undefined && this._pages[T] !== null) { var V = this._pages[T]; if (V.pdfLoadingTask) { V.pdfLoadingTask.destroy() } V.pdfLoadingTask = null; if (V.annotationLayerFactory.pdfDocument) { V.annotationLayerFactory.pdfDocument.destroy(); V.annotationLayerFactory.pdfDocument = null } if (V.textLayerFactory.pdfDocument) { V.textLayerFactory.pdfDocument.destroy(); V.textLayerFactory.pdfDocument = null } V.store = null; V.isInitialViewSet = false; if (typeof PDFBug !== "undefined") { PDFBug.cleanup() } V.annotationLayer = null; delete V.canvas; V.error = null; V.loadingIconDiv = "div.loadingIcon"; delete V.outputScale; if (V.pdfPage) { V.pdfPage.cleanup() } delete V.pdfPage; V.renderingState = 0; delete V.stats; V.textLayer = null; V.destroy() } } }, getPageTextContent: function (T) { return this.pdfDocument.getPage(T + 1).then(function (U) { return U.getTextContent({ normalizeWhitespace: true }) }) }, createTextLayerBuilder: function (W, U, T, V) { return new F({ textLayerDiv: W, eventBus: this.eventBus, pageIndex: U, viewport: T, findController: this.isInPresentationMode ? null : this.findController, enhanceTextSelection: this.isInPresentationMode ? false : V }) }, createAnnotationLayerBuilder: function (T, V, U) { return new j({ pageDiv: T, pdfPage: V, renderInteractiveForms: U, linkService: this.linkService, downloadManager: this.downloadManager }) }, setFindController: function (T) { this.findController = T }, getPagesOverview: function () { var T = this._pages.map(function (W) { var V = W.pdfPage.getViewport(1); return { width: V.width, height: V.height, rotation: V.rotation } }); if (!this.enablePrintAutoRotate) { return T } var U = K(T[0]); return T.map(function (V) { if (U === K(V)) { return V } return { width: V.height, height: V.width, rotation: (V.rotation + 90) % 360 } }) } }; return S }(); D.PresentationModeState = q; D.PDFViewer = E }), (function (d, a, g) { var c = g(0); var e = c.SCROLLBAR_PADDING; var f = c.mozL10n; var b = function h() { function n(v, u, t) { this.toolbar = v.toolbar; this.toggleButton = v.toggleButton; this.toolbarButtonContainer = v.toolbarButtonContainer; this.buttons = [{ element: v.presentationModeButton, eventName: "presentationmode", close: true }, { element: v.openFileButton, eventName: "openfile", close: true }, { element: v.printButton, eventName: "print", close: true }, { element: v.downloadButton, eventName: "download", close: true }, { element: v.viewBookmarkButton, eventName: null, close: true }, { element: v.firstPageButton, eventName: "firstpage", close: true }, { element: v.lastPageButton, eventName: "lastpage", close: true }, { element: v.pageRotateCwButton, eventName: "rotatecw", close: false }, { element: v.pageRotateCcwButton, eventName: "rotateccw", close: false }, { element: v.toggleHandToolButton, eventName: "togglehandtool", close: true }, { element: v.documentPropertiesButton, eventName: "documentproperties", close: true }]; this.items = { firstPage: v.firstPageButton, lastPage: v.lastPageButton, pageRotateCw: v.pageRotateCwButton, pageRotateCcw: v.pageRotateCcwButton }; this.mainContainer = u; this.eventBus = t; this.opened = false; this.containerHeight = null; this.previousContainerHeight = null; this.reset(); this._bindClickListeners(); this._bindHandToolListener(v.toggleHandToolButton); this.eventBus.on("resize", this._setMaxHeight.bind(this)) } n.prototype = { get isOpen() { return this.opened }, setPageNumber: function o(t) { this.pageNumber = t; this._updateUIState() }, setPagesCount: function q(t) { this.pagesCount = t; this._updateUIState() }, reset: function r() { this.pageNumber = 0; this.pagesCount = 0; this._updateUIState() }, _updateUIState: function s() { var t = this.items; t.pageRotateCw.disabled = this.pagesCount === 0; t.pageRotateCcw.disabled = this.pagesCount === 0 }, _bindClickListeners: function i() {}, _bindHandToolListener: function j(t) { var u = false; this.eventBus.on("handtoolchanged", function (v) { if (u === v.isActive) { return } u = v.isActive; if (u) { t.title = f.get("hand_tool_disable.title", null, "Disable hand tool"); t.firstElementChild.textContent = f.get("hand_tool_disable_label", null, "Disable hand tool") } else { t.title = f.get("hand_tool_enable.title", null, "Enable hand tool"); t.firstElementChild.textContent = f.get("hand_tool_enable_label", null, "Enable hand tool") } }) }, open: function p() { if (this.opened) { return } this.opened = true; this._setMaxHeight(); this.toggleButton.classList.add("toggled"); this.toolbar.classList.remove("hidden") }, close: function l() { if (!this.opened) { return } this.opened = false; this.toolbar.classList.add("hidden"); this.toggleButton.classList.remove("toggled") }, toggle: function k() { if (this.opened) { this.close() } else { this.open() } }, _setMaxHeight: function m() { if (!this.opened) { return } this.containerHeight = this.mainContainer.clientHeight; if (this.containerHeight === this.previousContainerHeight) { return } this.toolbarButtonContainer.setAttribute("style", "max-height: " + (this.containerHeight - e) + "px;"); this.previousContainerHeight = this.containerHeight } }; return n }(); a.SecondaryToolbar = b }), (function (b, e, a) { var f = a(2); var h = a(1); var c = 300; var g = function i() { function p(s) { this.textLayerDiv = s.textLayerDiv; this.eventBus = s.eventBus || f.getGlobalEventBus(); this.textContent = null; this.renderingDone = false; this.pageIdx = s.pageIndex; this.pageNumber = this.pageIdx + 1; this.matches = []; this.viewport = s.viewport; this.textDivs = []; this.findController = s.findController || null; this.textLayerRenderTask = null; this.enhanceTextSelection = s.enhanceTextSelection; this._bindMouse() } p.prototype = { _finishRendering: function n() { this.renderingDone = true; if (!this.enhanceTextSelection) { var s = document.createElement("div"); s.className = "endOfContent"; this.textLayerDiv.appendChild(s) } this.eventBus.dispatch("textlayerrendered", { source: this, pageNumber: this.pageNumber, numTextDivs: this.textDivs.length }) }, render: function o(t) { if (!this.textContent || this.renderingDone) { return } this.cancel(); this.textDivs = []; var s = document.createDocumentFragment(); this.textLayerRenderTask = h.renderTextLayer({ textContent: this.textContent, container: s, viewport: this.viewport, textDivs: this.textDivs, timeout: t, enhanceTextSelection: this.enhanceTextSelection }); this.textLayerRenderTask.promise.then(function () { this.textLayerDiv.appendChild(s); this._finishRendering(); this.updateMatches() }.bind(this), function (u) {}) }, cancel: function m() { if (this.textLayerRenderTask) { this.textLayerRenderTask.cancel(); this.textLayerRenderTask = null } }, setTextContent: function q(s) { this.cancel(); this.textContent = s }, convertMatches: function r(y, D) { var w = 0; var A = 0; var s = this.textContent.items; var v = s.length - 1; var u = this.findController === null ? 0 : this.findController.state.query.length; var B = []; if (!y) { return B } for (var t = 0, z = y.length; t < z; t++) { var C = y[t]; while (w !== v && C >= A + s[w].str.length) { A += s[w].str.length; w++ } if (w === s.length) { console.error("Could not find a matching mapping") } var x = { begin: { divIdx: w, offset: C - A } }; if (D) { C += D[t] } else { C += u } while (w !== v && C > A + s[w].str.length) { A += s[w].str.length; w++ } x.end = { divIdx: w, offset: C - A }; B.push(x) } return B }, renderMatches: function j(s) { if (s.length === 0) { return } var H = this.textContent.items; var C = this.textDivs; var u = null; var t = this.pageIdx; var E = this.findController === null ? false : t === this.findController.selected.pageIdx; var I = this.findController === null ? -1 : this.findController.selected.matchIdx; var J = this.findController === null ? false : this.findController.state.highlightAll; var M = { divIdx: -1, offset: undefined }; function L(O, N) { var P = O.divIdx; C[P].textContent = ""; w(P, 0, O.offset, N) } function w(T, O, N, Q) { var U = C[T]; var S = H[T].str.substring(O, N); var R = document.createTextNode(S); if (Q) { var P = document.createElement("span"); P.className = Q; P.appendChild(R); U.appendChild(P); return } U.appendChild(R) } var F = I, D = F + 1; if (J) { F = 0; D = s.length } else { if (!E) { return } } for (var G = F; G < D; G++) { var x = s[G]; var K = x.begin; var v = x.end; var z = E && G === I; var B = z ? " selected" : ""; if (this.findController) { this.findController.updateMatchPosition(t, G, C, K.divIdx) } if (!u || K.divIdx !== u.divIdx) { if (u !== null) { w(u.divIdx, u.offset, M.offset) } L(K) } else { w(u.divIdx, u.offset, K.offset) } if (K.divIdx === v.divIdx) { w(K.divIdx, K.offset, v.offset, "highlight" + B) } else { w(K.divIdx, K.offset, M.offset, "highlight begin" + B); for (var A = K.divIdx + 1, y = v.divIdx; A < y; A++) { C[A].className = "highlight middle" + B } L(v, "highlight end" + B) } u = v } if (u) { w(u.divIdx, u.offset, M.offset) } }, updateMatches: function k() { if (!this.renderingDone) { return } var y = this.matches; var C = this.textDivs; var t = this.textContent.items; var D = -1; for (var x = 0, A = y.length; x < A; x++) { var z = y[x]; var v = Math.max(D, z.begin.divIdx); for (var u = v, w = z.end.divIdx; u <= w; u++) { var s = C[u]; s.textContent = t[u].str; s.className = "" } D = z.end.divIdx + 1 } if (this.findController === null || !this.findController.active) { return } var E, B; if (this.findController !== null) { E = this.findController.pageMatches[this.pageIdx] || null; B = this.findController.pageMatchesLength ? this.findController.pageMatchesLength[this.pageIdx] || null : null } this.matches = this.convertMatches(E, B); this.renderMatches(this.matches) }, _bindMouse: function l() { var u = this.textLayerDiv; var t = this; var s = null; u.addEventListener("mousedown", function (y) { if (t.enhanceTextSelection && t.textLayerRenderTask) { t.textLayerRenderTask.expandTextDivs(true); if (s) { clearTimeout(s); s = null } return } var v = u.querySelector(".endOfContent"); if (!v) { return } var x = y.target !== u; x = x && window.getComputedStyle(v).getPropertyValue("-moz-user-select") !== "none"; if (x) { var z = u.getBoundingClientRect(); var w = Math.max(0, (y.pageY - z.top) / z.height); v.style.top = (w * 100).toFixed(2) + "%" } v.classList.add("active") }); u.addEventListener("mouseup", function (w) { if (t.enhanceTextSelection && t.textLayerRenderTask) { s = setTimeout(function () { if (t.textLayerRenderTask) { t.textLayerRenderTask.expandTextDivs(false) } s = null }, c); return } var v = u.querySelector(".endOfContent"); if (!v) { return } v.style.top = ""; v.classList.remove("active") }) } }; return p }(); function d() {} d.prototype = { createTextLayerBuilder: function (m, k, j, l) { return new g({ textLayerDiv: m, pageIndex: k, viewport: j, enhanceTextSelection: l }) } }; e.TextLayerBuilder = g; e.DefaultTextLayerFactory = d }), (function (f, i, e) { var g = e(0); var p = g.mozL10n; var b = g.noContextMenuHandler; var q = g.animationStarted; var m = g.localized; var d = g.DEFAULT_SCALE_VALUE; var h = g.DEFAULT_SCALE; var l = g.MIN_SCALE; var k = g.MAX_SCALE; var a = "visiblePageIsLoading"; var c = 8; var o = 22; var j = function n() { function u(z, y, x) { this.toolbar = z.container; this.mainContainer = y; this.eventBus = x; this.items = z; this._wasLocalized = false; this.reset(); this._bindListeners() } u.prototype = { setPageNumber: function (y, x) { this.pageNumber = y; this.pageLabel = x; this._updateUIState(false) }, setPagesCount: function (x, y) { this.pagesCount = x; this.hasPageLabels = y; this._updateUIState(true) }, setPageScale: function (x, y) { this.pageScaleValue = x; this.pageScale = y; this._updateUIState(false) }, reset: function () { this.pageNumber = 0; this.pageLabel = null; this.hasPageLabels = false; this.pagesCount = 0; this.pageScaleValue = d; this.pageScale = h; this._updateUIState(true) }, _bindListeners: function w() { var x = this.eventBus; var z = this; var y = this.items; y.previous.addEventListener("click", function () { x.dispatch("previouspage") }); y.next.addEventListener("click", function () { x.dispatch("nextpage") }); y.pageRotateCw.addEventListener("click", function () { x.dispatch("rotatecw") }); y.pageRotateCcw.addEventListener("click", function () { x.dispatch("rotateccw") }); y.toggleHandTool.addEventListener("click", function () { x.dispatch("togglehandtool") }); y.zoomIn.addEventListener("click", function () { x.dispatch("zoomin"); clearFitClass() }); y.zoomOut.addEventListener("click", function () { x.dispatch("zoomout"); clearFitClass() }); y.pageNumber.addEventListener("click", function () { this.select() }); y.pageNumber.addEventListener("change", function () { x.dispatch("pagenumberchanged", { source: z, value: this.value }) }); y.scaleSelect.addEventListener("change", function () { if (this.value === "custom") { return } x.dispatch("scalechanged", { source: z, value: this.value }) }); y.scaleSelect.oncontextmenu = b; m.then(this._localized.bind(this)) }, _localized: function r() { this._wasLocalized = true; this._adjustScaleWidth(); this._updateUIState(true) }, _updateUIState: function t(C) { function A(J, L) { var E = y.scaleSelect.options; var I = false; for (var F = 0, H = E.length; F < H; F++) { var G = E[F]; if (G.value !== J) { G.selected = false; continue } G.selected = true; I = true } if (!I) { var K = Math.round(L * 10000) / 100; y.customScaleOption.textContent = p.get("page_scale_percent", { scale: K }, "{{scale}}%"); y.customScaleOption.selected = true } } if (!this._wasLocalized) { return } var x = this.pageNumber; var D = (this.pageScaleValue || this.pageScale).toString(); var B = this.pageScale; var y = this.items; var z = this.pagesCount; if (C) { if (this.hasPageLabels) { y.pageNumber.type = "text" } else { y.pageNumber.type = "text"; y.numPages.textContent = p.get("of_pages", { pagesCount: z }, "of {{pagesCount}}") } y.pageNumber.max = z } if (this.hasPageLabels) { y.pageNumber.value = this.pageLabel; y.numPages.textContent = p.get("page_of_pages", { pageNumber: x, pagesCount: z }, "({{pageNumber}} of {{pagesCount}})") } else { y.pageNumber.value = x } y.previous.disabled = x <= 1; y.next.disabled = x >= z; y.zoomOut.disabled = B <= l; y.zoomIn.disabled = B >= k; A(D, B) }, updateLoadingIndicatorState: function s(y) { var x = this.items.pageNumber; if (y) { x.classList.add(a) } else { x.classList.remove(a) } }, _adjustScaleWidth: function v() { var y = this.items.scaleSelectContainer; var x = this.items.scaleSelect; q.then(function () { if (y.clientWidth === 0) { y.setAttribute("style", "display: inherit;") } if (y.clientWidth > 0) { x.setAttribute("style", "min-width: inherit;"); var z = x.clientWidth + c; x.setAttribute("style", "min-width: " + (z + o) + "px;"); y.setAttribute("style", "min-width: " + z + "px; max-width: " + z + "px;") } }) } }; return u }(); i.Toolbar = j }), (function (d, b, f) { var e = 20; var a = function c() { function g(m, n) { this.fingerprint = m; this.cacheSize = n || e; this.isInitializedPromiseResolved = false; this.initializedPromise = this._readFromStorage().then(function (o) { this.isInitializedPromiseResolved = true; var t = JSON.parse(o || "{}"); if (!("files" in t)) { t.files = [] } if (t.files.length >= this.cacheSize) { t.files.shift() } var p; for (var q = 0, s = t.files.length; q < s; q++) { var r = t.files[q]; if (r.fingerprint === this.fingerprint) { p = q; break } } if (typeof p !== "number") { p = t.files.push({ fingerprint: this.fingerprint }) - 1 } this.file = t.files[p]; this.database = t }.bind(this)) } g.prototype = { _writeToStorage: function h() { return new Promise(function (n) { var m = JSON.stringify(this.database); localStorage.setItem("pdfjs.history", m); n() }.bind(this)) }, _readFromStorage: function k() { return new Promise(function (q) { var p = localStorage.getItem("pdfjs.history"); if (!p) { var m = localStorage.getItem("database"); if (m) { try { var o = JSON.parse(m); if (typeof o.files[0].fingerprint === "string") { localStorage.setItem("pdfjs.history", m); localStorage.removeItem("database"); p = m } } catch (n) {} } } q(p) }) }, set: function j(m, n) { if (!this.isInitializedPromiseResolved) { return } this.file[m] = n; return this._writeToStorage() }, setMultiple: function i(n) { if (!this.isInitializedPromiseResolved) { return } for (var m in n) { this.file[m] = n[m] } return this._writeToStorage() }, get: function l(n, m) { if (!this.isInitializedPromiseResolved) { return m } return this.file[n] || m } }; return g }(); b.ViewHistory = a }), (function (c, b, e) { var a; a = e(6); e(9); function d() { return { appContainer: document.body, mainContainer: document.getElementById("viewerContainer"), viewerContainer: document.getElementById("viewer"), eventBus: null, toolbar: { container: document.getElementById("toolbarViewer"), numPages: document.getElementById("numPages"), pageNumber: document.getElementById("pageNumber"), scaleSelectContainer: document.getElementById("scaleSelectContainer"), scaleSelect: document.getElementById("scaleSelect"), customScaleOption: document.getElementById("customScaleOption"), previous: document.getElementById("previous"), next: document.getElementById("next"), firstPage: document.getElementById("firstPage"), lastPage: document.getElementById("lastPage"), pageRotateCw: document.getElementById("pageRotateCw"), pageRotateCcw: document.getElementById("pageRotateCcw"), toggleHandTool: document.getElementById("toggleHandTool"), zoomIn: document.getElementById("zoomIn"), zoomOut: document.getElementById("zoomOut"), viewFind: document.getElementById("viewFind"), openFile: document.getElementById("openFile"), print: document.getElementById("print"), presentationModeButton: document.getElementById("presentationMode"), download: document.getElementById("download") }, secondaryToolbar: { toolbar: document.getElementById("secondaryToolbar"), toggleButton: document.getElementById("secondaryToolbarToggle"), toolbarButtonContainer: document.getElementById("secondaryToolbarButtonContainer"), presentationModeButton: document.getElementById("secondaryPresentationMode"), openFileButton: document.getElementById("secondaryOpenFile"), printButton: document.getElementById("secondaryPrint"), downloadButton: document.getElementById("secondaryDownload"), firstPageButton: document.getElementById("firstPage"), lastPageButton: document.getElementById("lastPage"), pageRotateCwButton: document.getElementById("pageRotateCw"), pageRotateCcwButton: document.getElementById("pageRotateCcw"), toggleHandToolButton: document.getElementById("toggleHandTool"), documentPropertiesButton: document.getElementById("documentProperties") }, fullscreen: { contextFirstPage: document.getElementById("contextFirstPage"), contextLastPage: document.getElementById("contextLastPage"), contextPageRotateCw: document.getElementById("contextPageRotateCw"), contextPageRotateCcw: document.getElementById("contextPageRotateCcw") }, sidebar: { mainContainer: document.getElementById("mainContainer"), outerContainer: document.getElementById("outerContainer"), toggleButton: document.getElementById("sidebarToggle"), outlineButton: document.getElementById("viewOutline"), attachmentsButton: document.getElementById("viewAttachments"), thumbnailView: document.getElementById("thumbnailView"), outlineView: document.getElementById("outlineView"), attachmentsView: document.getElementById("attachmentsView") }, findBar: { bar: document.getElementById("findbar"), toggleButton: document.getElementById("viewFind"), findField: document.getElementById("findInput"), highlightAllCheckbox: document.getElementById("findHighlightAll"), caseSensitiveCheckbox: document.getElementById("findMatchCase"), findMsg: document.getElementById("findMsg"), findResultsCount: document.getElementById("findResultsCount"), findStatusIcon: document.getElementById("findStatusIcon"), findPreviousButton: document.getElementById("findPrevious"), findNextButton: document.getElementById("findNext") }, passwordOverlay: { overlayName: "passwordOverlay", container: document.getElementById("passwordOverlay"), label: document.getElementById("passwordText"), input: document.getElementById("password"), submitButton: document.getElementById("passwordSubmit"), cancelButton: document.getElementById("passwordCancel") }, documentProperties: { overlayName: "documentPropertiesOverlay", container: document.getElementById("documentPropertiesOverlay"), closeButton: document.getElementById("documentPropertiesClose"), fields: { fileName: document.getElementById("fileNameField"), fileSize: document.getElementById("fileSizeField"), title: document.getElementById("titleField"), author: document.getElementById("authorField"), subject: document.getElementById("subjectField"), keywords: document.getElementById("keywordsField"), creationDate: document.getElementById("creationDateField"), modificationDate: document.getElementById("modificationDateField"), creator: document.getElementById("creatorField"), producer: document.getElementById("producerField"), version: document.getElementById("versionField"), pageCount: document.getElementById("pageCountField") } }, errorWrapper: { container: document.getElementById("errorWrapper"), errorMessage: document.getElementById("errorMessage"), closeButton: document.getElementById("errorClose"), errorMoreInfo: document.getElementById("errorMoreInfo"), moreInfoButton: document.getElementById("errorShowMore"), lessInfoButton: document.getElementById("errorShowLess") }, printContainer: document.getElementById("printContainer"), openFileInputName: "fileInput", defaultUrl: DEFAULT_URL } } function g(m) { var n = m.split("&"); var p = {}; for (var j = 0, k = n.length; j < k; ++j) { var o = n[j].split("="); var h = o[0].toLowerCase(); var l = o.length > 1 ? o[1] : null; p[decodeURIComponent(h)] = decodeURIComponent(l) } return p } function f() { return ajax(pageUrl).then(function (k) { var j = k.responseText; if (j !== null && j !== "") { var h = JSON.parse(j); if (h.result === 1) { pageCount = h.totalPage } if (pageCount > 0) { DEFAULT_URL = pdfUrl + 1; documentCache = new Array(pageCount); var i = d(); window.PDFViewerApplication = a.PDFViewerApplication; a.PDFViewerApplication.run(i) } } }, function (h) { console.log(h) }) } if (document.readyState === "interactive" || document.readyState === "complete") { f() } else { document.addEventListener("DOMContentLoaded", f, true) } })]); function ajax(a, d, b) { if (!d) { d = "GET" } var c = new XMLHttpRequest(); return new Promise(function (f, e) { c.onreadystatechange = function () { if (c.readyState === 4) { if (c.status === 200) { f(c) } else { e(c.status) } } }; c.open(d, a); c.send(b) }) };
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de