diff --git a/codepot/README b/codepot/README index 53edd5db..a5037727 100644 --- a/codepot/README +++ b/codepot/README @@ -281,5 +281,6 @@ LICENSE CodeFlower MIT ACE BSD (http://ace.c9.io) Medium-editor https://github.com/yabwe/medium-editor/blob/master/LICENSE + PDFJS https://github.com/mozilla/pdf.js ------------------------------------------------------------------------ diff --git a/codepot/src/codepot/views/code_file.php b/codepot/src/codepot/views/code_file.php index ca34de50..1b5750e6 100644 --- a/codepot/src/codepot/views/code_file.php +++ b/codepot/src/codepot/views/code_file.php @@ -2,6 +2,41 @@ + 0) + { + foreach ($file['properties'] as $pn => $pv) + { + if ($pn == 'svn:mime-type') + { + if ($pv == 'application/octet-stream' && + in_array (strtolower($fileext), array ('png', 'jpg', 'gif', 'tif', 'bmp', 'ico'))) + { + $img = @imagecreatefromstring ($file['content']); + if ($img !== FALSE) + { + @imagedestroy ($img); + $is_image_file = TRUE; + $is_special_stream = TRUE; + break; + } + } + else if ($pv == 'application/pdf') + { + $is_special_stream = TRUE; + $is_pdf_file = TRUE; + break; + } + } + } + } +?> + @@ -24,7 +59,14 @@ + ', base_url_make('/js/pdf.min.js')); +} + $enstyle_anchor_text = ' ' . $this->lang->line('Enstyle'); $destyle_anchor_text = ' ' . $this->lang->line('Destyle'); @@ -67,11 +109,94 @@ function showRawCode() showing_raw_code = !showing_raw_code; } + + +var pdf_doc = null; +var pdf_page_num = 1; +var pdf_rendering_in_progress = false; +var pdf_page_num_pending = null; +var pdf_canvas = null; +var pdf_ctx = null; + +function render_pdf_page (num) +{ + pdf_rendering_in_progress = true; + // Using promise to fetch the page + pdf_doc.getPage(num).then(function(page) { + var vp1 = page.getViewport (1); + scale = ($('#code_file_result_code').innerWidth() - 20) / vp1.width; + var viewport = page.getViewport(scale); + pdf_canvas.height = viewport.height; + pdf_canvas.width = viewport.width; + + // Render PDF page into canvas context + var renderContext = { + canvasContext: pdf_ctx, + viewport: viewport + }; + + + var renderTask = page.render(renderContext); + + // Wait for rendering to finish + renderTask.promise.then(function () { + pdf_rendering_in_progress = false; + if (pdf_page_num_pending !== null) { + // New page rendering is pending + render_pdf_pagee(pdf_page_num_pending); + pdf_page_num_pending = null; + } + }); + }); + + $('#code_file_pdf_page_num').text (pdf_page_num); + $('#code_file_pdf_page_slider').val (pdf_page_num); +} + +function queue_pdf_rendering_in_progress (num) { + if (pdf_rendering_in_progress) + { + pdf_page_num_pending = num; + } + else + { + render_pdf_page (num); + } +} + +function on_next_pdf_page () +{ + if (pdf_page_num >= pdf_doc.numPages) return; + pdf_page_num++; + queue_pdf_rendering_in_progress (pdf_page_num); +} + +function on_prev_pdf_page () +{ + if (pdf_page_num <= 1) return; + pdf_page_num--; + queue_pdf_rendering_in_progress (pdf_page_num); +} + +function on_first_pdf_page () +{ + pdf_page_num = 1; + queue_pdf_rendering_in_progress (pdf_page_num); +} + +function on_last_pdf_page () +{ + pdf_page_num = pdf_doc.numPages; + queue_pdf_rendering_in_progress (pdf_page_num); +} + + + $(function () { $('#code_file_metadata').accordion({ collapsible: true, - heightStyle: "content" + heightStyle: "content" }); $("#code_file_mainarea_loc_info").hide(); @@ -120,6 +245,45 @@ $(function () { return false; }); + + pdf_canvas = document.getElementById('code_file_pdf_canvas'); + pdf_ctx = pdf_canvas.getContext('2d'); + + PDFJS.workerSrc = ""; + + var pdf_data = new Uint8Array( [ + + ]); + + PDFJS.getDocument(pdf_data).then(function (pdf) { + pdf_doc = pdf; + render_pdf_page (pdf_page_num); + + $('#code_file_pdf_page_count').text (pdf_doc.numPages); + + $('#code_file_pdf_first_page').click (on_first_pdf_page); + $('#code_file_pdf_last_page').click (on_last_pdf_page); + $('#code_file_pdf_next_page').click (on_next_pdf_page); + $('#code_file_pdf_prev_page').click (on_prev_pdf_page); + $(window).resize(function () { queue_pdf_rendering_in_progress (pdf_page_num); }); + + $('#code_file_pdf_page_slider').prop ('min', 1); + $('#code_file_pdf_page_slider').prop ('max', pdf_doc.numPages); + $('#code_file_pdf_page_slider').change (function () { + pdf_page_num = parseInt(this.value); + queue_pdf_rendering_in_progress (pdf_page_num); + }); + + }); + + + $("#code_file_style_button").button({"label": ''}).click (function () { showRawCode(); return false; @@ -128,6 +292,8 @@ $(function () { // for code rendering $("#code_file_result_raw").html ($("#code_file_result_code").html()) prettyPrint (); + + }); @@ -228,7 +394,6 @@ $this->load->view ( print ' | '; printf ('%s: %s', $this->lang->line('Size'), $file['size']); - if ((isset($login['id']) && $login['id'] != '')) { print ' '; @@ -270,7 +435,7 @@ $this->load->view ( print anchor ('#', $history_anchor_text, 'id="code_file_history_button"'); //print anchor ('', $download_anchor_text, 'id="code_file_download_button"'); print anchor ("code/fetch/{$project->id}/${hex_headpath}{$revreq}", $download_anchor_text, 'id="code_file_download_button"'); - print anchor ('#', $this->lang->line('Enstyle'), 'id="code_file_style_button"'); + if (!$is_special_stream) print anchor ('#', $this->lang->line('Enstyle'), 'id="code_file_style_button"'); print ''; print '
'; @@ -315,7 +480,6 @@ $this->load->view (
" id="code_file_result_code"> 0) + if ($is_image_file) { - foreach ($file['properties'] as $pn => $pv) - { - if ($pn == 'svn:mime-type' && $pv == 'application/octet-stream') - { - $is_octet_stream = TRUE; - break; - } - } + print ('[image]'); } - - $is_image_stream = FALSE; - if ($is_octet_stream || - in_array (strtolower($fileext), array ('png', 'jpg', 'gif', 'tif', 'bmp', 'ico'))) + else if ($is_pdf_file) { - $img = @imagecreatefromstring ($file['content']); - if ($img !== FALSE) - { - @imagedestroy ($img); - print ('[image]'); - $is_image_stream = TRUE; - } + print '
'; + print ''; + print ''; + print ''; + print '/'; + print ''; + print ''; + print '
'; + print ''; } - - if (!$is_image_stream) + else { $charset = ''; if (array_key_exists('properties', $file) && count($file['properties']) > 0) diff --git a/codepot/src/css/code.css b/codepot/src/css/code.css index e04b76e2..9c8379eb 100644 --- a/codepot/src/css/code.css +++ b/codepot/src/css/code.css @@ -101,6 +101,20 @@ color: #FFFFFF !important; } +#code_file_pdf_navigator { + padding: 0.5em 1em 0.5em 1em; +} + +#code_file_pdf_page_slider { + padding-left: 0.5em; +} +#code_file_pdf_page { + padding-right: 0.5em; +} + +#code_file_pdf_canvas { + border: none !important; +} /*----------------------------------------------- * project source folder view *-----------------------------------------------*/ diff --git a/codepot/src/css/common.css b/codepot/src/css/common.css index 76c75def..cf0ecf53 100644 --- a/codepot/src/css/common.css +++ b/codepot/src/css/common.css @@ -817,7 +817,7 @@ span.codepot-open-issue-count { line-height: 0.9em; } -/* normal blockquote is for indentation */ */ +/* normal blockquote is for indentation */ .codepot-plain-text-view blockquote, .codepot-styled-text-view blockquote, .codepot-styled-text-preview blockquote { diff --git a/codepot/src/js/Makefile.am b/codepot/src/js/Makefile.am index f12d9e2b..bc034cc0 100644 --- a/codepot/src/js/Makefile.am +++ b/codepot/src/js/Makefile.am @@ -28,7 +28,9 @@ www_DATA = \ medium-editor-tables.js \ showdown.js \ d3.min.js \ - CodeFlower.js + CodeFlower.js \ + pdf.min.js \ + pdf.worker.min.js EXTRA_DIST = $(www_DATA) diff --git a/codepot/src/js/Makefile.in b/codepot/src/js/Makefile.in index 7d474129..a4992e55 100644 --- a/codepot/src/js/Makefile.in +++ b/codepot/src/js/Makefile.in @@ -181,7 +181,10 @@ www_DATA = \ medium-editor-tables.js \ showdown.js \ d3.min.js \ - CodeFlower.js + CodeFlower.js \ + pdf.min.js \ + pdf.worker.min.js + EXTRA_DIST = $(www_DATA) all: all-recursive diff --git a/codepot/src/js/pdf.min.js b/codepot/src/js/pdf.min.js new file mode 100644 index 00000000..077289a3 --- /dev/null +++ b/codepot/src/js/pdf.min.js @@ -0,0 +1,7 @@ +(function(root,factory){"use strict";if(typeof define==="function"&&define.amd){define("pdfjs-dist/build/pdf",["exports"],factory)}else if(typeof exports!=="undefined"){factory(exports)}else{factory(root.pdfjsDistBuildPdf={})}})(this,function(exports){"use strict";var pdfjsVersion="1.4.76";var pdfjsBuild="45fea88";var pdfjsFilePath=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:null;var pdfjsLibs={};(function pdfjsWrapper(){(function(root,factory){{factory(root.pdfjsSharedGlobal={})}})(this,function(exports){var globalScope=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:this;var isWorker=typeof window==="undefined";if(!globalScope.PDFJS){globalScope.PDFJS={}}if(typeof pdfjsVersion!=="undefined"){globalScope.PDFJS.version=pdfjsVersion}if(typeof pdfjsVersion!=="undefined"){globalScope.PDFJS.build=pdfjsBuild}globalScope.PDFJS.pdfBug=false;exports.globalScope=globalScope;exports.isWorker=isWorker;exports.PDFJS=globalScope.PDFJS});(function(root,factory){{factory(root.pdfjsDisplayDOMUtils={},root.pdfjsSharedGlobal)}})(this,function(exports,sharedGlobal){var PDFJS=sharedGlobal.PDFJS;var CustomStyle=function CustomStyleClosure(){var prefixes=["ms","Moz","Webkit","O"];var _cache=Object.create(null);function CustomStyle(){}CustomStyle.getProp=function get(propName,element){if(arguments.length===1&&typeof _cache[propName]==="string"){return _cache[propName]}element=element||document.documentElement;var style=element.style,prefixed,uPropName;if(typeof style[propName]==="string"){return _cache[propName]=propName}uPropName=propName.charAt(0).toUpperCase()+propName.slice(1);for(var i=0,l=prefixes.length;i=PDFJS.VERBOSITY_LEVELS.infos){console.log("Info: "+msg)}}function warn(msg){if(PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.warnings){console.log("Warning: "+msg)}}function deprecated(details){console.log("Deprecated API usage: "+details)}function error(msg){if(PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.errors){console.log("Error: "+msg);console.log(backtrace())}throw new Error(msg)}function backtrace(){try{throw new Error}catch(e){return e.stack?e.stack.split("\n").slice(2).join("\n"):""}}function assert(cond,msg){if(!cond){error(msg)}}var UNSUPPORTED_FEATURES=PDFJS.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"};function combineUrl(baseUrl,url){if(!url){return baseUrl}return new URL(url,baseUrl).href}function isSameOrigin(baseUrl,otherUrl){try{var base=new URL(baseUrl);if(!base.origin||base.origin==="null"){return false}}catch(e){return false}var other=new URL(otherUrl,base);return base.origin===other.origin}function isValidUrl(url,allowRelative){if(!url){return false}var protocol=/^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url);if(!protocol){return allowRelative}protocol=protocol[0].toLowerCase();switch(protocol){case"http":case"https":case"ftp":case"mailto":case"tel":return true;default:return false}}PDFJS.isValidUrl=isValidUrl;function addLinkAttributes(link,params){var url=params&¶ms.url;link.href=link.title=url?removeNullCharacters(url):"";if(url){if(isExternalLinkTargetSet()){link.target=LinkTargetStringMap[PDFJS.externalLinkTarget]}link.rel=PDFJS.externalLinkRel}}PDFJS.addLinkAttributes=addLinkAttributes;function shadow(obj,prop,value){Object.defineProperty(obj,prop,{value:value,enumerable:true,configurable:true,writable:false});return value}PDFJS.shadow=shadow;function getLookupTableFactory(initializer){var lookup;return function(){if(initializer){lookup=Object.create(null);initializer(lookup);initializer=null}return lookup}}var LinkTarget=PDFJS.LinkTarget={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};var LinkTargetStringMap=["","_self","_blank","_parent","_top"];function isExternalLinkTargetSet(){if(PDFJS.openExternalLinksInNewWindow){deprecated("PDFJS.openExternalLinksInNewWindow, please use "+'"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.');if(PDFJS.externalLinkTarget===LinkTarget.NONE){PDFJS.externalLinkTarget=LinkTarget.BLANK}PDFJS.openExternalLinksInNewWindow=false}switch(PDFJS.externalLinkTarget){case LinkTarget.NONE:return false;case LinkTarget.SELF:case LinkTarget.BLANK:case LinkTarget.PARENT:case LinkTarget.TOP:return true}warn("PDFJS.externalLinkTarget is invalid: "+PDFJS.externalLinkTarget);PDFJS.externalLinkTarget=LinkTarget.NONE;return false}PDFJS.isExternalLinkTargetSet=isExternalLinkTargetSet;var PasswordResponses=PDFJS.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var PasswordException=function PasswordExceptionClosure(){function PasswordException(msg,code){this.name="PasswordException";this.message=msg;this.code=code}PasswordException.prototype=new Error;PasswordException.constructor=PasswordException;return PasswordException}();PDFJS.PasswordException=PasswordException;var UnknownErrorException=function UnknownErrorExceptionClosure(){function UnknownErrorException(msg,details){this.name="UnknownErrorException";this.message=msg;this.details=details}UnknownErrorException.prototype=new Error;UnknownErrorException.constructor=UnknownErrorException;return UnknownErrorException}();PDFJS.UnknownErrorException=UnknownErrorException;var InvalidPDFException=function InvalidPDFExceptionClosure(){function InvalidPDFException(msg){this.name="InvalidPDFException";this.message=msg}InvalidPDFException.prototype=new Error;InvalidPDFException.constructor=InvalidPDFException;return InvalidPDFException}();PDFJS.InvalidPDFException=InvalidPDFException;var MissingPDFException=function MissingPDFExceptionClosure(){function MissingPDFException(msg){this.name="MissingPDFException";this.message=msg}MissingPDFException.prototype=new Error;MissingPDFException.constructor=MissingPDFException;return MissingPDFException}();PDFJS.MissingPDFException=MissingPDFException;var UnexpectedResponseException=function UnexpectedResponseExceptionClosure(){function UnexpectedResponseException(msg,status){this.name="UnexpectedResponseException";this.message=msg;this.status=status}UnexpectedResponseException.prototype=new Error;UnexpectedResponseException.constructor=UnexpectedResponseException;return UnexpectedResponseException}();PDFJS.UnexpectedResponseException=UnexpectedResponseException;var NotImplementedException=function NotImplementedExceptionClosure(){function NotImplementedException(msg){this.message=msg}NotImplementedException.prototype=new Error;NotImplementedException.prototype.name="NotImplementedException";NotImplementedException.constructor=NotImplementedException;return NotImplementedException}();var MissingDataException=function MissingDataExceptionClosure(){function MissingDataException(begin,end){this.begin=begin;this.end=end;this.message="Missing data ["+begin+", "+end+")"}MissingDataException.prototype=new Error;MissingDataException.prototype.name="MissingDataException";MissingDataException.constructor=MissingDataException;return MissingDataException}();var XRefParseException=function XRefParseExceptionClosure(){function XRefParseException(msg){this.message=msg}XRefParseException.prototype=new Error;XRefParseException.prototype.name="XRefParseException";XRefParseException.constructor=XRefParseException;return XRefParseException}();var NullCharactersRegExp=/\x00/g;function removeNullCharacters(str){if(typeof str!=="string"){warn("The argument for removeNullCharacters must be a string.");return str}return str.replace(NullCharactersRegExp,"")}PDFJS.removeNullCharacters=removeNullCharacters;function bytesToString(bytes){assert(bytes!==null&&typeof bytes==="object"&&bytes.length!==undefined,"Invalid argument for bytesToString");var length=bytes.length;var MAX_ARGUMENT_COUNT=8192;if(length>24&255,value>>16&255,value>>8&255,value&255)}function log2(x){var n=1,i=0;while(x>n){n<<=1;i++}return i}function readInt8(data,start){return data[start]<<24>>24}function readUint16(data,offset){return data[offset]<<8|data[offset+1]}function readUint32(data,offset){return(data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3])>>>0}function isLittleEndian(){var buffer8=new Uint8Array(2);buffer8[0]=1;var buffer16=new Uint16Array(buffer8.buffer);return buffer16[0]===1}Object.defineProperty(PDFJS,"isLittleEndian",{configurable:true,get:function PDFJS_isLittleEndian(){return shadow(PDFJS,"isLittleEndian",isLittleEndian())}});function hasCanvasTypedArrays(){var canvas=document.createElement("canvas");canvas.width=canvas.height=1;var ctx=canvas.getContext("2d");var imageData=ctx.createImageData(1,1);return typeof imageData.data.buffer!=="undefined"}Object.defineProperty(PDFJS,"hasCanvasTypedArrays",{configurable:true,get:function PDFJS_hasCanvasTypedArrays(){return shadow(PDFJS,"hasCanvasTypedArrays",hasCanvasTypedArrays())}});var Uint32ArrayView=function Uint32ArrayViewClosure(){function Uint32ArrayView(buffer,length){this.buffer=buffer;this.byteLength=buffer.length;this.length=length===undefined?this.byteLength>>2:length;ensureUint32ArrayViewProps(this.length)}Uint32ArrayView.prototype=Object.create(null);var uint32ArrayViewSetters=0;function createUint32ArrayProp(index){return{get:function(){var buffer=this.buffer,offset=index<<2;return(buffer[offset]|buffer[offset+1]<<8|buffer[offset+2]<<16|buffer[offset+3]<<24)>>>0},set:function(value){var buffer=this.buffer,offset=index<<2;buffer[offset]=value&255;buffer[offset+1]=value>>8&255;buffer[offset+2]=value>>16&255;buffer[offset+3]=value>>>24&255}}}function ensureUint32ArrayViewProps(length){while(uint32ArrayViewSettersrect[2]){r[0]=rect[2];r[2]=rect[0]}if(rect[1]>rect[3]){r[1]=rect[3];r[3]=rect[1]}return r};Util.intersect=function Util_intersect(rect1,rect2){function compare(a,b){return a-b}var orderedX=[rect1[0],rect1[2],rect2[0],rect2[2]].sort(compare),orderedY=[rect1[1],rect1[3],rect2[1],rect2[3]].sort(compare),result=[];rect1=Util.normalizeRect(rect1);rect2=Util.normalizeRect(rect2);if(orderedX[0]===rect1[0]&&orderedX[1]===rect2[0]||orderedX[0]===rect2[0]&&orderedX[1]===rect1[0]){result[0]=orderedX[1];result[2]=orderedX[2]}else{return false}if(orderedY[0]===rect1[1]&&orderedY[1]===rect2[1]||orderedY[0]===rect2[1]&&orderedY[1]===rect1[1]){result[1]=orderedY[1];result[3]=orderedY[2]}else{return false}return result};Util.sign=function Util_sign(num){return num<0?-1:1};var ROMAN_NUMBER_MAP=["","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"];Util.toRoman=function Util_toRoman(number,lowerCase){assert(isInt(number)&&number>0,"The number should be a positive integer.");var pos,romanBuf=[];while(number>=1e3){number-=1e3;romanBuf.push("M")}pos=number/100|0;number%=100;romanBuf.push(ROMAN_NUMBER_MAP[pos]);pos=number/10|0;number%=10;romanBuf.push(ROMAN_NUMBER_MAP[10+pos]);romanBuf.push(ROMAN_NUMBER_MAP[20+number]);var romanStr=romanBuf.join("");return lowerCase?romanStr.toLowerCase():romanStr};Util.appendToArray=function Util_appendToArray(arr1,arr2){Array.prototype.push.apply(arr1,arr2)};Util.prependToArray=function Util_prependToArray(arr1,arr2){Array.prototype.unshift.apply(arr1,arr2)};Util.extendObj=function extendObj(obj1,obj2){for(var key in obj2){obj1[key]=obj2[key]}};Util.getInheritableProperty=function Util_getInheritableProperty(dict,name){while(dict&&!dict.has(name)){dict=dict.get("Parent")}if(!dict){return null}return dict.get(name)};Util.inherit=function Util_inherit(sub,base,prototype){sub.prototype=Object.create(base.prototype);sub.prototype.constructor=sub;for(var prop in prototype){sub.prototype[prop]=prototype[prop]}};Util.loadScript=function Util_loadScript(src,callback){var script=document.createElement("script");var loaded=false;script.setAttribute("src",src);if(callback){script.onload=function(){if(!loaded){callback()}loaded=true}}document.getElementsByTagName("head")[0].appendChild(script)};return Util}();var PageViewport=PDFJS.PageViewport=function PageViewportClosure(){function PageViewport(viewBox,scale,rotation,offsetX,offsetY,dontFlip){this.viewBox=viewBox;this.scale=scale;this.rotation=rotation;this.offsetX=offsetX;this.offsetY=offsetY;var centerX=(viewBox[2]+viewBox[0])/2;var centerY=(viewBox[3]+viewBox[1])/2;var rotateA,rotateB,rotateC,rotateD;rotation=rotation%360;rotation=rotation<0?rotation+360:rotation;switch(rotation){case 180:rotateA=-1;rotateB=0;rotateC=0;rotateD=1;break;case 90:rotateA=0;rotateB=1;rotateC=1;rotateD=0;break;case 270:rotateA=0;rotateB=-1;rotateC=-1;rotateD=0;break;default:rotateA=1;rotateB=0;rotateC=0;rotateD=-1;break}if(dontFlip){rotateC=-rotateC;rotateD=-rotateD}var offsetCanvasX,offsetCanvasY;var width,height;if(rotateA===0){offsetCanvasX=Math.abs(centerY-viewBox[1])*scale+offsetX;offsetCanvasY=Math.abs(centerX-viewBox[0])*scale+offsetY;width=Math.abs(viewBox[3]-viewBox[1])*scale;height=Math.abs(viewBox[2]-viewBox[0])*scale}else{offsetCanvasX=Math.abs(centerX-viewBox[0])*scale+offsetX;offsetCanvasY=Math.abs(centerY-viewBox[1])*scale+offsetY;width=Math.abs(viewBox[2]-viewBox[0])*scale;height=Math.abs(viewBox[3]-viewBox[1])*scale}this.transform=[rotateA*scale,rotateB*scale,rotateC*scale,rotateD*scale,offsetCanvasX-rotateA*scale*centerX-rotateC*scale*centerY,offsetCanvasY-rotateB*scale*centerX-rotateD*scale*centerY];this.width=width;this.height=height;this.fontScale=scale}PageViewport.prototype={clone:function PageViewPort_clone(args){args=args||{};var scale="scale"in args?args.scale:this.scale;var rotation="rotation"in args?args.rotation:this.rotation;return new PageViewport(this.viewBox.slice(),scale,rotation,this.offsetX,this.offsetY,args.dontFlip)},convertToViewportPoint:function PageViewport_convertToViewportPoint(x,y){return Util.applyTransform([x,y],this.transform)},convertToViewportRectangle:function PageViewport_convertToViewportRectangle(rect){var tl=Util.applyTransform([rect[0],rect[1]],this.transform);var br=Util.applyTransform([rect[2],rect[3]],this.transform);return[tl[0],tl[1],br[0],br[1]]},convertToPdfPoint:function PageViewport_convertToPdfPoint(x,y){return Util.applyInverseTransform([x,y],this.transform)}};return PageViewport}();var PDFStringTranslateTable=[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 stringToPDFString(str){var i,n=str.length,strBuf=[];if(str[0]==="þ"&&str[1]==="ÿ"){for(i=2;i0){var handler=this.handlers.shift();var nextStatus=handler.thisPromise._status;var nextValue=handler.thisPromise._value;try{if(nextStatus===STATUS_RESOLVED){if(typeof handler.onResolve==="function"){nextValue=handler.onResolve(nextValue)}}else if(typeof handler.onReject==="function"){nextValue=handler.onReject(nextValue);nextStatus=STATUS_RESOLVED;if(handler.thisPromise._unhandledRejection){this.removeUnhandeledRejection(handler.thisPromise)}}}catch(ex){nextStatus=STATUS_REJECTED;nextValue=ex}handler.nextPromise._updateStatus(nextStatus,nextValue);if(Date.now()>=timeoutAt){break}}if(this.handlers.length>0){setTimeout(this.runHandlers.bind(this),0);return}this.running=false},addUnhandledRejection:function addUnhandledRejection(promise){this.unhandledRejections.push({promise:promise,time:Date.now()});this.scheduleRejectionCheck()},removeUnhandeledRejection:function removeUnhandeledRejection(promise){promise._unhandledRejection=false;for(var i=0;iREJECTION_TIMEOUT){var unhandled=this.unhandledRejections[i].promise._value;var msg="Unhandled rejection: "+unhandled;if(unhandled.stack){msg+="\n"+unhandled.stack}warn(msg);this.unhandledRejections.splice(i);i--}}if(this.unhandledRejections.length){this.scheduleRejectionCheck()}}.bind(this),REJECTION_TIMEOUT)}};function Promise(resolver){this._status=STATUS_PENDING;this._handlers=[];try{resolver.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(e){this._reject(e)}}Promise.all=function Promise_all(promises){var resolveAll,rejectAll;var deferred=new Promise(function(resolve,reject){resolveAll=resolve;rejectAll=reject});var unresolved=promises.length;var results=[];if(unresolved===0){resolveAll(results);return deferred}function reject(reason){if(deferred._status===STATUS_REJECTED){return}results=[];rejectAll(reason)}for(var i=0,ii=promises.length;ilongest){longest=name.length}}for(i=0,ii=times.length;i>2,d2=(b1&3)<<4|b2>>4;var d3=i+1>6:64;var d4=i+232&&unicode<127&&[34,35,60,62,63,96].indexOf(unicode)==-1){return c}return encodeURIComponent(c)}function percentEscapeQuery(c){var unicode=c.charCodeAt(0);if(unicode>32&&unicode<127&&[34,35,60,62,96].indexOf(unicode)==-1){return c}return encodeURIComponent(c)}var EOF=undefined,ALPHA=/[a-zA-Z]/,ALPHANUMERIC=/[a-zA-Z0-9\+\-\.]/;function parse(input,stateOverride,base){function err(message){errors.push(message)}var state=stateOverride||"scheme start",cursor=0,buffer="",seenAt=false,seenBracket=false,errors=[];loop:while((input[cursor-1]!=EOF||cursor==0)&&!this._isInvalid){var c=input[cursor];switch(state){case"scheme start":if(c&&ALPHA.test(c)){buffer+=c.toLowerCase();state="scheme"}else if(!stateOverride){buffer="";state="no scheme";continue}else{err("Invalid scheme.");break loop}break;case"scheme":if(c&&ALPHANUMERIC.test(c)){buffer+=c.toLowerCase()}else if(":"==c){this._scheme=buffer;buffer="";if(stateOverride){break loop}if(isRelativeScheme(this._scheme)){this._isRelative=true}if("file"==this._scheme){state="relative"}else if(this._isRelative&&base&&base._scheme==this._scheme){state="relative or authority"}else if(this._isRelative){state="authority first slash"}else{state="scheme data"}}else if(!stateOverride){buffer="";cursor=0;state="no scheme";continue}else if(EOF==c){break loop}else{err("Code point not allowed in scheme: "+c);break loop}break;case"scheme data":if("?"==c){this._query="?";state="query"}else if("#"==c){this._fragment="#";state="fragment"}else{if(EOF!=c&&" "!=c&&"\n"!=c&&"\r"!=c){this._schemeData+=percentEscape(c)}}break;case"no scheme":if(!base||!isRelativeScheme(base._scheme)){err("Missing scheme.");invalid.call(this)}else{state="relative";continue}break;case"relative or authority":if("/"==c&&"/"==input[cursor+1]){state="authority ignore slashes"}else{err("Expected /, got: "+c);state="relative";continue}break;case"relative":this._isRelative=true;if("file"!=this._scheme)this._scheme=base._scheme;if(EOF==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query=base._query;this._username=base._username;this._password=base._password;break loop}else if("/"==c||"\\"==c){if("\\"==c)err("\\ is an invalid code point.");state="relative slash"}else if("?"==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query="?";this._username=base._username;this._password=base._password;state="query"}else if("#"==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query=base._query;this._fragment="#";this._username=base._username;this._password=base._password;state="fragment"}else{var nextC=input[cursor+1];var nextNextC=input[cursor+2];if("file"!=this._scheme||!ALPHA.test(c)||nextC!=":"&&nextC!="|"||EOF!=nextNextC&&"/"!=nextNextC&&"\\"!=nextNextC&&"?"!=nextNextC&&"#"!=nextNextC){this._host=base._host;this._port=base._port;this._username=base._username;this._password=base._password;this._path=base._path.slice();this._path.pop()}state="relative path";continue}break;case"relative slash":if("/"==c||"\\"==c){if("\\"==c){err("\\ is an invalid code point.")}if("file"==this._scheme){state="file host"}else{state="authority ignore slashes"}}else{if("file"!=this._scheme){this._host=base._host;this._port=base._port;this._username=base._username;this._password=base._password}state="relative path";continue}break;case"authority first slash":if("/"==c){state="authority second slash"}else{err("Expected '/', got: "+c);state="authority ignore slashes";continue}break;case"authority second slash":state="authority ignore slashes";if("/"!=c){err("Expected '/', got: "+c);continue}break;case"authority ignore slashes":if("/"!=c&&"\\"!=c){state="authority";continue}else{err("Expected authority, got: "+c)}break;case"authority":if("@"==c){if(seenAt){err("@ already seen.");buffer+="%40"}seenAt=true;for(var i=0;i0){container.style.borderWidth=data.borderStyle.width+"px";if(data.borderStyle.style!==AnnotationBorderStyleType.UNDERLINE){width=width-2*data.borderStyle.width;height=height-2*data.borderStyle.width}var horizontalRadius=data.borderStyle.horizontalCornerRadius;var verticalRadius=data.borderStyle.verticalCornerRadius;if(horizontalRadius>0||verticalRadius>0){var radius=horizontalRadius+"px / "+verticalRadius+"px";CustomStyle.setProp("borderRadius",container,radius)}switch(data.borderStyle.style){case AnnotationBorderStyleType.SOLID:container.style.borderStyle="solid";break;case AnnotationBorderStyleType.DASHED:container.style.borderStyle="dashed";break;case AnnotationBorderStyleType.BEVELED:warn("Unimplemented border style: beveled");break;case AnnotationBorderStyleType.INSET:warn("Unimplemented border style: inset");break;case AnnotationBorderStyleType.UNDERLINE:container.style.borderBottomStyle="solid";break;default:break}if(data.color){container.style.borderColor=Util.makeCssRgb(data.color[0]|0,data.color[1]|0,data.color[2]|0)}else{container.style.borderWidth=0}}container.style.left=rect[0]+"px";container.style.top=rect[1]+"px";container.style.width=width+"px";container.style.height=height+"px";return container},render:function AnnotationElement_render(){throw new Error("Abstract method AnnotationElement.render called")}};return AnnotationElement}();var LinkAnnotationElement=function LinkAnnotationElementClosure(){function LinkAnnotationElement(parameters){AnnotationElement.call(this,parameters,true)}Util.inherit(LinkAnnotationElement,AnnotationElement,{render:function LinkAnnotationElement_render(){this.container.className="linkAnnotation";var link=document.createElement("a");addLinkAttributes(link,{url:this.data.url});if(!this.data.url){if(this.data.action){this._bindNamedAction(link,this.data.action)}else{this._bindLink(link,"dest"in this.data?this.data.dest:null)}}this.container.appendChild(link);return this.container},_bindLink:function LinkAnnotationElement_bindLink(link,destination){var self=this;link.href=this.linkService.getDestinationHash(destination);link.onclick=function(){if(destination){self.linkService.navigateTo(destination)}return false};if(destination){link.className="internalLink"}},_bindNamedAction:function LinkAnnotationElement_bindNamedAction(link,action){var self=this;link.href=this.linkService.getAnchorUrl("");link.onclick=function(){self.linkService.executeNamedAction(action);return false};link.className="internalLink"}});return LinkAnnotationElement}();var TextAnnotationElement=function TextAnnotationElementClosure(){function TextAnnotationElement(parameters){var isRenderable=!!(parameters.data.hasPopup||parameters.data.title||parameters.data.contents);AnnotationElement.call(this,parameters,isRenderable)}Util.inherit(TextAnnotationElement,AnnotationElement,{render:function TextAnnotationElement_render(){this.container.className="textAnnotation";var image=document.createElement("img");image.style.height=this.container.style.height;image.style.width=this.container.style.width;image.src=PDFJS.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";image.alt="[{{type}} Annotation]";image.dataset.l10nId="text_annotation_type";image.dataset.l10nArgs=JSON.stringify({type:this.data.name});if(!this.data.hasPopup){var popupElement=new PopupElement({container:this.container,trigger:image,color:this.data.color,title:this.data.title,contents:this.data.contents,hideWrapper:true});var popup=popupElement.render();popup.style.left=image.style.width;this.container.appendChild(popup)}this.container.appendChild(image);return this.container}});return TextAnnotationElement}();var WidgetAnnotationElement=function WidgetAnnotationElementClosure(){function WidgetAnnotationElement(parameters){var isRenderable=!parameters.data.hasAppearance&&!!parameters.data.fieldValue;AnnotationElement.call(this,parameters,isRenderable)}Util.inherit(WidgetAnnotationElement,AnnotationElement,{render:function WidgetAnnotationElement_render(){var content=document.createElement("div");content.textContent=this.data.fieldValue;var textAlignment=this.data.textAlignment;content.style.textAlign=["left","center","right"][textAlignment];content.style.verticalAlign="middle";content.style.display="table-cell";var font=this.data.fontRefName?this.page.commonObjs.getData(this.data.fontRefName):null;this._setTextStyle(content,font);this.container.appendChild(content);return this.container},_setTextStyle:function WidgetAnnotationElement_setTextStyle(element,font){var style=element.style;style.fontSize=this.data.fontSize+"px";style.direction=this.data.fontDirection<0?"rtl":"ltr";if(!font){return}style.fontWeight=font.black?font.bold?"900":"bold":font.bold?"bold":"normal";style.fontStyle=font.italic?"italic":"normal";var fontFamily=font.loadedName?'"'+font.loadedName+'", ':"";var fallbackName=font.fallbackName||"Helvetica, sans-serif";style.fontFamily=fontFamily+fallbackName}});return WidgetAnnotationElement}();var PopupAnnotationElement=function PopupAnnotationElementClosure(){function PopupAnnotationElement(parameters){var isRenderable=!!(parameters.data.title||parameters.data.contents);AnnotationElement.call(this,parameters,isRenderable)}Util.inherit(PopupAnnotationElement,AnnotationElement,{render:function PopupAnnotationElement_render(){this.container.className="popupAnnotation";var selector='[data-annotation-id="'+this.data.parentId+'"]';var parentElement=this.layer.querySelector(selector);if(!parentElement){return this.container}var popup=new PopupElement({container:this.container,trigger:parentElement,color:this.data.color,title:this.data.title,contents:this.data.contents});var parentLeft=parseFloat(parentElement.style.left);var parentWidth=parseFloat(parentElement.style.width);CustomStyle.setProp("transformOrigin",this.container,-(parentLeft+parentWidth)+"px -"+parentElement.style.top);this.container.style.left=parentLeft+parentWidth+"px";this.container.appendChild(popup.render());return this.container}});return PopupAnnotationElement}();var PopupElement=function PopupElementClosure(){var BACKGROUND_ENLIGHT=.7;function PopupElement(parameters){this.container=parameters.container;this.trigger=parameters.trigger;this.color=parameters.color;this.title=parameters.title;this.contents=parameters.contents;this.hideWrapper=parameters.hideWrapper||false;this.pinned=false}PopupElement.prototype={render:function PopupElement_render(){var wrapper=document.createElement("div");wrapper.className="popupWrapper";this.hideElement=this.hideWrapper?wrapper:this.container;this.hideElement.setAttribute("hidden",true);var popup=document.createElement("div");popup.className="popup";var color=this.color;if(color){var r=BACKGROUND_ENLIGHT*(255-color[0])+color[0];var g=BACKGROUND_ENLIGHT*(255-color[1])+color[1];var b=BACKGROUND_ENLIGHT*(255-color[2])+color[2];popup.style.backgroundColor=Util.makeCssRgb(r|0,g|0,b|0)}var contents=this._formatContents(this.contents);var title=document.createElement("h1");title.textContent=this.title;this.trigger.addEventListener("click",this._toggle.bind(this));this.trigger.addEventListener("mouseover",this._show.bind(this,false));this.trigger.addEventListener("mouseout",this._hide.bind(this,false));popup.addEventListener("click",this._hide.bind(this,true));popup.appendChild(title);popup.appendChild(contents);wrapper.appendChild(popup);return wrapper},_formatContents:function PopupElement_formatContents(contents){var p=document.createElement("p");var lines=contents.split(/(?:\r\n?|\n)/);for(var i=0,ii=lines.length;i0&&!FontLoader.isSyncFontLoadingSupported){this.prepareFontLoadEvent(rules,fontsToLoad,request)}else{request.complete()}},queueLoadingCallback:function FontLoader_queueLoadingCallback(callback){function LoadLoader_completeRequest(){assert(!request.end,"completeRequest() cannot be called twice");request.end=Date.now();while(context.requests.length>0&&context.requests[0].end){var otherRequest=context.requests.shift();setTimeout(otherRequest.callback,0)}}var context=this.loadingContext;var requestId="pdfjs-font-loading-"+context.nextRequestId++;var request={id:requestId,complete:LoadLoader_completeRequest,callback:callback,started:Date.now()};context.requests.push(request);return request},prepareFontLoadEvent:function fontLoaderPrepareFontLoadEvent(rules,fonts,request){function int32(data,offset){return data.charCodeAt(offset)<<24|data.charCodeAt(offset+1)<<16|data.charCodeAt(offset+2)<<8|data.charCodeAt(offset+3)&255}function spliceString(s,offset,remove,insert){var chunk1=s.substr(0,offset);var chunk2=s.substr(offset+remove);return chunk1+insert+chunk2}var i,ii;var canvas=document.createElement("canvas");canvas.width=1;canvas.height=1;var ctx=canvas.getContext("2d");var called=0;function isFontReady(name,callback){called++;if(called>30){warn("Load test font never loaded.");callback();return}ctx.font="30px "+name;ctx.fillText(".",0,20);var imageData=ctx.getImageData(0,0,1,1);if(imageData.data[3]>0){callback();return}setTimeout(isFontReady.bind(null,name,callback))}var loadTestFontId="lt"+Date.now()+this.loadTestFontId++;var data=this.loadTestFont;var COMMENT_OFFSET=976;data=spliceString(data,COMMENT_OFFSET,loadTestFontId.length,loadTestFontId);var CFF_CHECKSUM_OFFSET=16;var XXXX_VALUE=1482184792;var checksum=int32(data,CFF_CHECKSUM_OFFSET);for(i=0,ii=loadTestFontId.length-3;i=14){supported=true; +}if(userAgent==="node"){supported=true}return shadow(FontLoader,"isSyncFontLoadingSupported",supported)},enumerable:true,configurable:true});var FontFaceObject=function FontFaceObjectClosure(){function FontFaceObject(translatedData){this.compiledGlyphs=Object.create(null);for(var i in translatedData){this[i]=translatedData[i]}}Object.defineProperty(FontFaceObject,"isEvalSupported",{get:function(){var evalSupport=false;if(PDFJS.isEvalSupported){try{new Function("");evalSupport=true}catch(e){}}return shadow(this,"isEvalSupported",evalSupport)},enumerable:true,configurable:true});FontFaceObject.prototype={createNativeFontFace:function FontFaceObject_createNativeFontFace(){if(!this.data){return null}if(PDFJS.disableFontFace){this.disableFontFace=true;return null}var nativeFontFace=new FontFace(this.loadedName,this.data,{});if(PDFJS.pdfBug&&"FontInspector"in globalScope&&globalScope["FontInspector"].enabled){globalScope["FontInspector"].fontAdded(this)}return nativeFontFace},createFontFaceRule:function FontFaceObject_createFontFaceRule(){if(!this.data){return null}if(PDFJS.disableFontFace){this.disableFontFace=true;return null}var data=bytesToString(new Uint8Array(this.data));var fontName=this.loadedName;var url="url(data:"+this.mimetype+";base64,"+window.btoa(data)+");";var rule='@font-face { font-family:"'+fontName+'";src:'+url+"}";if(PDFJS.pdfBug&&"FontInspector"in globalScope&&globalScope["FontInspector"].enabled){globalScope["FontInspector"].fontAdded(this,url)}return rule},getPathGenerator:function FontFaceObject_getPathGenerator(objs,character){if(!(character in this.compiledGlyphs)){var cmds=objs.get(this.loadedName+"_path_"+character);var current,i,len;if(FontFaceObject.isEvalSupported){var args,js="";for(i=0,len=cmds.length;i\\376\\377([^<]+)/g,function(all,codes){var bytes=codes.replace(/\\([0-3])([0-7])([0-7])/g,function(code,d1,d2,d3){return String.fromCharCode(d1*64+d2*8+d3*1)});var chars="";for(var i=0;i=32&&code<127&&code!==60&&code!==62&&code!==38&&false?String.fromCharCode(code):"&#x"+(65536+code).toString(16).substring(1)+";"}return">"+chars})}function Metadata(meta){if(typeof meta==="string"){meta=fixMetadata(meta);var parser=new DOMParser;meta=parser.parseFromString(meta,"application/xml")}else if(!(meta instanceof Document)){error("Metadata: Invalid metadata object")}this.metaDocument=meta;this.metadata=Object.create(null);this.parse()}Metadata.prototype={parse:function Metadata_parse(){var doc=this.metaDocument;var rdf=doc.documentElement;if(rdf.nodeName.toLowerCase()!=="rdf:rdf"){rdf=rdf.firstChild;while(rdf&&rdf.nodeName.toLowerCase()!=="rdf:rdf"){rdf=rdf.nextSibling}}var nodeName=rdf?rdf.nodeName.toLowerCase():null;if(!rdf||nodeName!=="rdf:rdf"||!rdf.hasChildNodes()){return}var children=rdf.childNodes,desc,entry,name,i,ii,length,iLength;for(i=0,length=children.length;i>1&2147483647}else{c=c>>1&2147483647}}crcTable[i]=c}function crc32(data,start,end){var crc=-1;for(var i=start;i>>8^b}return crc^-1}function writePngChunk(type,body,data,offset){var p=offset;var len=body.length;data[p]=len>>24&255;data[p+1]=len>>16&255;data[p+2]=len>>8&255;data[p+3]=len&255;p+=4;data[p]=type.charCodeAt(0)&255;data[p+1]=type.charCodeAt(1)&255;data[p+2]=type.charCodeAt(2)&255;data[p+3]=type.charCodeAt(3)&255;p+=4;data.set(body,p);p+=body.length;var crc=crc32(data,offset+4,p);data[p]=crc>>24&255;data[p+1]=crc>>16&255;data[p+2]=crc>>8&255;data[p+3]=crc&255}function adler32(data,start,end){var a=1;var b=0;for(var i=start;i>3;break;case ImageKind.RGB_24BPP:colorType=2;bitDepth=8;lineSize=width*3;break;case ImageKind.RGBA_32BPP:colorType=6;bitDepth=8;lineSize=width*4;break;default:throw new Error("invalid format")}var literals=new Uint8Array((1+lineSize)*height);var offsetLiterals=0,offsetBytes=0;var y,i;for(y=0;y>24&255,width>>16&255,width>>8&255,width&255,height>>24&255,height>>16&255,height>>8&255,height&255,bitDepth,colorType,0,0,0]);var len=literals.length;var maxBlockLength=65535;var deflateBlocks=Math.ceil(len/maxBlockLength);var idat=new Uint8Array(2+len+deflateBlocks*5+4);var pi=0;idat[pi++]=120;idat[pi++]=156;var pos=0;while(len>maxBlockLength){idat[pi++]=0;idat[pi++]=255;idat[pi++]=255;idat[pi++]=0;idat[pi++]=0;idat.set(literals.subarray(pos,pos+maxBlockLength),pi);pi+=maxBlockLength;pos+=maxBlockLength;len-=maxBlockLength}idat[pi++]=1;idat[pi++]=len&255;idat[pi++]=len>>8&255;idat[pi++]=~len&65535&255;idat[pi++]=(~len&65535)>>8&255;idat.set(literals.subarray(pos),pi);pi+=literals.length-pos;var adler=adler32(literals,0,literals.length);idat[pi++]=adler>>24&255;idat[pi++]=adler>>16&255;idat[pi++]=adler>>8&255;idat[pi++]=adler&255;var pngLength=PNG_HEADER.length+CHUNK_WRAPPER_SIZE*3+ihdr.length+idat.length;var data=new Uint8Array(pngLength);var offset=0;data.set(PNG_HEADER,offset);offset+=PNG_HEADER.length;writePngChunk("IHDR",ihdr,data,offset);offset+=CHUNK_WRAPPER_SIZE+ihdr.length;writePngChunk("IDATA",idat,data,offset);offset+=CHUNK_WRAPPER_SIZE+idat.length;writePngChunk("IEND",new Uint8Array(0),data,offset);return PDFJS.createObjectURL(data,"image/png")}return function convertImgDataToPng(imgData){var kind=imgData.kind===undefined?ImageKind.GRAYSCALE_1BPP:imgData.kind;return encode(imgData,kind)}}();var SVGExtraState=function SVGExtraStateClosure(){function SVGExtraState(){this.fontSizeScale=1;this.fontWeight=SVG_DEFAULTS.fontWeight;this.fontSize=0;this.textMatrix=IDENTITY_MATRIX;this.fontMatrix=FONT_IDENTITY_MATRIX;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=SVG_DEFAULTS.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.clipId="";this.pendingClip=false;this.maskId=""}SVGExtraState.prototype={clone:function SVGExtraState_clone(){return Object.create(this)},setCurrentPoint:function SVGExtraState_setCurrentPoint(x,y){this.x=x;this.y=y}};return SVGExtraState}();var SVGGraphics=function SVGGraphicsClosure(){function createScratchSVG(width,height){var NS="http://www.w3.org/2000/svg";var svg=document.createElementNS(NS,"svg:svg");svg.setAttributeNS(null,"version","1.1");svg.setAttributeNS(null,"width",width+"px");svg.setAttributeNS(null,"height",height+"px");svg.setAttributeNS(null,"viewBox","0 0 "+width+" "+height);return svg}function opListToTree(opList){var opTree=[];var tmp=[];var opListLen=opList.length;for(var x=0;x1){if(style.vertical){textDiv.dataset.canvasWidth=geom.height*viewport.scale}else{textDiv.dataset.canvasWidth=geom.width*viewport.scale}}}function render(task){if(task._canceled){return}var textLayerFrag=task._container;var textDivs=task._textDivs;var capability=task._capability;var textDivsLength=textDivs.length;if(textDivsLength>MAX_TEXT_DIVS_TO_RENDER){capability.resolve();return}var canvas=document.createElement("canvas");canvas.mozOpaque=true;var ctx=canvas.getContext("2d",{alpha:false});var lastFontSize; +var lastFontFamily;for(var i=0;i0){textLayerFrag.appendChild(textDiv);var transform;if(textDiv.dataset.canvasWidth!==undefined){var textScale=textDiv.dataset.canvasWidth/width;transform="scaleX("+textScale+")"}else{transform=""}var rotation=textDiv.dataset.angle;if(rotation){transform="rotate("+rotation+"deg) "+transform}if(transform){CustomStyle.setProp("transform",textDiv,transform)}}}capability.resolve()}function TextLayerRenderTask(textContent,container,viewport,textDivs){this._textContent=textContent;this._container=container;this._viewport=viewport;textDivs=textDivs||[];this._textDivs=textDivs;this._canceled=false;this._capability=createPromiseCapability();this._renderTimer=null}TextLayerRenderTask.prototype={get promise(){return this._capability.promise},cancel:function TextLayer_cancel(){this._canceled=true;if(this._renderTimer!==null){clearTimeout(this._renderTimer);this._renderTimer=null}this._capability.reject("canceled")},_render:function TextLayer_render(timeout){var textItems=this._textContent.items;var styles=this._textContent.styles;var textDivs=this._textDivs;var viewport=this._viewport;for(var i=0,len=textItems.length;icoords[p2+1]){tmp=p1;p1=p2;p2=tmp;tmp=c1;c1=c2;c2=tmp}if(coords[p2+1]>coords[p3+1]){tmp=p2;p2=p3;p3=tmp;tmp=c2;c2=c3;c3=tmp}if(coords[p1+1]>coords[p2+1]){tmp=p1;p1=p2;p2=tmp;tmp=c1;c1=c2;c2=tmp}var x1=(coords[p1]+context.offsetX)*context.scaleX;var y1=(coords[p1+1]+context.offsetY)*context.scaleY;var x2=(coords[p2]+context.offsetX)*context.scaleX;var y2=(coords[p2+1]+context.offsetY)*context.scaleY;var x3=(coords[p3]+context.offsetX)*context.scaleX;var y3=(coords[p3+1]+context.offsetY)*context.scaleY;if(y1>=y3){return}var c1r=colors[c1],c1g=colors[c1+1],c1b=colors[c1+2];var c2r=colors[c2],c2g=colors[c2+1],c2b=colors[c2+2];var c3r=colors[c3],c3g=colors[c3+1],c3b=colors[c3+2];var minY=Math.round(y1),maxY=Math.round(y3);var xa,car,cag,cab;var xb,cbr,cbg,cbb;var k;for(var y=minY;y<=maxY;y++){if(yy3?1:y2===y3?0:(y2-y)/(y2-y3);xa=x2-(x2-x3)*k;car=c2r-(c2r-c3r)*k;cag=c2g-(c2g-c3g)*k;cab=c2b-(c2b-c3b)*k}k=yy3?1:(y1-y)/(y1-y3);xb=x1-(x1-x3)*k;cbr=c1r-(c1r-c3r)*k;cbg=c1g-(c1g-c3g)*k;cbb=c1b-(c1b-c3b)*k;var x1_=Math.round(Math.min(xa,xb));var x2_=Math.round(Math.max(xa,xb));var j=rowSize*y+x1_*4;for(var x=x1_;x<=x2_;x++){k=(xa-x)/(xa-xb);k=k<0?0:k>1?1:k;bytes[j++]=car-(car-cbr)*k|0;bytes[j++]=cag-(cag-cbg)*k|0;bytes[j++]=cab-(cab-cbb)*k|0;bytes[j++]=255}}}function drawFigure(data,figure,context){var ps=figure.coords;var cs=figure.colors;var i,ii;switch(figure.type){case"lattice":var verticesPerRow=figure.verticesPerRow;var rows=Math.floor(ps.length/verticesPerRow)-1;var cols=verticesPerRow-1;for(i=0;i0){data[pos++]=elem&mask?0:255;mask>>=1}}var count=0;pos=0;if(data[pos]!==0){points[0]=1;++count}for(j=1;j>2)+(data[pos+1]?4:0)+(data[pos-lineSize+1]?8:0);if(POINT_TYPES[sum]){points[j0+j]=POINT_TYPES[sum];++count}pos++}if(data[pos-lineSize]!==data[pos]){points[j0+j]=data[pos]?2:4;++count}if(count>POINT_TO_PROCESS_LIMIT){return null}}pos=lineSize*(height-1);j0=i*width1;if(data[pos]!==0){points[j0]=8;++count}for(j=1;jPOINT_TO_PROCESS_LIMIT){return null}var steps=new Int32Array([0,width1,-1,0,-width1,0,0,0,1]);var outlines=[];for(i=0;count&&i<=height;i++){var p=i*width1;var end=p+width;while(p>4;points[p]&=type>>2|type<<2}coords.push(p%width1);coords.push(p/width1|0);--count}while(p0!==p);outlines.push(coords);--i}var drawOutline=function(c){c.save();c.scale(1/width,-1/height);c.translate(0,-height);c.beginPath();for(var i=0,ii=outlines.length;i>3;var white=4294967295;var black=PDFJS.isLittleEndian||!PDFJS.hasCanvasTypedArrays?4278190080:255;for(i=0;ifullSrcDiff?width:srcDiff*8-7;var kEndUnrolled=kEnd&~7;var mask=0;var srcByte=0;for(;k>=1}}while(destPos=fullChunks){thisChunkHeight=partialChunkHeight;elemsInThisChunk=width*thisChunkHeight}destPos=0;for(j=elemsInThisChunk;j--;){dest[destPos++]=src[srcPos++];dest[destPos++]=src[srcPos++];dest[destPos++]=src[srcPos++];dest[destPos++]=255}ctx.putImageData(chunkImgData,0,i*FULL_CHUNK_HEIGHT)}}else{error("bad image kind: "+imgData.kind)}}function putBinaryImageMask(ctx,imgData){var height=imgData.height,width=imgData.width;var partialChunkHeight=height%FULL_CHUNK_HEIGHT;var fullChunks=(height-partialChunkHeight)/FULL_CHUNK_HEIGHT;var totalChunks=partialChunkHeight===0?fullChunks:fullChunks+1;var chunkImgData=ctx.createImageData(width,FULL_CHUNK_HEIGHT);var srcPos=0;var src=imgData.data;var dest=chunkImgData.data;for(var i=0;i>=1}}ctx.putImageData(chunkImgData,0,i*FULL_CHUNK_HEIGHT)}}function copyCtxState(sourceCtx,destCtx){var properties=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(var i=0,ii=properties.length;i>8;bytes[i-2]=bytes[i-2]*alpha+g0*alpha_>>8;bytes[i-1]=bytes[i-1]*alpha+b0*alpha_>>8}}}function composeSMaskAlpha(maskData,layerData,transferMap){var length=maskData.length;var scale=1/255;for(var i=3;i>8]>>8:layerData[i]*y>>16}}function genericComposeSMask(maskCtx,layerCtx,width,height,subtype,backdrop,transferMap){var hasBackdrop=!!backdrop;var r0=hasBackdrop?backdrop[0]:0;var g0=hasBackdrop?backdrop[1]:0;var b0=hasBackdrop?backdrop[2]:0;var composeFn;if(subtype==="Luminosity"){composeFn=composeSMaskLuminosity}else{composeFn=composeSMaskAlpha}var PIXELS_TO_PROCESS=1048576;var chunkSize=Math.min(height,Math.ceil(PIXELS_TO_PROCESS/width));for(var row=0;rowEXECUTION_STEPS&&typeof continueCallback==="function";var endTime=chunkOperations?Date.now()+EXECUTION_TIME:0;var steps=0;var commonObjs=this.commonObjs;var objs=this.objs;var fnId;while(true){if(stepper!==undefined&&i===stepper.nextBreakPoint){stepper.breakIt(i,continueCallback);return i}fnId=fnArray[i];if(fnId!==OPS.dependency){this[fnId].apply(this,argsArray[i])}else{var deps=argsArray[i];for(var n=0,nn=deps.length;nEXECUTION_STEPS){if(Date.now()>endTime){continueCallback();return i}steps=0}}},endDrawing:function CanvasGraphics_endDrawing(){this.ctx.restore();if(this.transparentCanvas){this.ctx=this.compositeCtx;this.ctx.drawImage(this.transparentCanvas,0,0);this.transparentCanvas=null}this.cachedCanvases.clear();WebGLUtils.clear();if(this.imageLayer){this.imageLayer.endLayout()}},setLineWidth:function CanvasGraphics_setLineWidth(width){this.current.lineWidth=width;this.ctx.lineWidth=width},setLineCap:function CanvasGraphics_setLineCap(style){this.ctx.lineCap=LINE_CAP_STYLES[style]},setLineJoin:function CanvasGraphics_setLineJoin(style){this.ctx.lineJoin=LINE_JOIN_STYLES[style]},setMiterLimit:function CanvasGraphics_setMiterLimit(limit){this.ctx.miterLimit=limit},setDash:function CanvasGraphics_setDash(dashArray,dashPhase){var ctx=this.ctx;if(ctx.setLineDash!==undefined){ctx.setLineDash(dashArray);ctx.lineDashOffset=dashPhase}else{ctx.mozDash=dashArray;ctx.mozDashOffset=dashPhase}},setRenderingIntent:function CanvasGraphics_setRenderingIntent(intent){},setFlatness:function CanvasGraphics_setFlatness(flatness){},setGState:function CanvasGraphics_setGState(states){for(var i=0,ii=states.length;iMAX_FONT_SIZE?MAX_FONT_SIZE:size;this.current.fontSizeScale=size/browserFontSize;var rule=italic+" "+bold+" "+browserFontSize+"px "+typeface;this.ctx.font=rule},setTextRenderingMode:function CanvasGraphics_setTextRenderingMode(mode){this.current.textRenderingMode=mode},setTextRise:function CanvasGraphics_setTextRise(rise){this.current.textRise=rise},moveText:function CanvasGraphics_moveText(x,y){this.current.x=this.current.lineX+=x;this.current.y=this.current.lineY+=y},setLeadingMoveText:function CanvasGraphics_setLeadingMoveText(x,y){this.setLeading(-y);this.moveText(x,y)},setTextMatrix:function CanvasGraphics_setTextMatrix(a,b,c,d,e,f){this.current.textMatrix=[a,b,c,d,e,f];this.current.textMatrixScale=Math.sqrt(a*a+b*b);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0},nextLine:function CanvasGraphics_nextLine(){this.moveText(0,this.current.leading)},paintChar:function CanvasGraphics_paintChar(character,x,y){var ctx=this.ctx;var current=this.current;var font=current.font;var textRenderingMode=current.textRenderingMode;var fontSize=current.fontSize/current.fontSizeScale;var fillStrokeMode=textRenderingMode&TextRenderingMode.FILL_STROKE_MASK;var isAddToPathSet=!!(textRenderingMode&TextRenderingMode.ADD_TO_PATH_FLAG);var addToPath;if(font.disableFontFace||isAddToPathSet){addToPath=font.getPathGenerator(this.commonObjs,character)}if(font.disableFontFace){ctx.save();ctx.translate(x,y);ctx.beginPath();addToPath(ctx,fontSize);if(fillStrokeMode===TextRenderingMode.FILL||fillStrokeMode===TextRenderingMode.FILL_STROKE){ctx.fill()}if(fillStrokeMode===TextRenderingMode.STROKE||fillStrokeMode===TextRenderingMode.FILL_STROKE){ctx.stroke()}ctx.restore()}else{if(fillStrokeMode===TextRenderingMode.FILL||fillStrokeMode===TextRenderingMode.FILL_STROKE){ctx.fillText(character,x,y)}if(fillStrokeMode===TextRenderingMode.STROKE||fillStrokeMode===TextRenderingMode.FILL_STROKE){ctx.strokeText(character,x,y)}}if(isAddToPathSet){var paths=this.pendingTextPaths||(this.pendingTextPaths=[]);paths.push({transform:ctx.mozCurrentTransform,x:x,y:y,fontSize:fontSize,addToPath:addToPath})}},get isFontSubpixelAAEnabled(){var ctx=document.createElement("canvas").getContext("2d");ctx.scale(1.5,1);ctx.fillText("I",0,10);var data=ctx.getImageData(0,0,10,10).data;var enabled=false;for(var i=3;i0&&data[i]<255){enabled=true;break}}return shadow(this,"isFontSubpixelAAEnabled",enabled)},showText:function CanvasGraphics_showText(glyphs){var current=this.current;var font=current.font;if(font.isType3Font){return this.showType3Text(glyphs)}var fontSize=current.fontSize;if(fontSize===0){return}var ctx=this.ctx;var fontSizeScale=current.fontSizeScale;var charSpacing=current.charSpacing;var wordSpacing=current.wordSpacing;var fontDirection=current.fontDirection;var textHScale=current.textHScale*fontDirection;var glyphsLength=glyphs.length;var vertical=font.vertical;var spacingDir=vertical?1:-1;var defaultVMetrics=font.defaultVMetrics;var widthAdvanceScale=fontSize*current.fontMatrix[0];var simpleFillText=current.textRenderingMode===TextRenderingMode.FILL&&!font.disableFontFace;ctx.save();ctx.transform.apply(ctx,current.textMatrix);ctx.translate(current.x,current.y+current.textRise);if(current.patternFill){ctx.fillStyle=current.fillColor.getPattern(ctx,this)}if(fontDirection>0){ctx.scale(textHScale,-1)}else{ctx.scale(textHScale,1)}var lineWidth=current.lineWidth;var scale=current.textMatrixScale;if(scale===0||lineWidth===0){var fillStrokeMode=current.textRenderingMode&TextRenderingMode.FILL_STROKE_MASK;if(fillStrokeMode===TextRenderingMode.STROKE||fillStrokeMode===TextRenderingMode.FILL_STROKE){this.cachedGetSinglePixelWidth=null;lineWidth=this.getSinglePixelWidth()*MIN_WIDTH_FACTOR}}else{lineWidth/=scale}if(fontSizeScale!==1){ctx.scale(fontSizeScale,fontSizeScale);lineWidth/=fontSizeScale}ctx.lineWidth=lineWidth;var x=0,i;for(i=0;i0){var measuredWidth=ctx.measureText(character).width*1e3/fontSize*fontSizeScale;if(widthMAX_GROUP_SIZE){scaleX=drawnWidth/MAX_GROUP_SIZE;drawnWidth=MAX_GROUP_SIZE}if(drawnHeight>MAX_GROUP_SIZE){scaleY=drawnHeight/MAX_GROUP_SIZE;drawnHeight=MAX_GROUP_SIZE}var cacheId="groupAt"+this.groupLevel;if(group.smask){cacheId+="_smask_"+this.smaskCounter++%2}var scratchCanvas=this.cachedCanvases.getCanvas(cacheId,drawnWidth,drawnHeight,true);var groupCtx=scratchCanvas.context;groupCtx.scale(1/scaleX,1/scaleY);groupCtx.translate(-offsetX,-offsetY);groupCtx.transform.apply(groupCtx,currentTransform);if(group.smask){this.smaskStack.push({canvas:scratchCanvas.canvas,context:groupCtx,offsetX:offsetX,offsetY:offsetY,scaleX:scaleX,scaleY:scaleY,subtype:group.smask.subtype,backdrop:group.smask.backdrop,transferMap:group.smask.transferMap||null})}else{currentCtx.setTransform(1,0,0,1,0,0);currentCtx.translate(offsetX,offsetY);currentCtx.scale(scaleX,scaleY)}copyCtxState(currentCtx,groupCtx);this.ctx=groupCtx;this.setGState([["BM","Normal"],["ca",1],["CA",1]]);this.groupStack.push(currentCtx);this.groupLevel++},endGroup:function CanvasGraphics_endGroup(group){this.groupLevel--;var groupCtx=this.ctx;this.ctx=this.groupStack.pop();if(this.ctx.imageSmoothingEnabled!==undefined){this.ctx.imageSmoothingEnabled=false}else{this.ctx.mozImageSmoothingEnabled=false}if(group.smask){this.tempSMask=this.smaskStack.pop()}else{this.ctx.drawImage(groupCtx.canvas,0,0)}this.restore()},beginAnnotations:function CanvasGraphics_beginAnnotations(){this.save();this.current=new CanvasExtraState;if(this.baseTransform){this.ctx.setTransform.apply(this.ctx,this.baseTransform)}},endAnnotations:function CanvasGraphics_endAnnotations(){this.restore()},beginAnnotation:function CanvasGraphics_beginAnnotation(rect,transform,matrix){this.save();if(isArray(rect)&&4===rect.length){var width=rect[2]-rect[0];var height=rect[3]-rect[1];this.ctx.rect(rect[0],rect[1],width,height);this.clip();this.endPath()}this.transform.apply(this,transform);this.transform.apply(this,matrix)},endAnnotation:function CanvasGraphics_endAnnotation(){this.restore()},paintJpegXObject:function CanvasGraphics_paintJpegXObject(objId,w,h){var domImage=this.objs.get(objId);if(!domImage){warn("Dependent image isn't ready yet");return}this.save();var ctx=this.ctx;ctx.scale(1/w,-1/h);ctx.drawImage(domImage,0,0,domImage.width,domImage.height,0,-h,w,h);if(this.imageLayer){var currentTransform=ctx.mozCurrentTransformInverse;var position=this.getCanvasPosition(0,0);this.imageLayer.appendImage({objId:objId,left:position[0],top:position[1],width:w/currentTransform[0],height:h/currentTransform[3]})}this.restore()},paintImageMaskXObject:function CanvasGraphics_paintImageMaskXObject(img){var ctx=this.ctx;var width=img.width,height=img.height;var fillColor=this.current.fillColor;var isPatternFill=this.current.patternFill;var glyph=this.processingType3;if(COMPILE_TYPE3_GLYPHS&&glyph&&glyph.compiled===undefined){if(width<=MAX_SIZE_TO_COMPILE&&height<=MAX_SIZE_TO_COMPILE){glyph.compiled=compileType3Glyph({data:img.data,width:width,height:height})}else{glyph.compiled=null}}if(glyph&&glyph.compiled){glyph.compiled(ctx);return}var maskCanvas=this.cachedCanvases.getCanvas("maskCanvas",width,height);var maskCtx=maskCanvas.context;maskCtx.save();putBinaryImageMask(maskCtx,img);maskCtx.globalCompositeOperation="source-in";maskCtx.fillStyle=isPatternFill?fillColor.getPattern(maskCtx,this):fillColor;maskCtx.fillRect(0,0,width,height);maskCtx.restore();this.paintInlineImageXObject(maskCanvas.canvas)},paintImageMaskXObjectRepeat:function CanvasGraphics_paintImageMaskXObjectRepeat(imgData,scaleX,scaleY,positions){var width=imgData.width;var height=imgData.height;var fillColor=this.current.fillColor;var isPatternFill=this.current.patternFill;var maskCanvas=this.cachedCanvases.getCanvas("maskCanvas",width,height);var maskCtx=maskCanvas.context;maskCtx.save();putBinaryImageMask(maskCtx,imgData);maskCtx.globalCompositeOperation="source-in";maskCtx.fillStyle=isPatternFill?fillColor.getPattern(maskCtx,this):fillColor;maskCtx.fillRect(0,0,width,height);maskCtx.restore();var ctx=this.ctx;for(var i=0,ii=positions.length;i2&&paintWidth>1||heightScale>2&&paintHeight>1){var newWidth=paintWidth,newHeight=paintHeight;if(widthScale>2&&paintWidth>1){newWidth=Math.ceil(paintWidth/2);widthScale/=paintWidth/newWidth}if(heightScale>2&&paintHeight>1){newHeight=Math.ceil(paintHeight/2);heightScale/=paintHeight/newHeight}tmpCanvas=this.cachedCanvases.getCanvas(tmpCanvasId,newWidth,newHeight);tmpCtx=tmpCanvas.context;tmpCtx.clearRect(0,0,newWidth,newHeight);tmpCtx.drawImage(imgToPaint,0,0,paintWidth,paintHeight,0,0,newWidth,newHeight);imgToPaint=tmpCanvas.canvas;paintWidth=newWidth;paintHeight=newHeight;tmpCanvasId=tmpCanvasId==="prescale1"?"prescale2":"prescale1"}ctx.drawImage(imgToPaint,0,0,paintWidth,paintHeight,0,-height,width,height);if(this.imageLayer){var position=this.getCanvasPosition(0,-height);this.imageLayer.appendImage({imgData:imgData,left:position[0],top:position[1],width:width/currentTransform[0],height:height/currentTransform[3]})}this.restore()},paintInlineImageXObjectGroup:function CanvasGraphics_paintInlineImageXObjectGroup(imgData,map){var ctx=this.ctx;var w=imgData.width;var h=imgData.height;var tmpCanvas=this.cachedCanvases.getCanvas("inlineImage",w,h);var tmpCtx=tmpCanvas.context;putBinaryImageData(tmpCtx,imgData);for(var i=0,ii=map.length;i1){deprecated("getDocument is called with pdfDataRangeTransport, "+"passwordCallback or progressCallback argument")}if(pdfDataRangeTransport){if(!(pdfDataRangeTransport instanceof PDFDataRangeTransport)){pdfDataRangeTransport=Object.create(pdfDataRangeTransport);pdfDataRangeTransport.length=src.length;pdfDataRangeTransport.initialData=src.initialData;if(!pdfDataRangeTransport.abort){pdfDataRangeTransport.abort=function(){}}}src=Object.create(src);src.range=pdfDataRangeTransport}task.onPassword=passwordCallback||null;task.onProgress=progressCallback||null;var source;if(typeof src==="string"){source={url:src}}else if(isArrayBuffer(src)){source={data:src}}else if(src instanceof PDFDataRangeTransport){source={range:src}}else{if(typeof src!=="object"){error("Invalid parameter in getDocument, need either Uint8Array, "+"string or a parameter object")}if(!src.url&&!src.data&&!src.range){error("Invalid parameter object: need either .data, .range or .url")}source=src}var params={};var rangeTransport=null;var worker=null;for(var key in source){if(key==="url"&&typeof window!=="undefined"){params[key]=combineUrl(window.location.href,source[key]);continue}else if(key==="range"){rangeTransport=source[key];continue}else if(key==="worker"){worker=source[key];continue}else if(key==="data"&&!(source[key]instanceof Uint8Array)){var pdfBytes=source[key];if(typeof pdfBytes==="string"){params[key]=stringToBytes(pdfBytes)}else if(typeof pdfBytes==="object"&&pdfBytes!==null&&!isNaN(pdfBytes.length)){params[key]=new Uint8Array(pdfBytes)}else if(isArrayBuffer(pdfBytes)){params[key]=new Uint8Array(pdfBytes)}else{error("Invalid PDF binary data: either typed array, string or "+"array-like object is expected in the data property.")}continue}params[key]=source[key]}params.rangeChunkSize=params.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE;if(!worker){worker=new PDFWorker;task._worker=worker}var docId=task.docId;worker.promise.then(function(){if(task.destroyed){throw new Error("Loading aborted")}return _fetchDocument(worker,params,rangeTransport,docId).then(function(workerId){if(task.destroyed){throw new Error("Loading aborted")}var messageHandler=new MessageHandler(docId,workerId,worker.port);var transport=new WorkerTransport(messageHandler,task,rangeTransport);task._transport=transport;messageHandler.send("Ready",null)})}).catch(task._capability.reject);return task};function _fetchDocument(worker,source,pdfDataRangeTransport,docId){if(worker.destroyed){return Promise.reject(new Error("Worker was destroyed"))}source.disableAutoFetch=PDFJS.disableAutoFetch;source.disableStream=PDFJS.disableStream;source.chunkedViewerLoading=!!pdfDataRangeTransport;if(pdfDataRangeTransport){source.length=pdfDataRangeTransport.length;source.initialData=pdfDataRangeTransport.initialData}return worker.messageHandler.sendWithPromise("GetDocRequest",{docId:docId,source:source,disableRange:PDFJS.disableRange,maxImageSize:PDFJS.maxImageSize,cMapUrl:PDFJS.cMapUrl,cMapPacked:PDFJS.cMapPacked,disableFontFace:PDFJS.disableFontFace,disableCreateObjectURL:PDFJS.disableCreateObjectURL,verbosity:PDFJS.verbosity}).then(function(workerId){if(worker.destroyed){throw new Error("Worker was destroyed")}return workerId})}var PDFDocumentLoadingTask=function PDFDocumentLoadingTaskClosure(){var nextDocumentId=0;function PDFDocumentLoadingTask(){this._capability=createPromiseCapability();this._transport=null;this._worker=null;this.docId="d"+nextDocumentId++;this.destroyed=false;this.onPassword=null;this.onProgress=null;this.onUnsupportedFeature=null}PDFDocumentLoadingTask.prototype={get promise(){return this._capability.promise},destroy:function(){this.destroyed=true;var transportDestroyed=!this._transport?Promise.resolve():this._transport.destroy();return transportDestroyed.then(function(){this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}}.bind(this))},then:function PDFDocumentLoadingTask_then(onFulfilled,onRejected){return this.promise.then.apply(this.promise,arguments)}};return PDFDocumentLoadingTask}();var PDFDataRangeTransport=function pdfDataRangeTransportClosure(){function PDFDataRangeTransport(length,initialData){this.length=length;this.initialData=initialData;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._readyCapability=createPromiseCapability()}PDFDataRangeTransport.prototype={addRangeListener:function PDFDataRangeTransport_addRangeListener(listener){this._rangeListeners.push(listener)},addProgressListener:function PDFDataRangeTransport_addProgressListener(listener){this._progressListeners.push(listener)},addProgressiveReadListener:function PDFDataRangeTransport_addProgressiveReadListener(listener){this._progressiveReadListeners.push(listener)},onDataRange:function PDFDataRangeTransport_onDataRange(begin,chunk){var listeners=this._rangeListeners;for(var i=0,n=listeners.length;i=0){intentState.renderTasks.splice(i,1)}if(self.cleanupAfterRender){self.pendingCleanup=true}self._tryCleanup();if(error){internalRenderTask.capability.reject(error)}else{internalRenderTask.capability.resolve()}stats.timeEnd("Rendering");stats.timeEnd("Overall")}return renderTask},getOperatorList:function PDFPageProxy_getOperatorList(){function operatorListChanged(){if(intentState.operatorList.lastChunk){intentState.opListReadCapability.resolve(intentState.operatorList);var i=intentState.renderTasks.indexOf(opListTask);if(i>=0){intentState.renderTasks.splice(i,1)}}}var renderingIntent="oplist";if(!this.intentStates[renderingIntent]){this.intentStates[renderingIntent]=Object.create(null)}var intentState=this.intentStates[renderingIntent];var opListTask;if(!intentState.opListReadCapability){opListTask={};opListTask.operatorListChanged=operatorListChanged;intentState.receivingOperatorList=true;intentState.opListReadCapability=createPromiseCapability();intentState.renderTasks=[];intentState.renderTasks.push(opListTask);intentState.operatorList={fnArray:[],argsArray:[],lastChunk:false};this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageIndex,intent:renderingIntent})}return intentState.opListReadCapability.promise},getTextContent:function PDFPageProxy_getTextContent(params){var normalizeWhitespace=params&¶ms.normalizeWhitespace||false;return this.transport.messageHandler.sendWithPromise("GetTextContent",{pageIndex:this.pageNumber-1,normalizeWhitespace:normalizeWhitespace})},_destroy:function PDFPageProxy_destroy(){this.destroyed=true;this.transport.pageCache[this.pageIndex]=null;var waitOn=[];Object.keys(this.intentStates).forEach(function(intent){if(intent==="oplist"){return}var intentState=this.intentStates[intent];intentState.renderTasks.forEach(function(renderTask){var renderCompleted=renderTask.capability.promise.catch(function(){});waitOn.push(renderCompleted);renderTask.cancel()})},this);this.objs.clear();this.annotationsPromise=null;this.pendingCleanup=false;return Promise.all(waitOn)},destroy:function(){deprecated("page destroy method, use cleanup() instead");this.cleanup()},cleanup:function PDFPageProxy_cleanup(){this.pendingCleanup=true;this._tryCleanup()},_tryCleanup:function PDFPageProxy_tryCleanup(){if(!this.pendingCleanup||Object.keys(this.intentStates).some(function(intent){var intentState=this.intentStates[intent];return intentState.renderTasks.length!==0||intentState.receivingOperatorList},this)){return}Object.keys(this.intentStates).forEach(function(intent){delete this.intentStates[intent]},this);this.objs.clear();this.annotationsPromise=null;this.pendingCleanup=false},_startRenderPage:function PDFPageProxy_startRenderPage(transparency,intent){var intentState=this.intentStates[intent];if(intentState.displayReadyCapability){intentState.displayReadyCapability.resolve(transparency)}},_renderPageChunk:function PDFPageProxy_renderPageChunk(operatorListChunk,intent){var intentState=this.intentStates[intent];var i,ii;for(i=0,ii=operatorListChunk.length;iMAX_IMAGE_SIZE_TO_STORE){pageProxy.cleanupAfterRender=true}break;default:error("Got unknown object type "+type)}},this);messageHandler.on("DocProgress",function transportDocProgress(data){if(this.destroyed){return}var loadingTask=this.loadingTask;if(loadingTask.onProgress){loadingTask.onProgress({loaded:data.loaded,total:data.total})}},this);messageHandler.on("PageError",function transportError(data){if(this.destroyed){return}var page=this.pageCache[data.pageNum-1];var intentState=page.intentStates[data.intent];if(intentState.displayReadyCapability){intentState.displayReadyCapability.reject(data.error)}else{error(data.error)}},this);messageHandler.on("UnsupportedFeature",function transportUnsupportedFeature(data){if(this.destroyed){return}var featureId=data.featureId;var loadingTask=this.loadingTask;if(loadingTask.onUnsupportedFeature){loadingTask.onUnsupportedFeature(featureId)}PDFJS.UnsupportedManager.notify(featureId)},this);messageHandler.on("JpegDecode",function(data){if(this.destroyed){return Promise.reject("Worker was terminated")}var imageUrl=data[0];var components=data[1];if(components!==3&&components!==1){ +return Promise.reject(new Error("Only 3 components or 1 component can be returned"))}return new Promise(function(resolve,reject){var img=new Image;img.onload=function(){var width=img.width;var height=img.height;var size=width*height;var rgbaLength=size*4;var buf=new Uint8Array(size*components);var tmpCanvas=createScratchCanvas(width,height);var tmpCtx=tmpCanvas.getContext("2d");tmpCtx.drawImage(img,0,0);var data=tmpCtx.getImageData(0,0,width,height).data;var i,j;if(components===3){for(i=0,j=0;ithis.numPages||(pageNumber|0)!==pageNumber){return Promise.reject(new Error("Invalid page request"))}var pageIndex=pageNumber-1;if(pageIndex in this.pagePromises){return this.pagePromises[pageIndex]}var promise=this.messageHandler.sendWithPromise("GetPage",{pageIndex:pageIndex}).then(function(pageInfo){if(this.destroyed){throw new Error("Transport destroyed")}var page=new PDFPageProxy(pageIndex,pageInfo,this);this.pageCache[pageIndex]=page;return page}.bind(this));this.pagePromises[pageIndex]=promise;return promise},getPageIndex:function WorkerTransport_getPageIndexByRef(ref){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:ref})},getAnnotations:function WorkerTransport_getAnnotations(pageIndex,intent){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:pageIndex,intent:intent})},getDestinations:function WorkerTransport_getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)},getDestination:function WorkerTransport_getDestination(id){return this.messageHandler.sendWithPromise("GetDestination",{id:id})},getPageLabels:function WorkerTransport_getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)},getAttachments:function WorkerTransport_getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)},getJavaScript:function WorkerTransport_getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)},getOutline:function WorkerTransport_getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)},getMetadata:function WorkerTransport_getMetadata(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(function transportMetadata(results){return{info:results[0],metadata:results[1]?new Metadata(results[1]):null}})},getStats:function WorkerTransport_getStats(){return this.messageHandler.sendWithPromise("GetStats",null)},startCleanup:function WorkerTransport_startCleanup(){this.messageHandler.sendWithPromise("Cleanup",null).then(function endCleanup(){for(var i=0,ii=this.pageCache.length;i>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}ArithmeticDecoder.prototype={byteIn:function ArithmeticDecoder_byteIn(){var data=this.data;var bp=this.bp;if(data[bp]===255){var b1=data[bp+1];if(b1>143){this.clow+=65280;this.ct=8}else{bp++;this.clow+=data[bp]<<9;this.ct=7;this.bp=bp}}else{bp++;this.clow+=bp65535){this.chigh+=this.clow>>16;this.clow&=65535}},readBit:function ArithmeticDecoder_readBit(contexts,pos){var cx_index=contexts[pos]>>1,cx_mps=contexts[pos]&1;var qeTableIcx=QeTable[cx_index];var qeIcx=qeTableIcx.qe;var d;var a=this.a-qeIcx;if(this.chigh>15&1;this.clow=this.clow<<1&65535;this.ct--}while((a&32768)===0);this.a=a;contexts[pos]=cx_index<<1|cx_mps;return d}};return ArithmeticDecoder}();exports.ArithmeticDecoder=ArithmeticDecoder});(function(root,factory){{factory(root.pdfjsCoreCharsets={})}})(this,function(exports){var ISOAdobeCharset=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"];var ExpertCharset=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];var ExpertSubsetCharset=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];exports.ISOAdobeCharset=ISOAdobeCharset;exports.ExpertCharset=ExpertCharset;exports.ExpertSubsetCharset=ExpertSubsetCharset});(function(root,factory){{factory(root.pdfjsCoreEncodings={})}})(this,function(exports){var ExpertEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];var MacExpertEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall"];var MacRomanEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"];var StandardEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"];var WinAnsiEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"];var SymbolSetEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt"];var ZapfDingbatsEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191"];function getEncoding(encodingName){switch(encodingName){case"WinAnsiEncoding":return WinAnsiEncoding;case"StandardEncoding":return StandardEncoding;case"MacRomanEncoding":return MacRomanEncoding;case"SymbolSetEncoding":return SymbolSetEncoding;case"ZapfDingbatsEncoding":return ZapfDingbatsEncoding;case"ExpertEncoding":return ExpertEncoding;case"MacExpertEncoding":return MacExpertEncoding;default:return null}}exports.WinAnsiEncoding=WinAnsiEncoding;exports.StandardEncoding=StandardEncoding;exports.MacRomanEncoding=MacRomanEncoding;exports.SymbolSetEncoding=SymbolSetEncoding;exports.ZapfDingbatsEncoding=ZapfDingbatsEncoding;exports.ExpertEncoding=ExpertEncoding;exports.getEncoding=getEncoding});(function(root,factory){{factory(root.pdfjsCoreJpg={})}})(this,function(exports){var JpegImage=function jpegImage(){var dctZigZag=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);var dctCos1=4017;var dctSin1=799;var dctCos3=3406;var dctSin3=2276;var dctCos6=1567;var dctSin6=3784;var dctSqrt2=5793;var dctSqrt1d2=2896;function constructor(){}function buildHuffmanTable(codeLengths,values){var k=0,code=[],i,j,length=16;while(length>0&&!codeLengths[length-1]){length--}code.push({children:[],index:0});var p=code[0],q;for(i=0;i0){p=code.pop()}p.index++;code.push(p);while(code.length<=i){code.push(q={children:[],index:0});p.children[p.index]=q.children;p=q}k++}if(i+10){bitsCount--;return bitsData>>bitsCount&1}bitsData=data[offset++];if(bitsData===255){var nextByte=data[offset++];if(nextByte){throw"unexpected marker: "+(bitsData<<8|nextByte).toString(16)}}bitsCount=7;return bitsData>>>7}function decodeHuffman(tree){var node=tree;while(true){node=node[readBit()];if(typeof node==="number"){return node}if(typeof node!=="object"){throw"invalid huffman sequence"}}}function receive(length){var n=0;while(length>0){n=n<<1|readBit();length--}return n}function receiveAndExtend(length){if(length===1){return readBit()===1?1:-1}var n=receive(length);if(n>=1<>4;if(s===0){if(r<15){break}k+=16;continue}k+=r;var z=dctZigZag[k];component.blockData[offset+z]=receiveAndExtend(s);k++}}function decodeDCFirst(component,offset){var t=decodeHuffman(component.huffmanTableDC);var diff=t===0?0:receiveAndExtend(t)<0){eobrun--;return}var k=spectralStart,e=spectralEnd;while(k<=e){var rs=decodeHuffman(component.huffmanTableAC);var s=rs&15,r=rs>>4;if(s===0){if(r<15){eobrun=receive(r)+(1<>4;if(s===0){if(r<15){eobrun=receive(r)+(1<=65488&&marker<=65495){offset+=2}else{break}}return offset-startOffset}function quantizeAndInverse(component,blockBufferOffset,p){var qt=component.quantizationTable,blockData=component.blockData;var v0,v1,v2,v3,v4,v5,v6,v7;var p0,p1,p2,p3,p4,p5,p6,p7;var t;for(var row=0;row<64;row+=8){p0=blockData[blockBufferOffset+row];p1=blockData[blockBufferOffset+row+1];p2=blockData[blockBufferOffset+row+2];p3=blockData[blockBufferOffset+row+3];p4=blockData[blockBufferOffset+row+4];p5=blockData[blockBufferOffset+row+5];p6=blockData[blockBufferOffset+row+6];p7=blockData[blockBufferOffset+row+7];p0*=qt[row];if((p1|p2|p3|p4|p5|p6|p7)===0){t=dctSqrt2*p0+512>>10;p[row]=t;p[row+1]=t;p[row+2]=t;p[row+3]=t;p[row+4]=t;p[row+5]=t;p[row+6]=t;p[row+7]=t;continue}p1*=qt[row+1];p2*=qt[row+2];p3*=qt[row+3];p4*=qt[row+4];p5*=qt[row+5];p6*=qt[row+6];p7*=qt[row+7];v0=dctSqrt2*p0+128>>8;v1=dctSqrt2*p4+128>>8;v2=p2;v3=p6;v4=dctSqrt1d2*(p1-p7)+128>>8;v7=dctSqrt1d2*(p1+p7)+128>>8;v5=p3<<4;v6=p5<<4;v0=v0+v1+1>>1;v1=v0-v1;t=v2*dctSin6+v3*dctCos6+128>>8;v2=v2*dctCos6-v3*dctSin6+128>>8;v3=t;v4=v4+v6+1>>1;v6=v4-v6;v7=v7+v5+1>>1;v5=v7-v5;v0=v0+v3+1>>1;v3=v0-v3;v1=v1+v2+1>>1;v2=v1-v2;t=v4*dctSin3+v7*dctCos3+2048>>12;v4=v4*dctCos3-v7*dctSin3+2048>>12;v7=t;t=v5*dctSin1+v6*dctCos1+2048>>12;v5=v5*dctCos1-v6*dctSin1+2048>>12;v6=t;p[row]=v0+v7;p[row+7]=v0-v7;p[row+1]=v1+v6;p[row+6]=v1-v6;p[row+2]=v2+v5;p[row+5]=v2-v5;p[row+3]=v3+v4;p[row+4]=v3-v4}for(var col=0;col<8;++col){p0=p[col];p1=p[col+8];p2=p[col+16]; +p3=p[col+24];p4=p[col+32];p5=p[col+40];p6=p[col+48];p7=p[col+56];if((p1|p2|p3|p4|p5|p6|p7)===0){t=dctSqrt2*p0+8192>>14;t=t<-2040?0:t>=2024?255:t+2056>>4;blockData[blockBufferOffset+col]=t;blockData[blockBufferOffset+col+8]=t;blockData[blockBufferOffset+col+16]=t;blockData[blockBufferOffset+col+24]=t;blockData[blockBufferOffset+col+32]=t;blockData[blockBufferOffset+col+40]=t;blockData[blockBufferOffset+col+48]=t;blockData[blockBufferOffset+col+56]=t;continue}v0=dctSqrt2*p0+2048>>12;v1=dctSqrt2*p4+2048>>12;v2=p2;v3=p6;v4=dctSqrt1d2*(p1-p7)+2048>>12;v7=dctSqrt1d2*(p1+p7)+2048>>12;v5=p3;v6=p5;v0=(v0+v1+1>>1)+4112;v1=v0-v1;t=v2*dctSin6+v3*dctCos6+2048>>12;v2=v2*dctCos6-v3*dctSin6+2048>>12;v3=t;v4=v4+v6+1>>1;v6=v4-v6;v7=v7+v5+1>>1;v5=v7-v5;v0=v0+v3+1>>1;v3=v0-v3;v1=v1+v2+1>>1;v2=v1-v2;t=v4*dctSin3+v7*dctCos3+2048>>12;v4=v4*dctCos3-v7*dctSin3+2048>>12;v7=t;t=v5*dctSin1+v6*dctCos1+2048>>12;v5=v5*dctCos1-v6*dctSin1+2048>>12;v6=t;p0=v0+v7;p7=v0-v7;p1=v1+v6;p6=v1-v6;p2=v2+v5;p5=v2-v5;p3=v3+v4;p4=v3-v4;p0=p0<16?0:p0>=4080?255:p0>>4;p1=p1<16?0:p1>=4080?255:p1>>4;p2=p2<16?0:p2>=4080?255:p2>>4;p3=p3<16?0:p3>=4080?255:p3>>4;p4=p4<16?0:p4>=4080?255:p4>>4;p5=p5<16?0:p5>=4080?255:p5>>4;p6=p6<16?0:p6>=4080?255:p6>>4;p7=p7<16?0:p7>=4080?255:p7>>4;blockData[blockBufferOffset+col]=p0;blockData[blockBufferOffset+col+8]=p1;blockData[blockBufferOffset+col+16]=p2;blockData[blockBufferOffset+col+24]=p3;blockData[blockBufferOffset+col+32]=p4;blockData[blockBufferOffset+col+40]=p5;blockData[blockBufferOffset+col+48]=p6;blockData[blockBufferOffset+col+56]=p7}}function buildComponentData(frame,component){var blocksPerLine=component.blocksPerLine;var blocksPerColumn=component.blocksPerColumn;var computationBuffer=new Int16Array(64);for(var blockRow=0;blockRow=255?255:a}constructor.prototype={parse:function parse(data){function readUint16(){var value=data[offset]<<8|data[offset+1];offset+=2;return value}function readDataBlock(){var length=readUint16();var array=data.subarray(offset,offset+length-2);offset+=array.length;return array}function prepareComponents(frame){var mcusPerLine=Math.ceil(frame.samplesPerLine/8/frame.maxH);var mcusPerColumn=Math.ceil(frame.scanLines/8/frame.maxV);for(var i=0;i>4===0){for(j=0;j<64;j++){z=dctZigZag[j];tableData[z]=data[offset++]}}else if(quantizationTableSpec>>4===1){for(j=0;j<64;j++){z=dctZigZag[j];tableData[z]=readUint16()}}else{throw"DQT: invalid table spec"}quantizationTables[quantizationTableSpec&15]=tableData}break;case 65472:case 65473:case 65474:if(frame){throw"Only single frame JPEGs supported"}readUint16();frame={};frame.extended=fileMarker===65473;frame.progressive=fileMarker===65474;frame.precision=data[offset++];frame.scanLines=readUint16();frame.samplesPerLine=readUint16();frame.components=[];frame.componentIds={};var componentsCount=data[offset++],componentId;var maxH=0,maxV=0;for(i=0;i>4;var v=data[offset+1]&15;if(maxH>4===0?huffmanTablesDC:huffmanTablesAC)[huffmanTableSpec&15]=buildHuffmanTable(codeLengths,huffmanValues)}break;case 65501:readUint16();resetInterval=readUint16();break;case 65498:var scanLength=readUint16();var selectorsCount=data[offset++];var components=[],component;for(i=0;i>4];component.huffmanTableAC=huffmanTablesAC[tableSpec&15];components.push(component)}var spectralStart=data[offset++];var spectralEnd=data[offset++];var successiveApproximation=data[offset++];var processed=decodeScan(data,offset,frame,components,resetInterval,spectralStart,spectralEnd,successiveApproximation>>4,successiveApproximation&15);offset+=processed;break;case 65535:if(data[offset]!==255){offset--}break;default:if(data[offset-3]===255&&data[offset-2]>=192&&data[offset-2]<=254){offset-=3;break}throw"unknown JPEG marker "+fileMarker.toString(16)}fileMarker=readUint16()}this.width=frame.samplesPerLine;this.height=frame.scanLines;this.jfif=jfif;this.adobe=adobe;this.components=[];for(i=0;i>8)+transform[k+1]}}}return data},_isColorConversionNeeded:function isColorConversionNeeded(){if(this.adobe&&this.adobe.transformCode){return true}else if(this.numComponents===3){return true}else{return false}},_convertYccToRgb:function convertYccToRgb(data){var Y,Cb,Cr;for(var i=0,length=data.length;i=0?255:r<=min?0:255+r*scale|0;data[offset++]=g>=0?255:g<=min?0:255+g*scale|0;data[offset++]=b>=0?255:b<=min?0:255+b*scale|0}return data},getData:function getData(width,height,forceRGBoutput){if(this.numComponents>4){throw"Unsupported color mode"}var data=this._getLinearizedBlockData(width,height);if(this.numComponents===3){return this._convertYccToRgb(data)}else if(this.numComponents===4){if(this._isColorConversionNeeded()){if(forceRGBoutput){return this._convertYcckToRgb(data)}else{return this._convertYcckToCmyk(data)}}else if(forceRGBoutput){return this._convertCmykToRgb(data)}}return data}};return constructor}();exports.JpegImage=JpegImage});var NetworkManager=function NetworkManagerClosure(){var OK_RESPONSE=200;var PARTIAL_CONTENT_RESPONSE=206;function NetworkManager(url,args){this.url=url;args=args||{};this.isHttp=/^https?:/i.test(url);this.httpHeaders=this.isHttp&&args.httpHeaders||{};this.withCredentials=args.withCredentials||false;this.getXhr=args.getXhr||function NetworkManager_getXhr(){return new XMLHttpRequest};this.currXhrId=0;this.pendingRequests=Object.create(null);this.loadedRequests=Object.create(null)}function getArrayBuffer(xhr){var data=xhr.response;if(typeof data!=="string"){return data}var length=data.length;var array=new Uint8Array(length);for(var i=0;i=2&&pendingRequest.onHeadersReceived){pendingRequest.onHeadersReceived();delete pendingRequest.onHeadersReceived}if(xhr.readyState!==4){return}if(!(xhrId in this.pendingRequests)){return}delete this.pendingRequests[xhrId];if(xhr.status===0&&this.isHttp){if(pendingRequest.onError){pendingRequest.onError(xhr.status)}return}var xhrStatus=xhr.status||OK_RESPONSE;var ok_response_on_range_request=xhrStatus===OK_RESPONSE&&pendingRequest.expectedStatus===PARTIAL_CONTENT_RESPONSE;if(!ok_response_on_range_request&&xhrStatus!==pendingRequest.expectedStatus){if(pendingRequest.onError){pendingRequest.onError(xhr.status)}return}this.loadedRequests[xhrId]=true;var chunk=getArrayBuffer(xhr);if(xhrStatus===PARTIAL_CONTENT_RESPONSE){var rangeHeader=xhr.getResponseHeader("Content-Range");var matches=/bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader);var begin=parseInt(matches[1],10);pendingRequest.onDone({begin:begin,chunk:chunk})}else if(pendingRequest.onProgressiveData){pendingRequest.onDone(null)}else if(chunk){pendingRequest.onDone({begin:0,chunk:chunk})}else if(pendingRequest.onError){pendingRequest.onError(xhr.status)}},hasPendingRequests:function NetworkManager_hasPendingRequests(){for(var xhrId in this.pendingRequests){return true}return false},getRequestXhr:function NetworkManager_getXhr(xhrId){return this.pendingRequests[xhrId].xhr},isStreamingRequest:function NetworkManager_isStreamingRequest(xhrId){return!!this.pendingRequests[xhrId].onProgressiveData},isPendingRequest:function NetworkManager_isPendingRequest(xhrId){return xhrId in this.pendingRequests},isLoadedRequest:function NetworkManager_isLoadedRequest(xhrId){return xhrId in this.loadedRequests},abortAllRequests:function NetworkManager_abortAllRequests(){for(var xhrId in this.pendingRequests){this.abortRequest(xhrId|0)}},abortRequest:function NetworkManager_abortRequest(xhrId){var xhr=this.pendingRequests[xhrId].xhr;delete this.pendingRequests[xhrId];xhr.abort()}};return NetworkManager}();(function(root,factory){{factory(root.pdfjsCoreNetwork={})}})(this,function(exports){exports.NetworkManager=NetworkManager});(function(root,factory){{factory(root.pdfjsSharedGlobal={})}})(this,function(exports){var globalScope=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:this;var isWorker=typeof window==="undefined";if(!globalScope.PDFJS){globalScope.PDFJS={}}if(typeof pdfjsVersion!=="undefined"){globalScope.PDFJS.version=pdfjsVersion}if(typeof pdfjsVersion!=="undefined"){globalScope.PDFJS.build=pdfjsBuild}globalScope.PDFJS.pdfBug=false;exports.globalScope=globalScope;exports.isWorker=isWorker;exports.PDFJS=globalScope.PDFJS});(function(root,factory){{factory(root.pdfjsCoreBidi={},root.pdfjsSharedGlobal)}})(this,function(exports,sharedGlobal){var PDFJS=sharedGlobal.PDFJS;var bidi=PDFJS.bidi=function bidiClosure(){var baseTypes=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ON","CS","ON","CS","ON","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ON","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","ON","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"];var arabicTypes=["AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL"];function isOdd(i){return(i&1)!==0}function isEven(i){return(i&1)===0}function findUnequal(arr,start,value){for(var j=start,jj=arr.length;j=0;--j){if(types[j]!=="ET"){break}types[j]="EN"}for(j=i+1;j0){before=types[i-1]}var after=eor;if(end+1level&&isOdd(level)){lowestOddLevel=level}}for(level=highestLevel;level>=lowestOddLevel;--level){var start=-1;for(i=0,ii=levels.length;i=0){reverseValues(chars,start,i);start=-1}}else if(start<0){start=i}}if(start>=0){reverseValues(chars,start,levels.length)}}for(i=0,ii=chars.length;i"){chars[i]=""}}return createBidiText(chars.join(""),isLTR)}return bidi}();exports.bidi=bidi});(function(root,factory){{factory(root.pdfjsSharedUtil={},root.pdfjsSharedGlobal)}})(this,function(exports,sharedGlobal){var PDFJS=sharedGlobal.PDFJS;var globalScope=sharedGlobal.globalScope;var FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];var TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};var ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};var AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};var AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};var AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};var StreamType={UNKNOWN:0,FLATE:1,LZW:2,DCT:3,JPX:4,JBIG:5,A85:6,AHX:7,CCF:8,RL:9};var FontType={UNKNOWN:0,TYPE1:1,TYPE1C:2,CIDFONTTYPE0:3,CIDFONTTYPE0C:4,TRUETYPE:5,CIDFONTTYPE2:6,TYPE3:7,OPENTYPE:8,TYPE0:9,MMTYPE1:10};PDFJS.VERBOSITY_LEVELS={errors:0,warnings:1,infos:5};var OPS=PDFJS.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};function info(msg){if(PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.infos){console.log("Info: "+msg)}}function warn(msg){if(PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.warnings){console.log("Warning: "+msg)}}function deprecated(details){console.log("Deprecated API usage: "+details)}function error(msg){if(PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.errors){console.log("Error: "+msg);console.log(backtrace())}throw new Error(msg)}function backtrace(){try{throw new Error}catch(e){return e.stack?e.stack.split("\n").slice(2).join("\n"):""}}function assert(cond,msg){if(!cond){error(msg)}}var UNSUPPORTED_FEATURES=PDFJS.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"};function combineUrl(baseUrl,url){if(!url){return baseUrl}return new URL(url,baseUrl).href}function isSameOrigin(baseUrl,otherUrl){try{var base=new URL(baseUrl);if(!base.origin||base.origin==="null"){return false}}catch(e){return false}var other=new URL(otherUrl,base);return base.origin===other.origin}function isValidUrl(url,allowRelative){if(!url){return false}var protocol=/^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url);if(!protocol){return allowRelative}protocol=protocol[0].toLowerCase();switch(protocol){case"http":case"https":case"ftp":case"mailto":case"tel":return true;default:return false}}PDFJS.isValidUrl=isValidUrl;function addLinkAttributes(link,params){var url=params&¶ms.url;link.href=link.title=url?removeNullCharacters(url):"";if(url){if(isExternalLinkTargetSet()){link.target=LinkTargetStringMap[PDFJS.externalLinkTarget]}link.rel=PDFJS.externalLinkRel}}PDFJS.addLinkAttributes=addLinkAttributes;function shadow(obj,prop,value){Object.defineProperty(obj,prop,{value:value,enumerable:true,configurable:true,writable:false});return value}PDFJS.shadow=shadow;function getLookupTableFactory(initializer){var lookup;return function(){if(initializer){lookup=Object.create(null);initializer(lookup);initializer=null}return lookup}}var LinkTarget=PDFJS.LinkTarget={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};var LinkTargetStringMap=["","_self","_blank","_parent","_top"];function isExternalLinkTargetSet(){if(PDFJS.openExternalLinksInNewWindow){deprecated("PDFJS.openExternalLinksInNewWindow, please use "+'"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.');if(PDFJS.externalLinkTarget===LinkTarget.NONE){PDFJS.externalLinkTarget=LinkTarget.BLANK}PDFJS.openExternalLinksInNewWindow=false}switch(PDFJS.externalLinkTarget){case LinkTarget.NONE:return false;case LinkTarget.SELF:case LinkTarget.BLANK:case LinkTarget.PARENT:case LinkTarget.TOP:return true}warn("PDFJS.externalLinkTarget is invalid: "+PDFJS.externalLinkTarget);PDFJS.externalLinkTarget=LinkTarget.NONE;return false}PDFJS.isExternalLinkTargetSet=isExternalLinkTargetSet;var PasswordResponses=PDFJS.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var PasswordException=function PasswordExceptionClosure(){function PasswordException(msg,code){this.name="PasswordException";this.message=msg;this.code=code}PasswordException.prototype=new Error;PasswordException.constructor=PasswordException;return PasswordException}();PDFJS.PasswordException=PasswordException;var UnknownErrorException=function UnknownErrorExceptionClosure(){function UnknownErrorException(msg,details){this.name="UnknownErrorException";this.message=msg;this.details=details}UnknownErrorException.prototype=new Error;UnknownErrorException.constructor=UnknownErrorException;return UnknownErrorException}();PDFJS.UnknownErrorException=UnknownErrorException;var InvalidPDFException=function InvalidPDFExceptionClosure(){function InvalidPDFException(msg){this.name="InvalidPDFException";this.message=msg}InvalidPDFException.prototype=new Error;InvalidPDFException.constructor=InvalidPDFException;return InvalidPDFException}();PDFJS.InvalidPDFException=InvalidPDFException;var MissingPDFException=function MissingPDFExceptionClosure(){function MissingPDFException(msg){this.name="MissingPDFException";this.message=msg}MissingPDFException.prototype=new Error;MissingPDFException.constructor=MissingPDFException;return MissingPDFException}();PDFJS.MissingPDFException=MissingPDFException;var UnexpectedResponseException=function UnexpectedResponseExceptionClosure(){function UnexpectedResponseException(msg,status){this.name="UnexpectedResponseException";this.message=msg;this.status=status}UnexpectedResponseException.prototype=new Error;UnexpectedResponseException.constructor=UnexpectedResponseException;return UnexpectedResponseException}();PDFJS.UnexpectedResponseException=UnexpectedResponseException;var NotImplementedException=function NotImplementedExceptionClosure(){function NotImplementedException(msg){this.message=msg}NotImplementedException.prototype=new Error;NotImplementedException.prototype.name="NotImplementedException";NotImplementedException.constructor=NotImplementedException;return NotImplementedException}();var MissingDataException=function MissingDataExceptionClosure(){function MissingDataException(begin,end){this.begin=begin;this.end=end;this.message="Missing data ["+begin+", "+end+")"}MissingDataException.prototype=new Error;MissingDataException.prototype.name="MissingDataException"; +MissingDataException.constructor=MissingDataException;return MissingDataException}();var XRefParseException=function XRefParseExceptionClosure(){function XRefParseException(msg){this.message=msg}XRefParseException.prototype=new Error;XRefParseException.prototype.name="XRefParseException";XRefParseException.constructor=XRefParseException;return XRefParseException}();var NullCharactersRegExp=/\x00/g;function removeNullCharacters(str){if(typeof str!=="string"){warn("The argument for removeNullCharacters must be a string.");return str}return str.replace(NullCharactersRegExp,"")}PDFJS.removeNullCharacters=removeNullCharacters;function bytesToString(bytes){assert(bytes!==null&&typeof bytes==="object"&&bytes.length!==undefined,"Invalid argument for bytesToString");var length=bytes.length;var MAX_ARGUMENT_COUNT=8192;if(length>24&255,value>>16&255,value>>8&255,value&255)}function log2(x){var n=1,i=0;while(x>n){n<<=1;i++}return i}function readInt8(data,start){return data[start]<<24>>24}function readUint16(data,offset){return data[offset]<<8|data[offset+1]}function readUint32(data,offset){return(data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3])>>>0}function isLittleEndian(){var buffer8=new Uint8Array(2);buffer8[0]=1;var buffer16=new Uint16Array(buffer8.buffer);return buffer16[0]===1}Object.defineProperty(PDFJS,"isLittleEndian",{configurable:true,get:function PDFJS_isLittleEndian(){return shadow(PDFJS,"isLittleEndian",isLittleEndian())}});function hasCanvasTypedArrays(){var canvas=document.createElement("canvas");canvas.width=canvas.height=1;var ctx=canvas.getContext("2d");var imageData=ctx.createImageData(1,1);return typeof imageData.data.buffer!=="undefined"}Object.defineProperty(PDFJS,"hasCanvasTypedArrays",{configurable:true,get:function PDFJS_hasCanvasTypedArrays(){return shadow(PDFJS,"hasCanvasTypedArrays",hasCanvasTypedArrays())}});var Uint32ArrayView=function Uint32ArrayViewClosure(){function Uint32ArrayView(buffer,length){this.buffer=buffer;this.byteLength=buffer.length;this.length=length===undefined?this.byteLength>>2:length;ensureUint32ArrayViewProps(this.length)}Uint32ArrayView.prototype=Object.create(null);var uint32ArrayViewSetters=0;function createUint32ArrayProp(index){return{get:function(){var buffer=this.buffer,offset=index<<2;return(buffer[offset]|buffer[offset+1]<<8|buffer[offset+2]<<16|buffer[offset+3]<<24)>>>0},set:function(value){var buffer=this.buffer,offset=index<<2;buffer[offset]=value&255;buffer[offset+1]=value>>8&255;buffer[offset+2]=value>>16&255;buffer[offset+3]=value>>>24&255}}}function ensureUint32ArrayViewProps(length){while(uint32ArrayViewSettersrect[2]){r[0]=rect[2];r[2]=rect[0]}if(rect[1]>rect[3]){r[1]=rect[3];r[3]=rect[1]}return r};Util.intersect=function Util_intersect(rect1,rect2){function compare(a,b){return a-b}var orderedX=[rect1[0],rect1[2],rect2[0],rect2[2]].sort(compare),orderedY=[rect1[1],rect1[3],rect2[1],rect2[3]].sort(compare),result=[];rect1=Util.normalizeRect(rect1);rect2=Util.normalizeRect(rect2);if(orderedX[0]===rect1[0]&&orderedX[1]===rect2[0]||orderedX[0]===rect2[0]&&orderedX[1]===rect1[0]){result[0]=orderedX[1];result[2]=orderedX[2]}else{return false}if(orderedY[0]===rect1[1]&&orderedY[1]===rect2[1]||orderedY[0]===rect2[1]&&orderedY[1]===rect1[1]){result[1]=orderedY[1];result[3]=orderedY[2]}else{return false}return result};Util.sign=function Util_sign(num){return num<0?-1:1};var ROMAN_NUMBER_MAP=["","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"];Util.toRoman=function Util_toRoman(number,lowerCase){assert(isInt(number)&&number>0,"The number should be a positive integer.");var pos,romanBuf=[];while(number>=1e3){number-=1e3;romanBuf.push("M")}pos=number/100|0;number%=100;romanBuf.push(ROMAN_NUMBER_MAP[pos]);pos=number/10|0;number%=10;romanBuf.push(ROMAN_NUMBER_MAP[10+pos]);romanBuf.push(ROMAN_NUMBER_MAP[20+number]);var romanStr=romanBuf.join("");return lowerCase?romanStr.toLowerCase():romanStr};Util.appendToArray=function Util_appendToArray(arr1,arr2){Array.prototype.push.apply(arr1,arr2)};Util.prependToArray=function Util_prependToArray(arr1,arr2){Array.prototype.unshift.apply(arr1,arr2)};Util.extendObj=function extendObj(obj1,obj2){for(var key in obj2){obj1[key]=obj2[key]}};Util.getInheritableProperty=function Util_getInheritableProperty(dict,name){while(dict&&!dict.has(name)){dict=dict.get("Parent")}if(!dict){return null}return dict.get(name)};Util.inherit=function Util_inherit(sub,base,prototype){sub.prototype=Object.create(base.prototype);sub.prototype.constructor=sub;for(var prop in prototype){sub.prototype[prop]=prototype[prop]}};Util.loadScript=function Util_loadScript(src,callback){var script=document.createElement("script");var loaded=false;script.setAttribute("src",src);if(callback){script.onload=function(){if(!loaded){callback()}loaded=true}}document.getElementsByTagName("head")[0].appendChild(script)};return Util}();var PageViewport=PDFJS.PageViewport=function PageViewportClosure(){function PageViewport(viewBox,scale,rotation,offsetX,offsetY,dontFlip){this.viewBox=viewBox;this.scale=scale;this.rotation=rotation;this.offsetX=offsetX;this.offsetY=offsetY;var centerX=(viewBox[2]+viewBox[0])/2;var centerY=(viewBox[3]+viewBox[1])/2;var rotateA,rotateB,rotateC,rotateD;rotation=rotation%360;rotation=rotation<0?rotation+360:rotation;switch(rotation){case 180:rotateA=-1;rotateB=0;rotateC=0;rotateD=1;break;case 90:rotateA=0;rotateB=1;rotateC=1;rotateD=0;break;case 270:rotateA=0;rotateB=-1;rotateC=-1;rotateD=0;break;default:rotateA=1;rotateB=0;rotateC=0;rotateD=-1;break}if(dontFlip){rotateC=-rotateC;rotateD=-rotateD}var offsetCanvasX,offsetCanvasY;var width,height;if(rotateA===0){offsetCanvasX=Math.abs(centerY-viewBox[1])*scale+offsetX;offsetCanvasY=Math.abs(centerX-viewBox[0])*scale+offsetY;width=Math.abs(viewBox[3]-viewBox[1])*scale;height=Math.abs(viewBox[2]-viewBox[0])*scale}else{offsetCanvasX=Math.abs(centerX-viewBox[0])*scale+offsetX;offsetCanvasY=Math.abs(centerY-viewBox[1])*scale+offsetY;width=Math.abs(viewBox[2]-viewBox[0])*scale;height=Math.abs(viewBox[3]-viewBox[1])*scale}this.transform=[rotateA*scale,rotateB*scale,rotateC*scale,rotateD*scale,offsetCanvasX-rotateA*scale*centerX-rotateC*scale*centerY,offsetCanvasY-rotateB*scale*centerX-rotateD*scale*centerY];this.width=width;this.height=height;this.fontScale=scale}PageViewport.prototype={clone:function PageViewPort_clone(args){args=args||{};var scale="scale"in args?args.scale:this.scale;var rotation="rotation"in args?args.rotation:this.rotation;return new PageViewport(this.viewBox.slice(),scale,rotation,this.offsetX,this.offsetY,args.dontFlip)},convertToViewportPoint:function PageViewport_convertToViewportPoint(x,y){return Util.applyTransform([x,y],this.transform)},convertToViewportRectangle:function PageViewport_convertToViewportRectangle(rect){var tl=Util.applyTransform([rect[0],rect[1]],this.transform);var br=Util.applyTransform([rect[2],rect[3]],this.transform);return[tl[0],tl[1],br[0],br[1]]},convertToPdfPoint:function PageViewport_convertToPdfPoint(x,y){return Util.applyInverseTransform([x,y],this.transform)}};return PageViewport}();var PDFStringTranslateTable=[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 stringToPDFString(str){var i,n=str.length,strBuf=[];if(str[0]==="þ"&&str[1]==="ÿ"){for(i=2;i0){var handler=this.handlers.shift();var nextStatus=handler.thisPromise._status;var nextValue=handler.thisPromise._value;try{if(nextStatus===STATUS_RESOLVED){if(typeof handler.onResolve==="function"){nextValue=handler.onResolve(nextValue)}}else if(typeof handler.onReject==="function"){nextValue=handler.onReject(nextValue);nextStatus=STATUS_RESOLVED;if(handler.thisPromise._unhandledRejection){this.removeUnhandeledRejection(handler.thisPromise)}}}catch(ex){nextStatus=STATUS_REJECTED;nextValue=ex}handler.nextPromise._updateStatus(nextStatus,nextValue);if(Date.now()>=timeoutAt){break}}if(this.handlers.length>0){setTimeout(this.runHandlers.bind(this),0);return}this.running=false},addUnhandledRejection:function addUnhandledRejection(promise){this.unhandledRejections.push({promise:promise,time:Date.now()});this.scheduleRejectionCheck()},removeUnhandeledRejection:function removeUnhandeledRejection(promise){promise._unhandledRejection=false;for(var i=0;iREJECTION_TIMEOUT){var unhandled=this.unhandledRejections[i].promise._value;var msg="Unhandled rejection: "+unhandled;if(unhandled.stack){msg+="\n"+unhandled.stack}warn(msg);this.unhandledRejections.splice(i);i--}}if(this.unhandledRejections.length){this.scheduleRejectionCheck()}}.bind(this),REJECTION_TIMEOUT)}};function Promise(resolver){this._status=STATUS_PENDING;this._handlers=[];try{resolver.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(e){this._reject(e)}}Promise.all=function Promise_all(promises){var resolveAll,rejectAll;var deferred=new Promise(function(resolve,reject){resolveAll=resolve;rejectAll=reject});var unresolved=promises.length;var results=[];if(unresolved===0){resolveAll(results);return deferred}function reject(reason){if(deferred._status===STATUS_REJECTED){return}results=[];rejectAll(reason)}for(var i=0,ii=promises.length;ilongest){longest=name.length}}for(i=0,ii=times.length;i>2,d2=(b1&3)<<4|b2>>4;var d3=i+1>6:64;var d4=i+232&&unicode<127&&[34,35,60,62,63,96].indexOf(unicode)==-1){return c}return encodeURIComponent(c)}function percentEscapeQuery(c){var unicode=c.charCodeAt(0);if(unicode>32&&unicode<127&&[34,35,60,62,96].indexOf(unicode)==-1){return c}return encodeURIComponent(c)}var EOF=undefined,ALPHA=/[a-zA-Z]/,ALPHANUMERIC=/[a-zA-Z0-9\+\-\.]/;function parse(input,stateOverride,base){function err(message){errors.push(message)}var state=stateOverride||"scheme start",cursor=0,buffer="",seenAt=false,seenBracket=false,errors=[];loop:while((input[cursor-1]!=EOF||cursor==0)&&!this._isInvalid){var c=input[cursor];switch(state){case"scheme start":if(c&&ALPHA.test(c)){buffer+=c.toLowerCase();state="scheme"}else if(!stateOverride){buffer="";state="no scheme";continue}else{err("Invalid scheme.");break loop}break;case"scheme":if(c&&ALPHANUMERIC.test(c)){buffer+=c.toLowerCase()}else if(":"==c){this._scheme=buffer;buffer="";if(stateOverride){break loop}if(isRelativeScheme(this._scheme)){this._isRelative=true}if("file"==this._scheme){state="relative"}else if(this._isRelative&&base&&base._scheme==this._scheme){state="relative or authority"}else if(this._isRelative){state="authority first slash"}else{state="scheme data"}}else if(!stateOverride){buffer="";cursor=0;state="no scheme";continue}else if(EOF==c){break loop}else{err("Code point not allowed in scheme: "+c);break loop}break;case"scheme data":if("?"==c){this._query="?";state="query"}else if("#"==c){this._fragment="#";state="fragment"}else{if(EOF!=c&&" "!=c&&"\n"!=c&&"\r"!=c){this._schemeData+=percentEscape(c)}}break;case"no scheme":if(!base||!isRelativeScheme(base._scheme)){err("Missing scheme.");invalid.call(this)}else{state="relative";continue}break;case"relative or authority":if("/"==c&&"/"==input[cursor+1]){state="authority ignore slashes"}else{err("Expected /, got: "+c);state="relative";continue}break;case"relative":this._isRelative=true;if("file"!=this._scheme)this._scheme=base._scheme;if(EOF==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query=base._query;this._username=base._username;this._password=base._password;break loop}else if("/"==c||"\\"==c){if("\\"==c)err("\\ is an invalid code point.");state="relative slash"}else if("?"==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query="?";this._username=base._username;this._password=base._password;state="query"}else if("#"==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query=base._query;this._fragment="#";this._username=base._username;this._password=base._password;state="fragment"}else{var nextC=input[cursor+1];var nextNextC=input[cursor+2];if("file"!=this._scheme||!ALPHA.test(c)||nextC!=":"&&nextC!="|"||EOF!=nextNextC&&"/"!=nextNextC&&"\\"!=nextNextC&&"?"!=nextNextC&&"#"!=nextNextC){this._host=base._host;this._port=base._port;this._username=base._username;this._password=base._password;this._path=base._path.slice();this._path.pop()}state="relative path";continue}break;case"relative slash":if("/"==c||"\\"==c){if("\\"==c){err("\\ is an invalid code point.")}if("file"==this._scheme){state="file host"}else{state="authority ignore slashes"}}else{if("file"!=this._scheme){this._host=base._host;this._port=base._port;this._username=base._username;this._password=base._password}state="relative path";continue}break;case"authority first slash":if("/"==c){state="authority second slash"}else{err("Expected '/', got: "+c);state="authority ignore slashes";continue}break;case"authority second slash":state="authority ignore slashes";if("/"!=c){err("Expected '/', got: "+c);continue}break;case"authority ignore slashes":if("/"!=c&&"\\"!=c){state="authority";continue}else{err("Expected authority, got: "+c)}break;case"authority":if("@"==c){if(seenAt){err("@ already seen.");buffer+="%40"}seenAt=true;for(var i=0;i=this.end?this.numChunks:Math.floor(position/this.chunkSize);var curChunk;for(curChunk=beginChunk;curChunk=end){return}if(end<=this.progressiveDataLength){return}var chunkSize=this.chunkSize;var beginChunk=Math.floor(begin/chunkSize);var endChunk=Math.floor((end-1)/chunkSize)+1;for(var chunk=beginChunk;chunk=this.end){return-1}this.ensureByte(pos);return this.bytes[this.pos++]},getUint16:function ChunkedStream_getUint16(){var b0=this.getByte();var b1=this.getByte();if(b0===-1||b1===-1){return-1}return(b0<<8)+b1},getInt32:function ChunkedStream_getInt32(){var b0=this.getByte();var b1=this.getByte();var b2=this.getByte();var b3=this.getByte();return(b0<<24)+(b1<<16)+(b2<<8)+b3},getBytes:function ChunkedStream_getBytes(length){var bytes=this.bytes;var pos=this.pos;var strEnd=this.end;if(!length){this.ensureRange(pos,strEnd);return bytes.subarray(pos,strEnd)}var end=pos+length;if(end>strEnd){end=strEnd}this.ensureRange(pos,end);this.pos=end;return bytes.subarray(pos,end)},peekByte:function ChunkedStream_peekByte(){var peekedByte=this.getByte();this.pos--;return peekedByte},peekBytes:function ChunkedStream_peekBytes(length){var bytes=this.getBytes(length);this.pos-=bytes.length;return bytes},getByteRange:function ChunkedStream_getBytes(begin,end){this.ensureRange(begin,end);return this.bytes.subarray(begin,end)},skip:function ChunkedStream_skip(n){if(!n){n=1}this.pos+=n},reset:function ChunkedStream_reset(){this.pos=this.start},moveStart:function ChunkedStream_moveStart(){this.start=this.pos},makeSubStream:function ChunkedStream_makeSubStream(start,length,dict){this.ensureRange(start,start+length);function ChunkedStreamSubstream(){}ChunkedStreamSubstream.prototype=Object.create(this);ChunkedStreamSubstream.prototype.getMissingChunks=function(){var chunkSize=this.chunkSize;var beginChunk=Math.floor(this.start/chunkSize);var endChunk=Math.floor((this.end-1)/chunkSize)+1;var missingChunks=[];for(var chunk=beginChunk;chunk=0&&prevChunk+1!==chunk){groupedChunks.push({beginChunk:beginChunk,endChunk:prevChunk+1});beginChunk=chunk}if(i+1===chunks.length){groupedChunks.push({beginChunk:beginChunk,endChunk:chunk+1})}prevChunk=chunk}return groupedChunks},onProgress:function ChunkedStreamManager_onProgress(args){var bytesLoaded=this.stream.numChunksLoaded*this.chunkSize+args.loaded;this.msgHandler.send("DocProgress",{loaded:bytesLoaded,total:this.length})},onReceiveData:function ChunkedStreamManager_onReceiveData(args){var chunk=args.chunk;var isProgressive=args.begin===undefined;var begin=isProgressive?this.progressiveDataLength:args.begin;var end=begin+chunk.byteLength;var beginChunk=Math.floor(begin/this.chunkSize);var endChunk=end>>0}var sign=readBits(1);var value=readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(32)+4436:readBits(12)+340:readBits(8)+84:readBits(6)+20:readBits(4)+4:readBits(2);return sign===0?value:value>0?-value:null}function decodeIAID(contextCache,decoder,codeLength){var contexts=contextCache.getContexts("IAID");var prev=1;for(var i=0;i=sbb_left&&j=sbb_top){contextLabel=contextLabel<<1&reuseMask;for(k=0;k=0&&j0=0){bit=bitmap[i0][j0];if(bit){contextLabel|=bit<=width){contextLabel<<=1}else{contextLabel=contextLabel<<1|bitmap[i0][j0]}}for(k=0;k=referenceHeight||j0<0||j0>=referenceWidth){contextLabel<<=1}else{contextLabel=contextLabel<<1|referenceBitmap[i0][j0]}}var pixel=decoder.readBit(contexts,contextLabel);row[j]=pixel}}return bitmap}function decodeSymbolDictionary(huffman,refinement,symbols,numberOfNewSymbols,numberOfExportedSymbols,huffmanTables,templateIndex,at,refinementTemplateIndex,refinementAt,decodingContext){if(huffman){error("JBIG2 error: huffman is not supported")}var newSymbols=[];var currentHeight=0;var symbolCodeLength=log2(symbols.length+numberOfNewSymbols);var decoder=decodingContext.decoder;var contextCache=decodingContext.contextCache;while(newSymbols.length1){bitmap=decodeTextRegion(huffman,refinement,currentWidth,currentHeight,0,numberOfInstances,1,symbols.concat(newSymbols),symbolCodeLength,0,0,1,0,huffmanTables,refinementTemplateIndex,refinementAt,decodingContext)}else{var symbolId=decodeIAID(contextCache,decoder,symbolCodeLength);var rdx=decodeInteger(contextCache,"IARDX",decoder);var rdy=decodeInteger(contextCache,"IARDY",decoder);var symbol=symbolId>1)+rdx,(rdh>>1)+rdy,false,refinementAt,decodingContext)}var offsetT=t-(referenceCorner&1?0:symbolHeight);var offsetS=currentS-(referenceCorner&2?symbolWidth:0);var s2,t2,symbolRow;if(transposed){for(s2=0;s2>5&7;var retainBits=[referredFlags&31];var position=start+6;if(referredFlags===7){referredToCount=readUint32(data,position-1)&536870911;position+=3;var bytes=referredToCount+7>>3;retainBits[0]=data[position++];while(--bytes>0){retainBits.push(data[position++])}}else if(referredFlags===5||referredFlags===6){error("JBIG2 error: invalid referred-to flags")}segmentHeader.retainBits=retainBits;var referredToSegmentNumberSize=segmentHeader.number<=256?1:segmentHeader.number<=65536?2:4;var referredTo=[];var i,ii;for(i=0;i>>24&255;searchPattern[3]=genericRegionInfo.height>>16&255;searchPattern[4]=genericRegionInfo.height>>8&255;searchPattern[5]=genericRegionInfo.height&255;for(i=position,ii=data.length;i>2&3;dictionary.huffmanDWSelector=dictionaryFlags>>4&3;dictionary.bitmapSizeSelector=dictionaryFlags>>6&1;dictionary.aggregationInstancesSelector=dictionaryFlags>>7&1;dictionary.bitmapCodingContextUsed=!!(dictionaryFlags&256);dictionary.bitmapCodingContextRetained=!!(dictionaryFlags&512);dictionary.template=dictionaryFlags>>10&3;dictionary.refinementTemplate=dictionaryFlags>>12&1;position+=2;if(!dictionary.huffman){atLength=dictionary.template===0?4:1;at=[];for(i=0;i>2&3);textRegion.referenceCorner=textRegionSegmentFlags>>4&3;textRegion.transposed=!!(textRegionSegmentFlags&64);textRegion.combinationOperator=textRegionSegmentFlags>>7&3;textRegion.defaultPixelValue=textRegionSegmentFlags>>9&1;textRegion.dsOffset=textRegionSegmentFlags<<17>>27;textRegion.refinementTemplate=textRegionSegmentFlags>>15&1;if(textRegion.huffman){var textRegionHuffmanFlags=readUint16(data,position);position+=2;textRegion.huffmanFS=textRegionHuffmanFlags&3;textRegion.huffmanDS=textRegionHuffmanFlags>>2&3;textRegion.huffmanDT=textRegionHuffmanFlags>>4&3;textRegion.huffmanRefinementDW=textRegionHuffmanFlags>>6&3;textRegion.huffmanRefinementDH=textRegionHuffmanFlags>>8&3;textRegion.huffmanRefinementDX=textRegionHuffmanFlags>>10&3;textRegion.huffmanRefinementDY=textRegionHuffmanFlags>>12&3;textRegion.huffmanRefinementSizeSelector=!!(textRegionHuffmanFlags&14)}if(textRegion.refinement&&!textRegion.refinementTemplate){at=[];for(i=0;i<2;i++){at.push({x:readInt8(data,position),y:readInt8(data,position+1)});position+=2}textRegion.refinementAt=at}textRegion.numberOfSymbolInstances=readUint32(data,position);position+=4;if(textRegion.huffman){error("JBIG2 error: huffman is not supported")}args=[textRegion,header.referredTo,data,position,end];break;case 38:case 39:var genericRegion={};genericRegion.info=readRegionSegmentInformation(data,position);position+=RegionSegmentInformationFieldLength;var genericRegionSegmentFlags=data[position++];genericRegion.mmr=!!(genericRegionSegmentFlags&1);genericRegion.template=genericRegionSegmentFlags>>1&3;genericRegion.prediction=!!(genericRegionSegmentFlags&8);if(!genericRegion.mmr){atLength=genericRegion.template===0?4:1;at=[];for(i=0;i>2&1;pageInfo.combinationOperator=pageSegmentFlags>>3&3;pageInfo.requiresBuffer=!!(pageSegmentFlags&32);pageInfo.combinationOperatorOverride=!!(pageSegmentFlags&64);args=[pageInfo];break;case 49:break;case 50:break;case 51:break;case 62:break;default:error("JBIG2 error: segment type "+header.typeName+"("+header.type+") is not implemented")}var callbackName="on"+header.typeName;if(callbackName in visitor){visitor[callbackName].apply(visitor,args)}}function processSegments(segments,visitor){for(var i=0,ii=segments.length;i>3;var buffer=new Uint8Array(rowSize*info.height);if(info.defaultPixelValue){for(var i=0,ii=buffer.length;i>3;var combinationOperator=pageInfo.combinationOperatorOverride?regionInfo.combinationOperator:pageInfo.combinationOperator;var buffer=this.buffer;var mask0=128>>(regionInfo.x&7);var offset0=regionInfo.y*rowSize+(regionInfo.x>>3);var i,j,mask,offset;switch(combinationOperator){case 0:for(i=0;i>=1;if(!mask){mask=128;offset++}}offset0+=rowSize}break;case 2:for(i=0;i>=1;if(!mask){mask=128;offset++}}offset0+=rowSize}break;default:error("JBIG2 error: operator "+combinationOperator+" is not supported")}},onImmediateGenericRegion:function SimpleSegmentVisitor_onImmediateGenericRegion(region,data,start,end){var regionInfo=region.info;var decodingContext=new DecodingContext(data,start,end);var bitmap=decodeBitmap(region.mmr,regionInfo.width,regionInfo.height,region.template,region.prediction,null,region.at,decodingContext);this.drawBitmap(regionInfo,bitmap)},onImmediateLosslessGenericRegion:function SimpleSegmentVisitor_onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function SimpleSegmentVisitor_onSymbolDictionary(dictionary,currentSegment,referredSegments,data,start,end){var huffmanTables;if(dictionary.huffman){error("JBIG2 error: huffman is not supported")}var symbols=this.symbols;if(!symbols){this.symbols=symbols={}}var inputSymbols=[];for(var i=0,ii=referredSegments.length;i>24&255,tbox>>16&255,tbox>>8&255,tbox&255);warn("Unsupported header type "+tbox+" ("+headerType+")");break}if(jumpDataLength){position+=dataLength}}},parseImageProperties:function JpxImage_parseImageProperties(stream){var newByte=stream.getByte();while(newByte>=0){var oldByte=newByte;newByte=stream.getByte();var code=oldByte<<8|newByte;if(code===65361){stream.skip(4);var Xsiz=stream.getInt32()>>>0;var Ysiz=stream.getInt32()>>>0;var XOsiz=stream.getInt32()>>>0;var YOsiz=stream.getInt32()>>>0;stream.skip(16);var Csiz=stream.getUint16();this.width=Xsiz-XOsiz;this.height=Ysiz-YOsiz;this.componentsCount=Csiz;this.bitsPerComponent=8;return}}throw new Error("JPX Error: No size marker found in JPX stream")},parseCodestream:function JpxImage_parseCodestream(data,start,end){var context={};try{var doNotRecover=false;var position=start;while(position+1>5;spqcds=[];while(j>3;spqcd.mu=0}else{spqcd.epsilon=data[j]>>3;spqcd.mu=(data[j]&7)<<8|data[j+1];j+=2}spqcds.push(spqcd)}qcd.SPqcds=spqcds;if(context.mainHeader){context.QCD=qcd}else{context.currentTile.QCD=qcd;context.currentTile.QCC=[]}break;case 65373:length=readUint16(data,position);var qcc={};j=position+2;var cqcc;if(context.SIZ.Csiz<257){cqcc=data[j++]}else{cqcc=readUint16(data,j);j+=2}sqcd=data[j++];switch(sqcd&31){case 0:spqcdSize=8;scalarExpounded=true;break;case 1:spqcdSize=16;scalarExpounded=false;break;case 2:spqcdSize=16;scalarExpounded=true;break;default:throw new Error("JPX Error: Invalid SQcd value "+sqcd)}qcc.noQuantization=spqcdSize===8;qcc.scalarExpounded=scalarExpounded;qcc.guardBits=sqcd>>5;spqcds=[];while(j>3;spqcd.mu=0}else{spqcd.epsilon=data[j]>>3;spqcd.mu=(data[j]&7)<<8|data[j+1];j+=2}spqcds.push(spqcd)}qcc.SPqcds=spqcds;if(context.mainHeader){context.QCC[cqcc]=qcc}else{context.currentTile.QCC[cqcc]=qcc}break;case 65362:length=readUint16(data,position);var cod={};j=position+2;var scod=data[j++];cod.entropyCoderWithCustomPrecincts=!!(scod&1);cod.sopMarkerUsed=!!(scod&2);cod.ephMarkerUsed=!!(scod&4);cod.progressionOrder=data[j++];cod.layersCount=readUint16(data,j);j+=2;cod.multipleComponentTransform=data[j++];cod.decompositionLevelsCount=data[j++];cod.xcb=(data[j++]&15)+2;cod.ycb=(data[j++]&15)+2;var blockStyle=data[j++];cod.selectiveArithmeticCodingBypass=!!(blockStyle&1);cod.resetContextProbabilities=!!(blockStyle&2);cod.terminationOnEachCodingPass=!!(blockStyle&4);cod.verticalyStripe=!!(blockStyle&8);cod.predictableTermination=!!(blockStyle&16);cod.segmentationSymbolUsed=!!(blockStyle&32);cod.reversibleTransformation=data[j++];if(cod.entropyCoderWithCustomPrecincts){var precinctsSizes=[];while(j>4})}cod.precinctsSizes=precinctsSizes}var unsupported=[];if(cod.selectiveArithmeticCodingBypass){unsupported.push("selectiveArithmeticCodingBypass")}if(cod.resetContextProbabilities){unsupported.push("resetContextProbabilities")}if(cod.terminationOnEachCodingPass){unsupported.push("terminationOnEachCodingPass")}if(cod.verticalyStripe){unsupported.push("verticalyStripe")}if(cod.predictableTermination){unsupported.push("predictableTermination")}if(unsupported.length>0){doNotRecover=true;throw new Error("JPX Error: Unsupported COD options ("+unsupported.join(", ")+")")}if(context.mainHeader){context.COD=cod}else{context.currentTile.COD=cod;context.currentTile.COC=[]}break;case 65424:length=readUint16(data,position);tile={};tile.index=readUint16(data,position+2);tile.length=readUint32(data,position+4);tile.dataEnd=tile.length+position-2;tile.partIndex=data[position+8];tile.partsCount=data[position+9];context.mainHeader=false;if(tile.partIndex===0){tile.COD=context.COD;tile.COC=context.COC.slice(0);tile.QCD=context.QCD;tile.QCC=context.QCC.slice(0)}context.currentTile=tile;break;case 65427:tile=context.currentTile;if(tile.partIndex===0){initializeTile(context,tile.index);buildPackets(context)}length=tile.dataEnd-position;parseTilePackets(context,data,position,length);break;case 65365:case 65367:case 65368:case 65380:length=readUint16(data,position);break;case 65363:throw new Error("JPX Error: Codestream code 0xFF53 (COC) is "+"not implemented");default:throw new Error("JPX Error: Unknown codestream code: "+code.toString(16))}position+=length}}catch(e){if(doNotRecover||this.failOnCorruptedImage){throw e}else{warn("Trying to recover from "+e.message)}}this.tiles=transformComponents(context);this.width=context.SIZ.Xsiz-context.SIZ.XOsiz;this.height=context.SIZ.Ysiz-context.SIZ.YOsiz;this.componentsCount=context.SIZ.Csiz}};function calculateComponentDimensions(component,siz){component.x0=Math.ceil(siz.XOsiz/component.XRsiz);component.x1=Math.ceil(siz.Xsiz/component.XRsiz);component.y0=Math.ceil(siz.YOsiz/component.YRsiz);component.y1=Math.ceil(siz.Ysiz/component.YRsiz);component.width=component.x1-component.x0;component.height=component.y1-component.y0}function calculateTileGrids(context,components){var siz=context.SIZ;var tile,tiles=[];var numXtiles=Math.ceil((siz.Xsiz-siz.XTOsiz)/siz.XTsiz);var numYtiles=Math.ceil((siz.Ysiz-siz.YTOsiz)/siz.YTsiz);for(var q=0;q0?Math.min(codOrCoc.xcb,result.PPx-1):Math.min(codOrCoc.xcb,result.PPx);result.ycb_=r>0?Math.min(codOrCoc.ycb,result.PPy-1):Math.min(codOrCoc.ycb,result.PPy);return result}function buildPrecincts(context,resolution,dimensions){var precinctWidth=1<resolution.trx0?Math.ceil(resolution.trx1/precinctWidth)-Math.floor(resolution.trx0/precinctWidth):0;var numprecinctshigh=resolution.try1>resolution.try0?Math.ceil(resolution.try1/precinctHeight)-Math.floor(resolution.try0/precinctHeight):0;var numprecincts=numprecinctswide*numprecinctshigh;resolution.precinctParameters={precinctWidth:precinctWidth,precinctHeight:precinctHeight,numprecinctswide:numprecinctswide,numprecinctshigh:numprecinctshigh,numprecincts:numprecincts,precinctWidthInSubband:precinctWidthInSubband,precinctHeightInSubband:precinctHeightInSubband}}function buildCodeblocks(context,subband,dimensions){var xcb_=dimensions.xcb_;var ycb_=dimensions.ycb_;var codeblockWidth=1<>xcb_;var cby0=subband.tby0>>ycb_;var cbx1=subband.tbx1+codeblockWidth-1>>xcb_;var cby1=subband.tby1+codeblockHeight-1>>ycb_;var precinctParameters=subband.resolution.precinctParameters;var codeblocks=[];var precincts=[];var i,j,codeblock,precinctNumber;for(j=cby0;jprecinct.cbxMax){precinct.cbxMax=i}if(jprecinct.cbyMax){precinct.cbyMax=j}}else{precincts[precinctNumber]=precinct={cbxMin:i,cbyMin:j,cbxMax:i,cbyMax:j}}codeblock.precinct=precinct}}subband.codeblockParameters={codeblockWidth:xcb_,codeblockHeight:ycb_,numcodeblockwide:cbx1-cbx0+1,numcodeblockhigh:cby1-cby0+1};subband.codeblocks=codeblocks;subband.precincts=precincts}function createPacket(resolution,precinctNumber,layerNumber){var precinctCodeblocks=[];var subbands=resolution.subbands;for(var i=0,ii=subbands.length;icomponent.codingStyleParameters.decompositionLevelsCount){continue}var resolution=component.resolutions[r];var numprecincts=resolution.precinctParameters.numprecincts;for(;kcomponent.codingStyleParameters.decompositionLevelsCount){continue}var resolution=component.resolutions[r];var numprecincts=resolution.precinctParameters.numprecincts;for(;kcomponent.codingStyleParameters.decompositionLevelsCount){continue}var resolution=component.resolutions[r];var numprecincts=resolution.precinctParameters.numprecincts;if(p>=numprecincts){continue}for(;l=0;--r){var resolution=component.resolutions[r];var widthCurrentResolution=scale*resolution.precinctParameters.precinctWidth;var heightCurrentResolution=scale*resolution.precinctParameters.precinctHeight;minWidthCurrentComponent=Math.min(minWidthCurrentComponent,widthCurrentResolution);minHeightCurrentComponent=Math.min(minHeightCurrentComponent,heightCurrentResolution);maxNumWideCurrentComponent=Math.max(maxNumWideCurrentComponent,resolution.precinctParameters.numprecinctswide);maxNumHighCurrentComponent=Math.max(maxNumHighCurrentComponent,resolution.precinctParameters.numprecinctshigh);sizePerResolution[r]={width:widthCurrentResolution,height:heightCurrentResolution};scale<<=1}minWidth=Math.min(minWidth,minWidthCurrentComponent);minHeight=Math.min(minHeight,minHeightCurrentComponent);maxNumWide=Math.max(maxNumWide,maxNumWideCurrentComponent);maxNumHigh=Math.max(maxNumHigh,maxNumHighCurrentComponent);sizePerComponent[c]={resolutions:sizePerResolution,minWidth:minWidthCurrentComponent,minHeight:minHeightCurrentComponent,maxNumWide:maxNumWideCurrentComponent,maxNumHigh:maxNumHighCurrentComponent}}return{components:sizePerComponent,minWidth:minWidth,minHeight:minHeight,maxNumWide:maxNumWide,maxNumHigh:maxNumHigh}}function buildPackets(context){var siz=context.SIZ;var tileIndex=context.currentTile.index;var tile=context.tiles[tileIndex];var componentsCount=siz.Csiz;for(var c=0;c>>bufferSize&(1<0){var packetItem=queue.shift();codeblock=packetItem.codeblock;if(codeblock["data"]===undefined){codeblock.data=[]}codeblock.data.push({data:data,start:offset+position,end:offset+position+packetItem.dataLength,codingpasses:packetItem.codingpasses});position+=packetItem.dataLength}}return position}function copyCoefficients(coefficients,levelWidth,levelHeight,subband,delta,mb,reversible,segmentationSymbolUsed){var x0=subband.tbx0;var y0=subband.tby0;var width=subband.tbx1-subband.tbx0;var codeblocks=subband.codeblocks;var right=subband.type.charAt(0)==="H"?1:0;var bottom=subband.type.charAt(1)==="H"?levelWidth:0;for(var i=0,ii=codeblocks.length;i=mb){coefficients[pos]=n}else{coefficients[pos]=n*(1<0?1-i:0)}else{mu=spqcds[b].mu;epsilon=spqcds[b].epsilon;b++}var subband=resolution.subbands[j];var gainLog2=SubbandsGainLog2[subband.type];var delta=reversible?1:Math.pow(2,precision+gainLog2-epsilon)*(1+mu/2048);var mb=guardBits+epsilon-1;copyCoefficients(coefficients,width,height,subband,delta,mb,reversible,segmentationSymbolUsed)}subbandCoefficients.push({width:width,height:height,items:coefficients})}var result=transform.calculate(subbandCoefficients,component.tcx0,component.tcy0);return{left:component.tcx0,top:component.tcy0,width:result.width,height:result.height,items:result.items}}function transformComponents(context){var siz=context.SIZ;var components=context.components;var componentsCount=siz.Csiz;var resultImages=[];for(var i=0,ii=context.tiles.length;i=max?255:r>>shift;out[pos++]=g<=0?0:g>=max?255:g>>shift;out[pos++]=b<=0?0:b>=max?255:b>>shift}}else{for(j=0;j>2);r=g+y2;b=g+y1;out[pos++]=r<=0?0:r>=max?255:r>>shift;out[pos++]=g<=0?0:g>=max?255:g>>shift;out[pos++]=b<=0?0:b>=max?255:b>>shift}}if(fourComponents){for(j=0,pos=3;j=maxK?255:k+offset>>shift}}}else{for(c=0;c=max?255:val+offset>>shift;pos+=componentsCount}}}resultImages.push(result)}return resultImages}function initializeTile(context,tileIndex){var siz=context.SIZ;var componentsCount=siz.Csiz;var tile=context.tiles[tileIndex];for(var c=0;c>=1;j>>=1;currentLevel++}currentLevel--;level=this.levels[currentLevel];level.items[level.index]=value;this.currentLevel=currentLevel;delete this.value},incrementValue:function TagTree_incrementValue(){var level=this.levels[this.currentLevel];level.items[level.index]++},nextLevel:function TagTree_nextLevel(){var currentLevel=this.currentLevel;var level=this.levels[currentLevel];var value=level.items[level.index];currentLevel--;if(currentLevel<0){this.value=value;return false}this.currentLevel=currentLevel;level=this.levels[currentLevel];level.items[level.index]=value;return true}};return TagTree}();var InclusionTree=function InclusionTreeClosure(){function InclusionTree(width,height,defaultValue){var levelsLength=log2(Math.max(width,height))+1;this.levels=[];for(var i=0;istopValue){this.currentLevel=currentLevel;this.propagateValues();return false}i>>=1;j>>=1;currentLevel++}this.currentLevel=currentLevel-1;return true},incrementValue:function InclusionTree_incrementValue(stopValue){var level=this.levels[this.currentLevel];level.items[level.index]=stopValue+1;this.propagateValues()},propagateValues:function InclusionTree_propagateValues(){var levelIndex=this.currentLevel;var level=this.levels[levelIndex];var currentValue=level.items[level.index];while(--levelIndex>=0){level=this.levels[levelIndex];level.items[level.index]=currentValue}},nextLevel:function InclusionTree_nextLevel(){var currentLevel=this.currentLevel;var level=this.levels[currentLevel];var value=level.items[level.index];level.items[level.index]=255;currentLevel--;if(currentLevel<0){return false}this.currentLevel=currentLevel;level=this.levels[currentLevel];level.items[level.index]=value;return true}};return InclusionTree}();var BitModel=function BitModelClosure(){var UNIFORM_CONTEXT=17;var RUNLENGTH_CONTEXT=18;var LLAndLHContextsLabel=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]);var HLContextLabel=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]);var HHContextLabel=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);function BitModel(width,height,subband,zeroBitPlanes,mb){this.width=width;this.height=height;this.contextLabelTable=subband==="HH"?HHContextLabel:subband==="HL"?HLContextLabel:LLAndLHContextsLabel;var coefficientCount=width*height;this.neighborsSignificance=new Uint8Array(coefficientCount);this.coefficentsSign=new Uint8Array(coefficientCount);this.coefficentsMagnitude=mb>14?new Uint32Array(coefficientCount):mb>6?new Uint16Array(coefficientCount):new Uint8Array(coefficientCount);this.processingFlags=new Uint8Array(coefficientCount);var bitsDecoded=new Uint8Array(coefficientCount);if(zeroBitPlanes!==0){for(var i=0;i0;var right=column+10){i=index-width;if(left){neighborsSignificance[i-1]+=16}if(right){neighborsSignificance[i+1]+=16}neighborsSignificance[i]+=4}if(row+1=height){break}processingFlags[index]&=processedInverseMask;if(coefficentsMagnitude[index]||!neighborsSignificance[index]){continue}var contextLabel=labels[neighborsSignificance[index]];var decision=decoder.readBit(contexts,contextLabel);if(decision){var sign=this.decodeSignBit(i,j,index);coefficentsSign[index]=sign;coefficentsMagnitude[index]=1;this.setNeighborsSignificance(i,j,index);processingFlags[index]|=firstMagnitudeBitMask}bitsDecoded[index]++;processingFlags[index]|=processedMask}}}},decodeSignBit:function BitModel_decodeSignBit(row,column,index){var width=this.width,height=this.height;var coefficentsMagnitude=this.coefficentsMagnitude;var coefficentsSign=this.coefficentsSign;var contribution,sign0,sign1,significance1;var contextLabel,decoded;significance1=column>0&&coefficentsMagnitude[index-1]!==0;if(column+10&&coefficentsMagnitude[index-width]!==0;if(row+1=0){contextLabel=9+contribution;decoded=this.decoder.readBit(this.contexts,contextLabel)}else{contextLabel=9-contribution;decoded=this.decoder.readBit(this.contexts,contextLabel)^1}return decoded},runMagnitudeRefinementPass:function BitModel_runMagnitudeRefinementPass(){var decoder=this.decoder;var width=this.width,height=this.height;var coefficentsMagnitude=this.coefficentsMagnitude;var neighborsSignificance=this.neighborsSignificance;var contexts=this.contexts;var bitsDecoded=this.bitsDecoded;var processingFlags=this.processingFlags;var processedMask=1;var firstMagnitudeBitMask=2;var length=width*height;var width4=width*4;for(var index0=0,indexNext;index0>1;offset=offset|0;var j,n,current,next;var alpha=-1.586134342059924;var beta=-.052980118572961;var gamma=.882911075530934;var delta=.443506852043971;var K=1.230174104914001;var K_=1/K;j=offset-3;for(n=len+4;n--;j+=2){x[j]*=K_}j=offset-2;current=delta*x[j-1];for(n=len+3;n--;j+=2){next=delta*x[j+1];x[j]=K*x[j]-current-next;if(n--){j+=2;current=delta*x[j+1];x[j]=K*x[j]-current-next}else{break}}j=offset-1;current=gamma*x[j-1];for(n=len+2;n--;j+=2){next=gamma*x[j+1];x[j]-=current+next;if(n--){j+=2;current=gamma*x[j+1];x[j]-=current+next}else{break}}j=offset;current=beta*x[j-1];for(n=len+1;n--;j+=2){next=beta*x[j+1];x[j]-=current+next;if(n--){j+=2;current=beta*x[j+1];x[j]-=current+next}else{break}}if(len!==0){j=offset+1;current=alpha*x[j-1];for(n=len;n--;j+=2){next=alpha*x[j+1];x[j]-=current+next;if(n--){j+=2;current=alpha*x[j+1];x[j]-=current+next}else{break}}}};return IrreversibleTransform}();var ReversibleTransform=function ReversibleTransformClosure(){function ReversibleTransform(){Transform.call(this)}ReversibleTransform.prototype=Object.create(Transform.prototype);ReversibleTransform.prototype.filter=function reversibleTransformFilter(x,offset,length){var len=length>>1;offset=offset|0;var j,n;for(j=offset,n=len+1;n--;j+=2){x[j]-=x[j-1]+x[j+1]+2>>2}for(j=offset+1,n=len;n--;j+=2){x[j]+=x[j-1]+x[j+1]>>1}};return ReversibleTransform}();return JpxImage}();exports.JpxImage=JpxImage});(function(root,factory){{factory(root.pdfjsCoreMetrics={},root.pdfjsSharedUtil)}})(this,function(exports,sharedUtil){var getLookupTableFactory=sharedUtil.getLookupTableFactory;var getMetrics=getLookupTableFactory(function(t){t["Courier"]=600;t["Courier-Bold"]=600;t["Courier-BoldOblique"]=600;t["Courier-Oblique"]=600;t["Helvetica"]=getLookupTableFactory(function(t){t["space"]=278;t["exclam"]=278;t["quotedbl"]=355;t["numbersign"]=556;t["dollar"]=556;t["percent"]=889;t["ampersand"]=667;t["quoteright"]=222;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=389;t["plus"]=584;t["comma"]=278;t["hyphen"]=333;t["period"]=278;t["slash"]=278;t["zero"]=556;t["one"]=556;t["two"]=556;t["three"]=556;t["four"]=556;t["five"]=556;t["six"]=556;t["seven"]=556;t["eight"]=556;t["nine"]=556;t["colon"]=278;t["semicolon"]=278;t["less"]=584;t["equal"]=584;t["greater"]=584;t["question"]=556;t["at"]=1015;t["A"]=667;t["B"]=667;t["C"]=722;t["D"]=722;t["E"]=667;t["F"]=611;t["G"]=778;t["H"]=722;t["I"]=278;t["J"]=500;t["K"]=667;t["L"]=556;t["M"]=833;t["N"]=722;t["O"]=778;t["P"]=667;t["Q"]=778;t["R"]=722;t["S"]=667;t["T"]=611;t["U"]=722;t["V"]=667;t["W"]=944;t["X"]=667;t["Y"]=667;t["Z"]=611;t["bracketleft"]=278;t["backslash"]=278;t["bracketright"]=278;t["asciicircum"]=469;t["underscore"]=556;t["quoteleft"]=222;t["a"]=556;t["b"]=556;t["c"]=500;t["d"]=556;t["e"]=556;t["f"]=278;t["g"]=556;t["h"]=556;t["i"]=222;t["j"]=222;t["k"]=500;t["l"]=222;t["m"]=833;t["n"]=556;t["o"]=556;t["p"]=556;t["q"]=556;t["r"]=333;t["s"]=500;t["t"]=278;t["u"]=556;t["v"]=500;t["w"]=722;t["x"]=500;t["y"]=500;t["z"]=500;t["braceleft"]=334;t["bar"]=260;t["braceright"]=334;t["asciitilde"]=584;t["exclamdown"]=333;t["cent"]=556;t["sterling"]=556;t["fraction"]=167;t["yen"]=556;t["florin"]=556;t["section"]=556;t["currency"]=556;t["quotesingle"]=191;t["quotedblleft"]=333;t["guillemotleft"]=556;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=500;t["fl"]=500;t["endash"]=556;t["dagger"]=556;t["daggerdbl"]=556;t["periodcentered"]=278;t["paragraph"]=537;t["bullet"]=350;t["quotesinglbase"]=222;t["quotedblbase"]=333;t["quotedblright"]=333;t["guillemotright"]=556;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=611;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=1e3;t["ordfeminine"]=370;t["Lslash"]=556;t["Oslash"]=778;t["OE"]=1e3;t["ordmasculine"]=365;t["ae"]=889;t["dotlessi"]=278;t["lslash"]=222;t["oslash"]=611;t["oe"]=944;t["germandbls"]=611;t["Idieresis"]=278;t["eacute"]=556;t["abreve"]=556;t["uhungarumlaut"]=556;t["ecaron"]=556;t["Ydieresis"]=667;t["divide"]=584;t["Yacute"]=667;t["Acircumflex"]=667;t["aacute"]=556;t["Ucircumflex"]=722;t["yacute"]=500;t["scommaaccent"]=500;t["ecircumflex"]=556;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=556;t["Uacute"]=722;t["uogonek"]=556;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=737;t["Emacron"]=667;t["ccaron"]=500;t["aring"]=556;t["Ncommaaccent"]=722;t["lacute"]=222;t["agrave"]=556;t["Tcommaaccent"]=611;t["Cacute"]=722;t["atilde"]=556;t["Edotaccent"]=667;t["scaron"]=500;t["scedilla"]=500;t["iacute"]=278;t["lozenge"]=471;t["Rcaron"]=722;t["Gcommaaccent"]=778;t["ucircumflex"]=556;t["acircumflex"]=556;t["Amacron"]=667;t["rcaron"]=333;t["ccedilla"]=500;t["Zdotaccent"]=611;t["Thorn"]=667;t["Omacron"]=778;t["Racute"]=722;t["Sacute"]=667;t["dcaron"]=643;t["Umacron"]=722;t["uring"]=556;t["threesuperior"]=333;t["Ograve"]=778;t["Agrave"]=667;t["Abreve"]=667;t["multiply"]=584;t["uacute"]=556;t["Tcaron"]=611;t["partialdiff"]=476;t["ydieresis"]=500;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=556;t["edieresis"]=556;t["cacute"]=500;t["nacute"]=556;t["umacron"]=556;t["Ncaron"]=722;t["Iacute"]=278;t["plusminus"]=584;t["brokenbar"]=260;t["registered"]=737;t["Gbreve"]=778;t["Idotaccent"]=278;t["summation"]=600;t["Egrave"]=667;t["racute"]=333;t["omacron"]=556;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=722;t["lcommaaccent"]=222;t["tcaron"]=317;t["eogonek"]=556;t["Uogonek"]=722;t["Aacute"]=667;t["Adieresis"]=667;t["egrave"]=556;t["zacute"]=500;t["iogonek"]=222;t["Oacute"]=778;t["oacute"]=556;t["amacron"]=556;t["sacute"]=500;t["idieresis"]=278;t["Ocircumflex"]=778;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=556;t["twosuperior"]=333;t["Odieresis"]=778;t["mu"]=556;t["igrave"]=278;t["ohungarumlaut"]=556;t["Eogonek"]=667;t["dcroat"]=556;t["threequarters"]=834;t["Scedilla"]=667;t["lcaron"]=299;t["Kcommaaccent"]=667;t["Lacute"]=556;t["trademark"]=1e3;t["edotaccent"]=556;t["Igrave"]=278;t["Imacron"]=278;t["Lcaron"]=556;t["onehalf"]=834;t["lessequal"]=549;t["ocircumflex"]=556;t["ntilde"]=556;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=556;t["gbreve"]=556;t["onequarter"]=834;t["Scaron"]=667;t["Scommaaccent"]=667;t["Ohungarumlaut"]=778;t["degree"]=400;t["ograve"]=556;t["Ccaron"]=722;t["ugrave"]=556;t["radical"]=453;t["Dcaron"]=722;t["rcommaaccent"]=333;t["Ntilde"]=722;t["otilde"]=556;t["Rcommaaccent"]=722;t["Lcommaaccent"]=556;t["Atilde"]=667;t["Aogonek"]=667;t["Aring"]=667;t["Otilde"]=778;t["zdotaccent"]=500;t["Ecaron"]=667;t["Iogonek"]=278;t["kcommaaccent"]=500;t["minus"]=584;t["Icircumflex"]=278;t["ncaron"]=556;t["tcommaaccent"]=278;t["logicalnot"]=584;t["odieresis"]=556;t["udieresis"]=556;t["notequal"]=549;t["gcommaaccent"]=556;t["eth"]=556;t["zcaron"]=500;t["ncommaaccent"]=556;t["onesuperior"]=333;t["imacron"]=278;t["Euro"]=556});t["Helvetica-Bold"]=getLookupTableFactory(function(t){t["space"]=278;t["exclam"]=333;t["quotedbl"]=474;t["numbersign"]=556;t["dollar"]=556;t["percent"]=889;t["ampersand"]=722;t["quoteright"]=278;t["parenleft"]=333;t["parenright"]=333; +t["asterisk"]=389;t["plus"]=584;t["comma"]=278;t["hyphen"]=333;t["period"]=278;t["slash"]=278;t["zero"]=556;t["one"]=556;t["two"]=556;t["three"]=556;t["four"]=556;t["five"]=556;t["six"]=556;t["seven"]=556;t["eight"]=556;t["nine"]=556;t["colon"]=333;t["semicolon"]=333;t["less"]=584;t["equal"]=584;t["greater"]=584;t["question"]=611;t["at"]=975;t["A"]=722;t["B"]=722;t["C"]=722;t["D"]=722;t["E"]=667;t["F"]=611;t["G"]=778;t["H"]=722;t["I"]=278;t["J"]=556;t["K"]=722;t["L"]=611;t["M"]=833;t["N"]=722;t["O"]=778;t["P"]=667;t["Q"]=778;t["R"]=722;t["S"]=667;t["T"]=611;t["U"]=722;t["V"]=667;t["W"]=944;t["X"]=667;t["Y"]=667;t["Z"]=611;t["bracketleft"]=333;t["backslash"]=278;t["bracketright"]=333;t["asciicircum"]=584;t["underscore"]=556;t["quoteleft"]=278;t["a"]=556;t["b"]=611;t["c"]=556;t["d"]=611;t["e"]=556;t["f"]=333;t["g"]=611;t["h"]=611;t["i"]=278;t["j"]=278;t["k"]=556;t["l"]=278;t["m"]=889;t["n"]=611;t["o"]=611;t["p"]=611;t["q"]=611;t["r"]=389;t["s"]=556;t["t"]=333;t["u"]=611;t["v"]=556;t["w"]=778;t["x"]=556;t["y"]=556;t["z"]=500;t["braceleft"]=389;t["bar"]=280;t["braceright"]=389;t["asciitilde"]=584;t["exclamdown"]=333;t["cent"]=556;t["sterling"]=556;t["fraction"]=167;t["yen"]=556;t["florin"]=556;t["section"]=556;t["currency"]=556;t["quotesingle"]=238;t["quotedblleft"]=500;t["guillemotleft"]=556;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=611;t["fl"]=611;t["endash"]=556;t["dagger"]=556;t["daggerdbl"]=556;t["periodcentered"]=278;t["paragraph"]=556;t["bullet"]=350;t["quotesinglbase"]=278;t["quotedblbase"]=500;t["quotedblright"]=500;t["guillemotright"]=556;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=611;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=1e3;t["ordfeminine"]=370;t["Lslash"]=611;t["Oslash"]=778;t["OE"]=1e3;t["ordmasculine"]=365;t["ae"]=889;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=611;t["oe"]=944;t["germandbls"]=611;t["Idieresis"]=278;t["eacute"]=556;t["abreve"]=556;t["uhungarumlaut"]=611;t["ecaron"]=556;t["Ydieresis"]=667;t["divide"]=584;t["Yacute"]=667;t["Acircumflex"]=722;t["aacute"]=556;t["Ucircumflex"]=722;t["yacute"]=556;t["scommaaccent"]=556;t["ecircumflex"]=556;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=556;t["Uacute"]=722;t["uogonek"]=611;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=737;t["Emacron"]=667;t["ccaron"]=556;t["aring"]=556;t["Ncommaaccent"]=722;t["lacute"]=278;t["agrave"]=556;t["Tcommaaccent"]=611;t["Cacute"]=722;t["atilde"]=556;t["Edotaccent"]=667;t["scaron"]=556;t["scedilla"]=556;t["iacute"]=278;t["lozenge"]=494;t["Rcaron"]=722;t["Gcommaaccent"]=778;t["ucircumflex"]=611;t["acircumflex"]=556;t["Amacron"]=722;t["rcaron"]=389;t["ccedilla"]=556;t["Zdotaccent"]=611;t["Thorn"]=667;t["Omacron"]=778;t["Racute"]=722;t["Sacute"]=667;t["dcaron"]=743;t["Umacron"]=722;t["uring"]=611;t["threesuperior"]=333;t["Ograve"]=778;t["Agrave"]=722;t["Abreve"]=722;t["multiply"]=584;t["uacute"]=611;t["Tcaron"]=611;t["partialdiff"]=494;t["ydieresis"]=556;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=556;t["edieresis"]=556;t["cacute"]=556;t["nacute"]=611;t["umacron"]=611;t["Ncaron"]=722;t["Iacute"]=278;t["plusminus"]=584;t["brokenbar"]=280;t["registered"]=737;t["Gbreve"]=778;t["Idotaccent"]=278;t["summation"]=600;t["Egrave"]=667;t["racute"]=389;t["omacron"]=611;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=722;t["lcommaaccent"]=278;t["tcaron"]=389;t["eogonek"]=556;t["Uogonek"]=722;t["Aacute"]=722;t["Adieresis"]=722;t["egrave"]=556;t["zacute"]=500;t["iogonek"]=278;t["Oacute"]=778;t["oacute"]=611;t["amacron"]=556;t["sacute"]=556;t["idieresis"]=278;t["Ocircumflex"]=778;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=611;t["twosuperior"]=333;t["Odieresis"]=778;t["mu"]=611;t["igrave"]=278;t["ohungarumlaut"]=611;t["Eogonek"]=667;t["dcroat"]=611;t["threequarters"]=834;t["Scedilla"]=667;t["lcaron"]=400;t["Kcommaaccent"]=722;t["Lacute"]=611;t["trademark"]=1e3;t["edotaccent"]=556;t["Igrave"]=278;t["Imacron"]=278;t["Lcaron"]=611;t["onehalf"]=834;t["lessequal"]=549;t["ocircumflex"]=611;t["ntilde"]=611;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=556;t["gbreve"]=611;t["onequarter"]=834;t["Scaron"]=667;t["Scommaaccent"]=667;t["Ohungarumlaut"]=778;t["degree"]=400;t["ograve"]=611;t["Ccaron"]=722;t["ugrave"]=611;t["radical"]=549;t["Dcaron"]=722;t["rcommaaccent"]=389;t["Ntilde"]=722;t["otilde"]=611;t["Rcommaaccent"]=722;t["Lcommaaccent"]=611;t["Atilde"]=722;t["Aogonek"]=722;t["Aring"]=722;t["Otilde"]=778;t["zdotaccent"]=500;t["Ecaron"]=667;t["Iogonek"]=278;t["kcommaaccent"]=556;t["minus"]=584;t["Icircumflex"]=278;t["ncaron"]=611;t["tcommaaccent"]=333;t["logicalnot"]=584;t["odieresis"]=611;t["udieresis"]=611;t["notequal"]=549;t["gcommaaccent"]=611;t["eth"]=611;t["zcaron"]=500;t["ncommaaccent"]=611;t["onesuperior"]=333;t["imacron"]=278;t["Euro"]=556});t["Helvetica-BoldOblique"]=getLookupTableFactory(function(t){t["space"]=278;t["exclam"]=333;t["quotedbl"]=474;t["numbersign"]=556;t["dollar"]=556;t["percent"]=889;t["ampersand"]=722;t["quoteright"]=278;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=389;t["plus"]=584;t["comma"]=278;t["hyphen"]=333;t["period"]=278;t["slash"]=278;t["zero"]=556;t["one"]=556;t["two"]=556;t["three"]=556;t["four"]=556;t["five"]=556;t["six"]=556;t["seven"]=556;t["eight"]=556;t["nine"]=556;t["colon"]=333;t["semicolon"]=333;t["less"]=584;t["equal"]=584;t["greater"]=584;t["question"]=611;t["at"]=975;t["A"]=722;t["B"]=722;t["C"]=722;t["D"]=722;t["E"]=667;t["F"]=611;t["G"]=778;t["H"]=722;t["I"]=278;t["J"]=556;t["K"]=722;t["L"]=611;t["M"]=833;t["N"]=722;t["O"]=778;t["P"]=667;t["Q"]=778;t["R"]=722;t["S"]=667;t["T"]=611;t["U"]=722;t["V"]=667;t["W"]=944;t["X"]=667;t["Y"]=667;t["Z"]=611;t["bracketleft"]=333;t["backslash"]=278;t["bracketright"]=333;t["asciicircum"]=584;t["underscore"]=556;t["quoteleft"]=278;t["a"]=556;t["b"]=611;t["c"]=556;t["d"]=611;t["e"]=556;t["f"]=333;t["g"]=611;t["h"]=611;t["i"]=278;t["j"]=278;t["k"]=556;t["l"]=278;t["m"]=889;t["n"]=611;t["o"]=611;t["p"]=611;t["q"]=611;t["r"]=389;t["s"]=556;t["t"]=333;t["u"]=611;t["v"]=556;t["w"]=778;t["x"]=556;t["y"]=556;t["z"]=500;t["braceleft"]=389;t["bar"]=280;t["braceright"]=389;t["asciitilde"]=584;t["exclamdown"]=333;t["cent"]=556;t["sterling"]=556;t["fraction"]=167;t["yen"]=556;t["florin"]=556;t["section"]=556;t["currency"]=556;t["quotesingle"]=238;t["quotedblleft"]=500;t["guillemotleft"]=556;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=611;t["fl"]=611;t["endash"]=556;t["dagger"]=556;t["daggerdbl"]=556;t["periodcentered"]=278;t["paragraph"]=556;t["bullet"]=350;t["quotesinglbase"]=278;t["quotedblbase"]=500;t["quotedblright"]=500;t["guillemotright"]=556;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=611;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=1e3;t["ordfeminine"]=370;t["Lslash"]=611;t["Oslash"]=778;t["OE"]=1e3;t["ordmasculine"]=365;t["ae"]=889;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=611;t["oe"]=944;t["germandbls"]=611;t["Idieresis"]=278;t["eacute"]=556;t["abreve"]=556;t["uhungarumlaut"]=611;t["ecaron"]=556;t["Ydieresis"]=667;t["divide"]=584;t["Yacute"]=667;t["Acircumflex"]=722;t["aacute"]=556;t["Ucircumflex"]=722;t["yacute"]=556;t["scommaaccent"]=556;t["ecircumflex"]=556;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=556;t["Uacute"]=722;t["uogonek"]=611;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=737;t["Emacron"]=667;t["ccaron"]=556;t["aring"]=556;t["Ncommaaccent"]=722;t["lacute"]=278;t["agrave"]=556;t["Tcommaaccent"]=611;t["Cacute"]=722;t["atilde"]=556;t["Edotaccent"]=667;t["scaron"]=556;t["scedilla"]=556;t["iacute"]=278;t["lozenge"]=494;t["Rcaron"]=722;t["Gcommaaccent"]=778;t["ucircumflex"]=611;t["acircumflex"]=556;t["Amacron"]=722;t["rcaron"]=389;t["ccedilla"]=556;t["Zdotaccent"]=611;t["Thorn"]=667;t["Omacron"]=778;t["Racute"]=722;t["Sacute"]=667;t["dcaron"]=743;t["Umacron"]=722;t["uring"]=611;t["threesuperior"]=333;t["Ograve"]=778;t["Agrave"]=722;t["Abreve"]=722;t["multiply"]=584;t["uacute"]=611;t["Tcaron"]=611;t["partialdiff"]=494;t["ydieresis"]=556;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=556;t["edieresis"]=556;t["cacute"]=556;t["nacute"]=611;t["umacron"]=611;t["Ncaron"]=722;t["Iacute"]=278;t["plusminus"]=584;t["brokenbar"]=280;t["registered"]=737;t["Gbreve"]=778;t["Idotaccent"]=278;t["summation"]=600;t["Egrave"]=667;t["racute"]=389;t["omacron"]=611;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=722;t["lcommaaccent"]=278;t["tcaron"]=389;t["eogonek"]=556;t["Uogonek"]=722;t["Aacute"]=722;t["Adieresis"]=722;t["egrave"]=556;t["zacute"]=500;t["iogonek"]=278;t["Oacute"]=778;t["oacute"]=611;t["amacron"]=556;t["sacute"]=556;t["idieresis"]=278;t["Ocircumflex"]=778;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=611;t["twosuperior"]=333;t["Odieresis"]=778;t["mu"]=611;t["igrave"]=278;t["ohungarumlaut"]=611;t["Eogonek"]=667;t["dcroat"]=611;t["threequarters"]=834;t["Scedilla"]=667;t["lcaron"]=400;t["Kcommaaccent"]=722;t["Lacute"]=611;t["trademark"]=1e3;t["edotaccent"]=556;t["Igrave"]=278;t["Imacron"]=278;t["Lcaron"]=611;t["onehalf"]=834;t["lessequal"]=549;t["ocircumflex"]=611;t["ntilde"]=611;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=556;t["gbreve"]=611;t["onequarter"]=834;t["Scaron"]=667;t["Scommaaccent"]=667;t["Ohungarumlaut"]=778;t["degree"]=400;t["ograve"]=611;t["Ccaron"]=722;t["ugrave"]=611;t["radical"]=549;t["Dcaron"]=722;t["rcommaaccent"]=389;t["Ntilde"]=722;t["otilde"]=611;t["Rcommaaccent"]=722;t["Lcommaaccent"]=611;t["Atilde"]=722;t["Aogonek"]=722;t["Aring"]=722;t["Otilde"]=778;t["zdotaccent"]=500;t["Ecaron"]=667;t["Iogonek"]=278;t["kcommaaccent"]=556;t["minus"]=584;t["Icircumflex"]=278;t["ncaron"]=611;t["tcommaaccent"]=333;t["logicalnot"]=584;t["odieresis"]=611;t["udieresis"]=611;t["notequal"]=549;t["gcommaaccent"]=611;t["eth"]=611;t["zcaron"]=500;t["ncommaaccent"]=611;t["onesuperior"]=333;t["imacron"]=278;t["Euro"]=556});t["Helvetica-Oblique"]=getLookupTableFactory(function(t){t["space"]=278;t["exclam"]=278;t["quotedbl"]=355;t["numbersign"]=556;t["dollar"]=556;t["percent"]=889;t["ampersand"]=667;t["quoteright"]=222;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=389;t["plus"]=584;t["comma"]=278;t["hyphen"]=333;t["period"]=278;t["slash"]=278;t["zero"]=556;t["one"]=556;t["two"]=556;t["three"]=556;t["four"]=556;t["five"]=556;t["six"]=556;t["seven"]=556;t["eight"]=556;t["nine"]=556;t["colon"]=278;t["semicolon"]=278;t["less"]=584;t["equal"]=584;t["greater"]=584;t["question"]=556;t["at"]=1015;t["A"]=667;t["B"]=667;t["C"]=722;t["D"]=722;t["E"]=667;t["F"]=611;t["G"]=778;t["H"]=722;t["I"]=278;t["J"]=500;t["K"]=667;t["L"]=556;t["M"]=833;t["N"]=722;t["O"]=778;t["P"]=667;t["Q"]=778;t["R"]=722;t["S"]=667;t["T"]=611;t["U"]=722;t["V"]=667;t["W"]=944;t["X"]=667;t["Y"]=667;t["Z"]=611;t["bracketleft"]=278;t["backslash"]=278;t["bracketright"]=278;t["asciicircum"]=469;t["underscore"]=556;t["quoteleft"]=222;t["a"]=556;t["b"]=556;t["c"]=500;t["d"]=556;t["e"]=556;t["f"]=278;t["g"]=556;t["h"]=556;t["i"]=222;t["j"]=222;t["k"]=500;t["l"]=222;t["m"]=833;t["n"]=556;t["o"]=556;t["p"]=556;t["q"]=556;t["r"]=333;t["s"]=500;t["t"]=278;t["u"]=556;t["v"]=500;t["w"]=722;t["x"]=500;t["y"]=500;t["z"]=500;t["braceleft"]=334;t["bar"]=260;t["braceright"]=334;t["asciitilde"]=584;t["exclamdown"]=333;t["cent"]=556;t["sterling"]=556;t["fraction"]=167;t["yen"]=556;t["florin"]=556;t["section"]=556;t["currency"]=556;t["quotesingle"]=191;t["quotedblleft"]=333;t["guillemotleft"]=556;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=500;t["fl"]=500;t["endash"]=556;t["dagger"]=556;t["daggerdbl"]=556;t["periodcentered"]=278;t["paragraph"]=537;t["bullet"]=350;t["quotesinglbase"]=222;t["quotedblbase"]=333;t["quotedblright"]=333;t["guillemotright"]=556;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=611;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=1e3;t["ordfeminine"]=370;t["Lslash"]=556;t["Oslash"]=778;t["OE"]=1e3;t["ordmasculine"]=365;t["ae"]=889;t["dotlessi"]=278;t["lslash"]=222;t["oslash"]=611;t["oe"]=944;t["germandbls"]=611;t["Idieresis"]=278;t["eacute"]=556;t["abreve"]=556;t["uhungarumlaut"]=556;t["ecaron"]=556;t["Ydieresis"]=667;t["divide"]=584;t["Yacute"]=667;t["Acircumflex"]=667;t["aacute"]=556;t["Ucircumflex"]=722;t["yacute"]=500;t["scommaaccent"]=500;t["ecircumflex"]=556;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=556;t["Uacute"]=722;t["uogonek"]=556;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=737;t["Emacron"]=667;t["ccaron"]=500;t["aring"]=556;t["Ncommaaccent"]=722;t["lacute"]=222;t["agrave"]=556;t["Tcommaaccent"]=611;t["Cacute"]=722;t["atilde"]=556;t["Edotaccent"]=667;t["scaron"]=500;t["scedilla"]=500;t["iacute"]=278;t["lozenge"]=471;t["Rcaron"]=722;t["Gcommaaccent"]=778;t["ucircumflex"]=556;t["acircumflex"]=556;t["Amacron"]=667;t["rcaron"]=333;t["ccedilla"]=500;t["Zdotaccent"]=611;t["Thorn"]=667;t["Omacron"]=778;t["Racute"]=722;t["Sacute"]=667;t["dcaron"]=643;t["Umacron"]=722;t["uring"]=556;t["threesuperior"]=333;t["Ograve"]=778;t["Agrave"]=667;t["Abreve"]=667;t["multiply"]=584;t["uacute"]=556;t["Tcaron"]=611;t["partialdiff"]=476;t["ydieresis"]=500;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=556;t["edieresis"]=556;t["cacute"]=500;t["nacute"]=556;t["umacron"]=556;t["Ncaron"]=722;t["Iacute"]=278;t["plusminus"]=584;t["brokenbar"]=260;t["registered"]=737;t["Gbreve"]=778;t["Idotaccent"]=278;t["summation"]=600;t["Egrave"]=667;t["racute"]=333;t["omacron"]=556;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=722;t["lcommaaccent"]=222;t["tcaron"]=317;t["eogonek"]=556;t["Uogonek"]=722;t["Aacute"]=667;t["Adieresis"]=667;t["egrave"]=556;t["zacute"]=500;t["iogonek"]=222;t["Oacute"]=778;t["oacute"]=556;t["amacron"]=556;t["sacute"]=500;t["idieresis"]=278;t["Ocircumflex"]=778;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=556;t["twosuperior"]=333;t["Odieresis"]=778;t["mu"]=556;t["igrave"]=278;t["ohungarumlaut"]=556;t["Eogonek"]=667;t["dcroat"]=556;t["threequarters"]=834;t["Scedilla"]=667;t["lcaron"]=299;t["Kcommaaccent"]=667;t["Lacute"]=556;t["trademark"]=1e3;t["edotaccent"]=556;t["Igrave"]=278;t["Imacron"]=278;t["Lcaron"]=556;t["onehalf"]=834;t["lessequal"]=549;t["ocircumflex"]=556;t["ntilde"]=556;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=556;t["gbreve"]=556;t["onequarter"]=834;t["Scaron"]=667;t["Scommaaccent"]=667;t["Ohungarumlaut"]=778;t["degree"]=400;t["ograve"]=556;t["Ccaron"]=722;t["ugrave"]=556;t["radical"]=453;t["Dcaron"]=722;t["rcommaaccent"]=333;t["Ntilde"]=722;t["otilde"]=556;t["Rcommaaccent"]=722;t["Lcommaaccent"]=556;t["Atilde"]=667;t["Aogonek"]=667;t["Aring"]=667;t["Otilde"]=778;t["zdotaccent"]=500;t["Ecaron"]=667;t["Iogonek"]=278;t["kcommaaccent"]=500;t["minus"]=584;t["Icircumflex"]=278;t["ncaron"]=556;t["tcommaaccent"]=278;t["logicalnot"]=584;t["odieresis"]=556;t["udieresis"]=556;t["notequal"]=549;t["gcommaaccent"]=556;t["eth"]=556;t["zcaron"]=500;t["ncommaaccent"]=556;t["onesuperior"]=333;t["imacron"]=278;t["Euro"]=556});t["Symbol"]=getLookupTableFactory(function(t){t["space"]=250;t["exclam"]=333;t["universal"]=713;t["numbersign"]=500;t["existential"]=549;t["percent"]=833;t["ampersand"]=778;t["suchthat"]=439;t["parenleft"]=333;t["parenright"]=333;t["asteriskmath"]=500;t["plus"]=549;t["comma"]=250;t["minus"]=549;t["period"]=250;t["slash"]=278;t["zero"]=500;t["one"]=500;t["two"]=500;t["three"]=500;t["four"]=500;t["five"]=500;t["six"]=500;t["seven"]=500;t["eight"]=500;t["nine"]=500;t["colon"]=278;t["semicolon"]=278;t["less"]=549;t["equal"]=549;t["greater"]=549;t["question"]=444;t["congruent"]=549;t["Alpha"]=722;t["Beta"]=667;t["Chi"]=722;t["Delta"]=612;t["Epsilon"]=611;t["Phi"]=763;t["Gamma"]=603;t["Eta"]=722;t["Iota"]=333;t["theta1"]=631;t["Kappa"]=722;t["Lambda"]=686;t["Mu"]=889;t["Nu"]=722;t["Omicron"]=722;t["Pi"]=768;t["Theta"]=741;t["Rho"]=556;t["Sigma"]=592;t["Tau"]=611;t["Upsilon"]=690;t["sigma1"]=439;t["Omega"]=768;t["Xi"]=645;t["Psi"]=795;t["Zeta"]=611;t["bracketleft"]=333;t["therefore"]=863;t["bracketright"]=333;t["perpendicular"]=658;t["underscore"]=500;t["radicalex"]=500;t["alpha"]=631;t["beta"]=549;t["chi"]=549;t["delta"]=494;t["epsilon"]=439;t["phi"]=521;t["gamma"]=411;t["eta"]=603;t["iota"]=329;t["phi1"]=603;t["kappa"]=549;t["lambda"]=549;t["mu"]=576;t["nu"]=521;t["omicron"]=549;t["pi"]=549;t["theta"]=521;t["rho"]=549;t["sigma"]=603;t["tau"]=439;t["upsilon"]=576;t["omega1"]=713;t["omega"]=686;t["xi"]=493;t["psi"]=686;t["zeta"]=494;t["braceleft"]=480;t["bar"]=200;t["braceright"]=480;t["similar"]=549;t["Euro"]=750;t["Upsilon1"]=620;t["minute"]=247;t["lessequal"]=549;t["fraction"]=167;t["infinity"]=713;t["florin"]=500;t["club"]=753;t["diamond"]=753;t["heart"]=753;t["spade"]=753;t["arrowboth"]=1042;t["arrowleft"]=987;t["arrowup"]=603;t["arrowright"]=987;t["arrowdown"]=603;t["degree"]=400;t["plusminus"]=549;t["second"]=411;t["greaterequal"]=549;t["multiply"]=549;t["proportional"]=713;t["partialdiff"]=494;t["bullet"]=460;t["divide"]=549;t["notequal"]=549;t["equivalence"]=549;t["approxequal"]=549;t["ellipsis"]=1e3;t["arrowvertex"]=603;t["arrowhorizex"]=1e3;t["carriagereturn"]=658;t["aleph"]=823;t["Ifraktur"]=686;t["Rfraktur"]=795;t["weierstrass"]=987;t["circlemultiply"]=768;t["circleplus"]=768;t["emptyset"]=823;t["intersection"]=768;t["union"]=768;t["propersuperset"]=713;t["reflexsuperset"]=713;t["notsubset"]=713;t["propersubset"]=713;t["reflexsubset"]=713;t["element"]=713;t["notelement"]=713;t["angle"]=768;t["gradient"]=713;t["registerserif"]=790;t["copyrightserif"]=790;t["trademarkserif"]=890;t["product"]=823;t["radical"]=549;t["dotmath"]=250;t["logicalnot"]=713;t["logicaland"]=603;t["logicalor"]=603;t["arrowdblboth"]=1042;t["arrowdblleft"]=987;t["arrowdblup"]=603;t["arrowdblright"]=987;t["arrowdbldown"]=603;t["lozenge"]=494;t["angleleft"]=329;t["registersans"]=790;t["copyrightsans"]=790;t["trademarksans"]=786;t["summation"]=713;t["parenlefttp"]=384;t["parenleftex"]=384;t["parenleftbt"]=384;t["bracketlefttp"]=384;t["bracketleftex"]=384;t["bracketleftbt"]=384;t["bracelefttp"]=494;t["braceleftmid"]=494;t["braceleftbt"]=494;t["braceex"]=494;t["angleright"]=329;t["integral"]=274;t["integraltp"]=686;t["integralex"]=686;t["integralbt"]=686;t["parenrighttp"]=384;t["parenrightex"]=384;t["parenrightbt"]=384;t["bracketrighttp"]=384;t["bracketrightex"]=384;t["bracketrightbt"]=384;t["bracerighttp"]=494;t["bracerightmid"]=494;t["bracerightbt"]=494;t["apple"]=790});t["Times-Roman"]=getLookupTableFactory(function(t){t["space"]=250;t["exclam"]=333;t["quotedbl"]=408;t["numbersign"]=500;t["dollar"]=500;t["percent"]=833;t["ampersand"]=778;t["quoteright"]=333;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=500;t["plus"]=564;t["comma"]=250;t["hyphen"]=333;t["period"]=250;t["slash"]=278;t["zero"]=500;t["one"]=500;t["two"]=500;t["three"]=500;t["four"]=500;t["five"]=500;t["six"]=500;t["seven"]=500;t["eight"]=500;t["nine"]=500;t["colon"]=278;t["semicolon"]=278;t["less"]=564;t["equal"]=564;t["greater"]=564;t["question"]=444;t["at"]=921;t["A"]=722;t["B"]=667;t["C"]=667;t["D"]=722;t["E"]=611;t["F"]=556;t["G"]=722;t["H"]=722;t["I"]=333;t["J"]=389;t["K"]=722;t["L"]=611;t["M"]=889;t["N"]=722;t["O"]=722;t["P"]=556;t["Q"]=722;t["R"]=667;t["S"]=556;t["T"]=611;t["U"]=722;t["V"]=722;t["W"]=944;t["X"]=722;t["Y"]=722;t["Z"]=611;t["bracketleft"]=333;t["backslash"]=278;t["bracketright"]=333;t["asciicircum"]=469;t["underscore"]=500;t["quoteleft"]=333;t["a"]=444;t["b"]=500;t["c"]=444;t["d"]=500;t["e"]=444;t["f"]=333;t["g"]=500;t["h"]=500;t["i"]=278;t["j"]=278;t["k"]=500;t["l"]=278;t["m"]=778;t["n"]=500;t["o"]=500;t["p"]=500;t["q"]=500;t["r"]=333;t["s"]=389;t["t"]=278;t["u"]=500;t["v"]=500;t["w"]=722;t["x"]=500;t["y"]=500;t["z"]=444;t["braceleft"]=480;t["bar"]=200;t["braceright"]=480;t["asciitilde"]=541;t["exclamdown"]=333;t["cent"]=500;t["sterling"]=500;t["fraction"]=167;t["yen"]=500;t["florin"]=500;t["section"]=500;t["currency"]=500;t["quotesingle"]=180;t["quotedblleft"]=444;t["guillemotleft"]=500;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=556;t["fl"]=556;t["endash"]=500;t["dagger"]=500;t["daggerdbl"]=500;t["periodcentered"]=250;t["paragraph"]=453;t["bullet"]=350;t["quotesinglbase"]=333;t["quotedblbase"]=444;t["quotedblright"]=444;t["guillemotright"]=500;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=444;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=889;t["ordfeminine"]=276;t["Lslash"]=611;t["Oslash"]=722;t["OE"]=889;t["ordmasculine"]=310;t["ae"]=667;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=500;t["oe"]=722;t["germandbls"]=500;t["Idieresis"]=333;t["eacute"]=444;t["abreve"]=444;t["uhungarumlaut"]=500;t["ecaron"]=444;t["Ydieresis"]=722;t["divide"]=564;t["Yacute"]=722;t["Acircumflex"]=722;t["aacute"]=444;t["Ucircumflex"]=722;t["yacute"]=500;t["scommaaccent"]=389;t["ecircumflex"]=444;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=444;t["Uacute"]=722;t["uogonek"]=500;t["Edieresis"]=611;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=760;t["Emacron"]=611;t["ccaron"]=444;t["aring"]=444;t["Ncommaaccent"]=722;t["lacute"]=278;t["agrave"]=444;t["Tcommaaccent"]=611;t["Cacute"]=667;t["atilde"]=444;t["Edotaccent"]=611;t["scaron"]=389;t["scedilla"]=389;t["iacute"]=278;t["lozenge"]=471;t["Rcaron"]=667;t["Gcommaaccent"]=722;t["ucircumflex"]=500;t["acircumflex"]=444;t["Amacron"]=722;t["rcaron"]=333;t["ccedilla"]=444;t["Zdotaccent"]=611;t["Thorn"]=556;t["Omacron"]=722;t["Racute"]=667;t["Sacute"]=556;t["dcaron"]=588;t["Umacron"]=722;t["uring"]=500;t["threesuperior"]=300;t["Ograve"]=722;t["Agrave"]=722;t["Abreve"]=722;t["multiply"]=564;t["uacute"]=500;t["Tcaron"]=611;t["partialdiff"]=476;t["ydieresis"]=500;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=611;t["adieresis"]=444;t["edieresis"]=444;t["cacute"]=444;t["nacute"]=500;t["umacron"]=500;t["Ncaron"]=722;t["Iacute"]=333;t["plusminus"]=564;t["brokenbar"]=200;t["registered"]=760;t["Gbreve"]=722;t["Idotaccent"]=333;t["summation"]=600;t["Egrave"]=611;t["racute"]=333;t["omacron"]=500;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=667;t["lcommaaccent"]=278;t["tcaron"]=326;t["eogonek"]=444;t["Uogonek"]=722;t["Aacute"]=722;t["Adieresis"]=722;t["egrave"]=444;t["zacute"]=444;t["iogonek"]=278;t["Oacute"]=722;t["oacute"]=500;t["amacron"]=444;t["sacute"]=389;t["idieresis"]=278;t["Ocircumflex"]=722;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=500;t["twosuperior"]=300;t["Odieresis"]=722;t["mu"]=500;t["igrave"]=278;t["ohungarumlaut"]=500;t["Eogonek"]=611;t["dcroat"]=500;t["threequarters"]=750;t["Scedilla"]=556;t["lcaron"]=344;t["Kcommaaccent"]=722;t["Lacute"]=611;t["trademark"]=980;t["edotaccent"]=444;t["Igrave"]=333;t["Imacron"]=333;t["Lcaron"]=611;t["onehalf"]=750;t["lessequal"]=549;t["ocircumflex"]=500;t["ntilde"]=500;t["Uhungarumlaut"]=722;t["Eacute"]=611;t["emacron"]=444;t["gbreve"]=500;t["onequarter"]=750;t["Scaron"]=556;t["Scommaaccent"]=556;t["Ohungarumlaut"]=722;t["degree"]=400;t["ograve"]=500;t["Ccaron"]=667;t["ugrave"]=500;t["radical"]=453;t["Dcaron"]=722;t["rcommaaccent"]=333;t["Ntilde"]=722;t["otilde"]=500;t["Rcommaaccent"]=667;t["Lcommaaccent"]=611;t["Atilde"]=722;t["Aogonek"]=722;t["Aring"]=722;t["Otilde"]=722;t["zdotaccent"]=444;t["Ecaron"]=611;t["Iogonek"]=333;t["kcommaaccent"]=500;t["minus"]=564;t["Icircumflex"]=333;t["ncaron"]=500;t["tcommaaccent"]=278;t["logicalnot"]=564;t["odieresis"]=500;t["udieresis"]=500;t["notequal"]=549;t["gcommaaccent"]=500;t["eth"]=500;t["zcaron"]=444;t["ncommaaccent"]=500;t["onesuperior"]=300;t["imacron"]=278;t["Euro"]=500});t["Times-Bold"]=getLookupTableFactory(function(t){t["space"]=250;t["exclam"]=333;t["quotedbl"]=555;t["numbersign"]=500;t["dollar"]=500;t["percent"]=1e3;t["ampersand"]=833;t["quoteright"]=333;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=500;t["plus"]=570;t["comma"]=250;t["hyphen"]=333;t["period"]=250;t["slash"]=278;t["zero"]=500;t["one"]=500;t["two"]=500;t["three"]=500;t["four"]=500;t["five"]=500;t["six"]=500;t["seven"]=500;t["eight"]=500;t["nine"]=500;t["colon"]=333;t["semicolon"]=333;t["less"]=570;t["equal"]=570;t["greater"]=570;t["question"]=500;t["at"]=930;t["A"]=722;t["B"]=667;t["C"]=722;t["D"]=722;t["E"]=667;t["F"]=611;t["G"]=778;t["H"]=778;t["I"]=389;t["J"]=500;t["K"]=778;t["L"]=667;t["M"]=944;t["N"]=722;t["O"]=778;t["P"]=611;t["Q"]=778;t["R"]=722;t["S"]=556;t["T"]=667;t["U"]=722;t["V"]=722;t["W"]=1e3;t["X"]=722;t["Y"]=722;t["Z"]=667;t["bracketleft"]=333;t["backslash"]=278;t["bracketright"]=333;t["asciicircum"]=581;t["underscore"]=500;t["quoteleft"]=333;t["a"]=500;t["b"]=556;t["c"]=444;t["d"]=556;t["e"]=444;t["f"]=333;t["g"]=500;t["h"]=556;t["i"]=278;t["j"]=333;t["k"]=556;t["l"]=278;t["m"]=833;t["n"]=556;t["o"]=500;t["p"]=556;t["q"]=556;t["r"]=444;t["s"]=389;t["t"]=333;t["u"]=556;t["v"]=500;t["w"]=722;t["x"]=500;t["y"]=500;t["z"]=444;t["braceleft"]=394;t["bar"]=220;t["braceright"]=394;t["asciitilde"]=520;t["exclamdown"]=333;t["cent"]=500;t["sterling"]=500;t["fraction"]=167;t["yen"]=500;t["florin"]=500;t["section"]=500;t["currency"]=500;t["quotesingle"]=278;t["quotedblleft"]=500;t["guillemotleft"]=500;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=556;t["fl"]=556;t["endash"]=500;t["dagger"]=500;t["daggerdbl"]=500;t["periodcentered"]=250;t["paragraph"]=540;t["bullet"]=350;t["quotesinglbase"]=333;t["quotedblbase"]=500;t["quotedblright"]=500;t["guillemotright"]=500;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=500;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=1e3;t["ordfeminine"]=300;t["Lslash"]=667;t["Oslash"]=778;t["OE"]=1e3;t["ordmasculine"]=330;t["ae"]=722;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=500;t["oe"]=722;t["germandbls"]=556;t["Idieresis"]=389;t["eacute"]=444;t["abreve"]=500;t["uhungarumlaut"]=556;t["ecaron"]=444;t["Ydieresis"]=722;t["divide"]=570;t["Yacute"]=722;t["Acircumflex"]=722;t["aacute"]=500;t["Ucircumflex"]=722;t["yacute"]=500;t["scommaaccent"]=389;t["ecircumflex"]=444;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=500;t["Uacute"]=722;t["uogonek"]=556;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=747;t["Emacron"]=667;t["ccaron"]=444;t["aring"]=500;t["Ncommaaccent"]=722;t["lacute"]=278;t["agrave"]=500;t["Tcommaaccent"]=667;t["Cacute"]=722;t["atilde"]=500;t["Edotaccent"]=667;t["scaron"]=389;t["scedilla"]=389;t["iacute"]=278;t["lozenge"]=494;t["Rcaron"]=722;t["Gcommaaccent"]=778;t["ucircumflex"]=556;t["acircumflex"]=500;t["Amacron"]=722;t["rcaron"]=444;t["ccedilla"]=444;t["Zdotaccent"]=667;t["Thorn"]=611;t["Omacron"]=778;t["Racute"]=722;t["Sacute"]=556;t["dcaron"]=672;t["Umacron"]=722;t["uring"]=556;t["threesuperior"]=300;t["Ograve"]=778;t["Agrave"]=722;t["Abreve"]=722;t["multiply"]=570;t["uacute"]=556;t["Tcaron"]=667;t["partialdiff"]=494;t["ydieresis"]=500;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=500;t["edieresis"]=444;t["cacute"]=444;t["nacute"]=556;t["umacron"]=556;t["Ncaron"]=722;t["Iacute"]=389;t["plusminus"]=570;t["brokenbar"]=220;t["registered"]=747;t["Gbreve"]=778;t["Idotaccent"]=389;t["summation"]=600;t["Egrave"]=667;t["racute"]=444;t["omacron"]=500;t["Zacute"]=667;t["Zcaron"]=667;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=722;t["lcommaaccent"]=278;t["tcaron"]=416;t["eogonek"]=444;t["Uogonek"]=722;t["Aacute"]=722;t["Adieresis"]=722;t["egrave"]=444;t["zacute"]=444;t["iogonek"]=278;t["Oacute"]=778;t["oacute"]=500;t["amacron"]=500;t["sacute"]=389;t["idieresis"]=278;t["Ocircumflex"]=778;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=556;t["twosuperior"]=300;t["Odieresis"]=778;t["mu"]=556;t["igrave"]=278;t["ohungarumlaut"]=500;t["Eogonek"]=667;t["dcroat"]=556;t["threequarters"]=750;t["Scedilla"]=556;t["lcaron"]=394;t["Kcommaaccent"]=778;t["Lacute"]=667;t["trademark"]=1e3;t["edotaccent"]=444;t["Igrave"]=389;t["Imacron"]=389;t["Lcaron"]=667;t["onehalf"]=750;t["lessequal"]=549;t["ocircumflex"]=500;t["ntilde"]=556;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=444;t["gbreve"]=500;t["onequarter"]=750;t["Scaron"]=556;t["Scommaaccent"]=556;t["Ohungarumlaut"]=778;t["degree"]=400;t["ograve"]=500;t["Ccaron"]=722;t["ugrave"]=556;t["radical"]=549;t["Dcaron"]=722;t["rcommaaccent"]=444;t["Ntilde"]=722;t["otilde"]=500;t["Rcommaaccent"]=722;t["Lcommaaccent"]=667;t["Atilde"]=722;t["Aogonek"]=722;t["Aring"]=722;t["Otilde"]=778;t["zdotaccent"]=444;t["Ecaron"]=667;t["Iogonek"]=389;t["kcommaaccent"]=556;t["minus"]=570;t["Icircumflex"]=389;t["ncaron"]=556;t["tcommaaccent"]=333;t["logicalnot"]=570;t["odieresis"]=500;t["udieresis"]=556;t["notequal"]=549;t["gcommaaccent"]=500;t["eth"]=500;t["zcaron"]=444;t["ncommaaccent"]=556;t["onesuperior"]=300;t["imacron"]=278;t["Euro"]=500});t["Times-BoldItalic"]=getLookupTableFactory(function(t){t["space"]=250;t["exclam"]=389;t["quotedbl"]=555;t["numbersign"]=500;t["dollar"]=500;t["percent"]=833;t["ampersand"]=778;t["quoteright"]=333;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=500;t["plus"]=570;t["comma"]=250;t["hyphen"]=333;t["period"]=250;t["slash"]=278;t["zero"]=500;t["one"]=500;t["two"]=500;t["three"]=500;t["four"]=500;t["five"]=500;t["six"]=500;t["seven"]=500;t["eight"]=500;t["nine"]=500;t["colon"]=333;t["semicolon"]=333;t["less"]=570;t["equal"]=570;t["greater"]=570;t["question"]=500;t["at"]=832;t["A"]=667;t["B"]=667;t["C"]=667;t["D"]=722;t["E"]=667;t["F"]=667;t["G"]=722;t["H"]=778;t["I"]=389;t["J"]=500;t["K"]=667;t["L"]=611;t["M"]=889;t["N"]=722;t["O"]=722;t["P"]=611;t["Q"]=722;t["R"]=667;t["S"]=556;t["T"]=611;t["U"]=722;t["V"]=667;t["W"]=889;t["X"]=667;t["Y"]=611;t["Z"]=611;t["bracketleft"]=333;t["backslash"]=278;t["bracketright"]=333;t["asciicircum"]=570;t["underscore"]=500;t["quoteleft"]=333;t["a"]=500;t["b"]=500;t["c"]=444;t["d"]=500;t["e"]=444;t["f"]=333;t["g"]=500;t["h"]=556;t["i"]=278;t["j"]=278;t["k"]=500;t["l"]=278;t["m"]=778;t["n"]=556;t["o"]=500;t["p"]=500;t["q"]=500;t["r"]=389;t["s"]=389;t["t"]=278;t["u"]=556;t["v"]=444;t["w"]=667;t["x"]=500;t["y"]=444;t["z"]=389;t["braceleft"]=348;t["bar"]=220;t["braceright"]=348;t["asciitilde"]=570;t["exclamdown"]=389;t["cent"]=500;t["sterling"]=500;t["fraction"]=167;t["yen"]=500;t["florin"]=500;t["section"]=500;t["currency"]=500;t["quotesingle"]=278;t["quotedblleft"]=500;t["guillemotleft"]=500;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=556;t["fl"]=556;t["endash"]=500;t["dagger"]=500;t["daggerdbl"]=500;t["periodcentered"]=250;t["paragraph"]=500;t["bullet"]=350;t["quotesinglbase"]=333;t["quotedblbase"]=500;t["quotedblright"]=500;t["guillemotright"]=500;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=500;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=944;t["ordfeminine"]=266;t["Lslash"]=611;t["Oslash"]=722;t["OE"]=944;t["ordmasculine"]=300;t["ae"]=722;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=500;t["oe"]=722;t["germandbls"]=500;t["Idieresis"]=389;t["eacute"]=444;t["abreve"]=500;t["uhungarumlaut"]=556;t["ecaron"]=444;t["Ydieresis"]=611;t["divide"]=570;t["Yacute"]=611;t["Acircumflex"]=667;t["aacute"]=500;t["Ucircumflex"]=722;t["yacute"]=444; +t["scommaaccent"]=389;t["ecircumflex"]=444;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=500;t["Uacute"]=722;t["uogonek"]=556;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=747;t["Emacron"]=667;t["ccaron"]=444;t["aring"]=500;t["Ncommaaccent"]=722;t["lacute"]=278;t["agrave"]=500;t["Tcommaaccent"]=611;t["Cacute"]=667;t["atilde"]=500;t["Edotaccent"]=667;t["scaron"]=389;t["scedilla"]=389;t["iacute"]=278;t["lozenge"]=494;t["Rcaron"]=667;t["Gcommaaccent"]=722;t["ucircumflex"]=556;t["acircumflex"]=500;t["Amacron"]=667;t["rcaron"]=389;t["ccedilla"]=444;t["Zdotaccent"]=611;t["Thorn"]=611;t["Omacron"]=722;t["Racute"]=667;t["Sacute"]=556;t["dcaron"]=608;t["Umacron"]=722;t["uring"]=556;t["threesuperior"]=300;t["Ograve"]=722;t["Agrave"]=667;t["Abreve"]=667;t["multiply"]=570;t["uacute"]=556;t["Tcaron"]=611;t["partialdiff"]=494;t["ydieresis"]=444;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=500;t["edieresis"]=444;t["cacute"]=444;t["nacute"]=556;t["umacron"]=556;t["Ncaron"]=722;t["Iacute"]=389;t["plusminus"]=570;t["brokenbar"]=220;t["registered"]=747;t["Gbreve"]=722;t["Idotaccent"]=389;t["summation"]=600;t["Egrave"]=667;t["racute"]=389;t["omacron"]=500;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=667;t["lcommaaccent"]=278;t["tcaron"]=366;t["eogonek"]=444;t["Uogonek"]=722;t["Aacute"]=667;t["Adieresis"]=667;t["egrave"]=444;t["zacute"]=389;t["iogonek"]=278;t["Oacute"]=722;t["oacute"]=500;t["amacron"]=500;t["sacute"]=389;t["idieresis"]=278;t["Ocircumflex"]=722;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=500;t["twosuperior"]=300;t["Odieresis"]=722;t["mu"]=576;t["igrave"]=278;t["ohungarumlaut"]=500;t["Eogonek"]=667;t["dcroat"]=500;t["threequarters"]=750;t["Scedilla"]=556;t["lcaron"]=382;t["Kcommaaccent"]=667;t["Lacute"]=611;t["trademark"]=1e3;t["edotaccent"]=444;t["Igrave"]=389;t["Imacron"]=389;t["Lcaron"]=611;t["onehalf"]=750;t["lessequal"]=549;t["ocircumflex"]=500;t["ntilde"]=556;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=444;t["gbreve"]=500;t["onequarter"]=750;t["Scaron"]=556;t["Scommaaccent"]=556;t["Ohungarumlaut"]=722;t["degree"]=400;t["ograve"]=500;t["Ccaron"]=667;t["ugrave"]=556;t["radical"]=549;t["Dcaron"]=722;t["rcommaaccent"]=389;t["Ntilde"]=722;t["otilde"]=500;t["Rcommaaccent"]=667;t["Lcommaaccent"]=611;t["Atilde"]=667;t["Aogonek"]=667;t["Aring"]=667;t["Otilde"]=722;t["zdotaccent"]=389;t["Ecaron"]=667;t["Iogonek"]=389;t["kcommaaccent"]=500;t["minus"]=606;t["Icircumflex"]=389;t["ncaron"]=556;t["tcommaaccent"]=278;t["logicalnot"]=606;t["odieresis"]=500;t["udieresis"]=556;t["notequal"]=549;t["gcommaaccent"]=500;t["eth"]=500;t["zcaron"]=389;t["ncommaaccent"]=556;t["onesuperior"]=300;t["imacron"]=278;t["Euro"]=500});t["Times-Italic"]=getLookupTableFactory(function(t){t["space"]=250;t["exclam"]=333;t["quotedbl"]=420;t["numbersign"]=500;t["dollar"]=500;t["percent"]=833;t["ampersand"]=778;t["quoteright"]=333;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=500;t["plus"]=675;t["comma"]=250;t["hyphen"]=333;t["period"]=250;t["slash"]=278;t["zero"]=500;t["one"]=500;t["two"]=500;t["three"]=500;t["four"]=500;t["five"]=500;t["six"]=500;t["seven"]=500;t["eight"]=500;t["nine"]=500;t["colon"]=333;t["semicolon"]=333;t["less"]=675;t["equal"]=675;t["greater"]=675;t["question"]=500;t["at"]=920;t["A"]=611;t["B"]=611;t["C"]=667;t["D"]=722;t["E"]=611;t["F"]=611;t["G"]=722;t["H"]=722;t["I"]=333;t["J"]=444;t["K"]=667;t["L"]=556;t["M"]=833;t["N"]=667;t["O"]=722;t["P"]=611;t["Q"]=722;t["R"]=611;t["S"]=500;t["T"]=556;t["U"]=722;t["V"]=611;t["W"]=833;t["X"]=611;t["Y"]=556;t["Z"]=556;t["bracketleft"]=389;t["backslash"]=278;t["bracketright"]=389;t["asciicircum"]=422;t["underscore"]=500;t["quoteleft"]=333;t["a"]=500;t["b"]=500;t["c"]=444;t["d"]=500;t["e"]=444;t["f"]=278;t["g"]=500;t["h"]=500;t["i"]=278;t["j"]=278;t["k"]=444;t["l"]=278;t["m"]=722;t["n"]=500;t["o"]=500;t["p"]=500;t["q"]=500;t["r"]=389;t["s"]=389;t["t"]=278;t["u"]=500;t["v"]=444;t["w"]=667;t["x"]=444;t["y"]=444;t["z"]=389;t["braceleft"]=400;t["bar"]=275;t["braceright"]=400;t["asciitilde"]=541;t["exclamdown"]=389;t["cent"]=500;t["sterling"]=500;t["fraction"]=167;t["yen"]=500;t["florin"]=500;t["section"]=500;t["currency"]=500;t["quotesingle"]=214;t["quotedblleft"]=556;t["guillemotleft"]=500;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=500;t["fl"]=500;t["endash"]=500;t["dagger"]=500;t["daggerdbl"]=500;t["periodcentered"]=250;t["paragraph"]=523;t["bullet"]=350;t["quotesinglbase"]=333;t["quotedblbase"]=556;t["quotedblright"]=556;t["guillemotright"]=500;t["ellipsis"]=889;t["perthousand"]=1e3;t["questiondown"]=500;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=889;t["AE"]=889;t["ordfeminine"]=276;t["Lslash"]=556;t["Oslash"]=722;t["OE"]=944;t["ordmasculine"]=310;t["ae"]=667;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=500;t["oe"]=667;t["germandbls"]=500;t["Idieresis"]=333;t["eacute"]=444;t["abreve"]=500;t["uhungarumlaut"]=500;t["ecaron"]=444;t["Ydieresis"]=556;t["divide"]=675;t["Yacute"]=556;t["Acircumflex"]=611;t["aacute"]=500;t["Ucircumflex"]=722;t["yacute"]=444;t["scommaaccent"]=389;t["ecircumflex"]=444;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=500;t["Uacute"]=722;t["uogonek"]=500;t["Edieresis"]=611;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=760;t["Emacron"]=611;t["ccaron"]=444;t["aring"]=500;t["Ncommaaccent"]=667;t["lacute"]=278;t["agrave"]=500;t["Tcommaaccent"]=556;t["Cacute"]=667;t["atilde"]=500;t["Edotaccent"]=611;t["scaron"]=389;t["scedilla"]=389;t["iacute"]=278;t["lozenge"]=471;t["Rcaron"]=611;t["Gcommaaccent"]=722;t["ucircumflex"]=500;t["acircumflex"]=500;t["Amacron"]=611;t["rcaron"]=389;t["ccedilla"]=444;t["Zdotaccent"]=556;t["Thorn"]=611;t["Omacron"]=722;t["Racute"]=611;t["Sacute"]=500;t["dcaron"]=544;t["Umacron"]=722;t["uring"]=500;t["threesuperior"]=300;t["Ograve"]=722;t["Agrave"]=611;t["Abreve"]=611;t["multiply"]=675;t["uacute"]=500;t["Tcaron"]=556;t["partialdiff"]=476;t["ydieresis"]=444;t["Nacute"]=667;t["icircumflex"]=278;t["Ecircumflex"]=611;t["adieresis"]=500;t["edieresis"]=444;t["cacute"]=444;t["nacute"]=500;t["umacron"]=500;t["Ncaron"]=667;t["Iacute"]=333;t["plusminus"]=675;t["brokenbar"]=275;t["registered"]=760;t["Gbreve"]=722;t["Idotaccent"]=333;t["summation"]=600;t["Egrave"]=611;t["racute"]=389;t["omacron"]=500;t["Zacute"]=556;t["Zcaron"]=556;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=667;t["lcommaaccent"]=278;t["tcaron"]=300;t["eogonek"]=444;t["Uogonek"]=722;t["Aacute"]=611;t["Adieresis"]=611;t["egrave"]=444;t["zacute"]=389;t["iogonek"]=278;t["Oacute"]=722;t["oacute"]=500;t["amacron"]=500;t["sacute"]=389;t["idieresis"]=278;t["Ocircumflex"]=722;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=500;t["twosuperior"]=300;t["Odieresis"]=722;t["mu"]=500;t["igrave"]=278;t["ohungarumlaut"]=500;t["Eogonek"]=611;t["dcroat"]=500;t["threequarters"]=750;t["Scedilla"]=500;t["lcaron"]=300;t["Kcommaaccent"]=667;t["Lacute"]=556;t["trademark"]=980;t["edotaccent"]=444;t["Igrave"]=333;t["Imacron"]=333;t["Lcaron"]=611;t["onehalf"]=750;t["lessequal"]=549;t["ocircumflex"]=500;t["ntilde"]=500;t["Uhungarumlaut"]=722;t["Eacute"]=611;t["emacron"]=444;t["gbreve"]=500;t["onequarter"]=750;t["Scaron"]=500;t["Scommaaccent"]=500;t["Ohungarumlaut"]=722;t["degree"]=400;t["ograve"]=500;t["Ccaron"]=667;t["ugrave"]=500;t["radical"]=453;t["Dcaron"]=722;t["rcommaaccent"]=389;t["Ntilde"]=667;t["otilde"]=500;t["Rcommaaccent"]=611;t["Lcommaaccent"]=556;t["Atilde"]=611;t["Aogonek"]=611;t["Aring"]=611;t["Otilde"]=722;t["zdotaccent"]=389;t["Ecaron"]=611;t["Iogonek"]=333;t["kcommaaccent"]=444;t["minus"]=675;t["Icircumflex"]=333;t["ncaron"]=500;t["tcommaaccent"]=278;t["logicalnot"]=675;t["odieresis"]=500;t["udieresis"]=500;t["notequal"]=549;t["gcommaaccent"]=500;t["eth"]=500;t["zcaron"]=389;t["ncommaaccent"]=500;t["onesuperior"]=300;t["imacron"]=278;t["Euro"]=500});t["ZapfDingbats"]=getLookupTableFactory(function(t){t["space"]=278;t["a1"]=974;t["a2"]=961;t["a202"]=974;t["a3"]=980;t["a4"]=719;t["a5"]=789;t["a119"]=790;t["a118"]=791;t["a117"]=690;t["a11"]=960;t["a12"]=939;t["a13"]=549;t["a14"]=855;t["a15"]=911;t["a16"]=933;t["a105"]=911;t["a17"]=945;t["a18"]=974;t["a19"]=755;t["a20"]=846;t["a21"]=762;t["a22"]=761;t["a23"]=571;t["a24"]=677;t["a25"]=763;t["a26"]=760;t["a27"]=759;t["a28"]=754;t["a6"]=494;t["a7"]=552;t["a8"]=537;t["a9"]=577;t["a10"]=692;t["a29"]=786;t["a30"]=788;t["a31"]=788;t["a32"]=790;t["a33"]=793;t["a34"]=794;t["a35"]=816;t["a36"]=823;t["a37"]=789;t["a38"]=841;t["a39"]=823;t["a40"]=833;t["a41"]=816;t["a42"]=831;t["a43"]=923;t["a44"]=744;t["a45"]=723;t["a46"]=749;t["a47"]=790;t["a48"]=792;t["a49"]=695;t["a50"]=776;t["a51"]=768;t["a52"]=792;t["a53"]=759;t["a54"]=707;t["a55"]=708;t["a56"]=682;t["a57"]=701;t["a58"]=826;t["a59"]=815;t["a60"]=789;t["a61"]=789;t["a62"]=707;t["a63"]=687;t["a64"]=696;t["a65"]=689;t["a66"]=786;t["a67"]=787;t["a68"]=713;t["a69"]=791;t["a70"]=785;t["a71"]=791;t["a72"]=873;t["a73"]=761;t["a74"]=762;t["a203"]=762;t["a75"]=759;t["a204"]=759;t["a76"]=892;t["a77"]=892;t["a78"]=788;t["a79"]=784;t["a81"]=438;t["a82"]=138;t["a83"]=277;t["a84"]=415;t["a97"]=392;t["a98"]=392;t["a99"]=668;t["a100"]=668;t["a89"]=390;t["a90"]=390;t["a93"]=317;t["a94"]=317;t["a91"]=276;t["a92"]=276;t["a205"]=509;t["a85"]=509;t["a206"]=410;t["a86"]=410;t["a87"]=234;t["a88"]=234;t["a95"]=334;t["a96"]=334;t["a101"]=732;t["a102"]=544;t["a103"]=544;t["a104"]=910;t["a106"]=667;t["a107"]=760;t["a108"]=760;t["a112"]=776;t["a111"]=595;t["a110"]=694;t["a109"]=626;t["a120"]=788;t["a121"]=788;t["a122"]=788;t["a123"]=788;t["a124"]=788;t["a125"]=788;t["a126"]=788;t["a127"]=788;t["a128"]=788;t["a129"]=788;t["a130"]=788;t["a131"]=788;t["a132"]=788;t["a133"]=788;t["a134"]=788;t["a135"]=788;t["a136"]=788;t["a137"]=788;t["a138"]=788;t["a139"]=788;t["a140"]=788;t["a141"]=788;t["a142"]=788;t["a143"]=788;t["a144"]=788;t["a145"]=788;t["a146"]=788;t["a147"]=788;t["a148"]=788;t["a149"]=788;t["a150"]=788;t["a151"]=788;t["a152"]=788;t["a153"]=788;t["a154"]=788;t["a155"]=788;t["a156"]=788;t["a157"]=788;t["a158"]=788;t["a159"]=788;t["a160"]=894;t["a161"]=838;t["a163"]=1016;t["a164"]=458;t["a196"]=748;t["a165"]=924;t["a192"]=748;t["a166"]=918;t["a167"]=927;t["a168"]=928;t["a169"]=928;t["a170"]=834;t["a171"]=873;t["a172"]=828;t["a173"]=924;t["a162"]=924;t["a174"]=917;t["a175"]=930;t["a176"]=931;t["a177"]=463;t["a178"]=883;t["a179"]=836;t["a193"]=836;t["a180"]=867;t["a199"]=867;t["a181"]=696;t["a200"]=696;t["a182"]=874;t["a201"]=874;t["a183"]=760;t["a184"]=946;t["a197"]=771;t["a185"]=865;t["a194"]=771;t["a198"]=888;t["a186"]=967;t["a195"]=888;t["a187"]=831;t["a188"]=873;t["a189"]=927;t["a190"]=970;t["a191"]=918})});exports.getMetrics=getMetrics});(function(root,factory){{factory(root.pdfjsCoreMurmurHash3={},root.pdfjsSharedUtil)}})(this,function(exports,sharedUtil){var Uint32ArrayView=sharedUtil.Uint32ArrayView;var MurmurHash3_64=function MurmurHash3_64Closure(seed){var MASK_HIGH=4294901760;var MASK_LOW=65535;function MurmurHash3_64(seed){var SEED=3285377520;this.h1=seed?seed&4294967295:SEED;this.h2=seed?seed&4294967295:SEED}var alwaysUseUint32ArrayView=false;try{new Uint32Array(new Uint8Array(5).buffer,0,1)}catch(e){alwaysUseUint32ArrayView=true}MurmurHash3_64.prototype={update:function MurmurHash3_64_update(input){var useUint32ArrayView=alwaysUseUint32ArrayView;var i;if(typeof input==="string"){var data=new Uint8Array(input.length*2);var length=0;for(i=0;i>>8;data[length++]=code&255}}}else if(input instanceof Uint8Array){data=input;length=data.length}else if(typeof input==="object"&&"length"in input){data=input;length=data.length;useUint32ArrayView=true}else{throw new Error("Wrong data format in MurmurHash3_64_update. "+"Input must be a string or array.")}var blockCounts=length>>2;var tailLength=length-blockCounts*4;var dataUint32=useUint32ArrayView?new Uint32ArrayView(data,blockCounts):new Uint32Array(data.buffer,0,blockCounts);var k1=0;var k2=0;var h1=this.h1;var h2=this.h2;var C1=3432918353;var C2=461845907;var C1_LOW=C1&MASK_LOW;var C2_LOW=C2&MASK_LOW;for(i=0;i>>17;k1=k1*C2&MASK_HIGH|k1*C2_LOW&MASK_LOW;h1^=k1;h1=h1<<13|h1>>>19;h1=h1*5+3864292196}else{k2=dataUint32[i];k2=k2*C1&MASK_HIGH|k2*C1_LOW&MASK_LOW;k2=k2<<15|k2>>>17;k2=k2*C2&MASK_HIGH|k2*C2_LOW&MASK_LOW;h2^=k2;h2=h2<<13|h2>>>19;h2=h2*5+3864292196}}k1=0;switch(tailLength){case 3:k1^=data[blockCounts*4+2]<<16;case 2:k1^=data[blockCounts*4+1]<<8;case 1:k1^=data[blockCounts*4];k1=k1*C1&MASK_HIGH|k1*C1_LOW&MASK_LOW;k1=k1<<15|k1>>>17;k1=k1*C2&MASK_HIGH|k1*C2_LOW&MASK_LOW;if(blockCounts&1){h1^=k1}else{h2^=k1}}this.h1=h1;this.h2=h2;return this},hexdigest:function MurmurHash3_64_hexdigest(){var h1=this.h1;var h2=this.h2;h1^=h2>>>1;h1=h1*3981806797&MASK_HIGH|h1*36045&MASK_LOW;h2=h2*4283543511&MASK_HIGH|((h2<<16|h1>>>16)*2950163797&MASK_HIGH)>>>16;h1^=h2>>>1;h1=h1*444984403&MASK_HIGH|h1*60499&MASK_LOW;h2=h2*3301882366&MASK_HIGH|((h2<<16|h1>>>16)*3120437893&MASK_HIGH)>>>16;h1^=h2>>>1;for(var i=0,arr=[h1,h2],str="";i>>0).toString(16);while(hex.length<8){hex="0"+hex}str+=hex}return str}};return MurmurHash3_64}();exports.MurmurHash3_64=MurmurHash3_64});(function(root,factory){{factory(root.pdfjsCorePrimitives={},root.pdfjsSharedUtil)}})(this,function(exports,sharedUtil){var isArray=sharedUtil.isArray;var Name=function NameClosure(){function Name(name){this.name=name}Name.prototype={};var nameCache=Object.create(null);Name.get=function Name_get(name){var nameValue=nameCache[name];return nameValue?nameValue:nameCache[name]=new Name(name)};return Name}();var Cmd=function CmdClosure(){function Cmd(cmd){this.cmd=cmd}Cmd.prototype={};var cmdCache=Object.create(null);Cmd.get=function Cmd_get(cmd){var cmdValue=cmdCache[cmd];return cmdValue?cmdValue:cmdCache[cmd]=new Cmd(cmd)};return Cmd}();var Dict=function DictClosure(){var nonSerializable=function nonSerializableClosure(){return nonSerializable};function Dict(xref){this.map=Object.create(null);this.xref=xref;this.objId=null;this.__nonSerializable__=nonSerializable}Dict.prototype={assignXref:function Dict_assignXref(newXref){this.xref=newXref},get:function Dict_get(key1,key2,key3){var value;var xref=this.xref;if(typeof(value=this.map[key1])!=="undefined"||key1 in this.map||typeof key2==="undefined"){return xref?xref.fetchIfRef(value):value}if(typeof(value=this.map[key2])!=="undefined"||key2 in this.map||typeof key3==="undefined"){return xref?xref.fetchIfRef(value):value}value=this.map[key3]||null;return xref?xref.fetchIfRef(value):value},getAsync:function Dict_getAsync(key1,key2,key3){var value;var xref=this.xref;if(typeof(value=this.map[key1])!=="undefined"||key1 in this.map||typeof key2==="undefined"){if(xref){return xref.fetchIfRefAsync(value)}return Promise.resolve(value)}if(typeof(value=this.map[key2])!=="undefined"||key2 in this.map||typeof key3==="undefined"){if(xref){return xref.fetchIfRefAsync(value)}return Promise.resolve(value)}value=this.map[key3]||null;if(xref){return xref.fetchIfRefAsync(value)}return Promise.resolve(value)},getArray:function Dict_getArray(key1,key2,key3){var value=this.get(key1,key2,key3);var xref=this.xref;if(!isArray(value)||!xref){return value}value=value.slice();for(var i=0,ii=value.length;i=65520&&code<=65535){return 0}else if(code>=62976&&code<=63743){return getSpecialPUASymbols()[code]||code}return code}var UnicodeRanges=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{ +begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function getUnicodeRangeFor(value){for(var i=0,ii=UnicodeRanges.length;i=range.begin&&value=range.begin&&value=range.begin&&value=0;ii--){s+=chars[ii]}return s}exports.mapSpecialUnicodeValues=mapSpecialUnicodeValues;exports.reverseIfRtl=reverseIfRtl;exports.getUnicodeRangeFor=getUnicodeRangeFor;exports.getNormalizedUnicodes=getNormalizedUnicodes});(function(root,factory){{factory(root.pdfjsCoreStream={},root.pdfjsSharedUtil,root.pdfjsCorePrimitives,root.pdfjsCoreJbig2,root.pdfjsCoreJpg,root.pdfjsCoreJpx)}})(this,function(exports,sharedUtil,corePrimitives,coreJbig2,coreJpg,coreJpx){var Util=sharedUtil.Util;var error=sharedUtil.error;var info=sharedUtil.info;var isArray=sharedUtil.isArray;var shadow=sharedUtil.shadow;var warn=sharedUtil.warn;var Dict=corePrimitives.Dict;var Jbig2Image=coreJbig2.Jbig2Image;var JpegImage=coreJpg.JpegImage;var JpxImage=coreJpx.JpxImage;var coreParser;var EOF;var Lexer;var coreColorSpace;var ColorSpace;var Stream=function StreamClosure(){function Stream(arrayBuffer,start,length,dict){this.bytes=arrayBuffer instanceof Uint8Array?arrayBuffer:new Uint8Array(arrayBuffer);this.start=start||0;this.pos=this.start;this.end=start+length||this.bytes.length;this.dict=dict}Stream.prototype={get length(){return this.end-this.start},get isEmpty(){return this.length===0},getByte:function Stream_getByte(){if(this.pos>=this.end){return-1}return this.bytes[this.pos++]},getUint16:function Stream_getUint16(){var b0=this.getByte();var b1=this.getByte();if(b0===-1||b1===-1){return-1}return(b0<<8)+b1},getInt32:function Stream_getInt32(){var b0=this.getByte();var b1=this.getByte();var b2=this.getByte();var b3=this.getByte();return(b0<<24)+(b1<<16)+(b2<<8)+b3},getBytes:function Stream_getBytes(length){var bytes=this.bytes;var pos=this.pos;var strEnd=this.end;if(!length){return bytes.subarray(pos,strEnd)}var end=pos+length;if(end>strEnd){end=strEnd}this.pos=end;return bytes.subarray(pos,end)},peekByte:function Stream_peekByte(){var peekedByte=this.getByte();this.pos--;return peekedByte},peekBytes:function Stream_peekBytes(length){var bytes=this.getBytes(length);this.pos-=bytes.length;return bytes},skip:function Stream_skip(n){if(!n){n=1}this.pos+=n},reset:function Stream_reset(){this.pos=this.start},moveStart:function Stream_moveStart(){this.start=this.pos},makeSubStream:function Stream_makeSubStream(start,length,dict){return new Stream(this.bytes.buffer,start,length,dict)},isStream:true};return Stream}();var StringStream=function StringStreamClosure(){function StringStream(str){var length=str.length;var bytes=new Uint8Array(length);for(var n=0;nbufEnd){end=bufEnd}}else{while(!this.eof){this.readBlock()}end=this.bufferLength}this.pos=end;return this.buffer.subarray(pos,end)},peekByte:function DecodeStream_peekByte(){var peekedByte=this.getByte();this.pos--;return peekedByte},peekBytes:function DecodeStream_peekBytes(length){var bytes=this.getBytes(length);this.pos-=bytes.length;return bytes},makeSubStream:function DecodeStream_makeSubStream(start,length,dict){var end=start+length;while(this.bufferLength<=end&&!this.eof){this.readBlock()}return new Stream(this.buffer,start,length,dict)},skip:function DecodeStream_skip(n){if(!n){n=1}this.pos+=n},reset:function DecodeStream_reset(){this.pos=0},getBaseStreams:function DecodeStream_getBaseStreams(){if(this.str&&this.str.getBaseStreams){return this.str.getBaseStreams()}return[]}};return DecodeStream}();var StreamsSequenceStream=function StreamsSequenceStreamClosure(){function StreamsSequenceStream(streams){this.streams=streams;DecodeStream.call(this,null)}StreamsSequenceStream.prototype=Object.create(DecodeStream.prototype);StreamsSequenceStream.prototype.readBlock=function streamSequenceStreamReadBlock(){var streams=this.streams;if(streams.length===0){this.eof=true;return}var stream=streams.shift();var chunk=stream.getBytes();var bufferLength=this.bufferLength;var newLength=bufferLength+chunk.length;var buffer=this.ensureBuffer(newLength);buffer.set(chunk,bufferLength);this.bufferLength=newLength};StreamsSequenceStream.prototype.getBaseStreams=function StreamsSequenceStream_getBaseStreams(){var baseStreams=[];for(var i=0,ii=this.streams.length;i>bits;this.codeSize=codeSize-=bits;return b};FlateStream.prototype.getCode=function FlateStream_getCode(table){var str=this.str;var codes=table[0];var maxLen=table[1];var codeSize=this.codeSize;var codeBuf=this.codeBuf;var b;while(codeSize>16;var codeVal=code&65535;if(codeLen<1||codeSize>codeLen;this.codeSize=codeSize-codeLen;return codeVal};FlateStream.prototype.generateHuffmanTable=function flateStreamGenerateHuffmanTable(lengths){var n=lengths.length;var maxLen=0;var i;for(i=0;imaxLen){maxLen=lengths[i]}}var size=1<>=1}for(i=code2;i>=1;if(hdr===0){var b;if((b=str.getByte())===-1){error("Bad block header in flate stream")}var blockLen=b;if((b=str.getByte())===-1){error("Bad block header in flate stream")}blockLen|=b<<8;if((b=str.getByte())===-1){error("Bad block header in flate stream")}var check=b;if((b=str.getByte())===-1){error("Bad block header in flate stream")}check|=b<<8;if(check!==(~blockLen&65535)&&(blockLen!==0||check!==0)){error("Bad uncompressed block length in flate stream")}this.codeBuf=0;this.codeSize=0;var bufferLength=this.bufferLength;buffer=this.ensureBuffer(bufferLength+blockLen);var end=bufferLength+blockLen;this.bufferLength=end;if(blockLen===0){if(str.peekByte()===-1){this.eof=true}}else{for(var n=bufferLength;n0){codeLengths[i++]=what}}litCodeTable=this.generateHuffmanTable(codeLengths.subarray(0,numLitCodes));distCodeTable=this.generateHuffmanTable(codeLengths.subarray(numLitCodes,codes))}else{error("Unknown block type in flate stream")}buffer=this.buffer;var limit=buffer?buffer.length:0;var pos=this.bufferLength;while(true){ +var code1=this.getCode(litCodeTable);if(code1<256){if(pos+1>=limit){buffer=this.ensureBuffer(pos+1);limit=buffer.length}buffer[pos++]=code1;continue}if(code1===256){this.bufferLength=pos;return}code1-=257;code1=lengthDecode[code1];var code2=code1>>16;if(code2>0){code2=this.getBits(code2)}len=(code1&65535)+code2;code1=this.getCode(distCodeTable);code1=distDecode[code1];code2=code1>>16;if(code2>0){code2=this.getBits(code2)}var dist=(code1&65535)+code2;if(pos+len>=limit){buffer=this.ensureBuffer(pos+len);limit=buffer.length}for(var k=0;k15)){error("Unsupported predictor: "+predictor)}if(predictor===2){this.readBlock=this.readBlockTiff}else{this.readBlock=this.readBlockPng}this.str=str;this.dict=str.dict;var colors=this.colors=params.get("Colors")||1;var bits=this.bits=params.get("BitsPerComponent")||8;var columns=this.columns=params.get("Columns")||1;this.pixBytes=colors*bits+7>>3;this.rowBytes=columns*colors*bits+7>>3;DecodeStream.call(this,maybeLength);return this}PredictorStream.prototype=Object.create(DecodeStream.prototype);PredictorStream.prototype.readBlockTiff=function predictorStreamReadBlockTiff(){var rowBytes=this.rowBytes;var bufferLength=this.bufferLength;var buffer=this.ensureBuffer(bufferLength+rowBytes);var bits=this.bits;var colors=this.colors;var rawBytes=this.str.getBytes(rowBytes);this.eof=!rawBytes.length;if(this.eof){return}var inbuf=0,outbuf=0;var inbits=0,outbits=0;var pos=bufferLength;var i;if(bits===1){for(i=0;i>colors)&255;inbuf&=65535}}else if(bits===8){for(i=0;i>inbits-bits)&bitMask;inbits-=bits;outbuf=outbuf<=8){buffer[k++]=outbuf>>outbits-8&255;outbits-=8}}}if(outbits>0){buffer[k++]=(outbuf<<8-outbits)+(inbuf&(1<<8-outbits)-1)}}this.bufferLength+=rowBytes};PredictorStream.prototype.readBlockPng=function predictorStreamReadBlockPng(){var rowBytes=this.rowBytes;var pixBytes=this.pixBytes;var predictor=this.str.getByte();var rawBytes=this.str.getBytes(rowBytes);this.eof=!rawBytes.length;if(this.eof){return}var bufferLength=this.bufferLength;var buffer=this.ensureBuffer(bufferLength+rowBytes);var prevRow=buffer.subarray(bufferLength-rowBytes,bufferLength);if(prevRow.length===0){prevRow=new Uint8Array(rowBytes)}var i,j=bufferLength,up,c;switch(predictor){case 0:for(i=0;i>1)+rawBytes[i]}for(;i>1)+rawBytes[i]&255;j++}break;case 4:for(i=0;i1){warn("JBIG2 - 'DecodeParms' array with multiple elements "+"not supported.")}decodeParams=xref.fetchIfRef(decodeParams[0])}if(decodeParams&&decodeParams.has("JBIG2Globals")){var globalsStream=decodeParams.get("JBIG2Globals");var globals=globalsStream.getBytes();chunks.push({data:globals,start:0,end:globals.length})}chunks.push({data:this.bytes,start:0,end:this.bytes.length});var data=jbig2Image.parseChunks(chunks);var dataLength=data.length;for(var i=0;i0;var decrypt=this.decrypt;chunk=decrypt(chunk,!hasMoreData);var bufferLength=this.bufferLength;var i,n=chunk.length;var buffer=this.ensureBuffer(bufferLength+n);for(i=0;i=0;--i){buffer[bufferLength+i]=t&255;t>>=8}}};return Ascii85Stream}();var AsciiHexStream=function AsciiHexStreamClosure(){function AsciiHexStream(str,maybeLength){this.str=str;this.dict=str.dict;this.firstDigit=-1;if(maybeLength){maybeLength=.5*maybeLength}DecodeStream.call(this,maybeLength)}AsciiHexStream.prototype=Object.create(DecodeStream.prototype);AsciiHexStream.prototype.readBlock=function AsciiHexStream_readBlock(){var UPSTREAM_BLOCK_SIZE=8e3;var bytes=this.str.getBytes(UPSTREAM_BLOCK_SIZE);if(!bytes.length){this.eof=true;return}var maxDecodeLength=bytes.length+1>>1;var buffer=this.ensureBuffer(this.bufferLength+maxDecodeLength);var bufferLength=this.bufferLength;var firstDigit=this.firstDigit;for(var i=0,ii=bytes.length;i=48&&ch<=57){digit=ch&15}else if(ch>=65&&ch<=70||ch>=97&&ch<=102){digit=(ch&15)+9}else if(ch===62){this.eof=true;break}else{continue}if(firstDigit<0){firstDigit=digit}else{buffer[bufferLength++]=firstDigit<<4|digit;firstDigit=-1}}if(firstDigit>=0&&this.eof){buffer[bufferLength++]=firstDigit<<4;firstDigit=-1}this.firstDigit=firstDigit;this.bufferLength=bufferLength};return AsciiHexStream}();var RunLengthStream=function RunLengthStreamClosure(){function RunLengthStream(str,maybeLength){this.str=str;this.dict=str.dict;DecodeStream.call(this,maybeLength)}RunLengthStream.prototype=Object.create(DecodeStream.prototype);RunLengthStream.prototype.readBlock=function RunLengthStream_readBlock(){var repeatHeader=this.str.getBytes(2);if(!repeatHeader||repeatHeader.length<2||repeatHeader[0]===128){this.eof=true;return}var buffer;var bufferLength=this.bufferLength;var n=repeatHeader[0];if(n<128){buffer=this.ensureBuffer(bufferLength+n+1);buffer[bufferLength++]=repeatHeader[1];if(n>0){var source=this.str.getBytes(n);buffer.set(source,bufferLength);bufferLength+=n}}else{n=257-n;var b=repeatHeader[1];buffer=this.ensureBuffer(bufferLength+n+1);for(var i=0;i0){this.nextLine2D=!this.lookBits(1);this.eatBits(1)}DecodeStream.call(this,maybeLength)}CCITTFaxStream.prototype=Object.create(DecodeStream.prototype);CCITTFaxStream.prototype.readBlock=function CCITTFaxStream_readBlock(){while(!this.eof){var c=this.lookChar();this.ensureBuffer(this.bufferLength+1);this.buffer[this.bufferLength++]=c}};CCITTFaxStream.prototype.addPixels=function ccittFaxStreamAddPixels(a1,blackPixels){var codingLine=this.codingLine;var codingPos=this.codingPos;if(a1>codingLine[codingPos]){if(a1>this.columns){info("row is wrong length");this.err=true;a1=this.columns}if(codingPos&1^blackPixels){++codingPos}codingLine[codingPos]=a1}this.codingPos=codingPos};CCITTFaxStream.prototype.addPixelsNeg=function ccittFaxStreamAddPixelsNeg(a1,blackPixels){var codingLine=this.codingLine;var codingPos=this.codingPos;if(a1>codingLine[codingPos]){if(a1>this.columns){info("row is wrong length");this.err=true;a1=this.columns}if(codingPos&1^blackPixels){++codingPos}codingLine[codingPos]=a1}else if(a10&&a1=64);do{code2+=code3=this.getWhiteCode()}while(code3>=64)}else{do{code1+=code3=this.getWhiteCode()}while(code3>=64);do{code2+=code3=this.getBlackCode()}while(code3>=64)}this.addPixels(codingLine[this.codingPos]+code1,blackPixels);if(codingLine[this.codingPos]0){--refPos}else{++refPos}while(refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]0){--refPos}else{++refPos}while(refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]0){--refPos}else{++refPos}while(refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]=64)}else{do{code1+=code3=this.getWhiteCode()}while(code3>=64)}this.addPixels(codingLine[this.codingPos]+code1,blackPixels);blackPixels^=1}}var gotEOL=false;if(this.byteAlign){this.inputBits&=~7}if(!this.eoblock&&this.row===this.rows-1){this.eof=true}else{code1=this.lookBits(12);if(this.eoline){while(code1!==EOF&&code1!==1){this.eatBits(1);code1=this.lookBits(12)}}else{while(code1===0){this.eatBits(1);code1=this.lookBits(12)}}if(code1===1){this.eatBits(12);gotEOL=true}else if(code1===EOF){this.eof=true}}if(!this.eof&&this.encoding>0){this.nextLine2D=!this.lookBits(1);this.eatBits(1)}if(this.eoblock&&gotEOL&&this.byteAlign){code1=this.lookBits(12);if(code1===1){this.eatBits(12);if(this.encoding>0){this.lookBits(1);this.eatBits(1)}if(this.encoding>=0){for(i=0;i<4;++i){code1=this.lookBits(12);if(code1!==1){info("bad rtc code: "+code1)}this.eatBits(12);if(this.encoding>0){this.lookBits(1);this.eatBits(1)}}}this.eof=true}}else if(this.err&&this.eoline){while(true){code1=this.lookBits(13);if(code1===EOF){this.eof=true;return null}if(code1>>1===1){break}this.eatBits(1)}this.eatBits(12);if(this.encoding>0){this.eatBits(1);this.nextLine2D=!(code1&1)}}if(codingLine[0]>0){this.outputBits=codingLine[this.codingPos=0]}else{this.outputBits=codingLine[this.codingPos=1]}this.row++}var c;if(this.outputBits>=8){c=this.codingPos&1?0:255;this.outputBits-=8;if(this.outputBits===0&&codingLine[this.codingPos]bits){c<<=bits;if(!(this.codingPos&1)){c|=255>>8-bits}this.outputBits-=bits;bits=0}else{c<<=this.outputBits;if(!(this.codingPos&1)){c|=255>>8-this.outputBits}bits-=this.outputBits;this.outputBits=0;if(codingLine[this.codingPos]0){c<<=bits;bits=0}}}while(bits)}if(this.black){c^=255}return c};CCITTFaxStream.prototype.findTableCode=function ccittFaxStreamFindTableCode(start,end,table,limit){var limitValue=limit||0;for(var i=start;i<=end;++i){var code=this.lookBits(i);if(code===EOF){return[true,1,false]}if(i=limitValue){var p=table[code-limitValue];if(p[0]===i){this.eatBits(i);return[true,p[1],true]}}}return[false,0,false]};CCITTFaxStream.prototype.getTwoDimCode=function ccittFaxStreamGetTwoDimCode(){var code=0;var p;if(this.eoblock){code=this.lookBits(7);p=twoDimTable[code];if(p&&p[0]>0){this.eatBits(p[0]);return p[1]}}else{var result=this.findTableCode(1,7,twoDimTable);if(result[0]&&result[2]){return result[1]}}info("Bad two dim code");return EOF};CCITTFaxStream.prototype.getWhiteCode=function ccittFaxStreamGetWhiteCode(){var code=0;var p;if(this.eoblock){code=this.lookBits(12);if(code===EOF){return 1}if(code>>5===0){p=whiteTable1[code]}else{p=whiteTable2[code>>3]}if(p[0]>0){this.eatBits(p[0]);return p[1]}}else{var result=this.findTableCode(1,9,whiteTable2);if(result[0]){return result[1]}result=this.findTableCode(11,12,whiteTable1);if(result[0]){return result[1]}}info("bad white code");this.eatBits(1);return 1};CCITTFaxStream.prototype.getBlackCode=function ccittFaxStreamGetBlackCode(){var code,p;if(this.eoblock){code=this.lookBits(13);if(code===EOF){return 1}if(code>>7===0){p=blackTable1[code]}else if(code>>9===0&&code>>7!==0){p=blackTable2[(code>>1)-64]}else{p=blackTable3[code>>7]}if(p[0]>0){this.eatBits(p[0]);return p[1]}}else{var result=this.findTableCode(2,6,blackTable3);if(result[0]){return result[1]}result=this.findTableCode(7,12,blackTable2,64);if(result[0]){return result[1]}result=this.findTableCode(10,13,blackTable1);if(result[0]){return result[1]}}info("bad black code");this.eatBits(1);return 1};CCITTFaxStream.prototype.lookBits=function CCITTFaxStream_lookBits(n){var c;while(this.inputBits>16-n}this.inputBuf=(this.inputBuf<<8)+c;this.inputBits+=8}return this.inputBuf>>this.inputBits-n&65535>>16-n};CCITTFaxStream.prototype.eatBits=function CCITTFaxStream_eatBits(n){if((this.inputBits-=n)<0){this.inputBits=0}};return CCITTFaxStream}();var LZWStream=function LZWStreamClosure(){function LZWStream(str,maybeLength,earlyChange){this.str=str;this.dict=str.dict;this.cachedData=0;this.bitsCached=0;var maxLzwDictionarySize=4096;var lzwState={earlyChange:earlyChange,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(maxLzwDictionarySize),dictionaryLengths:new Uint16Array(maxLzwDictionarySize),dictionaryPrevCodes:new Uint16Array(maxLzwDictionarySize),currentSequence:new Uint8Array(maxLzwDictionarySize),currentSequenceLength:0};for(var i=0;i<256;++i){lzwState.dictionaryValues[i]=i;lzwState.dictionaryLengths[i]=1}this.lzwState=lzwState;DecodeStream.call(this,maybeLength)}LZWStream.prototype=Object.create(DecodeStream.prototype);LZWStream.prototype.readBits=function LZWStream_readBits(n){var bitsCached=this.bitsCached;var cachedData=this.cachedData;while(bitsCached>>bitsCached&(1<0;if(code<256){currentSequence[0]=code;currentSequenceLength=1}else if(code>=258){if(code=0;j--){currentSequence[j]=dictionaryValues[q];q=dictionaryPrevCodes[q]}}else{currentSequence[currentSequenceLength++]=currentSequence[0]}}else if(code===256){codeLength=9;nextCode=258;currentSequenceLength=0;continue}else{this.eof=true;delete this.lzwState;break}if(hasPrev){dictionaryPrevCodes[nextCode]=prevCode;dictionaryLengths[nextCode]=dictionaryLengths[prevCode]+1;dictionaryValues[nextCode]=currentSequence[0];nextCode++;codeLength=nextCode+earlyChange&nextCode+earlyChange-1?codeLength:Math.min(Math.log(nextCode+earlyChange)/.6931471805599453+1,12)|0}prevCode=code;decodedLength+=currentSequenceLength;if(estimatedDecodedSize>5&255;padded[i++]=length>>13&255;padded[i++]=length>>21&255;padded[i++]=length>>>29&255;padded[i++]=0;padded[i++]=0;padded[i++]=0;var w=new Int32Array(16);for(i=0;i>>32-rotate)|0;a=tmp}h0=h0+a|0;h1=h1+b|0;h2=h2+c|0;h3=h3+d|0}return new Uint8Array([h0&255,h0>>8&255,h0>>16&255,h0>>>24&255,h1&255,h1>>8&255,h1>>16&255,h1>>>24&255,h2&255,h2>>8&255,h2>>16&255,h2>>>24&255,h3&255,h3>>8&255,h3>>16&255,h3>>>24&255])}return hash}();var Word64=function Word64Closure(){function Word64(highInteger,lowInteger){this.high=highInteger|0;this.low=lowInteger|0}Word64.prototype={and:function Word64_and(word){this.high&=word.high;this.low&=word.low},xor:function Word64_xor(word){this.high^=word.high;this.low^=word.low},or:function Word64_or(word){this.high|=word.high;this.low|=word.low},shiftRight:function Word64_shiftRight(places){if(places>=32){this.low=this.high>>>places-32|0;this.high=0}else{this.low=this.low>>>places|this.high<<32-places;this.high=this.high>>>places|0}},shiftLeft:function Word64_shiftLeft(places){if(places>=32){this.high=this.low<>>32-places;this.low=this.low<>>places|high<<32-places;this.high=high>>>places|low<<32-places},not:function Word64_not(){this.high=~this.high;this.low=~this.low},add:function Word64_add(word){var lowAdd=(this.low>>>0)+(word.low>>>0);var highAdd=(this.high>>>0)+(word.high>>>0);if(lowAdd>4294967295){highAdd+=1}this.low=lowAdd|0;this.high=highAdd|0},copyTo:function Word64_copyTo(bytes,offset){bytes[offset]=this.high>>>24&255;bytes[offset+1]=this.high>>16&255;bytes[offset+2]=this.high>>8&255;bytes[offset+3]=this.high&255;bytes[offset+4]=this.low>>>24&255;bytes[offset+5]=this.low>>16&255;bytes[offset+6]=this.low>>8&255;bytes[offset+7]=this.low&255},assign:function Word64_assign(word){this.high=word.high;this.low=word.low}};return Word64}();var calculateSHA256=function calculateSHA256Closure(){function rotr(x,n){return x>>>n|x<<32-n}function ch(x,y,z){return x&y^~x&z}function maj(x,y,z){return x&y^x&z^y&z}function sigma(x){return rotr(x,2)^rotr(x,13)^rotr(x,22)}function sigmaPrime(x){return rotr(x,6)^rotr(x,11)^rotr(x,25)}function littleSigma(x){return rotr(x,7)^rotr(x,18)^x>>>3}function littleSigmaPrime(x){return rotr(x,17)^rotr(x,19)^x>>>10}var k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function hash(data,offset,length){var h0=1779033703,h1=3144134277,h2=1013904242,h3=2773480762,h4=1359893119,h5=2600822924,h6=528734635,h7=1541459225;var paddedLength=Math.ceil((length+9)/64)*64;var padded=new Uint8Array(paddedLength);var i,j,n;for(i=0;i>>29&255;padded[i++]=length>>21&255;padded[i++]=length>>13&255;padded[i++]=length>>5&255;padded[i++]=length<<3&255;var w=new Uint32Array(64);for(i=0;i>24&255,h0>>16&255,h0>>8&255,h0&255,h1>>24&255,h1>>16&255,h1>>8&255,h1&255,h2>>24&255,h2>>16&255,h2>>8&255,h2&255,h3>>24&255,h3>>16&255,h3>>8&255,h3&255,h4>>24&255,h4>>16&255,h4>>8&255,h4&255,h5>>24&255,h5>>16&255,h5>>8&255,h5&255,h6>>24&255,h6>>16&255,h6>>8&255,h6&255,h7>>24&255,h7>>16&255,h7>>8&255,h7&255])}return hash}();var calculateSHA512=function calculateSHA512Closure(){function ch(result,x,y,z,tmp){result.assign(x);result.and(y);tmp.assign(x);tmp.not();tmp.and(z);result.xor(tmp)}function maj(result,x,y,z,tmp){result.assign(x);result.and(y);tmp.assign(x);tmp.and(z);result.xor(tmp);tmp.assign(y);tmp.and(z);result.xor(tmp)}function sigma(result,x,tmp){result.assign(x);result.rotateRight(28);tmp.assign(x);tmp.rotateRight(34);result.xor(tmp);tmp.assign(x);tmp.rotateRight(39);result.xor(tmp)}function sigmaPrime(result,x,tmp){result.assign(x);result.rotateRight(14);tmp.assign(x);tmp.rotateRight(18);result.xor(tmp);tmp.assign(x);tmp.rotateRight(41);result.xor(tmp)}function littleSigma(result,x,tmp){result.assign(x);result.rotateRight(1);tmp.assign(x);tmp.rotateRight(8);result.xor(tmp);tmp.assign(x);tmp.shiftRight(7);result.xor(tmp)}function littleSigmaPrime(result,x,tmp){result.assign(x);result.rotateRight(19);tmp.assign(x);tmp.rotateRight(61);result.xor(tmp);tmp.assign(x);tmp.shiftRight(6);result.xor(tmp)}var k=[new Word64(1116352408,3609767458),new Word64(1899447441,602891725),new Word64(3049323471,3964484399),new Word64(3921009573,2173295548),new Word64(961987163,4081628472),new Word64(1508970993,3053834265),new Word64(2453635748,2937671579),new Word64(2870763221,3664609560),new Word64(3624381080,2734883394),new Word64(310598401,1164996542),new Word64(607225278,1323610764),new Word64(1426881987,3590304994),new Word64(1925078388,4068182383),new Word64(2162078206,991336113),new Word64(2614888103,633803317),new Word64(3248222580,3479774868),new Word64(3835390401,2666613458),new Word64(4022224774,944711139),new Word64(264347078,2341262773),new Word64(604807628,2007800933),new Word64(770255983,1495990901),new Word64(1249150122,1856431235),new Word64(1555081692,3175218132),new Word64(1996064986,2198950837),new Word64(2554220882,3999719339),new Word64(2821834349,766784016),new Word64(2952996808,2566594879),new Word64(3210313671,3203337956),new Word64(3336571891,1034457026),new Word64(3584528711,2466948901),new Word64(113926993,3758326383),new Word64(338241895,168717936),new Word64(666307205,1188179964),new Word64(773529912,1546045734),new Word64(1294757372,1522805485),new Word64(1396182291,2643833823),new Word64(1695183700,2343527390),new Word64(1986661051,1014477480),new Word64(2177026350,1206759142),new Word64(2456956037,344077627),new Word64(2730485921,1290863460),new Word64(2820302411,3158454273),new Word64(3259730800,3505952657),new Word64(3345764771,106217008),new Word64(3516065817,3606008344),new Word64(3600352804,1432725776),new Word64(4094571909,1467031594),new Word64(275423344,851169720),new Word64(430227734,3100823752),new Word64(506948616,1363258195),new Word64(659060556,3750685593),new Word64(883997877,3785050280),new Word64(958139571,3318307427),new Word64(1322822218,3812723403),new Word64(1537002063,2003034995),new Word64(1747873779,3602036899),new Word64(1955562222,1575990012),new Word64(2024104815,1125592928),new Word64(2227730452,2716904306),new Word64(2361852424,442776044),new Word64(2428436474,593698344),new Word64(2756734187,3733110249),new Word64(3204031479,2999351573),new Word64(3329325298,3815920427),new Word64(3391569614,3928383900),new Word64(3515267271,566280711),new Word64(3940187606,3454069534),new Word64(4118630271,4000239992),new Word64(116418474,1914138554),new Word64(174292421,2731055270),new Word64(289380356,3203993006),new Word64(460393269,320620315),new Word64(685471733,587496836),new Word64(852142971,1086792851),new Word64(1017036298,365543100),new Word64(1126000580,2618297676),new Word64(1288033470,3409855158),new Word64(1501505948,4234509866),new Word64(1607167915,987167468),new Word64(1816402316,1246189591)];function hash(data,offset,length,mode384){mode384=!!mode384;var h0,h1,h2,h3,h4,h5,h6,h7;if(!mode384){h0=new Word64(1779033703,4089235720);h1=new Word64(3144134277,2227873595);h2=new Word64(1013904242,4271175723);h3=new Word64(2773480762,1595750129);h4=new Word64(1359893119,2917565137);h5=new Word64(2600822924,725511199);h6=new Word64(528734635,4215389547);h7=new Word64(1541459225,327033209)}else{h0=new Word64(3418070365,3238371032);h1=new Word64(1654270250,914150663);h2=new Word64(2438529370,812702999);h3=new Word64(355462360,4144912697);h4=new Word64(1731405415,4290775857);h5=new Word64(2394180231,1750603025);h6=new Word64(3675008525,1694076839);h7=new Word64(1203062813,3204075428)}var paddedLength=Math.ceil((length+17)/128)*128;var padded=new Uint8Array(paddedLength);var i,j,n;for(i=0;i>>29&255;padded[i++]=length>>21&255;padded[i++]=length>>13&255;padded[i++]=length>>5&255;padded[i++]=length<<3&255;var w=new Array(80);for(i=0;i<80;i++){w[i]=new Word64(0,0)}var a=new Word64(0,0),b=new Word64(0,0),c=new Word64(0,0);var d=new Word64(0,0),e=new Word64(0,0),f=new Word64(0,0);var g=new Word64(0,0),h=new Word64(0,0);var t1=new Word64(0,0),t2=new Word64(0,0);var tmp1=new Word64(0,0),tmp2=new Word64(0,0),tmp3;for(i=0;i=1;--i){t=state[13];state[13]=state[9];state[9]=state[5];state[5]=state[1];state[1]=t;t=state[14];u=state[10];state[14]=state[6];state[10]=state[2];state[6]=t;state[2]=u;t=state[15];u=state[11];v=state[7];state[15]=state[3];state[11]=t;state[7]=u;state[3]=v;for(j=0;j<16;++j){state[j]=inv_s[state[j]]}for(j=0,k=i*16;j<16;++j,++k){state[j]^=key[k]}for(j=0;j<16;j+=4){var s0=mix[state[j]],s1=mix[state[j+1]],s2=mix[state[j+2]],s3=mix[state[j+3]];t=s0^s1>>>8^s1<<24^s2>>>16^s2<<16^s3>>>24^s3<<8;state[j]=t>>>24&255;state[j+1]=t>>16&255;state[j+2]=t>>8&255;state[j+3]=t&255}}t=state[13];state[13]=state[9];state[9]=state[5];state[5]=state[1];state[1]=t;t=state[14];u=state[10];state[14]=state[6];state[10]=state[2];state[6]=t;state[2]=u;t=state[15];u=state[11];v=state[7];state[15]=state[3];state[11]=t;state[7]=u;state[3]=v;for(j=0;j<16;++j){state[j]=inv_s[state[j]];state[j]^=key[j]}return state}function encrypt128(input,key){var t,u,v,k;var state=new Uint8Array(16);state.set(input);for(j=0;j<16;++j){state[j]^=key[j]}for(i=1;i<10;i++){for(j=0;j<16;++j){state[j]=s[state[j]]}v=state[1];state[1]=state[5];state[5]=state[9];state[9]=state[13];state[13]=v;v=state[2];u=state[6];state[2]=state[10];state[6]=state[14];state[10]=v;state[14]=u;v=state[3];u=state[7];t=state[11];state[3]=state[15];state[7]=v;state[11]=u;state[15]=t;for(var j=0;j<16;j+=4){var s0=state[j+0],s1=state[j+1];var s2=state[j+2],s3=state[j+3];t=s0^s1^s2^s3;state[j+0]^=t^mixCol[s0^s1];state[j+1]^=t^mixCol[s1^s2];state[j+2]^=t^mixCol[s2^s3];state[j+3]^=t^mixCol[s3^s0]}for(j=0,k=i*16;j<16;++j,++k){state[j]^=key[k]}}for(j=0;j<16;++j){state[j]=s[state[j]]}v=state[1];state[1]=state[5];state[5]=state[9];state[9]=state[13];state[13]=v;v=state[2];u=state[6];state[2]=state[10];state[6]=state[14];state[10]=v;state[14]=u;v=state[3];u=state[7];t=state[11];state[3]=state[15];state[7]=v;state[11]=u;state[15]=t;for(j=0,k=160;j<16;++j,++k){state[j]^=key[k]}return state}function AES128Cipher(key){this.key=expandKey128(key);this.buffer=new Uint8Array(16);this.bufferPosition=0}function decryptBlock2(data,finalize){var i,j,ii,sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition,result=[],iv=this.iv;for(i=0;i=ii;--i){if(lastBlock[i]!==psLen){psLen=0;break}}outputLength-=psLen;result[result.length-1]=lastBlock.subarray(0,16-psLen)}}var output=new Uint8Array(outputLength);for(i=0,j=0,ii=result.length;i=256){r=(r^27)&255}}for(var n=0;n<4;++n){result[j]=t1^=result[j-32];j++;result[j]=t2^=result[j-32];j++;result[j]=t3^=result[j-32];j++;result[j]=t4^=result[j-32];j++}}return result}function decrypt256(input,key){var state=new Uint8Array(16);state.set(input);var i,j,k;var t,u,v;for(j=0,k=224;j<16;++j,++k){state[j]^=key[k]}for(i=13;i>=1;--i){t=state[13];state[13]=state[9];state[9]=state[5];state[5]=state[1];state[1]=t;t=state[14];u=state[10];state[14]=state[6];state[10]=state[2];state[6]=t;state[2]=u;t=state[15];u=state[11];v=state[7];state[15]=state[3];state[11]=t;state[7]=u;state[3]=v;for(j=0;j<16;++j){state[j]=inv_s[state[j]]}for(j=0,k=i*16;j<16;++j,++k){state[j]^=key[k]}for(j=0;j<16;j+=4){var s0=mix[state[j]],s1=mix[state[j+1]],s2=mix[state[j+2]],s3=mix[state[j+3]];t=s0^s1>>>8^s1<<24^s2>>>16^s2<<16^s3>>>24^s3<<8;state[j]=t>>>24&255;state[j+1]=t>>16&255;state[j+2]=t>>8&255;state[j+3]=t&255}}t=state[13];state[13]=state[9];state[9]=state[5];state[5]=state[1];state[1]=t;t=state[14];u=state[10];state[14]=state[6];state[10]=state[2];state[6]=t;state[2]=u;t=state[15];u=state[11];v=state[7];state[15]=state[3];state[11]=t;state[7]=u;state[3]=v;for(j=0;j<16;++j){state[j]=inv_s[state[j]];state[j]^=key[j]}return state}function encrypt256(input,key){var t,u,v,k;var state=new Uint8Array(16);state.set(input);for(j=0;j<16;++j){state[j]^=key[j]}for(i=1;i<14;i++){for(j=0;j<16;++j){state[j]=s[state[j]]}v=state[1];state[1]=state[5];state[5]=state[9];state[9]=state[13];state[13]=v;v=state[2];u=state[6];state[2]=state[10];state[6]=state[14];state[10]=v;state[14]=u;v=state[3];u=state[7];t=state[11];state[3]=state[15];state[7]=v;state[11]=u;state[15]=t;for(var j=0;j<16;j+=4){var s0=state[j+0],s1=state[j+1];var s2=state[j+2],s3=state[j+3];t=s0^s1^s2^s3;state[j+0]^=t^mixCol[s0^s1];state[j+1]^=t^mixCol[s1^s2];state[j+2]^=t^mixCol[s2^s3];state[j+3]^=t^mixCol[s3^s0]}for(j=0,k=i*16;j<16;++j,++k){state[j]^=key[k]}}for(j=0;j<16;++j){state[j]=s[state[j]]}v=state[1];state[1]=state[5];state[5]=state[9];state[9]=state[13];state[13]=v;v=state[2];u=state[6];state[2]=state[10];state[6]=state[14];state[10]=v;state[14]=u;v=state[3];u=state[7];t=state[11];state[3]=state[15];state[7]=v;state[11]=u;state[15]=t;for(j=0,k=224;j<16;++j,++k){state[j]^=key[k]}return state}function AES256Cipher(key){this.key=expandKey256(key);this.buffer=new Uint8Array(16);this.bufferPosition=0}function decryptBlock2(data,finalize){var i,j,ii,sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition,result=[],iv=this.iv;for(i=0;i=ii;--i){if(lastBlock[i]!==psLen){psLen=0;break}}outputLength-=psLen;result[result.length-1]=lastBlock.subarray(0,16-psLen)}}var output=new Uint8Array(outputLength);for(i=0,j=0,ii=result.length;ii-32){var arrayLength=password.length+k.length+userBytes.length;var k1=new Uint8Array(arrayLength*64);var array=concatArrays(password,k);array=concatArrays(array,userBytes);for(var j=0,pos=0;j<64;j++,pos+=arrayLength){k1.set(array,pos)}var cipher=new AES128Cipher(k.subarray(0,16));e=cipher.encrypt(k1,k.subarray(16,32));var remainder=0;for(var z=0;z<16;z++){remainder*=256%3;remainder%=3;remainder+=(e[z]>>>0)%3;remainder%=3}if(remainder===0){k=calculateSHA256(e,0,e.length)}else if(remainder===1){k=calculateSHA384(e,0,e.length)}else if(remainder===2){k=calculateSHA512(e,0,e.length)}i++}return k.subarray(0,32)}function PDF20(){}function compareByteArrays(array1,array2){if(array1.length!==array2.length){return false}for(var i=0;i>8&255;hashData[i++]=flags>>16&255;hashData[i++]=flags>>>24&255;for(j=0,n=fileId.length;j=4&&!encryptMetadata){hashData[i++]=255;hashData[i++]=255;hashData[i++]=255;hashData[i++]=255}var hash=calculateMD5(hashData,0,i);var keyLengthInBytes=keyLength>>3;if(revision>=3){for(j=0;j<50;++j){hash=calculateMD5(hash,0,keyLengthInBytes)}}var encryptionKey=hash.subarray(0,keyLengthInBytes);var cipher,checkData;if(revision>=3){for(i=0;i<32;++i){hashData[i]=defaultPasswordBytes[i]}for(j=0,n=fileId.length;j>3;if(revision>=3){for(j=0;j<50;++j){hash=calculateMD5(hash,0,hash.length)}}var cipher,userPassword;if(revision>=3){userPassword=ownerPassword;var derivedKey=new Uint8Array(keyLengthInBytes),k;for(j=19;j>=0;j--){for(k=0;k=4){this.cf=dict.get("CF");this.stmf=dict.get("StmF")||identityName;this.strf=dict.get("StrF")||identityName;this.eff=dict.get("EFF")||this.stmf}}function buildObjectKey(num,gen,encryptionKey,isAes){var key=new Uint8Array(encryptionKey.length+9),i,n;for(i=0,n=encryptionKey.length;i>8&255;key[i++]=num>>16&255;key[i++]=gen&255;key[i++]=gen>>8&255;if(isAes){key[i++]=115;key[i++]=65;key[i++]=108;key[i++]=84}var hash=calculateMD5(key,0,i);return hash.subarray(0,Math.min(encryptionKey.length+5,16))}function buildCipherConstructor(cf,name,num,gen,key){var cryptFilter=cf.get(name.name);var cfm;if(cryptFilter!==null&&cryptFilter!==undefined){cfm=cryptFilter.get("CFM")}if(!cfm||cfm.name==="None"){return function cipherTransformFactoryBuildCipherConstructorNone(){return new NullCipher}}if("V2"===cfm.name){return function cipherTransformFactoryBuildCipherConstructorV2(){return new ARCFourCipher(buildObjectKey(num,gen,key,false))}}if("AESV2"===cfm.name){return function cipherTransformFactoryBuildCipherConstructorAESV2(){return new AES128Cipher(buildObjectKey(num,gen,key,true))}}if("AESV3"===cfm.name){return function cipherTransformFactoryBuildCipherConstructorAESV3(){return new AES256Cipher(key)}}error("Unknown crypto method")}CipherTransformFactory.prototype={createCipherTransform:function CipherTransformFactory_createCipherTransform(num,gen){if(this.algorithm===4||this.algorithm===5){return new CipherTransform(buildCipherConstructor(this.cf,this.stmf,num,gen,this.encryptionKey),buildCipherConstructor(this.cf,this.strf,num,gen,this.encryptionKey))}var key=buildObjectKey(num,gen,this.encryptionKey,false);var cipherConstructor=function buildCipherCipherConstructor(){return new ARCFourCipher(key)};return new CipherTransform(cipherConstructor,cipherConstructor)}};return CipherTransformFactory}();exports.AES128Cipher=AES128Cipher;exports.AES256Cipher=AES256Cipher;exports.ARCFourCipher=ARCFourCipher;exports.CipherTransformFactory=CipherTransformFactory;exports.PDF17=PDF17;exports.PDF20=PDF20;exports.calculateMD5=calculateMD5;exports.calculateSHA256=calculateSHA256;exports.calculateSHA384=calculateSHA384;exports.calculateSHA512=calculateSHA512});(function(root,factory){{factory(root.pdfjsCoreFontRenderer={},root.pdfjsSharedUtil,root.pdfjsCoreStream,root.pdfjsCoreGlyphList,root.pdfjsCoreEncodings)}})(this,function(exports,sharedUtil,coreStream,coreGlyphList,coreEncodings){var Util=sharedUtil.Util;var bytesToString=sharedUtil.bytesToString;var error=sharedUtil.error;var Stream=coreStream.Stream;var getGlyphsUnicode=coreGlyphList.getGlyphsUnicode;var StandardEncoding=coreEncodings.StandardEncoding;var coreFonts;var CFFParser;var FontRendererFactory=function FontRendererFactoryClosure(){function getLong(data,offset){return data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3]}function getUshort(data,offset){return data[offset]<<8|data[offset+1]}function parseCmap(data,start,end){var offset=getUshort(data,start+2)===1?getLong(data,start+8):getLong(data,start+16);var format=getUshort(data,start+offset);var length,ranges,p,i;if(format===4){length=getUshort(data,start+offset+2);var segCount=getUshort(data,start+offset+6)>>1;p=start+offset+14;ranges=[];for(i=0;i>1;if(code>16;var flags;var x=0,y=0;i+=10;if(numberOfContours<0){do{flags=code[i]<<8|code[i+1];var glyphIndex=code[i+2]<<8|code[i+3];i+=4;var arg1,arg2;if(flags&1){arg1=(code[i]<<24|code[i+1]<<16)>>16;arg2=(code[i+2]<<24|code[i+3]<<16)>>16;i+=4}else{arg1=code[i++];arg2=code[i++]}if(flags&2){x=arg1;y=arg2}else{x=0;y=0}var scaleX=1,scaleY=1,scale01=0,scale10=0;if(flags&8){scaleX=scaleY=(code[i]<<24|code[i+1]<<16)/1073741824;i+=2}else if(flags&64){scaleX=(code[i]<<24|code[i+1]<<16)/1073741824;scaleY=(code[i+2]<<24|code[i+3]<<16)/1073741824;i+=4}else if(flags&128){scaleX=(code[i]<<24|code[i+1]<<16)/1073741824;scale01=(code[i+2]<<24|code[i+3]<<16)/1073741824;scale10=(code[i+4]<<24|code[i+5]<<16)/1073741824;scaleY=(code[i+6]<<24|code[i+7]<<16)/1073741824;i+=8}var subglyph=font.glyphs[glyphIndex];if(subglyph){cmds.push({cmd:"save"});cmds.push({cmd:"transform",args:[scaleX,scale01,scale10,scaleY,x,y]});compileGlyf(subglyph,cmds,font);cmds.push({cmd:"restore"})}}while(flags&32)}else{var endPtsOfContours=[];var j,jj;for(j=0;j0){points.push({flags:flags})}}for(j=0;j>16;i+=2;break;case 2:x-=code[i++];break;case 18:x+=code[i++];break}points[j].x=x}for(j=0;j>16;i+=2;break;case 4:y-=code[i++];break;case 36:y+=code[i++];break}points[j].y=y}var startPoint=0;for(i=0;i>1;stackClean=true;break;case 3:stems+=stack.length>>1;stackClean=true;break;case 4:y+=stack.pop();moveTo(x,y);stackClean=true;break;case 5:while(stack.length>0){x+=stack.shift();y+=stack.shift();lineTo(x,y)}break;case 6:while(stack.length>0){x+=stack.shift();lineTo(x,y);if(stack.length===0){break}y+=stack.shift();lineTo(x,y)}break;case 7:while(stack.length>0){y+=stack.shift();lineTo(x,y);if(stack.length===0){break}x+=stack.shift();lineTo(x,y)}break;case 8:while(stack.length>0){xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y)}break;case 10:n=stack.pop()+font.subrsBias;subrCode=font.subrs[n];if(subrCode){parse(subrCode)}break;case 11:return;case 12:v=code[i++];switch(v){case 34:xa=x+stack.shift();xb=xa+stack.shift();y1=y+stack.shift();x=xb+stack.shift();bezierCurveTo(xa,y,xb,y1,x,y1);xa=x+stack.shift();xb=xa+stack.shift();x=xb+stack.shift();bezierCurveTo(xa,y1,xb,y,x,y);break;case 35:xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y);xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y);stack.pop();break;case 36:xa=x+stack.shift();y1=y+stack.shift();xb=xa+stack.shift();y2=y1+stack.shift();x=xb+stack.shift();bezierCurveTo(xa,y1,xb,y2,x,y2);xa=x+stack.shift();xb=xa+stack.shift();y3=y2+stack.shift();x=xb+stack.shift();bezierCurveTo(xa,y2,xb,y3,x,y);break;case 37:var x0=x,y0=y;xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y);xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb;y=yb;if(Math.abs(x-x0)>Math.abs(y-y0)){x+=stack.shift()}else{y+=stack.shift()}bezierCurveTo(xa,ya,xb,yb,x,y);break;default:error("unknown operator: 12 "+v)}break;case 14:if(stack.length>=4){var achar=stack.pop();var bchar=stack.pop();y=stack.pop();x=stack.pop();cmds.push({cmd:"save"});cmds.push({cmd:"translate",args:[x,y]});var gid=lookupCmap(font.cmap,String.fromCharCode(font.glyphNameMap[StandardEncoding[achar]]));compileCharString(font.glyphs[gid],cmds,font);cmds.push({cmd:"restore"});gid=lookupCmap(font.cmap,String.fromCharCode(font.glyphNameMap[StandardEncoding[bchar]]));compileCharString(font.glyphs[gid],cmds,font)}return;case 18:stems+=stack.length>>1;stackClean=true;break;case 19:stems+=stack.length>>1;i+=stems+7>>3;stackClean=true;break;case 20:stems+=stack.length>>1;i+=stems+7>>3;stackClean=true;break;case 21:y+=stack.pop();x+=stack.pop();moveTo(x,y);stackClean=true;break;case 22:x+=stack.pop();moveTo(x,y);stackClean=true;break;case 23:stems+=stack.length>>1;stackClean=true;break;case 24:while(stack.length>2){xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y)}x+=stack.shift();y+=stack.shift();lineTo(x,y);break;case 25:while(stack.length>6){x+=stack.shift();y+=stack.shift();lineTo(x,y)}xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y);break;case 26:if(stack.length%2){x+=stack.shift()}while(stack.length>0){xa=x;ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb;y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y)}break;case 27:if(stack.length%2){y+=stack.shift()}while(stack.length>0){xa=x+stack.shift();ya=y;xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb;bezierCurveTo(xa,ya,xb,yb,x,y)}break;case 28:stack.push((code[i]<<24|code[i+1]<<16)>>16);i+=2;break;case 29:n=stack.pop()+font.gsubrsBias;subrCode=font.gsubrs[n];if(subrCode){parse(subrCode)}break;case 30:while(stack.length>0){xa=x;ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+(stack.length===1?stack.shift():0);bezierCurveTo(xa,ya,xb,yb,x,y);if(stack.length===0){break}xa=x+stack.shift();ya=y;xb=xa+stack.shift();yb=ya+stack.shift();y=yb+stack.shift();x=xb+(stack.length===1?stack.shift():0);bezierCurveTo(xa,ya,xb,yb,x,y)}break;case 31:while(stack.length>0){xa=x+stack.shift();ya=y;xb=xa+stack.shift();yb=ya+stack.shift();y=yb+stack.shift();x=xb+(stack.length===1?stack.shift():0);bezierCurveTo(xa,ya,xb,yb,x,y);if(stack.length===0){break}xa=x;ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+(stack.length===1?stack.shift():0);bezierCurveTo(xa,ya,xb,yb,x,y)}break;default:if(v<32){error("unknown operator: "+v)}if(v<247){stack.push(v-139)}else if(v<251){stack.push((v-247)*256+code[i++]+108)}else if(v<255){stack.push(-(v-251)*256-code[i++]-108)}else{stack.push((code[i]<<24|code[i+1]<<16|code[i+2]<<8|code[i+3])/65536);i+=4}break}if(stackClean){stack.length=0}}}parse(code)}var noop="";function CompiledFont(fontMatrix){this.compiledGlyphs=Object.create(null);this.fontMatrix=fontMatrix}CompiledFont.prototype={getPathJs:function(unicode){var gid=lookupCmap(this.cmap,unicode);var fn=this.compiledGlyphs[gid];if(!fn){this.compiledGlyphs[gid]=fn=this.compileGlyph(this.glyphs[gid])}return fn},compileGlyph:function(code){if(!code||code.length===0||code[0]===14){return noop}var cmds=[];cmds.push({cmd:"save"});cmds.push({cmd:"transform",args:this.fontMatrix.slice()});cmds.push({cmd:"scale",args:["size","-size"]});this.compileGlyphImpl(code,cmds);cmds.push({cmd:"restore"});return cmds},compileGlyphImpl:function(){error("Children classes should implement this.")},hasBuiltPath:function(unicode){var gid=lookupCmap(this.cmap,unicode);return gid in this.compiledGlyphs}};function TrueTypeCompiled(glyphs,cmap,fontMatrix){fontMatrix=fontMatrix||[488e-6,0,0,488e-6,0,0];CompiledFont.call(this,fontMatrix);this.glyphs=glyphs;this.cmap=cmap;this.compiledGlyphs=[]}Util.inherit(TrueTypeCompiled,CompiledFont,{compileGlyphImpl:function(code,cmds){compileGlyf(code,cmds,this)}});function Type2Compiled(cffInfo,cmap,fontMatrix,glyphNameMap){fontMatrix=fontMatrix||[.001,0,0,.001,0,0];CompiledFont.call(this,fontMatrix);this.glyphs=cffInfo.glyphs;this.gsubrs=cffInfo.gsubrs||[];this.subrs=cffInfo.subrs||[];this.cmap=cmap;this.glyphNameMap=glyphNameMap||getGlyphsUnicode();this.compiledGlyphs=[];this.gsubrsBias=this.gsubrs.length<1240?107:this.gsubrs.length<33900?1131:32768;this.subrsBias=this.subrs.length<1240?107:this.subrs.length<33900?1131:32768}Util.inherit(Type2Compiled,CompiledFont,{compileGlyphImpl:function(code,cmds){compileCharString(code,cmds,this)}});return{create:function FontRendererFactory_create(font){var data=new Uint8Array(font.data);var cmap,glyf,loca,cff,indexToLocFormat,unitsPerEm;var numTables=getUshort(data,4);for(var i=0,p=12;i>")&&!isEOF(this.buf1)){if(!isName(this.buf1)){info("Malformed dictionary: key must be a name object");this.shift();continue}var key=this.buf1.name;this.shift();if(isEOF(this.buf1)){break}dict.set(key,this.getObj(cipherTransform))}if(isEOF(this.buf1)){error("End of file inside dictionary")}if(isCmd(this.buf2,"stream")){return this.allowStreams?this.makeStream(dict,cipherTransform):dict}this.shift();return dict;default:return buf1}}if(isInt(buf1)){var num=buf1;if(isInt(this.buf1)&&isCmd(this.buf2,"R")){var ref=new Ref(num,this.buf1);this.shift();this.shift();return ref}return num}if(isString(buf1)){var str=buf1;if(cipherTransform){str=cipherTransform.decryptString(str)}return str}return buf1},findDefaultInlineStreamEnd:function Parser_findDefaultInlineStreamEnd(stream){var E=69,I=73,SPACE=32,LF=10,CR=13;var startPos=stream.pos,state=0,ch,i,n,followingBytes;while((ch=stream.getByte())!==-1){if(state===0){state=ch===E?1:0}else if(state===1){state=ch===I?2:0}else{assert(state===2);if(ch===SPACE||ch===LF||ch===CR){n=5;followingBytes=stream.peekBytes(n);for(i=0;i127)){state=0;break}}if(state===2){break}}else{state=0}}}return stream.pos-4-startPos},findDCTDecodeInlineStreamEnd:function Parser_findDCTDecodeInlineStreamEnd(stream){var startPos=stream.pos,foundEOI=false,b,markerLength,length;while((b=stream.getByte())!==-1){if(b!==255){continue}switch(stream.getByte()){case 0:break;case 255:stream.skip(-1);break;case 217:foundEOI=true;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:markerLength=stream.getUint16();if(markerLength>2){stream.skip(markerLength-2)}else{stream.skip(-2)}break}if(foundEOI){break}}length=stream.pos-startPos;if(b===-1){warn("Inline DCTDecode image stream: "+"EOI marker not found, searching for /EI/ instead.");stream.skip(-length);return this.findDefaultInlineStreamEnd(stream)}this.inlineStreamSkipEI(stream);return length},findASCII85DecodeInlineStreamEnd:function Parser_findASCII85DecodeInlineStreamEnd(stream){var TILDE=126,GT=62;var startPos=stream.pos,ch,length;while((ch=stream.getByte())!==-1){if(ch===TILDE&&stream.peekByte()===GT){stream.skip();break}}length=stream.pos-startPos;if(ch===-1){warn("Inline ASCII85Decode image stream: "+"EOD marker not found, searching for /EI/ instead.");stream.skip(-length);return this.findDefaultInlineStreamEnd(stream)}this.inlineStreamSkipEI(stream);return length},findASCIIHexDecodeInlineStreamEnd:function Parser_findASCIIHexDecodeInlineStreamEnd(stream){var GT=62;var startPos=stream.pos,ch,length;while((ch=stream.getByte())!==-1){if(ch===GT){break}}length=stream.pos-startPos;if(ch===-1){warn("Inline ASCIIHexDecode image stream: "+"EOD marker not found, searching for /EI/ instead.");stream.skip(-length);return this.findDefaultInlineStreamEnd(stream)}this.inlineStreamSkipEI(stream);return length},inlineStreamSkipEI:function Parser_inlineStreamSkipEI(stream){var E=69,I=73;var state=0,ch;while((ch=stream.getByte())!==-1){if(state===0){state=ch===E?1:0}else if(state===1){state=ch===I?2:0}else if(state===2){break}}},makeInlineImage:function Parser_makeInlineImage(cipherTransform){var lexer=this.lexer;var stream=lexer.stream;var dict=new Dict(this.xref);while(!isCmd(this.buf1,"ID")&&!isEOF(this.buf1)){if(!isName(this.buf1)){error("Dictionary key must be a name object")}var key=this.buf1.name;this.shift();if(isEOF(this.buf1)){break}dict.set(key,this.getObj(cipherTransform))}var filter=dict.get("Filter","F"),filterName;if(isName(filter)){filterName=filter.name}else if(isArray(filter)&&isName(filter[0])){filterName=filter[0].name}var startPos=stream.pos,length,i,ii;if(filterName==="DCTDecode"||filterName==="DCT"){length=this.findDCTDecodeInlineStreamEnd(stream)}else if(filterName==="ASCII85Decide"||filterName==="A85"){length=this.findASCII85DecodeInlineStreamEnd(stream)}else if(filterName==="ASCIIHexDecode"||filterName==="AHx"){length=this.findASCIIHexDecodeInlineStreamEnd(stream)}else{length=this.findDefaultInlineStreamEnd(stream)}var imageStream=stream.makeSubStream(startPos,length,dict);var adler32;if(length=ENDSTREAM_SIGNATURE_LENGTH){found=true;break}i++}if(found){skipped+=i;stream.pos+=i;break}skipped+=scanLength;stream.pos+=scanLength}if(!found){error("Missing endstream")}length=skipped;lexer.nextChar();this.shift();this.shift()}this.shift();stream=stream.makeSubStream(pos,length,dict);if(cipherTransform){stream=cipherTransform.createStream(stream,length)}stream=this.filter(stream,dict,length);stream.dict=dict;return stream},filter:function Parser_filter(stream,dict,length){var filter=dict.get("Filter","F");var params=dict.get("DecodeParms","DP");if(isName(filter)){return this.makeFilter(stream,filter.name,length,params)}var maybeLength=length;if(isArray(filter)){var filterArray=filter;var paramsArray=params;for(var i=0,ii=filterArray.length;i=48&&ch<=57){return ch&15}if(ch>=65&&ch<=70||ch>=97&&ch<=102){return(ch&15)+9}return-1}Lexer.prototype={nextChar:function Lexer_nextChar(){return this.currentChar=this.stream.getByte()},peekChar:function Lexer_peekChar(){return this.stream.peekByte()},getNumber:function Lexer_getNumber(){var ch=this.currentChar;var eNotation=false;var divideBy=0;var sign=1;if(ch===45){sign=-1;ch=this.nextChar();if(ch===45){ch=this.nextChar()}}else if(ch===43){ch=this.nextChar()}if(ch===46){divideBy=10;ch=this.nextChar()}if(ch<48||ch>57){error("Invalid number: "+String.fromCharCode(ch));return 0}var baseValue=ch-48;var powerValue=0;var powerValueSign=1;while((ch=this.nextChar())>=0){if(48<=ch&&ch<=57){var currentDigit=ch-48;if(eNotation){powerValue=powerValue*10+currentDigit}else{if(divideBy!==0){divideBy*=10}baseValue=baseValue*10+currentDigit}}else if(ch===46){if(divideBy===0){divideBy=1}else{break}}else if(ch===45){warn("Badly formated number")}else if(ch===69||ch===101){ch=this.peekChar();if(ch===43||ch===45){powerValueSign=ch===45?-1:1;this.nextChar()}else if(ch<48||ch>57){break}eNotation=true}else{break}}if(divideBy!==0){baseValue/=divideBy}if(eNotation){baseValue*=Math.pow(10,powerValueSign*powerValue)}return sign*baseValue},getString:function Lexer_getString(){var numParen=1;var done=false;var strBuf=this.strBuf;strBuf.length=0;var ch=this.nextChar();while(true){var charBuffered=false;switch(ch|0){case-1:warn("Unterminated string");done=true;break;case 40:++numParen;strBuf.push("(");break;case 41:if(--numParen===0){this.nextChar();done=true}else{strBuf.push(")")}break;case 92:ch=this.nextChar();switch(ch){case-1:warn("Unterminated string");done=true;break;case 110:strBuf.push("\n");break;case 114:strBuf.push("\r");break;case 116:strBuf.push(" ");break;case 98:strBuf.push("\b");break;case 102:strBuf.push("\f");break;case 92:case 40:case 41:strBuf.push(String.fromCharCode(ch));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:var x=ch&15;ch=this.nextChar();charBuffered=true;if(ch>=48&&ch<=55){x=(x<<3)+(ch&15);ch=this.nextChar();if(ch>=48&&ch<=55){charBuffered=false;x=(x<<3)+(ch&15)}}strBuf.push(String.fromCharCode(x));break;case 13:if(this.peekChar()===10){this.nextChar()}break;case 10:break;default:strBuf.push(String.fromCharCode(ch));break}break;default:strBuf.push(String.fromCharCode(ch));break}if(done){break}if(!charBuffered){ch=this.nextChar()}}return strBuf.join("")},getName:function Lexer_getName(){var ch,previousCh;var strBuf=this.strBuf;strBuf.length=0;while((ch=this.nextChar())>=0&&!specialChars[ch]){if(ch===35){ch=this.nextChar();if(specialChars[ch]){warn("Lexer_getName: "+"NUMBER SIGN (#) should be followed by a hexadecimal number.");strBuf.push("#");break}var x=toHexDigit(ch);if(x!==-1){previousCh=ch;ch=this.nextChar();var x2=toHexDigit(ch);if(x2===-1){warn("Lexer_getName: Illegal digit ("+String.fromCharCode(ch)+") in hexadecimal number.");strBuf.push("#",String.fromCharCode(previousCh));if(specialChars[ch]){break}strBuf.push(String.fromCharCode(ch));continue}strBuf.push(String.fromCharCode(x<<4|x2))}else{strBuf.push("#",String.fromCharCode(ch))}}else{strBuf.push(String.fromCharCode(ch))}}if(strBuf.length>127){warn("name token is longer than allowed by the spec: "+strBuf.length)}return Name.get(strBuf.join(""))},getHexString:function Lexer_getHexString(){var strBuf=this.strBuf;strBuf.length=0;var ch=this.currentChar;var isFirstHex=true;var firstDigit;var secondDigit;while(true){if(ch<0){warn("Unterminated hex string");break}else if(ch===62){this.nextChar();break}else if(specialChars[ch]===1){ch=this.nextChar();continue}else{if(isFirstHex){firstDigit=toHexDigit(ch);if(firstDigit===-1){warn('Ignoring invalid character "'+ch+'" in hex string');ch=this.nextChar();continue}}else{secondDigit=toHexDigit(ch);if(secondDigit===-1){warn('Ignoring invalid character "'+ch+'" in hex string');ch=this.nextChar();continue}strBuf.push(String.fromCharCode(firstDigit<<4|secondDigit))}isFirstHex=!isFirstHex;ch=this.nextChar()}}return strBuf.join("")},getObj:function Lexer_getObj(){var comment=false;var ch=this.currentChar;while(true){if(ch<0){return EOF}if(comment){if(ch===10||ch===13){comment=false}}else if(ch===37){comment=true}else if(specialChars[ch]!==1){break}ch=this.nextChar()}switch(ch|0){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:this.nextChar();return Cmd.get("[");case 93:this.nextChar();return Cmd.get("]");case 60:ch=this.nextChar();if(ch===60){this.nextChar();return Cmd.get("<<")}return this.getHexString();case 62:ch=this.nextChar();if(ch===62){this.nextChar();return Cmd.get(">>")}return Cmd.get(">");case 123:this.nextChar();return Cmd.get("{");case 125:this.nextChar();return Cmd.get("}");case 41:error("Illegal character: "+ch);break}var str=String.fromCharCode(ch);var knownCommands=this.knownCommands;var knownCommandFound=knownCommands&&knownCommands[str]!==undefined;while((ch=this.nextChar())>=0&&!specialChars[ch]){var possibleCommand=str+String.fromCharCode(ch);if(knownCommandFound&&knownCommands[possibleCommand]===undefined){break}if(str.length===128){error("Command token too long: "+str.length)}str=possibleCommand;knownCommandFound=knownCommands&&knownCommands[str]!==undefined}if(str==="true"){return true}if(str==="false"){return false}if(str==="null"){return null}return Cmd.get(str)},skipToNextLine:function Lexer_skipToNextLine(){var ch=this.currentChar;while(ch>=0){if(ch===13){ch=this.nextChar();if(ch===10){this.nextChar()}break}else if(ch===10){this.nextChar();break}ch=this.nextChar()}}};return Lexer}();var Linearization={create:function LinearizationCreate(stream){function getInt(name,allowZeroValue){var obj=linDict.get(name);if(isInt(obj)&&(allowZeroValue?obj>=0:obj>0)){return obj}throw new Error('The "'+name+'" parameter in the linearization '+"dictionary is invalid.")}function getHints(){var hints=linDict.get("H"),hintsLength,item;if(isArray(hints)&&((hintsLength=hints.length)===2||hintsLength===4)){for(var index=0;index0)){throw new Error("Hint ("+index+") in the linearization dictionary is invalid.")}}return hints}throw new Error("Hint array in the linearization dictionary is invalid.")}var parser=new Parser(new Lexer(stream),false,null);var obj1=parser.getObj();var obj2=parser.getObj();var obj3=parser.getObj();var linDict=parser.getObj();var obj,length;if(!(isInt(obj1)&&isInt(obj2)&&isCmd(obj3,"obj")&&isDict(linDict)&&isNum(obj=linDict.get("Linearized"))&&obj>0)){return null}else if((length=getInt("L"))!==stream.length){throw new Error('The "L" parameter in the linearization dictionary '+"does not equal the stream length.")}return{length:length,hints:getHints(),objectNumberFirst:getInt("O"),endFirst:getInt("E"),numPages:getInt("N"),mainXRefEntriesOffset:getInt("T"),pageFirst:linDict.has("P")?getInt("P",true):0}}};exports.EOF=EOF;exports.Lexer=Lexer;exports.Linearization=Linearization;exports.Parser=Parser;exports.isEOF=isEOF;coreStream._setCoreParser(exports)});(function(root,factory){{factory(root.pdfjsCoreCMap={},root.pdfjsSharedUtil,root.pdfjsCorePrimitives,root.pdfjsCoreStream,root.pdfjsCoreParser)}})(this,function(exports,sharedUtil,corePrimitives,coreStream,coreParser){var Util=sharedUtil.Util;var assert=sharedUtil.assert;var error=sharedUtil.error;var isInt=sharedUtil.isInt;var isString=sharedUtil.isString;var warn=sharedUtil.warn;var isName=corePrimitives.isName;var isCmd=corePrimitives.isCmd;var isStream=corePrimitives.isStream;var StringStream=coreStream.StringStream;var Lexer=coreParser.Lexer;var isEOF=coreParser.isEOF;var BUILT_IN_CMAPS=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"];var CMap=function CMapClosure(){function CMap(builtInCMap){this.codespaceRanges=[[],[],[],[]];this.numCodespaceRanges=0;this._map=[];this.name="";this.vertical=false;this.useCMap=null;this.builtInCMap=builtInCMap}CMap.prototype={addCodespaceRange:function(n,low,high){this.codespaceRanges[n-1].push(low,high);this.numCodespaceRanges++},mapCidRange:function(low,high,dstLow){while(low<=high){this._map[low++]=dstLow++}},mapBfRange:function(low,high,dstLow){var lastByte=dstLow.length-1;while(low<=high){this._map[low++]=dstLow;dstLow=dstLow.substr(0,lastByte)+String.fromCharCode(dstLow.charCodeAt(lastByte)+1)}},mapBfRangeToArray:function(low,high,array){var i=0,ii=array.length;while(low<=high&&i>>0;var codespaceRange=codespaceRanges[n];for(var k=0,kk=codespaceRange.length;k=low&&c<=high){out.charcode=c;out.length=n+1;return}}}out.charcode=0;out.length=1},get length(){return this._map.length},get isIdentityCMap(){if(!(this.name==="Identity-H"||this.name==="Identity-V")){return false}if(this._map.length!==65536){return false}for(var i=0;i<65536;i++){if(this._map[i]!==i){return false}}return true}};return CMap}();var IdentityCMap=function IdentityCMapClosure(){function IdentityCMap(vertical,n){CMap.call(this);this.vertical=vertical;this.addCodespaceRange(n,0,65535)}Util.inherit(IdentityCMap,CMap,{});IdentityCMap.prototype={addCodespaceRange:CMap.prototype.addCodespaceRange,mapCidRange:function(low,high,dstLow){error("should not call mapCidRange")},mapBfRange:function(low,high,dstLow){error("should not call mapBfRange")},mapBfRangeToArray:function(low,high,array){error("should not call mapBfRangeToArray")},mapOne:function(src,dst){error("should not call mapCidOne")},lookup:function(code){return isInt(code)&&code<=65535?code:undefined},contains:function(code){return isInt(code)&&code<=65535},forEach:function(callback){for(var i=0;i<=65535;i++){callback(i,i)}},charCodeOf:function(value){return isInt(value)&&value<=65535?value:-1},getMap:function(){var map=new Array(65536);for(var i=0;i<=65535;i++){map[i]=i}return map},readCharCode:CMap.prototype.readCharCode,get length(){return 65536},get isIdentityCMap(){error("should not access .isIdentityCMap")}};return IdentityCMap}();var BinaryCMapReader=function BinaryCMapReaderClosure(){function fetchBinaryData(url){var nonBinaryRequest=PDFJS.disableWorker;var request=new XMLHttpRequest;request.open("GET",url,false);if(!nonBinaryRequest){try{request.responseType="arraybuffer";nonBinaryRequest=request.responseType!=="arraybuffer"}catch(e){nonBinaryRequest=true}}if(nonBinaryRequest&&request.overrideMimeType){request.overrideMimeType("text/plain; charset=x-user-defined")}request.send(null);if(nonBinaryRequest?!request.responseText:!request.response){error("Unable to get binary cMap at: "+url)}if(nonBinaryRequest){var data=Array.prototype.map.call(request.responseText,function(ch){return ch.charCodeAt(0)&255});return new Uint8Array(data)}return new Uint8Array(request.response)}function hexToInt(a,size){var n=0;for(var i=0;i<=size;i++){n=n<<8|a[i]}return n>>>0}function hexToStr(a,size){if(size===1){return String.fromCharCode(a[0],a[1])}if(size===3){return String.fromCharCode(a[0],a[1],a[2],a[3])}return String.fromCharCode.apply(null,a.subarray(0,size+1))}function addHex(a,b,size){var c=0;for(var i=size;i>=0;i--){c+=a[i]+b[i];a[i]=c&255;c>>=8}}function incHex(a,size){var c=1;for(var i=size;i>=0&&c>0;i--){c+=a[i];a[i]=c&255;c>>=8}}var MAX_NUM_SIZE=16;var MAX_ENCODED_NUM_SIZE=19;function BinaryCMapStream(data){this.buffer=data;this.pos=0;this.end=data.length;this.tmpBuf=new Uint8Array(MAX_ENCODED_NUM_SIZE)}BinaryCMapStream.prototype={readByte:function(){if(this.pos>=this.end){return-1}return this.buffer[this.pos++]},readNumber:function(){var n=0;var last;do{var b=this.readByte();if(b<0){error("unexpected EOF in bcmap")}last=!(b&128);n=n<<7|b&127}while(!last);return n},readSigned:function(){var n=this.readNumber();return n&1?~(n>>>1):n>>>1},readHex:function(num,size){num.set(this.buffer.subarray(this.pos,this.pos+size+1));this.pos+=size+1},readHexNumber:function(num,size){var last;var stack=this.tmpBuf,sp=0;do{var b=this.readByte();if(b<0){error("unexpected EOF in bcmap")}last=!(b&128);stack[sp++]=b&127}while(!last);var i=size,buffer=0,bufferSize=0;while(i>=0){while(bufferSize<8&&stack.length>0){buffer=stack[--sp]<>=8;bufferSize-=8}},readHexSigned:function(num,size){this.readHexNumber(num,size);var sign=num[size]&1?255:0;var c=0;for(var i=0;i<=size;i++){c=(c&1)<<8|num[i];num[i]=c>>1^sign}},readString:function(){var len=this.readNumber();var s="";for(var i=0;i=0){var type=b>>5;if(type===7){switch(b&31){case 0:stream.readString();break;case 1:useCMap=stream.readString();break}continue}var sequence=!!(b&16);var dataSize=b&15;assert(dataSize+1<=MAX_NUM_SIZE);var ucs2DataSize=1;var subitemsCount=stream.readNumber();var i;switch(type){case 0:stream.readHex(start,dataSize);stream.readHexNumber(end,dataSize);addHex(end,start,dataSize);cMap.addCodespaceRange(dataSize+1,hexToInt(start,dataSize),hexToInt(end,dataSize));for(i=1;i>>0}function expectString(obj){if(!isString(obj)){error("Malformed CMap: expected string.")}}function expectInt(obj){if(!isInt(obj)){error("Malformed CMap: expected int.")}}function parseBfChar(cMap,lexer){while(true){var obj=lexer.getObj();if(isEOF(obj)){break}if(isCmd(obj,"endbfchar")){return}expectString(obj);var src=strToInt(obj);obj=lexer.getObj();expectString(obj);var dst=obj;cMap.mapOne(src,dst)}}function parseBfRange(cMap,lexer){while(true){var obj=lexer.getObj();if(isEOF(obj)){break}if(isCmd(obj,"endbfrange")){return}expectString(obj);var low=strToInt(obj);obj=lexer.getObj();expectString(obj);var high=strToInt(obj);obj=lexer.getObj();if(isInt(obj)||isString(obj)){var dstLow=isInt(obj)?String.fromCharCode(obj):obj; +cMap.mapBfRange(low,high,dstLow)}else if(isCmd(obj,"[")){obj=lexer.getObj();var array=[];while(!isCmd(obj,"]")&&!isEOF(obj)){array.push(obj);obj=lexer.getObj()}cMap.mapBfRangeToArray(low,high,array)}else{break}}error("Invalid bf range.")}function parseCidChar(cMap,lexer){while(true){var obj=lexer.getObj();if(isEOF(obj)){break}if(isCmd(obj,"endcidchar")){return}expectString(obj);var src=strToInt(obj);obj=lexer.getObj();expectInt(obj);var dst=obj;cMap.mapOne(src,dst)}}function parseCidRange(cMap,lexer){while(true){var obj=lexer.getObj();if(isEOF(obj)){break}if(isCmd(obj,"endcidrange")){return}expectString(obj);var low=strToInt(obj);obj=lexer.getObj();expectString(obj);var high=strToInt(obj);obj=lexer.getObj();expectInt(obj);var dstLow=obj;cMap.mapCidRange(low,high,dstLow)}}function parseCodespaceRange(cMap,lexer){while(true){var obj=lexer.getObj();if(isEOF(obj)){break}if(isCmd(obj,"endcodespacerange")){return}if(!isString(obj)){break}var low=strToInt(obj);obj=lexer.getObj();if(!isString(obj)){break}var high=strToInt(obj);cMap.addCodespaceRange(obj.length,low,high)}error("Invalid codespace range.")}function parseWMode(cMap,lexer){var obj=lexer.getObj();if(isInt(obj)){cMap.vertical=!!obj}}function parseCMapName(cMap,lexer){var obj=lexer.getObj();if(isName(obj)&&isString(obj.name)){cMap.name=obj.name}}function parseCMap(cMap,lexer,builtInCMapParams,useCMap){var previous;var embededUseCMap;objLoop:while(true){var obj=lexer.getObj();if(isEOF(obj)){break}else if(isName(obj)){if(obj.name==="WMode"){parseWMode(cMap,lexer)}else if(obj.name==="CMapName"){parseCMapName(cMap,lexer)}previous=obj}else if(isCmd(obj)){switch(obj.cmd){case"endcmap":break objLoop;case"usecmap":if(isName(previous)){embededUseCMap=previous.name}break;case"begincodespacerange":parseCodespaceRange(cMap,lexer);break;case"beginbfchar":parseBfChar(cMap,lexer);break;case"begincidchar":parseCidChar(cMap,lexer);break;case"beginbfrange":parseBfRange(cMap,lexer);break;case"begincidrange":parseCidRange(cMap,lexer);break}}}if(!useCMap&&embededUseCMap){useCMap=embededUseCMap}if(useCMap){extendCMap(cMap,builtInCMapParams,useCMap)}}function extendCMap(cMap,builtInCMapParams,useCMap){cMap.useCMap=createBuiltInCMap(useCMap,builtInCMapParams);if(cMap.numCodespaceRanges===0){var useCodespaceRanges=cMap.useCMap.codespaceRanges;for(var i=0;i0){var i=queue.shift();var outlineDict=xref.fetchIfRef(i.obj);if(outlineDict===null){continue}if(!outlineDict.has("Title")){error("Invalid outline item")}var actionDict=outlineDict.get("A"),dest=null,url=null;if(actionDict){var destEntry=actionDict.get("D");if(destEntry){dest=destEntry}else{var uriEntry=actionDict.get("URI");if(isString(uriEntry)&&isValidUrl(uriEntry,false)){url=uriEntry}}}else if(outlineDict.has("Dest")){dest=outlineDict.getRaw("Dest");if(isName(dest)){dest=dest.name}}var title=outlineDict.get("Title");var outlineItem={dest:dest,url:url,title:stringToPDFString(title),color:outlineDict.get("C")||[0,0,0],count:outlineDict.get("Count"),bold:!!(outlineDict.get("F")&2),italic:!!(outlineDict.get("F")&1),items:[]};i.parent.items.push(outlineItem);obj=outlineDict.getRaw("First");if(isRef(obj)&&!processed.has(obj)){queue.push({obj:obj,parent:outlineItem});processed.put(obj)}obj=outlineDict.getRaw("Next");if(isRef(obj)&&!processed.has(obj)){queue.push({obj:obj,parent:i.parent});processed.put(obj)}}}}return root.items.length>0?root.items:null},get numPages(){var obj=this.toplevelPagesDict.get("Count");assert(isInt(obj),"page count in top level pages object is not an integer");return shadow(this,"num",obj)},get destinations(){function fetchDestination(dest){return isDict(dest)?dest.get("D"):dest}var xref=this.xref;var dests={},nameTreeRef,nameDictionaryRef;var obj=this.catDict.get("Names");if(obj&&obj.has("Dests")){nameTreeRef=obj.getRaw("Dests")}else if(this.catDict.has("Dests")){nameDictionaryRef=this.catDict.get("Dests")}if(nameDictionaryRef){obj=nameDictionaryRef;obj.forEach(function catalogForEach(key,value){if(!value){return}dests[key]=fetchDestination(value)})}if(nameTreeRef){var nameTree=new NameTree(nameTreeRef,xref);var names=nameTree.getAll();for(var name in names){dests[name]=fetchDestination(names[name])}}return shadow(this,"destinations",dests)},getDestination:function Catalog_getDestination(destinationId){function fetchDestination(dest){return isDict(dest)?dest.get("D"):dest}var xref=this.xref;var dest=null,nameTreeRef,nameDictionaryRef;var obj=this.catDict.get("Names");if(obj&&obj.has("Dests")){nameTreeRef=obj.getRaw("Dests")}else if(this.catDict.has("Dests")){nameDictionaryRef=this.catDict.get("Dests")}if(nameDictionaryRef){var value=nameDictionaryRef.get(destinationId);if(value){dest=fetchDestination(value)}}if(nameTreeRef){var nameTree=new NameTree(nameTreeRef,xref);dest=fetchDestination(nameTree.get(destinationId))}return dest},get pageLabels(){var obj=null;try{obj=this.readPageLabels()}catch(ex){if(ex instanceof MissingDataException){throw ex}warn("Unable to read page labels.")}return shadow(this,"pageLabels",obj)},readPageLabels:function Catalog_readPageLabels(){var obj=this.catDict.getRaw("PageLabels");if(!obj){return null}var pageLabels=new Array(this.numPages);var style=null;var prefix="";var start=1;var numberTree=new NumberTree(obj,this.xref);var nums=numberTree.getAll();var currentLabel="",currentIndex=1;for(var i=0,ii=this.numPages;i=0;last--){nodesToVisit.push(kids[last])}}}capability.reject("Page index "+pageIndex+" not found.")}next();return capability.promise},getPageIndex:function Catalog_getPageIndex(ref){var xref=this.xref;function pagesBeforeRef(kidRef){var total=0;var parentRef;return xref.fetchAsync(kidRef).then(function(node){if(!node){return null}parentRef=node.getRaw("Parent");return node.getAsync("Parent")}).then(function(parent){if(!parent){return null}return parent.getAsync("Kids")}).then(function(kids){if(!kids){return null}var kidPromises=[];var found=false;for(var i=0;i0){var first=entryRanges[0];var n=entryRanges[1];if(!isInt(first)||!isInt(n)){error("Invalid XRef range fields: "+first+", "+n)}if(!isInt(typeFieldWidth)||!isInt(offsetFieldWidth)||!isInt(generationFieldWidth)){error("Invalid XRef entry fields length: "+first+", "+n)}for(i=streamState.entryNum;i=data.length){break}token+=String.fromCharCode(ch);ch=data[offset]}return token}function skipUntil(data,offset,what){var length=what.length,dataLength=data.length;var skipped=0;while(offset=length){break}offset++;skipped++}return skipped}var objRegExp=/^(\d+)\s+(\d+)\s+obj\b/;var trailerBytes=new Uint8Array([116,114,97,105,108,101,114]);var startxrefBytes=new Uint8Array([115,116,97,114,116,120,114,101,102]);var endobjBytes=new Uint8Array([101,110,100,111,98,106]);var xrefBytes=new Uint8Array([47,88,82,101,102]);this.entries.length=0;var stream=this.stream;stream.pos=0;var buffer=stream.getBytes();var position=stream.start,length=buffer.length;var trailers=[],xrefStms=[];while(position=length){break}ch=buffer[position]}while(ch!==LF&&ch!==CR);continue}var token=readToken(buffer,position);var m;if(token.indexOf("xref")===0&&(token.length===4||/\s/.test(token[4]))){position+=skipUntil(buffer,position,trailerBytes);trailers.push(position);position+=skipUntil(buffer,position,startxrefBytes)}else if(m=objRegExp.exec(token)){if(typeof this.entries[m[1]]==="undefined"){this.entries[m[1]]={offset:position-stream.start,gen:m[2]|0,uncompressed:true}}var contentLength=skipUntil(buffer,position,endobjBytes)+7;var content=buffer.subarray(position,position+contentLength);var xrefTagOffset=skipUntil(content,0,xrefBytes);if(xrefTagOffset0){var i,n;var obj=xref.fetchIfRef(queue.shift());if(!isDict(obj)){continue}if(obj.has("Kids")){var kids=obj.get("Kids");for(i=0,n=kids.length;iMAX_LEVELS){warn('Search depth limit reached for "'+this._type+'" tree.');return null}var kids=kidsOrEntries.get("Kids");if(!isArray(kids)){return null}l=0;r=kids.length-1;while(l<=r){m=l+r>>1;var kid=xref.fetchIfRef(kids[m]);var limits=kid.get("Limits");if(keyxref.fetchIfRef(limits[1])){l=m+1}else{kidsOrEntries=xref.fetchIfRef(kids[m]);break}}if(l>r){return null}}var entries=kidsOrEntries.get(this._type);if(isArray(entries)){l=0;r=entries.length-2;while(l<=r){m=l+r&~1;var currentKey=xref.fetchIfRef(entries[m]);if(keycurrentKey){l=m+2}else{return xref.fetchIfRef(entries[m+1])}}}return null}};return NameOrNumberTree}();var NameTree=function NameTreeClosure(){function NameTree(root,xref){this.root=root;this.xref=xref;this._type="Names"}Util.inherit(NameTree,NameOrNumberTree,{});return NameTree}();var NumberTree=function NumberTreeClosure(){function NumberTree(root,xref){this.root=root;this.xref=xref;this._type="Nums"}Util.inherit(NumberTree,NameOrNumberTree,{});return NumberTree}();var FileSpec=function FileSpecClosure(){function FileSpec(root,xref){if(!root||!isDict(root)){return}this.xref=xref;this.root=root;if(root.has("FS")){this.fs=root.get("FS")}this.description=root.has("Desc")?stringToPDFString(root.get("Desc")):"";if(root.has("RF")){warn("Related file specifications are not supported")}this.contentAvailable=true;if(!root.has("EF")){this.contentAvailable=false;warn("Non-embedded file specifications are not supported")}}function pickPlatformItem(dict){if(dict.has("UF")){return dict.get("UF")}else if(dict.has("F")){return dict.get("F")}else if(dict.has("Unix")){return dict.get("Unix")}else if(dict.has("Mac")){return dict.get("Mac")}else if(dict.has("DOS")){return dict.get("DOS")}else{return null}}FileSpec.prototype={get filename(){if(!this._filename&&this.root){var filename=pickPlatformItem(this.root)||"unnamed";this._filename=stringToPDFString(filename).replace(/\\\\/g,"\\").replace(/\\\//g,"/").replace(/\\/g,"/")}return this._filename},get content(){if(!this.contentAvailable){return null}if(!this.contentRef&&this.root){this.contentRef=pickPlatformItem(this.root.get("EF"))}var content=null;if(this.contentRef){var xref=this.xref;var fileObj=xref.fetchIfRef(this.contentRef);if(fileObj&&isStream(fileObj)){content=fileObj.getBytes()}else{warn("Embedded file specification points to non-existing/invalid "+"content")}}else{warn("Embedded file specification does not have a content")}return content},get serializable(){return{filename:this.filename,content:this.content}}};return FileSpec}();var ObjectLoader=function(){function mayHaveChildren(value){return isRef(value)||isDict(value)||isArray(value)||isStream(value)}function addChildren(node,nodesToVisit){var value;if(isDict(node)||isStream(node)){var map;if(isDict(node)){map=node.map}else{map=node.dict.map}for(var key in map){value=map[key];if(mayHaveChildren(value)){nodesToVisit.push(value)}}}else if(isArray(node)){for(var i=0,ii=node.length;i=0&&(ch>=65&&ch<=90||ch>=97&&ch<=122)){strBuf.push(String.fromCharCode(ch))}var str=strBuf.join("");switch(str.toLowerCase()){case"if":return PostScriptToken.IF;case"ifelse":return PostScriptToken.IFELSE;default:return PostScriptToken.getOperator(str)}},getNumber:function PostScriptLexer_getNumber(){var ch=this.currentChar;var strBuf=this.strBuf;strBuf.length=0;strBuf[0]=String.fromCharCode(ch);while((ch=this.nextChar())>=0){if(ch>=48&&ch<=57||ch===45||ch===46){strBuf.push(String.fromCharCode(ch))}else{break}}var value=parseFloat(strBuf.join(""));if(isNaN(value)){error("Invalid floating point number: "+value)}return value}};return PostScriptLexer}();exports.PostScriptLexer=PostScriptLexer;exports.PostScriptParser=PostScriptParser});(function(root,factory){{factory(root.pdfjsCoreFonts={},root.pdfjsSharedUtil,root.pdfjsCorePrimitives,root.pdfjsCoreStream,root.pdfjsCoreParser,root.pdfjsCoreCMap,root.pdfjsCoreGlyphList,root.pdfjsCoreCharsets,root.pdfjsCoreFontRenderer,root.pdfjsCoreEncodings,root.pdfjsCoreStandardFonts,root.pdfjsCoreUnicode)}})(this,function(exports,sharedUtil,corePrimitives,coreStream,coreParser,coreCMap,coreGlyphList,coreCharsets,coreFontRenderer,coreEncodings,coreStandardFonts,coreUnicode){var FONT_IDENTITY_MATRIX=sharedUtil.FONT_IDENTITY_MATRIX;var FontType=sharedUtil.FontType;var Util=sharedUtil.Util;var assert=sharedUtil.assert;var bytesToString=sharedUtil.bytesToString;var error=sharedUtil.error;var info=sharedUtil.info;var isArray=sharedUtil.isArray;var isInt=sharedUtil.isInt;var isNum=sharedUtil.isNum;var readUint32=sharedUtil.readUint32;var shadow=sharedUtil.shadow;var stringToBytes=sharedUtil.stringToBytes;var string32=sharedUtil.string32;var warn=sharedUtil.warn;var Name=corePrimitives.Name;var Stream=coreStream.Stream;var Lexer=coreParser.Lexer;var CMapFactory=coreCMap.CMapFactory;var IdentityCMap=coreCMap.IdentityCMap;var getGlyphsUnicode=coreGlyphList.getGlyphsUnicode;var getDingbatsGlyphsUnicode=coreGlyphList.getDingbatsGlyphsUnicode;var ISOAdobeCharset=coreCharsets.ISOAdobeCharset;var ExpertCharset=coreCharsets.ExpertCharset;var ExpertSubsetCharset=coreCharsets.ExpertSubsetCharset;var FontRendererFactory=coreFontRenderer.FontRendererFactory;var WinAnsiEncoding=coreEncodings.WinAnsiEncoding;var StandardEncoding=coreEncodings.StandardEncoding;var MacRomanEncoding=coreEncodings.MacRomanEncoding;var SymbolSetEncoding=coreEncodings.SymbolSetEncoding;var ZapfDingbatsEncoding=coreEncodings.ZapfDingbatsEncoding;var ExpertEncoding=coreEncodings.ExpertEncoding;var getEncoding=coreEncodings.getEncoding;var getStdFontMap=coreStandardFonts.getStdFontMap;var getNonStdFontMap=coreStandardFonts.getNonStdFontMap;var getGlyphMapForStandardFonts=coreStandardFonts.getGlyphMapForStandardFonts;var getSupplementalGlyphMapForArialBlack=coreStandardFonts.getSupplementalGlyphMapForArialBlack;var getUnicodeRangeFor=coreUnicode.getUnicodeRangeFor;var mapSpecialUnicodeValues=coreUnicode.mapSpecialUnicodeValues;var PRIVATE_USE_OFFSET_START=57344;var PRIVATE_USE_OFFSET_END=63743;var SKIP_PRIVATE_USE_RANGE_F000_TO_F01F=false;var PDF_GLYPH_SPACE_UNITS=1e3;var HINTING_ENABLED=false;var SEAC_ANALYSIS_ENABLED=false;var MAX_SUBR_NESTING=10;var FontFlags={FixedPitch:1,Serif:2,Symbolic:4,Script:8,Nonsymbolic:32,Italic:64,AllCap:65536,SmallCap:131072,ForceBold:262144};var MacStandardGlyphOrdering=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function adjustWidths(properties){if(!properties.fontMatrix){return}if(properties.fontMatrix[0]===FONT_IDENTITY_MATRIX[0]){return}var scale=.001/properties.fontMatrix[0];var glyphsWidths=properties.widths;for(var glyph in glyphsWidths){glyphsWidths[glyph]*=scale}properties.defaultWidth*=scale}function getFontType(type,subtype){switch(type){case"Type1":return subtype==="Type1C"?FontType.TYPE1C:FontType.TYPE1;case"CIDFontType0":return subtype==="CIDFontType0C"?FontType.CIDFONTTYPE0C:FontType.CIDFONTTYPE0;case"OpenType":return FontType.OPENTYPE;case"TrueType":return FontType.TRUETYPE;case"CIDFontType2":return FontType.CIDFONTTYPE2;case"MMType1":return FontType.MMTYPE1;case"Type0":return FontType.TYPE0;default:return FontType.UNKNOWN}}var Glyph=function GlyphClosure(){function Glyph(fontChar,unicode,accent,width,vmetric,operatorListId,isSpace){this.fontChar=fontChar;this.unicode=unicode;this.accent=accent;this.width=width;this.vmetric=vmetric;this.operatorListId=operatorListId;this.isSpace=isSpace}Glyph.prototype.matchesForCache=function(fontChar,unicode,accent,width,vmetric,operatorListId,isSpace){return this.fontChar===fontChar&&this.unicode===unicode&&this.accent===accent&&this.width===width&&this.vmetric===vmetric&&this.operatorListId===operatorListId&&this.isSpace===isSpace};return Glyph}();var ToUnicodeMap=function ToUnicodeMapClosure(){function ToUnicodeMap(cmap){this._map=cmap}ToUnicodeMap.prototype={get length(){return this._map.length},forEach:function(callback){for(var charCode in this._map){callback(charCode,this._map[charCode].charCodeAt(0))}},has:function(i){return this._map[i]!==undefined},get:function(i){return this._map[i]},charCodeOf:function(v){return this._map.indexOf(v)}};return ToUnicodeMap}();var IdentityToUnicodeMap=function IdentityToUnicodeMapClosure(){function IdentityToUnicodeMap(firstChar,lastChar){this.firstChar=firstChar;this.lastChar=lastChar}IdentityToUnicodeMap.prototype={get length(){return this.lastChar+1-this.firstChar},forEach:function(callback){for(var i=this.firstChar,ii=this.lastChar;i<=ii;i++){callback(i,i)}},has:function(i){return this.firstChar<=i&&i<=this.lastChar},get:function(i){if(this.firstChar<=i&&i<=this.lastChar){return String.fromCharCode(i)}return undefined},charCodeOf:function(v){return isInt(v)&&v>=this.firstChar&&v<=this.lastChar?v:-1}};return IdentityToUnicodeMap}();var OpenTypeFileBuilder=function OpenTypeFileBuilderClosure(){function writeInt16(dest,offset,num){dest[offset]=num>>8&255;dest[offset+1]=num&255}function writeInt32(dest,offset,num){dest[offset]=num>>24&255;dest[offset+1]=num>>16&255;dest[offset+2]=num>>8&255;dest[offset+3]=num&255}function writeData(dest,offset,data){var i,ii;if(data instanceof Uint8Array){dest.set(data,offset)}else if(typeof data==="string"){for(i=0,ii=data.length;imaxPower2){maxPower2<<=1;log2++}var searchRange=maxPower2*entrySize;return{range:searchRange,entry:log2,rangeShift:entrySize*entriesCount-searchRange}};var OTF_HEADER_SIZE=12;var OTF_TABLE_ENTRY_SIZE=16;OpenTypeFileBuilder.prototype={toArray:function OpenTypeFileBuilder_toArray(){var sfnt=this.sfnt;var tables=this.tables;var tablesNames=Object.keys(tables);tablesNames.sort();var numTables=tablesNames.length;var i,j,jj,table,tableName;var offset=OTF_HEADER_SIZE+numTables*OTF_TABLE_ENTRY_SIZE;var tableOffsets=[offset];for(i=0;i>>0;offset+=paddedLength;tableOffsets.push(offset)}var file=new Uint8Array(offset);for(i=0;i1?names[1]:names[0];names=names.split(/[-,_]/g)[0];this.isSerifFont=!!(properties.flags&FontFlags.Serif);this.isSymbolicFont=!!(properties.flags&FontFlags.Symbolic);this.isMonospace=!!(properties.flags&FontFlags.FixedPitch);var type=properties.type;var subtype=properties.subtype;this.type=type;this.fallbackName=this.isMonospace?"monospace":this.isSerifFont?"serif":"sans-serif";this.differences=properties.differences;this.widths=properties.widths;this.defaultWidth=properties.defaultWidth;this.composite=properties.composite;this.wideChars=properties.wideChars;this.cMap=properties.cMap;this.ascent=properties.ascent/PDF_GLYPH_SPACE_UNITS;this.descent=properties.descent/PDF_GLYPH_SPACE_UNITS;this.fontMatrix=properties.fontMatrix;this.bbox=properties.bbox;this.toUnicode=properties.toUnicode=this.buildToUnicode(properties);this.toFontChar=[];if(properties.type==="Type3"){for(charCode=0;charCode<256;charCode++){this.toFontChar[charCode]=this.differences[charCode]||properties.defaultEncoding[charCode]}this.fontType=FontType.TYPE3;return}this.cidEncoding=properties.cidEncoding;this.vertical=properties.vertical;if(this.vertical){this.vmetrics=properties.vmetrics;this.defaultVMetrics=properties.defaultVMetrics}var glyphsUnicodeMap;if(!file||file.isEmpty){if(file){warn('Font file is empty in "'+name+'" ('+this.loadedName+")")}this.missingFile=true;var fontName=name.replace(/[,_]/g,"-");var stdFontMap=getStdFontMap(),nonStdFontMap=getNonStdFontMap();var isStandardFont=!!stdFontMap[fontName]||!!(nonStdFontMap[fontName]&&stdFontMap[nonStdFontMap[fontName]]);fontName=stdFontMap[fontName]||nonStdFontMap[fontName]||fontName;this.bold=fontName.search(/bold/gi)!==-1;this.italic=fontName.search(/oblique/gi)!==-1||fontName.search(/italic/gi)!==-1;this.black=name.search(/Black/g)!==-1;this.remeasure=Object.keys(this.widths).length>0;if(isStandardFont&&type==="CIDFontType2"&&properties.cidEncoding.indexOf("Identity-")===0){var GlyphMapForStandardFonts=getGlyphMapForStandardFonts();var map=[];for(charCode in GlyphMapForStandardFonts){map[+charCode]=GlyphMapForStandardFonts[charCode]}if(/ArialBlack/i.test(name)){var SupplementalGlyphMapForArialBlack=getSupplementalGlyphMapForArialBlack();for(charCode in SupplementalGlyphMapForArialBlack){map[+charCode]=SupplementalGlyphMapForArialBlack[charCode]}}var isIdentityUnicode=this.toUnicode instanceof IdentityToUnicodeMap;if(!isIdentityUnicode){this.toUnicode.forEach(function(charCode,unicodeCharCode){map[+charCode]=unicodeCharCode})}this.toFontChar=map;this.toUnicode=new ToUnicodeMap(map)}else if(/Symbol/i.test(fontName)){var symbols=SymbolSetEncoding;glyphsUnicodeMap=getGlyphsUnicode();for(charCode in symbols){fontChar=glyphsUnicodeMap[symbols[charCode]];if(!fontChar){continue}this.toFontChar[charCode]=fontChar}for(charCode in properties.differences){fontChar=glyphsUnicodeMap[properties.differences[charCode]];if(!fontChar){continue}this.toFontChar[charCode]=fontChar}}else if(/Dingbats/i.test(fontName)){glyphsUnicodeMap=getDingbatsGlyphsUnicode();if(/Wingdings/i.test(name)){warn("Wingdings font without embedded font file, "+"falling back to the ZapfDingbats encoding.")}var dingbats=ZapfDingbatsEncoding;for(charCode in dingbats){fontChar=glyphsUnicodeMap[dingbats[charCode]];if(!fontChar){continue}this.toFontChar[charCode]=fontChar}for(charCode in properties.differences){fontChar=glyphsUnicodeMap[properties.differences[charCode]];if(!fontChar){continue}this.toFontChar[charCode]=fontChar}}else if(isStandardFont){this.toFontChar=[];glyphsUnicodeMap=getGlyphsUnicode();for(charCode in properties.defaultEncoding){glyphName=properties.differences[charCode]||properties.defaultEncoding[charCode];this.toFontChar[charCode]=glyphsUnicodeMap[glyphName]}}else{var unicodeCharCode,notCidFont=type.indexOf("CIDFontType")===-1;glyphsUnicodeMap=getGlyphsUnicode();this.toUnicode.forEach(function(charCode,unicodeCharCode){if(notCidFont){glyphName=properties.differences[charCode]||properties.defaultEncoding[charCode];unicodeCharCode=glyphsUnicodeMap[glyphName]||unicodeCharCode}this.toFontChar[charCode]=unicodeCharCode}.bind(this))}this.loadedName=fontName.split("-")[0];this.loading=false;this.fontType=getFontType(type,subtype);return}if(subtype==="Type1C"&&(type!=="Type1"&&type!=="MMType1")){if(isTrueTypeFile(file)){subtype="TrueType"}else{type="Type1"}}if(subtype==="CIDFontType0C"&&type!=="CIDFontType0"){type="CIDFontType0"}if(subtype==="OpenType"){type="OpenType"}if(type==="CIDFontType0"){if(isType1File(file)){subtype="CIDFontType0"}else if(isOpenTypeFile(file)){type=subtype="OpenType"}else{subtype="CIDFontType0C"}}var data;switch(type){case"MMType1":info("MMType1 font ("+name+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";var cff=subtype==="Type1C"||subtype==="CIDFontType0C"?new CFFFont(file,properties):new Type1Font(name,file,properties);adjustWidths(properties);data=this.convert(name,cff,properties);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype";data=this.checkAndRepair(name,file,properties);if(this.isOpenType){adjustWidths(properties);type="OpenType"}break;default:error("Font "+type+" is not supported");break}this.data=data;this.fontType=getFontType(type,subtype);this.fontMatrix=properties.fontMatrix;this.widths=properties.widths;this.defaultWidth=properties.defaultWidth;this.encoding=properties.baseEncoding;this.seacMap=properties.seacMap;this.loading=true}Font.getFontID=function(){var ID=1;return function Font_getFontID(){return String(ID++)}}();function int16(b0,b1){return(b0<<8)+b1}function int32(b0,b1,b2,b3){return(b0<<24)+(b1<<16)+(b2<<8)+b3}function string16(value){return String.fromCharCode(value>>8&255,value&255)}function safeString16(value){value=value>32767?32767:value<-32768?-32768:value;return String.fromCharCode(value>>8&255,value&255)}function isTrueTypeFile(file){var header=file.peekBytes(4);return readUint32(header,0)===65536}function isOpenTypeFile(file){var header=file.peekBytes(4);return bytesToString(header)==="OTTO"}function isType1File(file){var header=file.peekBytes(2);if(header[0]===37&&header[1]===33){return true}if(header[0]===128&&header[1]===1){return true}return false}function isProblematicUnicodeLocation(code){var i=0,j=ProblematicCharRanges.length-1;while(i>1;if(code=numGlyphs){continue}codes.push({fontCharCode:charCode|0,glyphId:glyphs[charCode]})}codes.sort(function fontGetRangesSort(a,b){return a.fontCharCode-b.fontCharCode});var ranges=[];var length=codes.length;for(var n=0;n65535?2:1;var cmap="\x00\x00"+string16(numTables)+"\x00"+"\x00"+string32(4+numTables*8);var i,ii,j,jj;for(i=ranges.length-1;i>=0;--i){if(ranges[i][0]<=65535){break}}var bmpLength=i+1;if(ranges[i][0]<65535&&ranges[i][1]===65535){ranges[i][1]=65534}var trailingRangesCount=ranges[i][1]<65535?1:0;var segCount=bmpLength+trailingRangesCount;var searchParams=OpenTypeFileBuilder.getSearchParams(segCount,2);var startCount="";var endCount="";var idDeltas="";var idRangeOffsets="";var glyphsIds="";var bias=0;var range,start,end,codes;for(i=0,ii=bmpLength;i0){endCount+="ÿÿ";startCount+="ÿÿ";idDeltas+="\x00";idRangeOffsets+="\x00\x00"}var format314="\x00\x00"+string16(2*segCount)+string16(searchParams.range)+string16(searchParams.entry)+string16(searchParams.rangeShift)+endCount+"\x00\x00"+startCount+idDeltas+idRangeOffsets+glyphsIds;var format31012="";var header31012="";if(numTables>1){cmap+="\x00"+"\x00\n"+string32(4+numTables*8+4+format314.length);format31012="";for(i=0,ii=ranges.length;ilastChar){return false}stream.getBytes(6);var usWinAscent=stream.getUint16();if(usWinAscent===0){return false}os2.data[8]=os2.data[9]=0;return true}function createOS2Table(properties,charstrings,override){override=override||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};var ulUnicodeRange1=0;var ulUnicodeRange2=0;var ulUnicodeRange3=0;var ulUnicodeRange4=0;var firstCharIndex=null;var lastCharIndex=0;if(charstrings){for(var code in charstrings){code|=0;if(firstCharIndex>code||!firstCharIndex){firstCharIndex=code}if(lastCharIndex 123 are reserved for internal usage")}}}else{firstCharIndex=0;lastCharIndex=255}var bbox=properties.bbox||[0,0,0,0];var unitsPerEm=override.unitsPerEm||1/(properties.fontMatrix||FONT_IDENTITY_MATRIX)[0];var scale=properties.ascentScaled?1:unitsPerEm/PDF_GLYPH_SPACE_UNITS;var typoAscent=override.ascent||Math.round(scale*(properties.ascent||bbox[3]));var typoDescent=override.descent||Math.round(scale*(properties.descent||bbox[1]));if(typoDescent>0&&properties.descent>0&&bbox[1]<0){typoDescent=-typoDescent}var winAscent=override.yMax||typoAscent;var winDescent=-override.yMin||-typoDescent;return"\x00"+"$"+"ô"+"\x00"+"\x00\x00"+"Š"+"»"+"\x00\x00"+"\x00Œ"+"Š"+"»"+"\x00\x00"+"ß"+"\x001"+""+"\x00\x00"+"\x00\x00"+String.fromCharCode(properties.fixedPitch?9:0)+"\x00\x00\x00\x00\x00\x00"+string32(ulUnicodeRange1)+string32(ulUnicodeRange2)+string32(ulUnicodeRange3)+string32(ulUnicodeRange4)+"*21*"+string16(properties.italicAngle?1:0)+string16(firstCharIndex||properties.firstChar)+string16(lastCharIndex||properties.lastChar)+string16(typoAscent)+string16(typoDescent)+"\x00d"+string16(winAscent)+string16(winDescent)+"\x00\x00\x00\x00"+"\x00\x00\x00\x00"+string16(properties.xHeight)+string16(properties.capHeight)+string16(0)+string16(firstCharIndex||properties.firstChar)+"\x00"}function createPostTable(properties){var angle=Math.floor(properties.italicAngle*Math.pow(2,16));return"\x00\x00\x00"+string32(angle)+"\x00\x00"+"\x00\x00"+string32(properties.fixedPitch)+"\x00\x00\x00\x00"+"\x00\x00\x00\x00"+"\x00\x00\x00\x00"+"\x00\x00\x00\x00"}function createNameTable(name,proto){if(!proto){proto=[[],[]]}var strings=[proto[0][0]||"Original licence",proto[0][1]||name,proto[0][2]||"Unknown",proto[0][3]||"uniqueID",proto[0][4]||name,proto[0][5]||"Version 0.11",proto[0][6]||"",proto[0][7]||"Unknown",proto[0][8]||"Unknown",proto[0][9]||"Unknown"];var stringsUnicode=[];var i,ii,j,jj,str;for(i=0,ii=strings.length;i>>0;var length=file.getInt32()>>>0;var previousPosition=file.pos;file.pos=file.start?file.start:0;file.skip(offset);var data=file.getBytes(length);file.pos=previousPosition;if(tag==="head"){data[8]=data[9]=data[10]=data[11]=0;data[17]|=32}return{tag:tag,checksum:checksum,length:length,offset:offset,data:data}}function readOpenTypeHeader(ttf){return{version:bytesToString(ttf.getBytes(4)),numTables:ttf.getUint16(),searchRange:ttf.getUint16(),entrySelector:ttf.getUint16(),rangeShift:ttf.getUint16()}}function readCmapTable(cmap,font,isSymbolicFont,hasEncoding){if(!cmap){warn("No cmap table available.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:false}}var segment;var start=(font.start?font.start:0)+cmap.offset;font.pos=start;var version=font.getUint16();var numTables=font.getUint16();var potentialTable;var canBreak=false;for(var i=0;i>>0;var useTable=false;if(platformId===0&&encodingId===0){useTable=true}else if(platformId===1&&encodingId===0){useTable=true}else if(platformId===3&&encodingId===1&&(!isSymbolicFont&&hasEncoding||!potentialTable)){useTable=true;if(!isSymbolicFont){canBreak=true}}else if(isSymbolicFont&&platformId===3&&encodingId===0){useTable=true;canBreak=true}if(useTable){potentialTable={platformId:platformId,encodingId:encodingId,offset:offset}}if(canBreak){break}}if(potentialTable){font.pos=start+potentialTable.offset; +}if(!potentialTable||font.peekByte()===-1){warn("Could not find a preferred cmap table.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:false}}var format=font.getUint16();var length=font.getUint16();var language=font.getUint16();var hasShortCmap=false;var mappings=[];var j,glyphId;if(format===0){for(j=0;j<256;j++){var index=font.getByte();if(!index){continue}mappings.push({charCode:j,glyphId:index})}hasShortCmap=true}else if(format===4){var segCount=font.getUint16()>>1;font.getBytes(6);var segIndex,segments=[];for(segIndex=0;segIndex>1)-(segCount-segIndex);segment.offsetIndex=offsetIndex;offsetsCount=Math.max(offsetsCount,offsetIndex+segment.end-segment.start+1)}var offsets=[];for(j=0;jnumGlyphs){info("The numOfMetrics ("+numOfMetrics+") should not be "+"greater than the numGlyphs ("+numGlyphs+")");numOfMetrics=numGlyphs;header.data[34]=(numOfMetrics&65280)>>8;header.data[35]=numOfMetrics&255}var numOfSidebearings=numGlyphs-numOfMetrics;var numMissing=numOfSidebearings-(metrics.length-numOfMetrics*4>>1);if(numMissing>0){var entries=new Uint8Array(metrics.length+numMissing*2);entries.set(metrics.data);metrics.data=entries}}function sanitizeGlyph(source,sourceStart,sourceEnd,dest,destStart,hintsValid){if(sourceEnd-sourceStart<=12){return 0}var glyf=source.subarray(sourceStart,sourceEnd);var contoursCount=glyf[0]<<8|glyf[1];if(contoursCount&32768){dest.set(glyf,destStart);return glyf.length}var i,j=10,flagsCount=0;for(i=0;iglyf.length){return 0}if(!hintsValid&&instructionsLength>0){dest.set(glyf.subarray(0,instructionsStart),destStart);dest.set([0,0],destStart+instructionsStart);dest.set(glyf.subarray(instructionsEnd,glyphDataLength),destStart+instructionsStart+2);glyphDataLength-=instructionsLength;if(glyf.length-glyphDataLength>3){glyphDataLength=glyphDataLength+3&~3}return glyphDataLength}if(glyf.length-glyphDataLength>3){glyphDataLength=glyphDataLength+3&~3;dest.set(glyf.subarray(0,glyphDataLength),destStart);return glyphDataLength}dest.set(glyf,destStart);return glyf.length}function sanitizeHead(head,numGlyphs,locaLength){var data=head.data;var version=int32(data[0],data[1],data[2],data[3]);if(version>>16!==1){info("Attempting to fix invalid version in head table: "+version);data[0]=0;data[1]=1;data[2]=0;data[3]=0}var indexToLocFormat=int16(data[50],data[51]);if(indexToLocFormat<0||indexToLocFormat>1){info("Attempting to fix invalid indexToLocFormat in head table: "+indexToLocFormat);var numGlyphsPlusOne=numGlyphs+1;if(locaLength===numGlyphsPlusOne<<1){data[50]=0;data[51]=0}else if(locaLength===numGlyphsPlusOne<<2){data[50]=0;data[51]=1}else{warn("Could not fix indexToLocFormat: "+indexToLocFormat)}}}function sanitizeGlyphLocations(loca,glyf,numGlyphs,isGlyphLocationsLong,hintsValid,dupFirstEntry){var itemSize,itemDecode,itemEncode;if(isGlyphLocationsLong){itemSize=4;itemDecode=function fontItemDecodeLong(data,offset){return data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3]};itemEncode=function fontItemEncodeLong(data,offset,value){data[offset]=value>>>24&255;data[offset+1]=value>>16&255;data[offset+2]=value>>8&255;data[offset+3]=value&255}}else{itemSize=2;itemDecode=function fontItemDecode(data,offset){return data[offset]<<9|data[offset+1]<<1};itemEncode=function fontItemEncode(data,offset,value){data[offset]=value>>9&255;data[offset+1]=value>>1&255}}var locaData=loca.data;var locaDataSize=itemSize*(1+numGlyphs);if(locaData.length!==locaDataSize){locaData=new Uint8Array(locaDataSize);locaData.set(loca.data.subarray(0,locaDataSize));loca.data=locaData}var oldGlyfData=glyf.data;var oldGlyfDataLength=oldGlyfData.length;var newGlyfData=new Uint8Array(oldGlyfDataLength);var startOffset=itemDecode(locaData,0);var writeOffset=0;var missingGlyphData=Object.create(null);itemEncode(locaData,0,writeOffset);var i,j;for(i=0,j=itemSize;ioldGlyfDataLength&&(oldGlyfDataLength+3&~3)===endOffset){endOffset=oldGlyfDataLength}if(endOffset>oldGlyfDataLength){itemEncode(locaData,j,writeOffset);startOffset=endOffset;continue}if(startOffset===endOffset){missingGlyphData[i]=true}var newLength=sanitizeGlyph(oldGlyfData,startOffset,endOffset,newGlyfData,writeOffset,hintsValid);writeOffset+=newLength;itemEncode(locaData,j,writeOffset);startOffset=endOffset}if(writeOffset===0){var simpleGlyph=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(i=0,j=itemSize;ifirstEntryLength+writeOffset){glyf.data=newGlyfData.subarray(0,firstEntryLength+writeOffset)}else{glyf.data=new Uint8Array(firstEntryLength+writeOffset);glyf.data.set(newGlyfData.subarray(0,writeOffset))}glyf.data.set(newGlyfData.subarray(0,firstEntryLength),writeOffset);itemEncode(loca.data,locaData.length-itemSize,writeOffset+firstEntryLength)}else{glyf.data=newGlyfData.subarray(0,writeOffset)}return missingGlyphData}function readPostScriptTable(post,properties,maxpNumGlyphs){var start=(font.start?font.start:0)+post.offset;font.pos=start;var length=post.length,end=start+length;var version=font.getInt32();font.getBytes(28);var glyphNames;var valid=true;var i;switch(version){case 65536:glyphNames=MacStandardGlyphOrdering;break;case 131072:var numGlyphs=font.getUint16();if(numGlyphs!==maxpNumGlyphs){valid=false;break}var glyphNameIndexes=[];for(i=0;i=32768){valid=false;break}glyphNameIndexes.push(index)}if(!valid){break}var customNames=[];var strBuf=[];while(font.posend){continue}font.pos=pos;var nameIndex=record.name;if(record.encoding){var str="";for(var j=0,jj=record.length;j0){i+=offset-1}}}if(!inFDEF&&!inELSE){var stackDelta=op<=142?TTOpsStackDeltas[op]:op>=192&&op<=223?-1:op>=224?-2:0;if(op>=113&&op<=117){n=stack.pop();if(n===n){stackDelta=-n*2}}while(stackDelta<0&&stack.length>0){stack.pop();stackDelta++}while(stackDelta>0){stack.push(NaN);stackDelta--}}}ttContext.tooComplexToFollowFunctions=tooComplexToFollowFunctions;var content=[data];if(i>data.length){content.push(new Uint8Array(i-data.length))}if(lastDeff>lastEndf){warn("TT: complementing a missing function tail");content.push(new Uint8Array([34,45]))}foldTTTable(table,content)}function checkInvalidFunctions(ttContext,maxFunctionDefs){if(ttContext.tooComplexToFollowFunctions){return}if(ttContext.functionsDefined.length>maxFunctionDefs){warn("TT: more functions defined than expected");ttContext.hintsValid=false;return}for(var j=0,jj=ttContext.functionsUsed.length;jmaxFunctionDefs){warn("TT: invalid function id: "+j);ttContext.hintsValid=false;return}if(ttContext.functionsUsed[j]&&!ttContext.functionsDefined[j]){warn("TT: undefined function: "+j);ttContext.hintsValid=false;return}}}function foldTTTable(table,content){if(content.length>1){var newLength=0;var j,jj;for(j=0,jj=content.length;j=65536&&tables["maxp"].length>=22){font.pos+=8;var maxZones=font.getUint16();if(maxZones>2){tables["maxp"].data[14]=0;tables["maxp"].data[15]=2}font.pos+=4;maxFunctionDefs=font.getUint16()}var dupFirstEntry=false;if(properties.type==="CIDFontType2"&&properties.toUnicode&&properties.toUnicode.get(0)>"\x00"){dupFirstEntry=true;numGlyphs++;tables["maxp"].data[4]=numGlyphs>>8;tables["maxp"].data[5]=numGlyphs&255}var hintsValid=sanitizeTTPrograms(tables["fpgm"],tables["prep"],tables["cvt "],maxFunctionDefs);if(!hintsValid){delete tables["fpgm"];delete tables["prep"];delete tables["cvt "]}sanitizeMetrics(font,tables["hhea"],tables["hmtx"],numGlyphs);if(!tables["head"]){error('Required "head" table is not found')}sanitizeHead(tables["head"],numGlyphs,isTrueType?tables["loca"].length:0);var missingGlyphs=Object.create(null);if(isTrueType){var isGlyphLocationsLong=int16(tables["head"].data[50],tables["head"].data[51]);missingGlyphs=sanitizeGlyphLocations(tables["loca"],tables["glyf"],numGlyphs,isGlyphLocationsLong,hintsValid,dupFirstEntry)}if(!tables["hhea"]){error('Required "hhea" table is not found')}if(tables["hhea"].data[10]===0&&tables["hhea"].data[11]===0){tables["hhea"].data[10]=255;tables["hhea"].data[11]=255}var metricsOverride={unitsPerEm:int16(tables["head"].data[18],tables["head"].data[19]),yMax:int16(tables["head"].data[42],tables["head"].data[43]),yMin:int16(tables["head"].data[38],tables["head"].data[39])-65536,ascent:int16(tables["hhea"].data[4],tables["hhea"].data[5]),descent:int16(tables["hhea"].data[6],tables["hhea"].data[7])-65536};this.ascent=metricsOverride.ascent/metricsOverride.unitsPerEm;this.descent=metricsOverride.descent/metricsOverride.unitsPerEm;if(tables["post"]){var valid=readPostScriptTable(tables["post"],properties,numGlyphs);if(!valid){tables["post"]=null}}var charCodeToGlyphId=[],charCode;var toUnicode=properties.toUnicode,widths=properties.widths;var skipToUnicode=toUnicode instanceof IdentityToUnicodeMap||toUnicode.length===65536;function hasGlyph(glyphId,charCode,widthCode){if(!missingGlyphs[glyphId]){return true}if(!skipToUnicode&&charCode>=0&&toUnicode.has(charCode)){return true}if(widths&&widthCode>=0&&isNum(widths[widthCode])){return true}return false}if(properties.type==="CIDFontType2"){var cidToGidMap=properties.cidToGidMap||[];var isCidToGidMapEmpty=cidToGidMap.length===0;properties.cMap.forEach(function(charCode,cid){assert(cid<=65535,"Max size of CID is 65,535");var glyphId=-1;if(isCidToGidMapEmpty){glyphId=charCode}else if(cidToGidMap[cid]!==undefined){glyphId=cidToGidMap[cid]}if(glyphId>=0&&glyphId0||!!properties.baseEncodingName;var cmapTable=readCmapTable(tables["cmap"],font,this.isSymbolicFont,hasEncoding);var cmapPlatformId=cmapTable.platformId;var cmapEncodingId=cmapTable.encodingId;var cmapMappings=cmapTable.mappings;var cmapMappingsLength=cmapMappings.length;if(hasEncoding&&(cmapPlatformId===3&&cmapEncodingId===1||cmapPlatformId===1&&cmapEncodingId===0)||cmapPlatformId===-1&&cmapEncodingId===-1&&!!getEncoding(properties.baseEncodingName)){var baseEncoding=[];if(properties.baseEncodingName==="MacRomanEncoding"||properties.baseEncodingName==="WinAnsiEncoding"){baseEncoding=getEncoding(properties.baseEncodingName)}var glyphsUnicodeMap=getGlyphsUnicode();for(charCode=0;charCode<256;charCode++){var glyphName;if(this.differences&&charCode in this.differences){glyphName=this.differences[charCode]}else if(charCode in baseEncoding&&baseEncoding[charCode]!==""){glyphName=baseEncoding[charCode]}else{glyphName=StandardEncoding[charCode]}if(!glyphName){continue}var unicodeOrCharCode,isUnicode=false;if(cmapPlatformId===3&&cmapEncodingId===1){unicodeOrCharCode=glyphsUnicodeMap[glyphName];isUnicode=true}else if(cmapPlatformId===1&&cmapEncodingId===0){unicodeOrCharCode=MacRomanEncoding.indexOf(glyphName)}var found=false;for(i=0;i0&&hasGlyph(glyphId,-1,-1)){charCodeToGlyphId[charCode]=glyphId;found=true}}if(!found){charCodeToGlyphId[charCode]=0}}}else if(cmapPlatformId===0&&cmapEncodingId===0){for(i=0;i=3){code=+glyphName.substr(1)}break}if(code){if(baseEncodingName&&code===+charcode){var baseEncoding=getEncoding(baseEncodingName);if(baseEncoding&&(glyphName=baseEncoding[charcode])){toUnicode[charcode]=String.fromCharCode(glyphsUnicodeMap[glyphName]);continue}}toUnicode[charcode]=String.fromCharCode(code)}continue}toUnicode[charcode]=String.fromCharCode(glyphsUnicodeMap[glyphName])}return new ToUnicodeMap(toUnicode)}if(properties.composite&&(properties.cMap.builtInCMap&&!(properties.cMap instanceof IdentityCMap)||properties.cidSystemInfo.registry==="Adobe"&&(properties.cidSystemInfo.ordering==="GB1"||properties.cidSystemInfo.ordering==="CNS1"||properties.cidSystemInfo.ordering==="Japan1"||properties.cidSystemInfo.ordering==="Korea1"))){var registry=properties.cidSystemInfo.registry;var ordering=properties.cidSystemInfo.ordering;var ucs2CMapName=new Name(registry+"-"+ordering+"-UCS2");var ucs2CMap=CMapFactory.create(ucs2CMapName,{url:PDFJS.cMapUrl,packed:PDFJS.cMapPacked},null);var cMap=properties.cMap;toUnicode=[];cMap.forEach(function(charcode,cid){assert(cid<=65535,"Max size of CID is 65,535");var ucs2=ucs2CMap.lookup(cid);if(ucs2){toUnicode[charcode]=String.fromCharCode((ucs2.charCodeAt(0)<<8)+ucs2.charCodeAt(1))}});return new ToUnicodeMap(toUnicode)}return new IdentityToUnicodeMap(properties.firstChar,properties.lastChar)},get spaceWidth(){if("_shadowWidth"in this){return this._shadowWidth}var possibleSpaceReplacements=["space","minus","one","i"];var width;for(var i=0,ii=possibleSpaceReplacements.length;i=0){charCodeToGlyphId[charCode]=glyphId}else{charCodeToGlyphId[charCode]=0}}}else if(!!(properties.flags&FontFlags.Symbolic)){for(charCode in builtInEncoding){charCodeToGlyphId[charCode]=builtInEncoding[charCode]}}else{baseEncoding=StandardEncoding;for(charCode=0;charCode=0){charCodeToGlyphId[charCode]=glyphId}else{charCodeToGlyphId[charCode]=0}}}var differences=properties.differences;if(differences){for(charCode in differences){var glyphName=differences[charCode];glyphId=glyphNames.indexOf(glyphName);if(glyphId>=0){charCodeToGlyphId[charCode]=glyphId}else{charCodeToGlyphId[charCode]=0}}}return charCodeToGlyphId}var Type1CharString=function Type1CharStringClosure(){var COMMAND_MAP={hstem:[1],vstem:[3],vmoveto:[4],rlineto:[5],hlineto:[6],vlineto:[7],rrcurveto:[8],callsubr:[10],flex:[12,35],drop:[12,18],endchar:[14],rmoveto:[21],hmoveto:[22],vhcurveto:[30],hvcurveto:[31]};function Type1CharString(){this.width=0;this.lsb=0;this.flexing=false;this.output=[];this.stack=[]}Type1CharString.prototype={convert:function Type1CharString_convert(encoded,subrs){var count=encoded.length;var error=false;var wx,sbx,subrNumber;for(var i=0;istackLength){return true}var start=stackLength-howManyArgs;for(var i=start;i>8&255,value&255)}else{value=65536*value|0;this.output.push(255,value>>24&255,value>>16&255,value>>8&255,value&255)}}this.output.push.apply(this.output,command);if(keepStack){this.stack.splice(start,howManyArgs)}else{this.stack.length=0}return false}};return Type1CharString}();var Type1Parser=function Type1ParserClosure(){var EEXEC_ENCRYPT_KEY=55665;var CHAR_STRS_ENCRYPT_KEY=4330;function isHexDigit(code){return code>=48&&code<=57||code>=65&&code<=70||code>=97&&code<=102}function decrypt(data,key,discardNumber){if(discardNumber>=data.length){return new Uint8Array(0)}var r=key|0,c1=52845,c2=22719,i,j;for(i=0;i>8;r=(value+r)*c1+c2&(1<<16)-1}return decrypted}function decryptAscii(data,key,discardNumber){var r=key|0,c1=52845,c2=22719;var count=data.length,maybeLength=count>>>1;var decrypted=new Uint8Array(maybeLength);var i,j;for(i=0,j=0;i>8;r=(value+r)*c1+c2&(1<<16)-1}}return Array.prototype.slice.call(decrypted,discardNumber,j)}function isSpecial(c){return c===47||c===91||c===93||c===123||c===125||c===40||c===41}function Type1Parser(stream,encrypted){if(encrypted){var data=stream.getBytes();var isBinary=!(isHexDigit(data[0])&&isHexDigit(data[1])&&isHexDigit(data[2])&&isHexDigit(data[3]));stream=new Stream(isBinary?decrypt(data,EEXEC_ENCRYPT_KEY,4):decryptAscii(data,EEXEC_ENCRYPT_KEY,4))}this.stream=stream;this.nextChar()}Type1Parser.prototype={readNumberArray:function Type1Parser_readNumberArray(){this.getToken();var array=[];while(true){var token=this.getToken();if(token===null||token==="]"||token==="}"){break}array.push(parseFloat(token||0))}return array},readNumber:function Type1Parser_readNumber(){var token=this.getToken();return parseFloat(token||0)},readInt:function Type1Parser_readInt(){var token=this.getToken();return parseInt(token||0,10)|0},readBoolean:function Type1Parser_readBoolean(){var token=this.getToken();return token==="true"?1:0},nextChar:function Type1_nextChar(){return this.currentChar=this.stream.getByte()},getToken:function Type1Parser_getToken(){var comment=false;var ch=this.currentChar;while(true){if(ch===-1){return null}if(comment){if(ch===10||ch===13){comment=false}}else if(ch===37){comment=true}else if(!Lexer.isSpace(ch)){break}ch=this.nextChar()}if(isSpecial(ch)){this.nextChar();return String.fromCharCode(ch)}var token="";do{token+=String.fromCharCode(ch);ch=this.nextChar()}while(ch>=0&&!Lexer.isSpace(ch)&&!isSpecial(ch));return token},extractFontProgram:function Type1Parser_extractFontProgram(){var stream=this.stream;var subrs=[],charstrings=[];var privateData=Object.create(null);privateData["lenIV"]=4;var program={subrs:[],charstrings:[],properties:{privateData:privateData}};var token,length,data,lenIV,encoded;while((token=this.getToken())!==null){if(token!=="/"){continue}token=this.getToken();switch(token){case"CharStrings":this.getToken();this.getToken();this.getToken();this.getToken();while(true){token=this.getToken();if(token===null||token==="end"){break}if(token!=="/"){continue}var glyph=this.getToken();length=this.readInt();this.getToken();data=stream.makeSubStream(stream.pos,length);lenIV=program.properties.privateData["lenIV"];encoded=decrypt(data.getBytes(),CHAR_STRS_ENCRYPT_KEY,lenIV);stream.skip(length);this.nextChar();token=this.getToken();if(token==="noaccess"){this.getToken()}charstrings.push({glyph:glyph,encoded:encoded})}break;case"Subrs":var num=this.readInt();this.getToken();while((token=this.getToken())==="dup"){var index=this.readInt();length=this.readInt();this.getToken();data=stream.makeSubStream(stream.pos,length);lenIV=program.properties.privateData["lenIV"];encoded=decrypt(data.getBytes(),CHAR_STRS_ENCRYPT_KEY,lenIV);stream.skip(length);this.nextChar();token=this.getToken();if(token==="noaccess"){this.getToken()}subrs[index]=encoded}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":var blueArray=this.readNumberArray();if(blueArray.length>0&&blueArray.length%2===0&&HINTING_ENABLED){program.properties.privateData[token]=blueArray}break;case"StemSnapH":case"StemSnapV":program.properties.privateData[token]=this.readNumberArray();break;case"StdHW":case"StdVW":program.properties.privateData[token]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":case"ExpansionFactor":program.properties.privateData[token]=this.readNumber();break;case"ForceBold":program.properties.privateData[token]=this.readBoolean();break}}for(var i=0;i=0){builtInEncoding[charCode]=glyphId}}}return type1FontGlyphMapping(properties,builtInEncoding,glyphNames)},getSeacs:function Type1Font_getSeacs(charstrings){var i,ii;var seacMap=[];for(i=0,ii=charstrings.length;i>8&255,index&255)}cff.charset=new CFFCharset(false,0,[],charsetArray);var charStringsIndex=new CFFIndex;charStringsIndex.add([139,14]);for(i=0;i0;j--){value[j]-=value[j-1]}}privateDict.setByName(field,value)}cff.topDict.privateDict=privateDict;var subrIndex=new CFFIndex;for(i=0,ii=subrs.length;i=bytesLength){error("Invalid CFF header")}else if(offset!==0){info("cff data is shifted");bytes=bytes.subarray(offset);this.bytes=bytes}var major=bytes[0];var minor=bytes[1];var hdrSize=bytes[2];var offSize=bytes[3];var header=new CFFHeader(major,minor,hdrSize,offSize);return{obj:header,endPos:hdrSize}},parseDict:function CFFParser_parseDict(dict){var pos=0;function parseOperand(){var value=dict[pos++];if(value===30){return parseFloatOperand(pos)}else if(value===28){value=dict[pos++];value=(value<<24|dict[pos++]<<16)>>16;return value}else if(value===29){value=dict[pos++];value=value<<8|dict[pos++];value=value<<8|dict[pos++];value=value<<8|dict[pos++];return value}else if(value>=32&&value<=246){return value-139}else if(value>=247&&value<=250){return(value-247)*256+dict[pos++]+108}else if(value>=251&&value<=254){return-((value-251)*256)-dict[pos++]-108}else{error("255 is not a valid DICT command")}return-1}function parseFloatOperand(){var str="";var eof=15;var lookup=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];var length=dict.length;while(pos>4;var b2=b&15;if(b1===eof){break}str+=lookup[b1];if(b2===eof){break}str+=lookup[b2]}return parseFloat(str)}var operands=[];var entries=[];pos=0;var end=dict.length;while(pos126||c===91||c===93||c===40||c===41||c===123||c===125||c===60||c===62||c===47||c===37||c===35){data[j]=95;continue}data[j]=c}names.push(bytesToString(data))}return names},parseStringIndex:function CFFParser_parseStringIndex(index){var strings=new CFFStrings;for(var i=0,ii=index.count;iMAX_SUBR_NESTING){return false}var stackSize=state.stackSize;var stack=state.stack;var length=data.length;for(var j=0;j>16;j+=2;stackSize++}else if(value===14){if(stackSize>=4){stackSize-=4;if(SEAC_ANALYSIS_ENABLED){state.seac=stack.slice(stackSize,stackSize+4);return false}}validationCommand=CharstringValidationData[value]}else if(value>=32&&value<=246){stack[stackSize]=value-139;stackSize++}else if(value>=247&&value<=254){stack[stackSize]=value<251?(value-247<<8)+data[j]+108:-(value-251<<8)-data[j]-108;j++;stackSize++}else if(value===255){stack[stackSize]=(data[j]<<24|data[j+1]<<16|data[j+2]<<8|data[j+3])/65536;j+=4;stackSize++}else if(value===19||value===20){state.hints+=stackSize>>1;j+=state.hints+7>>3;stackSize%=2;validationCommand=CharstringValidationData[value]}else if(value===10||value===29){var subrsIndex;if(value===10){subrsIndex=localSubrIndex}else{subrsIndex=globalSubrIndex}if(!subrsIndex){validationCommand=CharstringValidationData[value];warn("Missing subrsIndex for "+validationCommand.id);return false}var bias=32768;if(subrsIndex.count<1240){bias=107}else if(subrsIndex.count<33900){bias=1131}var subrNumber=stack[--stackSize]+bias;if(subrNumber<0||subrNumber>=subrsIndex.count){validationCommand=CharstringValidationData[value];warn("Out of bounds subrIndex for "+validationCommand.id);return false}state.stackSize=stackSize;state.callDepth++;var valid=this.parseCharString(state,subrsIndex.get(subrNumber),localSubrIndex,globalSubrIndex);if(!valid){return false}state.callDepth--;stackSize=state.stackSize;continue}else if(value===11){state.stackSize=stackSize;return true}else{validationCommand=CharstringValidationData[value]}if(validationCommand){if(validationCommand.stem){state.hints+=stackSize>>1}if("min"in validationCommand){if(!state.undefStack&&stackSize=2&&validationCommand.stem){stackSize%=2}else if(stackSize>1){warn("Found too many parameters for stack-clearing command")}if(stackSize>0&&stack[stackSize-1]>=0){state.width=stack[stackSize-1]}}if("stackDelta"in validationCommand){if("stackFn"in validationCommand){validationCommand.stackFn(stack,stackSize)}stackSize+=validationCommand.stackDelta}else if(validationCommand.stackClearing){stackSize=0}else if(validationCommand.resetStack){stackSize=0;state.undefStack=false}else if(validationCommand.undefStack){stackSize=0;state.undefStack=true;state.firstStackClearing=false}}}state.stackSize=stackSize;return true},parseCharStrings:function CFFParser_parseCharStrings(charStrings,localSubrIndex,globalSubrIndex,fdSelect,fdArray){var seacs=[];var widths=[];var count=charStrings.count;for(var i=0;i=fdArray.length){warn("Invalid fd index for glyph index.");valid=false}if(valid){localSubrToUse=fdArray[fdIndex].privateDict.subrsIndex}}else if(localSubrIndex){localSubrToUse=localSubrIndex}if(valid){valid=this.parseCharString(state,charstring,localSubrToUse,globalSubrIndex)}if(state.width!==null){widths[i]=state.width}if(state.seac!==null){seacs[i]=state.seac}if(!valid){charStrings.set(i,new Uint8Array([14]))}}return{charStrings:charStrings,seacs:seacs,widths:widths}},emptyPrivateDictionary:function CFFParser_emptyPrivateDictionary(parentDict){var privateDict=this.createDict(CFFPrivateDict,[],parentDict.strings);parentDict.setByKey(18,[0,0]);parentDict.privateDict=privateDict},parsePrivateDict:function CFFParser_parsePrivateDict(parentDict){if(!parentDict.hasName("Private")){this.emptyPrivateDictionary(parentDict);return}var privateOffset=parentDict.getByName("Private");if(!isArray(privateOffset)||privateOffset.length!==2){parentDict.removeByName("Private");return}var size=privateOffset[0];var offset=privateOffset[1];if(size===0||offset>=this.bytes.length){this.emptyPrivateDictionary(parentDict);return}var privateDictEnd=offset+size;var dictData=this.bytes.subarray(offset,privateDictEnd);var dict=this.parseDict(dictData);var privateDict=this.createDict(CFFPrivateDict,dict,parentDict.strings);parentDict.privateDict=privateDict;if(!privateDict.getByName("Subrs")){return}var subrsOffset=privateDict.getByName("Subrs");var relativeOffset=offset+subrsOffset;if(subrsOffset===0||relativeOffset>=this.bytes.length){this.emptyPrivateDictionary(parentDict); +return}var subrsIndex=this.parseIndex(relativeOffset);privateDict.subrsIndex=subrsIndex.obj},parseCharsets:function CFFParser_parseCharsets(pos,length,strings,cid){if(pos===0){return new CFFCharset(true,CFFCharsetPredefinedTypes.ISO_ADOBE,ISOAdobeCharset)}else if(pos===1){return new CFFCharset(true,CFFCharsetPredefinedTypes.EXPERT,ExpertCharset)}else if(pos===2){return new CFFCharset(true,CFFCharsetPredefinedTypes.EXPERT_SUBSET,ExpertSubsetCharset)}var bytes=this.bytes;var start=pos;var format=bytes[pos++];var charset=[".notdef"];var id,count,i;length-=1;switch(format){case 0:for(i=0;i=0&&index<=390){return CFFStandardStrings[index]}if(index-391<=this.strings.length){return this.strings[index-391]}return CFFStandardStrings[0]},add:function CFFStrings_add(value){this.strings.push(value)},get count(){return this.strings.length}};return CFFStrings}();var CFFIndex=function CFFIndexClosure(){function CFFIndex(){this.objects=[];this.length=0}CFFIndex.prototype={add:function CFFIndex_add(data){this.length+=data.length;this.objects.push(data)},set:function CFFIndex_set(index,data){this.length+=data.length-this.objects[index].length;this.objects[index]=data},get:function CFFIndex_get(index){return this.objects[index]},get count(){return this.objects.length}};return CFFIndex}();var CFFDict=function CFFDictClosure(){function CFFDict(tables,strings){this.keyToNameMap=tables.keyToNameMap;this.nameToKeyMap=tables.nameToKeyMap;this.defaults=tables.defaults;this.types=tables.types;this.opcodes=tables.opcodes;this.order=tables.order;this.strings=strings;this.values=Object.create(null)}CFFDict.prototype={setByKey:function CFFDict_setByKey(key,value){if(!(key in this.keyToNameMap)){return false}if(value.length===0){return true}var type=this.types[key];if(type==="num"||type==="sid"||type==="offset"){value=value[0]}this.values[key]=value;return true},setByName:function CFFDict_setByName(name,value){if(!(name in this.nameToKeyMap)){error('Invalid dictionary name "'+name+'"')}this.values[this.nameToKeyMap[name]]=value},hasName:function CFFDict_hasName(name){return this.nameToKeyMap[name]in this.values},getByName:function CFFDict_getByName(name){if(!(name in this.nameToKeyMap)){error('Invalid dictionary name "'+name+'"')}var key=this.nameToKeyMap[name];if(!(key in this.values)){return this.defaults[key]}return this.values[key]},removeByName:function CFFDict_removeByName(name){delete this.values[this.nameToKeyMap[name]]}};CFFDict.createTables=function CFFDict_createTables(layout){var tables={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(var i=0,ii=layout.length;i=this.fdSelect.length){return-1}return this.fdSelect[glyphIndex]}};return CFFFDSelect}();var CFFOffsetTracker=function CFFOffsetTrackerClosure(){function CFFOffsetTracker(){this.offsets=Object.create(null)}CFFOffsetTracker.prototype={isTracking:function CFFOffsetTracker_isTracking(key){return key in this.offsets},track:function CFFOffsetTracker_track(key,location){if(key in this.offsets){error("Already tracking location of "+key)}this.offsets[key]=location},offset:function CFFOffsetTracker_offset(value){for(var key in this.offsets){this.offsets[key]+=value}},setEntryLocation:function CFFOffsetTracker_setEntryLocation(key,values,output){if(!(key in this.offsets)){error("Not tracking location of "+key)}var data=output.data;var dataOffset=this.offsets[key];var size=5;for(var i=0,ii=values.length;i>24&255;data[offset2]=value>>16&255;data[offset3]=value>>8&255;data[offset4]=value&255}}};return CFFOffsetTracker}();var CFFCompiler=function CFFCompilerClosure(){function CFFCompiler(cff){this.cff=cff}CFFCompiler.prototype={compile:function CFFCompiler_compile(){var cff=this.cff;var output={data:[],length:0,add:function CFFCompiler_add(data){this.data=this.data.concat(data);this.length=this.data.length}};var header=this.compileHeader(cff.header);output.add(header);var nameIndex=this.compileNameIndex(cff.names);output.add(nameIndex);if(cff.isCIDFont){if(cff.topDict.hasName("FontMatrix")){var base=cff.topDict.getByName("FontMatrix");cff.topDict.removeByName("FontMatrix");for(var i=0,ii=cff.fdArray.length;i=-107&&value<=107){code=[value+139]}else if(value>=108&&value<=1131){value=[value-108];code=[(value>>8)+247,value&255]}else if(value>=-1131&&value<=-108){value=-value-108;code=[(value>>8)+251,value&255]}else if(value>=-32768&&value<=32767){code=[28,value>>8&255,value&255]}else{code=[29,value>>24&255,value>>16&255,value>>8&255,value&255]}return code},compileHeader:function CFFCompiler_compileHeader(header){return[header.major,header.minor,header.hdrSize,header.offSize]},compileNameIndex:function CFFCompiler_compileNameIndex(names){var nameIndex=new CFFIndex;for(var i=0,ii=names.length;i>8&255,count&255];var lastOffset=1,i;for(i=0;i>8&255,relativeOffset&255)}else if(offsetSize===3){data.push(relativeOffset>>16&255,relativeOffset>>8&255,relativeOffset&255)}else{data.push(relativeOffset>>>24&255,relativeOffset>>16&255,relativeOffset>>8&255,relativeOffset&255)}if(objects[i]){relativeOffset+=objects[i].length}}for(i=0;i>codeSize)*sampleMul;codeBuf&=(1<max){v=max}else if(v0){dmin=bounds[i-1]}var dmax=domain[1];if(i>1;var numInputs=domain.length>>1;var evaluator=new PostScriptEvaluator(code);var cache=Object.create(null);var MAX_CACHE_SIZE=2048*4;var cache_available=MAX_CACHE_SIZE;var tmpBuf=new Float32Array(numInputs);return function constructPostScriptFromIRResult(src,srcOffset,dest,destOffset){var i,value;var key="";var input=tmpBuf;for(i=0;ibound){value=bound}}output[i]=value}if(cache_available>0){cache_available--;cache[key]=output}dest.set(output,destOffset)}}}}();function isPDFFunction(v){var fnDict;if(typeof v!=="object"){return false}else if(isDict(v)){fnDict=v}else if(isStream(v)){fnDict=v.dict}else{return false}return fnDict.has("FunctionType")}var PostScriptStack=function PostScriptStackClosure(){var MAX_STACK_SIZE=100;function PostScriptStack(initialStack){this.stack=!initialStack?[]:Array.prototype.slice.call(initialStack,0)}PostScriptStack.prototype={push:function PostScriptStack_push(value){if(this.stack.length>=MAX_STACK_SIZE){error("PostScript function stack overflow.")}this.stack.push(value)},pop:function PostScriptStack_pop(){if(this.stack.length<=0){error("PostScript function stack underflow.")}return this.stack.pop()},copy:function PostScriptStack_copy(n){if(this.stack.length+n>=MAX_STACK_SIZE){error("PostScript function stack overflow.")}var stack=this.stack;for(var i=stack.length-n,j=n-1;j>=0;j--,i++){stack.push(stack[i])}},index:function PostScriptStack_index(n){this.push(this.stack[this.stack.length-n-1])},roll:function PostScriptStack_roll(n,p){var stack=this.stack;var l=stack.length-n;var r=stack.length-1,c=l+(p-Math.floor(p/n)*n),i,j,t;for(i=l,j=r;i0){stack.push(a<>b)}break;case"ceiling":a=stack.pop();stack.push(Math.ceil(a));break;case"copy":a=stack.pop();stack.copy(a);break;case"cos":a=stack.pop();stack.push(Math.cos(a));break;case"cvi":a=stack.pop()|0;stack.push(a);break;case"cvr":break;case"div":b=stack.pop();a=stack.pop();stack.push(a/b);break;case"dup":stack.copy(1);break;case"eq":b=stack.pop();a=stack.pop();stack.push(a===b);break;case"exch":stack.roll(2,1);break;case"exp":b=stack.pop();a=stack.pop();stack.push(Math.pow(a,b));break;case"false":stack.push(false);break;case"floor":a=stack.pop();stack.push(Math.floor(a));break;case"ge":b=stack.pop();a=stack.pop();stack.push(a>=b);break;case"gt":b=stack.pop();a=stack.pop();stack.push(a>b);break;case"idiv":b=stack.pop();a=stack.pop();stack.push(a/b|0);break;case"index":a=stack.pop();stack.index(a);break;case"le":b=stack.pop();a=stack.pop();stack.push(a<=b);break;case"ln":a=stack.pop();stack.push(Math.log(a));break;case"log":a=stack.pop();stack.push(Math.log(a)/Math.LN10);break;case"lt":b=stack.pop();a=stack.pop();stack.push(a=max){return new AstLiteral(max)}else if(num1.max<=max){return num1}return new AstMin(num1,max)}function PostScriptCompiler(){}PostScriptCompiler.prototype={compile:function PostScriptCompiler_compile(code,domain,range){var stack=[];var i,ii;var instructions=[];var inputSize=domain.length>>1,outputSize=range.length>>1;var lastRegister=0;var n,j;var num1,num2,ast1,ast2,tmpVar,item;for(i=0;iexpr.min){out.unshift("Math.max(",min,", ");out.push(")")}if(maxnumComponentColors&&this.name!=="DeviceGray"&&this.name!=="DeviceRGB"){var allColors=bpc<=8?new Uint8Array(numComponentColors):new Uint16Array(numComponentColors);var key;for(i=0;i255?255:c;dest[destOffset]=dest[destOffset+1]=dest[destOffset+2]=c},getRgbBuffer:function DeviceGrayCS_getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){var scale=255/((1<255?255:r;dest[destOffset+1]=g<0?0:g>255?255:g;dest[destOffset+2]=b<0?0:b>255?255:b},getRgbBuffer:function DeviceRgbCS_getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){if(bits===8&&alpha01===0){dest.set(src.subarray(srcOffset,srcOffset+count*3),destOffset);return}var scale=255/((1<255?255:r<0?0:r;dest[destOffset+1]=g>255?255:g<0?0:g;dest[destOffset+2]=b>255?255:b<0?0:b}function DeviceCmykCS(){this.name="DeviceCMYK";this.numComps=4;this.defaultColor=new Float32Array([0,0,0,1])}DeviceCmykCS.prototype={getRgb:ColorSpace.prototype.getRgb,getRgbItem:function DeviceCmykCS_getRgbItem(src,srcOffset,dest,destOffset){convertToRgb(src,srcOffset,1,dest,destOffset)},getRgbBuffer:function DeviceCmykCS_getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){var scale=1/((1<8){return Math.pow((L+16)/116,3)}return L*DECODE_L_CONSTANT}function compensateBlackPoint(sourceBlackPoint,XYZ_Flat,result){if(sourceBlackPoint[0]===0&&sourceBlackPoint[1]===0&&sourceBlackPoint[2]===0){result[0]=XYZ_Flat[0];result[1]=XYZ_Flat[1];result[2]=XYZ_Flat[2];return}var zeroDecodeL=decodeL(0);var X_DST=zeroDecodeL;var X_SRC=decodeL(sourceBlackPoint[0]);var Y_DST=zeroDecodeL;var Y_SRC=decodeL(sourceBlackPoint[1]);var Z_DST=zeroDecodeL;var Z_SRC=decodeL(sourceBlackPoint[2]);var X_Scale=(1-X_DST)/(1-X_SRC);var X_Offset=1-X_Scale;var Y_Scale=(1-Y_DST)/(1-Y_SRC);var Y_Offset=1-Y_Scale;var Z_Scale=(1-Z_DST)/(1-Z_SRC);var Z_Offset=1-Z_Scale;result[0]=XYZ_Flat[0]*X_Scale+X_Offset;result[1]=XYZ_Flat[1]*Y_Scale+Y_Offset;result[2]=XYZ_Flat[2]*Z_Scale+Z_Offset}function normalizeWhitePointToFlat(sourceWhitePoint,XYZ_In,result){if(sourceWhitePoint[0]===1&&sourceWhitePoint[2]===1){result[0]=XYZ_In[0];result[1]=XYZ_In[1];result[2]=XYZ_In[2];return}var LMS=result;matrixProduct(BRADFORD_SCALE_MATRIX,XYZ_In,LMS);var LMS_Flat=tempNormalizeMatrix;convertToFlat(sourceWhitePoint,LMS,LMS_Flat);matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX,LMS_Flat,result)}function normalizeWhitePointToD65(sourceWhitePoint,XYZ_In,result){var LMS=result;matrixProduct(BRADFORD_SCALE_MATRIX,XYZ_In,LMS);var LMS_D65=tempNormalizeMatrix;convertToD65(sourceWhitePoint,LMS,LMS_D65);matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX,LMS_D65,result)}function convertToRgb(cs,src,srcOffset,dest,destOffset,scale){var A=adjustToRange(0,1,src[srcOffset]*scale);var B=adjustToRange(0,1,src[srcOffset+1]*scale);var C=adjustToRange(0,1,src[srcOffset+2]*scale);var AGR=Math.pow(A,cs.GR);var BGG=Math.pow(B,cs.GG);var CGB=Math.pow(C,cs.GB);var X=cs.MXA*AGR+cs.MXB*BGG+cs.MXC*CGB;var Y=cs.MYA*AGR+cs.MYB*BGG+cs.MYC*CGB;var Z=cs.MZA*AGR+cs.MZB*BGG+cs.MZC*CGB;var XYZ=tempConvertMatrix1;XYZ[0]=X;XYZ[1]=Y;XYZ[2]=Z;var XYZ_Flat=tempConvertMatrix2;normalizeWhitePointToFlat(cs.whitePoint,XYZ,XYZ_Flat);var XYZ_Black=tempConvertMatrix1;compensateBlackPoint(cs.blackPoint,XYZ_Flat,XYZ_Black);var XYZ_D65=tempConvertMatrix2;normalizeWhitePointToD65(FLAT_WHITEPOINT_MATRIX,XYZ_Black,XYZ_D65);var SRGB=tempConvertMatrix1;matrixProduct(SRGB_D65_XYZ_TO_RGB_MATRIX,XYZ_D65,SRGB);var sR=sRGBTransferFunction(SRGB[0]);var sG=sRGBTransferFunction(SRGB[1]);var sB=sRGBTransferFunction(SRGB[2]);dest[destOffset]=Math.round(sR*255);dest[destOffset+1]=Math.round(sG*255);dest[destOffset+2]=Math.round(sB*255)}CalRGBCS.prototype={getRgb:function CalRGBCS_getRgb(src,srcOffset){var rgb=new Uint8Array(3);this.getRgbItem(src,srcOffset,rgb,0);return rgb},getRgbItem:function CalRGBCS_getRgbItem(src,srcOffset,dest,destOffset){convertToRgb(this,src,srcOffset,dest,destOffset,1)},getRgbBuffer:function CalRGBCS_getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){var scale=1/((1<this.amax||this.bmin>this.bmax){info("Invalid Range, falling back to defaults");this.amin=-100;this.amax=100;this.bmin=-100;this.bmax=100}}function fn_g(x){if(x>=6/29){return x*x*x}else{return 108/841*(x-4/29)}}function decode(value,high1,low2,high2){return low2+value*(high2-low2)/high1}function convertToRgb(cs,src,srcOffset,maxVal,dest,destOffset){var Ls=src[srcOffset];var as=src[srcOffset+1];var bs=src[srcOffset+2];if(maxVal!==false){Ls=decode(Ls,maxVal,0,100);as=decode(as,maxVal,cs.amin,cs.amax);bs=decode(bs,maxVal,cs.bmin,cs.bmax)}as=as>cs.amax?cs.amax:ascs.bmax?cs.bmax:bs=1?255:Math.sqrt(r)*255|0;dest[destOffset+1]=g<=0?0:g>=1?255:Math.sqrt(g)*255|0;dest[destOffset+2]=b<=0?0:b>=1?255:Math.sqrt(b)*255|0}LabCS.prototype={getRgb:ColorSpace.prototype.getRgb,getRgbItem:function LabCS_getRgbItem(src,srcOffset,dest,destOffset){convertToRgb(this,src,srcOffset,false,dest,destOffset)},getRgbBuffer:function LabCS_getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){var maxVal=(1<max?max:value}function PDFImage(xref,res,image,inline,smask,mask,isMask){this.image=image;var dict=image.dict;if(dict.has("Filter")){var filter=dict.get("Filter").name;if(filter==="JPXDecode"){var jpxImage=new JpxImage;jpxImage.parseImageProperties(image.stream);image.stream.reset();image.bitsPerComponent=jpxImage.bitsPerComponent;image.numComps=jpxImage.componentsCount}else if(filter==="JBIG2Decode"){image.bitsPerComponent=1;image.numComps=1}}this.width=dict.get("Width","W");this.height=dict.get("Height","H");if(this.width<1||this.height<1){error("Invalid image width: "+this.width+" or height: "+this.height)}this.interpolate=dict.get("Interpolate","I")||false;this.imageMask=dict.get("ImageMask","IM")||false;this.matte=dict.get("Matte")||false;var bitsPerComponent=image.bitsPerComponent;if(!bitsPerComponent){bitsPerComponent=dict.get("BitsPerComponent","BPC");if(!bitsPerComponent){if(this.imageMask){bitsPerComponent=1}else{error("Bits per component missing in image: "+this.imageMask)}}}this.bpc=bitsPerComponent;if(!this.imageMask){var colorSpace=dict.get("ColorSpace","CS");if(!colorSpace){info("JPX images (which do not require color spaces)");switch(image.numComps){case 1:colorSpace=Name.get("DeviceGray");break;case 3:colorSpace=Name.get("DeviceRGB");break;case 4:colorSpace=Name.get("DeviceCMYK");break;default:error("JPX images with "+this.numComps+" color components not supported.")}}this.colorSpace=ColorSpace.parse(colorSpace,xref,res);this.numComps=this.colorSpace.numComps}this.decode=dict.get("Decode","D");this.needsDecode=false;if(this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode)||isMask&&!ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=true;var max=(1<>3)*height;var actualLength=imgArray.byteLength;var haveFullData=computedLength===actualLength;var data,i;if(imageIsFromDecodeStream&&(!inverseDecode||haveFullData)){data=imgArray}else if(!inverseDecode){data=new Uint8Array(actualLength);data.set(imgArray)}else{data=new Uint8Array(computedLength);data.set(imgArray);for(i=actualLength;i>7&1;output[i+1]=buf>>6&1;output[i+2]=buf>>5&1;output[i+3]=buf>>4&1;output[i+4]=buf>>3&1;output[i+5]=buf>>2&1;output[i+6]=buf>>1&1;output[i+7]=buf&1;i+=8}if(i>=1}}}}else{var bits=0;buf=0;for(i=0,ii=length;i>remainingBits;output[i]=value<0?0:value>max?max:value;buf=buf&(1<mask[maskOffset+1]){opacity=255;break}}alphaBuf[i]=opacity}}else{error("Unknown mask format.")}}if(alphaBuf){for(i=0,j=3,ii=width*actualHeight;i=255?255:r|0;buffer[i+1]=g<=0?0:g>=255?255:g|0;buffer[i+2]=b<=0?0:b>=255?255:b|0}},createImageData:function PDFImage_createImageData(forceRGBA){var drawWidth=this.drawWidth;var drawHeight=this.drawHeight;var imgData={width:drawWidth,height:drawHeight};var numComps=this.numComps;var originalWidth=this.width;var originalHeight=this.height;var bpc=this.bpc;var rowBytes=originalWidth*numComps*bpc+7>>3;var imgArray;if(!forceRGBA){var kind;if(this.colorSpace.name==="DeviceGray"&&bpc===1){kind=ImageKind.GRAYSCALE_1BPP}else if(this.colorSpace.name==="DeviceRGB"&&bpc===8&&!this.needsDecode){kind=ImageKind.RGB_24BPP}if(kind&&!this.smask&&!this.mask&&drawWidth===originalWidth&&drawHeight===originalHeight){imgData.kind=kind;imgArray=this.getImageBytes(originalHeight*rowBytes);if(this.image instanceof DecodeStream){imgData.data=imgArray}else{var newArray=new Uint8Array(imgArray.length);newArray.set(imgArray);imgData.data=newArray}if(this.needsDecode){assert(kind===ImageKind.GRAYSCALE_1BPP);var buffer=imgData.data;for(var i=0,ii=buffer.length;i>3;var imgArray=this.getImageBytes(height*rowBytes);var comps=this.getComponents(imgArray);var i,length;if(bpc===1){length=width*height;if(this.needsDecode){for(i=0;i=t1||step<=0){info("Bad shading domain.");return}var color=new Float32Array(cs.numComps),ratio=new Float32Array(1);var rgbColor;for(var i=t0;i<=t1;i+=step){ratio[0]=i;fn(ratio,0,color,0);rgbColor=cs.getRgb(color,0);var cssColor=Util.makeCssRgb(rgbColor[0],rgbColor[1],rgbColor[2]);colorStops.push([(i-t0)/diff,cssColor])}var background="transparent";if(dict.has("Background")){rgbColor=cs.getRgb(dict.get("Background"),0);background=Util.makeCssRgb(rgbColor[0],rgbColor[1],rgbColor[2])}if(!extendStart){colorStops.unshift([0,background]);colorStops[1][0]+=Shadings.SMALL_NUMBER}if(!extendEnd){colorStops[colorStops.length-1][0]-=Shadings.SMALL_NUMBER;colorStops.push([1,background])}this.colorStops=colorStops}RadialAxial.prototype={getIR:function RadialAxial_getIR(){var coordsArr=this.coordsArr;var shadingType=this.shadingType;var type,p0,p1,r0,r1;if(shadingType===ShadingType.AXIAL){p0=[coordsArr[0],coordsArr[1]];p1=[coordsArr[2],coordsArr[3]];r0=null;r1=null;type="axial"}else if(shadingType===ShadingType.RADIAL){p0=[coordsArr[0],coordsArr[1]];p1=[coordsArr[3],coordsArr[4]];r0=coordsArr[2];r1=coordsArr[5];type="radial"}else{error("getPattern type unknown: "+shadingType)}var matrix=this.matrix;if(matrix){p0=Util.applyTransform(p0,matrix);p1=Util.applyTransform(p1,matrix);if(shadingType===ShadingType.RADIAL){var scale=Util.singularValueDecompose2dScale(matrix);r0*=scale[0];r1*=scale[1]}}return["RadialAxial",type,this.colorStops,p0,p1,r0,r1]}};return RadialAxial}();Shadings.Mesh=function MeshClosure(){function MeshStreamReader(stream,context){this.stream=stream;this.context=context;this.buffer=0;this.bufferLength=0;var numComps=context.numComps;this.tmpCompsBuf=new Float32Array(numComps);var csNumComps=context.colorSpace.numComps;this.tmpCsCompsBuf=context.colorFn?new Float32Array(csNumComps):this.tmpCompsBuf}MeshStreamReader.prototype={get hasData(){if(this.stream.end){return this.stream.pos0){return true}var nextByte=this.stream.getByte();if(nextByte<0){return false}this.buffer=nextByte;this.bufferLength=8;return true},readBits:function MeshStreamReader_readBits(n){var buffer=this.buffer;var bufferLength=this.bufferLength;if(n===32){if(bufferLength===0){return(this.stream.getByte()<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte())>>>0}buffer=buffer<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte();var nextByte=this.stream.getByte();this.buffer=nextByte&(1<>bufferLength)>>>0}if(n===8&&bufferLength===0){return this.stream.getByte()}while(bufferLength>bufferLength},align:function MeshStreamReader_align(){this.buffer=0;this.bufferLength=0},readFlag:function MeshStreamReader_readFlag(){return this.readBits(this.context.bitsPerFlag)},readCoordinate:function MeshStreamReader_readCoordinate(){var bitsPerCoordinate=this.context.bitsPerCoordinate;var xi=this.readBits(bitsPerCoordinate);var yi=this.readBits(bitsPerCoordinate);var decode=this.context.decode;var scale=bitsPerCoordinate<32?1/((1<x?x:minX;minY=minY>y?y:minY;maxX=maxX=2,"Invalid VerticesPerRow");decodeType5Shading(this,reader,verticesPerRow);break;case ShadingType.COONS_PATCH_MESH:decodeType6Shading(this,reader);patchMesh=true;break;case ShadingType.TENSOR_PATCH_MESH:decodeType7Shading(this,reader);patchMesh=true;break;default:error("Unsupported mesh type.");break}if(patchMesh){updateBounds(this);for(var i=0,ii=this.figures.length;iPDFJS.maxImageSize){warn("Image exceeded maximum allowed size and was removed.");return}var imageMask=dict.get("ImageMask","IM")||false;var imgData,args;if(imageMask){var width=dict.get("Width","W");var height=dict.get("Height","H");var bitStrideLength=width+7>>3;var imgArray=image.getBytes(bitStrideLength*height);var decode=dict.get("Decode","D");var inverseDecode=!!decode&&decode[0]>0;imgData=PDFImage.createMask(imgArray,width,height,image instanceof DecodeStream,inverseDecode);imgData.cached=true;args=[imgData];operatorList.addOp(OPS.paintImageMaskXObject,args);if(cacheKey){imageCache[cacheKey]={fn:OPS.paintImageMaskXObject,args:args}}return}var softMask=dict.get("SMask","SM")||false;var mask=dict.get("Mask")||false;var SMALL_IMAGE_DIMENSIONS=200;if(inline&&!softMask&&!mask&&!(image instanceof JpegStream)&&w+h0){operatorList.addOp(OPS.setGState,[gStateObj])}})},loadFont:function PartialEvaluator_loadFont(fontName,font,xref,resources){function errorFont(){return Promise.resolve(new TranslatedFont("g_font_error",new ErrorFont("Font "+fontName+" is not available"),font))}var fontRef;if(font){assert(isRef(font));fontRef=font}else{var fontRes=resources.get("Font");if(fontRes){fontRef=fontRes.getRaw(fontName)}else{warn("fontRes not available");return errorFont()}}if(!fontRef){warn("fontRef not available");return errorFont()}if(this.fontCache.has(fontRef)){return this.fontCache.get(fontRef)}font=xref.fetchIfRef(fontRef);if(!isDict(font)){return errorFont()}if(font.translated){return font.translated}var fontCapability=createPromiseCapability();var preEvaluatedFont=this.preEvaluateFont(font,xref);var descriptor=preEvaluatedFont.descriptor;var fontID=fontRef.num+"_"+fontRef.gen;if(isDict(descriptor)){if(!descriptor.fontAliases){descriptor.fontAliases=Object.create(null)}var fontAliases=descriptor.fontAliases;var hash=preEvaluatedFont.hash;if(fontAliases[hash]){var aliasFontRef=fontAliases[hash].aliasRef;if(aliasFontRef&&this.fontCache.has(aliasFontRef)){this.fontCache.putAlias(fontRef,aliasFontRef);return this.fontCache.get(fontRef)}}if(!fontAliases[hash]){fontAliases[hash]={fontID:Font.getFontID()}}fontAliases[hash].aliasRef=fontRef;fontID=fontAliases[hash].fontID}var fontRefIsDict=isDict(fontRef);if(!fontRefIsDict){this.fontCache.put(fontRef,fontCapability.promise)}font.loadedName="g_"+this.pdfManager.docId+"_f"+(fontRefIsDict?fontName.replace(/\W/g,""):fontID);font.translated=fontCapability.promise;var translatedPromise;try{translatedPromise=Promise.resolve(this.translateFont(preEvaluatedFont,xref))}catch(e){translatedPromise=Promise.reject(e)}var self=this;translatedPromise.then(function(translatedFont){if(translatedFont.fontType!==undefined){var xrefFontStats=xref.stats.fontTypes;xrefFontStats[translatedFont.fontType]=true}fontCapability.resolve(new TranslatedFont(font.loadedName,translatedFont,font))},function(reason){self.handler.send("UnsupportedFeature",{featureId:UNSUPPORTED_FEATURES.font});try{var descriptor=preEvaluatedFont.descriptor;var fontFile3=descriptor&&descriptor.get("FontFile3");var subtype=fontFile3&&fontFile3.get("Subtype");var fontType=getFontType(preEvaluatedFont.type,subtype&&subtype.name);var xrefFontStats=xref.stats.fontTypes;xrefFontStats[fontType]=true}catch(ex){}fontCapability.resolve(new TranslatedFont(font.loadedName,new ErrorFont(reason instanceof Error?reason.message:reason),font))});return fontCapability.promise},buildPath:function PartialEvaluator_buildPath(operatorList,fn,args){var lastIndex=operatorList.length-1;if(!args){args=[]}if(lastIndex<0||operatorList.fnArray[lastIndex]!==OPS.constructPath){operatorList.addOp(OPS.constructPath,[[fn],args])}else{var opArgs=operatorList.argsArray[lastIndex];opArgs[0].push(fn);Array.prototype.push.apply(opArgs[1],args)}},handleColorN:function PartialEvaluator_handleColorN(operatorList,fn,args,cs,patterns,resources,task,xref){var patternName=args[args.length-1];var pattern;if(isName(patternName)&&(pattern=patterns.get(patternName.name))){var dict=isStream(pattern)?pattern.dict:pattern;var typeNum=dict.get("PatternType");if(typeNum===TILING_PATTERN){var color=cs.base?cs.base.getRgb(args,0):null;return this.handleTilingType(fn,color,resources,pattern,dict,operatorList,task)}else if(typeNum===SHADING_PATTERN){var shading=dict.get("Shading");var matrix=dict.get("Matrix");pattern=Pattern.parseShading(shading,matrix,xref,resources,this.handler);operatorList.addOp(fn,pattern.getIR());return Promise.resolve()}else{return Promise.reject("Unknown PatternType: "+typeNum)}}operatorList.addOp(fn,args);return Promise.resolve()},getOperatorList:function PartialEvaluator_getOperatorList(stream,task,resources,operatorList,initialState){var self=this;var xref=this.xref;var imageCache=Object.create(null);assert(operatorList);resources=resources||Dict.empty;var xobjs=resources.get("XObject")||Dict.empty;var patterns=resources.get("Pattern")||Dict.empty;var stateManager=new StateManager(initialState||new EvalState);var preprocessor=new EvaluatorPreprocessor(stream,xref,stateManager);var timeSlotManager=new TimeSlotManager;return new Promise(function next(resolve,reject){task.ensureNotTerminated();timeSlotManager.reset();var stop,operation={},i,ii,cs;while(!(stop=timeSlotManager.check())){operation.args=null;if(!preprocessor.read(operation)){break}var args=operation.args;var fn=operation.fn;switch(fn|0){case OPS.paintXObject:if(args[0].code){break}var name=args[0].name;if(!name){warn("XObject must be referred to by name.");continue}if(imageCache[name]!==undefined){operatorList.addOp(imageCache[name].fn,imageCache[name].args);args=null;continue}var xobj=xobjs.get(name);if(xobj){assert(isStream(xobj),"XObject should be a stream");var type=xobj.dict.get("Subtype");assert(isName(type),"XObject should have a Name subtype");if(type.name==="Form"){stateManager.save();return self.buildFormXObject(resources,xobj,null,operatorList,task,stateManager.state.clone()).then(function(){stateManager.restore();next(resolve,reject)},reject)}else if(type.name==="Image"){self.buildPaintImageXObject(resources,xobj,false,operatorList,name,imageCache);args=null;continue}else if(type.name==="PS"){info("Ignored XObject subtype PS");continue}else{error("Unhandled XObject subtype "+type.name)}}break;case OPS.setFont:var fontSize=args[1];return self.handleSetFont(resources,args,null,operatorList,task,stateManager.state).then(function(loadedName){operatorList.addDependency(loadedName);operatorList.addOp(OPS.setFont,[loadedName,fontSize]);next(resolve,reject)},reject);case OPS.endInlineImage:var cacheKey=args[0].cacheKey;if(cacheKey){var cacheEntry=imageCache[cacheKey];if(cacheEntry!==undefined){operatorList.addOp(cacheEntry.fn,cacheEntry.args);args=null;continue}}self.buildPaintImageXObject(resources,args[0],true,operatorList,cacheKey,imageCache);args=null;continue;case OPS.showText:args[0]=self.handleText(args[0],stateManager.state);break;case OPS.showSpacedText:var arr=args[0];var combinedGlyphs=[];var arrLength=arr.length;var state=stateManager.state;for(i=0;i0){glyphHeight=glyphHeight*textState.fontMatrix[3];tsm[3]*=glyphHeight}}var trm=Util.transform(textState.ctm,Util.transform(textState.textMatrix,tsm));textContentItem.transform=trm;if(!font.vertical){textContentItem.width=0;textContentItem.height=Math.sqrt(trm[2]*trm[2]+trm[3]*trm[3]);textContentItem.vertical=false}else{textContentItem.width=Math.sqrt(trm[0]*trm[0]+trm[1]*trm[1]);textContentItem.height=0;textContentItem.vertical=true}var a=textState.textLineMatrix[0];var b=textState.textLineMatrix[1];var scaleLineX=Math.sqrt(a*a+b*b);a=textState.ctm[0];b=textState.ctm[1];var scaleCtmX=Math.sqrt(a*a+b*b);textContentItem.textAdvanceScale=scaleCtmX*scaleLineX;textContentItem.lastAdvanceWidth=0;textContentItem.lastAdvanceHeight=0;var spaceWidth=font.spaceWidth/1e3*textState.fontSize;if(spaceWidth){textContentItem.spaceWidth=spaceWidth;textContentItem.fakeSpaceMin=spaceWidth*SPACE_FACTOR;textContentItem.fakeMultiSpaceMin=spaceWidth*MULTI_SPACE_FACTOR;textContentItem.fakeMultiSpaceMax=spaceWidth*MULTI_SPACE_FACTOR_MAX;textContentItem.textRunBreakAllowed=!font.isMonospace}else{textContentItem.spaceWidth=0;textContentItem.fakeSpaceMin=Infinity;textContentItem.fakeMultiSpaceMin=Infinity;textContentItem.fakeMultiSpaceMax=0;textContentItem.textRunBreakAllowed=false}textContentItem.initialized=true;return textContentItem}function replaceWhitespace(str){var i=0,ii=str.length,code;while(i=32&&code<=127){i++}return i0){addFakeSpaces(wordSpacing,textChunk.str)}}var tx=0;var ty=0;if(!font.vertical){var w0=glyphWidth*textState.fontMatrix[0];tx=(w0*textState.fontSize+charSpacing)*textState.textHScale;width+=tx}else{var w1=glyphWidth*textState.fontMatrix[0];ty=w1*textState.fontSize+charSpacing;height+=ty}textState.translateTextMatrix(tx,ty);textChunk.str.push(glyphUnicode)}if(!font.vertical){textChunk.lastAdvanceWidth=width;textChunk.width+=width*textChunk.textAdvanceScale}else{textChunk.lastAdvanceHeight=height;textChunk.height+=Math.abs(height*textChunk.textAdvanceScale)}return textChunk}function addFakeSpaces(width,strBuf){if(width0){strBuf.push(" ")}}function flushTextContentItem(){if(!textContentItem.initialized){return}textContent.items.push(runBidiTransform(textContentItem));textContentItem.initialized=false;textContentItem.str.length=0}var timeSlotManager=new TimeSlotManager;return new Promise(function next(resolve,reject){task.ensureNotTerminated();timeSlotManager.reset();var stop,operation={},args=[];while(!(stop=timeSlotManager.check())){args.length=0;operation.args=args;if(!preprocessor.read(operation)){break}textState=stateManager.state;var fn=operation.fn;args=operation.args;var advance;switch(fn|0){case OPS.setFont:flushTextContentItem();textState.fontSize=args[1];return handleSetFont(args[0].name).then(function(){next(resolve,reject)},reject);case OPS.setTextRise:flushTextContentItem();textState.textRise=args[0];break;case OPS.setHScale:flushTextContentItem();textState.textHScale=args[0]/100;break;case OPS.setLeading:flushTextContentItem();textState.leading=args[0];break;case OPS.moveText:var isSameTextLine=!textState.font?false:(textState.font.vertical?args[0]:args[1])===0;advance=args[0]-args[1];if(isSameTextLine&&textContentItem.initialized&&advance>0&&advance<=textContentItem.fakeMultiSpaceMax){textState.translateTextLineMatrix(args[0],args[1]);textContentItem.width+=args[0]-textContentItem.lastAdvanceWidth;textContentItem.height+=args[1]-textContentItem.lastAdvanceHeight;var diff=args[0]-textContentItem.lastAdvanceWidth-(args[1]-textContentItem.lastAdvanceHeight);addFakeSpaces(diff,textContentItem.str);break}flushTextContentItem();textState.translateTextLineMatrix(args[0],args[1]);textState.textMatrix=textState.textLineMatrix.slice();break;case OPS.setLeadingMoveText:flushTextContentItem();textState.leading=-args[1];textState.translateTextLineMatrix(args[0],args[1]);textState.textMatrix=textState.textLineMatrix.slice();break;case OPS.nextLine:flushTextContentItem();textState.carriageReturn();break;case OPS.setTextMatrix:flushTextContentItem();textState.setTextMatrix(args[0],args[1],args[2],args[3],args[4],args[5]);textState.setTextLineMatrix(args[0],args[1],args[2],args[3],args[4],args[5]);break;case OPS.setCharSpacing:textState.charSpacing=args[0];break;case OPS.setWordSpacing:textState.wordSpacing=args[0];break;case OPS.beginText:flushTextContentItem();textState.textMatrix=IDENTITY_MATRIX.slice();textState.textLineMatrix=IDENTITY_MATRIX.slice();break;case OPS.showSpacedText:var items=args[0];var offset;for(var j=0,jj=items.length;jtextContentItem.fakeMultiSpaceMax;if(!breakTextRun){textContentItem.height+=offset}}else{advance=-advance;offset=advance*(textState.textHScale*textState.textMatrix[0]+textState.textMatrix[1]);textState.translateTextMatrix(advance,0);breakTextRun=textContentItem.textRunBreakAllowed&&advance>textContentItem.fakeMultiSpaceMax;if(!breakTextRun){textContentItem.width+=offset}}if(breakTextRun){flushTextContentItem()}else if(advance>0){addFakeSpaces(advance,textContentItem.str)}}}break;case OPS.showText:buildTextContentItem(args[0]);break;case OPS.nextLineShowText:flushTextContentItem();textState.carriageReturn();buildTextContentItem(args[0]);break;case OPS.nextLineSetSpacingShowText:flushTextContentItem();textState.wordSpacing=args[0];textState.charSpacing=args[1];textState.carriageReturn();buildTextContentItem(args[2]);break;case OPS.paintXObject:flushTextContentItem();if(args[0].code){break}if(!xobjs){xobjs=resources.get("XObject")||Dict.empty}var name=args[0].name;if(xobjsCache.key===name){if(xobjsCache.texts){Util.appendToArray(textContent.items,xobjsCache.texts.items);Util.extendObj(textContent.styles,xobjsCache.texts.styles)}break}var xobj=xobjs.get(name);if(!xobj){break}assert(isStream(xobj),"XObject should be a stream");var type=xobj.dict.get("Subtype");assert(isName(type),"XObject should have a Name subtype");if("Form"!==type.name){xobjsCache.key=name;xobjsCache.texts=null;break}stateManager.save();var matrix=xobj.dict.get("Matrix"); +if(isArray(matrix)&&matrix.length===6){stateManager.transform(matrix)}return self.getTextContent(xobj,task,xobj.dict.get("Resources")||resources,stateManager,normalizeWhitespace).then(function(formTextContent){Util.appendToArray(textContent.items,formTextContent.items);Util.extendObj(textContent.styles,formTextContent.styles);stateManager.restore();xobjsCache.key=name;xobjsCache.texts=formTextContent;next(resolve,reject)},reject);case OPS.setGState:flushTextContentItem();var dictName=args[0];var extGState=resources.get("ExtGState");if(!isDict(extGState)||!extGState.has(dictName.name)){break}var gsStateMap=extGState.get(dictName.name);var gsStateFont=null;for(var key in gsStateMap){if(key==="Font"){assert(!gsStateFont);gsStateFont=gsStateMap[key]}}if(gsStateFont){textState.fontSize=gsStateFont[1];return handleSetFont(gsStateFont[0]).then(function(){next(resolve,reject)},reject)}break}}if(stop){deferred.then(function(){next(resolve,reject)},reject);return}flushTextContentItem();resolve(textContent)})},extractDataStructures:function partialEvaluatorExtractDataStructures(dict,baseDict,xref,properties){var toUnicode=dict.get("ToUnicode")||baseDict.get("ToUnicode");if(toUnicode){properties.toUnicode=this.readToUnicode(toUnicode)}if(properties.composite){var cidSystemInfo=dict.get("CIDSystemInfo");if(isDict(cidSystemInfo)){properties.cidSystemInfo={registry:cidSystemInfo.get("Registry"),ordering:cidSystemInfo.get("Ordering"),supplement:cidSystemInfo.get("Supplement")}}var cidToGidMap=dict.get("CIDToGIDMap");if(isStream(cidToGidMap)){properties.cidToGidMap=this.readCidToGidMap(cidToGidMap)}}var differences=[];var baseEncodingName=null;var encoding;if(dict.has("Encoding")){encoding=dict.get("Encoding");if(isDict(encoding)){baseEncodingName=encoding.get("BaseEncoding");baseEncodingName=isName(baseEncodingName)?baseEncodingName.name:null;if(encoding.has("Differences")){var diffEncoding=encoding.get("Differences");var index=0;for(var j=0,jj=diffEncoding.length;j>1;result[code]=glyphID}return result},extractWidths:function PartialEvaluator_extractWidths(dict,xref,descriptor,properties){var glyphsWidths=[];var defaultWidth=0;var glyphsVMetrics=[];var defaultVMetrics;var i,ii,j,jj,start,code,widths;if(properties.composite){defaultWidth=dict.get("DW")||1e3;widths=dict.get("W");if(widths){for(i=0,ii=widths.length;i=CHUNK_SIZE){this.flush()}else if(this.fnArray.length>=CHUNK_SIZE_ABOUT&&(fn===OPS.restore||fn===OPS.endText)){this.flush()}}},addDependency:function(dependency){if(dependency in this.dependencies){return}this.dependencies[dependency]=true;this.addOp(OPS.dependency,[dependency])},addDependencies:function(dependencies){for(var key in dependencies){this.addDependency(key)}},addOpList:function(opList){Util.extendObj(this.dependencies,opList.dependencies);for(var i=0,ii=opList.length;inumArgs){nonProcessedArgs.push(args.shift());argsLength--}while(argsLengthnumArgs){info("Command "+fn+": expected [0,"+numArgs+"] args, but received "+argsLength+" args")}this.preprocessCommand(fn,args);operation.fn=fn;operation.args=args;return true}else{if(isEOF(obj)){return false}if(obj!==null){if(!args){args=[]}args.push(obj);assert(args.length<=33,"Too many arguments")}}}},preprocessCommand:function EvaluatorPreprocessor_preprocessCommand(fn,args){switch(fn|0){case OPS.save:this.stateManager.save();break;case OPS.restore:this.stateManager.restore();break;case OPS.transform:this.stateManager.transform(args);break}}};return EvaluatorPreprocessor}();var QueueOptimizer=function QueueOptimizerClosure(){function addState(parentState,pattern,fn){var state=parentState;for(var i=0,ii=pattern.length-1;iMAX_WIDTH){maxX=Math.max(maxX,currentX);currentY+=maxLineHeight+2*IMAGE_PADDING;currentX=0;maxLineHeight=0}map.push({transform:transform,x:currentX,y:currentY,w:img.width,h:img.height});currentX+=img.width+2*IMAGE_PADDING;maxLineHeight=Math.max(maxLineHeight,img.height)}var imgWidth=Math.max(maxX,currentX)+IMAGE_PADDING;var imgHeight=currentY+maxLineHeight+IMAGE_PADDING;var imgData=new Uint8Array(imgWidth*imgHeight*4);var imgRowSize=imgWidth<<2;for(q=0;q=0){data[offset-4]=data[offset];data[offset-3]=data[offset+1];data[offset-2]=data[offset+2];data[offset-1]=data[offset+3];data[offset+rowSize]=data[offset+rowSize-4];data[offset+rowSize+1]=data[offset+rowSize-3];data[offset+rowSize+2]=data[offset+rowSize-2];data[offset+rowSize+3]=data[offset+rowSize-1];offset-=imgRowSize}}fnArray.splice(iFirstSave,count*4,OPS.paintInlineImageXObjectGroup);argsArray.splice(iFirstSave,count*4,[{width:imgWidth,height:imgHeight,kind:ImageKind.RGBA_32BPP,data:imgData},map]);return iFirstSave+1});addState(InitialState,[OPS.save,OPS.transform,OPS.paintImageMaskXObject,OPS.restore],function foundImageMaskGroup(context){var MIN_IMAGES_IN_MASKS_BLOCK=10;var MAX_IMAGES_IN_MASKS_BLOCK=100;var MAX_SAME_IMAGES_IN_MASKS_BLOCK=1e3;var fnArray=context.fnArray,argsArray=context.argsArray;var curr=context.iCurr;var iFirstSave=curr-3;var iFirstTransform=curr-2;var iFirstPIMXO=curr-1;var i=iFirstSave+4;var ii=fnArray.length;while(i+3=4&&fnArray[iFirstBeginText-4]===fnArray[iFirstSetFont]&&fnArray[iFirstBeginText-3]===fnArray[iFirstSetTextMatrix]&&fnArray[iFirstBeginText-2]===fnArray[iFirstShowText]&&fnArray[iFirstBeginText-1]===fnArray[iFirstEndText]&&argsArray[iFirstBeginText-4][0]===firstSetFontArg0&&argsArray[iFirstBeginText-4][1]===firstSetFontArg1){ +count++;iFirst-=5}var iEndText=iFirst+4;for(var q=1;q0}return false},setRectangle:function Annotation_setRectangle(rectangle){if(isArray(rectangle)&&rectangle.length===4){this.rectangle=Util.normalizeRect(rectangle)}else{this.rectangle=[0,0,0,0]}},setColor:function Annotation_setColor(color){var rgbColor=new Uint8Array(3);if(!isArray(color)){this.color=rgbColor;return}switch(color.length){case 0:this.color=null;break;case 1:ColorSpace.singletons.gray.getRgbItem(color,0,rgbColor,0);this.color=rgbColor;break;case 3:ColorSpace.singletons.rgb.getRgbItem(color,0,rgbColor,0);this.color=rgbColor;break;case 4:ColorSpace.singletons.cmyk.getRgbItem(color,0,rgbColor,0);this.color=rgbColor;break;default:this.color=rgbColor;break}},setBorderStyle:function Annotation_setBorderStyle(borderStyle){this.borderStyle=new AnnotationBorderStyle;if(!isDict(borderStyle)){return}if(borderStyle.has("BS")){var dict=borderStyle.get("BS");var dictType;if(!dict.has("Type")||isName(dictType=dict.get("Type"))&&dictType.name==="Border"){this.borderStyle.setWidth(dict.get("W"));this.borderStyle.setStyle(dict.get("S"));this.borderStyle.setDashArray(dict.get("D"))}}else if(borderStyle.has("Border")){var array=borderStyle.get("Border");if(isArray(array)&&array.length>=3){this.borderStyle.setHorizontalCornerRadius(array[0]);this.borderStyle.setVerticalCornerRadius(array[1]);this.borderStyle.setWidth(array[2]);if(array.length===4){this.borderStyle.setDashArray(array[3])}}}else{this.borderStyle.setWidth(0)}},loadResources:function Annotation_loadResources(keys){return new Promise(function(resolve,reject){this.appearance.dict.getAsync("Resources").then(function(resources){if(!resources){resolve();return}var objectLoader=new ObjectLoader(resources.map,keys,resources.xref);objectLoader.load().then(function(){resolve(resources)},reject)},reject)}.bind(this))},getOperatorList:function Annotation_getOperatorList(evaluator,task){if(!this.appearance){return Promise.resolve(new OperatorList)}var data=this.data;var appearanceDict=this.appearance.dict;var resourcesPromise=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"]);var bbox=appearanceDict.get("BBox")||[0,0,1,1];var matrix=appearanceDict.get("Matrix")||[1,0,0,1,0,0];var transform=getTransformMatrix(data.rect,bbox,matrix);var self=this;return resourcesPromise.then(function(resources){var opList=new OperatorList;opList.addOp(OPS.beginAnnotation,[data.rect,transform,matrix]);return evaluator.getOperatorList(self.appearance,task,resources,opList).then(function(){opList.addOp(OPS.endAnnotation,[]);self.appearance.reset();return opList})})}};Annotation.appendToOperatorList=function Annotation_appendToOperatorList(annotations,opList,partialEvaluator,task,intent){var annotationPromises=[];for(var i=0,n=annotations.length;i0){var isValid=true;var allZeros=true;for(var i=0,len=dashArray.length;i=0;if(!validNumber){isValid=false;break}else if(element>0){allZeros=false}}if(isValid&&!allZeros){this.dashArray=dashArray}else{this.width=0}}else if(dashArray){this.width=0}},setHorizontalCornerRadius:function AnnotationBorderStyle_setHorizontalCornerRadius(radius){if(radius===(radius|0)){this.horizontalCornerRadius=radius}},setVerticalCornerRadius:function AnnotationBorderStyle_setVerticalCornerRadius(radius){if(radius===(radius|0)){this.verticalCornerRadius=radius}}};return AnnotationBorderStyle}();var WidgetAnnotation=function WidgetAnnotationClosure(){function WidgetAnnotation(params){Annotation.call(this,params);var dict=params.dict;var data=this.data;data.annotationType=AnnotationType.WIDGET;data.fieldValue=stringToPDFString(Util.getInheritableProperty(dict,"V")||"");data.alternativeText=stringToPDFString(dict.get("TU")||"");data.defaultAppearance=Util.getInheritableProperty(dict,"DA")||"";var fieldType=Util.getInheritableProperty(dict,"FT");data.fieldType=isName(fieldType)?fieldType.name:"";data.fieldFlags=Util.getInheritableProperty(dict,"Ff")||0;this.fieldResources=Util.getInheritableProperty(dict,"DR")||Dict.empty;if(data.fieldType==="Sig"){warn("unimplemented annotation type: Widget signature");this.setFlags(AnnotationFlag.HIDDEN)}var fieldName=[];var namedItem=dict;var ref=params.ref;while(namedItem){var parent=namedItem.get("Parent");var parentRef=namedItem.getRaw("Parent");var name=namedItem.get("T");if(name){fieldName.unshift(stringToPDFString(name))}else if(parent&&ref){var kids=parent.get("Kids");var j,jj;for(j=0,jj=kids.length;jMAX_LOOP_COUNT){warn("Page_getInheritedPageProp: maximum loop count exceeded.");break}dict=dict.get("Parent")}if(!valueArray){return Dict.empty}if(valueArray.length===1||!isDict(valueArray[0])||loopCount>MAX_LOOP_COUNT){return valueArray[0]}return Dict.merge(this.xref,valueArray)},get content(){return this.getPageProp("Contents")},get resources(){return shadow(this,"resources",this.getInheritedPageProp("Resources"))},get mediaBox(){var obj=this.getInheritedPageProp("MediaBox");if(!isArray(obj)||obj.length!==4){obj=LETTER_SIZE_MEDIABOX}return shadow(this,"mediaBox",obj)},get view(){var mediaBox=this.mediaBox;var cropBox=this.getInheritedPageProp("CropBox");if(!isArray(cropBox)||cropBox.length!==4){return shadow(this,"view",mediaBox)}cropBox=Util.intersect(cropBox,mediaBox);if(!cropBox){return shadow(this,"view",mediaBox)}return shadow(this,"view",cropBox)},get rotate(){var rotate=this.getInheritedPageProp("Rotate")||0;if(rotate%90!==0){rotate=0}else if(rotate>=360){rotate=rotate%360}else if(rotate<0){rotate=(rotate%360+360)%360}return shadow(this,"rotate",rotate)},getContentStream:function Page_getContentStream(){var content=this.content;var stream;if(isArray(content)){var xref=this.xref;var i,n=content.length;var streams=[];for(i=0;i0,"stream must have data");this.pdfManager=pdfManager;this.stream=stream;var xref=new XRef(this.stream,password,pdfManager);this.xref=xref}function find(stream,needle,limit,backwards){var pos=stream.pos;var end=stream.end;var strBuf=[];if(pos+limit>end){limit=end-pos}for(var n=0;n0){pos-=step-"startxref".length;if(pos<0){pos=0}stream.pos=pos;found=find(stream,"startxref",step,true)}if(found){stream.skip(9);var ch;do{ch=stream.getByte()}while(Lexer.isSpace(ch));var str="";while(ch>=32&&ch<=57){str+=String.fromCharCode(ch);ch=stream.getByte()}startXRef=parseInt(str,10);if(isNaN(startXRef)){startXRef=0}}}return shadow(this,"startXRef",startXRef)},get mainXRefEntriesOffset(){var mainXRefEntriesOffset=0;var linearization=this.linearization;if(linearization){mainXRefEntriesOffset=linearization.mainXRefEntriesOffset}return shadow(this,"mainXRefEntriesOffset",mainXRefEntriesOffset)},checkHeader:function PDFDocument_checkHeader(){var stream=this.stream;stream.reset();if(find(stream,"%PDF-",1024)){stream.moveStart();var MAX_VERSION_LENGTH=12;var version="",ch;while((ch=stream.getByte())>32){if(version.length>=MAX_VERSION_LENGTH){break}version+=String.fromCharCode(ch)}if(!this.pdfFormatVersion){this.pdfFormatVersion=version.substring(5)}return}},parseStartXRef:function PDFDocument_parseStartXRef(){var startXRef=this.startXRef;this.xref.setStartXRef(startXRef)},setup:function PDFDocument_setup(recoveryMode){this.xref.parse(recoveryMode);var self=this;var pageFactory={createPage:function(pageIndex,dict,ref,fontCache){return new Page(self.pdfManager,self.xref,pageIndex,dict,ref,fontCache)}};this.catalog=new Catalog(this.pdfManager,this.xref,pageFactory)},get numPages(){var linearization=this.linearization;var num=linearization?linearization.numPages:this.catalog.numPages;return shadow(this,"numPages",num)},get documentInfo(){var docInfo={PDFFormatVersion:this.pdfFormatVersion,IsAcroFormPresent:!!this.acroForm,IsXFAPresent:!!this.xfa};var infoDict;try{infoDict=this.xref.trailer.get("Info")}catch(err){info("The document information dictionary is invalid.")}if(infoDict){var validEntries=DocumentInfoValidators.entries;for(var key in validEntries){if(infoDict.has(key)){var value=infoDict.get(key);if(validEntries[key](value)){docInfo[key]=typeof value!=="string"?value:stringToPDFString(value)}else{info('Bad value in document info for "'+key+'"')}}}}return shadow(this,"documentInfo",docInfo)},get fingerprint(){var xref=this.xref,hash,fileID="";var idArray=xref.trailer.get("ID");if(idArray&&isArray(idArray)&&idArray[0]&&isString(idArray[0])&&idArray[0]!==EMPTY_FINGERPRINT){hash=stringToBytes(idArray[0])}else{if(this.stream.ensureRange){this.stream.ensureRange(0,Math.min(FINGERPRINT_FIRST_BYTES,this.stream.end))}hash=calculateMD5(this.stream.bytes.subarray(0,FINGERPRINT_FIRST_BYTES),0,FINGERPRINT_FIRST_BYTES)}for(var i=0,n=hash.length;i