"use strict";(function(){var e=navigator.userAgent,t=/Android/.test(e),n=/Android\s[0-2][^\d]/.test(e),i=/Android\s[0-4][^\d]/.test(e),r=e.indexOf("Chrom")>=0,a=/Chrome\/(39|40)\./.test(e),s=e.indexOf("Trident")>=0,o=/\b(iPad|iPhone|iPod)(?=;)/.test(e),c=e.indexOf("Opera")>=0,l=/Safari\//.test(e)&&!/(Chrome\/|Android\s)/.test(e);"undefined"==typeof PDFJS&&(("undefined"!=typeof window?window:this).PDFJS={}),function(){function e(e,t){return new n(this.slice(e,t))}function t(e,t){arguments.length<2&&(t=0);for(var n=0,i=e.length;n>2,l=(3&a)<<4|s>>4,h=n+1>6:64,u=n+2>(-2*r&6)):0)i=e.indexOf(i);return s}}}(),function(){"undefined"==typeof Function.prototype.bind&&(Function.prototype.bind=function(e){var t=this,n=Array.prototype.slice.call(arguments,1),i=function(){var i=n.concat(Array.prototype.slice.call(arguments));return t.apply(e,i)};return i})}(),function(){var e=document.createElement("div");"dataset"in e||Object.defineProperty(HTMLElement.prototype,"dataset",{get:function(){if(this._dataset)return this._dataset;for(var e={},t=0,n=this.attributes.length;t=0&&i&&a.splice(s,1),e.className=a.join(" "),s>=0}var t=document.createElement("div");if(!("classList"in t)){var n={add:function(t){e(this.element,t,!0,!1)},contains:function(t){return e(this.element,t,!1,!1)},remove:function(t){e(this.element,t,!1,!0)},toggle:function(t){e(this.element,t,!0,!0)}};Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){if(this._classList)return this._classList;var e=Object.create(n,{element:{value:this,writable:!1,enumerable:!0}});return Object.defineProperty(this,"_classList",{value:e,writable:!1,enumerable:!1}),e},enumerable:!0})}}(),function(){"console"in window?"bind"in console.log||(console.log=function(e){return function(t){return e(t)}}(console.log),console.error=function(e){return function(t){return e(t)}}(console.error),console.warn=function(e){return function(t){return e(t)}}(console.warn)):window.console={log:function(){},error:function(){},warn:function(){}}}(),function(){function e(e){t(e.target)&&e.stopPropagation()}function t(e){return e.disabled||e.parentNode&&t(e.parentNode)}c&&document.addEventListener("click",e,!0)}(),function(){s&&(PDFJS.disableCreateObjectURL=!0)}(),function(){"language"in navigator||(PDFJS.locale=navigator.userLanguage||"en-US")}(),function(){(l||n||a||o)&&(PDFJS.disableRange=!0,PDFJS.disableStream=!0)}(),function(){history.pushState&&!n||(PDFJS.disableHistory=!0)}(),function(){if(window.CanvasPixelArray)"function"!=typeof window.CanvasPixelArray.prototype.set&&(window.CanvasPixelArray.prototype.set=function(e){for(var t=0,n=this.length;t0?(i=t.substring(0,a),r=t.substr(a+1)):(i=t,r=A),w[i]||(w[i]={}),w[i][r]=e[t]}n&&n()})},i)}function h(e,t){function n(e){var t=e.href;this.load=function(e,n){l(t,e,n,function(){console.warn(t+" not found."),console.warn('"'+e+'" resource not found'),S="",n()})}}e&&(e=e.toLowerCase()),t=t||function(){},u(),S=e;var a=i(),s=a.length;if(0===s){var c=r();if(c&&c.locales&&c.default_locale){if(console.log("using the embedded JSON directory, early way out"),w=c.locales[e],!w){var h=c.default_locale.toLowerCase();for(var d in c.locales){if(d=d.toLowerCase(),d===e){w=c.locales[e];break}d===h&&(w=c.locales[h])}}t()}else console.log("no resource to load, early way out");return o(e),void(x="complete")}var f=null,p=0;f=function(){p++,p>=s&&(t(),o(e),x="complete")};for(var g=0;g0&&(r=e.substr(i+1),e=e.substring(0,i));var a;n&&(a={},a[r]=n);var s=f(e,t,a);return s&&r in s?s[r]:"{{"+e+"}}"},getData:function(){return w},getText:function(){return y},getLanguage:function(){return S},setLanguage:function(e,t){h(e,function(){t&&t(),b()})},getDirection:function(){var e=["ar","he","fa","ps","ur"],t=S.split("-",1)[0];return e.indexOf(t)>=0?"rtl":"ltr"},translate:b,getReadyState:function(){return x},ready:function(n){n&&("complete"==x||"interactive"==x?e.setTimeout(function(){n()}):t.addEventListener&&t.addEventListener("localized",function e(){t.removeEventListener("localized",e),n()}))}}}(window,document),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],t):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=t():e["pdfjs-dist/build/pdf"]=e.pdfjsDistBuildPdf=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=13)}([function(e,t,n){(function(e){function n(e){$=e}function i(){return $}function r(e){$>=K.infos&&console.log("Info: "+e)}function a(e){$>=K.warnings&&console.log("Warning: "+e)}function s(e){console.log("Deprecated API usage: "+e)}function o(e){throw $>=K.errors&&(console.log("Error: "+e),console.log(c())),new Error(e)}function c(){try{throw new Error}catch(e){return e.stack?e.stack.split("\n").slice(2).join("\n"):""}}function l(e,t){e||o(t)}function h(e,t){try{var n=new URL(e);if(!n.origin||"null"===n.origin)return!1}catch(e){return!1}var i=new URL(t,n);return n.origin===i.origin}function u(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function d(e,t){if(!e)return null;try{var n=t?new URL(e,t):new URL(e);if(u(n))return n}catch(e){}return null}function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}function p(e){var t;return function(){return e&&(t=Object.create(null),e(t),e=null),t}}function g(e){return"string"!=typeof e?(a("The argument for removeNullCharacters must be a string."),e):e.replace(he,"")}function v(e){l(null!==e&&"object"==typeof e&&void 0!==e.length,"Invalid argument for bytesToString");var t=e.length,n=8192;if(t>24&255,e>>16&255,e>>8&255,255&e)}function A(e){for(var t=1,n=0;e>t;)t<<=1,n++;return n}function S(e,t){return e[t]<<24>>24}function P(e,t){return e[t]<<8|e[t+1]}function x(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function C(){var e=new Uint8Array(2);e[0]=1;var t=new Uint16Array(e.buffer);return 1===t[0]}function _(){try{return new Function(""),!0}catch(e){return!1}}function L(e){var t,n=e.length,i=[];if("þ"===e[0]&&"ÿ"===e[1])for(t=2;t>2:t,n(this.length)}function t(e){return{get:function(){var t=this.buffer,n=e<<2;return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0},set:function(t){var n=this.buffer,i=e<<2;n[i]=255&t,n[i+1]=t>>8&255,n[i+2]=t>>16&255,n[i+3]=t>>>24&255}}}function n(n){for(;ie[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t},e.intersect=function(t,n){function i(e,t){return e-t}var r=[t[0],t[2],n[0],n[2]].sort(i),a=[t[1],t[3],n[1],n[3]].sort(i),s=[];return t=e.normalizeRect(t),n=e.normalizeRect(n),(r[0]===t[0]&&r[1]===n[0]||r[0]===n[0]&&r[1]===t[0])&&(s[0]=r[1],s[2]=r[2],(a[0]===t[1]&&a[1]===n[1]||a[0]===n[1]&&a[1]===t[1])&&(s[1]=a[1],s[3]=a[2],s))},e.sign=function(e){return e<0?-1:1};var n=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];return e.toRoman=function(e,t){l(F(e)&&e>0,"The number should be a positive integer.");for(var i,r=[];e>=1e3;)e-=1e3,r.push("M");i=e/100|0,e%=100,r.push(n[i]),i=e/10|0,e%=10,r.push(n[10+i]),r.push(n[20+e]);var a=r.join("");return t?a.toLowerCase():a},e.appendToArray=function(e,t){Array.prototype.push.apply(e,t)},e.prependToArray=function(e,t){Array.prototype.unshift.apply(e,t)},e.extendObj=function(e,t){for(var n in t)e[n]=t[n]},e.getInheritableProperty=function(e,t,n){for(;e&&!e.has(t);)e=e.get("Parent");return e?n?e.getArray(t):e.get(t):null},e.inherit=function(e,t,n){e.prototype=Object.create(t.prototype),e.prototype.constructor=e;for(var i in n)e.prototype[i]=n[i]},e.loadScript=function(e,t){var n=document.createElement("script"),i=!1;n.setAttribute("src",e),t&&(n.onload=function(){i||t(),i=!0}),document.getElementsByTagName("head")[0].appendChild(n)},e}(),pe=function(){function e(e,t,n,i,r,a){this.viewBox=e,this.scale=t,this.rotation=n,this.offsetX=i,this.offsetY=r;var s,o,c,l,h=(e[2]+e[0])/2,u=(e[3]+e[1])/2;switch(n%=360,n=n<0?n+360:n){case 180:s=-1,o=0,c=0,l=1;break;case 90:s=0,o=1,c=1,l=0;break;case 270:s=0,o=-1,c=-1,l=0;break;default:s=1,o=0,c=0,l=-1}a&&(c=-c,l=-l);var d,f,p,g;0===s?(d=Math.abs(u-e[1])*t+i,f=Math.abs(h-e[0])*t+r,p=Math.abs(e[3]-e[1])*t,g=Math.abs(e[2]-e[0])*t):(d=Math.abs(h-e[0])*t+i,f=Math.abs(u-e[1])*t+r,p=Math.abs(e[2]-e[0])*t,g=Math.abs(e[3]-e[1])*t),this.transform=[s*t,o*t,c*t,l*t,d-s*t*h-c*t*u,f-o*t*h-l*t*u],this.width=p,this.height=g,this.fontScale=t}return e.prototype={clone:function(t){t=t||{};var n="scale"in t?t.scale:this.scale,i="rotation"in t?t.rotation:this.rotation;return new e(this.viewBox.slice(),n,i,this.offsetX,this.offsetY,t.dontFlip)},convertToViewportPoint:function(e,t){return fe.applyTransform([e,t],this.transform)},convertToViewportRectangle:function(e){var t=fe.applyTransform([e[0],e[1]],this.transform),n=fe.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]},convertToPdfPoint:function(e,t){return fe.applyInverseTransform([e,t],this.transform)}},e}(),ge=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];!function(){if(U.Promise)return"function"!=typeof U.Promise.all&&(U.Promise.all=function(e){var t,n,i=0,r=[],a=new U.Promise(function(e,i){t=e,n=i});return e.forEach(function(e,a){i++,e.then(function(e){r[a]=e,i--,0===i&&t(r)},n)}),0===i&&t(r),a}),"function"!=typeof U.Promise.resolve&&(U.Promise.resolve=function(e){return new U.Promise(function(t){t(e)})}),"function"!=typeof U.Promise.reject&&(U.Promise.reject=function(e){return new U.Promise(function(t,n){n(e)})}),void("function"!=typeof U.Promise.prototype.catch&&(U.Promise.prototype.catch=function(e){return U.Promise.prototype.then(void 0,e)}));var e=0,t=1,n=2,i=500,r={handlers:[],running:!1,unhandledRejections:[],pendingRejectionCheck:!1,scheduleHandlers:function(t){t._status!==e&&(this.handlers=this.handlers.concat(t._handlers),t._handlers=[],this.running||(this.running=!0,setTimeout(this.runHandlers.bind(this),0)))},runHandlers:function(){for(var e=1,i=Date.now()+e;this.handlers.length>0;){var r=this.handlers.shift(),a=r.thisPromise._status,s=r.thisPromise._value;try{a===t?"function"==typeof r.onResolve&&(s=r.onResolve(s)):"function"==typeof r.onReject&&(s=r.onReject(s),a=t,r.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(r.thisPromise))}catch(e){a=n,s=e}if(r.nextPromise._updateStatus(a,s),Date.now()>=i)break}return this.handlers.length>0?void setTimeout(this.runHandlers.bind(this),0):void(this.running=!1)},addUnhandledRejection:function(e){this.unhandledRejections.push({promise:e,time:Date.now()}),this.scheduleRejectionCheck()},removeUnhandeledRejection:function(e){e._unhandledRejection=!1;for(var t=0;ti){var n=this.unhandledRejections[t].promise._value,r="Unhandled rejection: "+n;n.stack&&(r+="\n"+n.stack),a(r),this.unhandledRejections.splice(t),t--}this.unhandledRejections.length&&this.scheduleRejectionCheck()}.bind(this),i))}},s=function(t){this._status=e,this._handlers=[];try{t.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(e){this._reject(e)}};s.all=function(e){function t(e){a._status!==n&&(c=[],r(e))}var i,r,a=new s(function(e,t){i=e,r=t}),o=e.length,c=[];if(0===o)return i(c),a;for(var l=0,h=e.length;la&&(a=s.length)}for(t=0,n=i.length;t>2,d=(3&c)<<4|l>>4,f=s+1>6:64,p=s+232&&t<127&&[34,35,60,62,63,96].indexOf(t)===-1?e:encodeURIComponent(e)}function a(e){var t=e.charCodeAt(0);return t>32&&t<127&&[34,35,60,62,96].indexOf(t)===-1?e:encodeURIComponent(e)}function s(e,s,o){function c(e){w.push(e)}var l=s||"scheme start",h=0,v="",m=!1,b=!1,w=[];e:for(;(e[h-1]!==f||0===h)&&!this._isInvalid;){var y=e[h];switch(l){case"scheme start":if(!y||!p.test(y)){if(s){c("Invalid scheme.");break e}v="",l="no scheme";continue}v+=y.toLowerCase(),l="scheme";break;case"scheme":if(y&&g.test(y))v+=y.toLowerCase();else{if(":"!==y){if(s){if(f===y)break e;c("Code point not allowed in scheme: "+y);break e}v="",h=0,l="no scheme";continue}if(this._scheme=v,v="",s)break e;t(this._scheme)&&(this._isRelative=!0),l="file"===this._scheme?"relative":this._isRelative&&o&&o._scheme===this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"===y?(this._query="?",l="query"):"#"===y?(this._fragment="#",l="fragment"):f!==y&&"\t"!==y&&"\n"!==y&&"\r"!==y&&(this._schemeData+=r(y));break;case"no scheme":if(o&&t(o._scheme)){l="relative";continue}c("Missing scheme."),n.call(this);break;case"relative or authority":if("/"!==y||"/"!==e[h+1]){c("Expected /, got: "+y),l="relative";continue}l="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!==this._scheme&&(this._scheme=o._scheme),f===y){this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query=o._query,this._username=o._username,this._password=o._password;break e}if("/"===y||"\\"===y)"\\"===y&&c("\\ is an invalid code point."),l="relative slash";else if("?"===y)this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query="?",this._username=o._username,this._password=o._password,l="query";else{if("#"!==y){var A=e[h+1],S=e[h+2];("file"!==this._scheme||!p.test(y)||":"!==A&&"|"!==A||f!==S&&"/"!==S&&"\\"!==S&&"?"!==S&&"#"!==S)&&(this._host=o._host,this._port=o._port,this._username=o._username,this._password=o._password,this._path=o._path.slice(),this._path.pop()),l="relative path";continue}this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query=o._query,this._fragment="#",this._username=o._username,this._password=o._password,l="fragment"}break;case"relative slash":if("/"!==y&&"\\"!==y){"file"!==this._scheme&&(this._host=o._host,this._port=o._port,this._username=o._username,this._password=o._password),l="relative path";continue}"\\"===y&&c("\\ is an invalid code point."),l="file"===this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!==y){c("Expected '/', got: "+y),l="authority ignore slashes";continue}l="authority second slash";break;case"authority second slash":if(l="authority ignore slashes","/"!==y){c("Expected '/', got: "+y);continue}break;case"authority ignore slashes":if("/"!==y&&"\\"!==y){l="authority";continue}c("Expected authority, got: "+y);break;case"authority":if("@"===y){m&&(c("@ already seen."),v+="%40"),m=!0;for(var P=0;P0?t:e.length,n>0?n:e.length);return e.substring(e.lastIndexOf("/",i)+1,i)}function s(e){var t=l.globalScope.PDFJS;switch(e){case"pdfBug":return!!t&&t.pdfBug;case"disableAutoFetch":return!!t&&t.disableAutoFetch;case"disableStream":return!!t&&t.disableStream;case"disableRange":return!!t&&t.disableRange;case"disableFontFace":return!!t&&t.disableFontFace;case"disableCreateObjectURL":return!!t&&t.disableCreateObjectURL;case"disableWebGL":return!t||t.disableWebGL;case"cMapUrl":return t?t.cMapUrl:null;case"cMapPacked":return!!t&&t.cMapPacked;case"postMessageTransfers":return!t||t.postMessageTransfers;case"workerSrc":return t?t.workerSrc:null;case"disableWorker":return!!t&&t.disableWorker;case"maxImageSize":return t?t.maxImageSize:-1;case"imageResourcesPath":return t?t.imageResourcesPath:"";case"isEvalSupported":return!t||t.isEvalSupported;case"externalLinkTarget":if(!t)return b.NONE;switch(t.externalLinkTarget){case b.NONE:case b.SELF:case b.BLANK:case b.PARENT:case b.TOP:return t.externalLinkTarget}return d("PDFJS.externalLinkTarget is invalid: "+t.externalLinkTarget),t.externalLinkTarget=b.NONE,b.NONE;case"externalLinkRel":return t?t.externalLinkRel:g;case"enableStats":return!(!t||!t.enableStats);default:throw new Error("Unknown default setting: "+e)}}function o(){var e=s("externalLinkTarget");switch(e){case b.NONE:return!1;case b.SELF:case b.BLANK:case b.PARENT:case b.TOP:return!0}}function c(e,t){f("isValidUrl(), please use createValidAbsoluteUrl() instead.");var n=t?"http://example.com":null;return null!==p(e,n)}var l=n(0),h=l.assert,u=l.removeNullCharacters,d=l.warn,f=l.deprecated,p=l.createValidAbsoluteUrl,g="noopener noreferrer nofollow";i.prototype={create:function(e,t){h(e>0&&t>0,"invalid canvas size");var n=document.createElement("canvas"),i=n.getContext("2d");return n.width=e,n.height=t,{canvas:n,context:i}},reset:function(e,t,n){h(e.canvas,"canvas is not specified"),h(t>0&&n>0,"invalid canvas size"),e.canvas.width=t,e.canvas.height=n},destroy:function(e){h(e.canvas,"canvas is not specified"),e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}};var v,m=function(){function e(){}var t=["ms","Moz","Webkit","O"],n=Object.create(null);return e.getProp=function(e,i){if(1===arguments.length&&"string"==typeof n[e])return n[e];i=i||document.documentElement;var r,a,s=i.style;if("string"==typeof s[e])return n[e]=e;a=e.charAt(0).toUpperCase()+e.slice(1);for(var o=0,c=t.length;o0){i.style.borderWidth=e.borderStyle.width+"px",e.borderStyle.style!==s.UNDERLINE&&(r-=2*e.borderStyle.width,a-=2*e.borderStyle.width);var c=e.borderStyle.horizontalCornerRadius,h=e.borderStyle.verticalCornerRadius;if(c>0||h>0){var u=c+"px / "+h+"px";p.setProp("borderRadius",i,u)}switch(e.borderStyle.style){case s.SOLID:i.style.borderStyle="solid";break;case s.DASHED:i.style.borderStyle="dashed";break;case s.BEVELED:f("Unimplemented border style: beveled");break;case s.INSET:f("Unimplemented border style: inset");break;case s.UNDERLINE:i.style.borderBottomStyle="solid"}e.color?i.style.borderColor=l.makeCssRgb(0|e.color[0],0|e.color[1],0|e.color[2]):i.style.borderWidth=0}return i.style.left=o[0]+"px",i.style.top=o[1]+"px",i.style.width=r+"px",i.style.height=a+"px",i},_createPopup:function(e,t,n){t||(t=document.createElement("div"),t.style.height=e.style.height,t.style.width=e.style.width,e.appendChild(t));var i=new C({container:e,trigger:t,color:n.color,title:n.title,contents:n.contents,hideWrapper:!0}),r=i.render();r.style.left=e.style.width,e.appendChild(r)},render:function(){throw new Error("Abstract method AnnotationElement.render called")}},e}(),m=function(){function e(e){v.call(this,e,!0)}return l.inherit(e,v,{render:function(){this.container.className="linkAnnotation";var e=document.createElement("a");return h(e,{url:this.data.url,target:this.data.newWindow?u.BLANK:void 0}),this.data.url||(this.data.action?this._bindNamedAction(e,this.data.action):this._bindLink(e,this.data.dest)),this.container.appendChild(e),this.container},_bindLink:function(e,t){var n=this;e.href=this.linkService.getDestinationHash(t),e.onclick=function(){return t&&n.linkService.navigateTo(t),!1},t&&(e.className="internalLink")},_bindNamedAction:function(e,t){var n=this;e.href=this.linkService.getAnchorUrl(""),e.onclick=function(){return n.linkService.executeNamedAction(t),!1},e.className="internalLink"}}),e}(),b=function(){function e(e){var t=!!(e.data.hasPopup||e.data.title||e.data.contents);v.call(this,e,t)}return l.inherit(e,v,{render:function(){this.container.className="textAnnotation";var e=document.createElement("img");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,e,this.data),this.container.appendChild(e),this.container}}),e}(),w=function(){function e(e,t){v.call(this,e,t)}return l.inherit(e,v,{render:function(){return this.container}}),e}(),y=function(){function e(e){var t=e.renderInteractiveForms||!e.data.hasAppearance&&!!e.data.fieldValue;w.call(this,e,t)}var t=["left","center","right"];return l.inherit(e,w,{render:function(){this.container.className="textWidgetAnnotation";var e=null;if(this.renderInteractiveForms){if(this.data.multiLine?(e=document.createElement("textarea"),e.textContent=this.data.fieldValue):(e=document.createElement("input"),e.type="text",e.setAttribute("value",this.data.fieldValue)),e.disabled=this.data.readOnly,null!==this.data.maxLen&&(e.maxLength=this.data.maxLen),this.data.comb){var n=this.data.rect[2]-this.data.rect[0],i=n/this.data.maxLen;e.classList.add("comb"),e.style.letterSpacing="calc("+i+"px - 1ch)"}}else{e=document.createElement("div"),e.textContent=this.data.fieldValue,e.style.verticalAlign="middle",e.style.display="table-cell";var r=null;this.data.fontRefName&&(r=this.page.commonObjs.getData(this.data.fontRefName)),this._setTextStyle(e,r)}return null!==this.data.textAlignment&&(e.style.textAlign=t[this.data.textAlignment]),this.container.appendChild(e),this.container},_setTextStyle:function(e,t){var n=e.style;if(n.fontSize=this.data.fontSize+"px",n.direction=this.data.fontDirection<0?"rtl":"ltr",t){n.fontWeight=t.black?t.bold?"900":"bold":t.bold?"bold":"normal",n.fontStyle=t.italic?"italic":"normal";var i=t.loadedName?'"'+t.loadedName+'", ':"",r=t.fallbackName||"Helvetica, sans-serif";n.fontFamily=i+r}}}),e}(),A=function(){function e(e){w.call(this,e,e.renderInteractiveForms)}return l.inherit(e,w,{render:function(){this.container.className="buttonWidgetAnnotation checkBox";var e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="checkbox",this.data.fieldValue&&"Off"!==this.data.fieldValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}),e}(),S=function(){function e(e){w.call(this,e,e.renderInteractiveForms)}return l.inherit(e,w,{render:function(){this.container.className="buttonWidgetAnnotation radioButton";var e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="radio",e.name=this.data.fieldName,this.data.fieldValue===this.data.buttonValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}),e}(),P=function(){function e(e){w.call(this,e,e.renderInteractiveForms)}return l.inherit(e,w,{render:function(){this.container.className="choiceWidgetAnnotation";var e=document.createElement("select");e.disabled=this.data.readOnly,this.data.combo||(e.size=this.data.options.length,this.data.multiSelect&&(e.multiple=!0));for(var t=0,n=this.data.options.length;t=0&&r.setAttribute("selected",!0),e.appendChild(r)}return this.container.appendChild(e),this.container}}),e}(),x=function(){function e(e){var t=!(!e.data.title&&!e.data.contents);v.call(this,e,t)}return l.inherit(e,v,{render:function(){this.container.className="popupAnnotation";var e='[data-annotation-id="'+this.data.parentId+'"]',t=this.layer.querySelector(e);if(!t)return this.container;var n=new C({container:this.container,trigger:t,color:this.data.color,title:this.data.title,contents:this.data.contents}),i=parseFloat(t.style.left),r=parseFloat(t.style.width);return p.setProp("transformOrigin",this.container,-(i+r)+"px -"+t.style.top),this.container.style.left=i+r+"px",this.container.appendChild(n.render()),this.container}}),e}(),C=function(){function e(e){this.container=e.container,this.trigger=e.trigger,this.color=e.color,this.title=e.title,this.contents=e.contents,this.hideWrapper=e.hideWrapper||!1,this.pinned=!1}var t=.7;return e.prototype={render:function(){var e=document.createElement("div");e.className="popupWrapper",this.hideElement=this.hideWrapper?e:this.container,this.hideElement.setAttribute("hidden",!0);var n=document.createElement("div");n.className="popup";var i=this.color;if(i){var r=t*(255-i[0])+i[0],a=t*(255-i[1])+i[1],s=t*(255-i[2])+i[2];n.style.backgroundColor=l.makeCssRgb(0|r,0|a,0|s)}var o=this._formatContents(this.contents),c=document.createElement("h1");return c.textContent=this.title,this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),n.addEventListener("click",this._hide.bind(this,!0)),n.appendChild(c),n.appendChild(o),e.appendChild(n),e},_formatContents:function(e){for(var t=document.createElement("p"),n=e.split(/(?:\r\n?|\n)/),i=0,r=n.length;i1&&S("getDocument is called with pdfDataRangeTransport, passwordCallback or progressCallback argument"),t&&(t instanceof q||(t=Object.create(t),t.length=e.length,t.initialData=e.initialData,t.abort||(t.abort=function(){})),e=Object.create(e),e.range=t),a.onPassword=n||null,a.onProgress=i||null;var s;"string"==typeof e?s={url:e}:L(e)?s={data:e}:e instanceof q?s={range:e}:("object"!=typeof e&&A("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object"),e.url||e.data||e.range||A("Invalid parameter object: need either .data, .range or .url"),s=e);var o={},c=null,l=null;for(var h in s)if("url"!==h||"undefined"==typeof window)if("range"!==h)if("worker"!==h)if("data"!==h||s[h]instanceof Uint8Array)o[h]=s[h];else{var u=s[h];"string"==typeof u?o[h]=E(u):"object"!=typeof u||null===u||isNaN(u.length)?L(u)?o[h]=new Uint8Array(u):A("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property."):o[h]=new Uint8Array(u)}else l=s[h];else c=s[h];else o[h]=new URL(s[h],window.location).href;o.rangeChunkSize=o.rangeChunkSize||j,o.disableNativeImageDecoder=o.disableNativeImageDecoder===!0,l||(l=new Q,a._worker=l);var f=a.docId;return l.promise.then(function(){if(a.destroyed)throw new Error("Loading aborted");return r(l,o,c,f).then(function(e){if(a.destroyed)throw new Error("Loading aborted");var t=new d(f,e,l.port),n=new K(t,a,c);a._transport=n,t.send("Ready",null)})}).catch(a._capability.reject),a}function r(e,t,n,i){return e.destroyed?Promise.reject(new Error("Worker was destroyed")):(t.disableAutoFetch=B("disableAutoFetch"),t.disableStream=B("disableStream"),t.chunkedViewerLoading=!!n,n&&(t.length=n.length,t.initialData=n.initialData),e.messageHandler.sendWithPromise("GetDocRequest",{docId:i,source:t,disableRange:B("disableRange"),maxImageSize:B("maxImageSize"),cMapUrl:B("cMapUrl"),cMapPacked:B("cMapPacked"),disableFontFace:B("disableFontFace"),disableCreateObjectURL:B("disableCreateObjectURL"),postMessageTransfers:B("postMessageTransfers")&&!U,docBaseUrl:t.docBaseUrl,disableNativeImageDecoder:t.disableNativeImageDecoder}).then(function(t){if(e.destroyed)throw new Error("Worker was destroyed");return t}))}var a,s=n(0),o=n(11),c=n(10),l=n(6),h=n(1),u=s.InvalidPDFException,d=s.MessageHandler,f=s.MissingPDFException,p=s.PageViewport,g=s.PasswordException,v=s.StatTimer,m=s.UnexpectedResponseException,b=s.UnknownErrorException,w=s.Util,y=s.createPromiseCapability,A=s.error,S=s.deprecated,P=s.getVerbosityLevel,x=s.info,C=s.isInt,_=s.isArray,L=s.isArrayBuffer,k=s.isSameOrigin,T=s.loadJpegStream,E=s.stringToBytes,I=s.globalScope,F=s.warn,R=o.FontFaceObject,D=o.FontLoader,N=c.CanvasGraphics,O=l.Metadata,B=h.getDefaultSetting,M=h.DOMCanvasFactory,j=65536,V=!1,U=!1,H="undefined"!=typeof document&&document.currentScript?document.currentScript.src:null,z=null,W=!1;if("undefined"==typeof __pdfjsdev_webpack__){"undefined"==typeof window?(V=!0,"undefined"==typeof require.ensure&&(require.ensure=require("node-ensure")),W=!0):"undefined"!=typeof require&&"function"==typeof require.ensure&&(W=!0),"undefined"!=typeof requirejs&&requirejs.toUrl&&(a=requirejs.toUrl("pdfjs-dist/build/pdf.worker.js"));var G="undefined"!=typeof requirejs&&requirejs.load; z=W?function(e){require.ensure([],function(){var t=require("./pdf.worker.js");e(t.WorkerMessageHandler)})}:G?function(e){requirejs(["pdfjs-dist/build/pdf.worker"],function(t){e(t.WorkerMessageHandler)})}:null}var X=function(){function e(){this._capability=y(),this._transport=null,this._worker=null,this.docId="d"+t++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}var t=0;return e.prototype={get promise(){return this._capability.promise},destroy:function(){this.destroyed=!0;var e=this._transport?this._transport.destroy():Promise.resolve();return e.then(function(){this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}.bind(this))},then:function(e,t){return this.promise.then.apply(this.promise,arguments)}},e}(),q=function(){function e(e,t){this.length=e,this.initialData=t,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._readyCapability=y()}return e.prototype={addRangeListener:function(e){this._rangeListeners.push(e)},addProgressListener:function(e){this._progressListeners.push(e)},addProgressiveReadListener:function(e){this._progressiveReadListeners.push(e)},onDataRange:function(e,t){for(var n=this._rangeListeners,i=0,r=n.length;i=0&&s.renderTasks.splice(t,1),l.cleanupAfterRender&&(l.pendingCleanup=!0),l._tryCleanup(),e?o.capability.reject(e):o.capability.resolve(),n.timeEnd("Rendering"),n.timeEnd("Overall")}var n=this.stats;n.time("Overall"),this.pendingCleanup=!1;var i="print"===e.intent?"print":"display",r=e.renderInteractiveForms===!0,a=e.canvasFactory||new M;this.intentStates[i]||(this.intentStates[i]=Object.create(null));var s=this.intentStates[i];s.displayReadyCapability||(s.receivingOperatorList=!0,s.displayReadyCapability=y(),s.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.stats.time("Page Request"),this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageNumber-1,intent:i,renderInteractiveForms:r}));var o=new ee(t,e,this.objs,this.commonObjs,s.operatorList,this.pageNumber,a);o.useRequestAnimationFrame="print"!==i,s.renderTasks||(s.renderTasks=[]),s.renderTasks.push(o);var c=o.task;e.continueCallback&&(S("render is used with continueCallback parameter"),c.onContinue=e.continueCallback);var l=this;return s.displayReadyCapability.promise.then(function(e){return l.pendingCleanup?void t():(n.time("Rendering"),o.initializeGraphics(e),void o.operatorListChanged())},function(e){t(e)}),c},getOperatorList:function(){function e(){if(i.operatorList.lastChunk){i.opListReadCapability.resolve(i.operatorList);var e=i.renderTasks.indexOf(n);e>=0&&i.renderTasks.splice(e,1)}}var t="oplist";this.intentStates[t]||(this.intentStates[t]=Object.create(null));var n,i=this.intentStates[t];return i.opListReadCapability||(n={},n.operatorListChanged=e,i.receivingOperatorList=!0,i.opListReadCapability=y(),i.renderTasks=[],i.renderTasks.push(n),i.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageIndex,intent:t})),i.opListReadCapability.promise},getTextContent:function(e){return this.transport.messageHandler.sendWithPromise("GetTextContent",{pageIndex:this.pageNumber-1,normalizeWhitespace:!(!e||e.normalizeWhitespace!==!0),combineTextItems:!e||e.disableCombineTextItems!==!0})},_destroy:function(){this.destroyed=!0,this.transport.pageCache[this.pageIndex]=null;var e=[];return Object.keys(this.intentStates).forEach(function(t){if("oplist"!==t){var n=this.intentStates[t];n.renderTasks.forEach(function(t){var n=t.capability.promise.catch(function(){});e.push(n),t.cancel()})}},this),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(e)},destroy:function(){S("page destroy method, use cleanup() instead"),this.cleanup()},cleanup:function(){this.pendingCleanup=!0,this._tryCleanup()},_tryCleanup:function(){this.pendingCleanup&&!Object.keys(this.intentStates).some(function(e){var t=this.intentStates[e];return 0!==t.renderTasks.length||t.receivingOperatorList},this)&&(Object.keys(this.intentStates).forEach(function(e){delete this.intentStates[e]},this),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1)},_startRenderPage:function(e,t){var n=this.intentStates[t];n.displayReadyCapability&&n.displayReadyCapability.resolve(e)},_renderPageChunk:function(e,t){var n,i,r=this.intentStates[t];for(n=0,i=e.length;n=0;return r=e===a?e:s?new e.constructor(a,e.byteOffset,e.byteLength):new e.constructor(e),i.set(e,r),r}r=_(e)?[]:{},i.set(e,r);for(var o in e){for(var c,l=e;!(c=Object.getOwnPropertyDescriptor(l,o));)l=Object.getPrototypeOf(l);"undefined"!=typeof c.value&&"function"!=typeof c.value&&(r[o]=n(c.value))}return r}if(!this._defer)return void this._listeners.forEach(function(t){t.call(this,{data:e})},this);var i=new WeakMap,r={data:n(e)};this._deferred.then(function(){this._listeners.forEach(function(e){e.call(this,r)},this)}.bind(this))},addEventListener:function(e,t){this._listeners.push(t)},removeEventListener:function(e,t){var n=this._listeners.indexOf(t);this._listeners.splice(n,1)},terminate:function(){this._listeners=[]}},r.prototype={get promise(){return this._readyCapability.promise},get port(){return this._port},get messageHandler(){return this._messageHandler},_initialize:function(){if(!V&&!B("disableWorker")&&"undefined"!=typeof Worker){var t=e();try{k(window.location.href,t)||(t=i(new URL(t,window.location).href));var n=new Worker(t),r=new d("main","worker",n),a=function(){n.removeEventListener("error",s),r.destroy(),n.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()}.bind(this),s=function(e){this._webWorker||a()}.bind(this);n.addEventListener("error",s),r.on("test",function(e){if(n.removeEventListener("error",s),this.destroyed)return void a();var t=e&&e.supportTypedArray;t?(this._messageHandler=r,this._port=n,this._webWorker=n,e.supportTransfers||(U=!0),this._readyCapability.resolve(),r.send("configure",{verbosity:P()})):(this._setupFakeWorker(),r.destroy(),n.terminate())}.bind(this)),r.on("console_log",function(e){console.log.apply(console,e)}),r.on("console_error",function(e){console.error.apply(console,e)}),r.on("ready",function(e){if(n.removeEventListener("error",s),this.destroyed)return void a();try{o()}catch(e){this._setupFakeWorker()}}.bind(this));var o=function(){var e=B("postMessageTransfers")&&!U,t=new Uint8Array([e?255:0]);try{r.send("test",t,[t.buffer])}catch(e){x("Cannot use postMessage transfers"),t[0]=0,r.send("test",t)}};return void o()}catch(e){x("The worker has been disabled.")}}this._setupFakeWorker()},_setupFakeWorker:function(){V||B("disableWorker")||(F("Setting up fake worker."),V=!0),t().then(function(e){if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));var t=Uint8Array!==Float32Array,i=new n(t);this._port=i;var r="fake"+o++,a=new d(r+"_worker",r,i);e.setup(a,i);var s=new d(r,r+"_worker",i);this._messageHandler=s,this._readyCapability.resolve()}.bind(this))},destroy:function(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}},r}(),K=function(){function e(e,t,n){this.messageHandler=e,this.loadingTask=t,this.pdfDataRangeTransport=n,this.commonObjs=new Z,this.fontLoader=new D(t.docId),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=y(),this.setupMessageHandler()}return e.prototype={destroy:function(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=y(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));var e=[];this.pageCache.forEach(function(t){t&&e.push(t._destroy())}),this.pageCache=[],this.pagePromises=[];var t=this,n=this.messageHandler.sendWithPromise("Terminate",null);return e.push(n),Promise.all(e).then(function(){t.fontLoader.clear(),t.pdfDataRangeTransport&&(t.pdfDataRangeTransport.abort(),t.pdfDataRangeTransport=null),t.messageHandler&&(t.messageHandler.destroy(),t.messageHandler=null),t.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise},setupMessageHandler:function(){var e=this.messageHandler,t=this.loadingTask,n=this.pdfDataRangeTransport;n&&(n.addRangeListener(function(t,n){e.send("OnDataRange",{begin:t,chunk:n})}),n.addProgressListener(function(t){e.send("OnDataProgress",{loaded:t})}),n.addProgressiveReadListener(function(t){e.send("OnDataRange",{chunk:t})}),e.on("RequestDataRange",function(e){n.requestDataRange(e.begin,e.end)},this)),e.on("GetDoc",function(e){var t=e.pdfInfo;this.numPages=e.pdfInfo.numPages;var n=this.loadingTask,i=new Y(t,this,n);this.pdfDocument=i,n._capability.resolve(i)},this),e.on("PasswordRequest",function(e){if(this._passwordCapability=y(),t.onPassword){var n=function(e){this._passwordCapability.resolve({password:e})}.bind(this);t.onPassword(n,e.code)}else this._passwordCapability.reject(new g(e.message,e.code));return this._passwordCapability.promise},this),e.on("PasswordException",function(e){t._capability.reject(new g(e.message,e.code))},this),e.on("InvalidPDF",function(e){this.loadingTask._capability.reject(new u(e.message))},this),e.on("MissingPDF",function(e){this.loadingTask._capability.reject(new f(e.message))},this),e.on("UnexpectedResponse",function(e){this.loadingTask._capability.reject(new m(e.message,e.status))},this),e.on("UnknownError",function(e){this.loadingTask._capability.reject(new b(e.message,e.details))},this),e.on("DataLoaded",function(e){this.downloadInfoCapability.resolve(e)},this),e.on("PDFManagerReady",function(e){this.pdfDataRangeTransport&&this.pdfDataRangeTransport.transportReady()},this),e.on("StartRenderPage",function(e){if(!this.destroyed){var t=this.pageCache[e.pageIndex];t.stats.timeEnd("Page Request"),t._startRenderPage(e.transparency,e.intent)}},this),e.on("RenderPageChunk",function(e){if(!this.destroyed){var t=this.pageCache[e.pageIndex];t._renderPageChunk(e.operatorList,e.intent)}},this),e.on("commonobj",function(e){if(!this.destroyed){var t=e[0],n=e[1];if(!this.commonObjs.hasData(t))switch(n){case"Font":var i=e[2];if("error"in i){var r=i.error;F("Error during font loading: "+r),this.commonObjs.resolve(t,r);break}var a=null;B("pdfBug")&&I.FontInspector&&I.FontInspector.enabled&&(a={registerFont:function(e,t){I.FontInspector.fontAdded(e,t)}});var s=new R(i,{isEvalSuported:B("isEvalSupported"),disableFontFace:B("disableFontFace"),fontRegistry:a});this.fontLoader.bind([s],function(e){this.commonObjs.resolve(t,s)}.bind(this));break;case"FontPath":this.commonObjs.resolve(t,e[2]);break;default:A("Got unknown common object type "+n)}}},this),e.on("obj",function(e){if(!this.destroyed){var t,n=e[0],i=e[1],r=e[2],a=this.pageCache[i];if(!a.objs.hasData(n))switch(r){case"JpegStream":t=e[3],T(n,t,a.objs);break;case"Image":t=e[3],a.objs.resolve(n,t);var s=8e6;t&&"data"in t&&t.data.length>s&&(a.cleanupAfterRender=!0);break;default:A("Got unknown object type "+r)}}},this),e.on("DocProgress",function(e){if(!this.destroyed){var t=this.loadingTask;t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}},this),e.on("PageError",function(e){if(!this.destroyed){var t=this.pageCache[e.pageNum-1],n=t.intentStates[e.intent];if(n.displayReadyCapability?n.displayReadyCapability.reject(e.error):A(e.error),n.operatorList){n.operatorList.lastChunk=!0;for(var i=0;ithis.numPages)return Promise.reject(new Error("Invalid page request"));var n=e-1;if(n in this.pagePromises)return this.pagePromises[n];var i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(function(e){if(this.destroyed)throw new Error("Transport destroyed");var t=new J(n,e,this);return this.pageCache[n]=t,t}.bind(this));return this.pagePromises[n]=i,i},getPageIndex:function(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e}).catch(function(e){return Promise.reject(new Error(e))})},getAnnotations:function(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})},getDestinations:function(){return this.messageHandler.sendWithPromise("GetDestinations",null)},getDestination:function(e){return this.messageHandler.sendWithPromise("GetDestination",{id:e})},getPageLabels:function(){return this.messageHandler.sendWithPromise("GetPageLabels",null)},getAttachments:function(){return this.messageHandler.sendWithPromise("GetAttachments",null)},getJavaScript:function(){return this.messageHandler.sendWithPromise("GetJavaScript",null)},getOutline:function(){return this.messageHandler.sendWithPromise("GetOutline",null)},getMetadata:function(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(function(e){return{info:e[0],metadata:e[1]?new O(e[1]):null}})},getStats:function(){return this.messageHandler.sendWithPromise("GetStats",null)},startCleanup:function(){this.messageHandler.sendWithPromise("Cleanup",null).then(function(){for(var e=0,t=this.pageCache.length;e>>8^s}return i^-1}function t(t,n,i,r){var a=r,s=n.length;i[a]=s>>24&255,i[a+1]=s>>16&255,i[a+2]=s>>8&255,i[a+3]=255&s,a+=4,i[a]=255&t.charCodeAt(0),i[a+1]=255&t.charCodeAt(1),i[a+2]=255&t.charCodeAt(2),i[a+3]=255&t.charCodeAt(3),a+=4,i.set(n,a),a+=n.length;var o=e(i,r+4,a);i[a]=o>>24&255,i[a+1]=o>>16&255,i[a+2]=o>>8&255,i[a+3]=255&o}function n(e,t,n){for(var i=1,r=0,a=t;a>3;break;case s.RGB_24BPP:l=2,c=8,h=3*u;break;case s.RGBA_32BPP:l=6,c=8,h=4*u;break;default:throw new Error("invalid format")}var g,v,m=new Uint8Array((1+h)*f),b=0,w=0;for(g=0;g>24&255,u>>16&255,u>>8&255,255&u,f>>24&255,f>>16&255,f>>8&255,255&f,c,l,0,0,0]),A=m.length,S=65535,P=Math.ceil(A/S),x=new Uint8Array(2+A+5*P+4),C=0;x[C++]=120,x[C++]=156;for(var _=0;A>S;)x[C++]=0,x[C++]=255,x[C++]=255,x[C++]=0,x[C++]=0,x.set(m.subarray(_,_+S),C),C+=S,_+=S,A-=S;x[C++]=1,x[C++]=255&A,x[C++]=A>>8&255,x[C++]=65535&~A&255,x[C++]=(65535&~A)>>8&255,x.set(m.subarray(_),C),C+=m.length-_;var L=n(m,0,m.length);x[C++]=L>>24&255,x[C++]=L>>16&255,x[C++]=L>>8&255,x[C++]=255&L;var k=r.length+3*a+y.length+x.length,T=new Uint8Array(k),E=0;return T.set(r,E),E+=r.length,t("IHDR",y,T,E),E+=a+y.length,t("IDATA",x,T,E),E+=a+x.length,t("IEND",new Uint8Array(0),T,E),d(T,"image/png",o)}for(var r=new Uint8Array([137,80,78,71,13,10,26,10]),a=12,o=new Int32Array(256),c=0;c<256;c++){for(var l=c,h=0;h<8;h++)l=1&l?3988292384^l>>1&2147483647:l>>1&2147483647;o[c]=l}return function(e,t){var n=void 0===e.kind?s.GRAYSCALE_1BPP:e.kind;return i(e,n,t)}}(),g=function(){function e(){this.fontSizeScale=1,this.fontWeight=f.fontWeight,this.fontSize=0,this.textMatrix=a,this.fontMatrix=r,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=f.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}return e.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(e,t){this.x=e,this.y=t}},e}(),v=function(){function e(e){for(var t=[],n=[],i=e.length,r=0;r1&&(h.vertical?s.canvasWidth=n.height*t._viewport.scale:s.canvasWidth=n.width*t._viewport.scale),t._textDivProperties.set(r,s),t._enhanceTextSelection){var v=1,m=0;0!==l&&(v=Math.cos(l),m=Math.sin(l));var b,w,y=(h.vertical?n.height:n.width)*t._viewport.scale,A=u;0!==l?(b=[v,m,-m,v,f,g],w=a.getAxialAlignedBoundingBox([0,0,y,A],b)):w=[f,g,f+y,g+A],t._bounds.push({left:w[0],top:w[1],right:w[2],bottom:w[3],div:r,size:[y,A],m:b})}}function n(e){if(!e._canceled){var t=e._container,n=e._textDivs,i=e._capability,r=n.length;if(r>d)return e._renderingDone=!0,void i.resolve();var a=document.createElement("canvas");a.mozOpaque=!0;for(var s,c,l=a.getContext("2d",{alpha:!1}),h=0;h0&&(f.scale=f.canvasWidth/v,m="scaleX("+f.scale+")"),0!==f.angle&&(m="rotate("+f.angle+"deg) "+m),""!==m&&(f.originalTransform=m,o.setProp("transform",u,m)),e._textDivProperties.set(u,f)}}e._renderingDone=!0,i.resolve()}}function i(e){for(var t=e._bounds,n=e._viewport,i=r(n.width,n.height,t),s=0;s0&&(i=i?Math.min(a,i):a)}return i},m=1+Math.min(Math.abs(d),Math.abs(f));c.paddingLeft=v(g,32,16)/m,c.paddingTop=v(g,48,16)/m,c.paddingRight=v(g,0,16)/m,c.paddingBottom=v(g,16,16)/m,e._textDivProperties.set(o,c)}else c.paddingLeft=t[s].left-i[s].left,c.paddingTop=t[s].top-i[s].top,c.paddingRight=i[s].right-t[s].right,c.paddingBottom=i[s].bottom-t[s].bottom,e._textDivProperties.set(o,c)}}function r(e,t,n){var i=n.map(function(e,t){return{x1:e.left,y1:e.top,x2:e.right,y2:e.bottom,index:t,x1New:void 0,x2New:void 0}});l(e,i);var r=new Array(n.length);return i.forEach(function(e){var t=e.index;r[t]={left:e.x1New,top:0,right:e.x2New,bottom:0}}),n.map(function(t,n){var a=r[n],s=i[n];s.x1=t.top,s.y1=e-a.right,s.x2=t.bottom,s.y2=e-a.left,s.index=n,s.x1New=void 0,s.x2New=void 0}),l(t,i),i.forEach(function(e){var t=e.index;r[t].top=e.x1New,r[t].bottom=e.x2New}),r}function l(e,t){t.sort(function(e,t){return e.x1-t.x1||e.index-t.index});var n={x1:-(1/0),y1:-(1/0),x2:0,y2:1/0,index:-1,x1New:0,x2New:0},i=[{start:-(1/0),end:1/0,boundary:n}];t.forEach(function(e){for(var t=0;t=0&&i[n].start>=e.y2;)n--;var r,a,s,o,c=-(1/0);for(s=t;s<=n;s++){r=i[s],a=r.boundary;var l;l=a.x2>e.x1?a.index>e.index?a.x1New:e.x1:void 0===a.x2New?(a.x2+e.x1)/2:a.x2New,l>c&&(c=l)}for(e.x1New=c,s=t;s<=n;s++)r=i[s],a=r.boundary,void 0===a.x2New?a.x2>e.x1?a.index>e.index&&(a.x2New=a.x2):a.x2New=c:a.x2New>c&&(a.x2New=Math.max(c,a.x2));var h=[],u=null;for(s=t;s<=n;s++){r=i[s],a=r.boundary;var d=a.x2>e.x2?a:e;u===d?h[h.length-1].end=r.end:(h.push({start:r.start,end:r.end,boundary:d}),u=d)}for(i[t].start=0&&i[o].start>=a.y1;o--)f=i[o].boundary===a;for(o=n+1;!f&&o\\376\\377([^<]+)/g,function(e,t){for(var n=t.replace(/\\([0-3])([0-7])([0-7])/g,function(e,t,n,i){return String.fromCharCode(64*t+8*n+1*i)}),i="",r=0;r=32&&a<127&&60!==a&&62!==a&&38!==a?String.fromCharCode(a):"&#x"+(65536+a).toString(16).substring(1)+";"}return">"+i})}function r(e){if("string"==typeof e){e=i(e);var t=new DOMParser;e=t.parseFromString(e,"application/xml")}else e instanceof Document||s("Metadata: Invalid metadata object");this.metaDocument=e,this.metadata=Object.create(null),this.parse()}var a=n(0),s=a.error;r.prototype={parse:function(){var e=this.metaDocument,t=e.documentElement;if("rdf:rdf"!==t.nodeName.toLowerCase())for(t=t.firstChild;t&&"rdf:rdf"!==t.nodeName.toLowerCase();)t=t.nextSibling;var n=t?t.nodeName.toLowerCase():null;if(t&&"rdf:rdf"===n&&t.hasChildNodes()){var i,r,a,s,o,c,l,h=t.childNodes;for(s=0,c=h.length;s0;)f[p++]=v&g?0:255,g>>=1;var m=0;for(p=0,0!==f[p]&&(l[0]=1,++m),n=1;n>2)+(f[p+1]?4:0)+(f[p-u+1]?8:0),h[b]&&(l[i+n]=h[b],++m),p++;if(f[p-u]!==f[p]&&(l[i+n]=f[p]?2:4,++m),m>a)return null}for(p=u*(o-1),i=t*c,0!==f[p]&&(l[i]=8,++m),n=1;na)return null;var w=new Int32Array([0,c,-1,0,-c,0,0,0,1]),y=[];for(t=0;m&&t<=o;t++){for(var A=t*c,S=A+s;A>4,l[A]&=C>>2|C<<2),x.push(A%c),x.push(A/c|0),--m}while(_!==A);y.push(x),--t}}var k=function(e){e.save(),e.scale(1/s,-1/o),e.translate(0,-o),e.beginPath();for(var t=0,n=y.length;t>3,P=4294967295,x=O.value||!N.value?4278190080:255;for(i=0;iS?c:8*C-7,k=L&-8,T=0,E=0;_>=1}for(;n=h&&(a=l,s=c*a),n=0,r=s;r--;)m[n++]=v[g++],m[n++]=v[g++],m[n++]=v[g++],m[n++]=255;e.putImageData(f,0,i*D)}else A("bad image kind: "+t.kind)}function n(e,t){for(var n=t.height,i=t.width,r=n%D,a=(n-r)/D,s=0===r?a:a+1,o=e.createImageData(i,D),c=0,l=t.data,h=o.data,u=0;u>=1}e.putImageData(o,0,u*D)}}function a(e,t){for(var n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],i=0,r=n.length;i>8,e[a-2]=e[a-2]*s+n*o>>8,e[a-1]=e[a-1]*s+i*o>>8}}}function o(e,t,n){for(var i=e.length,r=1/255,a=3;a>8]>>8:t[r]*a>>16}}function y(e,t,n,i,r,a,l){var h,u=!!a,d=u?a[0]:0,f=u?a[1]:0,p=u?a[2]:0;h="Luminosity"===r?c:o;for(var g=1048576,v=Math.min(i,Math.ceil(g/n)),m=0;mV&&"function"==typeof n,h=l?Date.now()+j:0,u=0,f=this.commonObjs,p=this.objs;;){if(void 0!==i&&s===i.nextBreakPoint)return i.breakIt(s,n),s;if(c=a[s],c!==d.dependency)this[c].apply(this,r[s]);else for(var g=r[s],v=0,m=g.length;vV){if(Date.now()>h)return n(),s;u=0}}},endDrawing:function(){null!==this.current.activeSMask&&this.endSMaskGroup(),this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null),this.cachedCanvases.clear(),_.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(e){this.current.lineWidth=e,this.ctx.lineWidth=e},setLineCap:function(e){this.ctx.lineCap=U[e]},setLineJoin:function(e){this.ctx.lineJoin=H[e]},setMiterLimit:function(e){this.ctx.miterLimit=e},setDash:function(e,t){var n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)},setRenderingIntent:function(e){},setFlatness:function(e){},setGState:function(e){for(var t=0,n=e.length;t0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=a?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null}}},beginSMaskGroup:function(){var e=this.current.activeSMask,t=e.canvas.width,n=e.canvas.height,i="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(i,t,n,!0),s=this.ctx,o=s.mozCurrentTransform;this.ctx.save();var c=r.context;c.scale(1/e.scaleX,1/e.scaleY),c.translate(-e.offsetX,-e.offsetY),c.transform.apply(c,o),e.startTransformInverse=c.mozCurrentTransformInverse,a(s,c),this.ctx=c,this.setGState([["BM","Normal"],["ca",1],["CA",1]]),this.groupStack.push(s),this.groupLevel++},suspendSMaskGroup:function(){var e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),L(this.ctx,this.current.activeSMask,e),this.ctx.restore(),this.ctx.save(),a(e,this.ctx),this.current.resumeSMaskCtx=e;var t=g.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t),e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.restore()},resumeSMaskGroup:function(){var e=this.current.resumeSMaskCtx,t=this.ctx;this.ctx=e,this.groupStack.push(t),this.groupLevel++},endSMaskGroup:function(){var e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),L(this.ctx,this.current.activeSMask,e),this.ctx.restore(),a(e,this.ctx);var t=g.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t)},save:function(){this.ctx.save();var e=this.current;this.stateStack.push(e),this.current=e.clone(),this.current.resumeSMaskCtx=null},restore:function(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),null===this.current.activeSMask||0!==this.stateStack.length&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask||this.endSMaskGroup(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this.cachedGetSinglePixelWidth=null)},transform:function(e,t,n,i,r,a){this.ctx.transform(e,t,n,i,r,a),this.cachedGetSinglePixelWidth=null},constructPath:function(e,t){for(var n=this.ctx,i=this.current,r=i.x,a=i.y,s=0,o=0,c=e.length;sT?T:t;this.current.fontSizeScale=t/c;var h=s+" "+a+" "+c+"px "+o;this.ctx.font=h}},setTextRenderingMode:function(e){this.current.textRenderingMode=e},setTextRise:function(e){this.current.textRise=e},moveText:function(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t},setLeadingMoveText:function(e,t){this.setLeading(-t),this.moveText(e,t)},setTextMatrix:function(e,t,n,i,r,a){this.current.textMatrix=[e,t,n,i,r,a],this.current.textMatrixScale=Math.sqrt(e*e+t*t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar:function(e,t,n){var i,r=this.ctx,a=this.current,s=a.font,o=a.textRenderingMode,c=a.fontSize/a.fontSizeScale,l=o&f.FILL_STROKE_MASK,h=!!(o&f.ADD_TO_PATH_FLAG);if((s.disableFontFace||h)&&(i=s.getPathGenerator(this.commonObjs,e)),s.disableFontFace?(r.save(),r.translate(t,n),r.beginPath(),i(r,c),l!==f.FILL&&l!==f.FILL_STROKE||r.fill(),l!==f.STROKE&&l!==f.FILL_STROKE||r.stroke(),r.restore()):(l!==f.FILL&&l!==f.FILL_STROKE||r.fillText(e,t,n),l!==f.STROKE&&l!==f.FILL_STROKE||r.strokeText(e,t,n)),h){var u=this.pendingTextPaths||(this.pendingTextPaths=[]);u.push({transform:r.mozCurrentTransform,x:t,y:n,fontSize:c,addToPath:i})}},get isFontSubpixelAAEnabled(){var e=this.canvasFactory.create(10,10).context;e.scale(1.5,1),e.fillText("I",0,10);for(var t=e.getImageData(0,0,10,10).data,n=!1,i=3;i0&&t[i]<255){n=!0;break}return S(this,"isFontSubpixelAAEnabled",n)},showText:function(e){var t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);var i=t.fontSize;if(0!==i){var r=this.ctx,a=t.fontSizeScale,s=t.charSpacing,o=t.wordSpacing,c=t.fontDirection,l=t.textHScale*c,h=e.length,u=n.vertical,d=u?1:-1,p=n.defaultVMetrics,g=i*t.fontMatrix[0],v=t.textRenderingMode===f.FILL&&!n.disableFontFace;r.save(),r.transform.apply(r,t.textMatrix),r.translate(t.x,t.y+t.textRise),t.patternFill&&(r.fillStyle=t.fillColor.getPattern(r,this)),c>0?r.scale(l,-1):r.scale(l,1);var m=t.lineWidth,w=t.textMatrixScale;if(0===w||0===m){var y=t.textRenderingMode&f.FILL_STROKE_MASK;y!==f.STROKE&&y!==f.FILL_STROKE||(this.cachedGetSinglePixelWidth=null,m=this.getSinglePixelWidth()*I)}else m/=w;1!==a&&(r.scale(a,a),m/=a),r.lineWidth=m;var A,S=0;for(A=0;A0){var B=1e3*r.measureText(E).width/i*a;if(RE&&(h=c/E,c=E),l>E&&(u=l/E,l=E);var d="groupAt"+this.groupLevel;e.smask&&(d+="_smask_"+this.smaskCounter++%2);var f=this.cachedCanvases.getCanvas(d,c,l,!0),p=f.context;p.scale(1/h,1/u),p.translate(-s,-o),p.transform.apply(p,n),e.smask?this.smaskStack.push({canvas:f.canvas,context:p,offsetX:s,offsetY:o,scaleX:h,scaleY:u,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(s,o),t.scale(h,u)),a(t,p),this.ctx=p,this.setGState([["BM","Normal"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++,this.current.activeSMask=null},endGroup:function(e){this.groupLevel--;var t=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,e.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(t.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.current=new M,this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(e,t,n){if(this.save(),w(e)&&4===e.length){var i=e[2]-e[0],r=e[3]-e[1];this.ctx.rect(e[0],e[1],i,r),this.clip(),this.endPath()}this.transform.apply(this,t),this.transform.apply(this,n)},endAnnotation:function(){this.restore()},paintJpegXObject:function(e,t,n){var i=this.objs.get(e);if(!i)return void P("Dependent image isn't ready yet");this.save();var r=this.ctx;if(r.scale(1/t,-1/n),r.drawImage(i,0,0,i.width,i.height,0,-n,t,n),this.imageLayer){var a=r.mozCurrentTransformInverse,s=this.getCanvasPosition(0,0);this.imageLayer.appendImage({objId:e,left:s[0],top:s[1],width:t/a[0],height:n/a[3]})}this.restore()},paintImageMaskXObject:function(e){var t=this.ctx,i=e.width,a=e.height,s=this.current.fillColor,o=this.current.patternFill,c=this.processingType3;if(F&&c&&void 0===c.compiled&&(i<=R&&a<=R?c.compiled=r({data:e.data,width:i,height:a}):c.compiled=null),c&&c.compiled)return void c.compiled(t);var l=this.cachedCanvases.getCanvas("maskCanvas",i,a),h=l.context;h.save(),n(h,e),h.globalCompositeOperation="source-in",h.fillStyle=o?s.getPattern(h,this):s,h.fillRect(0,0,i,a),h.restore(),this.paintInlineImageXObject(l.canvas)},paintImageMaskXObjectRepeat:function(e,t,i,r){var a=e.width,s=e.height,o=this.current.fillColor,c=this.current.patternFill,l=this.cachedCanvases.getCanvas("maskCanvas",a,s),h=l.context;h.save(),n(h,e),h.globalCompositeOperation="source-in",h.fillStyle=c?o.getPattern(h,this):o,h.fillRect(0,0,a,s),h.restore();for(var u=this.ctx,d=0,f=r.length;d2&&g>1||f>2&&v>1;){var b=g,w=v;h>2&&g>1&&(b=Math.ceil(g/2),h/=g/b),f>2&&v>1&&(w=Math.ceil(v/2),f/=v/w),s=this.cachedCanvases.getCanvas(m,b,w),p=s.context,p.clearRect(0,0,b,w),p.drawImage(a,0,0,g,v,0,0,b,w),a=s.canvas,g=b,v=w,m="prescale1"===m?"prescale2":"prescale1"}if(r.drawImage(a,0,0,g,v,0,-i,n,i),this.imageLayer){var y=this.getCanvasPosition(0,-i);this.imageLayer.appendImage({imgData:e,left:y[0],top:y[1],width:n/o[0],height:i/o[3]})}this.restore()},paintInlineImageXObjectGroup:function(e,n){var i=this.ctx,r=e.width,a=e.height,s=this.cachedCanvases.getCanvas("inlineImage",r,a),o=s.context;t(o,e);for(var c=0,l=n.length;c0&&!i.isSyncFontLoadingSupported?this.prepareFontLoadEvent(n,r,p):p.complete()},i.prototype.queueLoadingCallback=function(e){function t(){for(a(!r.end,"completeRequest() cannot be called twice"),r.end=Date.now();n.requests.length>0&&n.requests[0].end;){var e=n.requests.shift();setTimeout(e.callback,0)}}var n=this.loadingContext,i="pdfjs-font-loading-"+n.nextRequestId++,r={id:i,complete:t,callback:e,started:Date.now()};return n.requests.push(r),r},i.prototype.prepareFontLoadEvent=function(e,t,n){function i(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function r(e,t,n,i){var r=e.substr(0,t),a=e.substr(t+n);return r+i+a}function a(e,t){if(d++,d>30)return l("Load test font never loaded."),void t();u.font="30px "+e,u.fillText(".",0,20);var n=u.getImageData(0,0,1,1);return n.data[3]>0?void t():void setTimeout(a.bind(null,e,t))}var s,c,h=document.createElement("canvas");h.width=1,h.height=1;var u=h.getContext("2d"),d=0,f="lt"+Date.now()+this.loadTestFontId++,p=this.loadTestFont,g=976;p=r(p,g,f.length,f);var v=16,m=1482184792,b=i(p,v);for(s=0,c=f.length-3;s=14&&(e=!0),e};Object.defineProperty(i,"isSyncFontLoadingSupported",{get:function(){return c(i,"isSyncFontLoadingSupported",u())},enumerable:!0,configurable:!0});var d={get value(){return c(this,"value",r.isEvalSupported())}},f=function(){function e(e,t){this.compiledGlyphs=Object.create(null);for(var n in e)this[n]=e[n];this.options=t}return e.prototype={createNativeFontFace:function(){if(!this.data)return null;if(this.options.disableFontFace)return this.disableFontFace=!0,null;var e=new FontFace(this.loadedName,this.data,{});return this.options.fontRegistry&&this.options.fontRegistry.registerFont(this),e},createFontFaceRule:function(){if(!this.data)return null;if(this.options.disableFontFace)return this.disableFontFace=!0,null;var e=s(new Uint8Array(this.data)),t=this.loadedName,n="url(data:"+this.mimetype+";base64,"+btoa(e)+");",i='@font-face { font-family:"'+t+'";src:'+n+"}";return this.options.fontRegistry&&this.options.fontRegistry.registerFont(this,n),i},getPathGenerator:function(e,t){if(!(t in this.compiledGlyphs)){var n,i,r,a=e.get(this.loadedName+"_path_"+t);if(this.options.isEvalSupported&&d.value){var s,o="";for(i=0,r=a.length;il[i+1]&&(c=n,n=i,i=c,c=a,a=s,s=c),l[i+1]>l[r+1]&&(c=i,i=r,r=c,c=s,s=o,o=c),l[n+1]>l[i+1]&&(c=n,n=i,i=c,c=a,a=s,s=c);var f=(l[n]+t.offsetX)*t.scaleX,p=(l[n+1]+t.offsetY)*t.scaleY,g=(l[i]+t.offsetX)*t.scaleX,v=(l[i+1]+t.offsetY)*t.scaleY,m=(l[r]+t.offsetX)*t.scaleX,b=(l[r+1]+t.offsetY)*t.scaleY;if(!(p>=b))for(var w,y,A,S,P,x,C,_,L,k=h[a],T=h[a+1],E=h[a+2],I=h[s],F=h[s+1],R=h[s+2],D=h[o],N=h[o+1],O=h[o+2],B=Math.round(p),M=Math.round(b),j=B;j<=M;j++){ jb?1:v===b?0:(v-j)/(v-b),w=g-(g-m)*L,y=I-(I-D)*L,A=F-(F-N)*L,S=R-(R-O)*L),L=jb?1:(p-j)/(p-b),P=f-(f-m)*L,x=k-(k-D)*L,C=T-(T-N)*L,_=E-(E-O)*L;for(var V=Math.round(Math.min(w,P)),U=Math.round(Math.max(w,P)),H=d*j+4*V,z=V;z<=U;z++)L=(w-z)/(w-P),L=L<0?0:L>1?1:L,u[H++]=y-(y-x)*L|0,u[H++]=A-(A-C)*L|0,u[H++]=S-(S-_)*L|0,u[H++]=255}}function t(t,n,i){var r,a,s=n.coords,o=n.colors;switch(n.type){case"lattice":var c=n.verticesPerRow,h=Math.floor(s.length/c)-1,u=c-1;for(r=0;ra),i.lastY=n,t(i)}))},i={down:!0,lastY:e.scrollTop,_eventHandler:n},r=null;return e.addEventListener("scroll",n,!0),i}function s(e){for(var t=e.split("&"),n={},i=0,r=t.length;i1?a[1]:null;n[decodeURIComponent(s)]=decodeURIComponent(o)}return n}function o(e,t){var n=0,i=e.length-1;if(0===e.length||!t(e[i]))return e.length;if(t(e[n]))return n;for(;n>1,a=e[r];t(a)?i=r:n=r+1}return n}function c(e){if(Math.floor(e)===e)return[e,1];var t=1/e,n=8;if(t>n)return[1,n];if(Math.floor(t)===t)return[1,t];for(var i=e>1?t:e,r=0,a=1,s=1,o=1;;){var c=r+s,l=a+o;if(l>n)break;i<=c/l?(s=c,o=l):(r=c,a=l)}var h;return h=i-r/af}for(var r,a,s,c,l,h,u,d,f=e.scrollTop,p=f+e.clientHeight,g=e.scrollLeft,v=g+e.clientWidth,m=[],b=0===t.length?0:o(t,i),w=b,y=t.length;wp));w++)u=a.offsetLeft+a.clientLeft,d=a.clientWidth,u+dv||(l=Math.max(0,f-s)+Math.max(0,s+c-p),h=100*(c-l)/c|0,m.push({id:r.id,x:u,y:s,view:r,percent:h}));var A=m[0],S=m[m.length-1];return n&&m.sort(function(e,t){var n=e.percent-t.percent;return Math.abs(n)>.001?-n:e.id-t.id}),{first:A,last:S,views:m}}function u(e){e.preventDefault()}function d(e){var t=/^(?:([^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,n=/[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=t.exec(e),r=n.exec(i[1])||n.exec(i[2])||n.exec(i[3]);if(r&&(r=r[0],r.indexOf("%")!==-1))try{r=n.exec(decodeURIComponent(r))[0]}catch(e){}return r||"document.pdf"}function f(e){var t=Math.sqrt(e.deltaX*e.deltaX+e.deltaY*e.deltaY),n=Math.atan2(e.deltaY,e.deltaX);-.25*Math.PI0&&this.bar.setAttribute("style","width: calc(100% - "+n+"px);")}},hide:function(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"),document.body.classList.remove("loadingInProgress"))},show:function(){this.visible||(this.visible=!0,document.body.classList.add("loadingInProgress"),this.bar.classList.remove("hidden"))}},t}();t.CSS_UNITS=g,t.DEFAULT_SCALE_VALUE=v,t.DEFAULT_SCALE=m,t.MIN_SCALE=b,t.MAX_SCALE=w,t.UNKNOWN_SCALE=y,t.MAX_AUTO_SCALE=A,t.SCROLLBAR_PADDING=S,t.VERTICAL_PADDING=P,t.RendererType=x,t.mozL10n=C,t.EventBus=T,t.ProgressBar=E,t.getPDFFileNameFromURL=d,t.noContextMenuHandler=u,t.parseQueryString=s,t.getVisibleElements=h,t.roundToDivide=l,t.approximateFraction=c,t.getOutputScale=i,t.scrollIntoView=r,t.watchScroll=a,t.binarySearchFirstItem=o,t.normalizeWheelEventDelta=f,t.animationStarted=L,t.localized=k},function(e,t,n){e.exports=window["pdfjs-dist/build/pdf"]},function(e,t,n){function i(e){e.on("documentload",function(){var e=document.createEvent("CustomEvent");e.initCustomEvent("documentload",!0,!0,{}),window.dispatchEvent(e)}),e.on("pagerendered",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("pagerendered",!0,!0,{pageNumber:e.pageNumber,cssTransform:e.cssTransform}),e.source.div.dispatchEvent(t)}),e.on("textlayerrendered",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("textlayerrendered",!0,!0,{pageNumber:e.pageNumber}),e.source.textLayerDiv.dispatchEvent(t)}),e.on("pagechange",function(e){var t=document.createEvent("UIEvents");t.initUIEvent("pagechange",!0,!0,window,0),t.pageNumber=e.pageNumber,e.source.container.dispatchEvent(t)}),e.on("pagesinit",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("pagesinit",!0,!0,null),e.source.container.dispatchEvent(t)}),e.on("pagesloaded",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("pagesloaded",!0,!0,{pagesCount:e.pagesCount}),e.source.container.dispatchEvent(t)}),e.on("scalechange",function(e){var t=document.createEvent("UIEvents");t.initUIEvent("scalechange",!0,!0,window,0),t.scale=e.scale,t.presetValue=e.presetValue,e.source.container.dispatchEvent(t)}),e.on("updateviewarea",function(e){var t=document.createEvent("UIEvents");t.initUIEvent("updateviewarea",!0,!0,window,0),t.location=e.location,e.source.container.dispatchEvent(t)}),e.on("find",function(e){if(e.source!==window){var t=document.createEvent("CustomEvent");t.initCustomEvent("find"+e.type,!0,!0,{query:e.query,phraseSearch:e.phraseSearch,caseSensitive:e.caseSensitive,highlightAll:e.highlightAll,findPrevious:e.findPrevious}),window.dispatchEvent(t)}}),e.on("attachmentsloaded",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("attachmentsloaded",!0,!0,{attachmentsCount:e.attachmentsCount}),e.source.container.dispatchEvent(t)}),e.on("sidebarviewchanged",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("sidebarviewchanged",!0,!0,{view:e.view}),e.source.outerContainer.dispatchEvent(t)}),e.on("pagemode",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("pagemode",!0,!0,{mode:e.mode}),e.source.pdfViewer.container.dispatchEvent(t)}),e.on("namedaction",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("namedaction",!0,!0,{action:e.action}),e.source.pdfViewer.container.dispatchEvent(t)}),e.on("presentationmodechanged",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("presentationmodechanged",!0,!0,{active:e.active,switchInProgress:e.switchInProgress}),window.dispatchEvent(t)}),e.on("outlineloaded",function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("outlineloaded",!0,!0,{outlineCount:e.outlineCount}),e.source.container.dispatchEvent(t)})}function r(){return o?o:(o=new s,i(o),o)}var a=n(0),s=a.EventBus,o=null;t.attachDOMEventsToEventBus=i,t.getGlobalEventBus=r},function(e,t,n){var i=3e4,r={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},a=function(){function e(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1}return e.prototype={setViewer:function(e){this.pdfViewer=e},setThumbnailViewer:function(e){this.pdfThumbnailViewer=e},isHighestPriority:function(e){return this.highestPriorityPage===e.renderingId},renderHighestPriority:function(e){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(e)||this.pdfThumbnailViewer&&this.isThumbnailViewEnabled&&this.pdfThumbnailViewer.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),i))},getHighestPriority:function(e,t,n){var i=e.views,r=i.length;if(0===r)return!1;for(var a=0;a=0))return!1;var r=e[1];if("object"!=typeof r||"string"!=typeof r.name)return!1;switch(r.name){case"XYZ":if(5!==t)return!1;break;case"Fit":case"FitB":return 2===t;case"FitH":case"FitBH":case"FitV":case"FitBV":if(3!==t)return!1;break;case"FitR":if(6!==t)return!1;n=!1;break;default:return!1}for(var a=2;ai.pagesCount)return void console.error('PDFLinkService_navigateTo: "'+a+'" is a non-existent page number.');i.pdfViewer.scrollPageIntoView({pageNumber:a,destArray:e}),i.pdfHistory&&i.pdfHistory.push({dest:e,hash:n,page:a})}else i.pdfDocument.getPageIndex(t).then(function(e){i.cachePageRef(e+1,t),r(t)}).catch(function(){console.error('PDFLinkService_navigateTo: "'+t+'" is not a valid page reference.')})};"string"==typeof e?(n=e,t=this.pdfDocument.getDestination(e)):t=Promise.resolve(e),t.then(function(t){return e=t,t instanceof Array?void r(t[0]):void console.error('PDFLinkService_navigateTo: "'+t+'" is not a valid destination array.')})},getDestinationHash:function(e){if("string"==typeof e)return this.getAnchorUrl("#"+(i(e)?"nameddest=":"")+escape(e));if(e instanceof Array){var t=JSON.stringify(e);return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")},getAnchorUrl:function(e){return(this.baseUrl||"")+e},setHash:function(e){var n,r;if(e.indexOf("=")>=0){var a=s(e);if("search"in a&&this.eventBus.dispatch("findfromurlhash",{source:this,query:a.search.replace(/"/g,""),phraseSearch:"true"===a.phrase}),"nameddest"in a)return this.pdfHistory&&this.pdfHistory.updateNextHashParam(a.nameddest),void this.navigateTo(a.nameddest);if("page"in a&&(n=0|a.page||1),"zoom"in a){var o=a.zoom.split(","),c=o[0],l=parseFloat(c);c.indexOf("Fit")===-1?r=[null,{name:"XYZ"},o.length>1?0|o[1]:null,o.length>2?0|o[2]:null,l?l/100:c]:"Fit"===c||"FitB"===c?r=[null,{name:c}]:"FitH"===c||"FitBH"===c||"FitV"===c||"FitBV"===c?r=[null,{name:c},o.length>1?0|o[1]:null]:"FitR"===c?5!==o.length?console.error("PDFLinkService_setHash: Not enough parameters for 'FitR'."):r=[null,{name:c},0|o[1],0|o[2],0|o[3],0|o[4]]:console.error("PDFLinkService_setHash: '"+c+"' is not a valid zoom value.")}r?this.pdfViewer.scrollPageIntoView({pageNumber:n||this.page,destArray:r,allowNegativeOffset:!0}):n&&(this.page=n),"pagemode"in a&&this.eventBus.dispatch("pagemode",{source:this,mode:a.pagemode})}else{i(e)&&e<=this.pagesCount&&(console.warn('PDFLinkService_setHash: specifying a page number directly after the hash symbol (#) is deprecated, please use the "#page='+e+'" form instead.'),this.page=0|e),r=unescape(e);try{r=JSON.parse(r),r instanceof Array||(r=r.toString())}catch(e){}if("string"==typeof r||t(r))return this.pdfHistory&&this.pdfHistory.updateNextHashParam(r),void this.navigateTo(r);console.error("PDFLinkService_setHash: '"+unescape(e)+"' is not a valid destination.")}},executeNamedAction:function(e){switch(e){case"GoBack":this.pdfHistory&&this.pdfHistory.back();break;case"GoForward":this.pdfHistory&&this.pdfHistory.forward();break;case"NextPage":this.page1&&this.page--;break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}this.eventBus.dispatch("namedaction",{source:this,action:e})},onFileAttachmentAnnotation:function(e){this.eventBus.dispatch("fileattachmentannotation",{source:this,id:e.id,filename:e.filename,content:e.content})},cachePageRef:function(e,t){var n=t.num+" "+t.gen+" R";this._pagesRefCache[n]=e},_cachedPageNumber:function(e){var t=e.num+" "+e.gen+" R";return this._pagesRefCache&&this._pagesRefCache[t]||null}},e}(),l=function(){function e(){}return e.prototype={get page(){return 0},set page(e){},navigateTo:function(e){},getDestinationHash:function(e){return"#"},getAnchorUrl:function(e){return"#"},setHash:function(e){},executeNamedAction:function(e){},onFileAttachmentAnnotation:function(e){},cachePageRef:function(e,t){}},e}();t.PDFLinkService=c,t.SimpleLinkService=l},function(e,t,n){function i(e){e.imageResourcesPath="./images/",e.workerSrc="../build/pdf.worker.js",e.cMapUrl="../web/cmaps/",e.cMapPacked=!0}function r(e){return new Promise(function(t,n){var i=Xe.appConfig,r=document.createElement("script");r.src=i.debuggerScriptPath,r.onload=function(){PDFBug.enable(e),PDFBug.init(se,i.mainContainer),t()},r.onerror=function(){n(new Error("Cannot load debugger at "+r.src))},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)})}function a(){var e,t=Xe.appConfig,n=document.location.search.substring(1),i=ge(n);e="file"in i?i.file:t.defaultUrl,B(e);var a=[],s=document.createElement("input");s.id=t.openFileInputName,s.className="fileInput",s.setAttribute("type","file"),s.oncontextmenu=fe,document.body.appendChild(s),window.File&&window.FileReader&&window.FileList&&window.Blob?s.value=null:(t.toolbar.openFile.setAttribute("hidden","true"),t.secondaryToolbar.openFileButton.setAttribute("hidden","true"));var o=se.PDFJS;if(Xe.viewerPrefs.pdfBugEnabled){var c=document.location.hash.substring(1),l=ge(c);if("disableworker"in l&&(o.disableWorker="true"===l.disableworker),"disablerange"in l&&(o.disableRange="true"===l.disablerange),"disablestream"in l&&(o.disableStream="true"===l.disablestream),"disableautofetch"in l&&(o.disableAutoFetch="true"===l.disableautofetch),"disablefontface"in l&&(o.disableFontFace="true"===l.disablefontface),"disablehistory"in l&&(o.disableHistory="true"===l.disablehistory),"webgl"in l&&(o.disableWebGL="true"!==l.webgl),"useonlycsszoom"in l&&(o.useOnlyCssZoom="true"===l.useonlycsszoom),"verbosity"in l&&(o.verbosity=0|l.verbosity),"ignorecurrentpositiononzoom"in l&&(o.ignoreCurrentPositionOnZoom="true"===l.ignorecurrentpositiononzoom),"locale"in l&&(o.locale=l.locale),"textlayer"in l)switch(l.textlayer){case"off":o.disableTextLayer=!0;break;case"visible":case"shadow":case"hover":var h=t.viewerContainer;h.classList.add("textLayer-"+l.textlayer)}if("pdfbug"in l){o.pdfBug=!0;var u=l.pdfbug,d=u.split(",");a.push(r(d))}}pe.setLanguage(o.locale),Xe.supportsPrinting||(t.toolbar.print.classList.add("hidden"),t.secondaryToolbar.printButton.classList.add("hidden")),Xe.supportsFullscreen||(t.toolbar.presentationModeButton.classList.add("hidden"),t.secondaryToolbar.presentationModeButton.classList.add("hidden")),Xe.supportsIntegratedFind&&t.toolbar.viewFind.classList.add("hidden"),t.sidebar.mainContainer.addEventListener("transitionend",function(e){e.target===this&&Xe.eventBus.dispatch("resize")},!0),t.sidebar.toggleButton.addEventListener("click",function(){Xe.pdfSidebar.toggle()}),Promise.all(a).then(function(){Ye(e)}).catch(function(e){Xe.error(pe.get("loading_error",null,"An error occurred while opening."),e)})}function s(e){var t=e.pageNumber,n=t-1,i=Xe.pdfViewer.getPageView(n);if(t===Xe.page&&Xe.toolbar.updateLoadingIndicatorState(!1),i){if(Xe.pdfSidebar.isThumbnailViewVisible){var r=Xe.pdfThumbnailViewer.getThumbnail(n);r.setImage(i)}se.PDFJS.pdfBug&&Stats.enabled&&i.stats&&Stats.add(t,i.stats),i.error&&Xe.error(pe.get("rendering_error",null,"An error occurred while rendering the page."),i.error)}}function o(e){}function c(e){var t,n=e.mode;switch(n){case"thumbs":t=be.THUMBS;break;case"bookmarks":case"outline":t=be.OUTLINE;break;case"attachments":t=be.ATTACHMENTS;break;case"none":t=be.NONE;break;default:return void console.error('Invalid "pagemode" hash parameter: '+n)}Xe.pdfSidebar.switchView(t,!0)}function l(e){var t=e.action;switch(t){case"GoToPage":Xe.appConfig.toolbar.pageNumber.select();break;case"Find":Xe.supportsIntegratedFind||Xe.findBar.toggle()}}function h(e){var t=e.active,n=e.switchInProgress;Xe.pdfViewer.presentationModeState=n?ke.CHANGING:t?ke.FULLSCREEN:ke.NORMAL}function u(e){Xe.pdfRenderingQueue.isThumbnailViewEnabled=Xe.pdfSidebar.isThumbnailViewVisible;var t=Xe.store;t&&Xe.isInitialViewSet&&t.initializedPromise.then(function(){t.set("sidebarView",e.view).catch(function(){})})}function d(e){var t=e.location,n=Xe.store;n&&n.initializedPromise.then(function(){n.setMultiple({exists:!0,page:t.pageNumber,zoom:t.scale,scrollLeft:t.left,scrollTop:t.top}).catch(function(){})});var i=Xe.pdfLinkService.getAnchorUrl(t.pdfOpenParams);Xe.appConfig.toolbar.viewBookmark.href=i,Xe.appConfig.secondaryToolbar.viewBookmarkButton.href=i,Xe.pdfHistory.updateCurrentBookmark(t.pdfOpenParams,t.pageNumber);var r=Xe.pdfViewer.getPageView(Xe.page-1),a=r.renderingState!==Ee.FINISHED;Xe.toolbar.updateLoadingIndicatorState(a)}function f(){var e=Xe.pdfViewer.currentScaleValue;"auto"===e||"page-fit"===e||"page-width"===e?Xe.pdfViewer.currentScaleValue=e:e||(Xe.pdfViewer.currentScaleValue=ce),Xe.pdfViewer.update()}function p(e){if(Xe.pdfHistory.isHashChangeUnlocked){var t=e.hash;if(!t)return;Xe.isInitialViewSet?Xe.pdfLinkService.setHash(t):Xe.initialBookmark=t}}function g(){Xe.requestPresentationMode()}function v(){var e=Xe.appConfig.openFileInputName;document.getElementById(e).click()}function m(){window.print()}function b(){Xe.download()}function w(){Xe.pdfDocument&&(Xe.page=1)}function y(){Xe.pdfDocument&&(Xe.page=Xe.pagesCount)}function A(){Xe.page++}function S(){Xe.page--}function P(){Xe.zoomIn()}function x(){Xe.zoomOut()}function C(e){var t=Xe.pdfViewer;t.currentPageLabel=e.value,e.value!==t.currentPageNumber.toString()&&e.value!==t.currentPageLabel&&Xe.toolbar.setPageNumber(t.currentPageNumber,t.currentPageLabel)}function _(e){Xe.pdfViewer.currentScaleValue=e.value}function L(){Xe.rotatePages(90)}function k(){Xe.rotatePages(-90)}function T(){Xe.pdfDocumentProperties.open()}function E(e){Xe.findController.executeCommand("find"+e.type,{query:e.query,phraseSearch:e.phraseSearch,caseSensitive:e.caseSensitive,highlightAll:e.highlightAll,findPrevious:e.findPrevious})}function I(e){Xe.findController.executeCommand("find",{query:e.query,phraseSearch:e.phraseSearch,caseSensitive:!1,highlightAll:!0,findPrevious:!1})}function F(e){Xe.toolbar.setPageScale(e.presetValue,e.scale),Xe.pdfViewer.update()}function R(e){var t=e.pageNumber;if(Xe.toolbar.setPageNumber(t,e.pageLabel||null),Xe.secondaryToolbar.setPageNumber(t),Xe.pdfSidebar.isThumbnailViewVisible&&Xe.pdfThumbnailViewer.scrollThumbnailIntoView(t),se.PDFJS.pdfBug&&Stats.enabled){var n=Xe.pdfViewer.getPageView(t-1);n.stats&&Stats.add(t,n.stats)}}function D(e){var t=Xe.pdfViewer;if(!t.isInPresentationMode)if(e.ctrlKey||e.metaKey){var n=Xe.supportedMouseWheelZoomModifierKeys;if(e.ctrlKey&&!n.ctrlKey||e.metaKey&&!n.metaKey)return;if(e.preventDefault(),Ke)return;var i=t.currentScale,r=je(e),a=3,s=r*a;s<0?Xe.zoomOut(-s):Xe.zoomIn(s);var o=t.currentScale;if(i!==o){var c=o/i-1,l=t.container.getBoundingClientRect(),h=e.clientX-l.left,u=e.clientY-l.top;t.container.scrollLeft+=h*c,t.container.scrollTop+=u*c}}else Ke=!0,clearTimeout(Qe),Qe=setTimeout(function(){Ke=!1},1e3)}function N(e){if(Xe.secondaryToolbar.isOpen){var t=Xe.appConfig;(Xe.pdfViewer.containsElement(e.target)||t.toolbar.container.contains(e.target)&&e.target!==t.secondaryToolbar.toggleButton)&&Xe.secondaryToolbar.close()}}function O(e){if(!De.active){var t=!1,n=!1,i=(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0),r=Xe.pdfViewer,a=r&&r.isInPresentationMode;if(1===i||8===i||5===i||12===i)switch(e.keyCode){case 70:Xe.supportsIntegratedFind||(Xe.findBar.open(),t=!0);break;case 71:if(!Xe.supportsIntegratedFind){var s=Xe.findController.state;s&&Xe.findController.executeCommand("findagain",{query:s.query,phraseSearch:s.phraseSearch,caseSensitive:s.caseSensitive,highlightAll:s.highlightAll,findPrevious:5===i||12===i}),t=!0}break;case 61:case 107:case 187:case 171:a||Xe.zoomIn(),t=!0;break;case 173:case 109:case 189:a||Xe.zoomOut(),t=!0;break;case 48:case 96:a||(setTimeout(function(){r.currentScaleValue=ce}),t=!1);break;case 38:(a||Xe.page>1)&&(Xe.page=1,t=!0,n=!0);break;case 40:(a||Xe.page1&&Xe.page--,t=!0;break;case 27:Xe.secondaryToolbar.isOpen&&(Xe.secondaryToolbar.close(),t=!0),!Xe.supportsIntegratedFind&&Xe.findBar.opened&&(Xe.findBar.close(),t=!0);break;case 40:case 34:case 32:if(!a&&"page-fit"!==r.currentScaleValue)break;case 39:if(r.isHorizontalScrollbarEnabled)break;case 74:case 78:Xe.page1)&&(Xe.page=1,t=!0,n=!0);break;case 35:(a||Xe.page1&&Xe.page--,t=!0;break;case 82:Xe.rotatePages(-90)}if(t||a||(e.keyCode>=33&&e.keyCode<=40||32===e.keyCode&&"BUTTON"!==c)&&(n=!0), 2===i)switch(e.keyCode){case 37:a&&(Xe.pdfHistory.back(),t=!0);break;case 39:a&&(Xe.pdfHistory.forward(),t=!0)}n&&!r.containsElement(o)&&r.focus(),t&&e.preventDefault()}}}var B,M=n(0),j=n(11),V=n(18),U=n(8),H=n(22),z=n(29),W=n(24),G=n(28),X=n(26),q=n(14),Y=n(21),J=n(16),Q=n(13),K=n(25),Z=n(3),$=n(5),ee=n(19),te=n(4),ne=n(15),ie=n(7),re=n(17),ae=n(2),se=n(1),oe=M.UNKNOWN_SCALE,ce=M.DEFAULT_SCALE_VALUE,le=M.MIN_SCALE,he=M.MAX_SCALE,ue=M.ProgressBar,de=M.getPDFFileNameFromURL,fe=M.noContextMenuHandler,pe=M.mozL10n,ge=M.parseQueryString,ve=V.PDFHistory,me=U.Preferences,be=H.SidebarView,we=H.PDFSidebar,ye=z.ViewHistory,Ae=W.PDFThumbnailViewer,Se=G.Toolbar,Pe=X.SecondaryToolbar,xe=q.PasswordPrompt,Ce=Y.PDFPresentationMode,_e=J.PDFDocumentProperties,Le=Q.HandTool,ke=K.PresentationModeState,Te=K.PDFViewer,Ee=Z.RenderingStates,Ie=Z.PDFRenderingQueue,Fe=$.PDFLinkService,Re=ee.PDFOutlineViewer,De=te.OverlayManager,Ne=ne.PDFAttachmentViewer,Oe=ie.PDFFindController,Be=re.PDFFindBar,Me=ae.getGlobalEventBus,je=M.normalizeWheelEventDelta,Ve=M.animationStarted,Ue=M.localized,He=M.RendererType,ze=1.1,We=5e3,Ge={updateFindControlState:function(e){},initPassiveLoading:function(e){},fallback:function(e,t){},reportTelemetry:function(e){},createDownloadManager:function(){return new j.DownloadManager},supportsIntegratedFind:!1,supportsDocumentFonts:!0,supportsDocumentColors:!0,supportedMouseWheelZoomModifierKeys:{ctrlKey:!0,metaKey:!0}},Xe={initialBookmark:document.location.hash.substring(1),initialDestination:null,initialized:!1,fellback:!1,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:!1,viewerPrefs:{sidebarViewOnLoad:be.NONE,pdfBugEnabled:!1,showPreviousViewOnLoad:!0,defaultZoomValue:"",disablePageLabels:!1,renderer:"canvas",enhanceTextSelection:!1,renderInteractiveForms:!1,enablePrintAutoRotate:!1},isViewerEmbedded:window.parent!==window,url:"",baseUrl:"",externalServices:Ge,initialize:function(e){var t=this,n=se.PDFJS;return me.initialize(),this.preferences=me,i(n),this.appConfig=e,this._readPreferences().then(function(){return t._initializeViewerComponents()}).then(function(){t.bindEvents(),t.bindWindowEvents(),Ue.then(function(){t.eventBus.dispatch("localized")}),t.isViewerEmbedded&&!n.isExternalLinkTargetSet()&&(n.externalLinkTarget=n.LinkTarget.TOP),t.initialized=!0})},_readPreferences:function(){var e=this,t=se.PDFJS;return Promise.all([me.get("enableWebGL").then(function(e){t.disableWebGL=!e}),me.get("sidebarViewOnLoad").then(function(t){e.viewerPrefs.sidebarViewOnLoad=t}),me.get("pdfBugEnabled").then(function(t){e.viewerPrefs.pdfBugEnabled=t}),me.get("showPreviousViewOnLoad").then(function(t){e.viewerPrefs.showPreviousViewOnLoad=t}),me.get("defaultZoomValue").then(function(t){e.viewerPrefs.defaultZoomValue=t}),me.get("enhanceTextSelection").then(function(t){e.viewerPrefs.enhanceTextSelection=t}),me.get("disableTextLayer").then(function(e){t.disableTextLayer!==!0&&(t.disableTextLayer=e)}),me.get("disableRange").then(function(e){t.disableRange!==!0&&(t.disableRange=e)}),me.get("disableStream").then(function(e){t.disableStream!==!0&&(t.disableStream=e)}),me.get("disableAutoFetch").then(function(e){t.disableAutoFetch=e}),me.get("disableFontFace").then(function(e){t.disableFontFace!==!0&&(t.disableFontFace=e)}),me.get("useOnlyCssZoom").then(function(e){t.useOnlyCssZoom=e}),me.get("externalLinkTarget").then(function(e){t.isExternalLinkTargetSet()||(t.externalLinkTarget=e)}),me.get("renderer").then(function(t){e.viewerPrefs.renderer=t}),me.get("renderInteractiveForms").then(function(t){e.viewerPrefs.renderInteractiveForms=t}),me.get("disablePageLabels").then(function(t){e.viewerPrefs.disablePageLabels=t}),me.get("enablePrintAutoRotate").then(function(t){e.viewerPrefs.enablePrintAutoRotate=t})]).catch(function(e){})},_initializeViewerComponents:function(){var e=this,t=this.appConfig;return new Promise(function(n,i){var r=t.eventBus||Me();e.eventBus=r;var a=new Ie;a.onIdle=e.cleanup.bind(e),e.pdfRenderingQueue=a;var s=new Fe({eventBus:r});e.pdfLinkService=s;var o=e.externalServices.createDownloadManager();e.downloadManager=o;var c=t.mainContainer,l=t.viewerContainer;e.pdfViewer=new Te({container:c,viewer:l,eventBus:r,renderingQueue:a,linkService:s,downloadManager:o,renderer:e.viewerPrefs.renderer,enhanceTextSelection:e.viewerPrefs.enhanceTextSelection,renderInteractiveForms:e.viewerPrefs.renderInteractiveForms,enablePrintAutoRotate:e.viewerPrefs.enablePrintAutoRotate}),a.setViewer(e.pdfViewer),s.setViewer(e.pdfViewer);var h=t.sidebar.thumbnailView;e.pdfThumbnailViewer=new Ae({container:h,renderingQueue:a,linkService:s}),a.setThumbnailViewer(e.pdfThumbnailViewer),e.pdfHistory=new ve({linkService:s,eventBus:r}),s.setHistory(e.pdfHistory),e.findController=new Oe({pdfViewer:e.pdfViewer}),e.findController.onUpdateResultsCount=function(t){e.supportsIntegratedFind||e.findBar.updateResultsCount(t)},e.findController.onUpdateState=function(t,n,i){e.supportsIntegratedFind?e.externalServices.updateFindControlState({result:t,findPrevious:n}):e.findBar.updateUIState(t,n,i)},e.pdfViewer.setFindController(e.findController);var u=Object.create(t.findBar);u.findController=e.findController,u.eventBus=r,e.findBar=new Be(u),e.overlayManager=De,e.handTool=new Le({container:c,eventBus:r}),e.pdfDocumentProperties=new _e(t.documentProperties),e.toolbar=new Se(t.toolbar,c,r),e.secondaryToolbar=new Pe(t.secondaryToolbar,c,r),e.supportsFullscreen&&(e.pdfPresentationMode=new Ce({container:c,viewer:l,pdfViewer:e.pdfViewer,eventBus:r,contextMenuItems:t.fullscreen})),e.passwordPrompt=new xe(t.passwordOverlay),e.pdfOutlineViewer=new Re({container:t.sidebar.outlineView,eventBus:r,linkService:s}),e.pdfAttachmentViewer=new Ne({container:t.sidebar.attachmentsView,eventBus:r,downloadManager:o});var d=Object.create(t.sidebar);d.pdfViewer=e.pdfViewer,d.pdfThumbnailViewer=e.pdfThumbnailViewer,d.pdfOutlineViewer=e.pdfOutlineViewer,d.eventBus=r,e.pdfSidebar=new we(d),e.pdfSidebar.onToggled=e.forceRendering.bind(e),n(void 0)})},run:function(e){this.initialize(e).then(a)},zoomIn:function(e){var t=this.pdfViewer.currentScale;do t=(t*ze).toFixed(2),t=Math.ceil(10*t)/10,t=Math.min(he,t);while(--e>0&&t0&&t>le);this.pdfViewer.currentScaleValue=t},get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0},set page(e){this.pdfViewer.currentPageNumber=e},get page(){return this.pdfViewer.currentPageNumber},get printing(){return!!this.printService},get supportsPrinting(){return Ze.instance.supportsPrinting},get supportsFullscreen(){var e,t=document.documentElement;return e=!!(t.requestFullscreen||t.mozRequestFullScreen||t.webkitRequestFullScreen||t.msRequestFullscreen),document.fullscreenEnabled!==!1&&document.mozFullScreenEnabled!==!1&&document.webkitFullscreenEnabled!==!1&&document.msFullscreenEnabled!==!1||(e=!1),e&&se.PDFJS.disableFullscreen===!0&&(e=!1),se.shadow(this,"supportsFullscreen",e)},get supportsIntegratedFind(){return this.externalServices.supportsIntegratedFind},get supportsDocumentFonts(){return this.externalServices.supportsDocumentFonts},get supportsDocumentColors(){return this.externalServices.supportsDocumentColors},get loadingBar(){var e=new ue("#loadingBar",{});return se.shadow(this,"loadingBar",e)},get supportedMouseWheelZoomModifierKeys(){return this.externalServices.supportedMouseWheelZoomModifierKeys},initPassiveLoading:function(){throw new Error("Not implemented: initPassiveLoading")},setTitleUsingUrl:function(e){this.url=e,this.baseUrl=e.split("#")[0];try{this.setTitle(decodeURIComponent(se.getFilenameFromUrl(e))||e)}catch(t){this.setTitle(e)}},setTitle:function(e){this.isViewerEmbedded||(document.title=e)},close:function(){var e=this.appConfig.errorWrapper.container;if(e.setAttribute("hidden","true"),!this.pdfLoadingTask)return Promise.resolve();var t=this.pdfLoadingTask.destroy();return this.pdfLoadingTask=null,this.pdfDocument&&(this.pdfDocument=null,this.pdfThumbnailViewer.setDocument(null),this.pdfViewer.setDocument(null),this.pdfLinkService.setDocument(null,null)),this.store=null,this.isInitialViewSet=!1,this.pdfSidebar.reset(),this.pdfOutlineViewer.reset(),this.pdfAttachmentViewer.reset(),this.findController.reset(),this.findBar.reset(),this.toolbar.reset(),this.secondaryToolbar.reset(),"undefined"!=typeof PDFBug&&PDFBug.cleanup(),t},open:function(e,t){if(arguments.length>2||"number"==typeof t)return Promise.reject(new Error("Call of open() with obsolete signature."));if(this.pdfLoadingTask)return this.close().then(function(){return me.reload(),this.open(e,t)}.bind(this));var n,i=Object.create(null);if("string"==typeof e?(this.setTitleUsingUrl(e),i.url=e):e&&"byteLength"in e?i.data=e:e.url&&e.originalUrl&&(this.setTitleUsingUrl(e.originalUrl),i.url=e.url),t){for(var r in t)i[r]=t[r];t.scale&&(n=t.scale),t.length&&this.pdfDocumentProperties.setFileSize(t.length)}var a=this;a.downloadComplete=!1;var s=se.getDocument(i);return this.pdfLoadingTask=s,s.onPassword=function(e,t){a.passwordPrompt.setUpdateCallback(e,t),a.passwordPrompt.open()},s.onProgress=function(e){a.progress(e.loaded/e.total)},s.onUnsupportedFeature=this.fallback.bind(this),s.promise.then(function(e){a.load(e,n)},function(e){var t=e&&e.message,n=pe.get("loading_error",null,"An error occurred while loading the PDF.");e instanceof se.InvalidPDFException?n=pe.get("invalid_file_error",null,"Invalid or corrupted PDF file."):e instanceof se.MissingPDFException?n=pe.get("missing_file_error",null,"Missing PDF file."):e instanceof se.UnexpectedResponseException&&(n=pe.get("unexpected_response_error",null,"Unexpected server response."));var i={message:t};throw a.error(n,i),new Error(n)})},download:function(){function e(){i.downloadUrl(t,n)}var t=this.baseUrl,n=de(t),i=this.downloadManager;return i.onerror=function(e){Xe.error("PDF failed to download.")},this.pdfDocument&&this.downloadComplete?void this.pdfDocument.getData().then(function(e){var r=se.createBlob(e,"application/pdf");i.download(r,t,n)},e).then(null,e):void e()},fallback:function(e){},error:function(e,t){var n=pe.get("error_version_info",{version:se.version||"?",build:se.build||"?"},"PDF.js v{{version}} (build: {{build}})")+"\n";t&&(n+=pe.get("error_message",{message:t.message},"Message: {{message}}"),t.stack?n+="\n"+pe.get("error_stack",{stack:t.stack},"Stack: {{stack}}"):(t.filename&&(n+="\n"+pe.get("error_file",{file:t.filename},"File: {{file}}")),t.lineNumber&&(n+="\n"+pe.get("error_line",{line:t.lineNumber},"Line: {{line}}"))));var i=this.appConfig.errorWrapper,r=i.container;r.removeAttribute("hidden");var a=i.errorMessage;a.textContent=e;var s=i.closeButton;s.onclick=function(){r.setAttribute("hidden","true")};var o=i.errorMoreInfo,c=i.moreInfoButton,l=i.lessInfoButton;c.onclick=function(){o.removeAttribute("hidden"),c.setAttribute("hidden","true"),l.removeAttribute("hidden"),o.style.height=o.scrollHeight+"px"},l.onclick=function(){o.setAttribute("hidden","true"),c.removeAttribute("hidden"),l.setAttribute("hidden","true")},c.oncontextmenu=fe,l.oncontextmenu=fe,s.oncontextmenu=fe,c.removeAttribute("hidden"),l.setAttribute("hidden","true"),o.value=n},progress:function(e){var t=Math.round(100*e);(t>this.loadingBar.percent||isNaN(t))&&(this.loadingBar.percent=t,se.PDFJS.disableAutoFetch&&t&&(this.disableAutoFetchLoadingBarTimeout&&(clearTimeout(this.disableAutoFetchLoadingBarTimeout),this.disableAutoFetchLoadingBarTimeout=null),this.loadingBar.show(),this.disableAutoFetchLoadingBarTimeout=setTimeout(function(){this.loadingBar.hide(),this.disableAutoFetchLoadingBarTimeout=null}.bind(this),We)))},load:function(e,t){var n=this;t=t||oe,this.pdfDocument=e,this.pdfDocumentProperties.setDocumentAndUrl(e,this.url);var i=e.getDownloadInfo().then(function(){n.downloadComplete=!0,n.loadingBar.hide()});this.toolbar.setPagesCount(e.numPages,!1),this.secondaryToolbar.setPagesCount(e.numPages);var r,a=this.documentFingerprint=e.fingerprint,s=this.store=new ye(a);r=null,this.pdfLinkService.setDocument(e,r);var o=this.pdfViewer;o.currentScale=t,o.setDocument(e);var c=o.firstPagePromise,l=o.pagesPromise,h=o.onePageRendered;this.pageRotation=0;var u=this.pdfThumbnailViewer;u.setDocument(e),c.then(function(e){i.then(function(){n.eventBus.dispatch("documentload",{source:n})}),n.loadingBar.setWidth(n.appConfig.viewerContainer),se.PDFJS.disableHistory||n.isViewerEmbedded||(n.viewerPrefs.showPreviousViewOnLoad||n.pdfHistory.clearHistoryState(),n.pdfHistory.initialize(n.documentFingerprint),n.pdfHistory.initialDestination?n.initialDestination=n.pdfHistory.initialDestination:n.pdfHistory.initialBookmark&&(n.initialBookmark=n.pdfHistory.initialBookmark));var r={destination:n.initialDestination,bookmark:n.initialBookmark,hash:null};s.initializedPromise.then(function(){var e=null,i=null;if(n.viewerPrefs.showPreviousViewOnLoad&&s.get("exists",!1)){var a=s.get("page","1"),o=n.viewerPrefs.defaultZoomValue||s.get("zoom",ce),c=s.get("scrollLeft","0"),l=s.get("scrollTop","0");e="page="+a+"&zoom="+o+","+c+","+l,i=s.get("sidebarView",be.NONE)}else n.viewerPrefs.defaultZoomValue&&(e="page=1&zoom="+n.viewerPrefs.defaultZoomValue);n.setInitialView(e,{scale:t,sidebarView:i}),r.hash=e,n.isViewerEmbedded||n.pdfViewer.focus()},function(e){console.error(e),n.setInitialView(null,{scale:t})}),l.then(function(){(r.destination||r.bookmark||r.hash)&&(n.hasEqualPageSizes||(n.initialDestination=r.destination,n.initialBookmark=r.bookmark,n.pdfViewer.currentScaleValue=n.pdfViewer.currentScaleValue,n.setInitialView(r.hash)))})}),e.getPageLabels().then(function(t){if(t&&!n.viewerPrefs.disablePageLabels){var i=0,r=t.length;if(r!==n.pagesCount)return void console.error("The number of Page Labels does not match the number of pages in the document.");for(;i=0)return;var n=new URL(e,window.location.href).origin;if(n!==t)throw new Error("file origin does not match viewer's")}catch(e){var i=e&&e.message,r=pe.get("loading_error",null,"An error occurred while loading the PDF."),a={message:i};throw Xe.error(r,a),e}};var Ye;Ye=function(e){if(e&&0===e.lastIndexOf("file:",0)){Xe.setTitleUsingUrl(e);var t=new XMLHttpRequest;t.onload=function(){Xe.open(new Uint8Array(t.response))};try{t.open("GET",e),t.responseType="arraybuffer",t.send()}catch(e){Xe.error(pe.get("loading_error",null,"An error occurred while loading the PDF."),e)}}else e&&Xe.open(e)};var Je;Je=function(e){var t=e.fileInput.files[0];if(!se.PDFJS.disableCreateObjectURL&&"undefined"!=typeof URL&&URL.createObjectURL)Xe.open(URL.createObjectURL(t));else{var n=new FileReader;n.onload=function(e){var t=e.target.result,n=new Uint8Array(t);Xe.open(n)},n.readAsArrayBuffer(t)}Xe.setTitleUsingUrl(t.name);var i=Xe.appConfig;i.toolbar.viewBookmark.setAttribute("hidden","true"),i.secondaryToolbar.viewBookmarkButton.setAttribute("hidden","true"),i.toolbar.download.setAttribute("hidden","true"),i.secondaryToolbar.downloadButton.setAttribute("hidden","true")};var Qe,Ke=!1;Ue.then(function(){document.getElementsByTagName("html")[0].dir=pe.getDirection()});var Ze={instance:{supportsPrinting:!1,createPrintService:function(){throw new Error("Not implemented: createPrintService")}}};t.PDFViewerApplication=Xe,t.DefaultExernalServices=Ge,t.PDFPrintServiceFactory=Ze},function(e,t,n){var i=n(0),r=i.scrollIntoView,a={FIND_FOUND:0,FIND_NOTFOUND:1,FIND_WRAPPED:2,FIND_PENDING:3},s=-50,o=-400,c={"‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},l=function(){function e(e){this.pdfViewer=e.pdfViewer||null,this.onUpdateResultsCount=null,this.onUpdateState=null,this.reset();var t=Object.keys(c).join("");this.normalizationRegex=new RegExp("["+t+"]","g")}return e.prototype={reset:function(){this.startedTextExtraction=!1,this.extractTextPromises=[],this.pendingFindMatches=Object.create(null),this.active=!1,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=!1,this.findTimeout=null,this.firstPagePromise=new Promise(function(e){this.resolveFirstPage=e}.bind(this))},normalize:function(e){return e.replace(this.normalizationRegex,function(e){return c[e]})},_prepareMatches:function(e,t,n){function i(e,t){var n,i,r;if(n=e[t],r=e[t+1],t=0;a--)if(i=e[a],!i.skipped){if(i.match+i.matchLength=n.match+n.matchLength)return n.skipped=!0,!0}return!1}var r,a;for(e.sort(function(e,t){return e.match===t.match?e.matchLength-t.matchLength:e.match-t.match}),r=0,a=e.length;r0&&(this.matchCount+=this.pageMatches[e].length,this.updateUIResultsCount()))},extractText:function(){function e(n){r.pdfViewer.getPageTextContent(n).then(function(i){for(var a=i.items,s=[],o=0,c=a.length;o0)return this.hadMatch=!0,s.matchIdx=e?s.matchIdx-1:s.matchIdx+1,void this.updateMatch(!0);this.advanceOffsetPage(e)}this.nextPageMatch()}},matchesReady:function(e){var t=this.offset,n=e.length,i=this.state.findPrevious;return n?(this.hadMatch=!0,t.matchIdx=i?n-1:0,this.updateMatch(!0),!0):(this.advanceOffsetPage(i),!!(t.wrapped&&(t.matchIdx=null,this.pagesToSearch<0))&&(this.updateMatch(!1),!0))},updateMatchPosition:function(e,t,n,i){if(this.selected.matchIdx===t&&this.selected.pageIdx===e){var a={top:s,left:o};r(n[i],a,!0)}},nextPageMatch:function(){null!==this.resumePageIdx&&console.error("There can only be one pending page.");do{var e=this.offset.pageIdx,t=this.pageMatches[e];if(!t){this.resumePageIdx=e;break}}while(!this.matchesReady(t))},advanceOffsetPage:function(e){var t=this.offset,n=this.extractTextPromises.length;t.pageIdx=e?t.pageIdx-1:t.pageIdx+1,t.matchIdx=null,this.pagesToSearch--,(t.pageIdx>=n||t.pageIdx<0)&&(t.pageIdx=e?n-1:0,t.wrapped=!0)},updateMatch:function(e){var t=a.FIND_NOTFOUND,n=this.offset.wrapped;if(this.offset.wrapped=!1,e){var i=this.selected.pageIdx;this.selected.pageIdx=this.offset.pageIdx,this.selected.matchIdx=this.offset.matchIdx,t=n?a.FIND_WRAPPED:a.FIND_FOUND,i!==-1&&i!==this.selected.pageIdx&&this.updatePage(i)}this.updateUIState(t,this.state.findPrevious),this.selected.pageIdx!==-1&&this.updatePage(this.selected.pageIdx)},updateUIResultsCount:function(){this.onUpdateResultsCount&&this.onUpdateResultsCount(this.matchCount)},updateUIState:function(e,t){this.onUpdateState&&this.onUpdateState(e,t,this.matchCount)}},e}();t.FindStates=a,t.PDFFindController=l},function(e,t,n){function i(){return a||(a=Promise.resolve({showPreviousViewOnLoad:!0,defaultZoomValue:"",sidebarViewOnLoad:0,enableHandToolOnLoad:!1,enableWebGL:!1,pdfBugEnabled:!1,disableRange:!1,disableStream:!1,disableAutoFetch:!1,disableFontFace:!1,disableTextLayer:!1,useOnlyCssZoom:!1,externalLinkTarget:0,enhanceTextSelection:!1,renderer:"canvas",renderInteractiveForms:!1,enablePrintAutoRotate:!1,disablePageLabels:!1})),a}function r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}var a=null,s={prefs:null,isInitializedPromiseResolved:!1,initializedPromise:null,initialize:function(){return this.initializedPromise=i().then(function(e){return Object.defineProperty(this,"defaults",{value:Object.freeze(e),writable:!1,enumerable:!0,configurable:!1}),this.prefs=r(e),this._readFromStorage(e)}.bind(this)).then(function(e){this.isInitializedPromiseResolved=!0,e&&(this.prefs=e)}.bind(this))},_writeToStorage:function(e){return Promise.resolve()},_readFromStorage:function(e){return Promise.resolve()},reset:function(){return this.initializedPromise.then(function(){return this.prefs=r(this.defaults),this._writeToStorage(this.defaults)}.bind(this))},reload:function(){return this.initializedPromise.then(function(){this._readFromStorage(this.defaults).then(function(e){e&&(this.prefs=e)}.bind(this))}.bind(this))},set:function(e,t){return this.initializedPromise.then(function(){if(void 0===this.defaults[e])throw new Error("preferencesSet: '"+e+"' is undefined.");if(void 0===t)throw new Error("preferencesSet: no value is specified.");var n=typeof t,i=typeof this.defaults[e];if(n!==i){if("number"!==n||"string"!==i)throw new Error("Preferences_set: '"+t+"' is a \""+n+'", expected "'+i+'".');t=t.toString()}else if("number"===n&&(0|t)!==t)throw new Error("Preferences_set: '"+t+'\' must be an "integer".');return this.prefs[e]=t,this._writeToStorage(this.prefs)}.bind(this))},get:function(e){return this.initializedPromise.then(function(){var t=this.defaults[e];if(void 0===t)throw new Error("preferencesGet: '"+e+"' is undefined.");var n=this.prefs[e];return void 0!==n?n:t}.bind(this))}};s._writeToStorage=function(e){return new Promise(function(t){localStorage.setItem("pdfjs.preferences",JSON.stringify(e)),t()})},s._readFromStorage=function(e){return new Promise(function(e){var t=JSON.parse(localStorage.getItem("pdfjs.preferences"));e(t)})},t.Preferences=s},function(e,t,n){function i(e,t,n,i){var r=m.scratchCanvas,a=150,s=a/72;r.width=Math.floor(i.width*s),r.height=Math.floor(i.height*s);var o=Math.floor(i.width*p)+"px",c=Math.floor(i.height*p)+"px",l=r.getContext("2d");return l.save(),l.fillStyle="rgb(255, 255, 255)",l.fillRect(0,0,r.width,r.height),l.restore(),t.getPage(n).then(function(e){var t={canvasContext:l,transform:[s,0,0,s,0,0],viewport:e.getViewport(1,i.rotation),intent:"print"};return e.render(t).promise}).then(function(){return{width:o,height:c}})}function r(e,t,n){this.pdfDocument=e,this.pagesOverview=t,this.printContainer=n,this.currentPage=-1,this.scratchCanvas=document.createElement("canvas")}function a(e){var t=document.createEvent("CustomEvent");t.initCustomEvent(e,!1,!1,"custom"),window.dispatchEvent(t)}function s(){m&&(m.destroy(),a("afterprint"))}function o(e,t){var n=document.getElementById("printServiceOverlay"),i=Math.round(100*e/t),r=n.querySelector("progress"),a=n.querySelector(".relative-progress");r.value=i,a.textContent=f.get("print_progress_percent",{progress:i},i+"%")}function c(){return A||(A=v.register("printServiceOverlay",document.getElementById("printServiceOverlay"),s,!0),document.getElementById("printCancel").onclick=s),A}var l=n(0),h=n(4),u=n(6),d=n(1),f=l.mozL10n,p=l.CSS_UNITS,g=u.PDFPrintServiceFactory,v=h.OverlayManager,m=null;r.prototype={layout:function(){this.throwIfInactive();var e=document.querySelector("body");e.setAttribute("data-pdfjsprinting",!0);var t=this.pagesOverview.every(function(e){return e.width===this.pagesOverview[0].width&&e.height===this.pagesOverview[0].height},this);t||console.warn("Not all pages have the same size. The printed result may be incorrect!"),this.pageStyleSheet=document.createElement("style");var n=this.pagesOverview[0];this.pageStyleSheet.textContent="@supports ((size:A4) and (size:1pt 1pt)) {@page { size: "+n.width+"pt "+n.height+"pt;}}",e.appendChild(this.pageStyleSheet)},destroy:function(){m===this&&(this.printContainer.textContent="",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,c().then(function(){"printServiceOverlay"===v.active&&v.close("printServiceOverlay")}))},renderPages:function(){var e=this.pagesOverview.length,t=function(n,r){if(this.throwIfInactive(),++this.currentPage>=e)return o(e,e),void n();var a=this.currentPage;o(a,e),i(this,this.pdfDocument,a+1,this.pagesOverview[a]).then(this.useRenderedPage.bind(this)).then(function(){t(n,r)},r)}.bind(this);return new Promise(t)},useRenderedPage:function(e){this.throwIfInactive();var t=document.createElement("img");t.style.width=e.width,t.style.height=e.height;var n=this.scratchCanvas;"toBlob"in n&&!d.PDFJS.disableCreateObjectURL?n.toBlob(function(e){t.src=URL.createObjectURL(e)}):t.src=n.toDataURL();var i=document.createElement("div");return i.appendChild(t), this.printContainer.appendChild(i),new Promise(function(e,n){t.onload=e,t.onerror=n})},performPrint:function(){return this.throwIfInactive(),new Promise(function(e){setTimeout(function(){return this.active?(b.call(window),void setTimeout(e,20)):void e()}.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 b=window.print;window.print=function(){if(m)return void console.warn("Ignored window.print() because of a pending print job.");c().then(function(){m&&v.open("printServiceOverlay")});try{a("beforeprint")}finally{if(!m)return console.error("Expected print service to be initialized."),void("printServiceOverlay"===v.active&&v.close("printServiceOverlay"));var e=m;m.renderPages().then(function(){return e.performPrint()}).catch(function(){}).then(function(){e.active&&s()})}};var w=!!document.attachEvent;if(window.addEventListener("keydown",function(e){if(80===e.keyCode&&(e.ctrlKey||e.metaKey)&&!e.altKey&&(!e.shiftKey||window.chrome||window.opera)){if(window.print(),w)return;return e.preventDefault(),void(e.stopImmediatePropagation?e.stopImmediatePropagation():e.stopPropagation())}},!0),w&&document.attachEvent("onkeydown",function(e){if(e=e||window.event,80===e.keyCode&&e.ctrlKey)return e.keyCode=0,!1}),"onbeforeprint"in window){var y=function(e){"custom"!==e.detail&&e.stopImmediatePropagation&&e.stopImmediatePropagation()};window.addEventListener("beforeprint",y),window.addEventListener("afterprint",y)}var A;g.instance={supportsPrinting:!0,createPrintService:function(e,t,n){if(m)throw new Error("The print service is created and active.");return m=new r(e,t,n)}},t.PDFPrintService=r},function(e,t,n){function i(){}var r=n(0),a=n(5),s=n(1),o=r.mozL10n,c=a.SimpleLinkService,l=function(){function e(e){this.pageDiv=e.pageDiv,this.pdfPage=e.pdfPage,this.renderInteractiveForms=e.renderInteractiveForms,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.div=null}return e.prototype={render:function(e,t){var n=this,i={intent:void 0===t?"display":t};this.pdfPage.getAnnotations(i).then(function(t){if(e=e.clone({dontFlip:!0}),i={viewport:e,div:n.div,annotations:t,page:n.pdfPage,renderInteractiveForms:n.renderInteractiveForms,linkService:n.linkService,downloadManager:n.downloadManager},n.div)s.AnnotationLayer.update(i);else{if(0===t.length)return;n.div=document.createElement("div"),n.div.className="annotationLayer",n.pageDiv.appendChild(n.div),i.div=n.div,s.AnnotationLayer.render(i),"undefined"!=typeof o&&o.translate(n.div)}})},hide:function(){this.div&&this.div.setAttribute("hidden","true")}},e}();i.prototype={createAnnotationLayerBuilder:function(e,t,n){return new l({pageDiv:e,pdfPage:t,renderInteractiveForms:n,linkService:new c})}},t.AnnotationLayerBuilder=l,t.DefaultAnnotationLayerFactory=i},function(e,t,n){function i(e,t){var n=document.createElement("a");if(n.click)n.href=e,n.target="_parent","download"in n&&(n.download=t),(document.body||document.documentElement).appendChild(n),n.click(),n.parentNode.removeChild(n);else{if(window.top===window&&e.split("#")[0]===window.location.href.split("#")[0]){var i=e.indexOf("?")===-1?"?":"&";e=e.replace(/#|$/,i+"$&")}window.open(e,"_parent")}}function r(){}var a=n(1);r.prototype={downloadUrl:function(e,t){a.createValidAbsoluteUrl(e,"http://example.com")&&i(e+"#pdfjs.action=download",t)},downloadData:function(e,t,n){if(navigator.msSaveBlob)return navigator.msSaveBlob(new Blob([e],{type:n}),t);var r=a.createObjectURL(e,n,a.PDFJS.disableCreateObjectURL);i(r,t)},download:function(e,t,n){if(!URL)return void this.downloadUrl(t,n);if(navigator.msSaveBlob)return void(navigator.msSaveBlob(e,n)||this.downloadUrl(t,n));var r=URL.createObjectURL(e);i(r,n)}},t.DownloadManager=r},function(e,t,n){function i(e){this.element=e.element,this.document=e.element.ownerDocument,"function"==typeof e.ignoreTarget&&(this.ignoreTarget=e.ignoreTarget),this.onActiveChanged=e.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 t=this.overlay=document.createElement("div");t.className="grab-to-pan-grabbing"}function r(e){return"buttons"in e&&s?!(1&e.buttons):c||l?0===e.which:void 0}i.prototype={CSS_CLASS_GRAB:"grab-to-pan-grab",activate:function(){this.active||(this.active=!0,this.element.addEventListener("mousedown",this._onmousedown,!0),this.element.classList.add(this.CSS_CLASS_GRAB),this.onActiveChanged&&this.onActiveChanged(!0))},deactivate:function(){this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onmousedown,!0),this._endPan(),this.element.classList.remove(this.CSS_CLASS_GRAB),this.onActiveChanged&&this.onActiveChanged(!1))},toggle:function(){this.active?this.deactivate():this.activate()},ignoreTarget:function(e){return e[a]("a[href], a[href] *, input, textarea, button, button *, select, option")},_onmousedown:function(e){if(0===e.button&&!this.ignoreTarget(e.target)){if(e.originalTarget)try{e.originalTarget.tagName}catch(e){return}this.scrollLeftStart=this.element.scrollLeft,this.scrollTopStart=this.element.scrollTop,this.clientXStart=e.clientX,this.clientYStart=e.clientY,this.document.addEventListener("mousemove",this._onmousemove,!0),this.document.addEventListener("mouseup",this._endPan,!0),this.element.addEventListener("scroll",this._endPan,!0),e.preventDefault(),e.stopPropagation();var t=document.activeElement;t&&!t.contains(e.target)&&t.blur()}},_onmousemove:function(e){if(this.element.removeEventListener("scroll",this._endPan,!0),r(e))return void this._endPan();var t=e.clientX-this.clientXStart,n=e.clientY-this.clientYStart,i=this.scrollTopStart-n,a=this.scrollLeftStart-t;this.element.scrollTo?this.element.scrollTo({top:i,left:a,behavior:"instant"}):(this.element.scrollTop=i,this.element.scrollLeft=a),this.overlay.parentNode||document.body.appendChild(this.overlay)},_endPan:function(){this.element.removeEventListener("scroll",this._endPan,!0),this.document.removeEventListener("mousemove",this._onmousemove,!0),this.document.removeEventListener("mouseup",this._endPan,!0),this.overlay.remove()}};var a;["webkitM","mozM","msM","oM","m"].some(function(e){var t=e+"atches";return t in document.documentElement&&(a=t),t+="Selector",t in document.documentElement&&(a=t),a});var s=!document.documentMode||document.documentMode>9,o=window.chrome,c=o&&(o.webstore||o.app),l=/Apple/.test(navigator.vendor)&&/Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent);t.GrabToPan=i},function(e,t,n){var i=n(12),r=n(8),a=n(0),s=i.GrabToPan,o=r.Preferences,c=a.localized,l=function(){function e(e){this.container=e.container,this.eventBus=e.eventBus,this.wasActive=!1,this.handTool=new s({element:this.container,onActiveChanged:function(e){this.eventBus.dispatch("handtoolchanged",{isActive:e})}.bind(this)}),this.eventBus.on("togglehandtool",this.toggle.bind(this)),Promise.all([c,o.get("enableHandToolOnLoad")]).then(function(e){e[1]===!0&&this.handTool.activate()}.bind(this)).catch(function(e){}),this.eventBus.on("presentationmodechanged",function(e){e.switchInProgress||(e.active?this.enterPresentationMode():this.exitPresentationMode())}.bind(this))}return e.prototype={get isActive(){return!!this.handTool.active},toggle:function(){this.handTool.toggle()},enterPresentationMode:function(){this.isActive&&(this.wasActive=!0,this.handTool.deactivate())},exitPresentationMode:function(){this.wasActive&&(this.wasActive=!1,this.handTool.activate())}},e}();t.HandTool=l},function(e,t,n){var i=n(0),r=n(4),a=n(1),s=i.mozL10n,o=r.OverlayManager,c=function(){function e(e){this.overlayName=e.overlayName,this.container=e.container,this.label=e.label,this.input=e.input,this.submitButton=e.submitButton,this.cancelButton=e.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(e){13===e.keyCode&&this.verify()}.bind(this)),o.register(this.overlayName,this.container,this.close.bind(this),!0)}return e.prototype={open:function(){o.open(this.overlayName).then(function(){this.input.type="password",this.input.focus();var e=s.get("password_label",null,"Enter the password to open this PDF file.");this.reason===a.PasswordResponses.INCORRECT_PASSWORD&&(e=s.get("password_invalid",null,"Invalid password. Please try again.")),this.label.textContent=e}.bind(this))},close:function(){o.close(this.overlayName).then(function(){this.input.value="",this.input.type=""}.bind(this))},verify:function(){var e=this.input.value;if(e&&e.length>0)return this.close(),this.updateCallback(e)},setUpdateCallback:function(e,t){this.updateCallback=e,this.reason=t}},e}();t.PasswordPrompt=c},function(e,t,n){var i=n(1),r=function(){function e(e){this.attachments=null,this.container=e.container,this.eventBus=e.eventBus,this.downloadManager=e.downloadManager,this._renderedCapability=i.createPromiseCapability(),this.eventBus.on("fileattachmentannotation",this._appendAttachment.bind(this))}return e.prototype={reset:function(e){this.attachments=null;for(var t=this.container;t.firstChild;)t.removeChild(t.firstChild);e||(this._renderedCapability=i.createPromiseCapability())},_dispatchEvent:function(e){this.eventBus.dispatch("attachmentsloaded",{source:this,attachmentsCount:e}),this._renderedCapability.resolve()},_bindLink:function(e,t,n){e.onclick=function(e){return this.downloadManager.downloadData(t,n,""),!1}.bind(this)},render:function(e){e=e||{};var t=e.attachments||null,n=0;if(this.attachments){var r=e.keepRenderedCapability===!0;this.reset(r)}if(this.attachments=t,!t)return void this._dispatchEvent(n);var a=Object.keys(t).sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())});n=a.length;for(var s=0;s0&&(this.rawFileSize=e)},setDocumentAndUrl:function(e,t){this.pdfDocument=e,this.url=t,this.resolveDataAvailable()},_getProperties:function(){o.active&&(this.pdfDocument.getDownloadInfo().then(function(e){e.length!==this.rawFileSize&&(this.setFileSize(e.length),this._updateUI(this.fields.fileSize,this._parseFileSize()))}.bind(this)),this.pdfDocument.getMetadata().then(function(e){var t={fileName:a(this.url),fileSize:this._parseFileSize(),title:e.info.Title,author:e.info.Author,subject:e.info.Subject,keywords:e.info.Keywords,creationDate:this._parseDate(e.info.CreationDate),modificationDate:this._parseDate(e.info.ModDate),creator:e.info.Creator,producer:e.info.Producer,version:e.info.PDFFormatVersion,pageCount:this.pdfDocument.numPages};for(var n in t)this._updateUI(this.fields[n],t[n])}.bind(this)))},_updateUI:function(e,t){e&&void 0!==t&&""!==t&&(e.textContent=t)},_parseFileSize:function(){var e=this.rawFileSize,t=e/1024;if(t)return t<1024?s.get("document_properties_kb",{size_kb:(+t.toPrecision(3)).toLocaleString(),size_b:e.toLocaleString()},"{{size_kb}} KB ({{size_b}} bytes)"):s.get("document_properties_mb",{size_mb:(+(t/1024).toPrecision(3)).toLocaleString(),size_b:e.toLocaleString()},"{{size_mb}} MB ({{size_b}} bytes)")},_parseDate:function(e){var t=e;if(void 0===t)return"";"D:"===t.substring(0,2)&&(t=t.substring(2));var n=parseInt(t.substring(0,4),10),i=parseInt(t.substring(4,6),10)-1,r=parseInt(t.substring(6,8),10),a=parseInt(t.substring(8,10),10),o=parseInt(t.substring(10,12),10),c=parseInt(t.substring(12,14),10),l=t.substring(14,15),h=parseInt(t.substring(15,17),10),u=parseInt(t.substring(18,20),10);"-"===l?(a+=h,o+=u):"+"===l&&(a-=h,o-=u);var d=new Date(Date.UTC(n,i,r,a,o,c)),f=d.toLocaleDateString(),p=d.toLocaleTimeString();return s.get("document_properties_date_string",{date:f,time:p},"{{date}}, {{time}}")}},e}();t.PDFDocumentProperties=c},function(e,t,n){var i=n(0),r=n(7),a=i.mozL10n,s=r.FindStates,o=function(){function e(e){if(this.opened=!1,this.bar=e.bar||null,this.toggleButton=e.toggleButton||null,this.findField=e.findField||null,this.highlightAll=e.highlightAllCheckbox||null,this.caseSensitive=e.caseSensitiveCheckbox||null,this.findMsg=e.findMsg||null,this.findResultsCount=e.findResultsCount||null,this.findStatusIcon=e.findStatusIcon||null,this.findPreviousButton=e.findPreviousButton||null,this.findNextButton=e.findNextButton||null,this.findController=e.findController||null,this.eventBus=e.eventBus,null===this.findController)throw new Error("PDFFindBar cannot be used without a PDFFindController instance.");var t=this;this.toggleButton.addEventListener("click",function(){t.toggle()}),this.findField.addEventListener("input",function(){t.dispatchEvent("")}),this.bar.addEventListener("keydown",function(e){switch(e.keyCode){case 13:e.target===t.findField&&t.dispatchEvent("again",e.shiftKey);break;case 27:t.close()}}),this.findPreviousButton.addEventListener("click",function(){t.dispatchEvent("again",!0)}),this.findNextButton.addEventListener("click",function(){t.dispatchEvent("again",!1)}),this.highlightAll.addEventListener("click",function(){t.dispatchEvent("highlightallchange")}),this.caseSensitive.addEventListener("click",function(){t.dispatchEvent("casesensitivitychange")})}return e.prototype={reset:function(){this.updateUIState()},dispatchEvent:function(e,t){this.eventBus.dispatch("find",{source:this,type:e,query:this.findField.value,caseSensitive:this.caseSensitive.checked,phraseSearch:!0,highlightAll:this.highlightAll.checked,findPrevious:t})},updateUIState:function(e,t,n){var i=!1,r="",o="";switch(e){case s.FIND_FOUND:break;case s.FIND_PENDING:o="pending";break;case s.FIND_NOTFOUND:r=a.get("find_not_found",null,"Phrase not found"),i=!0;break;case s.FIND_WRAPPED:r=t?a.get("find_reached_top",null,"Reached top of document, continued from bottom"):a.get("find_reached_bottom",null,"Reached end of document, continued from top")}i?this.findField.classList.add("notFound"):this.findField.classList.remove("notFound"),this.findField.setAttribute("data-status",o),this.findMsg.textContent=r,this.updateResultsCount(n)},updateResultsCount:function(e){if(this.findResultsCount){if(!e)return void this.findResultsCount.classList.add("hidden");this.findResultsCount.textContent=e.toLocaleString(),this.findResultsCount.classList.remove("hidden")}},open:function(){this.opened||(this.opened=!0,this.toggleButton.classList.add("toggled"),this.bar.classList.remove("hidden")),this.findField.select(),this.findField.focus()},close:function(){this.opened&&(this.opened=!1,this.toggleButton.classList.remove("toggled"),this.bar.classList.add("hidden"),this.findController.active=!1)},toggle:function(){this.opened?this.close():this.open()}},e}();t.PDFFindBar=o},function(e,t,n){function i(e){this.linkService=e.linkService,this.eventBus=e.eventBus||r.getGlobalEventBus(),this.initialized=!1,this.initialDestination=null,this.initialBookmark=null}var r=n(2);i.prototype={initialize:function(e){function t(){a.previousHash=window.location.hash.slice(1),a._pushToHistory({hash:a.previousHash},!1,!0),a._updatePreviousBookmark()}function n(e,t){function n(){window.removeEventListener("popstate",n),window.addEventListener("popstate",i),a._pushToHistory(e,!1,!0),history.forward()}function i(){window.removeEventListener("popstate",i),a.allowHashChange=!0,a.historyUnlocked=!0,t()}a.historyUnlocked=!1,a.allowHashChange=!1,window.addEventListener("popstate",n),history.back()}function i(){var e=a._getPreviousParams(null,!0);if(e){var t=!a.current.dest&&a.current.hash!==a.previousHash;a._pushToHistory(e,!1,t),a._updatePreviousBookmark()}window.removeEventListener("beforeunload",i)}this.initialized=!0,this.reInitialized=!1,this.allowHashChange=!0,this.historyUnlocked=!0,this.isViewerInPresentationMode=!1,this.previousHash=window.location.hash.substring(1),this.currentBookmark="",this.currentPage=0,this.updatePreviousBookmark=!1,this.previousBookmark="",this.previousPage=0,this.nextHashParam="",this.fingerprint=e,this.currentUid=this.uid=0,this.current={};var r=window.history.state;this._isStateObjectDefined(r)?(r.target.dest?this.initialDestination=r.target.dest:this.initialBookmark=r.target.hash,this.currentUid=r.uid,this.uid=r.uid+1,this.current=r.target):(r&&r.fingerprint&&this.fingerprint!==r.fingerprint&&(this.reInitialized=!0),this._pushOrReplaceState({fingerprint:this.fingerprint},!0));var a=this;window.addEventListener("popstate",function(e){if(a.historyUnlocked){if(e.state)return void a._goTo(e.state);if(0===a.uid){var i=a.previousHash&&a.currentBookmark&&a.previousHash!==a.currentBookmark?{hash:a.currentBookmark,page:a.currentPage}:{page:1};n(i,function(){t()})}else t()}}),window.addEventListener("beforeunload",i),window.addEventListener("pageshow",function(e){window.addEventListener("beforeunload",i)}),a.eventBus.on("presentationmodechanged",function(e){a.isViewerInPresentationMode=e.active})},clearHistoryState:function(){this._pushOrReplaceState(null,!0)},_isStateObjectDefined:function(e){return!!(e&&e.uid>=0&&e.fingerprint&&this.fingerprint===e.fingerprint&&e.target&&e.target.hash)},_pushOrReplaceState:function(e,t){t?window.history.replaceState(e,"",document.URL):window.history.pushState(e,"",document.URL)},get isHashChangeUnlocked(){return!this.initialized||this.allowHashChange},_updatePreviousBookmark:function(){this.updatePreviousBookmark&&this.currentBookmark&&this.currentPage&&(this.previousBookmark=this.currentBookmark,this.previousPage=this.currentPage,this.updatePreviousBookmark=!1)},updateCurrentBookmark:function(e,t){this.initialized&&(this.currentBookmark=e.substring(1),this.currentPage=0|t,this._updatePreviousBookmark())},updateNextHashParam:function(e){this.initialized&&(this.nextHashParam=e)},push:function(e,t){if(this.initialized&&this.historyUnlocked){if(e.dest&&!e.hash&&(e.hash=this.current.hash&&this.current.dest&&this.current.dest===e.dest?this.current.hash:this.linkService.getDestinationHash(e.dest).split("#")[1]),e.page&&(e.page|=0),t){var n=window.history.state.target;return n||(this._pushToHistory(e,!1),this.previousHash=window.location.hash.substring(1)),this.updatePreviousBookmark=!this.nextHashParam,void(n&&this._updatePreviousBookmark())}if(this.nextHashParam){if(this.nextHashParam===e.hash)return this.nextHashParam=null,void(this.updatePreviousBookmark=!0);this.nextHashParam=null}e.hash?this.current.hash?this.current.hash!==e.hash?this._pushToHistory(e,!0):(!this.current.page&&e.page&&this._pushToHistory(e,!1,!0),this.updatePreviousBookmark=!0):this._pushToHistory(e,!0):this.current.page&&e.page&&this.current.page!==e.page&&this._pushToHistory(e,!0)}},_getPreviousParams:function(e,t){if(!this.currentBookmark||!this.currentPage)return null;if(this.updatePreviousBookmark&&(this.updatePreviousBookmark=!1),this.uid>0&&(!this.previousBookmark||!this.previousPage))return null;if(!this.current.dest&&!e||t){if(this.previousBookmark===this.currentBookmark)return null}else{if(!this.current.page&&!e)return null;if(this.previousPage===this.currentPage)return null}var n={hash:this.currentBookmark,page:this.currentPage};return this.isViewerInPresentationMode&&(n.hash=null),n},_stateObj:function(e){return{fingerprint:this.fingerprint,uid:this.uid,target:e}},_pushToHistory:function(e,t,n){if(this.initialized){if(!e.hash&&e.page&&(e.hash="page="+e.page),t&&!n){var i=this._getPreviousParams();if(i){var r=!this.current.dest&&this.current.hash!==this.previousHash;this._pushToHistory(i,!1,r)}}this._pushOrReplaceState(this._stateObj(e),n||0===this.uid),this.currentUid=this.uid++,this.current=e,this.updatePreviousBookmark=!0}},_goTo:function(e){if(this.initialized&&this.historyUnlocked&&this._isStateObjectDefined(e)){if(!this.reInitialized&&e.uidthis.uid&&(this.uid=e.uid),this.current=e.target,this.updatePreviousBookmark=!0;var n=window.location.hash.substring(1);this.previousHash!==n&&(this.allowHashChange=!1),this.previousHash=n,this.historyUnlocked=!0}},back:function(){this.go(-1)},forward:function(){this.go(1)},go:function(e){if(this.initialized&&this.historyUnlocked){var t=window.history.state;e===-1&&t&&t.uid>0?window.history.back():1===e&&t&&t.uid0;)for(var c=s.shift(),l=0,h=c.items.length;l0){o=!0,this._addToggleButton(d);var p=document.createElement("div");p.className="outlineItems",d.appendChild(p),s.push({parent:p,items:u.items})}c.parent.appendChild(d),n++}o&&this.container.classList.add("outlineWithDeepNesting"),this.container.appendChild(r),this._dispatchEvent(n)}},e}();t.PDFOutlineViewer=s},function(e,t,n){var i=n(0),r=n(3),a=n(2),s=n(1),o=i.CSS_UNITS,c=i.DEFAULT_SCALE,l=i.getOutputScale,h=i.approximateFraction,u=i.roundToDivide,d=i.RendererType,f=r.RenderingStates,p=200,g=function(){function e(e){var t=e.container,n=e.id,i=e.scale,r=e.defaultViewport,s=e.renderingQueue,o=e.textLayerFactory,l=e.annotationLayerFactory,h=e.enhanceTextSelection||!1,u=e.renderInteractiveForms||!1;this.id=n,this.renderingId="page"+n,this.pageLabel=null,this.rotation=0,this.scale=i||c,this.viewport=r,this.pdfPageRotate=r.rotation,this.hasRestrictedScaling=!1,this.enhanceTextSelection=h,this.renderInteractiveForms=u,this.eventBus=e.eventBus||a.getGlobalEventBus(),this.renderingQueue=s,this.textLayerFactory=o,this.annotationLayerFactory=l,this.renderer=e.renderer||d.CANVAS,this.paintTask=null,this.paintedViewportMap=new WeakMap,this.renderingState=f.INITIAL,this.resume=null,this.error=null,this.onBeforeDraw=null,this.onAfterDraw=null,this.textLayer=null,this.zoomLayer=null,this.annotationLayer=null;var p=document.createElement("div");p.className="page",p.style.width=Math.floor(this.viewport.width)+"px",p.style.height=Math.floor(this.viewport.height)+"px",p.setAttribute("data-page-number",this.id),this.div=p,t.appendChild(p)}return e.prototype={setPdfPage:function(e){this.pdfPage=e,this.pdfPageRotate=e.rotate;var t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport(this.scale*o,t),this.stats=e.stats,this.reset()},destroy:function(){this.zoomLayer=null,this.reset(),this.pdfPage&&this.pdfPage.cleanup()},reset:function(e,t){this.cancelRendering();var n=this.div;n.style.width=Math.floor(this.viewport.width)+"px",n.style.height=Math.floor(this.viewport.height)+"px";for(var i=n.childNodes,r=e&&this.zoomLayer||null,a=t&&this.annotationLayer&&this.annotationLayer.div||null,s=i.length-1;s>=0;s--){var o=i[s];r!==o&&a!==o&&n.removeChild(o)}n.removeAttribute("data-loaded"),a?this.annotationLayer.hide():this.annotationLayer=null,this.canvas&&!r&&(this.paintedViewportMap.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this.svg&&(this.paintedViewportMap.delete(this.svg),delete this.svg),this.loadingIconDiv=document.createElement("div"),this.loadingIconDiv.className="loadingIcon",n.appendChild(this.loadingIconDiv)},update:function(e,t){this.scale=e||this.scale,"undefined"!=typeof t&&(this.rotation=t);var n=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*o,rotation:n}),this.svg)return this.cssTransform(this.svg,!0),void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0});var i=!1;if(this.canvas&&s.PDFJS.maxCanvasPixels>0){var r=this.outputScale;(Math.floor(this.viewport.width)*r.sx|0)*(Math.floor(this.viewport.height)*r.sy|0)>s.PDFJS.maxCanvasPixels&&(i=!0)}if(this.canvas){if(s.PDFJS.useOnlyCssZoom||this.hasRestrictedScaling&&i)return this.cssTransform(this.canvas,!0),void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0});this.zoomLayer||(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform(this.zoomLayer.firstChild),this.reset(!0,!0)},cancelRendering:function(){this.paintTask&&(this.paintTask.cancel(),this.paintTask=null),this.renderingState=f.INITIAL,this.resume=null,this.textLayer&&(this.textLayer.cancel(),this.textLayer=null)},updatePosition:function(){this.textLayer&&this.textLayer.render(p)},cssTransform:function(e,t){var n=s.CustomStyle,i=this.viewport.width,r=this.viewport.height,a=this.div;e.style.width=e.parentNode.style.width=a.style.width=Math.floor(i)+"px",e.style.height=e.parentNode.style.height=a.style.height=Math.floor(r)+"px";var o=this.viewport.rotation-this.paintedViewportMap.get(e).rotation,c=Math.abs(o),l=1,h=1;90!==c&&270!==c||(l=r/i,h=i/r);var u="rotate("+o+"deg) scale("+l+","+h+")";if(n.setProp("transform",e,u),this.textLayer){var d=this.textLayer.viewport,f=this.viewport.rotation-d.rotation,p=Math.abs(f),g=i/d.width;90!==p&&270!==p||(g=i/d.height);var v,m,b=this.textLayer.textLayerDiv;switch(p){case 0:v=m=0;break;case 90:v=0,m="-"+b.style.height;break;case 180:v="-"+b.style.width,m="-"+b.style.height;break;case 270:v="-"+b.style.width,m=0;break;default:console.error("Bad rotation value.")}n.setProp("transform",b,"rotate("+p+"deg) scale("+g+", "+g+") translate("+v+", "+m+")"),n.setProp("transformOrigin",b,"0% 0%")}t&&this.annotationLayer&&this.annotationLayer.render(this.viewport,"display")},get width(){return this.viewport.width},get height(){return this.viewport.height},getPagePoint:function(e,t){return this.viewport.convertToPdfPoint(e,t)},draw:function(){this.renderingState!==f.INITIAL&&(console.error("Must be in new state before drawing"),this.reset()),this.renderingState=f.RUNNING;var e=this,t=this.pdfPage,n=this.div,i=document.createElement("div");i.style.width=n.style.width,i.style.height=n.style.height,i.classList.add("canvasWrapper"),this.annotationLayer&&this.annotationLayer.div?n.insertBefore(i,this.annotationLayer.div):n.appendChild(i);var r=null,a=null;this.textLayerFactory&&(r=document.createElement("div"),r.className="textLayer",r.style.width=i.style.width,r.style.height=i.style.height,this.annotationLayer&&this.annotationLayer.div?n.insertBefore(r,this.annotationLayer.div):n.appendChild(r),a=this.textLayerFactory.createTextLayerBuilder(r,this.id-1,this.viewport,this.enhanceTextSelection)),this.textLayer=a;var s=null;this.renderingQueue&&(s=function(t){return e.renderingQueue.isHighestPriority(e)?void t():(e.renderingState=f.PAUSED,void(e.resume=function(){e.renderingState=f.RUNNING,t()}))});var o=function(i){if(c===e.paintTask&&(e.paintTask=null),"cancelled"===i)return e.error=null,Promise.resolve(void 0);if(e.renderingState=f.FINISHED,e.loadingIconDiv&&(n.removeChild(e.loadingIconDiv),delete e.loadingIconDiv),e.zoomLayer){var r=e.zoomLayer.firstChild;e.paintedViewportMap.delete(r),r.width=0,r.height=0,n.contains(e.zoomLayer)&&n.removeChild(e.zoomLayer),e.zoomLayer=null}return e.error=i,e.stats=t.stats,e.onAfterDraw&&e.onAfterDraw(),e.eventBus.dispatch("pagerendered",{source:e,pageNumber:e.id,cssTransform:!1}),i?Promise.reject(i):Promise.resolve(void 0)},c=this.renderer===d.SVG?this.paintOnSvg(i):this.paintOnCanvas(i);c.onRenderContinue=s,this.paintTask=c;var l=c.promise.then(function(){return o(null).then(function(){a&&t.getTextContent({normalizeWhitespace:!0}).then(function(e){a.setTextContent(e),a.render(p)})})},function(e){return o(e)});return this.annotationLayerFactory&&(this.annotationLayer||(this.annotationLayer=this.annotationLayerFactory.createAnnotationLayerBuilder(n,t,this.renderInteractiveForms)),this.annotationLayer.render(this.viewport,"display")),n.setAttribute("data-loaded",!0),this.onBeforeDraw&&this.onBeforeDraw(),l},paintOnCanvas:function(e){var t,n,i=new Promise(function(e,i){t=e,n=i}),r={promise:i,onRenderContinue:function(e){e()},cancel:function(){P.cancel()}},a=this.viewport,c=document.createElement("canvas");c.id="page"+this.id,c.setAttribute("hidden","hidden");var d=!0,f=function(){d&&(c.removeAttribute("hidden"),d=!1)};e.appendChild(c),this.canvas=c,c.mozOpaque=!0;var p=c.getContext("2d",{alpha:!1}),g=l(p);if(this.outputScale=g,s.PDFJS.useOnlyCssZoom){var v=a.clone({scale:o});g.sx*=v.width/a.width,g.sy*=v.height/a.height,g.scaled=!0}if(s.PDFJS.maxCanvasPixels>0){var m=a.width*a.height,b=Math.sqrt(s.PDFJS.maxCanvasPixels/m);g.sx>b||g.sy>b?(g.sx=b,g.sy=b,g.scaled=!0,this.hasRestrictedScaling=!0):this.hasRestrictedScaling=!1}var w=h(g.sx),y=h(g.sy);c.width=u(a.width*g.sx,w[0]),c.height=u(a.height*g.sy,y[0]),c.style.width=u(a.width,w[1])+"px",c.style.height=u(a.height,y[1])+"px",this.paintedViewportMap.set(c,a);var A=g.scaled?[g.sx,0,0,g.sy,0,0]:null,S={canvasContext:p,transform:A,viewport:this.viewport,renderInteractiveForms:this.renderInteractiveForms},P=this.pdfPage.render(S);return P.onContinue=function(e){ f(),r.onRenderContinue?r.onRenderContinue(e):e()},P.promise.then(function(){f(),t(void 0)},function(e){f(),n(e)}),r},paintOnSvg:function(e){var t=!1,n=function(){if(t)throw"cancelled"},i=this,r=this.pdfPage,a=s.SVGGraphics,c=this.viewport.clone({scale:o}),l=r.getOperatorList().then(function(t){n();var s=new a(r.commonObjs,r.objs);return s.getSVG(t,c).then(function(t){n(),i.svg=t,i.paintedViewportMap.set(t,c),t.style.width=e.style.width,t.style.height=e.style.height,i.renderingState=f.FINISHED,e.appendChild(t)})});return{promise:l,onRenderContinue:function(e){e()},cancel:function(){t=!0}}},setPageLabel:function(e){this.pageLabel="string"==typeof e?e:null,null!==this.pageLabel?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}},e}();t.PDFPageView=g},function(e,t,n){var i=n(0),r=i.normalizeWheelEventDelta,a=1500,s=3e3,o="pdfPresentationMode",c="pdfPresentationModeControls",l=function(){function e(e){this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,this.pdfViewer=e.pdfViewer,this.eventBus=e.eventBus;var t=e.contextMenuItems||null;this.active=!1,this.args=null,this.contextMenuOpen=!1,this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0,this.touchSwipeState=null,t&&(t.contextFirstPage.addEventListener("click",function(e){this.contextMenuOpen=!1,this.eventBus.dispatch("firstpage")}.bind(this)),t.contextLastPage.addEventListener("click",function(e){this.contextMenuOpen=!1,this.eventBus.dispatch("lastpage")}.bind(this)),t.contextPageRotateCw.addEventListener("click",function(e){this.contextMenuOpen=!1,this.eventBus.dispatch("rotatecw")}.bind(this)),t.contextPageRotateCcw.addEventListener("click",function(e){this.contextMenuOpen=!1,this.eventBus.dispatch("rotateccw")}.bind(this)))}return e.prototype={request:function(){if(this.switchInProgress||this.active||!this.viewer.hasChildNodes())return!1;if(this._addFullscreenChangeListeners(),this._setSwitchInProgress(),this._notifyStateChange(),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)return!1;this.container.msRequestFullscreen()}return this.args={page:this.pdfViewer.currentPageNumber,previousScale:this.pdfViewer.currentScaleValue},!0},_mouseWheel:function(e){if(this.active){e.preventDefault();var t=r(e),n=50,i=.1,a=(new Date).getTime(),s=this.mouseScrollTimeStamp;if(!(a>s&&a-s0&&t<0||this.mouseScrollDelta<0&&t>0)&&this._resetMouseScrollState(),this.mouseScrollDelta+=t,Math.abs(this.mouseScrollDelta)>=i)){var o=this.mouseScrollDelta;this._resetMouseScrollState();var c=o>0?this._goToPreviousPage():this._goToNextPage();c&&(this.mouseScrollTimeStamp=a)}}},get isFullscreen(){return!!(document.fullscreenElement||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement)},_goToPreviousPage:function(){var e=this.pdfViewer.currentPageNumber;return!(e<=1)&&(this.pdfViewer.currentPageNumber=e-1,!0)},_goToNextPage:function(){var e=this.pdfViewer.currentPageNumber;return!(e>=this.pdfViewer.pagesCount)&&(this.pdfViewer.currentPageNumber=e+1,!0)},_notifyStateChange:function(){this.eventBus.dispatch("presentationmodechanged",{source:this,active:this.active,switchInProgress:!!this.switchInProgress})},_setSwitchInProgress:function(){this.switchInProgress&&clearTimeout(this.switchInProgress),this.switchInProgress=setTimeout(function(){this._removeFullscreenChangeListeners(),delete this.switchInProgress,this._notifyStateChange()}.bind(this),a)},_resetSwitchInProgress:function(){this.switchInProgress&&(clearTimeout(this.switchInProgress),delete this.switchInProgress)},_enter:function(){this.active=!0,this._resetSwitchInProgress(),this._notifyStateChange(),this.container.classList.add(o),setTimeout(function(){this.pdfViewer.currentPageNumber=this.args.page,this.pdfViewer.currentScaleValue="page-fit"}.bind(this),0),this._addWindowListeners(),this._showControls(),this.contextMenuOpen=!1,this.container.setAttribute("contextmenu","viewerContextMenu"),window.getSelection().removeAllRanges()},_exit:function(){var e=this.pdfViewer.currentPageNumber;this.container.classList.remove(o),setTimeout(function(){this.active=!1,this._removeFullscreenChangeListeners(),this._notifyStateChange(),this.pdfViewer.currentScaleValue=this.args.previousScale,this.pdfViewer.currentPageNumber=e,this.args=null}.bind(this),0),this._removeWindowListeners(),this._hideControls(),this._resetMouseScrollState(),this.container.removeAttribute("contextmenu"),this.contextMenuOpen=!1},_mouseDown:function(e){if(this.contextMenuOpen)return this.contextMenuOpen=!1,void e.preventDefault();if(0===e.button){var t=e.target.href&&e.target.classList.contains("internalLink");t||(e.preventDefault(),this.pdfViewer.currentPageNumber+=e.shiftKey?-1:1)}},_contextMenu:function(){this.contextMenuOpen=!0},_showControls:function(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(c),this.controlsTimeout=setTimeout(function(){this.container.classList.remove(c),delete this.controlsTimeout}.bind(this),s)},_hideControls:function(){this.controlsTimeout&&(clearTimeout(this.controlsTimeout),this.container.classList.remove(c),delete this.controlsTimeout)},_resetMouseScrollState:function(){this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0},_touchSwipe:function(e){if(this.active){var t=50,n=Math.PI/6;if(e.touches.length>1)return void(this.touchSwipeState=null);switch(e.type){case"touchstart":this.touchSwipeState={startX:e.touches[0].pageX,startY:e.touches[0].pageY,endX:e.touches[0].pageX,endY:e.touches[0].pageY};break;case"touchmove":if(null===this.touchSwipeState)return;this.touchSwipeState.endX=e.touches[0].pageX,this.touchSwipeState.endY=e.touches[0].pageY,e.preventDefault();break;case"touchend":if(null===this.touchSwipeState)return;var i=0,r=this.touchSwipeState.endX-this.touchSwipeState.startX,a=this.touchSwipeState.endY-this.touchSwipeState.startY,s=Math.abs(Math.atan2(a,r));Math.abs(r)>t&&(s<=n||s>=Math.PI-n)?i=r:Math.abs(a)>t&&Math.abs(s-Math.PI/2)<=n&&(i=a),i>0?this._goToPreviousPage():i<0&&this._goToNextPage()}}},_addWindowListeners:function(){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(){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(){this.isFullscreen?this._enter():this._exit()},_addFullscreenChangeListeners:function(){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(){window.removeEventListener("fullscreenchange",this.fullscreenChangeBind),window.removeEventListener("mozfullscreenchange",this.fullscreenChangeBind),window.removeEventListener("webkitfullscreenchange",this.fullscreenChangeBind),window.removeEventListener("MSFullscreenChange",this.fullscreenChangeBind),delete this.fullscreenChangeBind}},e}();t.PDFPresentationMode=l},function(e,t,n){var i=n(3),r=n(0),a=i.RenderingStates,s=r.mozL10n,o="pdfSidebarNotification",c={NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3},l=function(){function e(e){this.isOpen=!1,this.active=c.THUMBS,this.isInitialViewSet=!1,this.onToggled=null,this.pdfViewer=e.pdfViewer,this.pdfThumbnailViewer=e.pdfThumbnailViewer,this.pdfOutlineViewer=e.pdfOutlineViewer,this.mainContainer=e.mainContainer,this.outerContainer=e.outerContainer,this.eventBus=e.eventBus,this.toggleButton=e.toggleButton,this.thumbnailButton=e.thumbnailButton,this.outlineButton=e.outlineButton,this.attachmentsButton=e.attachmentsButton,this.thumbnailView=e.thumbnailView,this.outlineView=e.outlineView,this.attachmentsView=e.attachmentsView,this.disableNotification=e.disableNotification||!1,this._addEventListeners()}return e.prototype={reset:function(){this.isInitialViewSet=!1,this._hideUINotification(null),this.switchView(c.THUMBS),this.outlineButton.disabled=!1,this.attachmentsButton.disabled=!1},get visibleView(){return this.isOpen?this.active:c.NONE},get isThumbnailViewVisible(){return this.isOpen&&this.active===c.THUMBS},get isOutlineViewVisible(){return this.isOpen&&this.active===c.OUTLINE},get isAttachmentsViewVisible(){return this.isOpen&&this.active===c.ATTACHMENTS},setInitialView:function(e){if(!this.isInitialViewSet){if(this.isInitialViewSet=!0,this.isOpen&&e===c.NONE)return void this._dispatchEvent();var t=e===this.visibleView;this.switchView(e,!0),t&&this._dispatchEvent()}},switchView:function(e,t){if(e===c.NONE)return void this.close();var n=e!==this.active,i=!1;switch(e){case c.THUMBS:this.thumbnailButton.classList.add("toggled"),this.outlineButton.classList.remove("toggled"),this.attachmentsButton.classList.remove("toggled"),this.thumbnailView.classList.remove("hidden"),this.outlineView.classList.add("hidden"),this.attachmentsView.classList.add("hidden"),this.isOpen&&n&&(this._updateThumbnailViewer(),i=!0);break;case c.OUTLINE:if(this.outlineButton.disabled)return;this.thumbnailButton.classList.remove("toggled"),this.outlineButton.classList.add("toggled"),this.attachmentsButton.classList.remove("toggled"),this.thumbnailView.classList.add("hidden"),this.outlineView.classList.remove("hidden"),this.attachmentsView.classList.add("hidden");break;case c.ATTACHMENTS:if(this.attachmentsButton.disabled)return;this.thumbnailButton.classList.remove("toggled"),this.outlineButton.classList.remove("toggled"),this.attachmentsButton.classList.add("toggled"),this.thumbnailView.classList.add("hidden"),this.outlineView.classList.add("hidden"),this.attachmentsView.classList.remove("hidden");break;default:return void console.error('PDFSidebar_switchView: "'+e+'" is an unsupported value.')}return this.active=0|e,t&&!this.isOpen?void this.open():(i&&this._forceRendering(),n&&this._dispatchEvent(),void this._hideUINotification(this.active))},open:function(){this.isOpen||(this.isOpen=!0,this.toggleButton.classList.add("toggled"),this.outerContainer.classList.add("sidebarMoving"),this.outerContainer.classList.add("sidebarOpen"),this.active===c.THUMBS&&this._updateThumbnailViewer(),this._forceRendering(),this._dispatchEvent(),this._hideUINotification(this.active))},close:function(){this.isOpen&&(this.isOpen=!1,this.toggleButton.classList.remove("toggled"),this.outerContainer.classList.add("sidebarMoving"),this.outerContainer.classList.remove("sidebarOpen"),this._forceRendering(),this._dispatchEvent())},toggle:function(){this.isOpen?this.close():this.open()},_dispatchEvent:function(){this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.visibleView})},_forceRendering:function(){this.onToggled?this.onToggled():(this.pdfViewer.forceRendering(),this.pdfThumbnailViewer.forceRendering())},_updateThumbnailViewer:function(){for(var e=this.pdfViewer,t=this.pdfThumbnailViewer,n=e.pagesCount,i=0;i=0;n--)e.removeChild(t[n]);var i=2*l;e.style.width=this.canvasWidth+i+"px",e.style.height=this.canvasHeight+i+"px",this.canvas&&(this.canvas.width=0,this.canvas.height=0,delete this.canvas),this.image&&(this.image.removeAttribute("src"),delete this.image)},update:function(e){"undefined"!=typeof e&&(this.rotation=e);var t=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:t}),this.reset()},cancelRendering:function(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null),this.renderingState=o.INITIAL,this.resume=null},_getPageDrawContext:function(e){var t=document.createElement("canvas");this.canvas=t,t.mozOpaque=!0;var n=t.getContext("2d",{alpha:!1}),i=s(n);return t.width=this.canvasWidth*i.sx|0,t.height=this.canvasHeight*i.sy|0,t.style.width=this.canvasWidth+"px",t.style.height=this.canvasHeight+"px",!e&&i.scaled&&n.scale(i.sx,i.sy),n},_convertCanvasToImage:function(){if(this.canvas&&this.renderingState===o.FINISHED){var e=this.renderingId,t="thumbnailImage",n=a.get("thumb_page_canvas",{page:this.pageId},"Thumbnail of Page {{page}}");if(this.disableCanvasToImageConversion)return this.canvas.id=e,this.canvas.className=t,this.canvas.setAttribute("aria-label",n),this.div.setAttribute("data-loaded",!0),void this.ring.appendChild(this.canvas);var i=document.createElement("img");i.id=e,i.className=t,i.setAttribute("aria-label",n),i.style.width=this.canvasWidth+"px",i.style.height=this.canvasHeight+"px",i.src=this.canvas.toDataURL(),this.image=i,this.div.setAttribute("data-loaded",!0),this.ring.appendChild(i),this.canvas.width=0,this.canvas.height=0,delete this.canvas}},draw:function(){function e(e){return h===r.renderTask&&(r.renderTask=null),"cancelled"===e?void n(e):(r.renderingState=o.FINISHED,r._convertCanvasToImage(),void(e?n(e):t(void 0)))}if(this.renderingState!==o.INITIAL)return console.error("Must be in new state before drawing"),Promise.resolve(void 0);this.renderingState=o.RUNNING;var t,n,i=new Promise(function(e,i){t=e,n=i}),r=this,a=this._getPageDrawContext(),s=this.viewport.clone({scale:this.scale}),c=function(e){return r.renderingQueue.isHighestPriority(r)?void e():(r.renderingState=o.PAUSED,void(r.resume=function(){r.renderingState=o.RUNNING,e()}))},l={canvasContext:a,viewport:s},h=this.renderTask=this.pdfPage.render(l);return h.onContinue=c,h.promise.then(function(){e(null)},function(t){e(t)}),i},setImage:function(t){if(this.renderingState===o.INITIAL){var n=t.canvas;if(n){this.pdfPage||this.setPdfPage(t.pdfPage),this.renderingState=o.FINISHED;var i=this._getPageDrawContext(!0),r=i.canvas;if(n.width<=2*r.width)return i.drawImage(n,0,0,n.width,n.height,0,0,r.width,r.height),void this._convertCanvasToImage();for(var a=3,s=r.width<n.width||c>n.height;)s>>=1,c>>=1;for(h.drawImage(n,0,0,n.width,n.height,0,0,s,c);s>2*r.width;)h.drawImage(l,0,0,s,c,0,0,s>>1,c>>1),s>>=1,c>>=1;i.drawImage(l,0,0,s,c,0,0,r.width,r.height),this._convertCanvasToImage()}}},get pageId(){return null!==this.pageLabel?this.pageLabel:this.id},setPageLabel:function(e){if(this.pageLabel="string"==typeof e?e:null,this.anchor.title=a.get("thumb_page_title",{page:this.pageId},"Page {{page}}"),this.renderingState===o.FINISHED){var t=a.get("thumb_page_canvas",{page:this.pageId},"Thumbnail of Page {{page}}");this.image?this.image.setAttribute("aria-label",t):this.disableCanvasToImageConversion&&this.canvas&&this.canvas.setAttribute("aria-label",t)}}},t}();h.tempImageCache=null,t.PDFThumbnailView=h},function(e,t,n){var i=n(0),r=n(23),a=i.watchScroll,s=i.getVisibleElements,o=i.scrollIntoView,c=r.PDFThumbnailView,l=-19,h=function(){function e(e){this.container=e.container,this.renderingQueue=e.renderingQueue,this.linkService=e.linkService,this.scroll=a(this.container,this._scrollUpdated.bind(this)),this._resetView()}return e.prototype={_scrollUpdated:function(){this.renderingQueue.renderHighestPriority()},getThumbnail:function(e){return this.thumbnails[e]},_getVisibleThumbs:function(){return s(this.container,this.thumbnails)},scrollThumbnailIntoView:function(e){var t=document.querySelector(".thumbnail.selected");t&&t.classList.remove("selected");var n=document.querySelector('div.thumbnail[data-page-number="'+e+'"]');n&&n.classList.add("selected");var i=this._getVisibleThumbs(),r=i.views.length;if(r>0){var a=i.first.id,s=r>1?i.last.id:a;(e<=a||e>=s)&&o(n,{top:l})}},get pagesRotation(){return this._pagesRotation},set pagesRotation(e){this._pagesRotation=e;for(var t=0,n=this.thumbnails.length;t=0&&t.splice(i,1),t.push(n),t.length>e&&t.shift().destroy()},this.resize=function(n){for(e=n;t.length>e;)t.shift().destroy()}}function t(e,t){return t===e||Math.abs(t-e)<1e-15}function n(e){return e.width<=e.height}function i(e){this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,this.eventBus=e.eventBus||l.getGlobalEventBus(),this.linkService=e.linkService||new L,this.downloadManager=e.downloadManager||null,this.removePageBorders=e.removePageBorders||!1,this.enhanceTextSelection=e.enhanceTextSelection||!1,this.renderInteractiveForms=e.renderInteractiveForms||!1,this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.renderer=e.renderer||b.CANVAS,this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new x,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue,this.scroll=y(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=k.UNKNOWN,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders")}return i.prototype={get pagesCount(){return this._pages.length},getPageView:function(e){return this._pages[e]},get pageViewsReady(){return this._pageViewsReady},get currentPageNumber(){return this._currentPageNumber},set currentPageNumber(e){if((0|e)!==e)throw new Error("Invalid page number.");return this.pdfDocument?void this._setCurrentPageNumber(e,!0):void(this._currentPageNumber=e)},_setCurrentPageNumber:function(e,t){if(this._currentPageNumber===e)return void(t&&this._resetCurrentPageView());if(!(0=0&&(t=n+1)}this.currentPageNumber=t},get currentScale(){return this._currentScale!==u?this._currentScale:v},set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale");return this.pdfDocument?void this._setScale(e,!1):(this._currentScale=e,void(this._currentScaleValue=e!==u?e.toString():null))},get currentScaleValue(){return this._currentScaleValue},set currentScaleValue(e){return this.pdfDocument?void this._setScale(e,!1):(this._currentScale=isNaN(e)?u:e,void(this._currentScaleValue=e.toString()))},get pagesRotation(){return this._pagesRotation},set pagesRotation(e){if("number"!=typeof e||e%90!==0)throw new Error("Invalid pages rotation angle.");if(this._pagesRotation=e,this.pdfDocument){for(var t=0,n=this._pages.length;t0)this._setScaleUpdatePages(n,e,t,!1);else{var i=this._pages[this._currentPageNumber-1];if(!i)return;var r=this.isInPresentationMode||this.removePageBorders?0:d,a=this.isInPresentationMode||this.removePageBorders?0:f,s=(this.container.clientWidth-r)/i.width*i.scale,o=(this.container.clientHeight-a)/i.height*i.scale;switch(e){case"page-actual":n=1;break;case"page-width":n=s;break;case"page-height":n=o;break;case"page-fit":n=Math.min(s,o);break;case"auto":var c=i.width>i.height,l=c?Math.min(o,s):s;n=Math.min(p,l);break;default:return void console.error('PDFViewer_setScale: "'+e+'" is an unknown zoom value.')}this._setScaleUpdatePages(n,e,t,!0)}},_resetCurrentPageView:function(){this.isInPresentationMode&&this._setScale(this._currentScaleValue,!0);var e=this._pages[this._currentPageNumber-1];w(e.div)},scrollPageIntoView:function(e){if(this.pdfDocument){if(arguments.length>1||"number"==typeof e){console.warn("Call of scrollPageIntoView() with obsolete signature.");var t={};"number"==typeof e&&(t.pageNumber=e),arguments[1]instanceof Array&&(t.destArray=arguments[1]),e=t}var n=e.pageNumber||0,i=e.destArray||null,r=e.allowNegativeOffset||!1;if(this.isInPresentationMode||!i)return void this._setCurrentPageNumber(n,!0);var a=this._pages[n-1];if(!a)return void console.error('PDFViewer_scrollPageIntoView: Invalid "pageNumber" parameter.');var s,o,c=0,l=0,h=0,p=0,v=a.rotation%180!==0,b=(v?a.height:a.width)/a.scale/g,y=(v?a.width:a.height)/a.scale/g,A=0;switch(i[1].name){case"XYZ":c=i[2],l=i[3],A=i[4],c=null!==c?c:0,l=null!==l?l:y;break;case"Fit":case"FitB":A="page-fit";break;case"FitH":case"FitBH":l=i[2],A="page-width",null===l&&this._location&&(c=this._location.left,l=this._location.top);break;case"FitV":case"FitBV":c=i[2],h=b,p=y,A="page-height";break;case"FitR":c=i[2],l=i[3],h=i[4]-c,p=i[5]-l;var S=this.removePageBorders?0:d,P=this.removePageBorders?0:f;s=(this.container.clientWidth-S)/h/g,o=(this.container.clientHeight-P)/p/g,A=Math.min(Math.abs(s),Math.abs(o));break;default:return void console.error("PDFViewer_scrollPageIntoView: '"+i[1].name+"' is not a valid destination type.")}if(A&&A!==this._currentScale?this.currentScaleValue=A:this._currentScale===u&&(this.currentScaleValue=m),"page-fit"===A&&!i[4])return void w(a.div);var x=[a.viewport.convertToViewportPoint(c,l),a.viewport.convertToViewportPoint(c+h,l+p)],C=Math.min(x[0][0],x[1][0]),_=Math.min(x[0][1],x[1][1]);r||(C=Math.max(C,0),_=Math.max(_,0)),w(a.div,{left:C,top:_})}},_updateLocation:function(e){var t=this._currentScale,n=this._currentScaleValue,i=parseFloat(n)===t?Math.round(1e4*t)/100:n,r=e.id,a="#page="+r; a+="&zoom="+i;var s=this._pages[r-1],o=this.container,c=s.getPagePoint(o.scrollLeft-e.x,o.scrollTop-e.y),l=Math.round(c[0]),h=Math.round(c[1]);a+=","+l+","+h,this._location={pageNumber:r,scale:i,top:h,left:l,pdfOpenParams:a}},update:function(){var e=this._getVisiblePages(),t=e.views;if(0!==t.length){var n=Math.max(T,2*t.length+1);this._buffer.resize(n),this.renderingQueue.renderHighestPriority(e);for(var i=this._currentPageNumber,r=e.first,a=0,s=t.length,o=!1;athis.container.clientWidth},_getVisiblePages:function(){if(!this.isInPresentationMode)return A(this.container,this._pages,!0);var e=[],t=this._pages[this._currentPageNumber-1];return e.push({id:t.id,view:t}),{first:t,last:t,views:e}},cleanup:function(){for(var e=0,t=this._pages.length;e=this.pagesCount,e.pageRotateCw.disabled=0===this.pagesCount,e.pageRotateCcw.disabled=0===this.pagesCount},_bindClickListeners:function(){this.toggleButton.addEventListener("click",this.toggle.bind(this));for(var e in this.buttons){var t=this.buttons[e].element,n=this.buttons[e].eventName,i=this.buttons[e].close;t.addEventListener("click",function(e,t){null!==e&&this.eventBus.dispatch(e,{source:this}),t&&this.close()}.bind(this,n,i))}},_bindHandToolListener:function(e){var t=!1;this.eventBus.on("handtoolchanged",function(n){t!==n.isActive&&(t=n.isActive,t?(e.title=a.get("hand_tool_disable.title",null,"Disable hand tool"),e.firstElementChild.textContent=a.get("hand_tool_disable_label",null,"Disable hand tool")):(e.title=a.get("hand_tool_enable.title",null,"Enable hand tool"),e.firstElementChild.textContent=a.get("hand_tool_enable_label",null,"Enable hand tool")))})},open:function(){this.opened||(this.opened=!0,this._setMaxHeight(),this.toggleButton.classList.add("toggled"),this.toolbar.classList.remove("hidden"))},close:function(){this.opened&&(this.opened=!1,this.toolbar.classList.add("hidden"),this.toggleButton.classList.remove("toggled"))},toggle:function(){this.opened?this.close():this.open()},_setMaxHeight:function(){this.opened&&(this.containerHeight=this.mainContainer.clientHeight,this.containerHeight!==this.previousContainerHeight&&(this.toolbarButtonContainer.setAttribute("style","max-height: "+(this.containerHeight-r)+"px;"),this.previousContainerHeight=this.containerHeight))}},e}();t.SecondaryToolbar=s},function(e,t,n){function i(){}var r=n(2),a=n(1),s=300,o=function(){function e(e){this.textLayerDiv=e.textLayerDiv,this.eventBus=e.eventBus||r.getGlobalEventBus(),this.textContent=null,this.renderingDone=!1,this.pageIdx=e.pageIndex,this.pageNumber=this.pageIdx+1,this.matches=[],this.viewport=e.viewport,this.textDivs=[],this.findController=e.findController||null,this.textLayerRenderTask=null,this.enhanceTextSelection=e.enhanceTextSelection,this._bindMouse()}return e.prototype={_finishRendering:function(){if(this.renderingDone=!0,!this.enhanceTextSelection){var e=document.createElement("div");e.className="endOfContent",this.textLayerDiv.appendChild(e)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})},render:function(e){if(this.textContent&&!this.renderingDone){this.cancel(),this.textDivs=[];var t=document.createDocumentFragment();this.textLayerRenderTask=a.renderTextLayer({textContent:this.textContent,container:t,viewport:this.viewport,textDivs:this.textDivs,timeout:e,enhanceTextSelection:this.enhanceTextSelection}),this.textLayerRenderTask.promise.then(function(){this.textLayerDiv.appendChild(t),this._finishRendering(),this.updateMatches()}.bind(this),function(e){})}},cancel:function(){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null)},setTextContent:function(e){this.cancel(),this.textContent=e},convertMatches:function(e,t){var n=0,i=0,r=this.textContent.items,a=r.length-1,s=null===this.findController?0:this.findController.state.query.length,o=[];if(!e)return o;for(var c=0,l=e.length;c=i+r[n].str.length;)i+=r[n].str.length,n++;n===r.length&&console.error("Could not find a matching mapping");var u={begin:{divIdx:n,offset:h-i}};for(h+=t?t[c]:s;n!==a&&h>i+r[n].str.length;)i+=r[n].str.length,n++;u.end={divIdx:n,offset:h-i},o.push(u)}return o},renderMatches:function(e){function t(e,t){var i=e.divIdx;r[i].textContent="",n(i,0,e.offset,t)}function n(e,t,n,a){var s=r[e],o=i[e].str.substring(t,n),c=document.createTextNode(o);if(a){var l=document.createElement("span");return l.className=a,l.appendChild(c),void s.appendChild(l)}s.appendChild(c)}if(0!==e.length){var i=this.textContent.items,r=this.textDivs,a=null,s=this.pageIdx,o=null!==this.findController&&s===this.findController.selected.pageIdx,c=null===this.findController?-1:this.findController.selected.matchIdx,l=null!==this.findController&&this.findController.state.highlightAll,h={divIdx:-1,offset:void 0},u=c,d=u+1;if(l)u=0,d=e.length;else if(!o)return;for(var f=u;f=o,s.zoomOut.disabled=a<=h,s.zoomIn.disabled=a>=u,t(i,a)}},updateLoadingIndicatorState:function(e){var t=this.items.pageNumber;e?t.classList.add(d):t.classList.remove(d)},_adjustScaleWidth:function(){var e=this.items.scaleSelectContainer,t=this.items.scaleSelect;s.then(function(){if(0===e.clientWidth&&e.setAttribute("style","display: inherit;"),e.clientWidth>0){t.setAttribute("style","min-width: inherit;");var n=t.clientWidth+f;t.setAttribute("style","min-width: "+(n+p)+"px;"),e.setAttribute("style","min-width: "+n+"px; max-width: "+n+"px;")}})}},e}();t.Toolbar=g},function(e,t,n){var i=20,r=function(){function e(e,t){this.fingerprint=e,this.cacheSize=t||i,this.isInitializedPromiseResolved=!1,this.initializedPromise=this._readFromStorage().then(function(e){this.isInitializedPromiseResolved=!0;var t=JSON.parse(e||"{}");"files"in t||(t.files=[]),t.files.length>=this.cacheSize&&t.files.shift();for(var n,i=0,r=t.files.length;i