ngx-extended-pdf-viewer
Version:
Embedding PDF files in your Angular application. Highly configurable viewer including the toolbar, sidebar, and all the features you're used to.
21 lines • 338 kB
JavaScript
/**
* @licstart The following is the entire license notice for the
* JavaScript code in this page
*
* Copyright 2023 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @licend The above is the entire license notice for the
* JavaScript code in this page
*/var e,t,i,n,s={6873:(e,t,i)=>{i.d(t,{default:()=>h});function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(i),!0).forEach((function(t){_defineProperty(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function _defineProperty(e,t,i){(t=function _toPropertyKey(e){var t=function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i;return e}function _objectWithoutProperties(e,t){if(null==e)return{};var i,n,s=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var i,n,s={},r=Object.keys(e);for(n=0;n<r.length;n++){i=r[n];t.indexOf(i)>=0||(s[i]=e[i])}return s}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++){i=r[n];t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(s[i]=e[i])}}return s}function _slicedToArray(e,t){return function _arrayWithHoles(e){if(Array.isArray(e))return e}(e)||function _iterableToArrayLimit(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,s,r,a,o=[],l=!0,h=!1;try{if(r=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=r.call(i)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){h=!0,s=e}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(h)throw s}}return o}}(e,t)||_unsupportedIterableToArray(e,t)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_unsupportedIterableToArray(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);return"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function canvasTest(e){var t,i,n=e.sizes.shift(),s=Math.max(Math.ceil(n[0]),1),r=Math.max(Math.ceil(n[1]),1),a=[s-1,r-1,1,1],o=Date.now(),l="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;if(l){t=new OffscreenCanvas(1,1);i=new OffscreenCanvas(s,r)}else{(t=document.createElement("canvas")).width=1;t.height=1;(i=document.createElement("canvas")).width=s;i.height=r}var h=t.getContext("2d"),d=i.getContext("2d");if(d){d.fillRect.apply(d,a);h.drawImage(i,s-1,r-1,1,1,0,0,1,1)}var c=h&&0!==h.getImageData(0,0,1,1).data[3],u=Date.now()-o;[t,i].forEach((function(e){e.height=0;e.width=0}));if(l){postMessage({width:s,height:r,benchmark:u,isTestPass:c});!c&&e.sizes.length&&canvasTest(e)}else if(c)e.onSuccess(s,r,u);else{e.onError(s,r,u);e.sizes.length&&canvasTest(e)}return c}var n=[16384,14188,11402,11180,10836,8192,4096,1],s=[8388607,65535,32767,16384,8192,4096,1],r=[4194303,65535,32767,16384,8192,4096,1],a=["onError","onSuccess"],o={max:null,min:1,sizes:[],step:1024,usePromise:!1,useWorker:!1,onError:Function.prototype,onSuccess:Function.prototype},l={};function createSizesArray(e){var t=e.width===e.height,i=1===e.height,n=1===e.width,s=[];if(e.width&&e.height)for(var r=e.min||o.min,a=e.step||o.step,l=Math.max(e.width,e.height);l>=r;){var h=t||i?l:1,d=t||n?l:1;s.push([h,d]);l-=a}else e.sizes.forEach((function(e){var r=t||i?e:1,a=t||n?e:1;s.push([r,a])}));return s}function handleMethod(e){var t=window&&"HTMLCanvasElement"in window,i=window&&"OffscreenCanvas"in window,n=Date.now(),s=e.onError,r=e.onSuccess,o=_objectWithoutProperties(e,a),h=null;if(!t)return!1;if(e.useWorker&&i){var d="\n var canvasTest = ".concat(canvasTest.toString(),";\n onmessage = function(e) {\n canvasTest(e.data);\n };\n "),c=new Blob([d],{type:"application/javascript"}),u=URL.createObjectURL(c);h=new Worker(u);URL.revokeObjectURL(u);h.onmessage=function(e){var t=e.data,i=t.width,s=t.height,r=t.benchmark;if(t.isTestPass){l[n].onSuccess(i,s,r);delete l[n]}else l[n].onError(i,s,r)}}if(e.usePromise)return new Promise((function(t,i){var a=_objectSpread2(_objectSpread2({},e),{},{onError:function onError(t,n,r){var a;if(0===e.sizes.length)a=!0;else{var o=_slicedToArray(e.sizes.slice(-1),1),l=_slicedToArray(o[0],2),h=l[0],d=l[1];a=t===h&&n===d}s(t,n,r);a&&i({width:t,height:n,benchmark:r})},onSuccess:function onSuccess(e,i,n){r(e,i,n);t({width:e,height:i,benchmark:n})}});if(h){var d=a.onError,c=a.onSuccess;l[n]={onError:d,onSuccess:c};h.postMessage(o)}else canvasTest(a)}));if(!h)return canvasTest(e);l[n]={onError:s,onSuccess:r};h.postMessage(o)}var h={maxArea:function maxArea(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=createSizesArray({width:e.max,height:e.max,min:e.min,step:e.step,sizes:_toConsumableArray(n)});return handleMethod(_objectSpread2(_objectSpread2(_objectSpread2({},o),e),{},{sizes:t}))},maxHeight:function maxHeight(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=createSizesArray({width:1,height:e.max,min:e.min,step:e.step,sizes:_toConsumableArray(s)});return handleMethod(_objectSpread2(_objectSpread2(_objectSpread2({},o),e),{},{sizes:t}))},maxWidth:function maxWidth(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=createSizesArray({width:e.max,height:1,min:e.min,step:e.step,sizes:_toConsumableArray(r)});return handleMethod(_objectSpread2(_objectSpread2(_objectSpread2({},o),e),{},{sizes:t}))},test:function test(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=_objectSpread2(_objectSpread2({},o),e);t.sizes=_toConsumableArray(t.sizes);t.width&&t.height&&(t.sizes=[[t.width,t.height]]);return handleMethod(t)}}},3695:(e,t,i)=>{i.d(t,{FluentBundle:()=>FluentBundle,FluentResource:()=>FluentResource});class FluentType{constructor(e){this.value=e}valueOf(){return this.value}}class FluentNone extends FluentType{constructor(e="???"){super(e)}toString(e){return`{${this.value}}`}}class FluentNumber extends FluentType{constructor(e,t={}){super(e);this.opts=t}toString(e){try{return e.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(t){e.reportError(t);return this.value.toString(10)}}}class FluentDateTime extends FluentType{constructor(e,t={}){super(e);this.opts=t}toString(e){try{return e.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(t){e.reportError(t);return new Date(this.value).toISOString()}}}const n=100,s="",r="";function match(e,t,i){if(i===t)return!0;if(i instanceof FluentNumber&&t instanceof FluentNumber&&i.value===t.value)return!0;if(t instanceof FluentNumber&&"string"==typeof i){if(i===e.memoizeIntlObject(Intl.PluralRules,t.opts).select(t.value))return!0}return!1}function getDefault(e,t,i){if(t[i])return resolvePattern(e,t[i].value);e.reportError(new RangeError("No default"));return new FluentNone}function getArguments(e,t){const i=[],n=Object.create(null);for(const s of t)"narg"===s.type?n[s.name]=resolveExpression(e,s.value):i.push(resolveExpression(e,s));return{positional:i,named:n}}function resolveExpression(e,t){switch(t.type){case"str":return t.value;case"num":return new FluentNumber(t.value,{minimumFractionDigits:t.precision});case"var":return function resolveVariableReference(e,{name:t}){let i;if(e.params){if(!Object.prototype.hasOwnProperty.call(e.params,t))return new FluentNone(`$${t}`);i=e.params[t]}else{if(!e.args||!Object.prototype.hasOwnProperty.call(e.args,t)){e.reportError(new ReferenceError(`Unknown variable: $${t}`));return new FluentNone(`$${t}`)}i=e.args[t]}if(i instanceof FluentType)return i;switch(typeof i){case"string":return i;case"number":return new FluentNumber(i);case"object":if(i instanceof Date)return new FluentDateTime(i.getTime());default:e.reportError(new TypeError(`Variable type not supported: $${t}, ${typeof i}`));return new FluentNone(`$${t}`)}}(e,t);case"mesg":return function resolveMessageReference(e,{name:t,attr:i}){const n=e.bundle._messages.get(t);if(!n){e.reportError(new ReferenceError(`Unknown message: ${t}`));return new FluentNone(t)}if(i){const s=n.attributes[i];if(s)return resolvePattern(e,s);e.reportError(new ReferenceError(`Unknown attribute: ${i}`));return new FluentNone(`${t}.${i}`)}if(n.value)return resolvePattern(e,n.value);e.reportError(new ReferenceError(`No value: ${t}`));return new FluentNone(t)}(e,t);case"term":return function resolveTermReference(e,{name:t,attr:i,args:n}){const s=`-${t}`,r=e.bundle._terms.get(s);if(!r){e.reportError(new ReferenceError(`Unknown term: ${s}`));return new FluentNone(s)}if(i){const t=r.attributes[i];if(t){e.params=getArguments(e,n).named;const i=resolvePattern(e,t);e.params=null;return i}e.reportError(new ReferenceError(`Unknown attribute: ${i}`));return new FluentNone(`${s}.${i}`)}e.params=getArguments(e,n).named;const a=resolvePattern(e,r.value);e.params=null;return a}(e,t);case"func":return function resolveFunctionReference(e,{name:t,args:i}){let n=e.bundle._functions[t];if(!n){e.reportError(new ReferenceError(`Unknown function: ${t}()`));return new FluentNone(`${t}()`)}if("function"!=typeof n){e.reportError(new TypeError(`Function ${t}() is not callable`));return new FluentNone(`${t}()`)}try{let t=getArguments(e,i);return n(t.positional,t.named)}catch(i){e.reportError(i);return new FluentNone(`${t}()`)}}(e,t);case"select":return function resolveSelectExpression(e,{selector:t,variants:i,star:n}){let s=resolveExpression(e,t);if(s instanceof FluentNone)return getDefault(e,i,n);for(const t of i){if(match(e,s,resolveExpression(e,t.key)))return resolvePattern(e,t.value)}return getDefault(e,i,n)}(e,t);default:return new FluentNone}}function resolveComplexPattern(e,t){if(e.dirty.has(t)){e.reportError(new RangeError("Cyclic reference"));return new FluentNone}e.dirty.add(t);const i=[],a=e.bundle._useIsolating&&t.length>1;for(const o of t)if("string"!=typeof o){e.placeables++;if(e.placeables>n){e.dirty.delete(t);throw new RangeError(`Too many placeables expanded: ${e.placeables}, max allowed is ${n}`)}a&&i.push(s);i.push(resolveExpression(e,o).toString(e));a&&i.push(r)}else i.push(e.bundle._transform(o));e.dirty.delete(t);return i.join("")}function resolvePattern(e,t){return"string"==typeof t?e.bundle._transform(t):resolveComplexPattern(e,t)}class Scope{constructor(e,t,i){this.dirty=new WeakSet;this.params=null;this.placeables=0;this.bundle=e;this.errors=t;this.args=i}reportError(e){if(!(this.errors&&e instanceof Error))throw e;this.errors.push(e)}memoizeIntlObject(e,t){let i=this.bundle._intls.get(e);if(!i){i={};this.bundle._intls.set(e,i)}let n=JSON.stringify(t);i[n]||(i[n]=new e(this.bundle.locales,t));return i[n]}}function values(e,t){const i=Object.create(null);for(const[n,s]of Object.entries(e))t.includes(n)&&(i[n]=s.valueOf());return i}const a=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function NUMBER(e,t){let i=e[0];if(i instanceof FluentNone)return new FluentNone(`NUMBER(${i.valueOf()})`);if(i instanceof FluentNumber)return new FluentNumber(i.valueOf(),{...i.opts,...values(t,a)});if(i instanceof FluentDateTime)return new FluentNumber(i.valueOf(),{...values(t,a)});throw new TypeError("Invalid argument to NUMBER")}const o=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function DATETIME(e,t){let i=e[0];if(i instanceof FluentNone)return new FluentNone(`DATETIME(${i.valueOf()})`);if(i instanceof FluentDateTime)return new FluentDateTime(i.valueOf(),{...i.opts,...values(t,o)});if(i instanceof FluentNumber)return new FluentDateTime(i.valueOf(),{...values(t,o)});throw new TypeError("Invalid argument to DATETIME")}const l=new Map;class FluentBundle{constructor(e,{functions:t,useIsolating:i=!0,transform:n=(e=>e)}={}){this._terms=new Map;this._messages=new Map;this.locales=Array.isArray(e)?e:[e];this._functions={NUMBER:NUMBER,DATETIME:DATETIME,...t};this._useIsolating=i;this._transform=n;this._intls=function getMemoizerForLocale(e){const t=Array.isArray(e)?e.join(" "):e;let i=l.get(t);if(void 0===i){i=new Map;l.set(t,i)}return i}(e)}hasMessage(e){return this._messages.has(e)}getMessage(e){return this._messages.get(e)}addResource(e,{allowOverrides:t=!1}={}){const i=[];for(let n=0;n<e.body.length;n++){let s=e.body[n];if(s.id.startsWith("-")){if(!1===t&&this._terms.has(s.id)){i.push(new Error(`Attempt to override an existing term: "${s.id}"`));continue}this._terms.set(s.id,s)}else{if(!1===t&&this._messages.has(s.id)){i.push(new Error(`Attempt to override an existing message: "${s.id}"`));continue}this._messages.set(s.id,s)}}return i}formatPattern(e,t=null,i=null){if("string"==typeof e)return this._transform(e);let n=new Scope(this,i,t);try{return resolveComplexPattern(n,e).toString(n)}catch(e){if(n.errors&&e instanceof Error){n.errors.push(e);return(new FluentNone).toString(n)}throw e}}}const h=/^(-?[a-zA-Z][\w-]*) *= */gm,d=/\.([a-zA-Z][\w-]*) *= */y,c=/\*?\[/y,u=/(-?[0-9]+(?:\.([0-9]+))?)/y,p=/([a-zA-Z][\w-]*)/y,g=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,f=/^[A-Z][A-Z0-9_-]*$/,m=/([^{}\n\r]+)/y,w=/([^\\"\n\r]*)/y,b=/\\([\\"])/y,v=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,y=/^\n+/,P=/ +$/,S=/ *\r?\n/g,E=/( *)$/,_=/{\s*/y,C=/\s*}/y,x=/\[\s*/y,T=/\s*] */y,L=/\s*\(\s*/y,I=/\s*->\s*/y,M=/\s*:\s*/y,A=/\s*,?\s*/y,D=/\s+/y;class FluentResource{constructor(e){this.body=[];h.lastIndex=0;let t=0;for(;;){let i=h.exec(e);if(null===i)break;t=h.lastIndex;try{this.body.push(parseMessage(i[1]))}catch(e){if(e instanceof SyntaxError)continue;throw e}}function test(i){i.lastIndex=t;return i.test(e)}function consumeChar(i,n){if(e[t]===i){t++;return!0}if(n)throw new n(`Expected ${i}`);return!1}function consumeToken(e,i){if(test(e)){t=e.lastIndex;return!0}if(i)throw new i(`Expected ${e.toString()}`);return!1}function match(i){i.lastIndex=t;let n=i.exec(e);if(null===n)throw new SyntaxError(`Expected ${i.toString()}`);t=i.lastIndex;return n}function match1(e){return match(e)[1]}function parseMessage(e){let t=parsePattern(),i=function parseAttributes(){let e=Object.create(null);for(;test(d);){let t=match1(d),i=parsePattern();if(null===i)throw new SyntaxError("Expected attribute value");e[t]=i}return e}();if(null===t&&0===Object.keys(i).length)throw new SyntaxError("Expected message value or attributes");return{id:e,value:t,attributes:i}}function parsePattern(){let i;test(m)&&(i=match1(m));if("{"===e[t]||"}"===e[t])return parsePatternElements(i?[i]:[],1/0);let n=parseIndent();if(n){if(i)return parsePatternElements([i,n],n.length);n.value=trim(n.value,y);return parsePatternElements([n],n.length)}return i?trim(i,P):null}function parsePatternElements(i=[],n){for(;;){if(test(m)){i.push(match1(m));continue}if("{"===e[t]){i.push(parsePlaceable());continue}if("}"===e[t])throw new SyntaxError("Unbalanced closing brace");let s=parseIndent();if(!s)break;i.push(s);n=Math.min(n,s.length)}let s=i.length-1,r=i[s];"string"==typeof r&&(i[s]=trim(r,P));let a=[];for(let e of i){e instanceof Indent&&(e=e.value.slice(0,e.value.length-n));e&&a.push(e)}return a}function parsePlaceable(){consumeToken(_,SyntaxError);let e=parseInlineExpression();if(consumeToken(C))return e;if(consumeToken(I)){let t=function parseVariants(){let e,t=[],i=0;for(;test(c);){consumeChar("*")&&(e=i);let n=parseVariantKey(),s=parsePattern();if(null===s)throw new SyntaxError("Expected variant value");t[i++]={key:n,value:s}}if(0===i)return null;if(void 0===e)throw new SyntaxError("Expected default variant");return{variants:t,star:e}}();consumeToken(C,SyntaxError);return{type:"select",selector:e,...t}}throw new SyntaxError("Unclosed placeable")}function parseInlineExpression(){if("{"===e[t])return parsePlaceable();if(test(g)){let[,i,n,s=null]=match(g);if("$"===i)return{type:"var",name:n};if(consumeToken(L)){let r=function parseArguments(){let i=[];for(;;){switch(e[t]){case")":t++;return i;case void 0:throw new SyntaxError("Unclosed argument list")}i.push(parseArgument());consumeToken(A)}}();if("-"===i)return{type:"term",name:n,attr:s,args:r};if(f.test(n))return{type:"func",name:n,args:r};throw new SyntaxError("Function names must be all upper-case")}return"-"===i?{type:"term",name:n,attr:s,args:[]}:{type:"mesg",name:n,attr:s}}return parseLiteral()}function parseArgument(){let e=parseInlineExpression();return"mesg"!==e.type?e:consumeToken(M)?{type:"narg",name:e.name,value:parseLiteral()}:e}function parseVariantKey(){consumeToken(x,SyntaxError);let e;e=test(u)?parseNumberLiteral():{type:"str",value:match1(p)};consumeToken(T,SyntaxError);return e}function parseLiteral(){if(test(u))return parseNumberLiteral();if('"'===e[t])return function parseStringLiteral(){consumeChar('"',SyntaxError);let i="";for(;;){i+=match1(w);if("\\"!==e[t]){if(consumeChar('"'))return{type:"str",value:i};throw new SyntaxError("Unclosed string literal")}i+=parseEscapeSequence()}}();throw new SyntaxError("Invalid expression")}function parseNumberLiteral(){let[,e,t=""]=match(u),i=t.length;return{type:"num",value:parseFloat(e),precision:i}}function parseEscapeSequence(){if(test(b))return match1(b);if(test(v)){let[,e,t]=match(v),i=parseInt(e||t,16);return i<=55295||57344<=i?String.fromCodePoint(i):"�"}throw new SyntaxError("Unknown escape sequence")}function parseIndent(){let i=t;consumeToken(D);switch(e[t]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return makeIndent(e.slice(i,t))}return" "===e[t-1]&&makeIndent(e.slice(i,t))}function trim(e,t){return e.replace(t,"")}function makeIndent(e){let t=e.replace(S,"\n"),i=E.exec(e)[1].length;return new Indent(t,i)}}}class Indent{constructor(e,t){this.value=e;this.length=t}}},8527:(e,t,i)=>{i.d(t,{DOMLocalization:()=>DOMLocalization});const n=/<|&#?\w+;/,s={"http://www.w3.org/1999/xhtml":["em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","bdi","bdo","span","br","wbr"]},r={"http://www.w3.org/1999/xhtml":{global:["title","aria-label","aria-valuetext"],a:["download"],area:["download","alt"],input:["alt","placeholder"],menuitem:["label"],menu:["label"],optgroup:["label"],option:["label"],track:["label"],img:["alt"],textarea:["placeholder"],th:["abbr"]},"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":{global:["accesskey","aria-label","aria-valuetext","label","title","tooltiptext"],description:["value"],key:["key","keycode"],label:["value"],textbox:["placeholder","value"]}};function translateElement(e,t){const{value:i}=t;if("string"==typeof i)if("title"===e.localName&&"http://www.w3.org/1999/xhtml"===e.namespaceURI)e.textContent=i;else if(n.test(i)){const t=e.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");t.innerHTML=i;!function overlayChildNodes(e,t){for(const i of e.childNodes)if(i.nodeType!==i.TEXT_NODE)if(i.hasAttribute("data-l10n-name")){const n=getNodeForNamedElement(t,i);e.replaceChild(n,i)}else if(isElementAllowed(i)){const t=createSanitizedElement(i);e.replaceChild(t,i)}else{console.warn(`An element of forbidden type "${i.localName}" was found in the translation. Only safe text-level elements and elements with data-l10n-name are allowed.`);e.replaceChild(createTextNodeFromTextContent(i),i)}t.textContent="";t.appendChild(e)}(t.content,e)}else e.textContent=i;overlayAttributes(t,e)}function hasAttribute(e,t){if(!e)return!1;for(let i of e)if(i.name===t)return!0;return!1}function overlayAttributes(e,t){const i=t.hasAttribute("data-l10n-attrs")?t.getAttribute("data-l10n-attrs").split(",").map((e=>e.trim())):null;for(const n of Array.from(t.attributes))isAttrNameLocalizable(n.name,t,i)&&!hasAttribute(e.attributes,n.name)&&t.removeAttribute(n.name);if(e.attributes)for(const n of Array.from(e.attributes))isAttrNameLocalizable(n.name,t,i)&&t.getAttribute(n.name)!==n.value&&t.setAttribute(n.name,n.value)}function getNodeForNamedElement(e,t){const i=t.getAttribute("data-l10n-name"),n=e.querySelector(`[data-l10n-name="${i}"]`);if(!n){console.warn(`An element named "${i}" wasn't found in the source.`);return createTextNodeFromTextContent(t)}if(n.localName!==t.localName){console.warn(`An element named "${i}" was found in the translation but its type ${t.localName} didn't match the element found in the source (${n.localName}).`);return createTextNodeFromTextContent(t)}e.removeChild(n);return shallowPopulateUsing(t,n.cloneNode(!1))}function createSanitizedElement(e){const t=e.ownerDocument.createElement(e.localName);return shallowPopulateUsing(e,t)}function createTextNodeFromTextContent(e){return e.ownerDocument.createTextNode(e.textContent)}function isElementAllowed(e){const t=s[e.namespaceURI];return t&&t.includes(e.localName)}function isAttrNameLocalizable(e,t,i=null){if(i&&i.includes(e))return!0;const n=r[t.namespaceURI];if(!n)return!1;const s=e.toLowerCase(),a=t.localName;if(n.global.includes(s))return!0;if(!n[a])return!1;if(n[a].includes(s))return!0;if("http://www.w3.org/1999/xhtml"===t.namespaceURI&&"input"===a&&"value"===s){const e=t.type.toLowerCase();if("submit"===e||"button"===e||"reset"===e)return!0}return!1}function shallowPopulateUsing(e,t){t.textContent=e.textContent;overlayAttributes(e,t);return t}class CachedIterable extends Array{static from(e){return e instanceof this?e:new this(e)}}Symbol.iterator;class CachedAsyncIterable extends CachedIterable{constructor(e){super();if(Symbol.asyncIterator in Object(e))this.iterator=e[Symbol.asyncIterator]();else{if(!(Symbol.iterator in Object(e)))throw new TypeError("Argument must implement the iteration protocol.");this.iterator=e[Symbol.iterator]()}}[Symbol.asyncIterator](){const e=this;let t=0;return{async next(){e.length<=t&&e.push(e.iterator.next());return e[t++]}}}async touchNext(e=1){let t=0;for(;t++<e;){const e=this[this.length-1];if(e&&(await e).done)break;this.push(this.iterator.next())}return this[this.length-1]}}class Localization{constructor(e=[],t){this.resourceIds=e;this.generateBundles=t;this.onChange(!0)}addResourceIds(e,t=!1){this.resourceIds.push(...e);this.onChange(t);return this.resourceIds.length}removeResourceIds(e){this.resourceIds=this.resourceIds.filter((t=>!e.includes(t)));this.onChange();return this.resourceIds.length}async formatWithFallback(e,t){const i=[];let n=!1;for await(const s of this.bundles){n=!0;const r=keysFromBundle(t,s,e,i);if(0===r.size)break;if("undefined"!=typeof console){const e=s.locales[0],t=Array.from(r).join(", ");console.warn(`[fluent] Missing translations in ${e}: ${t}`)}}n||"undefined"==typeof console||console.warn(`[fluent] Request for keys failed because no resource bundles got generated.\n keys: ${JSON.stringify(e)}.\n resourceIds: ${JSON.stringify(this.resourceIds)}.`);return i}formatMessages(e){return this.formatWithFallback(e,messageFromBundle)}formatValues(e){return this.formatWithFallback(e,valueFromBundle)}async formatValue(e,t){const[i]=await this.formatValues([{id:e,args:t}]);return i}handleEvent(){this.onChange()}onChange(e=!1){this.bundles=CachedAsyncIterable.from(this.generateBundles(this.resourceIds));e&&this.bundles.touchNext(2)}}function valueFromBundle(e,t,i,n){return i.value?e.formatPattern(i.value,n,t):null}function messageFromBundle(e,t,i,n){const s={value:null,attributes:null};i.value&&(s.value=e.formatPattern(i.value,n,t));let r=Object.keys(i.attributes);if(r.length>0){s.attributes=new Array(r.length);for(let[a,o]of r.entries()){let r=e.formatPattern(i.attributes[o],n,t);s.attributes[a]={name:o,value:r}}}return s}function keysFromBundle(e,t,i,n){const s=[],r=new Set;i.forEach((({id:i,args:a},o)=>{if(void 0!==n[o])return;let l=t.getMessage(i);if(l){s.length=0;n[o]=e(t,s,l,a);if(s.length>0&&"undefined"!=typeof console){const e=t.locales[0],n=s.join(", ");console.warn(`[fluent][resolver] errors in ${e}/${i}: ${n}.`)}}else r.add(i)}));return r}const a="data-l10n-id",o="data-l10n-args",l=`[${a}]`;class DOMLocalization extends Localization{constructor(e,t){super(e,t);this.roots=new Set;this.pendingrAF=null;this.pendingElements=new Set;this.windowElement=null;this.mutationObserver=null;this.observerConfig={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:[a,o]}}onChange(e=!1){super.onChange(e);this.roots&&this.translateRoots()}setAttributes(e,t,i){e.setAttribute(a,t);i?e.setAttribute(o,JSON.stringify(i)):e.removeAttribute(o);return e}getAttributes(e){return{id:e.getAttribute(a),args:JSON.parse(e.getAttribute(o)||null)}}connectRoot(e){for(const t of this.roots)if(t===e||t.contains(e)||e.contains(t))throw new Error("Cannot add a root that overlaps with existing root.");if(this.windowElement){if(this.windowElement!==e.ownerDocument.defaultView)throw new Error("Cannot connect a root:\n DOMLocalization already has a root from a different window.")}else{this.windowElement=e.ownerDocument.defaultView;this.mutationObserver=new this.windowElement.MutationObserver((e=>this.translateMutations(e)))}this.roots.add(e);this.mutationObserver.observe(e,this.observerConfig)}disconnectRoot(e){this.roots.delete(e);this.pauseObserving();if(0===this.roots.size){this.mutationObserver=null;this.windowElement=null;this.pendingrAF=null;this.pendingElements.clear();return!0}this.resumeObserving();return!1}translateRoots(){const e=Array.from(this.roots);return Promise.all(e.map((e=>this.translateFragment(e))))}pauseObserving(){if(this.mutationObserver){this.translateMutations(this.mutationObserver.takeRecords());this.mutationObserver.disconnect()}}resumeObserving(){if(this.mutationObserver)for(const e of this.roots)this.mutationObserver.observe(e,this.observerConfig)}translateMutations(e){for(const t of e)switch(t.type){case"attributes":t.target.hasAttribute("data-l10n-id")&&this.pendingElements.add(t.target);break;case"childList":for(const e of t.addedNodes)if(e.nodeType===e.ELEMENT_NODE)if(e.childElementCount)for(const t of this.getTranslatables(e))this.pendingElements.add(t);else e.hasAttribute(a)&&this.pendingElements.add(e)}this.pendingElements.size>0&&null===this.pendingrAF&&(this.pendingrAF=this.windowElement.requestAnimationFrame((()=>{this.translateElements(Array.from(this.pendingElements));this.pendingElements.clear();this.pendingrAF=null})))}translateFragment(e){return this.translateElements(this.getTranslatables(e))}async translateElements(e){if(!e.length)return;const t=e.map(this.getKeysForElement),i=await this.formatMessages(t);return this.applyTranslations(e,i)}applyTranslations(e,t){this.pauseObserving();for(let i=0;i<e.length;i++)void 0!==t[i]&&translateElement(e[i],t[i]);this.resumeObserving()}getTranslatables(e){const t=Array.from(e.querySelectorAll(l));"function"==typeof e.hasAttribute&&e.hasAttribute(a)&&t.push(e);return t}getKeysForElement(e){return{id:e.getAttribute(a),args:JSON.parse(e.getAttribute(o)||null)}}}},1567:(e,t,i)=>{i.d(t,{warn:()=>warn});"object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&process.type;const n={ERRORS:0,WARNINGS:1,INFOS:5};let s=n.WARNINGS;function warn(e){s>=n.WARNINGS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log(`Warning: ${e}`):Window&&globalThis.ngxConsole?globalThis.ngxConsole.log(`Warning: ${e}`):console.log(`Warning: ${e}`))}function unreachable(e){throw new Error(e)}!function BaseExceptionClosure(){function BaseException(e,t){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=e;this.name=t}BaseException.prototype=new Error;BaseException.constructor=BaseException}();[...Array(256).keys()].map((e=>e.toString(16).padStart(2,"0")))},9382:(e,t,i)=>{i.a(e,(async(e,n)=>{try{i.d(t,{AltTextManager:()=>AltTextManager});var s=i(9600),r=e([s]);s=(r.then?(await r)():r)[0];class AltTextManager{#e=this.#t.bind(this);#i=this.#n.bind(this);#s=this.#r.bind(this);#a=null;#o;#l;#h;#d=!1;#c;#u;#p;#g;#f;#m;#w=null;#b=null;#v=null;#y;#P=null;constructor({dialog:e,optionDescription:t,optionDecorative:i,textarea:n,cancelButton:s,saveButton:r},a,o,l){this.#l=e;this.#c=t;this.#u=i;this.#f=n;this.#o=s;this.#g=r;this.#p=o;this.#h=l;this.#y=a;e.addEventListener("close",this.#S.bind(this));e.addEventListener("contextmenu",(e=>{e.target!==this.#f&&e.preventDefault()}));s.addEventListener("click",this.#E.bind(this));r.addEventListener("click",this.#_.bind(this));t.addEventListener("change",this.#e);i.addEventListener("change",this.#e);this.#p.register(e)}get _elements(){return(0,s.shadow)(this,"_elements",[this.#c,this.#u,this.#f,this.#g,this.#o])}#C(){if(this.#b)return;const e=new s.DOMSVGFactory,t=this.#b=e.createElement("svg");t.setAttribute("width","0");t.setAttribute("height","0");const i=e.createElement("defs");t.append(i);const n=e.createElement("mask");i.append(n);n.setAttribute("id","alttext-manager-mask");n.setAttribute("maskContentUnits","objectBoundingBox");let r=e.createElement("rect");n.append(r);r.setAttribute("fill","white");r.setAttribute("width","1");r.setAttribute("height","1");r.setAttribute("x","0");r.setAttribute("y","0");r=this.#v=e.createElement("rect");n.append(r);r.setAttribute("fill","black");this.#l.append(t)}async editAltText(e,t){if(this.#a||!t)return;this.#C();this.#d=!1;for(const e of this._elements)e.addEventListener("click",this.#s);const{altText:i,decorative:n}=t.altTextData;if(!0===n){this.#u.checked=!0;this.#c.checked=!1}else{this.#u.checked=!1;this.#c.checked=!0}this.#w=this.#f.value=i?.trim()||"";this.#t();this.#a=t;this.#m=e;this.#m.removeEditListeners();this.#h._on("resize",this.#i);try{await this.#p.open(this.#l);this.#n()}catch(e){this.#S();throw e}}#n(){if(!this.#a)return;const e=this.#l,{style:t}=e,{x:i,y:n,width:s,height:r}=this.#y.getBoundingClientRect(),{innerWidth:a,innerHeight:o}=window,{width:l,height:h}=e.getBoundingClientRect(),{x:d,y:c,width:u,height:p}=this.#a.getClientDimensions(),g=10,f="ltr"===this.#m.direction,m=Math.max(d,i),w=Math.min(d+u,i+s),b=Math.max(c,n),v=Math.min(c+p,n+r);this.#v.setAttribute("width",""+(w-m)/a);this.#v.setAttribute("height",""+(v-b)/o);this.#v.setAttribute("x",""+m/a);this.#v.setAttribute("y",""+b/o);let y=null,P=Math.max(c,0);P+=Math.min(o-(P+h),0);f?d+u+g+l<a?y=d+u+g:d>l+g&&(y=d-l-g):d>l+g?y=d-l-g:d+u+g+l<a&&(y=d+u+g);if(null===y){P=null;y=Math.max(d,0);y+=Math.min(a-(y+l),0);c>h+g?P=c-h-g:c+p+g+h<o&&(P=c+p+g)}if(null!==P){e.classList.add("positioned");f?t.left=`${y}px`:t.right=a-y-l+"px";t.top=`${P}px`}else{e.classList.remove("positioned");t.left="";t.top=""}}#E(){this.#p.active===this.#l&&this.#p.close(this.#l)}#S(){this.#h.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.#a.editorType,data:this.#P||{action:"alt_text_cancel",alt_text_keyboard:!this.#d}}});this.#P=null;this.#x();this.#m?.addEditListeners();this.#h._off("resize",this.#i);this.#a.altTextFinish();this.#a=null;this.#m=null}#t(){this.#f.disabled=this.#u.checked}#_(){const e=this.#f.value.trim(),t=this.#u.checked;this.#a.altTextData={altText:e,decorative:t};this.#P={action:"alt_text_save",alt_text_description:!!e,alt_text_edit:!!this.#w&&this.#w!==e,alt_text_decorative:t,alt_text_keyboard:!this.#d};this.#E()}#r(e){if(0!==e.detail){this.#d=!0;this.#x()}}#x(){for(const e of this._elements)e.removeEventListener("click",this.#s)}destroy(){this.#m=null;this.#E();this.#b?.remove();this.#b=this.#v=null}}n()}catch(e){n(e)}}))},7348:(e,t,i)=>{i.a(e,(async(e,n)=>{try{i.d(t,{AnnotationEditorLayerBuilder:()=>AnnotationEditorLayerBuilder});var s=i(9600),r=i(6226),a=e([s,r]);[s,r]=a.then?(await a)():a;class AnnotationEditorLayerBuilder{#T=null;#L=null;#I=null;#m;constructor(e){this.pageDiv=e.pageDiv;this.pdfPage=e.pdfPage;this.accessibilityManager=e.accessibilityManager;this.l10n=e.l10n||r.NullL10n;this.annotationEditorLayer=null;this.div=null;this._cancelled=!1;this.#m=e.uiManager;this.#T=e.annotationLayer||null;this.#I=e.textLayer||null;this.#L=e.drawLayer||null;this.eventBus=e.eventBus}async render(e,t="display"){if("display"!==t)return;if(this._cancelled)return;const i=e.clone({dontFlip:!0});if(this.div){this.annotationEditorLayer.update({viewport:i});this.show();return}const n=this.div=document.createElement("div");n.className="annotationEditorLayer";n.tabIndex=0;n.hidden=!0;n.dir=this.#m.direction;this.pageDiv.append(n);this.annotationEditorLayer=new s.AnnotationEditorLayer({uiManager:this.#m,div:n,accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:i,annotationLayer:this.#T,textLayer:this.#I,drawLayer:this.#L,eventBus:this.eventBus});const r={viewport:i,div:n,annotations:null,intent:t};this.annotationEditorLayer.render(r);this.show()}cancel(){this._cancelled=!0;if(this.div){this.pageDiv=null;this.annotationEditorLayer.destroy();this.div.remove()}}hide(){this.div&&(this.div.hidden=!0)}show(){this.div&&!this.annotationEditorLayer.isEmpty&&(this.div.hidden=!1)}}n()}catch(e){n(e)}}))},7671:(e,t,i)=>{i.a(e,(async(e,n)=>{try{i.d(t,{AnnotationEditorParams:()=>AnnotationEditorParams});var s=i(9600),r=e([s]);s=(r.then?(await r)():r)[0];class AnnotationEditorParams{constructor(e,t){this.eventBus=t;this.#M(e)}#M({editorFreeTextFontSize:e,editorFreeTextColor:t,editorInkColor:i,editorInkThickness:n,editorInkOpacity:r,editorStampAddImage:a}){const dispatchEvent=(e,t)=>{this.eventBus.dispatch("switchannotationeditorparams",{source:this,type:s.AnnotationEditorParamsType[e],value:t})};e.addEventListener("input",(function(){dispatchEvent("FREETEXT_SIZE",this.valueAsNumber)}));t.addEventListener("input",(function(){dispatchEvent("FREETEXT_COLOR",this.value)}));i.addEventListener("input",(function(){dispatchEvent("INK_COLOR",this.value)}));n.addEventListener("input",(function(){dispatchEvent("INK_THICKNESS",this.valueAsNumber)}));r.addEventListener("input",(function(){dispatchEvent("INK_OPACITY",this.valueAsNumber)}));a.addEventListener("click",(()=>{dispatchEvent("CREATE")}));this.eventBus._on("annotationeditorparamschanged",(a=>{for(const[o,l]of a.details)switch(o){case s.AnnotationEditorParamsType.FREETEXT_SIZE:e.value=l;break;case s.AnnotationEditorParamsType.FREETEXT_COLOR:t.value=l;break;case s.AnnotationEditorParamsType.INK_COLOR:i.value=l;break;case s.AnnotationEditorParamsType.INK_THICKNESS:n.value=l;break;case s.AnnotationEditorParamsType.INK_OPACITY:r.value=l}}))}}n()}catch(e){n(e)}}))},4874:(e,t,i)=>{i.a(e,(async(e,n)=>{try{i.d(t,{AnnotationLayerBuilder:()=>AnnotationLayerBuilder});var s=i(9600),r=i(249),a=e([s]);s=(a.then?(await a)():a)[0];class AnnotationLayerBuilder{#A=null;constructor({pageDiv:e,pdfPage:t,linkService:i,downloadManager:n,annotationStorage:s=null,imageResourcesPath:r="",renderForms:a=!0,enableScripting:o=!1,hasJSActionsPromise:l=null,fieldObjectsPromise:h=null,annotationCanvasMap:d=null,accessibilityManager:c=null}){this.pageDiv=e;this.pdfPage=t;this.linkService=i;this.downloadManager=n;this.imageResourcesPath=r;this.renderForms=a;this.annotationStorage=s;this.enableScripting=o;this._hasJSActionsPromise=l||Promise.resolve(!1);this._fieldObjectsPromise=h||Promise.resolve(null);this._annotationCanvasMap=d;this._accessibilityManager=c;this.annotationLayer=null;this.div=null;this._cancelled=!1;this._eventBus=i.eventBus}async render(e,t="display"){if(this.div){if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:e.clone({dontFlip:!0})});return}const[i,n,a]=await Promise.all([this.pdfPage.getAnnotations({intent:t}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const o=this.div=document.createElement("div");o.className="annotationLayer";this.pageDiv.append(o);if(0!==i.length){this.annotationLayer=new s.AnnotationLayer({div:o,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,page:this.pdfPage,viewport:e.clone({dontFlip:!0})});await this.annotationLayer.render({annotations:i,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:n,fieldObjects:a});this.linkService.isInPresentationMode&&this.#D(r.PresentationModeState.FULLSCREEN);if(!this.#A){this.#A=e=>{this.#D(e.state)};this._eventBus?._on("presentationmodechanged",this.#A)}}else this.hide()}cancel(){this._cancelled=!0;if(this.#A){this._eventBus?._off("presentationmodechanged",this.#A);this.#A=null}}hide(){this.div&&(document.querySelector("[data-pdfjsprinting=true]")||(this.div.hidden=!0))}#D(e){if(!this.div)return;let t=!1;switch(e){case r.PresentationModeState.FULLSCREEN:t=!0;break;case r.PresentationModeState.NORMAL:break;default:return}for(const e of this.div.childNodes)e.hasAttribute("data-internal-link")||(e.inert=t)}}n()}catch(e){n(e)}}))},646:(e,t,i)=>{i.a(e,(async(e,n)=>{try{i.d(t,{DefaultExternalServices:()=>DefaultExternalServices,PDFPrintServiceFactory:()=>F,PDFViewerApplication:()=>k});var s=i(249),r=i(9600),a=i(507),o=i(9655),l=i(367),h=i(4886),d=i(9382),c=i(7671),u=i(5509),p=i(7581),g=i(1568),f=i(8708),m=i(7771),w=i(9683),b=i(700),v=i(3872),y=i(3782),P=i(1751),S=i(2505),E=i(8564),_=i(3777),C=i(3320),x=i(6681),T=i(9552),L=i(2599),I=i(9166),M=i(5887),A=e([r,d,c,p,g,f,m,w,b,P,S,E,_,x,T,L,I]);[r,d,c,p,g,f,m,w,b,P,S,E,_,x,T,L,I]=A.then?(await A)():A;const D=10,N=1e3,B={UNKNOWN:-1,PREVIOUS:0,INITIAL:1};class DefaultExternalServices{constructor(){throw new Error("Cannot initialize DefaultExternalServices.")}static updateFindControlState(e){}static updateFindMatchesCount(e){}static initPassiveLoading(e){}static reportTelemetry(e){}static createDownloadManager(){throw new Error("Not implemented: createDownloadManager")}static createPreferences(){throw new Error("Not implemented: createPreferences")}static async createL10n(){throw new Error("Not implemented: createL10n")}static createScripting(){throw new Error("Not implemented: createScripting")}static updateEditorStates(e){throw new Error("Not implemented: updateEditorStates")}static getNimbusExperimentData(){return(0,r.shadow)(this,"getNimbusExperimentData",Promise.resolve(null))}}const k={initialBookmark:document.location.hash.substring(1),_initializedCapability:new r.PromiseCapability,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,pdfLayerViewer:null,pdfCursorTools:null,pdfScriptingManager:null,store:null,downloadManager:null,overlayManager:null,preferences:null,toolbar:null,secondaryToolbar:null,eventBus:null,l10n:null,annotationEditorParams:null,isInitialViewSet:!1,downloadComplete:!1,isViewerEmbedded:window.parent!==window,url:"",baseUrl:"",_downloadUrl:"",externalServices:DefaultExternalServices,_boundEvents:Object.create(null),documentInfo:null,metadata:null,_contentDispositionFilename:null,_contentLength:null,_saveInProgress:!1,_wheelUnusedTicks:0,_wheelUnusedFactor:1,_touchUnusedTicks:0,_touchUnusedFactor:1,_PDFBug:null,_hasAnnotationEditors:!1,_title:document.title,_printAnnotationStoragePromise:null,_touchInfo:null,_isCtrlKeyDown:!1,_nimbusDataPromise:null,async initialize(e){let t,i;this.appConfig=e;try{await this.preferences.initializedPromise}catch(e){console.error(`initialize: "${e.message}".`)}o.AppOptions.get("pdfBugEnabled")&&await this._parseHashParams();switch(o.AppOptions.get("viewerCssTheme")){case 1:i="is-light";break;case 2:i="is-dark"}i&&document.documentElement.classList.add(i);t=this.externalServices.createL10n();this.l10n=await t;document.getElementsByTagName("html")[0].dir=this.l10n.getDirection();this.l10n.translate(e.appContainer||document.documentElement);this.isViewerEmbedded&&o.AppOptions.get("externalLinkTarget")===h.LinkTarget.NONE&&o.AppOptions.set("externalLinkTarget",h.LinkTarget.TOP);await this._initializeViewerComponents();this.bindEvents();this.bindWindowEvents();this._initializedCapability.resolve();this.initializeLoadingBar()},async _parseHashParams(){const e=document.location.hash.substring(1);if(!e)return;const{mainContainer:t,viewerContainer:i}=this.appConfig,n=(0,s.parseQueryString)(e);if("true"===n.get("disableworker"))try{await loadFakeWorker()}catch(e){console.error(`_parseHashParams: "${e.message}".`)}n.has("disablerange")&&o.AppOptions.set("disableRange","true"===n.get("disablerange"));n.has("disablestream")&&o.AppOptions.set("disableStream","true"===n.get("disablestream"));n.has("disableautofetch")&&o.AppOptions.set("disableAutoFetch","true"===n.get("disableautofetch"));n.has("disablefontface")&&o.AppOptions.set("disableFontFace","true"===n.get("disablefontface"));n.has("disablehistory")&&o.AppOptions.set("disableHistory","true"===n.get("disablehistory"));n.has("verbosity")&&o.AppOptions.set("verbosity",0|n.get("verbosity"));if(n.has("textlayer"))switch(n.get("textlayer")){case"off":o.AppOptions.set("textLayerMode",s.TextLayerMode.DISABLE);break;case"visible":case"shadow":case"hover":i.classList.add(`textLayer-${n.get("textlayer")}`);try{await loadPDFBug(this);this._PDFBug.loadCSS()}catch(e){console.error(`_parseHashParams: "${e.message}".`)}}if(n.has("pdfbug")){o.AppOptions.set("pdfBug",!0);o.AppOptions.set("fontExtraProperties",!0);const e=n.get("pdfbug").split(",");try{await loadPDFBug(this);this._PDFBug.init(t,e)}catch(e){console.error(`_parseHashParams: "${e.message}".`)}}n.has("locale")&&o.AppOptions.set("locale",n.get("locale"))},async _initializeViewerComponents(){const{appConfig:e,externalServices:t,l10n:i}=this,n=o.AppOptions.get("isInAutomation")?new l.AutomationEventBus:new l.EventBus;this.eventBus=n;this.overlayManager=new u.OverlayManager;const a=new E.PDFRenderingQueue;a.onIdle=this._cleanup.bind(this);this.pdfRenderingQueue=a;const M=new h.PDFLinkService({eventBus:n,externalLinkTarget:o.AppOptions.get("externalLinkTarget"),externalLinkRel:o.AppOptions.get("externalLinkRel"),ignoreDestinationZoom:o.AppOptions.get("ignoreDestinationZoom")});this.pdfLinkService=M;const A=t.createDownloadManager();this.downloadManager=A;const D=new b.PDFFindController({linkService:M,eventBus:n,pageViewMode:o.AppOptions.get("pageViewMode"),updateMatchesCountOnProgress:!0});this.findController=D;const N=new _.PDFScriptingManager({eventBus:n,externalServices:t,docProperties:this._scriptingDocProperties.bind(this)});this.pdfScriptingManager=N;const B=e.mainContainer,k=e.viewerContainer,V=o.AppOptions.get("annotationEditorMode"),F=o.AppOptions.get("isOffscreenCanvasSupported")&&r.FeatureTest.isOffscreenCanvasSupported,R=o.AppOptions.get("forcePageColors")||window.matchMedia("(forced-colors: active)").matches?{background:o.AppOptions.get("pageColorsBackground"),foreground:o.AppOptions.get("pageColorsForeground")}:null,O=e.altTextDialog?new d.AltTextManager(e.altTextDialog,B,this.overlayManager,n):null,H=new T.PDFViewer({container:B,viewer:k,eventBus:n,renderingQueue:a,linkService:M,downloadManager:A,altTextManager:O,findController:D,scriptingManager:o.AppOptions.get("enableScripting")&&N,l10n:i,textLayerMode:o.AppOptions.get("textLayerMode"),annotationMode:o.AppOptions.get("annotationMode"),annotationEditorMode:V,annotationEditorHighlightColors:o.AppOptions.get("highlightEditorColors"),imageResourcesPath:o.AppOptions.get("imageResourcesPath"),removePageBorders:o.AppOptions.get("removePageBorders"),enablePrintAutoRotate:o.AppOptions.get("enablePrintAutoRotate"),isOffscreenCanvasSupported:F,maxCanvasPixels:o.AppOptions.get("maxCanvasPixels"),pageViewMode:o.AppOptions.get("pageViewMode"),enablePermissions:o.AppOptions.get("enablePermissions"),pageColors:R});this.pdfViewer=H;a.setViewer(H);M.setViewer(H);N.setViewer(H);if(e.sidebar?.thumbnailView){this.pdfThumbnailViewer=new x.PDFThumbnailViewer({container:e.sidebar.thumbnailView,eventBus:n,renderingQueue:a,linkService:M,pageColors:R});a.setThumbnailViewer(this.pdfThumbnailViewer)}if(!this.isViewerEmbedded&&!o.AppOptions.get("disableHistory")){this.pdfHistory=new v.PDFHistory({linkService:M,eventBus:n});M.setHistory(this.pdfHistory)}!this.supportsIntegratedFind&&e.findBar&&(this.findBar=new w.PDFFindBar(e.findBar,n));if(e.annotationEditorParams)if(V!==r.AnnotationEditorType.DISABLE){F||e.toolbar?.editorStampButton?.classList.add("hidden");const t=e.toolbar?.editorHighlightButton;t&&o.AppOptions.get("enableHighlightEditor")&&(t.hidden=!1);this.annotationEditorParams=new c.AnnotationEditorParams(e.annotationEditorParams,n)}else for(const e of["editorModeButtons","editorModeSeparator"])document.getElementById(e)?.classList.add("hidden");e.documentProperties&&(this.pdfDocumentProperties=new m.PDFDocumentProperties(e.documentProperties,this.overlayManager,n,i,(()=>this._docFilename)));e.secondaryToolbar?.cursorHandToolButton&&(this.pdfCursorTools=new f.PDFCursorTools({container:B,eventBus:n,cursorToolOnLoad:o.AppOptions.get("cursorToolOnLoad")}));e.toolbar&&(this.toolbar=new I.Toolbar(e.toolbar,n));e.secondaryToolbar&&(this.secondaryToolbar=new L.SecondaryToolbar(e.secondaryToolbar,n));this.supportsFullscreen&&(e.toolbar?.presentationModeButton||e.secondaryToolbar?.presentationModeButton)&&(this.pdfPresentationMode=new S.PDFPresentationMode({container:B,pdfViewer:H,eventBus:n}));const U=o.AppOptions.get("passwordPrompt");U?this.passwordPrompt=U:e.passwordOverlay&&(this.passwordPrompt=new p.PasswordPrompt(e.passwordOverlay,this.overlayManager,this.isViewerEmbedded));e.sidebar?.outlineView&&(this.pdfOutlineViewer=new P.PDFOutlineViewer({container:e.sidebar.outlineView,eventBus:n,l10n:i,linkService:M,downloadManager:A}));e.sidebar?.attachmentsView&&(this.pdfAttachmentViewer=new g.PDFAttachmentViewer({container:e.sidebar.attachmentsView,eventBus:n,l10n:i,downloadManager:A}));e.sidebar?.layersView&&(this.pdfLayerViewer=new y.PDFLayerViewer({container:e.sidebar.layersView,eventBus:n,l10n:i}));if(e.sidebar){this.pdfSidebar=new C.PDFSidebar({elements:e.sidebar,eventBus:n,l10n:i});this.pdfSidebar.onToggled=this.forceRendering.bind(this);this.pdfSidebar.onUpdateThumbnails=()=>{for(const e of H.getCachedPageViews())e.renderingState===s.RenderingStates.FINISHED&&this.pdfThumbnailViewer.getThumbnail(e.id-1)?.setImage(e);this.pdfThumbnailViewer.scrollThumbnailIntoView(H.currentPageNumber)}}},async run(e){this.preferences=this.externalServices.createPreferences();await this.initialize(e);const{appConfig:t,eventBus:i}=this;let n;const r=document.location.search.substring(1);n=(0,s.parseQueryString)(r).get("file")??o.AppOptions.get("defaultUrl");validateFileURL(n);const a=t.openFileInput;a.value=null;a.addEventListener("change",(function(e){const{files:t}=e.target;t&&0!==t.length&&i.dispatch("fileinputchange",{source:this,fileInput:e.target})}));t.mainContainer.addEventListener("dragover",(function(e){if(o.AppOptions.get("enableDragAndDrop")){e.preventDefault();e.dataTransfer.dropEffect="copy"===e.dataTransfer.effectAllowed?"copy":"move"}}));t.mainContainer.addEventListener("drop",(function(e){e.preventDefault();const{files:t}=e.dataTransfer;t&&0!==t.length&&i.dispatch("fileinputchange",{source:this,fileInput:e.dataTransfer,dropEvent:e})}));if(!o.AppOptions.get("supportsDocumentFonts")){o.AppOptions.set("disableFontFace",!0);this.l10n.get("pdfjs-web-fonts-disabled").then((e=>{console.warn(e)}))}if(!this.supportsPrinting){t.toolbar?.print?.classList.add("hidden");t.secondaryToolbar?.printButton.classList.add("hidden")}if(!this.supportsFullscreen){t.toolbar.presentationModeButton.classList.add("hidden");t.secondaryToolbar?.presentationModeButton.classList.add("hidden")}this.supportsIntegratedFind&&t.toolbar?.viewFind?.classList.add("hidden");n?this.open({url:n}):this._hideViewBookmark()},get initialized(){return this._initializedCapability.settled},get initializedPromise(){return this._initializedCapability.promise},zoomIn(e,t){this.pdfViewer.isInPresentationMode||this.pdfViewer.increaseScale({drawingDelay:o.AppOptions.get("defaultZoomDelay"),steps:e,scaleFactor:t})},zoomOut(e,t