@pdftron/pdfjs-express 8.7.5 → 8.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/core/22.chunk.js +7 -7
- package/public/core/23.chunk.js +7 -7
- package/public/core/AndroidContentPartRetriever.chunk.js +2 -2
- package/public/core/ArrayBufferPdfPartRetriever.chunk.js +1 -1
- package/public/core/AzurePartRetriever.chunk.js +2 -2
- package/public/core/ContentEdit.chunk.js +28 -26
- package/public/core/ExternalAnnotationMerger.chunk.js +13 -13
- package/public/core/ExternalPdfPartRetriever.chunk.js +6 -6
- package/public/core/HttpPartRetriever.chunk.js +12 -11
- package/public/core/IOSPartRetriever.chunk.js +2 -3
- package/public/core/LocalPartRetriever.chunk.js +4 -4
- package/public/core/LocalPdfPartRetriever.chunk.js +3 -3
- package/public/core/PDFInfoVersion1.chunk.js +16 -15
- package/public/core/SelectionInfoOld.chunk.js +14 -14
- package/public/core/StreamingPartRetriever.chunk.js +9 -9
- package/public/core/WebDBPartRetriever.chunk.js +2 -2
- package/public/core/WebViewerServerPartRetriever.chunk.js +41 -40
- package/public/core/WinRTPartRetriever.chunk.js +2 -2
- package/public/core/pdfjs/PDFJSDocumentType.js +1623 -1624
- package/public/core/pdfjs/pdf.worker.js +947 -937
- package/public/core/pdfjs/pikaday.chunk.js +32 -32
- package/public/core/pdfjs/vendors.pikaday.chunk.js +34 -33
- package/public/core/pikaday.chunk.js +34 -33
- package/public/core/vendors.ascii85.chunk.js +6 -6
- package/public/core/vendors.ascii85.quill.chunk.js +34 -31
- package/public/core/vendors.pako.chunk.js +80 -76
- package/public/core/vendors.quill.chunk.js +421 -409
- package/public/core/webviewer-core.min.js +2811 -2708
- package/public/ui/style.css +1 -1
- package/public/ui/style.css.map +1 -1
- package/public/ui/webviewer-ui.min.js +6 -6
- package/public/ui/webviewer-ui.min.js.map +1 -1
- package/webviewer.min.js +1 -1
|
@@ -4,36 +4,44 @@
|
|
|
4
4
|
@author Feross Aboukhadijeh <http://feross.org>
|
|
5
5
|
@license MIT
|
|
6
6
|
*/
|
|
7
|
-
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(array){var index=0;return function(){return index<array.length?{done:!1,value:array[index++]}:{done:!0}}};$jscomp.arrayIterator=function(array){return{next:$jscomp.arrayIteratorImpl(array)}};$jscomp.
|
|
8
|
-
$jscomp.
|
|
9
|
-
$jscomp.
|
|
10
|
-
$jscomp.
|
|
11
|
-
$jscomp.polyfill
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(array){var index=0;return function(){return index<array.length?{done:!1,value:array[index++]}:{done:!0}}};$jscomp.arrayIterator=function(array){return{next:$jscomp.arrayIteratorImpl(array)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;
|
|
8
|
+
$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(target,property,descriptor){if(target==Array.prototype||target==Object.prototype)return target;target[property]=descriptor.value;return target};
|
|
9
|
+
$jscomp.getGlobal=function(passedInThis){passedInThis=["object"==typeof globalThis&&globalThis,passedInThis,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var i=0;i<passedInThis.length;++i){var maybeGlobal=passedInThis[i];if(maybeGlobal&&maybeGlobal.Math==Math)return maybeGlobal}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");
|
|
10
|
+
$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(target,property){var obfuscatedName=$jscomp.propertyToPolyfillSymbol[property];if(null==obfuscatedName)return target[property];obfuscatedName=target[obfuscatedName];return void 0!==obfuscatedName?obfuscatedName:target[property]};
|
|
11
|
+
$jscomp.polyfill=function(target,polyfill,fromLang,toLang){polyfill&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(target,polyfill,fromLang,toLang):$jscomp.polyfillUnisolated(target,polyfill,fromLang,toLang))};
|
|
12
|
+
$jscomp.polyfillUnisolated=function(target,polyfill,fromLang,toLang){fromLang=$jscomp.global;target=target.split(".");for(toLang=0;toLang<target.length-1;toLang++){var key=target[toLang];if(!(key in fromLang))return;fromLang=fromLang[key]}target=target[target.length-1];toLang=fromLang[target];polyfill=polyfill(toLang);polyfill!=toLang&&null!=polyfill&&$jscomp.defineProperty(fromLang,target,{configurable:!0,writable:!0,value:polyfill})};
|
|
13
|
+
$jscomp.polyfillIsolated=function(target,polyfill,fromLang,toLang){var split=target.split(".");target=1===split.length;toLang=split[0];toLang=!target&&toLang in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var i=0;i<split.length-1;i++){var key=split[i];if(!(key in toLang))return;toLang=toLang[key]}split=split[split.length-1];fromLang=$jscomp.IS_SYMBOL_NATIVE&&"es6"===fromLang?toLang[split]:null;polyfill=polyfill(fromLang);null!=polyfill&&(target?$jscomp.defineProperty($jscomp.polyfills,
|
|
14
|
+
split,{configurable:!0,writable:!0,value:polyfill}):polyfill!==fromLang&&(void 0===$jscomp.propertyToPolyfillSymbol[split]&&(fromLang=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[split]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(split):$jscomp.POLYFILL_PREFIX+fromLang+"$"+split),$jscomp.defineProperty(toLang,$jscomp.propertyToPolyfillSymbol[split],{configurable:!0,writable:!0,value:polyfill})))};$jscomp.initSymbol=function(){};
|
|
15
|
+
$jscomp.polyfill("Symbol",function(orig){if(orig)return orig;var SymbolClass=function(id,opt_description){this.$jscomp$symbol$id_=id;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:opt_description})};SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};var SYMBOL_PREFIX="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",counter=0,symbolPolyfill=function(opt_description){if(this instanceof symbolPolyfill)throw new TypeError("Symbol is not a constructor");
|
|
16
|
+
return new SymbolClass(SYMBOL_PREFIX+(opt_description||"")+"_"+counter++,opt_description)};return symbolPolyfill},"es6","es3");
|
|
17
|
+
$jscomp.polyfill("Symbol.iterator",function(orig){if(orig)return orig;orig=Symbol("Symbol.iterator");for(var arrayLikes="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i<arrayLikes.length;i++){var ArrayLikeCtor=$jscomp.global[arrayLikes[i]];"function"===typeof ArrayLikeCtor&&"function"!=typeof ArrayLikeCtor.prototype[orig]&&$jscomp.defineProperty(ArrayLikeCtor.prototype,orig,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return orig},
|
|
18
|
+
"es6","es3");$jscomp.polyfill("Symbol.asyncIterator",function(orig){return orig?orig:Symbol("Symbol.asyncIterator")},"es9","es3");$jscomp.iteratorPrototype=function(next){next={next:next};next[Symbol.iterator]=function(){return this};return next};$jscomp.makeIterator=function(iterable){var iteratorFunction="undefined"!=typeof Symbol&&Symbol.iterator&&iterable[Symbol.iterator];return iteratorFunction?iteratorFunction.call(iterable):$jscomp.arrayIterator(iterable)};
|
|
19
|
+
$jscomp.polyfill("Promise",function(NativePromise){function AsyncExecutor(){this.batch_=null}function resolvingPromise(opt_value){return opt_value instanceof PolyfillPromise?opt_value:new PolyfillPromise(function(resolve,reject){resolve(opt_value)})}if(NativePromise&&(!($jscomp.FORCE_POLYFILL_PROMISE||$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION&&"undefined"===typeof $jscomp.global.PromiseRejectionEvent)||!$jscomp.global.Promise||-1===$jscomp.global.Promise.toString().indexOf("[native code]")))return NativePromise;
|
|
20
|
+
AsyncExecutor.prototype.asyncExecute=function(f){if(null==this.batch_){this.batch_=[];var self=this;this.asyncExecuteFunction(function(){self.executeBatch_()})}this.batch_.push(f)};var nativeSetTimeout=$jscomp.global.setTimeout;AsyncExecutor.prototype.asyncExecuteFunction=function(f){nativeSetTimeout(f,0)};AsyncExecutor.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var executingBatch=this.batch_;this.batch_=[];for(var i=0;i<executingBatch.length;++i){var f=executingBatch[i];
|
|
21
|
+
executingBatch[i]=null;try{f()}catch(error){this.asyncThrow_(error)}}}this.batch_=null};AsyncExecutor.prototype.asyncThrow_=function(exception){this.asyncExecuteFunction(function(){throw exception;})};var PolyfillPromise=function(executor){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];this.isRejectionHandled_=!1;var resolveAndReject=this.createResolveAndReject_();try{executor(resolveAndReject.resolve,resolveAndReject.reject)}catch(e){resolveAndReject.reject(e)}};PolyfillPromise.prototype.createResolveAndReject_=
|
|
22
|
+
function(){function firstCallWins(method){return function(x){alreadyCalled||(alreadyCalled=!0,method.call(thisPromise,x))}}var thisPromise=this,alreadyCalled=!1;return{resolve:firstCallWins(this.resolveTo_),reject:firstCallWins(this.reject_)}};PolyfillPromise.prototype.resolveTo_=function(value){if(value===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(value instanceof PolyfillPromise)this.settleSameAsPromise_(value);else{a:switch(typeof value){case "object":var JSCompiler_inline_result=
|
|
23
|
+
null!=value;break a;case "function":JSCompiler_inline_result=!0;break a;default:JSCompiler_inline_result=!1}JSCompiler_inline_result?this.resolveToNonPromiseObj_(value):this.fulfill_(value)}};PolyfillPromise.prototype.resolveToNonPromiseObj_=function(obj){var thenMethod=void 0;try{thenMethod=obj.then}catch(error){this.reject_(error);return}"function"==typeof thenMethod?this.settleSameAsThenable_(thenMethod,obj):this.fulfill_(obj)};PolyfillPromise.prototype.reject_=function(reason){this.settle_(2,
|
|
24
|
+
reason)};PolyfillPromise.prototype.fulfill_=function(value){this.settle_(1,value)};PolyfillPromise.prototype.settle_=function(settledState,valueOrReason){if(0!=this.state_)throw Error("Cannot settle("+settledState+", "+valueOrReason+"): Promise already settled in state"+this.state_);this.state_=settledState;this.result_=valueOrReason;2===this.state_&&this.scheduleUnhandledRejectionCheck_();this.executeOnSettledCallbacks_()};PolyfillPromise.prototype.scheduleUnhandledRejectionCheck_=function(){var self=
|
|
25
|
+
this;nativeSetTimeout(function(){if(self.notifyUnhandledRejection_()){var nativeConsole=$jscomp.global.console;"undefined"!==typeof nativeConsole&&nativeConsole.error(self.result_)}},1)};PolyfillPromise.prototype.notifyUnhandledRejection_=function(){if(this.isRejectionHandled_)return!1;var NativeCustomEvent=$jscomp.global.CustomEvent,NativeEvent=$jscomp.global.Event,nativeDispatchEvent=$jscomp.global.dispatchEvent;if("undefined"===typeof nativeDispatchEvent)return!0;"function"===typeof NativeCustomEvent?
|
|
26
|
+
NativeCustomEvent=new NativeCustomEvent("unhandledrejection",{cancelable:!0}):"function"===typeof NativeEvent?NativeCustomEvent=new NativeEvent("unhandledrejection",{cancelable:!0}):(NativeCustomEvent=$jscomp.global.document.createEvent("CustomEvent"),NativeCustomEvent.initCustomEvent("unhandledrejection",!1,!0,NativeCustomEvent));NativeCustomEvent.promise=this;NativeCustomEvent.reason=this.result_;return nativeDispatchEvent(NativeCustomEvent)};PolyfillPromise.prototype.executeOnSettledCallbacks_=
|
|
27
|
+
function(){if(null!=this.onSettledCallbacks_){for(var i=0;i<this.onSettledCallbacks_.length;++i)asyncExecutor.asyncExecute(this.onSettledCallbacks_[i]);this.onSettledCallbacks_=null}};var asyncExecutor=new AsyncExecutor;PolyfillPromise.prototype.settleSameAsPromise_=function(promise){var methods=this.createResolveAndReject_();promise.callWhenSettled_(methods.resolve,methods.reject)};PolyfillPromise.prototype.settleSameAsThenable_=function(thenMethod,thenable){var methods=this.createResolveAndReject_();
|
|
28
|
+
try{thenMethod.call(thenable,methods.resolve,methods.reject)}catch(error){methods.reject(error)}};PolyfillPromise.prototype.then=function(onFulfilled,onRejected){function createCallback(paramF,defaultF){return"function"==typeof paramF?function(x){try{resolveChild(paramF(x))}catch(error){rejectChild(error)}}:defaultF}var resolveChild,rejectChild,childPromise=new PolyfillPromise(function(resolve,reject){resolveChild=resolve;rejectChild=reject});this.callWhenSettled_(createCallback(onFulfilled,resolveChild),
|
|
29
|
+
createCallback(onRejected,rejectChild));return childPromise};PolyfillPromise.prototype.catch=function(onRejected){return this.then(void 0,onRejected)};PolyfillPromise.prototype.callWhenSettled_=function(onFulfilled,onRejected){function callback(){switch(thisPromise.state_){case 1:onFulfilled(thisPromise.result_);break;case 2:onRejected(thisPromise.result_);break;default:throw Error("Unexpected state: "+thisPromise.state_);}}var thisPromise=this;null==this.onSettledCallbacks_?asyncExecutor.asyncExecute(callback):
|
|
30
|
+
this.onSettledCallbacks_.push(callback);this.isRejectionHandled_=!0};PolyfillPromise.resolve=resolvingPromise;PolyfillPromise.reject=function(opt_reason){return new PolyfillPromise(function(resolve,reject){reject(opt_reason)})};PolyfillPromise.race=function(thenablesOrValues){return new PolyfillPromise(function(resolve,reject){for(var iterator=$jscomp.makeIterator(thenablesOrValues),iterRec=iterator.next();!iterRec.done;iterRec=iterator.next())resolvingPromise(iterRec.value).callWhenSettled_(resolve,
|
|
31
|
+
reject)})};PolyfillPromise.all=function(thenablesOrValues){var iterator=$jscomp.makeIterator(thenablesOrValues),iterRec=iterator.next();return iterRec.done?resolvingPromise([]):new PolyfillPromise(function(resolveAll,rejectAll){function onFulfilled(i){return function(ithResult){resultsArray[i]=ithResult;unresolvedCount--;0==unresolvedCount&&resolveAll(resultsArray)}}var resultsArray=[],unresolvedCount=0;do resultsArray.push(void 0),unresolvedCount++,resolvingPromise(iterRec.value).callWhenSettled_(onFulfilled(resultsArray.length-
|
|
32
|
+
1),rejectAll),iterRec=iterator.next();while(!iterRec.done)})};return PolyfillPromise},"es6","es3");$jscomp.underscoreProtoCanBeSet=function(){var x={a:!0},y={};try{return y.__proto__=x,y.a}catch(e){}return!1};$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(target,proto){target.__proto__=proto;if(target.__proto__!==proto)throw new TypeError(target+" is not extensible");return target}:null;
|
|
33
|
+
$jscomp.polyfill("Object.setPrototypeOf",function(orig){return orig||$jscomp.setPrototypeOf},"es6","es5");$jscomp.polyfill("Number.isFinite",function(orig){return orig?orig:function(x){return"number"!==typeof x?!1:!isNaN(x)&&Infinity!==x&&-Infinity!==x}},"es6","es3");$jscomp.polyfill("Number.isInteger",function(orig){return orig?orig:function(x){return Number.isFinite(x)?x===Math.floor(x):!1}},"es6","es3");
|
|
34
|
+
$jscomp.polyfill("Math.log2",function(orig){return orig?orig:function(x){return Math.log(x)/Math.LN2}},"es6","es3");$jscomp.polyfill("Object.getOwnPropertySymbols",function(orig){return orig?orig:function(){return[]}},"es6","es5");
|
|
35
|
+
$jscomp.checkStringArgs=function(thisArg,arg,func){if(null==thisArg)throw new TypeError("The 'this' value for String.prototype."+func+" must not be null or undefined");if(arg instanceof RegExp)throw new TypeError("First argument to String.prototype."+func+" must not be a regular expression");return thisArg+""};
|
|
25
36
|
$jscomp.polyfill("String.prototype.startsWith",function(orig){return orig?orig:function(searchString,opt_position){var string=$jscomp.checkStringArgs(this,searchString,"startsWith");searchString+="";var strLen=string.length,searchLen=searchString.length;opt_position=Math.max(0,Math.min(opt_position|0,string.length));for(var j=0;j<searchLen&&opt_position<strLen;)if(string[opt_position++]!=searchString[j++])return!1;return j>=searchLen}},"es6","es3");
|
|
26
37
|
$jscomp.polyfill("String.prototype.endsWith",function(orig){return orig?orig:function(searchString,opt_position){var string=$jscomp.checkStringArgs(this,searchString,"endsWith");searchString+="";void 0===opt_position&&(opt_position=string.length);opt_position=Math.max(0,Math.min(opt_position|0,string.length));for(var j=searchString.length;0<j&&0<opt_position;)if(string[--opt_position]!=searchString[--j])return!1;return 0>=j}},"es6","es3");
|
|
27
38
|
$jscomp.polyfill("Object.is",function(orig){return orig?orig:function(left,right){return left===right?0!==left||1/left===1/right:left!==left&&right!==right}},"es6","es3");
|
|
28
39
|
$jscomp.polyfill("Array.prototype.includes",function(orig){return orig?orig:function(searchElement,opt_fromIndex){var array=this;array instanceof String&&(array=String(array));var len=array.length;opt_fromIndex=opt_fromIndex||0;for(0>opt_fromIndex&&(opt_fromIndex=Math.max(opt_fromIndex+len,0));opt_fromIndex<len;opt_fromIndex++){var element=array[opt_fromIndex];if(element===searchElement||Object.is(element,searchElement))return!0}return!1}},"es7","es3");
|
|
29
|
-
$jscomp.polyfill("String.prototype.includes",function(orig){return orig?orig:function(searchString,opt_position){return-1!==$jscomp.checkStringArgs(this,searchString,"includes").indexOf(searchString,opt_position||0)}},"es6","es3")
|
|
30
|
-
$jscomp.
|
|
31
|
-
$jscomp.
|
|
32
|
-
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var symbolAsyncIterator=$jscomp.global.Symbol.asyncIterator;symbolAsyncIterator||(symbolAsyncIterator=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(next){$jscomp.initSymbolIterator();next={next:next};next[$jscomp.global.Symbol.iterator]=function(){return this};return next};
|
|
33
|
-
$jscomp.iteratorFromArray=function(array,transform){$jscomp.initSymbolIterator();array instanceof String&&(array+="");var i=0,iter={next:function(){if(i<array.length){var index=i++;return{value:transform(index,array[index]),done:!1}}iter.next=function(){return{done:!0,value:void 0}};return iter.next()}};iter[Symbol.iterator]=function(){return iter};return iter};
|
|
34
|
-
$jscomp.polyfill("Array.prototype.keys",function(orig){return orig?orig:function(){return $jscomp.iteratorFromArray(this,function(i){return i})}},"es6","es3");$jscomp.polyfill("Array.prototype.entries",function(orig){return orig?orig:function(){return $jscomp.iteratorFromArray(this,function(i,v){return[i,v]})}},"es6","es3");
|
|
40
|
+
$jscomp.polyfill("String.prototype.includes",function(orig){return orig?orig:function(searchString,opt_position){return-1!==$jscomp.checkStringArgs(this,searchString,"includes").indexOf(searchString,opt_position||0)}},"es6","es3");
|
|
41
|
+
$jscomp.iteratorFromArray=function(array,transform){array instanceof String&&(array+="");var i=0,done=!1,iter={next:function(){if(!done&&i<array.length){var index=i++;return{value:transform(index,array[index]),done:!1}}done=!0;return{done:!0,value:void 0}}};iter[Symbol.iterator]=function(){return iter};return iter};$jscomp.polyfill("Array.prototype.keys",function(orig){return orig?orig:function(){return $jscomp.iteratorFromArray(this,function(i){return i})}},"es6","es3");
|
|
42
|
+
$jscomp.polyfill("Array.prototype.entries",function(orig){return orig?orig:function(){return $jscomp.iteratorFromArray(this,function(i,v){return[i,v]})}},"es6","es3");
|
|
35
43
|
$jscomp.polyfill("Array.from",function(orig){return orig?orig:function(arrayLike,opt_mapFn,opt_thisArg){opt_mapFn=null!=opt_mapFn?opt_mapFn:function(x){return x};var result=[],iteratorFunction="undefined"!=typeof Symbol&&Symbol.iterator&&arrayLike[Symbol.iterator];if("function"==typeof iteratorFunction){arrayLike=iteratorFunction.call(arrayLike);for(var k=0;!(iteratorFunction=arrayLike.next()).done;)result.push(opt_mapFn.call(opt_thisArg,iteratorFunction.value,k++))}else for(iteratorFunction=arrayLike.length,
|
|
36
|
-
k=0;k<iteratorFunction;k++)result.push(opt_mapFn.call(opt_thisArg,arrayLike[k],k));return result}},"es6","es3");$jscomp.owns=function(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)};$jscomp.assign
|
|
44
|
+
k=0;k<iteratorFunction;k++)result.push(opt_mapFn.call(opt_thisArg,arrayLike[k],k));return result}},"es6","es3");$jscomp.owns=function(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)};$jscomp.assign=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.assign?Object.assign:function(target,var_args){for(var i=1;i<arguments.length;i++){var source=arguments[i];if(source)for(var key in source)$jscomp.owns(source,key)&&(target[key]=source[key])}return target};
|
|
37
45
|
$jscomp.polyfill("Object.assign",function(orig){return orig||$jscomp.assign},"es6","es3");$jscomp.polyfill("Array.prototype.values",function(orig){return orig?orig:function(){return $jscomp.iteratorFromArray(this,function(k,v){return v})}},"es8","es3");$jscomp.polyfill("Number.isNaN",function(orig){return orig?orig:function(x){return"number"===typeof x&&isNaN(x)}},"es6","es3");
|
|
38
46
|
$jscomp.findInternal=function(array,callback,thisArg){array instanceof String&&(array=String(array));for(var len=array.length,i=0;i<len;i++){var value=array[i];if(callback.call(thisArg,value,i,array))return{i:i,v:value}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(orig){return orig?orig:function(callback,opt_thisArg){return $jscomp.findInternal(this,callback,opt_thisArg).v}},"es6","es3");
|
|
39
47
|
$jscomp.polyfill("Array.prototype.findIndex",function(orig){return orig?orig:function(callback,opt_thisArg){return $jscomp.findInternal(this,callback,opt_thisArg).i}},"es6","es3");
|
|
@@ -41,19 +49,23 @@ $jscomp.polyfill("String.fromCodePoint",function(orig){return orig?orig:function
|
|
|
41
49
|
$jscomp.polyfill("String.prototype.repeat",function(orig){return orig?orig:function(copies){var string=$jscomp.checkStringArgs(this,null,"repeat");if(0>copies||1342177279<copies)throw new RangeError("Invalid count value");copies|=0;for(var result="";copies;)if(copies&1&&(result+=string),copies>>>=1)string+=string;return result}},"es6","es3");
|
|
42
50
|
$jscomp.stringPadding=function(padString,padLength){padString=void 0!==padString?String(padString):" ";return 0<padLength&&padString?padString.repeat(Math.ceil(padLength/padString.length)).substring(0,padLength):""};$jscomp.polyfill("String.prototype.padStart",function(orig){return orig?orig:function(targetLength,opt_padString){var string=$jscomp.checkStringArgs(this,null,"padStart");return $jscomp.stringPadding(opt_padString,targetLength-string.length)+string}},"es8","es3");
|
|
43
51
|
$jscomp.checkEs6ConformanceViaProxy=function(){try{var proxied={},proxy=Object.create(new $jscomp.global.Proxy(proxied,{get:function(target,key,receiver){return target==proxied&&"q"==key&&receiver==proxy}}));return!0===proxy.q}catch(err){return!1}};$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1;$jscomp.ES6_CONFORMANCE=$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&$jscomp.checkEs6ConformanceViaProxy();
|
|
44
|
-
$jscomp.polyfill("WeakMap",function(NativeWeakMap){function isConformant(){if(!NativeWeakMap||!Object.seal)return!1;try{var x=Object.seal({}),y=Object.seal({}),map=new NativeWeakMap([[x,2],[y,3]]);if(2!=map.get(x)||3!=map.get(y))return!1;map.delete(x);map.set(y,4);return!map.has(x)&&4==map.get(y)}catch(err){return!1}}function WeakMapMembership(){}function insert(target){if(!$jscomp.owns(target,prop)){var obj=
|
|
45
|
-
Object[name];prev&&(Object[name]=function(target){if(target instanceof WeakMapMembership)return target;insert(target);return prev(target)})}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(NativeWeakMap&&$jscomp.ES6_CONFORMANCE)return NativeWeakMap}else if(isConformant())return NativeWeakMap;var prop="$jscomp_hidden_"+Math.random();patch("freeze");
|
|
46
|
-
|
|
47
|
-
PolyfillWeakMap.prototype.delete=function(key){return
|
|
52
|
+
$jscomp.polyfill("WeakMap",function(NativeWeakMap){function isConformant(){if(!NativeWeakMap||!Object.seal)return!1;try{var x=Object.seal({}),y=Object.seal({}),map=new NativeWeakMap([[x,2],[y,3]]);if(2!=map.get(x)||3!=map.get(y))return!1;map.delete(x);map.set(y,4);return!map.has(x)&&4==map.get(y)}catch(err){return!1}}function WeakMapMembership(){}function isValidKey(key){var type=typeof key;return"object"===type&&null!==key||"function"===type}function insert(target){if(!$jscomp.owns(target,prop)){var obj=
|
|
53
|
+
new WeakMapMembership;$jscomp.defineProperty(target,prop,{value:obj})}}function patch(name){if(!$jscomp.ISOLATE_POLYFILLS){var prev=Object[name];prev&&(Object[name]=function(target){if(target instanceof WeakMapMembership)return target;Object.isExtensible(target)&&insert(target);return prev(target)})}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(NativeWeakMap&&$jscomp.ES6_CONFORMANCE)return NativeWeakMap}else if(isConformant())return NativeWeakMap;var prop="$jscomp_hidden_"+Math.random();patch("freeze");
|
|
54
|
+
patch("preventExtensions");patch("seal");var index=0,PolyfillWeakMap=function(opt_iterable){this.id_=(index+=Math.random()+1).toString();if(opt_iterable){opt_iterable=$jscomp.makeIterator(opt_iterable);for(var entry;!(entry=opt_iterable.next()).done;)entry=entry.value,this.set(entry[0],entry[1])}};PolyfillWeakMap.prototype.set=function(key,value){if(!isValidKey(key))throw Error("Invalid WeakMap key");insert(key);if(!$jscomp.owns(key,prop))throw Error("WeakMap key fail: "+key);key[prop][this.id_]=
|
|
55
|
+
value;return this};PolyfillWeakMap.prototype.get=function(key){return isValidKey(key)&&$jscomp.owns(key,prop)?key[prop][this.id_]:void 0};PolyfillWeakMap.prototype.has=function(key){return isValidKey(key)&&$jscomp.owns(key,prop)&&$jscomp.owns(key[prop],this.id_)};PolyfillWeakMap.prototype.delete=function(key){return isValidKey(key)&&$jscomp.owns(key,prop)&&$jscomp.owns(key[prop],this.id_)?delete key[prop][this.id_]:!1};return PolyfillWeakMap},"es6","es3");$jscomp.MapEntry=function(){};
|
|
48
56
|
$jscomp.polyfill("Map",function(NativeMap){function isConformant(){if($jscomp.ASSUME_NO_NATIVE_MAP||!NativeMap||"function"!=typeof NativeMap||!NativeMap.prototype.entries||"function"!=typeof Object.seal)return!1;try{var key=Object.seal({x:4}),map=new NativeMap($jscomp.makeIterator([[key,"s"]]));if("s"!=map.get(key)||1!=map.size||map.get({x:4})||map.set({x:4},"t")!=map||2!=map.size)return!1;var iter=map.entries(),item=iter.next();if(item.done||item.value[0]!=key||"s"!=item.value[1])return!1;item=iter.next();
|
|
49
|
-
return item.done||4!=item.value[0].x||"t"!=item.value[1]||!iter.next().done?!1:!0}catch(err){return!1}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(NativeMap&&$jscomp.ES6_CONFORMANCE)return NativeMap}else if(isConformant())return NativeMap
|
|
50
|
-
entry
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
map.head_;)entry=entry.previous;for(;entry.next!=entry.head;)return entry=entry.next,{done:!1,value:func(entry)};entry=null}return{done:!0,value:void 0}})},createHead=function(){var head={};return head.previous=head.next=head.head=head},mapIndex=0;return PolyfillMap},"es6","es3");
|
|
55
|
-
$jscomp.polyfill("Array.prototype.
|
|
56
|
-
$jscomp.polyfill("
|
|
57
|
+
return item.done||4!=item.value[0].x||"t"!=item.value[1]||!iter.next().done?!1:!0}catch(err){return!1}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(NativeMap&&$jscomp.ES6_CONFORMANCE)return NativeMap}else if(isConformant())return NativeMap;var idMap=new WeakMap,PolyfillMap=function(opt_iterable){this.data_={};this.head_=createHead();this.size=0;if(opt_iterable){opt_iterable=$jscomp.makeIterator(opt_iterable);for(var entry;!(entry=opt_iterable.next()).done;)entry=entry.value,this.set(entry[0],
|
|
58
|
+
entry[1])}};PolyfillMap.prototype.set=function(key,value){key=0===key?0:key;var r=maybeGetEntry(this,key);r.list||(r.list=this.data_[r.id]=[]);r.entry?r.entry.value=value:(r.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:key,value:value},r.list.push(r.entry),this.head_.previous.next=r.entry,this.head_.previous=r.entry,this.size++);return this};PolyfillMap.prototype.delete=function(key){key=maybeGetEntry(this,key);return key.entry&&key.list?(key.list.splice(key.index,1),key.list.length||
|
|
59
|
+
delete this.data_[key.id],key.entry.previous.next=key.entry.next,key.entry.next.previous=key.entry.previous,key.entry.head=null,this.size--,!0):!1};PolyfillMap.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=createHead();this.size=0};PolyfillMap.prototype.has=function(key){return!!maybeGetEntry(this,key).entry};PolyfillMap.prototype.get=function(key){return(key=maybeGetEntry(this,key).entry)&&key.value};PolyfillMap.prototype.entries=function(){return makeIterator(this,function(entry){return[entry.key,
|
|
60
|
+
entry.value]})};PolyfillMap.prototype.keys=function(){return makeIterator(this,function(entry){return entry.key})};PolyfillMap.prototype.values=function(){return makeIterator(this,function(entry){return entry.value})};PolyfillMap.prototype.forEach=function(callback,opt_thisArg){for(var iter=this.entries(),item;!(item=iter.next()).done;)item=item.value,callback.call(opt_thisArg,item[1],item[0],this)};PolyfillMap.prototype[Symbol.iterator]=PolyfillMap.prototype.entries;var maybeGetEntry=function(map,
|
|
61
|
+
key){var id=key&&typeof key;"object"==id||"function"==id?idMap.has(key)?id=idMap.get(key):(id=""+ ++mapIndex,idMap.set(key,id)):id="p_"+key;var list=map.data_[id];if(list&&$jscomp.owns(map.data_,id))for(map=0;map<list.length;map++){var entry=list[map];if(key!==key&&entry.key!==entry.key||key===entry.key)return{id:id,list:list,index:map,entry:entry}}return{id:id,list:list,index:-1,entry:void 0}},makeIterator=function(map,func){var entry=map.head_;return $jscomp.iteratorPrototype(function(){if(entry){for(;entry.head!=
|
|
62
|
+
map.head_;)entry=entry.previous;for(;entry.next!=entry.head;)return entry=entry.next,{done:!1,value:func(entry)};entry=null}return{done:!0,value:void 0}})},createHead=function(){var head={};return head.previous=head.next=head.head=head},mapIndex=0;return PolyfillMap},"es6","es3");$jscomp.atMethod=function(index){index=Math.trunc(index)||0;0>index&&(index+=this.length);if(!(0>index||index>=this.length))return this[index]};
|
|
63
|
+
$jscomp.polyfill("Array.prototype.at",function(orig){return orig?orig:$jscomp.atMethod},"es_next","es5");$jscomp.typedArrayAt=function(orig){return orig?orig:$jscomp.atMethod};$jscomp.polyfill("Int8Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Uint8Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Uint8ClampedArray.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Int16Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");
|
|
64
|
+
$jscomp.polyfill("Uint16Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Int32Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Uint32Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Float32Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Float64Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");
|
|
65
|
+
$jscomp.polyfill("String.prototype.at",function(orig){return orig?orig:$jscomp.atMethod},"es_next","es5");
|
|
66
|
+
$jscomp.polyfill("Array.prototype.fill",function(orig){return orig?orig:function(value,opt_start,opt_end){var length=this.length||0;0>opt_start&&(opt_start=Math.max(0,length+opt_start));if(null==opt_end||opt_end>length)opt_end=length;opt_end=Number(opt_end);0>opt_end&&(opt_end=Math.max(0,length+opt_end));for(opt_start=Number(opt_start||0);opt_start<opt_end;opt_start++)this[opt_start]=value;return this}},"es6","es3");$jscomp.typedArrayFill=function(orig){return orig?orig:Array.prototype.fill};
|
|
67
|
+
$jscomp.polyfill("Int8Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint8Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint8ClampedArray.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Int16Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint16Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Int32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");
|
|
68
|
+
$jscomp.polyfill("Uint32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Float32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Float64Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Object.values",function(orig){return orig?orig:function(obj){var result=[],key;for(key in obj)$jscomp.owns(obj,key)&&result.push(obj[key]);return result}},"es8","es3");
|
|
57
69
|
$jscomp.polyfill("String.prototype.codePointAt",function(orig){return orig?orig:function(position){var string=$jscomp.checkStringArgs(this,null,"codePointAt"),size=string.length;position=Number(position)||0;if(0<=position&&position<size){position|=0;var first=string.charCodeAt(position);if(55296>first||56319<first||position+1===size)return first;position=string.charCodeAt(position+1);return 56320>position||57343<position?first:1024*(first-55296)+position+9216}}},"es6","es3");
|
|
58
70
|
(function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=!0;return module.exports}var installedModules={};__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,
|
|
59
71
|
name,{enumerable:!0,get:getter})};__webpack_require__.r=function(exports){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});Object.defineProperty(exports,"__esModule",{value:!0})};__webpack_require__.t=function(value,mode){mode&1&&(value=__webpack_require__(value));if(mode&8||mode&4&&"object"===typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);__webpack_require__.r(ns);Object.defineProperty(ns,"default",
|
|
@@ -298,8 +310,8 @@ state=PATH;continue}else{state=PATH;continue}break;case FILE_SLASH:if("/"==_char
|
|
|
298
310
|
parseHost(url,buffer))return state;"localhost"==url.host&&(url.host="");if(stateOverride)return;buffer=""}state=PATH_START}continue}else buffer+=_char3;break;case PATH_START:if(isSpecial(url)){if(state=PATH,"/"!=_char3&&"\\"!=_char3)continue}else if(!stateOverride&&"?"==_char3)url.query="",state=QUERY;else if(!stateOverride&&"#"==_char3)url.fragment="",state=FRAGMENT;else if(void 0!=_char3&&(state=PATH,"/"!=_char3))continue;break;case PATH:if(void 0==_char3||"/"==_char3||"\\"==_char3&&isSpecial(url)||
|
|
299
311
|
!stateOverride&&("?"==_char3||"#"==_char3)){codePoint=buffer;codePoint=codePoint.toLowerCase();".."===codePoint||"%2e."===codePoint||".%2e"===codePoint||"%2e%2e"===codePoint?(shortenURLsPath(url),"/"==_char3||"\\"==_char3&&isSpecial(url)||url.path.push("")):"."===buffer||"%2e"===buffer.toLowerCase()?"/"==_char3||"\\"==_char3&&isSpecial(url)||url.path.push(""):("file"==url.scheme&&!url.path.length&&isWindowsDriveLetter(buffer)&&(url.host&&(url.host=""),buffer=buffer.charAt(0)+":"),url.path.push(buffer));
|
|
300
312
|
buffer="";if("file"==url.scheme&&(void 0==_char3||"?"==_char3||"#"==_char3))for(;1<url.path.length&&""===url.path[0];)url.path.shift();"?"==_char3?(url.query="",state=QUERY):"#"==_char3&&(url.fragment="",state=FRAGMENT)}else buffer+=percentEncode(_char3,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==_char3?(url.query="",state=QUERY):"#"==_char3?(url.fragment="",state=FRAGMENT):void 0!=_char3&&(url.path[0]+=percentEncode(_char3,C0ControlPercentEncodeSet));break;case QUERY:stateOverride||
|
|
301
|
-
"#"!=_char3?void 0!=_char3&&("'"==_char3&&isSpecial(url)?url.query+="%27":url.query="#"==_char3?url.query+"%23":url.query+percentEncode(_char3,C0ControlPercentEncodeSet)):(url.fragment="",state=FRAGMENT);break;case FRAGMENT:void 0!=_char3&&(url.fragment+=percentEncode(_char3,fragmentPercentEncodeSet))}pointer++}},URLConstructor=function(url){var that=anInstance(this,URLConstructor,"URL"),base=1<arguments.length?arguments[1]:void 0,urlString=String(url),state=setInternalState(that,{type:"URL"});
|
|
302
|
-
base)if(base instanceof URLConstructor)var baseState=getInternalURLState(base);else if(
|
|
313
|
+
"#"!=_char3?void 0!=_char3&&("'"==_char3&&isSpecial(url)?url.query+="%27":url.query="#"==_char3?url.query+"%23":url.query+percentEncode(_char3,C0ControlPercentEncodeSet)):(url.fragment="",state=FRAGMENT);break;case FRAGMENT:void 0!=_char3&&(url.fragment+=percentEncode(_char3,fragmentPercentEncodeSet))}pointer++}},URLConstructor=function(url){var that=anInstance(this,URLConstructor,"URL"),base=1<arguments.length?arguments[1]:void 0,urlString=String(url),state=setInternalState(that,{type:"URL"}),failure;
|
|
314
|
+
if(void 0!==base)if(base instanceof URLConstructor)var baseState=getInternalURLState(base);else if(failure=parseURL(baseState={},String(base)))throw TypeError(failure);if(failure=parseURL(state,urlString,null,baseState))throw TypeError(failure);var searchParams=state.searchParams=new URLSearchParams;base=getInternalSearchParamsState(searchParams);base.updateSearchParams(state.query);base.updateURL=function(){state.query=String(searchParams)||null};DESCRIPTORS||(that.href=serializeURL.call(that),that.origin=
|
|
303
315
|
getOrigin.call(that),that.protocol=getProtocol.call(that),that.username=getUsername.call(that),that.password=getPassword.call(that),that.host=getHost.call(that),that.hostname=getHostname.call(that),that.port=getPort.call(that),that.pathname=getPathname.call(that),that.search=getSearch.call(that),that.searchParams=getSearchParams.call(that),that.hash=getHash.call(that))};__w_pdfjs_require__=URLConstructor.prototype;var serializeURL=function(){var url=getInternalURLState(this),scheme=url.scheme,username=
|
|
304
316
|
url.username,password=url.password,host=url.host,port=url.port,path=url.path,query=url.query,fragment=url.fragment,output=scheme+":";if(null!==host){output+="//";if(""!=url.username||""!=url.password)output+=username+(password?":"+password:"")+"@";output+=serializeHost(host);null!==port&&(output+=":"+port)}else"file"==scheme&&(output+="//");output+=url.cannotBeABaseURL?path[0]:path.length?"/"+path.join("/"):"";null!==query&&(output+="?"+query);null!==fragment&&(output+="#"+fragment);return output},
|
|
305
317
|
getOrigin=function(){var url=getInternalURLState(this),scheme=url.scheme,port=url.port;if("blob"==scheme)try{return(new URL(scheme.path[0])).origin}catch(error){return"null"}return"file"!=scheme&&isSpecial(url)?scheme+"://"+serializeHost(url.host)+(null!==port?":"+port:""):"null"},getProtocol=function(){return getInternalURLState(this).scheme+":"},getUsername=function(){return getInternalURLState(this).username},getPassword=function(){return getInternalURLState(this).password},getHost=function(){var url=
|
|
@@ -312,113 +324,113 @@ search.charAt(0)&&(search=search.slice(1)),url.query="",parseURL(url,search,QUER
|
|
|
312
324
|
redefine(__w_pdfjs_require__,"toString",function(){return serializeURL.call(this)},{enumerable:!0});if(NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&redefine(URLConstructor,"createObjectURL",function(blob){return nativeCreateObjectURL.apply(NativeURL,arguments)});nativeRevokeObjectURL&&redefine(URLConstructor,"revokeObjectURL",function(url){return nativeRevokeObjectURL.apply(NativeURL,arguments)})}setToStringTag(URLConstructor,
|
|
313
325
|
"URL");module({global:!0,forced:!exports,sham:!DESCRIPTORS},{URL:URLConstructor})},function(module,exports,__w_pdfjs_require__){exports=__w_pdfjs_require__(13);var wellKnownSymbol=__w_pdfjs_require__(57),IS_PURE=__w_pdfjs_require__(36),ITERATOR=wellKnownSymbol("iterator");module.exports=!exports(function(){var url=new URL("b?a=1&b=2&c=3","http://a"),searchParams=url.searchParams,result="";url.pathname="c%20d";searchParams.forEach(function(value,key){searchParams["delete"]("b");result+=key+value});
|
|
314
326
|
return IS_PURE&&!url.toJSON||!searchParams.sort||"http://a/c%20d?a=1&c=3"!==url.href||"3"!==searchParams.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!searchParams[ITERATOR]||"a"!==(new URL("https://a@b")).username||"b"!==(new URLSearchParams(new URLSearchParams("a=b"))).get("a")||"xn--e1aybc"!==(new URL("http://\u0442\u0435\u0441\u0442")).host||"#%D0%B1"!==(new URL("http://a#\u0431")).hash||"a1c3"!==result||"x"!==(new URL("http://x",void 0)).host})},function(module,exports,__w_pdfjs_require__){var regexNonASCII=
|
|
315
|
-
/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,floor=Math.floor,stringFromCharCode=String.fromCharCode
|
|
316
|
-
counter
|
|
317
|
-
extra+1;if(m-
|
|
318
|
-
bias;if(q<m)break;q-=m;var baseMinusT=36-m;
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
__w_pdfjs_require__=__w_pdfjs_require__("iterator");var setInternalState=InternalStateModule.set,getInternalParamsState=InternalStateModule.getterFor("URLSearchParams"),getInternalIteratorState=InternalStateModule.getterFor("URLSearchParamsIterator"),plus=/\+/g,sequences=Array(4),
|
|
322
|
-
deserialize=function(it){
|
|
323
|
-
result.push({key:deserialize(attribute.shift()),value:deserialize(attribute.join("="))}))}},updateSearchParams=function(query){this.entries.length=0;parseSearchParams(this.entries,query)},validateArgumentsLength=
|
|
324
|
-
function(){var state=getInternalIteratorState(this),kind=state.kind;state=state.iterator.next();var entry=state.value;state.done||(state.value="keys"===kind?entry.key:"values"===kind?entry.value:[entry.key,
|
|
325
|
-
if(void 0!==init)if(isObject(init)){var iteratorMethod=getIteratorMethod(init);if("function"===typeof iteratorMethod)for(init=iteratorMethod.call(init),iteratorMethod=init.next;!(step=
|
|
326
|
-
step)&&entries.push({key:step,value:init[step]+""})}else parseSearchParams(entries,"string"===typeof init?"?"===init.charAt(0)?init.slice(1):init:init+"")};createIteratorConstructor=
|
|
327
|
-
|
|
328
|
-
getInternalParamsState(this).entries,key=name+"",
|
|
329
|
-
found=!1,key=name+"",val=value+"",index=0,entry;index<entries.length;index++)entry=entries[index],entry.key===key&&(found?entries.splice(index--,1):(found=!0,entry.value=val));found||entries.push({key:key,value:val});state.updateURL()},
|
|
330
|
-
entry.key){entries.splice(entriesIndex,0,entry);break}entriesIndex===sliceIndex&&entries.push(entry)}state.updateURL()},forEach:function(callback){for(var entries=getInternalParamsState(this).entries,
|
|
331
|
-
|
|
332
|
-
{enumerable:!0});setToStringTag(URLSearchParamsConstructor,"URLSearchParams");exports({global:!0,forced:!USE_NATIVE_URL},{URLSearchParams:URLSearchParamsConstructor});USE_NATIVE_URL||"function"!=typeof $fetch||
|
|
333
|
-
headers.has("content-type")||headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8");init=create(init,{body:createPropertyDescriptor(0,String(body)),headers:createPropertyDescriptor(0,
|
|
334
|
-
getIteratorMethod(it);if("function"!=typeof iteratorMethod)throw TypeError(String(it)+" is not iterable");return anObject(iteratorMethod.call(it))}},function(module,exports,__w_pdfjs_require__){__w_pdfjs_require__(9)({target:"URL",
|
|
335
|
-
("number"!==typeof v||NumberIsNaN(v)||0>v?!1:!0)||Infinity===v?!1:!0}function Call(F,V,args){if("function"!==typeof F)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(F,
|
|
336
|
-
underlyingObject,extraArgs)};case 1:return function(arg){arg=[arg].concat(extraArgs);return PromiseCall(method,underlyingObject,arg)}}}return function(){return originalPromiseResolve(void 0)}}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
void 0,
|
|
340
|
-
|
|
341
|
-
defaultReaderClosedPromiseInitialize(reader)
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
writer=
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
controller
|
|
365
|
-
controller
|
|
366
|
-
|
|
367
|
-
stream.
|
|
368
|
-
|
|
369
|
-
function
|
|
370
|
-
|
|
371
|
-
function
|
|
372
|
-
null===value)return!1;try{return"boolean"===typeof value.aborted}catch(_a$4){return!1}}function createDOMExceptionPolyfill(){var ctor=
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
(ReadableStreamDefaultControllerClearAlgorithms(controller)
|
|
384
|
-
chunk,stream)}catch(
|
|
385
|
-
|
|
386
|
-
void 0;ResetQueue(controller);controller._started=!1;controller._closeRequested=!1;controller._pullAgain=!1;controller._pulling=!1;controller._strategySizeAlgorithm=
|
|
387
|
-
|
|
388
|
-
"start",[controller])},pullAlgorithm,cancelAlgorithm,highWaterMark,sizeAlgorithm)}function defaultControllerBrandCheckException(name){return new TypeError("ReadableStreamDefaultController.prototype."+
|
|
389
|
-
!1;!0===result.done?(!1===canceled1&&ReadableStreamDefaultControllerClose(branch1._readableStreamController),!1===canceled2&&ReadableStreamDefaultControllerClose(branch2._readableStreamController)):
|
|
390
|
-
var reader=AcquireReadableStreamDefaultReader(stream),reading=!1,canceled1=!1,canceled2=!1,reason1,reason2,resolveCancelPromise,cancelPromise=newPromise(function(resolve){resolveCancelPromise=
|
|
391
|
-
pullAlgorithm,function(reason){
|
|
392
|
-
|
|
393
|
-
!0===controller._pullAgain&&(controller._pullAgain=!1,ReadableByteStreamControllerCallPullIfNeeded(controller))},function(e){ReadableByteStreamControllerError(controller,e)})}}function ReadableByteStreamControllerCommitPullIntoDescriptor(stream,
|
|
394
|
-
ReadableStreamFulfillReadRequest(stream,filledView,done):(pullIntoDescriptor=done,stream=stream._reader,stream._readIntoRequests.shift()._resolve(ReadableStreamCreateReadResult(filledView,pullIntoDescriptor,stream._forAuthorCode)))}
|
|
395
|
-
pullIntoDescriptor){var elementSize=pullIntoDescriptor.elementSize,maxBytesToCopy=Math.min(controller._queueTotalSize,pullIntoDescriptor.byteLength-pullIntoDescriptor.bytesFilled),maxBytesFilled=pullIntoDescriptor.bytesFilled+
|
|
396
|
-
controller._queue;0<maxBytesToCopy;){var headOfQueue=elementSize.peek();maxAlignedBytes=Math.min(maxBytesToCopy,headOfQueue.byteLength);var destOffset=pullIntoDescriptor.byteOffset+pullIntoDescriptor.bytesFilled,src=headOfQueue.buffer,
|
|
397
|
-
maxAlignedBytes);controller._queueTotalSize-=maxAlignedBytes;headOfQueue=maxAlignedBytes;destOffset=pullIntoDescriptor;ReadableByteStreamControllerInvalidateBYOBRequest(controller);destOffset.bytesFilled+=headOfQueue;maxBytesToCopy-=
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
view={buffer:view.buffer,byteOffset:view.byteOffset,byteLength:view.byteLength,bytesFilled:0,elementSize:elementSize,ctor:ctor,readerType:"byob"};if(0<controller._pendingPullIntos.length)return controller._pendingPullIntos.push(view),ReadableStreamAddReadIntoRequest(stream);
|
|
401
|
-
|
|
402
|
-
stream=ReadableStreamAddReadIntoRequest(stream);ReadableByteStreamControllerCallPullIfNeeded(controller);return stream}function ReadableByteStreamControllerRespondInternal(controller,bytesWritten){var firstDescriptor=controller._pendingPullIntos.peek();
|
|
403
|
-
if(!0===ReadableStreamHasBYOBReader(firstDescriptor))for(;0<firstDescriptor._reader._readIntoRequests.length;)bytesWritten=ReadableByteStreamControllerShiftPendingPullInto(controller),ReadableByteStreamControllerCommitPullIntoDescriptor(firstDescriptor,
|
|
404
|
-
firstDescriptor.elementSize)){ReadableByteStreamControllerShiftPendingPullInto(controller);bytesWritten=firstDescriptor.bytesFilled%firstDescriptor.elementSize;if(0<bytesWritten){var end=firstDescriptor.byteOffset+firstDescriptor.bytesFilled;
|
|
405
|
-
firstDescriptor);
|
|
406
|
-
|
|
407
|
-
"readable"===stream._state&&(ReadableByteStreamControllerInvalidateBYOBRequest(controller),controller._pendingPullIntos=new SimpleQueue,ResetQueue(controller),ReadableByteStreamControllerClearAlgorithms(controller),ReadableStreamError(stream,e))}function ReadableByteStreamControllerGetDesiredSize(controller){var state=
|
|
408
|
-
controller,startAlgorithm,pullAlgorithm,cancelAlgorithm,highWaterMark,autoAllocateChunkSize){controller._controlledReadableByteStream=stream;controller._pullAgain=!1;controller._pulling=!1;controller._byobRequest=void 0;controller._queue=controller._queueTotalSize=void 0;ResetQueue(controller);controller._closeRequested
|
|
409
|
-
controller._autoAllocateChunkSize=autoAllocateChunkSize;controller._pendingPullIntos=new SimpleQueue;stream._readableStreamController=controller;stream=startAlgorithm();uponPromise(originalPromiseResolve(stream),function(){controller._started=!0;ReadableByteStreamControllerCallPullIfNeeded(controller)},function(r){ReadableByteStreamControllerError(controller,
|
|
410
|
-
pullAlgorithm=CreateAlgorithmFromUnderlyingMethod(underlyingByteSource,"pull",0,[controller]),cancelAlgorithm=CreateAlgorithmFromUnderlyingMethod(underlyingByteSource,"cancel",1,[]),autoAllocateChunkSize=underlyingByteSource.autoAllocateChunkSize;if(void 0!==autoAllocateChunkSize&&(autoAllocateChunkSize=Number(autoAllocateChunkSize)
|
|
411
|
-
controller,function(){return InvokeOrNoop(underlyingByteSource,"start",[controller])},pullAlgorithm,cancelAlgorithm,highWaterMark,autoAllocateChunkSize)}function byobRequestBrandCheckException(name){return new TypeError("ReadableStreamBYOBRequest.prototype."+name+" can only be used on a ReadableStreamBYOBRequest")}
|
|
412
|
-
reject){stream._reader._readIntoRequests.push({_resolve:resolve,_reject:reject})})}function ReadableStreamHasBYOBReader(stream){stream=stream._reader;return void 0!==stream&&IsReadableStreamBYOBReader(stream)?!0:!1}function IsReadableStreamBYOBReader(x){return typeIsObject(x)&&
|
|
413
|
-
function CreateReadableStream(startAlgorithm,pullAlgorithm,cancelAlgorithm,highWaterMark,sizeAlgorithm){void 0===highWaterMark&&(highWaterMark=1);void 0===sizeAlgorithm&&(sizeAlgorithm=function(){return 1});var stream=Object.create(ReadableStream$jscomp$0.prototype);InitializeReadableStream(stream);
|
|
414
|
-
return stream}function InitializeReadableStream(stream){stream._state="readable";stream._reader=void 0;stream._storedError=void 0;stream._disturbed=!1}function IsReadableStream(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,"_readableStreamController")?!0:!1}function IsReadableStreamLocked(stream){return void 0===
|
|
415
|
-
stream._state)return originalPromiseReject(stream._storedError);ReadableStreamClose(stream);stream=stream._readableStreamController[CancelSteps](reason);return PerformPromiseThen(stream,noop,void 0)}function ReadableStreamClose(stream){stream._state="closed";var reader=stream._reader;void 0!==reader&&(IsReadableStreamDefaultReader(reader)&&
|
|
416
|
-
new SimpleQueue),defaultReaderClosedPromiseResolve(reader))}function ReadableStreamError(stream,e){stream._state="errored";stream._storedError=e;stream=stream._reader;void 0!==stream&&(IsReadableStreamDefaultReader(stream)?(stream._readRequests.forEach(function(readRequest){readRequest._reject(e)}),stream._readRequests=new SimpleQueue):(stream._readIntoRequests.forEach(function(readIntoRequest){readIntoRequest._reject(e)}),
|
|
417
|
-
e))}function streamBrandCheckException$1(name){return new TypeError("ReadableStream.prototype."+name+" can only be used on a ReadableStream")}function InitializeTransformStream(stream,startPromise,writableHighWaterMark,writableSizeAlgorithm,readableHighWaterMark,readableSizeAlgorithm){function startAlgorithm(){return startPromise}stream._writable=CreateWritableStream(startAlgorithm,function(chunk){return TransformStreamDefaultSinkWriteAlgorithm(stream,
|
|
418
|
-
function(reason){TransformStreamError(stream,reason);return originalPromiseResolve(void 0)},writableHighWaterMark,writableSizeAlgorithm);stream._readable=CreateReadableStream(startAlgorithm,function(){TransformStreamSetBackpressure(stream,!1);return stream._backpressureChangePromise},function(reason){TransformStreamErrorWritableAndUnblockWrite(stream,reason);return originalPromiseResolve(void 0)},readableHighWaterMark,readableSizeAlgorithm);
|
|
419
|
-
void 0;stream._backpressureChangePromise_resolve=void 0;TransformStreamSetBackpressure(stream,!0);stream._transformStreamController=void 0}function IsTransformStream(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,"_transformStreamController")?!0:!1}function TransformStreamError(stream,e){ReadableStreamDefaultControllerError(stream._readable._readableStreamController,e);TransformStreamErrorWritableAndUnblockWrite(stream,
|
|
420
|
-
e){TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController,e);!0===stream._backpressure&&TransformStreamSetBackpressure(stream,!1)}function TransformStreamSetBackpressure(stream,backpressure){void 0!==stream._backpressureChangePromise&&stream._backpressureChangePromise_resolve();stream._backpressureChangePromise=newPromise(function(resolve){stream._backpressureChangePromise_resolve=
|
|
421
|
-
stream._backpressure=backpressure}function IsTransformStreamDefaultController(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,"_controlledTransformStream")?!0:!1}function SetUpTransformStreamDefaultController(stream,controller,transformAlgorithm,flushAlgorithm){controller._controlledTransformStream=stream;stream._transformStreamController=controller;controller._transformAlgorithm=transformAlgorithm;controller._flushAlgorithm=flushAlgorithm}function SetUpTransformStreamDefaultControllerFromTransformer(stream,
|
|
327
|
+
/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,floor=Math.floor,stringFromCharCode=String.fromCharCode;module.exports=function(input$jscomp$0){var encoded=[];input$jscomp$0=input$jscomp$0.toLowerCase().replace(regexSeparators,".").split(".");var i;for(i=0;i<input$jscomp$0.length;i++){var label=input$jscomp$0[i];var JSCompiler_temp_const=encoded,JSCompiler_temp_const$jscomp$0=JSCompiler_temp_const.push;if(regexNonASCII.test(label)){var input=label;label=[];var i$jscomp$0=input;input=[];for(var counter=
|
|
328
|
+
0,length=i$jscomp$0.length;counter<length;){var value=i$jscomp$0.charCodeAt(counter++);if(55296<=value&&56319>=value&&counter<length){var extra=i$jscomp$0.charCodeAt(counter++);56320==(extra&64512)?input.push(((value&1023)<<10)+(extra&1023)+65536):(input.push(value),counter--)}else input.push(value)}counter=input.length;length=128;var delta=0,bias=72;for(i$jscomp$0=0;i$jscomp$0<input.length;i$jscomp$0++){var currentValue=input[i$jscomp$0];128>currentValue&&label.push(stringFromCharCode(currentValue))}for((extra=
|
|
329
|
+
value=label.length)&&label.push("-");extra<counter;){var m=2147483647;for(i$jscomp$0=0;i$jscomp$0<input.length;i$jscomp$0++)currentValue=input[i$jscomp$0],currentValue>=length&¤tValue<m&&(m=currentValue);var handledCPCountPlusOne=extra+1;if(m-length>floor((2147483647-delta)/handledCPCountPlusOne))throw RangeError("Overflow: input needs wider integers to process");delta+=(m-length)*handledCPCountPlusOne;length=m;for(i$jscomp$0=0;i$jscomp$0<input.length;i$jscomp$0++){currentValue=input[i$jscomp$0];
|
|
330
|
+
if(currentValue<length&&2147483647<++delta)throw RangeError("Overflow: input needs wider integers to process");if(currentValue==length){var q=delta;for(currentValue=36;;currentValue+=36){m=currentValue<=bias?1:currentValue>=bias+26?26:currentValue-bias;if(q<m)break;q-=m;var baseMinusT=36-m,JSCompiler_temp_const$jscomp$1=label;m+=q%baseMinusT;JSCompiler_temp_const$jscomp$1.push.call(JSCompiler_temp_const$jscomp$1,stringFromCharCode(m+22+75*(26>m)));q=floor(q/baseMinusT)}label.push(stringFromCharCode(q+
|
|
331
|
+
22+75*(26>q)));bias=handledCPCountPlusOne;currentValue=0;delta=extra==value?floor(delta/700):delta>>1;for(delta+=floor(delta/bias);455<delta;currentValue+=36)delta=floor(delta/35);bias=floor(currentValue+36*delta/(delta+38));delta=0;++extra}}++delta;++length}label="xn--"+label.join("")}JSCompiler_temp_const$jscomp$0.call(JSCompiler_temp_const,label)}return encoded.join(".")}},function(module,exports,__w_pdfjs_require__){__w_pdfjs_require__(112);exports=__w_pdfjs_require__(9);var getBuiltIn=__w_pdfjs_require__(41),
|
|
332
|
+
USE_NATIVE_URL=__w_pdfjs_require__(133),redefine=__w_pdfjs_require__(28),redefineAll=__w_pdfjs_require__(115),setToStringTag=__w_pdfjs_require__(84),createIteratorConstructor=__w_pdfjs_require__(79),InternalStateModule=__w_pdfjs_require__(32),anInstance=__w_pdfjs_require__(117),hasOwn=__w_pdfjs_require__(22),bind=__w_pdfjs_require__(62),classof=__w_pdfjs_require__(94),anObject=__w_pdfjs_require__(27),isObject=__w_pdfjs_require__(21),create=__w_pdfjs_require__(71),createPropertyDescriptor=__w_pdfjs_require__(15),
|
|
333
|
+
getIterator=__w_pdfjs_require__(136),getIteratorMethod=__w_pdfjs_require__(93);__w_pdfjs_require__=__w_pdfjs_require__(57);var $fetch=getBuiltIn("fetch"),Headers=getBuiltIn("Headers");__w_pdfjs_require__=__w_pdfjs_require__("iterator");var setInternalState=InternalStateModule.set,getInternalParamsState=InternalStateModule.getterFor("URLSearchParams"),getInternalIteratorState=InternalStateModule.getterFor("URLSearchParamsIterator"),plus=/\+/g,sequences=Array(4),percentDecode=function(sequence){try{return decodeURIComponent(sequence)}catch(error){return sequence}},
|
|
334
|
+
deserialize=function(it){var result=it.replace(plus," ");it=4;try{return decodeURIComponent(result)}catch(error){for(;it;){var JSCompiler_temp_const=result.replace;var JSCompiler_inline_result=it--;JSCompiler_inline_result=sequences[JSCompiler_inline_result-1]||(sequences[JSCompiler_inline_result-1]=RegExp("((?:%[\\da-f]{2}){"+JSCompiler_inline_result+"})","gi"));result=JSCompiler_temp_const.call(result,JSCompiler_inline_result,percentDecode)}return result}},find=/[!'()~]|%20/g,replace={"!":"%21",
|
|
335
|
+
"'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(match){return replace[match]},parseSearchParams=function(result,query){if(query){query=query.split("&");for(var index=0,attribute;index<query.length;)attribute=query[index++],attribute.length&&(attribute=attribute.split("="),result.push({key:deserialize(attribute.shift()),value:deserialize(attribute.join("="))}))}},updateSearchParams=function(query){this.entries.length=0;parseSearchParams(this.entries,query)},validateArgumentsLength=
|
|
336
|
+
function(passed,required){if(passed<required)throw TypeError("Not enough arguments");},URLSearchParamsIterator=createIteratorConstructor(function(params,kind){setInternalState(this,{type:"URLSearchParamsIterator",iterator:getIterator(getInternalParamsState(params).entries),kind:kind})},"Iterator",function(){var state=getInternalIteratorState(this),kind=state.kind;state=state.iterator.next();var entry=state.value;state.done||(state.value="keys"===kind?entry.key:"values"===kind?entry.value:[entry.key,
|
|
337
|
+
entry.value]);return state}),URLSearchParamsConstructor=function(){anInstance(this,URLSearchParamsConstructor,"URLSearchParams");var init=0<arguments.length?arguments[0]:void 0,entries=[],step,first,second;setInternalState(this,{type:"URLSearchParams",entries:entries,updateURL:function(){},updateSearchParams:updateSearchParams});if(void 0!==init)if(isObject(init)){var iteratorMethod=getIteratorMethod(init);if("function"===typeof iteratorMethod)for(init=iteratorMethod.call(init),iteratorMethod=init.next;!(step=
|
|
338
|
+
iteratorMethod.call(init)).done;){step=getIterator(anObject(step.value));var entryNext=step.next;if((first=entryNext.call(step)).done||(second=entryNext.call(step)).done||!entryNext.call(step).done)throw TypeError("Expected sequence with length 2");entries.push({key:first.value+"",value:second.value+""})}else for(step in init)hasOwn(init,step)&&entries.push({key:step,value:init[step]+""})}else parseSearchParams(entries,"string"===typeof init?"?"===init.charAt(0)?init.slice(1):init:init+"")};createIteratorConstructor=
|
|
339
|
+
URLSearchParamsConstructor.prototype;redefineAll(createIteratorConstructor,{append:function(name,value){validateArgumentsLength(arguments.length,2);var state=getInternalParamsState(this);state.entries.push({key:name+"",value:value+""});state.updateURL()},"delete":function(name){validateArgumentsLength(arguments.length,1);for(var state=getInternalParamsState(this),entries=state.entries,key=name+"",index=0;index<entries.length;)entries[index].key===key?entries.splice(index,1):index++;state.updateURL()},
|
|
340
|
+
get:function(name){validateArgumentsLength(arguments.length,1);for(var entries=getInternalParamsState(this).entries,key=name+"",index=0;index<entries.length;index++)if(entries[index].key===key)return entries[index].value;return null},getAll:function(name){validateArgumentsLength(arguments.length,1);for(var entries=getInternalParamsState(this).entries,key=name+"",result=[],index=0;index<entries.length;index++)entries[index].key===key&&result.push(entries[index].value);return result},has:function(name){validateArgumentsLength(arguments.length,
|
|
341
|
+
1);for(var entries=getInternalParamsState(this).entries,key=name+"",index=0;index<entries.length;)if(entries[index++].key===key)return!0;return!1},set:function(name,value){validateArgumentsLength(arguments.length,1);for(var state=getInternalParamsState(this),entries=state.entries,found=!1,key=name+"",val=value+"",index=0,entry;index<entries.length;index++)entry=entries[index],entry.key===key&&(found?entries.splice(index--,1):(found=!0,entry.value=val));found||entries.push({key:key,value:val});state.updateURL()},
|
|
342
|
+
sort:function(){var state=getInternalParamsState(this),entries=state.entries,slice=entries.slice(),entriesIndex,sliceIndex;for(sliceIndex=entries.length=0;sliceIndex<slice.length;sliceIndex++){var entry=slice[sliceIndex];for(entriesIndex=0;entriesIndex<sliceIndex;entriesIndex++)if(entries[entriesIndex].key>entry.key){entries.splice(entriesIndex,0,entry);break}entriesIndex===sliceIndex&&entries.push(entry)}state.updateURL()},forEach:function(callback){for(var entries=getInternalParamsState(this).entries,
|
|
343
|
+
boundFunction=bind(callback,1<arguments.length?arguments[1]:void 0,3),index=0,entry;index<entries.length;)entry=entries[index++],boundFunction(entry.value,entry.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0});redefine(createIteratorConstructor,__w_pdfjs_require__,createIteratorConstructor.entries);redefine(createIteratorConstructor,
|
|
344
|
+
"toString",function(){for(var entries=getInternalParamsState(this).entries,result=[],index=0,entry;index<entries.length;)entry=entries[index++],result.push(encodeURIComponent(entry.key).replace(find,replacer)+"="+encodeURIComponent(entry.value).replace(find,replacer));return result.join("&")},{enumerable:!0});setToStringTag(URLSearchParamsConstructor,"URLSearchParams");exports({global:!0,forced:!USE_NATIVE_URL},{URLSearchParams:URLSearchParamsConstructor});USE_NATIVE_URL||"function"!=typeof $fetch||
|
|
345
|
+
"function"!=typeof Headers||exports({global:!0,enumerable:!0,forced:!0},{fetch:function(input){var args=[input];if(1<arguments.length){var init=arguments[1];if(isObject(init)){var body=init.body;if("URLSearchParams"===classof(body)){var headers=init.headers?new Headers(init.headers):new Headers;headers.has("content-type")||headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8");init=create(init,{body:createPropertyDescriptor(0,String(body)),headers:createPropertyDescriptor(0,
|
|
346
|
+
headers)})}}args.push(init)}return $fetch.apply(this,args)}});module.exports={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState}},function(module,exports,__w_pdfjs_require__){var anObject=__w_pdfjs_require__(27),getIteratorMethod=__w_pdfjs_require__(93);module.exports=function(it){var iteratorMethod=getIteratorMethod(it);if("function"!=typeof iteratorMethod)throw TypeError(String(it)+" is not iterable");return anObject(iteratorMethod.call(it))}},function(module,exports,__w_pdfjs_require__){__w_pdfjs_require__(9)({target:"URL",
|
|
347
|
+
proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},function(__webpack_module__,__webpack_exports__,__w_pdfjs_require__){function noop(){}function typeIsObject(x){return"object"===_typeof2(x)&&null!==x||"function"===typeof x}function IsFiniteNonNegativeNumber(v){return!1===("number"!==typeof v||NumberIsNaN(v)||0>v?!1:!0)||Infinity===v?!1:!0}function Call(F,V,args){if("function"!==typeof F)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(F,
|
|
348
|
+
V,args)}function CreateAlgorithmFromUnderlyingMethod(underlyingObject,methodName,algoArgCount,extraArgs){var method=underlyingObject[methodName];if(void 0!==method){if("function"!==typeof method)throw new TypeError(method+" is not a method");switch(algoArgCount){case 0:return function(){return PromiseCall(method,underlyingObject,extraArgs)};case 1:return function(arg){arg=[arg].concat(extraArgs);return PromiseCall(method,underlyingObject,arg)}}}return function(){return originalPromiseResolve(void 0)}}
|
|
349
|
+
function InvokeOrNoop(O,P,args){P=O[P];if(void 0!==P)return Call(P,O,args)}function PromiseCall(F,V,args){try{return originalPromiseResolve(Call(F,V,args))}catch(value){return originalPromiseReject(value)}}function ValidateAndNormalizeHighWaterMark(highWaterMark){highWaterMark=Number(highWaterMark);if(NumberIsNaN(highWaterMark)||0>highWaterMark)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return highWaterMark}function MakeSizeAlgorithmFromSizeFunction(size){if(void 0===
|
|
350
|
+
size)return function(){return 1};if("function"!==typeof size)throw new TypeError("size property of a queuing strategy must be a function");return function(chunk){return size(chunk)}}function newPromise(executor){return new originalPromise(executor)}function PerformPromiseThen(promise,onFulfilled,onRejected){return originalPromiseThen.call(promise,onFulfilled,onRejected)}function uponPromise(promise,onFulfilled,onRejected){PerformPromiseThen(PerformPromiseThen(promise,onFulfilled,onRejected),void 0,
|
|
351
|
+
rethrowAssertionErrorRejection)}function uponFulfillment(promise,onFulfilled){uponPromise(promise,onFulfilled)}function uponRejection(promise,onRejected){uponPromise(promise,void 0,onRejected)}function transformPromiseWith(promise,fulfillmentHandler,rejectionHandler){return PerformPromiseThen(promise,fulfillmentHandler,rejectionHandler)}function setPromiseIsHandledToTrue(promise){PerformPromiseThen(promise,void 0,rethrowAssertionErrorRejection)}function ReadableStreamCreateReadResult(value,done,forAuthorCode){var prototype=
|
|
352
|
+
null;!0===forAuthorCode&&(prototype=Object.prototype);forAuthorCode=Object.create(prototype);forAuthorCode.value=value;forAuthorCode.done=done;return forAuthorCode}function ReadableStreamReaderGenericInitialize(reader,stream){reader._forAuthorCode=!0;reader._ownerReadableStream=stream;stream._reader=reader;"readable"===stream._state?defaultReaderClosedPromiseInitialize(reader):"closed"===stream._state?(defaultReaderClosedPromiseInitialize(reader),defaultReaderClosedPromiseResolve(reader)):(stream=
|
|
353
|
+
stream._storedError,defaultReaderClosedPromiseInitialize(reader),defaultReaderClosedPromiseReject(reader,stream))}function ReadableStreamReaderGenericRelease(reader){if("readable"===reader._ownerReadableStream._state)defaultReaderClosedPromiseReject(reader,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"));else{var reason=new TypeError("Reader was released and can no longer be used to monitor the stream's closedness");defaultReaderClosedPromiseInitialize(reader);
|
|
354
|
+
defaultReaderClosedPromiseReject(reader,reason)}reader._ownerReadableStream._reader=void 0;reader._ownerReadableStream=void 0}function readerLockException(name){return new TypeError("Cannot "+name+" a stream using a released reader")}function defaultReaderClosedPromiseInitialize(reader){reader._closedPromise=newPromise(function(resolve,reject){reader._closedPromise_resolve=resolve;reader._closedPromise_reject=reject})}function defaultReaderClosedPromiseReject(reader,reason){setPromiseIsHandledToTrue(reader._closedPromise);
|
|
355
|
+
reader._closedPromise_reject(reason);reader._closedPromise_resolve=void 0;reader._closedPromise_reject=void 0}function defaultReaderClosedPromiseResolve(reader){reader._closedPromise_resolve(void 0);reader._closedPromise_resolve=void 0;reader._closedPromise_reject=void 0}function AcquireReadableStreamDefaultReader(stream,forAuthorCode){void 0===forAuthorCode&&(forAuthorCode=!1);stream=new ReadableStreamDefaultReader$jscomp$0(stream);stream._forAuthorCode=forAuthorCode;return stream}function ReadableStreamAddReadRequest(stream){return newPromise(function(resolve,
|
|
356
|
+
reject){stream._reader._readRequests.push({_resolve:resolve,_reject:reject})})}function ReadableStreamFulfillReadRequest(stream,chunk,done){stream=stream._reader;stream._readRequests.shift()._resolve(ReadableStreamCreateReadResult(chunk,done,stream._forAuthorCode))}function ReadableStreamHasDefaultReader(stream){stream=stream._reader;return void 0!==stream&&IsReadableStreamDefaultReader(stream)?!0:!1}function IsReadableStreamDefaultReader(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,
|
|
357
|
+
"_readRequests")?!0:!1}function ReadableStreamDefaultReaderRead(reader){var stream=reader._ownerReadableStream;stream._disturbed=!0;return"closed"===stream._state?originalPromiseResolve(ReadableStreamCreateReadResult(void 0,!0,reader._forAuthorCode)):"errored"===stream._state?originalPromiseReject(stream._storedError):stream._readableStreamController[PullSteps]()}function defaultReaderBrandCheckException(name){return new TypeError("ReadableStreamDefaultReader.prototype."+name+" can only be used on a ReadableStreamDefaultReader")}
|
|
358
|
+
function IsReadableStreamAsyncIterator(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,"_asyncIteratorReader")?!0:!1}function streamAsyncIteratorBrandCheckException(name){return new TypeError("ReadableStreamAsyncIterator."+name+" can only be used on a ReadableSteamAsyncIterator")}function DequeueValue(container){var pair=container._queue.shift();container._queueTotalSize-=pair.size;0>container._queueTotalSize&&(container._queueTotalSize=0);return pair.value}function EnqueueValueWithSize(container,
|
|
359
|
+
value,size){size=Number(size);if(!IsFiniteNonNegativeNumber(size))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");container._queue.push({value:value,size:size});container._queueTotalSize+=size}function ResetQueue(container){container._queue=new SimpleQueue;container._queueTotalSize=0}function CreateWritableStream(startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,highWaterMark,sizeAlgorithm){void 0===highWaterMark&&(highWaterMark=1);void 0===sizeAlgorithm&&(sizeAlgorithm=
|
|
360
|
+
function(){return 1});var stream=Object.create(WritableStream$jscomp$0.prototype);InitializeWritableStream(stream);var controller=Object.create(WritableStreamDefaultController$jscomp$0.prototype);SetUpWritableStreamDefaultController(stream,controller,startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,highWaterMark,sizeAlgorithm);return stream}function InitializeWritableStream(stream){stream._state="writable";stream._storedError=void 0;stream._writer=void 0;stream._writableStreamController=
|
|
361
|
+
void 0;stream._writeRequests=new SimpleQueue;stream._inFlightWriteRequest=void 0;stream._closeRequest=void 0;stream._inFlightCloseRequest=void 0;stream._pendingAbortRequest=void 0;stream._backpressure=!1}function IsWritableStream(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,"_writableStreamController")?!0:!1}function IsWritableStreamLocked(stream){return void 0===stream._writer?!1:!0}function WritableStreamAbort(stream,reason){var state=stream._state;if("closed"===state||"errored"===
|
|
362
|
+
state)return originalPromiseResolve(void 0);if(void 0!==stream._pendingAbortRequest)return stream._pendingAbortRequest._promise;var wasAlreadyErroring=!1;"erroring"===state&&(wasAlreadyErroring=!0,reason=void 0);state=newPromise(function(resolve,reject){stream._pendingAbortRequest={_promise:void 0,_resolve:resolve,_reject:reject,_reason:reason,_wasAlreadyErroring:wasAlreadyErroring}});stream._pendingAbortRequest._promise=state;!1===wasAlreadyErroring&&WritableStreamStartErroring(stream,reason);return state}
|
|
363
|
+
function WritableStreamAddWriteRequest(stream){return newPromise(function(resolve,reject){stream._writeRequests.push({_resolve:resolve,_reject:reject})})}function WritableStreamDealWithRejection(stream,error){"writable"===stream._state?WritableStreamStartErroring(stream,error):WritableStreamFinishErroring(stream)}function WritableStreamStartErroring(stream,reason){var controller=stream._writableStreamController;stream._state="erroring";stream._storedError=reason;var writer=stream._writer;void 0!==
|
|
364
|
+
writer&&("pending"!==writer._readyPromiseState&&defaultWriterReadyPromiseInitialize(writer),defaultWriterReadyPromiseReject(writer,reason));reason=void 0===stream._inFlightWriteRequest&&void 0===stream._inFlightCloseRequest?!1:!0;!1===reason&&!0===controller._started&&WritableStreamFinishErroring(stream)}function WritableStreamFinishErroring(stream){stream._state="errored";stream._writableStreamController[ErrorSteps]();var storedError=stream._storedError;stream._writeRequests.forEach(function(writeRequest){writeRequest._reject(storedError)});
|
|
365
|
+
stream._writeRequests=new SimpleQueue;if(void 0===stream._pendingAbortRequest)WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);else{var abortRequest=stream._pendingAbortRequest;stream._pendingAbortRequest=void 0;if(!0===abortRequest._wasAlreadyErroring)abortRequest._reject(storedError),WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);else{var promise=stream._writableStreamController[AbortSteps](abortRequest._reason);uponPromise(promise,function(){abortRequest._resolve();WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream)},
|
|
366
|
+
function(reason){abortRequest._reject(reason);WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream)})}}}function WritableStreamCloseQueuedOrInFlight(stream){return void 0===stream._closeRequest&&void 0===stream._inFlightCloseRequest?!1:!0}function WritableStreamMarkCloseRequestInFlight(stream){stream._inFlightCloseRequest=stream._closeRequest;stream._closeRequest=void 0}function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream){void 0!==stream._closeRequest&&(stream._closeRequest._reject(stream._storedError),
|
|
367
|
+
stream._closeRequest=void 0);var writer=stream._writer;void 0!==writer&&defaultWriterClosedPromiseReject(writer,stream._storedError)}function WritableStreamUpdateBackpressure(stream,backpressure){var writer=stream._writer;void 0!==writer&&backpressure!==stream._backpressure&&(!0===backpressure?defaultWriterReadyPromiseInitialize(writer):defaultWriterReadyPromiseResolve(writer));stream._backpressure=backpressure}function IsWritableStreamDefaultWriter(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,
|
|
368
|
+
"_ownerWritableStream")?!0:!1}function WritableStreamDefaultWriterClose(writer){var stream=writer._ownerWritableStream,state=stream._state;if("closed"===state||"errored"===state)return originalPromiseReject(new TypeError("The stream (in "+state+" state) is not in the writable state and cannot be closed"));var promise=newPromise(function(resolve,reject){stream._closeRequest={_resolve:resolve,_reject:reject}});!0===stream._backpressure&&"writable"===state&&defaultWriterReadyPromiseResolve(writer);WritableStreamDefaultControllerClose(stream._writableStreamController);
|
|
369
|
+
return promise}function WritableStreamDefaultWriterRelease(writer){var stream=writer._ownerWritableStream,releasedError=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");"pending"!==writer._readyPromiseState&&defaultWriterReadyPromiseInitialize(writer);defaultWriterReadyPromiseReject(writer,releasedError);"pending"!==writer._closedPromiseState&&defaultWriterClosedPromiseInitialize(writer);defaultWriterClosedPromiseReject(writer,releasedError);stream._writer=
|
|
370
|
+
void 0;writer._ownerWritableStream=void 0}function WritableStreamDefaultWriterWrite(writer,chunk){var stream=writer._ownerWritableStream,controller=stream._writableStreamController;try{var chunkSize=controller._strategySizeAlgorithm(chunk)}catch(chunkSizeE){WritableStreamDefaultControllerErrorIfNeeded(controller,chunkSizeE),chunkSize=1}if(stream!==writer._ownerWritableStream)return originalPromiseReject(defaultWriterLockException("write to"));writer=stream._state;if("errored"===writer)return originalPromiseReject(stream._storedError);
|
|
371
|
+
if(!0===WritableStreamCloseQueuedOrInFlight(stream)||"closed"===writer)return originalPromiseReject(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===writer)return originalPromiseReject(stream._storedError);stream=WritableStreamAddWriteRequest(stream);a:{chunk={chunk:chunk};try{EnqueueValueWithSize(controller,chunk,chunkSize)}catch(enqueueE){WritableStreamDefaultControllerErrorIfNeeded(controller,enqueueE);break a}chunkSize=controller._controlledWritableStream;
|
|
372
|
+
!1===WritableStreamCloseQueuedOrInFlight(chunkSize)&&"writable"===chunkSize._state&&WritableStreamUpdateBackpressure(chunkSize,0>=controller._strategyHWM-controller._queueTotalSize);WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller)}return stream}function SetUpWritableStreamDefaultController(stream,controller,startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,highWaterMark,sizeAlgorithm){controller._controlledWritableStream=stream;stream._writableStreamController=controller;
|
|
373
|
+
controller._queue=void 0;controller._queueTotalSize=void 0;ResetQueue(controller);controller._started=!1;controller._strategySizeAlgorithm=sizeAlgorithm;controller._strategyHWM=highWaterMark;controller._writeAlgorithm=writeAlgorithm;controller._closeAlgorithm=closeAlgorithm;controller._abortAlgorithm=abortAlgorithm;WritableStreamUpdateBackpressure(stream,0>=controller._strategyHWM-controller._queueTotalSize);startAlgorithm=startAlgorithm();startAlgorithm=originalPromiseResolve(startAlgorithm);uponPromise(startAlgorithm,
|
|
374
|
+
function(){controller._started=!0;WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller)},function(r){controller._started=!0;WritableStreamDealWithRejection(stream,r)})}function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream,underlyingSink,highWaterMark,sizeAlgorithm){var controller=Object.create(WritableStreamDefaultController$jscomp$0.prototype),writeAlgorithm=CreateAlgorithmFromUnderlyingMethod(underlyingSink,"write",1,[controller]),closeAlgorithm=CreateAlgorithmFromUnderlyingMethod(underlyingSink,
|
|
375
|
+
"close",0,[]),abortAlgorithm=CreateAlgorithmFromUnderlyingMethod(underlyingSink,"abort",1,[]);SetUpWritableStreamDefaultController(stream,controller,function(){return InvokeOrNoop(underlyingSink,"start",[controller])},writeAlgorithm,closeAlgorithm,abortAlgorithm,highWaterMark,sizeAlgorithm)}function WritableStreamDefaultControllerClearAlgorithms(controller){controller._writeAlgorithm=void 0;controller._closeAlgorithm=void 0;controller._abortAlgorithm=void 0;controller._strategySizeAlgorithm=void 0}
|
|
376
|
+
function WritableStreamDefaultControllerClose(controller){EnqueueValueWithSize(controller,"close",0);WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller)}function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller){var stream=controller._controlledWritableStream;!1!==controller._started&&void 0===stream._inFlightWriteRequest&&("erroring"===stream._state?WritableStreamFinishErroring(stream):0!==controller._queue.length&&(stream=controller._queue.peek().value,"close"===stream?
|
|
377
|
+
WritableStreamDefaultControllerProcessClose(controller):WritableStreamDefaultControllerProcessWrite(controller,stream.chunk)))}function WritableStreamDefaultControllerErrorIfNeeded(controller,error){if("writable"===controller._controlledWritableStream._state){var stream=controller._controlledWritableStream;WritableStreamDefaultControllerClearAlgorithms(controller);WritableStreamStartErroring(stream,error)}}function WritableStreamDefaultControllerProcessClose(controller){var stream=controller._controlledWritableStream;
|
|
378
|
+
WritableStreamMarkCloseRequestInFlight(stream);DequeueValue(controller);var sinkClosePromise=controller._closeAlgorithm();WritableStreamDefaultControllerClearAlgorithms(controller);uponPromise(sinkClosePromise,function(){stream._inFlightCloseRequest._resolve(void 0);stream._inFlightCloseRequest=void 0;"erroring"===stream._state&&(stream._storedError=void 0,void 0!==stream._pendingAbortRequest&&(stream._pendingAbortRequest._resolve(),stream._pendingAbortRequest=void 0));stream._state="closed";var writer=
|
|
379
|
+
stream._writer;void 0!==writer&&defaultWriterClosedPromiseResolve(writer)},function(reason){stream._inFlightCloseRequest._reject(reason);stream._inFlightCloseRequest=void 0;void 0!==stream._pendingAbortRequest&&(stream._pendingAbortRequest._reject(reason),stream._pendingAbortRequest=void 0);WritableStreamDealWithRejection(stream,reason)})}function WritableStreamDefaultControllerProcessWrite(controller,chunk){var stream=controller._controlledWritableStream;stream._inFlightWriteRequest=stream._writeRequests.shift();
|
|
380
|
+
chunk=controller._writeAlgorithm(chunk);uponPromise(chunk,function(){stream._inFlightWriteRequest._resolve(void 0);stream._inFlightWriteRequest=void 0;var state=stream._state;DequeueValue(controller);!1===WritableStreamCloseQueuedOrInFlight(stream)&&"writable"===state&&WritableStreamUpdateBackpressure(stream,0>=controller._strategyHWM-controller._queueTotalSize);WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller)},function(reason){"writable"===stream._state&&WritableStreamDefaultControllerClearAlgorithms(controller);
|
|
381
|
+
stream._inFlightWriteRequest._reject(reason);stream._inFlightWriteRequest=void 0;WritableStreamDealWithRejection(stream,reason)})}function streamBrandCheckException(name){return new TypeError("WritableStream.prototype."+name+" can only be used on a WritableStream")}function defaultWriterBrandCheckException(name){return new TypeError("WritableStreamDefaultWriter.prototype."+name+" can only be used on a WritableStreamDefaultWriter")}function defaultWriterLockException(name){return new TypeError("Cannot "+
|
|
382
|
+
name+" a stream using a released writer")}function defaultWriterClosedPromiseInitialize(writer){writer._closedPromise=newPromise(function(resolve,reject){writer._closedPromise_resolve=resolve;writer._closedPromise_reject=reject;writer._closedPromiseState="pending"})}function defaultWriterClosedPromiseReject(writer,reason){setPromiseIsHandledToTrue(writer._closedPromise);writer._closedPromise_reject(reason);writer._closedPromise_resolve=void 0;writer._closedPromise_reject=void 0;writer._closedPromiseState=
|
|
383
|
+
"rejected"}function defaultWriterClosedPromiseResolve(writer){writer._closedPromise_resolve(void 0);writer._closedPromise_resolve=void 0;writer._closedPromise_reject=void 0;writer._closedPromiseState="resolved"}function defaultWriterReadyPromiseInitialize(writer){writer._readyPromise=newPromise(function(resolve,reject){writer._readyPromise_resolve=resolve;writer._readyPromise_reject=reject});writer._readyPromiseState="pending"}function defaultWriterReadyPromiseReject(writer,reason){setPromiseIsHandledToTrue(writer._readyPromise);
|
|
384
|
+
writer._readyPromise_reject(reason);writer._readyPromise_resolve=void 0;writer._readyPromise_reject=void 0;writer._readyPromiseState="rejected"}function defaultWriterReadyPromiseResolve(writer){writer._readyPromise_resolve(void 0);writer._readyPromise_resolve=void 0;writer._readyPromise_reject=void 0;writer._readyPromiseState="fulfilled"}function isAbortSignal(value){if("object"!==_typeof2(value)||null===value)return!1;try{return"boolean"===typeof value.aborted}catch(_a$4){return!1}}function createDOMExceptionPolyfill(){var ctor=
|
|
385
|
+
function(message,name){this.message=message||"";this.name=name||"Error";Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};ctor.prototype=Object.create(Error.prototype);Object.defineProperty(ctor.prototype,"constructor",{value:ctor,writable:!0,configurable:!0});return ctor}function ReadableStreamPipeTo(source,dest,preventClose,preventAbort,preventCancel,signal){var reader=AcquireReadableStreamDefaultReader(source),writer=new WritableStreamDefaultWriter$jscomp$0(dest),shuttingDown=
|
|
386
|
+
!1,currentWrite=originalPromiseResolve(void 0);return newPromise(function(resolve,reject){function pipeStep(){return!0===shuttingDown?originalPromiseResolve(!0):PerformPromiseThen(writer._readyPromise,function(){return PerformPromiseThen(ReadableStreamDefaultReaderRead(reader),function(_a){if(!0===_a.done)return!0;currentWrite=PerformPromiseThen(WritableStreamDefaultWriterWrite(writer,_a.value),void 0,noop);return!1})})}function waitForWritesToFinish(){var oldCurrentWrite=currentWrite;return PerformPromiseThen(currentWrite,
|
|
387
|
+
function(){return oldCurrentWrite!==currentWrite?waitForWritesToFinish():void 0})}function isOrBecomesErrored(stream,promise,action){"errored"===stream._state?action(stream._storedError):uponRejection(promise,action)}function shutdownWithAction(action,originalIsError,originalError){function doTheRest(){uponPromise(action(),function(){return finalize(originalIsError,originalError)},function(newError){return finalize(!0,newError)})}!0!==shuttingDown&&(shuttingDown=!0,"writable"===dest._state&&!1===
|
|
388
|
+
WritableStreamCloseQueuedOrInFlight(dest)?uponFulfillment(waitForWritesToFinish(),doTheRest):doTheRest())}function shutdown(isError,error){!0!==shuttingDown&&(shuttingDown=!0,"writable"===dest._state&&!1===WritableStreamCloseQueuedOrInFlight(dest)?uponFulfillment(waitForWritesToFinish(),function(){return finalize(isError,error)}):finalize(isError,error))}function finalize(isError,error){WritableStreamDefaultWriterRelease(writer);ReadableStreamReaderGenericRelease(reader);void 0!==signal&&signal.removeEventListener("abort",
|
|
389
|
+
abortAlgorithm);isError?reject(error):resolve(void 0)}if(void 0!==signal){var abortAlgorithm=function(){var error=new DOMException$1("Aborted","AbortError"),actions=[];!1===preventAbort&&actions.push(function(){return"writable"===dest._state?WritableStreamAbort(dest,error):originalPromiseResolve(void 0)});!1===preventCancel&&actions.push(function(){return"readable"===source._state?ReadableStreamCancel(source,error):originalPromiseResolve(void 0)});shutdownWithAction(function(){return Promise.all(actions.map(function(action){return action()}))},
|
|
390
|
+
!0,error)};if(!0===signal.aborted){abortAlgorithm();return}signal.addEventListener("abort",abortAlgorithm)}isOrBecomesErrored(source,reader._closedPromise,function(storedError){!1===preventAbort?shutdownWithAction(function(){return WritableStreamAbort(dest,storedError)},!0,storedError):shutdown(!0,storedError)});isOrBecomesErrored(dest,writer._closedPromise,function(storedError){!1===preventCancel?shutdownWithAction(function(){return ReadableStreamCancel(source,storedError)},!0,storedError):shutdown(!0,
|
|
391
|
+
storedError)});(function(stream,promise,action){"closed"===stream._state?action():uponPromise(promise,action)})(source,reader._closedPromise,function(){!1===preventClose?shutdownWithAction(function(){var JSCompiler_inline_result=writer._ownerWritableStream;var state=JSCompiler_inline_result._state;JSCompiler_inline_result=!0===WritableStreamCloseQueuedOrInFlight(JSCompiler_inline_result)||"closed"===state?originalPromiseResolve(void 0):"errored"===state?originalPromiseReject(JSCompiler_inline_result._storedError):
|
|
392
|
+
WritableStreamDefaultWriterClose(writer);return JSCompiler_inline_result}):shutdown()});if(!0===WritableStreamCloseQueuedOrInFlight(dest)||"closed"===dest._state){var destClosed_1=new TypeError("the destination writable stream closed before all data could be piped to it");!1===preventCancel?shutdownWithAction(function(){return ReadableStreamCancel(source,destClosed_1)},!0,destClosed_1):shutdown(!0,destClosed_1)}setPromiseIsHandledToTrue(function(){return newPromise(function(resolveLoop,rejectLoop){function next(done){done?
|
|
393
|
+
resolveLoop():PerformPromiseThen(pipeStep(),next,rejectLoop)}next(!1)})}())})}function IsReadableStreamDefaultController(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,"_controlledReadableStream")?!0:!1}function ReadableStreamDefaultControllerCallPullIfNeeded(controller){if(!1!==ReadableStreamDefaultControllerShouldCallPull(controller))if(!0===controller._pulling)controller._pullAgain=!0;else{controller._pulling=!0;var pullPromise=controller._pullAlgorithm();uponPromise(pullPromise,
|
|
394
|
+
function(){controller._pulling=!1;!0===controller._pullAgain&&(controller._pullAgain=!1,ReadableStreamDefaultControllerCallPullIfNeeded(controller))},function(e){ReadableStreamDefaultControllerError(controller,e)})}}function ReadableStreamDefaultControllerShouldCallPull(controller){var stream=controller._controlledReadableStream;return!1===ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)||!1===controller._started?!1:!0===IsReadableStreamLocked(stream)&&0<stream._reader._readRequests.length||
|
|
395
|
+
0<ReadableStreamDefaultControllerGetDesiredSize(controller)?!0:!1}function ReadableStreamDefaultControllerClearAlgorithms(controller){controller._pullAlgorithm=void 0;controller._cancelAlgorithm=void 0;controller._strategySizeAlgorithm=void 0}function ReadableStreamDefaultControllerClose(controller){var stream=controller._controlledReadableStream;controller._closeRequested=!0;0===controller._queue.length&&(ReadableStreamDefaultControllerClearAlgorithms(controller),ReadableStreamClose(stream))}function ReadableStreamDefaultControllerEnqueue(controller,
|
|
396
|
+
chunk){var stream=controller._controlledReadableStream;if(!0===IsReadableStreamLocked(stream)&&0<stream._reader._readRequests.length)ReadableStreamFulfillReadRequest(stream,chunk,!1);else{stream=void 0;try{stream=controller._strategySizeAlgorithm(chunk)}catch(chunkSizeE){throw ReadableStreamDefaultControllerError(controller,chunkSizeE),chunkSizeE;}try{EnqueueValueWithSize(controller,chunk,stream)}catch(enqueueE){throw ReadableStreamDefaultControllerError(controller,enqueueE),enqueueE;}}ReadableStreamDefaultControllerCallPullIfNeeded(controller)}
|
|
397
|
+
function ReadableStreamDefaultControllerError(controller,e){var stream=controller._controlledReadableStream;"readable"===stream._state&&(ResetQueue(controller),ReadableStreamDefaultControllerClearAlgorithms(controller),ReadableStreamError(stream,e))}function ReadableStreamDefaultControllerGetDesiredSize(controller){var state=controller._controlledReadableStream._state;return"errored"===state?null:"closed"===state?0:controller._strategyHWM-controller._queueTotalSize}function ReadableStreamDefaultControllerCanCloseOrEnqueue(controller){var state=
|
|
398
|
+
controller._controlledReadableStream._state;return!1===controller._closeRequested&&"readable"===state?!0:!1}function SetUpReadableStreamDefaultController(stream,controller,startAlgorithm,pullAlgorithm,cancelAlgorithm,highWaterMark,sizeAlgorithm){controller._controlledReadableStream=stream;controller._queue=void 0;controller._queueTotalSize=void 0;ResetQueue(controller);controller._started=!1;controller._closeRequested=!1;controller._pullAgain=!1;controller._pulling=!1;controller._strategySizeAlgorithm=
|
|
399
|
+
sizeAlgorithm;controller._strategyHWM=highWaterMark;controller._pullAlgorithm=pullAlgorithm;controller._cancelAlgorithm=cancelAlgorithm;stream._readableStreamController=controller;stream=startAlgorithm();uponPromise(originalPromiseResolve(stream),function(){controller._started=!0;ReadableStreamDefaultControllerCallPullIfNeeded(controller)},function(r){ReadableStreamDefaultControllerError(controller,r)})}function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream,underlyingSource,highWaterMark,
|
|
400
|
+
sizeAlgorithm){var controller=Object.create(ReadableStreamDefaultController$jscomp$0.prototype),pullAlgorithm=CreateAlgorithmFromUnderlyingMethod(underlyingSource,"pull",0,[controller]),cancelAlgorithm=CreateAlgorithmFromUnderlyingMethod(underlyingSource,"cancel",1,[]);SetUpReadableStreamDefaultController(stream,controller,function(){return InvokeOrNoop(underlyingSource,"start",[controller])},pullAlgorithm,cancelAlgorithm,highWaterMark,sizeAlgorithm)}function defaultControllerBrandCheckException(name){return new TypeError("ReadableStreamDefaultController.prototype."+
|
|
401
|
+
name+" can only be used on a ReadableStreamDefaultController")}function ReadableStreamTee(stream,cloneForBranch2){function pullAlgorithm(){if(!0===reading)return originalPromiseResolve(void 0);reading=!0;var readPromise=transformPromiseWith(ReadableStreamDefaultReaderRead(reader),function(result){reading=!1;!0===result.done?(!1===canceled1&&ReadableStreamDefaultControllerClose(branch1._readableStreamController),!1===canceled2&&ReadableStreamDefaultControllerClose(branch2._readableStreamController)):
|
|
402
|
+
(result=result.value,!1===canceled1&&ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController,result),!1===canceled2&&ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController,result))});setPromiseIsHandledToTrue(readPromise);return originalPromiseResolve(void 0)}function startAlgorithm(){}var reader=AcquireReadableStreamDefaultReader(stream),reading=!1,canceled1=!1,canceled2=!1,reason1,reason2,resolveCancelPromise,cancelPromise=newPromise(function(resolve){resolveCancelPromise=
|
|
403
|
+
resolve});var branch1=CreateReadableStream(startAlgorithm,pullAlgorithm,function(reason){canceled1=!0;reason1=reason;!0===canceled2&&(reason=[reason1,reason2].slice(),reason=ReadableStreamCancel(stream,reason),resolveCancelPromise(reason));return cancelPromise});var branch2=CreateReadableStream(startAlgorithm,pullAlgorithm,function(reason){canceled2=!0;reason2=reason;!0===canceled1&&(reason=[reason1,reason2].slice(),reason=ReadableStreamCancel(stream,reason),resolveCancelPromise(reason));return cancelPromise});
|
|
404
|
+
uponRejection(reader._closedPromise,function(r){ReadableStreamDefaultControllerError(branch1._readableStreamController,r);ReadableStreamDefaultControllerError(branch2._readableStreamController,r)});return[branch1,branch2]}function IsReadableByteStreamController(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,"_controlledReadableByteStream")?!0:!1}function IsReadableStreamBYOBRequest(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,"_associatedReadableByteStreamController")?
|
|
405
|
+
!0:!1}function ReadableByteStreamControllerCallPullIfNeeded(controller){if(!1!==ReadableByteStreamControllerShouldCallPull(controller))if(!0===controller._pulling)controller._pullAgain=!0;else{controller._pulling=!0;var pullPromise=controller._pullAlgorithm();uponPromise(pullPromise,function(){controller._pulling=!1;!0===controller._pullAgain&&(controller._pullAgain=!1,ReadableByteStreamControllerCallPullIfNeeded(controller))},function(e){ReadableByteStreamControllerError(controller,e)})}}function ReadableByteStreamControllerCommitPullIntoDescriptor(stream,
|
|
406
|
+
pullIntoDescriptor){var done=!1;"closed"===stream._state&&(done=!0);var filledView=new pullIntoDescriptor.ctor(pullIntoDescriptor.buffer,pullIntoDescriptor.byteOffset,pullIntoDescriptor.bytesFilled/pullIntoDescriptor.elementSize);"default"===pullIntoDescriptor.readerType?ReadableStreamFulfillReadRequest(stream,filledView,done):(pullIntoDescriptor=done,stream=stream._reader,stream._readIntoRequests.shift()._resolve(ReadableStreamCreateReadResult(filledView,pullIntoDescriptor,stream._forAuthorCode)))}
|
|
407
|
+
function ReadableByteStreamControllerEnqueueChunkToQueue(controller,buffer,byteOffset,byteLength){controller._queue.push({buffer:buffer,byteOffset:byteOffset,byteLength:byteLength});controller._queueTotalSize+=byteLength}function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller,pullIntoDescriptor){var elementSize=pullIntoDescriptor.elementSize,maxBytesToCopy=Math.min(controller._queueTotalSize,pullIntoDescriptor.byteLength-pullIntoDescriptor.bytesFilled),maxBytesFilled=pullIntoDescriptor.bytesFilled+
|
|
408
|
+
maxBytesToCopy,maxAlignedBytes=maxBytesFilled-maxBytesFilled%elementSize;maxBytesFilled=!1;maxAlignedBytes>pullIntoDescriptor.bytesFilled-pullIntoDescriptor.bytesFilled%elementSize&&(maxBytesToCopy=maxAlignedBytes-pullIntoDescriptor.bytesFilled,maxBytesFilled=!0);for(elementSize=controller._queue;0<maxBytesToCopy;){var headOfQueue=elementSize.peek();maxAlignedBytes=Math.min(maxBytesToCopy,headOfQueue.byteLength);var destOffset=pullIntoDescriptor.byteOffset+pullIntoDescriptor.bytesFilled,src=headOfQueue.buffer,
|
|
409
|
+
srcOffset=headOfQueue.byteOffset,n=maxAlignedBytes;(new Uint8Array(pullIntoDescriptor.buffer)).set(new Uint8Array(src,srcOffset,n),destOffset);headOfQueue.byteLength===maxAlignedBytes?elementSize.shift():(headOfQueue.byteOffset+=maxAlignedBytes,headOfQueue.byteLength-=maxAlignedBytes);controller._queueTotalSize-=maxAlignedBytes;headOfQueue=maxAlignedBytes;destOffset=pullIntoDescriptor;ReadableByteStreamControllerInvalidateBYOBRequest(controller);destOffset.bytesFilled+=headOfQueue;maxBytesToCopy-=
|
|
410
|
+
maxAlignedBytes}return maxBytesFilled}function ReadableByteStreamControllerHandleQueueDrain(controller){0===controller._queueTotalSize&&!0===controller._closeRequested?(ReadableByteStreamControllerClearAlgorithms(controller),ReadableStreamClose(controller._controlledReadableByteStream)):ReadableByteStreamControllerCallPullIfNeeded(controller)}function ReadableByteStreamControllerInvalidateBYOBRequest(controller){void 0!==controller._byobRequest&&(controller._byobRequest._associatedReadableByteStreamController=
|
|
411
|
+
void 0,controller._byobRequest._view=void 0,controller._byobRequest=void 0)}function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller){for(;0<controller._pendingPullIntos.length&&0!==controller._queueTotalSize;){var pullIntoDescriptor=controller._pendingPullIntos.peek();!0===ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller,pullIntoDescriptor)&&(ReadableByteStreamControllerShiftPendingPullInto(controller),ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream,
|
|
412
|
+
pullIntoDescriptor))}}function ReadableByteStreamControllerPullInto(controller,view){var stream=controller._controlledReadableByteStream,elementSize=1;view.constructor!==DataView&&(elementSize=view.constructor.BYTES_PER_ELEMENT);var ctor=view.constructor;view={buffer:view.buffer,byteOffset:view.byteOffset,byteLength:view.byteLength,bytesFilled:0,elementSize:elementSize,ctor:ctor,readerType:"byob"};if(0<controller._pendingPullIntos.length)return controller._pendingPullIntos.push(view),ReadableStreamAddReadIntoRequest(stream);
|
|
413
|
+
if("closed"===stream._state)return controller=new ctor(view.buffer,view.byteOffset,0),originalPromiseResolve(ReadableStreamCreateReadResult(controller,!0,stream._reader._forAuthorCode));if(0<controller._queueTotalSize){if(!0===ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller,view))return ctor=new view.ctor(view.buffer,view.byteOffset,view.bytesFilled/view.elementSize),ReadableByteStreamControllerHandleQueueDrain(controller),originalPromiseResolve(ReadableStreamCreateReadResult(ctor,
|
|
414
|
+
!1,stream._reader._forAuthorCode));if(!0===controller._closeRequested)return stream=new TypeError("Insufficient bytes to fill elements in the given buffer"),ReadableByteStreamControllerError(controller,stream),originalPromiseReject(stream)}controller._pendingPullIntos.push(view);stream=ReadableStreamAddReadIntoRequest(stream);ReadableByteStreamControllerCallPullIfNeeded(controller);return stream}function ReadableByteStreamControllerRespondInternal(controller,bytesWritten){var firstDescriptor=controller._pendingPullIntos.peek();
|
|
415
|
+
if("closed"===controller._controlledReadableByteStream._state){if(0!==bytesWritten)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");firstDescriptor.buffer=firstDescriptor.buffer;firstDescriptor=controller._controlledReadableByteStream;if(!0===ReadableStreamHasBYOBReader(firstDescriptor))for(;0<firstDescriptor._reader._readIntoRequests.length;)bytesWritten=ReadableByteStreamControllerShiftPendingPullInto(controller),ReadableByteStreamControllerCommitPullIntoDescriptor(firstDescriptor,
|
|
416
|
+
bytesWritten)}else{if(firstDescriptor.bytesFilled+bytesWritten>firstDescriptor.byteLength)throw new RangeError("bytesWritten out of range");ReadableByteStreamControllerInvalidateBYOBRequest(controller);firstDescriptor.bytesFilled+=bytesWritten;if(!(firstDescriptor.bytesFilled<firstDescriptor.elementSize)){ReadableByteStreamControllerShiftPendingPullInto(controller);bytesWritten=firstDescriptor.bytesFilled%firstDescriptor.elementSize;if(0<bytesWritten){var end=firstDescriptor.byteOffset+firstDescriptor.bytesFilled;
|
|
417
|
+
end=firstDescriptor.buffer.slice(end-bytesWritten,end);ReadableByteStreamControllerEnqueueChunkToQueue(controller,end,0,end.byteLength)}firstDescriptor.buffer=firstDescriptor.buffer;firstDescriptor.bytesFilled-=bytesWritten;ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream,firstDescriptor);ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller)}}ReadableByteStreamControllerCallPullIfNeeded(controller)}function ReadableByteStreamControllerShiftPendingPullInto(controller){var descriptor=
|
|
418
|
+
controller._pendingPullIntos.shift();ReadableByteStreamControllerInvalidateBYOBRequest(controller);return descriptor}function ReadableByteStreamControllerShouldCallPull(controller){var stream=controller._controlledReadableByteStream;return"readable"!==stream._state||!0===controller._closeRequested||!1===controller._started?!1:!0===ReadableStreamHasDefaultReader(stream)&&0<stream._reader._readRequests.length||!0===ReadableStreamHasBYOBReader(stream)&&0<stream._reader._readIntoRequests.length||0<ReadableByteStreamControllerGetDesiredSize(controller)?
|
|
419
|
+
!0:!1}function ReadableByteStreamControllerClearAlgorithms(controller){controller._pullAlgorithm=void 0;controller._cancelAlgorithm=void 0}function ReadableByteStreamControllerError(controller,e){var stream=controller._controlledReadableByteStream;"readable"===stream._state&&(ReadableByteStreamControllerInvalidateBYOBRequest(controller),controller._pendingPullIntos=new SimpleQueue,ResetQueue(controller),ReadableByteStreamControllerClearAlgorithms(controller),ReadableStreamError(stream,e))}function ReadableByteStreamControllerGetDesiredSize(controller){var state=
|
|
420
|
+
controller._controlledReadableByteStream._state;return"errored"===state?null:"closed"===state?0:controller._strategyHWM-controller._queueTotalSize}function SetUpReadableByteStreamController(stream,controller,startAlgorithm,pullAlgorithm,cancelAlgorithm,highWaterMark,autoAllocateChunkSize){controller._controlledReadableByteStream=stream;controller._pullAgain=!1;controller._pulling=!1;controller._byobRequest=void 0;controller._queue=controller._queueTotalSize=void 0;ResetQueue(controller);controller._closeRequested=
|
|
421
|
+
!1;controller._started=!1;controller._strategyHWM=ValidateAndNormalizeHighWaterMark(highWaterMark);controller._pullAlgorithm=pullAlgorithm;controller._cancelAlgorithm=cancelAlgorithm;controller._autoAllocateChunkSize=autoAllocateChunkSize;controller._pendingPullIntos=new SimpleQueue;stream._readableStreamController=controller;stream=startAlgorithm();uponPromise(originalPromiseResolve(stream),function(){controller._started=!0;ReadableByteStreamControllerCallPullIfNeeded(controller)},function(r){ReadableByteStreamControllerError(controller,
|
|
422
|
+
r)})}function SetUpReadableByteStreamControllerFromUnderlyingSource(stream,underlyingByteSource,highWaterMark){var controller=Object.create(ReadableByteStreamController$jscomp$0.prototype),pullAlgorithm=CreateAlgorithmFromUnderlyingMethod(underlyingByteSource,"pull",0,[controller]),cancelAlgorithm=CreateAlgorithmFromUnderlyingMethod(underlyingByteSource,"cancel",1,[]),autoAllocateChunkSize=underlyingByteSource.autoAllocateChunkSize;if(void 0!==autoAllocateChunkSize&&(autoAllocateChunkSize=Number(autoAllocateChunkSize),
|
|
423
|
+
!1===NumberIsInteger(autoAllocateChunkSize)||0>=autoAllocateChunkSize))throw new RangeError("autoAllocateChunkSize must be a positive integer");SetUpReadableByteStreamController(stream,controller,function(){return InvokeOrNoop(underlyingByteSource,"start",[controller])},pullAlgorithm,cancelAlgorithm,highWaterMark,autoAllocateChunkSize)}function byobRequestBrandCheckException(name){return new TypeError("ReadableStreamBYOBRequest.prototype."+name+" can only be used on a ReadableStreamBYOBRequest")}
|
|
424
|
+
function byteStreamControllerBrandCheckException(name){return new TypeError("ReadableByteStreamController.prototype."+name+" can only be used on a ReadableByteStreamController")}function ReadableStreamAddReadIntoRequest(stream){return newPromise(function(resolve,reject){stream._reader._readIntoRequests.push({_resolve:resolve,_reject:reject})})}function ReadableStreamHasBYOBReader(stream){stream=stream._reader;return void 0!==stream&&IsReadableStreamBYOBReader(stream)?!0:!1}function IsReadableStreamBYOBReader(x){return typeIsObject(x)&&
|
|
425
|
+
Object.prototype.hasOwnProperty.call(x,"_readIntoRequests")?!0:!1}function byobReaderBrandCheckException(name){return new TypeError("ReadableStreamBYOBReader.prototype."+name+" can only be used on a ReadableStreamBYOBReader")}function CreateReadableStream(startAlgorithm,pullAlgorithm,cancelAlgorithm,highWaterMark,sizeAlgorithm){void 0===highWaterMark&&(highWaterMark=1);void 0===sizeAlgorithm&&(sizeAlgorithm=function(){return 1});var stream=Object.create(ReadableStream$jscomp$0.prototype);InitializeReadableStream(stream);
|
|
426
|
+
var controller=Object.create(ReadableStreamDefaultController$jscomp$0.prototype);SetUpReadableStreamDefaultController(stream,controller,startAlgorithm,pullAlgorithm,cancelAlgorithm,highWaterMark,sizeAlgorithm);return stream}function InitializeReadableStream(stream){stream._state="readable";stream._reader=void 0;stream._storedError=void 0;stream._disturbed=!1}function IsReadableStream(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,"_readableStreamController")?!0:!1}function IsReadableStreamLocked(stream){return void 0===
|
|
427
|
+
stream._reader?!1:!0}function ReadableStreamCancel(stream,reason){stream._disturbed=!0;if("closed"===stream._state)return originalPromiseResolve(void 0);if("errored"===stream._state)return originalPromiseReject(stream._storedError);ReadableStreamClose(stream);stream=stream._readableStreamController[CancelSteps](reason);return PerformPromiseThen(stream,noop,void 0)}function ReadableStreamClose(stream){stream._state="closed";var reader=stream._reader;void 0!==reader&&(IsReadableStreamDefaultReader(reader)&&
|
|
428
|
+
(reader._readRequests.forEach(function(readRequest){readRequest._resolve(ReadableStreamCreateReadResult(void 0,!0,reader._forAuthorCode))}),reader._readRequests=new SimpleQueue),defaultReaderClosedPromiseResolve(reader))}function ReadableStreamError(stream,e){stream._state="errored";stream._storedError=e;stream=stream._reader;void 0!==stream&&(IsReadableStreamDefaultReader(stream)?(stream._readRequests.forEach(function(readRequest){readRequest._reject(e)}),stream._readRequests=new SimpleQueue):(stream._readIntoRequests.forEach(function(readIntoRequest){readIntoRequest._reject(e)}),
|
|
429
|
+
stream._readIntoRequests=new SimpleQueue),defaultReaderClosedPromiseReject(stream,e))}function streamBrandCheckException$1(name){return new TypeError("ReadableStream.prototype."+name+" can only be used on a ReadableStream")}function InitializeTransformStream(stream,startPromise,writableHighWaterMark,writableSizeAlgorithm,readableHighWaterMark,readableSizeAlgorithm){function startAlgorithm(){return startPromise}stream._writable=CreateWritableStream(startAlgorithm,function(chunk){return TransformStreamDefaultSinkWriteAlgorithm(stream,
|
|
430
|
+
chunk)},function(){return TransformStreamDefaultSinkCloseAlgorithm(stream)},function(reason){TransformStreamError(stream,reason);return originalPromiseResolve(void 0)},writableHighWaterMark,writableSizeAlgorithm);stream._readable=CreateReadableStream(startAlgorithm,function(){TransformStreamSetBackpressure(stream,!1);return stream._backpressureChangePromise},function(reason){TransformStreamErrorWritableAndUnblockWrite(stream,reason);return originalPromiseResolve(void 0)},readableHighWaterMark,readableSizeAlgorithm);
|
|
431
|
+
stream._backpressure=void 0;stream._backpressureChangePromise=void 0;stream._backpressureChangePromise_resolve=void 0;TransformStreamSetBackpressure(stream,!0);stream._transformStreamController=void 0}function IsTransformStream(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,"_transformStreamController")?!0:!1}function TransformStreamError(stream,e){ReadableStreamDefaultControllerError(stream._readable._readableStreamController,e);TransformStreamErrorWritableAndUnblockWrite(stream,
|
|
432
|
+
e)}function TransformStreamErrorWritableAndUnblockWrite(stream,e){TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController,e);!0===stream._backpressure&&TransformStreamSetBackpressure(stream,!1)}function TransformStreamSetBackpressure(stream,backpressure){void 0!==stream._backpressureChangePromise&&stream._backpressureChangePromise_resolve();stream._backpressureChangePromise=newPromise(function(resolve){stream._backpressureChangePromise_resolve=
|
|
433
|
+
resolve});stream._backpressure=backpressure}function IsTransformStreamDefaultController(x){return typeIsObject(x)&&Object.prototype.hasOwnProperty.call(x,"_controlledTransformStream")?!0:!1}function SetUpTransformStreamDefaultController(stream,controller,transformAlgorithm,flushAlgorithm){controller._controlledTransformStream=stream;stream._transformStreamController=controller;controller._transformAlgorithm=transformAlgorithm;controller._flushAlgorithm=flushAlgorithm}function SetUpTransformStreamDefaultControllerFromTransformer(stream,
|
|
422
434
|
transformer){var controller=Object.create(TransformStreamDefaultController$jscomp$0.prototype),transformAlgorithm=function(chunk){try{return TransformStreamDefaultControllerEnqueue(controller,chunk),originalPromiseResolve(void 0)}catch(transformResultE){return originalPromiseReject(transformResultE)}},transformMethod=transformer.transform;if(void 0!==transformMethod){if("function"!==typeof transformMethod)throw new TypeError("transform is not a method");transformAlgorithm=function(chunk){return PromiseCall(transformMethod,
|
|
423
435
|
transformer,[chunk,controller])}}var flushAlgorithm=CreateAlgorithmFromUnderlyingMethod(transformer,"flush",0,[controller]);SetUpTransformStreamDefaultController(stream,controller,transformAlgorithm,flushAlgorithm)}function TransformStreamDefaultControllerClearAlgorithms(controller){controller._transformAlgorithm=void 0;controller._flushAlgorithm=void 0}function TransformStreamDefaultControllerEnqueue(controller,chunk){controller=controller._controlledTransformStream;var readableController=controller._readable._readableStreamController;
|
|
424
436
|
if(!1===ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController))throw new TypeError("Readable side is not in a state that permits enqueue");try{ReadableStreamDefaultControllerEnqueue(readableController,chunk)}catch(e){throw TransformStreamErrorWritableAndUnblockWrite(controller,e),controller._readable._storedError;}chunk=!0===ReadableStreamDefaultControllerShouldCallPull(readableController)?!1:!0;chunk!==controller._backpressure&&TransformStreamSetBackpressure(controller,!0)}function TransformStreamDefaultControllerPerformTransform(controller,
|
|
@@ -426,24 +438,24 @@ chunk){chunk=controller._transformAlgorithm(chunk);return transformPromiseWith(c
|
|
|
426
438
|
chunk)}):TransformStreamDefaultControllerPerformTransform(controller,chunk)}function TransformStreamDefaultSinkCloseAlgorithm(stream){var readable=stream._readable,controller=stream._transformStreamController,flushPromise=controller._flushAlgorithm();TransformStreamDefaultControllerClearAlgorithms(controller);return transformPromiseWith(flushPromise,function(){if("errored"===readable._state)throw readable._storedError;var readableController=readable._readableStreamController;!0===ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)&&
|
|
427
439
|
ReadableStreamDefaultControllerClose(readableController)},function(r){TransformStreamError(stream,r);throw readable._storedError;})}function defaultControllerBrandCheckException$1(name){return new TypeError("TransformStreamDefaultController.prototype."+name+" can only be used on a TransformStreamDefaultController")}function streamBrandCheckException$2(name){return new TypeError("TransformStream.prototype."+name+" can only be used on a TransformStream")}__w_pdfjs_require__.r(__webpack_exports__);__w_pdfjs_require__.d(__webpack_exports__,
|
|
428
440
|
"ByteLengthQueuingStrategy",function(){return ByteLengthQueuingStrategy$jscomp$0});__w_pdfjs_require__.d(__webpack_exports__,"CountQueuingStrategy",function(){return CountQueuingStrategy$jscomp$0});__w_pdfjs_require__.d(__webpack_exports__,"ReadableStream",function(){return ReadableStream$jscomp$0});__w_pdfjs_require__.d(__webpack_exports__,"TransformStream",function(){return TransformStream$jscomp$0});__w_pdfjs_require__.d(__webpack_exports__,"WritableStream",function(){return WritableStream$jscomp$0});
|
|
429
|
-
var SymbolPolyfill="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?Symbol:function(description){return"Symbol("+description+")"},NumberIsNaN=Number.isNaN||function(x){return x!==x},rethrowAssertionErrorRejection=noop,originalPromise=Promise,originalPromiseThen=Promise.prototype.then,originalPromiseResolve=Promise.resolve.bind(originalPromise),originalPromiseReject=Promise.reject.bind(originalPromise),SimpleQueue=function(){function SimpleQueue(){this.
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
{
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
"
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
441
|
+
var SymbolPolyfill="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?Symbol:function(description){return"Symbol("+description+")"},NumberIsNaN=Number.isNaN||function(x){return x!==x},rethrowAssertionErrorRejection=noop,originalPromise=Promise,originalPromiseThen=Promise.prototype.then,originalPromiseResolve=Promise.resolve.bind(originalPromise),originalPromiseReject=Promise.reject.bind(originalPromise),SimpleQueue=function(){function SimpleQueue(){this._back=this._front={_elements:[],
|
|
442
|
+
_next:void 0};this._size=this._cursor=0}Object.defineProperty(SimpleQueue.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0});SimpleQueue.prototype.push=function(element){var oldBack=this._back,newBack=oldBack;16383===oldBack._elements.length&&(newBack={_elements:[],_next:void 0});oldBack._elements.push(element);newBack!==oldBack&&(this._back=newBack,oldBack._next=newBack);++this._size};SimpleQueue.prototype.shift=function(){var oldFront=this._front,newFront=oldFront,
|
|
443
|
+
oldCursor=this._cursor,newCursor=oldCursor+1,elements=oldFront._elements,element=elements[oldCursor];16384===newCursor&&(newFront=oldFront._next,newCursor=0);--this._size;this._cursor=newCursor;oldFront!==newFront&&(this._front=newFront);elements[oldCursor]=void 0;return element};SimpleQueue.prototype.forEach=function(callback){for(var i=this._cursor,node=this._front,elements=node._elements;!(i===elements.length&&void 0===node._next||i===elements.length&&(node=node._next,elements=node._elements,i=
|
|
444
|
+
0,0===elements.length));)callback(elements[i]),++i};SimpleQueue.prototype.peek=function(){return this._front._elements[this._cursor]};return SimpleQueue}(),CancelSteps=SymbolPolyfill("[[CancelSteps]]"),PullSteps=SymbolPolyfill("[[PullSteps]]"),ReadableStreamDefaultReader$jscomp$0=function(){function ReadableStreamDefaultReader(stream){if(!1===IsReadableStream(stream))throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===IsReadableStreamLocked(stream))throw new TypeError("This stream has already been locked for exclusive reading by another reader");
|
|
445
|
+
ReadableStreamReaderGenericInitialize(this,stream);this._readRequests=new SimpleQueue}Object.defineProperty(ReadableStreamDefaultReader.prototype,"closed",{get:function(){return IsReadableStreamDefaultReader(this)?this._closedPromise:originalPromiseReject(defaultReaderBrandCheckException("closed"))},enumerable:!0,configurable:!0});ReadableStreamDefaultReader.prototype.cancel=function(reason){return IsReadableStreamDefaultReader(this)?void 0===this._ownerReadableStream?originalPromiseReject(readerLockException("cancel")):
|
|
446
|
+
ReadableStreamCancel(this._ownerReadableStream,reason):originalPromiseReject(defaultReaderBrandCheckException("cancel"))};ReadableStreamDefaultReader.prototype.read=function(){return IsReadableStreamDefaultReader(this)?void 0===this._ownerReadableStream?originalPromiseReject(readerLockException("read from")):ReadableStreamDefaultReaderRead(this):originalPromiseReject(defaultReaderBrandCheckException("read"))};ReadableStreamDefaultReader.prototype.releaseLock=function(){if(!IsReadableStreamDefaultReader(this))throw defaultReaderBrandCheckException("releaseLock");
|
|
447
|
+
if(void 0!==this._ownerReadableStream){if(0<this._readRequests.length)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");ReadableStreamReaderGenericRelease(this)}};return ReadableStreamDefaultReader}(),_a;if("symbol"===_typeof2(SymbolPolyfill.asyncIterator)){var AsyncIteratorPrototype=(_a={},_a[SymbolPolyfill.asyncIterator]=function(){return this},_a);Object.defineProperty(AsyncIteratorPrototype,SymbolPolyfill.asyncIterator,{enumerable:!1})}var ReadableStreamAsyncIteratorPrototype=
|
|
448
|
+
{next:function(){if(!1===IsReadableStreamAsyncIterator(this))return originalPromiseReject(streamAsyncIteratorBrandCheckException("next"));var reader=this._asyncIteratorReader;return void 0===reader._ownerReadableStream?originalPromiseReject(readerLockException("iterate")):transformPromiseWith(ReadableStreamDefaultReaderRead(reader),function(result){var done=result.done;done&&ReadableStreamReaderGenericRelease(reader);return ReadableStreamCreateReadResult(result.value,done,!0)})},"return":function(value){if(!1===
|
|
449
|
+
IsReadableStreamAsyncIterator(this))return originalPromiseReject(streamAsyncIteratorBrandCheckException("next"));var reader=this._asyncIteratorReader;if(void 0===reader._ownerReadableStream)return originalPromiseReject(readerLockException("finish iterating"));if(0<reader._readRequests.length)return originalPromiseReject(new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this._preventCancel){var result=ReadableStreamCancel(reader._ownerReadableStream,
|
|
450
|
+
value);ReadableStreamReaderGenericRelease(reader);return transformPromiseWith(result,function(){return ReadableStreamCreateReadResult(value,!0,!0)})}ReadableStreamReaderGenericRelease(reader);return originalPromiseResolve(ReadableStreamCreateReadResult(value,!0,!0))}};void 0!==AsyncIteratorPrototype&&Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype,AsyncIteratorPrototype);Object.defineProperty(ReadableStreamAsyncIteratorPrototype,"next",{enumerable:!1});Object.defineProperty(ReadableStreamAsyncIteratorPrototype,
|
|
451
|
+
"return",{enumerable:!1});var AbortSteps=SymbolPolyfill("[[AbortSteps]]"),ErrorSteps=SymbolPolyfill("[[ErrorSteps]]"),WritableStream$jscomp$0=function(){function WritableStream(underlyingSink,strategy){void 0===underlyingSink&&(underlyingSink={});void 0===strategy&&(strategy={});InitializeWritableStream(this);var size=strategy.size;strategy=strategy.highWaterMark;if(void 0!==underlyingSink.type)throw new RangeError("Invalid type is specified");size=MakeSizeAlgorithmFromSizeFunction(size);void 0===
|
|
452
|
+
strategy&&(strategy=1);strategy=ValidateAndNormalizeHighWaterMark(strategy);SetUpWritableStreamDefaultControllerFromUnderlyingSink(this,underlyingSink,strategy,size)}Object.defineProperty(WritableStream.prototype,"locked",{get:function(){if(!1===IsWritableStream(this))throw streamBrandCheckException("locked");return IsWritableStreamLocked(this)},enumerable:!0,configurable:!0});WritableStream.prototype.abort=function(reason){return!1===IsWritableStream(this)?originalPromiseReject(streamBrandCheckException("abort")):
|
|
453
|
+
!0===IsWritableStreamLocked(this)?originalPromiseReject(new TypeError("Cannot abort a stream that already has a writer")):WritableStreamAbort(this,reason)};WritableStream.prototype.getWriter=function(){if(!1===IsWritableStream(this))throw streamBrandCheckException("getWriter");return new WritableStreamDefaultWriter$jscomp$0(this)};return WritableStream}(),WritableStreamDefaultWriter$jscomp$0=function(){function WritableStreamDefaultWriter(stream){if(!1===IsWritableStream(stream))throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");
|
|
454
|
+
if(!0===IsWritableStreamLocked(stream))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=stream;stream._writer=this;var state=stream._state;"writable"===state?(!1===WritableStreamCloseQueuedOrInFlight(stream)&&!0===stream._backpressure?defaultWriterReadyPromiseInitialize(this):(defaultWriterReadyPromiseInitialize(this),defaultWriterReadyPromiseResolve(this)),defaultWriterClosedPromiseInitialize(this)):"erroring"===state?(stream=
|
|
455
|
+
stream._storedError,defaultWriterReadyPromiseInitialize(this),defaultWriterReadyPromiseReject(this,stream),defaultWriterClosedPromiseInitialize(this)):"closed"===state?(defaultWriterReadyPromiseInitialize(this),defaultWriterReadyPromiseResolve(this),defaultWriterClosedPromiseInitialize(this),defaultWriterClosedPromiseResolve(this)):(stream=stream._storedError,defaultWriterReadyPromiseInitialize(this),defaultWriterReadyPromiseReject(this,stream),defaultWriterClosedPromiseInitialize(this),defaultWriterClosedPromiseReject(this,
|
|
456
|
+
stream))}Object.defineProperty(WritableStreamDefaultWriter.prototype,"closed",{get:function(){return!1===IsWritableStreamDefaultWriter(this)?originalPromiseReject(defaultWriterBrandCheckException("closed")):this._closedPromise},enumerable:!0,configurable:!0});Object.defineProperty(WritableStreamDefaultWriter.prototype,"desiredSize",{get:function(){if(!1===IsWritableStreamDefaultWriter(this))throw defaultWriterBrandCheckException("desiredSize");if(void 0===this._ownerWritableStream)throw defaultWriterLockException("desiredSize");
|
|
457
|
+
var stream=this._ownerWritableStream,state=stream._state;"errored"===state||"erroring"===state?stream=null:"closed"===state?stream=0:(stream=stream._writableStreamController,stream=stream._strategyHWM-stream._queueTotalSize);return stream},enumerable:!0,configurable:!0});Object.defineProperty(WritableStreamDefaultWriter.prototype,"ready",{get:function(){return!1===IsWritableStreamDefaultWriter(this)?originalPromiseReject(defaultWriterBrandCheckException("ready")):this._readyPromise},enumerable:!0,
|
|
458
|
+
configurable:!0});WritableStreamDefaultWriter.prototype.abort=function(reason){return!1===IsWritableStreamDefaultWriter(this)?originalPromiseReject(defaultWriterBrandCheckException("abort")):void 0===this._ownerWritableStream?originalPromiseReject(defaultWriterLockException("abort")):WritableStreamAbort(this._ownerWritableStream,reason)};WritableStreamDefaultWriter.prototype.close=function(){if(!1===IsWritableStreamDefaultWriter(this))return originalPromiseReject(defaultWriterBrandCheckException("close"));
|
|
447
459
|
var stream=this._ownerWritableStream;return void 0===stream?originalPromiseReject(defaultWriterLockException("close")):!0===WritableStreamCloseQueuedOrInFlight(stream)?originalPromiseReject(new TypeError("cannot close an already-closing stream")):WritableStreamDefaultWriterClose(this)};WritableStreamDefaultWriter.prototype.releaseLock=function(){if(!1===IsWritableStreamDefaultWriter(this))throw defaultWriterBrandCheckException("releaseLock");void 0!==this._ownerWritableStream&&WritableStreamDefaultWriterRelease(this)};
|
|
448
460
|
WritableStreamDefaultWriter.prototype.write=function(chunk){return!1===IsWritableStreamDefaultWriter(this)?originalPromiseReject(defaultWriterBrandCheckException("write")):void 0===this._ownerWritableStream?originalPromiseReject(defaultWriterLockException("write to")):WritableStreamDefaultWriterWrite(this,chunk)};return WritableStreamDefaultWriter}(),WritableStreamDefaultController$jscomp$0=function(){function WritableStreamDefaultController(){throw new TypeError("WritableStreamDefaultController cannot be constructed explicitly");
|
|
449
461
|
}WritableStreamDefaultController.prototype.error=function(e){var JSCompiler_inline_result=typeIsObject(this)?Object.prototype.hasOwnProperty.call(this,"_controlledWritableStream")?!0:!1:!1;if(!1===JSCompiler_inline_result)throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&(JSCompiler_inline_result=this._controlledWritableStream,WritableStreamDefaultControllerClearAlgorithms(this),
|
|
@@ -613,17 +625,17 @@ null!=_i["return"])_i["return"]()}finally{if(_d)throw _e;}}}else JSCompiler_temp
|
|
|
613
625
|
intent&&annotation.viewable||"print"===intent&&annotation.printable}function find(stream,signature){var backwards=3<arguments.length&&void 0!==arguments[3]?arguments[3]:!1,signatureLength=signature.length,scanBytes=stream.peekBytes(2<arguments.length&&void 0!==arguments[2]?arguments[2]:1024),scanLength=scanBytes.length-signatureLength;if(0>=scanLength)return!1;if(backwards)for(scanLength=signatureLength-1,backwards=scanBytes.length-1;backwards>=scanLength;){for(var j=0;j<signatureLength&&scanBytes[backwards-
|
|
614
626
|
j]===signature[scanLength-j];)j++;if(j>=signatureLength)return stream.pos+=backwards-scanLength,!0;backwards--}else for(backwards=0;backwards<=scanLength;){for(j=0;j<signatureLength&&scanBytes[backwards+j]===signature[j];)j++;if(j>=signatureLength)return stream.pos+=backwards,!0;backwards++}return!1}Object.defineProperty(exports,"__esModule",{value:!0});exports.PDFDocument=exports.Page=void 0;var _regenerator=function(obj){return obj&&obj.__esModule?obj:{"default":obj}}(__w_pdfjs_require__(2)),_util=
|
|
615
627
|
__w_pdfjs_require__(5),_obj=__w_pdfjs_require__(193),_primitives=__w_pdfjs_require__(188),_core_utils=__w_pdfjs_require__(191),_stream2=__w_pdfjs_require__(195),_annotation=__w_pdfjs_require__(207),_crypto=__w_pdfjs_require__(205),_parser=__w_pdfjs_require__(194),_operator_list=__w_pdfjs_require__(208),_evaluator=__w_pdfjs_require__(209),_function=__w_pdfjs_require__(223),LETTER_SIZE_MEDIABOX=[0,0,612,792],Page=function(){function Page(_ref){var pdfManager=_ref.pdfManager,xref=_ref.xref,pageIndex=
|
|
616
|
-
_ref.pageIndex,pageDict=_ref.pageDict,ref=_ref.ref,fontCache=_ref.fontCache,builtInCMapCache=_ref.builtInCMapCache;_ref=_ref.pdfFunctionFactory;_classCallCheck(this,Page);this.pdfManager=pdfManager;this.pageIndex=pageIndex;this.pageDict=pageDict;this.xref=xref;this.ref=ref;this.fontCache=fontCache;this.builtInCMapCache=builtInCMapCache;this.pdfFunctionFactory=_ref;this.evaluatorOptions=pdfManager.evaluatorOptions;this.resourcesPromise=null;var
|
|
617
|
-
"_").concat(++
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
628
|
+
_ref.pageIndex,pageDict=_ref.pageDict,ref=_ref.ref,fontCache=_ref.fontCache,builtInCMapCache=_ref.builtInCMapCache;_ref=_ref.pdfFunctionFactory;_classCallCheck(this,Page);this.pdfManager=pdfManager;this.pageIndex=pageIndex;this.pageDict=pageDict;this.xref=xref;this.ref=ref;this.fontCache=fontCache;this.builtInCMapCache=builtInCMapCache;this.pdfFunctionFactory=_ref;this.evaluatorOptions=pdfManager.evaluatorOptions;this.resourcesPromise=null;var JSCompiler_object_inline_obj_1327=0;this.idFactory={createObjId:function(){return"p".concat(pageIndex,
|
|
629
|
+
"_").concat(++JSCompiler_object_inline_obj_1327)},getDocId:function(){return"g_".concat(pdfManager.docId)}}}_createClass(Page,[{key:"_getInheritableProperty",value:function(key){var value=(0,_core_utils.getInheritableProperty)({dict:this.pageDict,key:key,getArray:1<arguments.length&&void 0!==arguments[1]?arguments[1]:!1,stopWhenFound:!1});return Array.isArray(value)?1!==value.length&&(0,_primitives.isDict)(value[0])?_primitives.Dict.merge(this.xref,value):value[0]:value}},{key:"_getBoundingBox",value:function(name){var box=
|
|
630
|
+
this._getInheritableProperty(name,!0);if(Array.isArray(box)&&4===box.length){if(0!==box[2]-box[0]&&0!==box[3]-box[1])return box;(0,_util.warn)("Empty /".concat(name," entry."))}return null}},{key:"getContentStream",value:function(){var content=this.content;if(Array.isArray(content)){var xref=this.xref,streams=[],_iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _iterator=content[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=
|
|
631
|
+
!0)streams.push(xref.fetchIfRef(_step.value))}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&null!=_iterator["return"])_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}content=new _stream2.StreamsSequenceStream(streams)}else content=(0,_primitives.isStream)(content)?content:new _stream2.NullStream;return content}},{key:"loadResources",value:function(keys){var _this=this;this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,
|
|
632
|
+
"resources"));return this.resourcesPromise.then(function(){return(new _obj.ObjectLoader(_this.resources,keys,_this.xref)).load()})}},{key:"getOperatorList",value:function(_ref2){var _this2=this,handler=_ref2.handler,sink=_ref2.sink,task=_ref2.task,intent=_ref2.intent,renderInteractiveForms=_ref2.renderInteractiveForms;_ref2=this.pdfManager.ensure(this,"getContentStream");var resourcesPromise=this.loadResources("ExtGState ColorSpace Pattern Shading XObject Font".split(" ")),partialEvaluator=new _evaluator.PartialEvaluator({xref:this.xref,
|
|
633
|
+
handler:handler,pageIndex:this.pageIndex,idFactory:this.idFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,options:this.evaluatorOptions,pdfFunctionFactory:this.pdfFunctionFactory});_ref2=Promise.all([_ref2,resourcesPromise]).then(function(_ref3){_ref3=_slicedToArray(_ref3,1)[0];var opList=new _operator_list.OperatorList(intent,sink,_this2.pageIndex);handler.send("StartRenderPage",{transparency:partialEvaluator.hasBlendModes(_this2.resources),pageIndex:_this2.pageIndex,intent:intent});
|
|
634
|
+
return partialEvaluator.getOperatorList({stream:_ref3,task:task,resources:_this2.resources,operatorList:opList}).then(function(){return opList})});return Promise.all([_ref2,this._parsedAnnotations]).then(function(_ref5){_ref5=_slicedToArray(_ref5,2);var pageOpList=_ref5[0];_ref5=_ref5[1];if(0===_ref5.length)return pageOpList.flush(!0),{length:pageOpList.totalLength};var opListPromises=[],_iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _iterator2=_ref5[Symbol.iterator](),
|
|
635
|
+
_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0){var annotation=_step2.value;isAnnotationRenderable(annotation,intent)&&opListPromises.push(annotation.getOperatorList(partialEvaluator,task,renderInteractiveForms))}}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&null!=_iterator2["return"])_iterator2["return"]()}finally{if(_didIteratorError2)throw _iteratorError2;}}return Promise.all(opListPromises).then(function(opLists){pageOpList.addOp(_util.OPS.beginAnnotations,
|
|
636
|
+
[]);var _iteratorNormalCompletion3=!0,_didIteratorError3=!1,_iteratorError3=void 0;try{for(var _iterator3=opLists[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=!0)pageOpList.addOpList(_step3.value)}catch(err$7){_didIteratorError3=!0,_iteratorError3=err$7}finally{try{if(!_iteratorNormalCompletion3&&null!=_iterator3["return"])_iterator3["return"]()}finally{if(_didIteratorError3)throw _iteratorError3;}}pageOpList.addOp(_util.OPS.endAnnotations,
|
|
637
|
+
[]);pageOpList.flush(!0);return{length:pageOpList.totalLength}})})}},{key:"extractTextContent",value:function(_ref7){var _this3=this,handler=_ref7.handler,task=_ref7.task,normalizeWhitespace=_ref7.normalizeWhitespace,sink=_ref7.sink,combineTextItems=_ref7.combineTextItems;_ref7=this.pdfManager.ensure(this,"getContentStream");var resourcesPromise=this.loadResources(["ExtGState","XObject","Font"]);return Promise.all([_ref7,resourcesPromise]).then(function(_ref8){_ref8=_slicedToArray(_ref8,1)[0];return(new _evaluator.PartialEvaluator({xref:_this3.xref,
|
|
638
|
+
handler:handler,pageIndex:_this3.pageIndex,idFactory:_this3.idFactory,fontCache:_this3.fontCache,builtInCMapCache:_this3.builtInCMapCache,options:_this3.evaluatorOptions,pdfFunctionFactory:_this3.pdfFunctionFactory})).getTextContent({stream:_ref8,task:task,resources:_this3.resources,normalizeWhitespace:normalizeWhitespace,combineTextItems:combineTextItems,sink:sink})})}},{key:"getAnnotationsData",value:function(intent){return this._parsedAnnotations.then(function(annotations){for(var annotationsData=
|
|
627
639
|
[],i=0,ii=annotations.length;i<ii;i++)intent&&!isAnnotationRenderable(annotations[i],intent)||annotationsData.push(annotations[i].data);return annotationsData})}},{key:"content",get:function(){return this.pageDict.get("Contents")}},{key:"resources",get:function(){return(0,_util.shadow)(this,"resources",this._getInheritableProperty("Resources")||_primitives.Dict.empty)}},{key:"mediaBox",get:function(){return(0,_util.shadow)(this,"mediaBox",this._getBoundingBox("MediaBox")||LETTER_SIZE_MEDIABOX)}},
|
|
628
640
|
{key:"cropBox",get:function(){return(0,_util.shadow)(this,"cropBox",this._getBoundingBox("CropBox")||this.mediaBox)}},{key:"userUnit",get:function(){var obj=this.pageDict.get("UserUnit");if(!(0,_util.isNum)(obj)||0>=obj)obj=1;return(0,_util.shadow)(this,"userUnit",obj)}},{key:"view",get:function(){var cropBox=this.cropBox,mediaBox=this.mediaBox;if(cropBox===mediaBox||(0,_util.isArrayEqual)(cropBox,mediaBox))var view=mediaBox;else(cropBox=_util.Util.intersect(cropBox,mediaBox))&&0!==cropBox[2]-cropBox[0]&&
|
|
629
641
|
0!==cropBox[3]-cropBox[1]?view=cropBox:(0,_util.warn)("Empty /CropBox and /MediaBox intersection.");return(0,_util.shadow)(this,"view",view||mediaBox)}},{key:"rotate",get:function(){var rotate=this._getInheritableProperty("Rotate")||0;0!==rotate%90?rotate=0:360<=rotate?rotate%=360:0>rotate&&(rotate=(rotate%360+360)%360);return(0,_util.shadow)(this,"rotate",rotate)}},{key:"annotations",get:function(){return(0,_util.shadow)(this,"annotations",this._getInheritableProperty("Annots")||[])}},{key:"_parsedAnnotations",
|
|
@@ -641,45 +653,44 @@ var catalog=this.catalog,linearization=this.linearization;linearization=lineariz
|
|
|
641
653
|
{key:"checkFirstPage",value:function(){var _this6=this;return this.getPage(0)["catch"](function(){var _ref12=_asyncToGenerator(_regenerator["default"].mark(function _callee(reason){return _regenerator["default"].wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(!(reason instanceof _core_utils.XRefEntryException)){_context.next=5;break}_this6._pagePromises.length=0;_context.next=4;return _this6.cleanup();case 4:throw new _core_utils.XRefParseException;case 5:case "end":return _context.stop()}},
|
|
642
654
|
_callee)}));return function(_x){return _ref12.apply(this,arguments)}}())}},{key:"fontFallback",value:function(id,handler){return this.catalog.fontFallback(id,handler)}},{key:"cleanup",value:function(){return this.catalog.cleanup()}},{key:"linearization",get:function(){var linearization=null;try{linearization=_parser.Linearization.create(this.stream)}catch(err){if(err instanceof _core_utils.MissingDataException)throw err;(0,_util.info)(err)}return(0,_util.shadow)(this,"linearization",linearization)}},
|
|
643
655
|
{key:"startXRef",get:function(){var stream=this.stream,startXRef=0;if(this.linearization)stream.reset(),find(stream,ENDOBJ_SIGNATURE)&&(startXRef=stream.pos+6-stream.start);else{for(var startXRefLength=STARTXREF_SIGNATURE.length,found=!1,pos=stream.end;!found&&0<pos;)pos-=1024-startXRefLength,0>pos&&(pos=0),stream.pos=pos,found=find(stream,STARTXREF_SIGNATURE,1024,!0);if(found){stream.skip(9);do startXRef=stream.getByte();while((0,_util.isSpace)(startXRef));for(startXRefLength="";32<=startXRef&&57>=
|
|
644
|
-
startXRef;)startXRefLength+=String.fromCharCode(startXRef),startXRef=stream.getByte();startXRef=parseInt(startXRefLength,10);isNaN(startXRef)&&(startXRef=0)}}return(0,_util.shadow)(this,"startXRef",startXRef)}},{key:"numPages",get:function(){var linearization=this.linearization;
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
Object.
|
|
651
|
-
p
|
|
652
|
-
resolve,reject,_next,_throw,"
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
style
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
return(0,_util.shadow)(this,"
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
if(ViewerPreferencesValidators[key](value)){var prefValue=void 0;switch(key){case "NonFullScreenPageMode":switch(value.name){case "UseNone":case "UseOutlines":case "UseThumbs":case "UseOC":prefValue=value.name;break;default:prefValue="UseNone"}break;case "Direction":switch(value.name){case "L2R":case "R2L":prefValue=value.name;break;default:prefValue="L2R"}break;case "ViewArea":case "ViewClip":case "PrintArea":case "PrintClip":switch(value.name){case "MediaBox":case "CropBox":case "BleedBox":case "TrimBox":case "ArtBox":prefValue=
|
|
656
|
+
startXRef;)startXRefLength+=String.fromCharCode(startXRef),startXRef=stream.getByte();startXRef=parseInt(startXRefLength,10);isNaN(startXRef)&&(startXRef=0)}}return(0,_util.shadow)(this,"startXRef",startXRef)}},{key:"numPages",get:function(){var linearization=this.linearization;return(0,_util.shadow)(this,"numPages",linearization?linearization.numPages:this.catalog.numPages)}},{key:"documentInfo",get:function(){var DocumentInfoValidators={Title:_util.isString,Author:_util.isString,Subject:_util.isString,
|
|
657
|
+
Keywords:_util.isString,Creator:_util.isString,Producer:_util.isString,CreationDate:_util.isString,ModDate:_util.isString,Trapped:_primitives.isName},docInfo={PDFFormatVersion:this.pdfFormatVersion,IsLinearized:!!this.linearization,IsAcroFormPresent:!!this.acroForm,IsXFAPresent:!!this.xfa,IsCollectionPresent:!!this.collection};try{var infoDict=this.xref.trailer.get("Info")}catch(err){if(err instanceof _core_utils.MissingDataException)throw err;(0,_util.info)("The document information dictionary is invalid.")}if((0,_primitives.isDict)(infoDict)){var _iteratorNormalCompletion6=
|
|
658
|
+
!0,_didIteratorError6=!1,_iteratorError6=void 0;try{for(var _iterator6=infoDict.getKeys()[Symbol.iterator](),_step6;!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=!0){var key=_step6.value,value=infoDict.get(key);if(DocumentInfoValidators[key])DocumentInfoValidators[key](value)?docInfo[key]="string"!==typeof value?value:(0,_util.stringToPDFString)(value):(0,_util.info)('Bad value in document info for "'.concat(key,'".'));else if("string"===typeof key){var customValue=
|
|
659
|
+
void 0;if((0,_util.isString)(value))customValue=(0,_util.stringToPDFString)(value);else if((0,_primitives.isName)(value)||(0,_util.isNum)(value)||(0,_util.isBool)(value))customValue=value;else{(0,_util.info)('Unsupported value in document info for (custom) "'.concat(key,'".'));continue}docInfo.Custom||(docInfo.Custom=Object.create(null));docInfo.Custom[key]=customValue}}}catch(err$10){_didIteratorError6=!0,_iteratorError6=err$10}finally{try{if(!_iteratorNormalCompletion6&&null!=_iterator6["return"])_iterator6["return"]()}finally{if(_didIteratorError6)throw _iteratorError6;
|
|
660
|
+
}}}return(0,_util.shadow)(this,"documentInfo",docInfo)}},{key:"fingerprint",get:function(){var hash=this.xref.trailer.get("ID");hash=Array.isArray(hash)&&hash[0]&&(0,_util.isString)(hash[0])&&"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"!==hash[0]?(0,_util.stringToBytes)(hash[0]):(0,_crypto.calculateMD5)(this.stream.getByteRange(0,1024),0,1024);for(var fingerprintBuf=[],i=0,ii=hash.length;i<ii;i++){var hex=hash[i].toString(16);fingerprintBuf.push(hex.padStart(2,"0"))}return(0,_util.shadow)(this,
|
|
661
|
+
"fingerprint",fingerprintBuf.join(""))}}]);return PDFDocument}();exports.PDFDocument=module},function(module,exports,__w_pdfjs_require__){function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"===typeof call))return call;if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||
|
|
662
|
+
Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,
|
|
663
|
+
p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,
|
|
664
|
+
resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");
|
|
665
|
+
}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}function fetchDestination(dest){return(0,_primitives.isDict)(dest)?
|
|
666
|
+
dest.get("D"):dest}Object.defineProperty(exports,"__esModule",{value:!0});exports.FileSpec=exports.XRef=exports.ObjectLoader=exports.Catalog=void 0;var _regenerator=function(obj){return obj&&obj.__esModule?obj:{"default":obj}}(__w_pdfjs_require__(2)),_util=__w_pdfjs_require__(5),_primitives=__w_pdfjs_require__(188),_parser=__w_pdfjs_require__(194),_core_utils=__w_pdfjs_require__(191),_crypto=__w_pdfjs_require__(205),_colorspace=__w_pdfjs_require__(206);module=function(){function Catalog(pdfManager,
|
|
667
|
+
xref){_classCallCheck(this,Catalog);this.pdfManager=pdfManager;this.xref=xref;this.catDict=xref.getCatalogObj();if(!(0,_primitives.isDict)(this.catDict))throw new _util.FormatError("Catalog object is not a dictionary.");this.fontCache=new _primitives.RefSetCache;this.builtInCMapCache=new Map;this.pageKidsCountCache=new _primitives.RefSetCache}_createClass(Catalog,[{key:"_readDocumentOutline",value:function(){var obj=this.catDict.get("Outlines");if(!(0,_primitives.isDict)(obj))return null;obj=obj.getRaw("First");
|
|
668
|
+
if(!(0,_primitives.isRef)(obj))return null;var root={items:[]},queue=[{obj:obj,parent:root}],processed=new _primitives.RefSet;processed.put(obj);for(var xref=this.xref,blackColor=new Uint8ClampedArray(3);0<queue.length;){var i=queue.shift(),outlineDict=xref.fetchIfRef(i.obj);if(null!==outlineDict){if(!outlineDict.has("Title"))throw new _util.FormatError("Invalid outline item encountered.");obj={url:null,dest:null};Catalog.parseDestDictionary({destDict:outlineDict,resultObj:obj,docBaseUrl:this.pdfManager.docBaseUrl});
|
|
669
|
+
var title=outlineDict.get("Title"),flags=outlineDict.get("F")||0,color=outlineDict.getArray("C"),count=outlineDict.get("Count"),rgbColor=blackColor;!Array.isArray(color)||3!==color.length||0===color[0]&&0===color[1]&&0===color[2]||(rgbColor=_colorspace.ColorSpace.singletons.rgb.getRgb(color,0));title={dest:obj.dest,url:obj.url,unsafeUrl:obj.unsafeUrl,newWindow:obj.newWindow,title:(0,_util.stringToPDFString)(title),color:rgbColor,count:Number.isInteger(count)?count:void 0,bold:!!(flags&2),italic:!!(flags&
|
|
670
|
+
1),items:[]};i.parent.items.push(title);obj=outlineDict.getRaw("First");(0,_primitives.isRef)(obj)&&!processed.has(obj)&&(queue.push({obj:obj,parent:title}),processed.put(obj));obj=outlineDict.getRaw("Next");(0,_primitives.isRef)(obj)&&!processed.has(obj)&&(queue.push({obj:obj,parent:i.parent}),processed.put(obj))}}return 0<root.items.length?root.items:null}},{key:"_readPermissions",value:function(){var encrypt=this.xref.trailer.get("Encrypt");if(!(0,_primitives.isDict)(encrypt))return null;encrypt=
|
|
671
|
+
encrypt.get("P");if(!(0,_util.isNum)(encrypt))return null;encrypt+=Math.pow(2,32);var permissions=[],key;for(key in _util.PermissionFlag){var value=_util.PermissionFlag[key];encrypt&value&&permissions.push(value)}return permissions}},{key:"getDestination",value:function(destinationId){var obj=this._readDests();return obj instanceof NameTree||obj instanceof _primitives.Dict?fetchDestination(obj.get(destinationId)||null):null}},{key:"_readDests",value:function(){var obj=this.catDict.get("Names");if(obj&&
|
|
672
|
+
obj.has("Dests"))return new NameTree(obj.getRaw("Dests"),this.xref);if(this.catDict.has("Dests"))return this.catDict.get("Dests")}},{key:"_readPageLabels",value:function(){var obj=this.catDict.getRaw("PageLabels");if(!obj)return null;var pageLabels=Array(this.numPages),style=null,prefix="";obj=(new NumberTree(obj,this.xref)).getAll();for(var currentLabel,currentIndex=1,i=0,ii=this.numPages;i<ii;i++){if(i in obj){currentIndex=obj[i];if(!(0,_primitives.isDict)(currentIndex))throw new _util.FormatError("PageLabel is not a dictionary.");
|
|
673
|
+
if(currentIndex.has("Type")&&!(0,_primitives.isName)(currentIndex.get("Type"),"PageLabel"))throw new _util.FormatError("Invalid type in PageLabel dictionary.");if(currentIndex.has("S")){style=currentIndex.get("S");if(!(0,_primitives.isName)(style))throw new _util.FormatError("Invalid style in PageLabel dictionary.");style=style.name}else style=null;if(currentIndex.has("P")){prefix=currentIndex.get("P");if(!(0,_util.isString)(prefix))throw new _util.FormatError("Invalid prefix in PageLabel dictionary.");
|
|
674
|
+
prefix=(0,_util.stringToPDFString)(prefix)}else prefix="";if(currentIndex.has("St")){if(currentIndex=currentIndex.get("St"),!(Number.isInteger(currentIndex)&&1<=currentIndex))throw new _util.FormatError("Invalid start in PageLabel dictionary.");}else currentIndex=1}switch(style){case "D":currentLabel=currentIndex;break;case "R":case "r":currentLabel=(0,_core_utils.toRomanNumerals)(currentIndex,"r"===style);break;case "A":case "a":var letterIndex=currentIndex-1;currentLabel=String.fromCharCode(("a"===
|
|
675
|
+
style?97:65)+letterIndex%26);var charBuf=[],j=0;for(letterIndex=letterIndex/26|0;j<=letterIndex;j++)charBuf.push(currentLabel);currentLabel=charBuf.join("");break;default:if(style)throw new _util.FormatError('Invalid style "'.concat(style,'" in PageLabel dictionary.'));currentLabel=""}pageLabels[i]=prefix+currentLabel;currentIndex++}return pageLabels}},{key:"fontFallback",value:function(id,handler){var promises=[];this.fontCache.forEach(function(promise){promises.push(promise)});return Promise.all(promises).then(function(translatedFonts){var _iteratorNormalCompletion=
|
|
676
|
+
!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _iterator=translatedFonts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var translatedFont=_step.value;if(translatedFont.loadedName===id){translatedFont.fallback(handler);break}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&null!=_iterator["return"])_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}})}},
|
|
677
|
+
{key:"cleanup",value:function(){var _this=this;(0,_primitives.clearPrimitiveCaches)();this.pageKidsCountCache.clear();var promises=[];this.fontCache.forEach(function(promise){promises.push(promise)});return Promise.all(promises).then(function(translatedFonts){var _iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _iterator2=translatedFonts[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0)delete _step2.value.dict.translated}catch(err){_didIteratorError2=
|
|
678
|
+
!0,_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&null!=_iterator2["return"])_iterator2["return"]()}finally{if(_didIteratorError2)throw _iteratorError2;}}_this.fontCache.clear();_this.builtInCMapCache.clear()})}},{key:"getPageDict",value:function(pageIndex){function next(){for(var _loop=function(){var currentNode=nodesToVisit.pop();if((0,_primitives.isRef)(currentNode)){count=pageKidsCountCache.get(currentNode);if(0<count&¤tPageIndex+count<pageIndex)return currentPageIndex+=
|
|
679
|
+
count,"continue";xref.fetchAsync(currentNode).then(function(obj){(0,_primitives.isDict)(obj,"Page")||(0,_primitives.isDict)(obj)&&!obj.has("Kids")?pageIndex===currentPageIndex?(currentNode&&!pageKidsCountCache.has(currentNode)&&pageKidsCountCache.put(currentNode,1),capability.resolve([obj,currentNode])):(currentPageIndex++,next()):(nodesToVisit.push(obj),next())},capability.reject);return{v:void 0}}if(!(0,_primitives.isDict)(currentNode))return capability.reject(new _util.FormatError("Page dictionary kid reference points to wrong type of object.")),
|
|
680
|
+
{v:void 0};count=currentNode.get("Count");if(Number.isInteger(count)&&0<=count){var objId=currentNode.objId;objId&&!pageKidsCountCache.has(objId)&&pageKidsCountCache.put(objId,count);if(currentPageIndex+count<=pageIndex)return currentPageIndex+=count,"continue"}objId=currentNode.get("Kids");if(!Array.isArray(objId)){if((0,_primitives.isName)(currentNode.get("Type"),"Page")||!currentNode.has("Type")&¤tNode.has("Contents")){if(currentPageIndex===pageIndex)return capability.resolve([currentNode,
|
|
681
|
+
null]),{v:void 0};currentPageIndex++;return"continue"}capability.reject(new _util.FormatError("Page dictionary kids object is not an array."));return{v:void 0}}for(var last=objId.length-1;0<=last;last--)nodesToVisit.push(objId[last])};nodesToVisit.length;){var _ret=_loop();switch(_ret){case "continue":continue;default:if("object"===_typeof(_ret))return _ret.v}}capability.reject(Error("Page index ".concat(pageIndex," not found.")))}var capability=(0,_util.createPromiseCapability)(),nodesToVisit=[this.catDict.getRaw("Pages")],
|
|
682
|
+
xref=this.xref,pageKidsCountCache=this.pageKidsCountCache,count,currentPageIndex=0;next();return capability.promise}},{key:"getPageIndex",value:function(pageRef){function pagesBeforeRef(kidRef){var total=0,parentRef;return xref.fetchAsync(kidRef).then(function(node){if((0,_primitives.isRefsEqual)(kidRef,pageRef)&&!(0,_primitives.isDict)(node,"Page")&&(!(0,_primitives.isDict)(node)||node.has("Type")||!node.has("Contents")))throw new _util.FormatError("The reference does not point to a /Page dictionary.");
|
|
683
|
+
if(!node)return null;if(!(0,_primitives.isDict)(node))throw new _util.FormatError("Node must be a dictionary.");parentRef=node.getRaw("Parent");return node.getAsync("Parent")}).then(function(parent){if(!parent)return null;if(!(0,_primitives.isDict)(parent))throw new _util.FormatError("Parent must be a dictionary.");return parent.getAsync("Kids")}).then(function(kids){if(!kids)return null;for(var kidPromises=[],found=!1,i=0,ii=kids.length;i<ii;i++){var kid=kids[i];if(!(0,_primitives.isRef)(kid))throw new _util.FormatError("Kid must be a reference.");
|
|
684
|
+
if((0,_primitives.isRefsEqual)(kid,kidRef)){found=!0;break}kidPromises.push(xref.fetchAsync(kid).then(function(kid){if(!(0,_primitives.isDict)(kid))throw new _util.FormatError("Kid node must be a dictionary.");kid.has("Count")?total+=kid.get("Count"):total++}))}if(!found)throw new _util.FormatError("Kid reference not found in parent's kids.");return Promise.all(kidPromises).then(function(){return[total,parentRef]})})}function next(ref){return pagesBeforeRef(ref).then(function(args){if(!args)return total;
|
|
685
|
+
var JSCompiler_temp=Array.isArray(args)?args:void 0;if(!JSCompiler_temp)if(Symbol.iterator in Object(args)||"[object Arguments]"===Object.prototype.toString.call(args)){JSCompiler_temp=[];var _n=!0,_d=!1,_e=void 0;try{for(var _i=args[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(JSCompiler_temp.push(_s.value),2!==JSCompiler_temp.length);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i["return"])_i["return"]()}finally{if(_d)throw _e;}}}else JSCompiler_temp=void 0;if(!(args=JSCompiler_temp))throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
686
|
+
_i=args[1];total+=args[0];return next(_i)})}var xref=this.xref,total=0;return next(pageRef)}},{key:"metadata",get:function(){var streamRef=this.catDict.getRaw("Metadata");if(!(0,_primitives.isRef)(streamRef))return(0,_util.shadow)(this,"metadata",null);streamRef=this.xref.fetch(streamRef,!(this.xref.encrypt&&this.xref.encrypt.encryptMetadata));if(streamRef&&(0,_primitives.isDict)(streamRef.dict)){var type=streamRef.dict.get("Type"),subtype=streamRef.dict.get("Subtype");if((0,_primitives.isName)(type,
|
|
687
|
+
"Metadata")&&(0,_primitives.isName)(subtype,"XML"))try{var metadata=(0,_util.stringToUTF8String)((0,_util.bytesToString)(streamRef.getBytes()))}catch(e){if(e instanceof _core_utils.MissingDataException)throw e;(0,_util.info)("Skipping invalid metadata.")}}return(0,_util.shadow)(this,"metadata",metadata)}},{key:"toplevelPagesDict",get:function(){var pagesObj=this.catDict.get("Pages");if(!(0,_primitives.isDict)(pagesObj))throw new _util.FormatError("Invalid top-level pages dictionary.");return(0,_util.shadow)(this,
|
|
688
|
+
"toplevelPagesDict",pagesObj)}},{key:"documentOutline",get:function(){var obj=null;try{obj=this._readDocumentOutline()}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;(0,_util.warn)("Unable to read document outline.")}return(0,_util.shadow)(this,"documentOutline",obj)}},{key:"permissions",get:function(){var permissions=null;try{permissions=this._readPermissions()}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;(0,_util.warn)("Unable to read permissions.")}return(0,_util.shadow)(this,
|
|
689
|
+
"permissions",permissions)}},{key:"numPages",get:function(){var obj=this.toplevelPagesDict.get("Count");if(!Number.isInteger(obj))throw new _util.FormatError("Page count in top-level pages dictionary is not an integer.");return(0,_util.shadow)(this,"numPages",obj)}},{key:"destinations",get:function(){var obj=this._readDests(),dests=Object.create(null);if(obj instanceof NameTree){obj=obj.getAll();for(var name in obj)dests[name]=fetchDestination(obj[name])}else obj instanceof _primitives.Dict&&obj.forEach(function(key,
|
|
690
|
+
value){value&&(dests[key]=fetchDestination(value))});return(0,_util.shadow)(this,"destinations",dests)}},{key:"pageLabels",get:function(){var obj=null;try{obj=this._readPageLabels()}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;(0,_util.warn)("Unable to read page labels.")}return(0,_util.shadow)(this,"pageLabels",obj)}},{key:"pageLayout",get:function(){var obj=this.catDict.get("PageLayout"),pageLayout="";if((0,_primitives.isName)(obj))switch(obj.name){case "SinglePage":case "OneColumn":case "TwoColumnLeft":case "TwoColumnRight":case "TwoPageLeft":case "TwoPageRight":pageLayout=
|
|
691
|
+
obj.name}return(0,_util.shadow)(this,"pageLayout",pageLayout)}},{key:"pageMode",get:function(){var obj=this.catDict.get("PageMode"),pageMode="UseNone";if((0,_primitives.isName)(obj))switch(obj.name){case "UseNone":case "UseOutlines":case "UseThumbs":case "FullScreen":case "UseOC":case "UseAttachments":pageMode=obj.name}return(0,_util.shadow)(this,"pageMode",pageMode)}},{key:"viewerPreferences",get:function(){var _this2=this,ViewerPreferencesValidators={HideToolbar:_util.isBool,HideMenubar:_util.isBool,
|
|
692
|
+
HideWindowUI:_util.isBool,FitWindow:_util.isBool,CenterWindow:_util.isBool,DisplayDocTitle:_util.isBool,NonFullScreenPageMode:_primitives.isName,Direction:_primitives.isName,ViewArea:_primitives.isName,ViewClip:_primitives.isName,PrintArea:_primitives.isName,PrintClip:_primitives.isName,PrintScaling:_primitives.isName,Duplex:_primitives.isName,PickTrayByPDFSize:_util.isBool,PrintPageRange:Array.isArray,NumCopies:Number.isInteger},obj=this.catDict.get("ViewerPreferences"),prefs=Object.create(null);
|
|
693
|
+
if((0,_primitives.isDict)(obj))for(var key in ViewerPreferencesValidators)if(obj.has(key)){var value=obj.get(key);if(ViewerPreferencesValidators[key](value)){var prefValue=void 0;switch(key){case "NonFullScreenPageMode":switch(value.name){case "UseNone":case "UseOutlines":case "UseThumbs":case "UseOC":prefValue=value.name;break;default:prefValue="UseNone"}break;case "Direction":switch(value.name){case "L2R":case "R2L":prefValue=value.name;break;default:prefValue="L2R"}break;case "ViewArea":case "ViewClip":case "PrintArea":case "PrintClip":switch(value.name){case "MediaBox":case "CropBox":case "BleedBox":case "TrimBox":case "ArtBox":prefValue=
|
|
683
694
|
value.name;break;default:prefValue="CropBox"}break;case "PrintScaling":switch(value.name){case "None":case "AppDefault":prefValue=value.name;break;default:prefValue="AppDefault"}break;case "Duplex":switch(value.name){case "Simplex":case "DuplexFlipShortEdge":case "DuplexFlipLongEdge":prefValue=value.name;break;default:prefValue="None"}break;case "PrintPageRange":if(0!==value.length%2)break;value.every(function(page,i,arr){return Number.isInteger(page)&&0<page&&(0===i||page>=arr[i-1])&&page<=_this2.numPages})&&
|
|
684
695
|
(prefValue=value);break;case "NumCopies":0<value&&(prefValue=value);break;default:(0,_util.assert)("boolean"===typeof value),prefValue=value}void 0!==prefValue?prefs[key]=prefValue:(0,_util.info)('Bad value in ViewerPreferences for "'.concat(key,'".'))}else(0,_util.info)('Bad value in ViewerPreferences for "'.concat(key,'".'))}return(0,_util.shadow)(this,"viewerPreferences",prefs)}},{key:"openActionDestination",get:function(){var obj=this.catDict.get("OpenAction"),openActionDest=null;if((0,_primitives.isDict)(obj)){var destDict=
|
|
685
696
|
new _primitives.Dict(this.xref);destDict.set("A",obj);obj={url:null,dest:null};Catalog.parseDestDictionary({destDict:destDict,resultObj:obj});Array.isArray(obj.dest)&&(openActionDest=obj.dest)}else Array.isArray(obj)&&(openActionDest=obj);return(0,_util.shadow)(this,"openActionDestination",openActionDest)}},{key:"attachments",get:function(){var obj=this.catDict.get("Names"),attachments=null;if(obj&&obj.has("EmbeddedFiles")){obj=(new NameTree(obj.getRaw("EmbeddedFiles"),this.xref)).getAll();for(var name in obj){var fs=
|
|
@@ -690,7 +701,7 @@ params.resultObj;if("object"!==_typeof(resultObj))(0,_util.warn)("parseDestDicti
|
|
|
690
701
|
return}resultObj.extraActions={};actionType$jscomp$0=actionType$jscomp$0.name;switch(actionType$jscomp$0){case "Hide":resultObj.extraActions.hide={H:action$jscomp$0.get("H"),T:action$jscomp$0.get("T")};break;case "ResetForm":resultObj.extraActions.reset={Fields:action$jscomp$0.get("Fields"),Flags:action$jscomp$0.get("Flags")};break;case "URI":var url$jscomp$0=action$jscomp$0.get("URI");(0,_primitives.isName)(url$jscomp$0)?url$jscomp$0="/"+url$jscomp$0.name:(0,_util.isString)(url$jscomp$0)&&(url$jscomp$0=
|
|
691
702
|
addDefaultProtocolToUrl(url$jscomp$0));break;case "GoTo":var dest=action$jscomp$0.get("D");break;case "Launch":case "GoToR":var urlDict=action$jscomp$0.get("F");(0,_primitives.isDict)(urlDict)?url$jscomp$0=urlDict.get("F")||null:(0,_util.isString)(urlDict)&&(url$jscomp$0=urlDict);if(urlDict=action$jscomp$0.get("D"))(0,_primitives.isName)(urlDict)&&(urlDict=urlDict.name),(0,_util.isString)(url$jscomp$0)&&(actionType$jscomp$0=url$jscomp$0.split("#")[0],(0,_util.isString)(urlDict)?url$jscomp$0=actionType$jscomp$0+
|
|
692
703
|
"#"+urlDict:Array.isArray(urlDict)&&(url$jscomp$0=actionType$jscomp$0+"#"+JSON.stringify(urlDict)));action$jscomp$0=action$jscomp$0.get("NewWindow");(0,_util.isBool)(action$jscomp$0)&&(resultObj.newWindow=action$jscomp$0);break;case "Named":action$jscomp$0=action$jscomp$0.get("N");(0,_primitives.isName)(action$jscomp$0)&&(resultObj.action=action$jscomp$0.name);break;case "JavaScript":action$jscomp$0=action$jscomp$0.get("JS");(0,_primitives.isStream)(action$jscomp$0)?urlDict=(0,_util.bytesToString)(action$jscomp$0.getBytes()):
|
|
693
|
-
(0,_util.isString)(action$jscomp$0)&&(urlDict=action$jscomp$0);urlDict&&(resultObj.extraActions.javascript={js:urlDict},(action$jscomp$0
|
|
704
|
+
(0,_util.isString)(action$jscomp$0)&&(urlDict=action$jscomp$0);urlDict&&(resultObj.extraActions.javascript={js:urlDict},(action$jscomp$0=RegExp("^\\s*(app\\.launchURL|window\\.open)\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec((0,_util.stringToPDFString)(urlDict)))&&action$jscomp$0[2]&&(url$jscomp$0=action$jscomp$0[2],"true"===action$jscomp$0[3]&&"app.launchURL"===action$jscomp$0[1]&&(resultObj.newWindow=!0)));break;default:(0,_util.warn)('parseDestDictionary: unsupported action type "'.concat(actionType$jscomp$0,
|
|
694
705
|
'".'))}}else destDict.has("Dest")&&(dest=destDict.get("Dest"));if((0,_util.isString)(url$jscomp$0)){url$jscomp$0=tryConvertUrlEncoding(url$jscomp$0);if(params=(0,_util.createValidAbsoluteUrl)(url$jscomp$0,params))resultObj.url=params.href;resultObj.unsafeUrl=url$jscomp$0}dest&&((0,_primitives.isName)(dest)&&(dest=dest.name),(0,_util.isString)(dest)||Array.isArray(dest))&&(resultObj.dest=dest);url$jscomp$0=function(action,actionType){if(action&&(action=action.get("JS"))){var _js;(0,_primitives.isStream)(action)?
|
|
695
706
|
_js=(0,_util.bytesToString)(action.getBytes()):(0,_util.isString)(action)&&(_js=action);resultObj.additionalActions=resultObj.additionalActions||{};resultObj.additionalActions[actionType]={js:_js,actionType:actionType};"C"===actionType&&(_js=destDict.xref.topDict.get("Root").get("AcroForm").get("CO"),resultObj.additionalActions[actionType].calculationOrder=_js.reduce(function(acc,element){element=destDict.xref.fetchIfRef(element).get("T");acc.push(element);return acc},[]))}};dest=destDict.get("AA");
|
|
696
707
|
(0,_primitives.isDict)(dest)&&(url$jscomp$0(dest.get("K"),"K"),url$jscomp$0(dest.get("F"),"F"),url$jscomp$0(dest.get("V"),"V"),url$jscomp$0(dest.get("C"),"C"))}}else(0,_util.warn)("parseDestDictionary: `destDict` must be a dictionary.")}}]);return Catalog}();exports.Catalog=module;module=function(){function XRef(stream,pdfManager){this.stream=stream;this.pdfManager=pdfManager;this.entries=[];this.xrefstms=Object.create(null);this._cacheMap=new Map;this.stats={streamTypes:Object.create(null),fontTypes:Object.create(null)}}
|
|
@@ -706,42 +717,42 @@ for(var typeFieldWidth=i[0],offsetFieldWidth=i[1],generationFieldWidth=i[2],entr
|
|
|
706
717
|
}this.entries[first+i]||(this.entries[first+i]=j)}streamState.entryNum=0;streamState.streamPos=stream.pos;entryRanges.splice(0,2)}},indexObjects:function(){function readToken(data,offset){for(var token="",ch=data[offset];10!==ch&&13!==ch&&60!==ch&&!(++offset>=data.length);)token+=String.fromCharCode(ch),ch=data[offset];return token}function skipUntil(data,offset,what){for(var length=what.length,dataLength=data.length,skipped=0;offset<dataLength;){for(var i=0;i<length&&data[offset+i]===what[i];)++i;
|
|
707
718
|
if(i>=length)break;offset++;skipped++}return skipped}var objRegExp=/^(\d+)\s+(\d+)\s+obj\b/,endobjRegExp=/\bendobj[\b\s]$/,nestedObjRegExp=/\s+(\d+\s+\d+\s+obj[\b\s<])$/,trailerBytes=new Uint8Array([116,114,97,105,108,101,114]),startxrefBytes=new Uint8Array([115,116,97,114,116,120,114,101,102]),objBytes=new Uint8Array([111,98,106]),xrefBytes=new Uint8Array([47,88,82,101,102]);this.entries.length=0;var stream=this.stream;stream.pos=0;for(var buffer=stream.getBytes(),position=stream.start,length$jscomp$0=
|
|
708
719
|
buffer.length,trailers=[],xrefStms=[];position<length$jscomp$0;){var ch$jscomp$0=buffer[position];if(9===ch$jscomp$0||10===ch$jscomp$0||13===ch$jscomp$0||32===ch$jscomp$0)++position;else if(37===ch$jscomp$0){do{++position;if(position>=length$jscomp$0)break;ch$jscomp$0=buffer[position]}while(10!==ch$jscomp$0&&13!==ch$jscomp$0)}else{var token$jscomp$0=readToken(buffer,position),m;if(token$jscomp$0.startsWith("xref")&&(4===token$jscomp$0.length||/\s/.test(token$jscomp$0[4])))position+=skipUntil(buffer,
|
|
709
|
-
position,trailerBytes),trailers.push(position),position+=skipUntil(buffer,position,startxrefBytes);else if(m=objRegExp.exec(token$jscomp$0)){ch$jscomp$0=m[1]|0;m=m[2]|0;this.entries[ch$jscomp$0]&&this.entries[ch$jscomp$0].gen!==m||(this.entries[ch$jscomp$0]={offset:position-stream.start,gen:m,uncompressed:!0});ch$jscomp$0=void 0;for(m=position+token$jscomp$0.length;m<buffer.length;){token$jscomp$0=m+skipUntil(buffer,m,objBytes)+4;ch$jscomp$0=token$jscomp$0-position;m=Math.max(token$jscomp$0-
|
|
710
|
-
m
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
cacheEntry=
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
if(
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
"
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
720
|
+
position,trailerBytes),trailers.push(position),position+=skipUntil(buffer,position,startxrefBytes);else if(m=objRegExp.exec(token$jscomp$0)){ch$jscomp$0=m[1]|0;m=m[2]|0;this.entries[ch$jscomp$0]&&this.entries[ch$jscomp$0].gen!==m||(this.entries[ch$jscomp$0]={offset:position-stream.start,gen:m,uncompressed:!0});ch$jscomp$0=void 0;for(m=position+token$jscomp$0.length;m<buffer.length;){token$jscomp$0=m+skipUntil(buffer,m,objBytes)+4;ch$jscomp$0=token$jscomp$0-position;m=(0,_util.bytesToString)(buffer.subarray(Math.max(token$jscomp$0-
|
|
721
|
+
25,m),token$jscomp$0));if(endobjRegExp.test(m))break;else if((m=nestedObjRegExp.exec(m))&&m[1]){(0,_util.warn)('indexObjects: Found new "obj" inside of another "obj", caused by missing "endobj" -- trying to recover.');ch$jscomp$0-=m[1].length;break}m=token$jscomp$0}token$jscomp$0=buffer.subarray(position,position+ch$jscomp$0);m=skipUntil(token$jscomp$0,0,xrefBytes);m<ch$jscomp$0&&64>token$jscomp$0[m+5]&&(xrefStms.push(position-stream.start),this.xrefstms[position-stream.start]=1);position+=ch$jscomp$0}else token$jscomp$0.startsWith("trailer")&&
|
|
722
|
+
(7===token$jscomp$0.length||/\s/.test(token$jscomp$0[7]))?(trailers.push(position),position+=skipUntil(buffer,position,startxrefBytes)):position+=token$jscomp$0.length+1}}objRegExp=0;for(endobjRegExp=xrefStms.length;objRegExp<endobjRegExp;++objRegExp)this.startXRefQueue.push(xrefStms[objRegExp]),this.readXRef(!0);objRegExp=0;for(endobjRegExp=trailers.length;objRegExp<endobjRegExp;++objRegExp)if(stream.pos=trailers[objRegExp],xrefStms=new _parser.Parser({lexer:new _parser.Lexer(stream),xref:this,allowStreams:!0,
|
|
723
|
+
recoveryMode:!0}),nestedObjRegExp=xrefStms.getObj(),(0,_primitives.isCmd)(nestedObjRegExp,"trailer")&&(xrefStms=xrefStms.getObj(),(0,_primitives.isDict)(xrefStms))){nestedObjRegExp=void 0;try{nestedObjRegExp=xrefStms.get("Root")}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;continue}if((0,_primitives.isDict)(nestedObjRegExp)&&nestedObjRegExp.has("Pages")){if(xrefStms.has("ID"))return xrefStms;var trailerDict=xrefStms}}if(trailerDict)return trailerDict;throw new _util.InvalidPDFException("Invalid PDF structure.");
|
|
724
|
+
},readXRef:function(recoveryMode){var stream=this.stream,startXRefParsedCache=Object.create(null);try{for(;this.startXRefQueue.length;){var startXRef=this.startXRefQueue[0];if(startXRefParsedCache[startXRef])(0,_util.warn)("readXRef - skipping XRef table since it was already parsed.");else{startXRefParsedCache[startXRef]=!0;stream.pos=startXRef+stream.start;var parser=new _parser.Parser({lexer:new _parser.Lexer(stream),xref:this,allowStreams:!0}),obj=parser.getObj();if((0,_primitives.isCmd)(obj,"xref")){var dict=
|
|
725
|
+
this.processXRefTable(parser);this.topDict||(this.topDict=dict);obj=dict.get("XRefStm");if(Number.isInteger(obj)){var pos=obj;pos in this.xrefstms||(this.xrefstms[pos]=1,this.startXRefQueue.push(pos))}}else if(Number.isInteger(obj)){if(!Number.isInteger(parser.getObj())||!(0,_primitives.isCmd)(parser.getObj(),"obj")||!(0,_primitives.isStream)(obj=parser.getObj()))throw new _util.FormatError("Invalid XRef stream");dict=this.processXRefStream(obj);this.topDict||(this.topDict=dict);if(!dict)throw new _util.FormatError("Failed to read XRef stream");
|
|
726
|
+
}else throw new _util.FormatError("Invalid XRef stream header");obj=dict.get("Prev");Number.isInteger(obj)?this.startXRefQueue.push(obj):(0,_primitives.isRef)(obj)&&this.startXRefQueue.push(obj.num)}this.startXRefQueue.shift()}return this.topDict}catch(e){if(e instanceof _core_utils.MissingDataException)throw e;(0,_util.info)("(while reading XRef): "+e)}if(!recoveryMode)throw new _core_utils.XRefParseException;},getEntry:function(i){return(i=this.entries[i])&&!i.free&&i.offset?i:null},fetchIfRef:function(obj,
|
|
727
|
+
suppressEncryption){return obj instanceof _primitives.Ref?this.fetch(obj,suppressEncryption):obj},fetch:function(ref,suppressEncryption){if(!(ref instanceof _primitives.Ref))throw Error("ref object is not a reference");var num=ref.num,cacheEntry=this._cacheMap.get(num);if(void 0!==cacheEntry)return cacheEntry instanceof _primitives.Dict&&!cacheEntry.objId&&(cacheEntry.objId=ref.toString()),cacheEntry;cacheEntry=this.getEntry(num);if(null===cacheEntry)return this._cacheMap.set(num,cacheEntry),cacheEntry;
|
|
728
|
+
cacheEntry=cacheEntry.uncompressed?this.fetchUncompressed(ref,cacheEntry,suppressEncryption):this.fetchCompressed(ref,cacheEntry,suppressEncryption);(0,_primitives.isDict)(cacheEntry)?cacheEntry.objId=ref.toString():(0,_primitives.isStream)(cacheEntry)&&(cacheEntry.dict.objId=ref.toString());return cacheEntry},fetchUncompressed:function(ref,xrefEntry){var suppressEncryption=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!1,gen=ref.gen,num=ref.num;if(xrefEntry.gen!==gen)throw new _core_utils.XRefEntryException("Inconsistent generation in XRef: ".concat(ref));
|
|
729
|
+
var stream=this.stream.makeSubStream(xrefEntry.offset+this.stream.start);stream=new _parser.Parser({lexer:new _parser.Lexer(stream),xref:this,allowStreams:!0});var obj1=stream.getObj(),obj2=stream.getObj(),obj3=stream.getObj();if(obj1!==num||obj2!==gen||!(obj3 instanceof _primitives.Cmd))throw new _core_utils.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(ref));if("obj"!==obj3.cmd){if(obj3.cmd.startsWith("obj")&&(num=parseInt(obj3.cmd.substring(3),10),!Number.isNaN(num)))return num;throw new _core_utils.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(ref));
|
|
730
|
+
}xrefEntry=this.encrypt&&!suppressEncryption?stream.getObj(this.encrypt.createCipherTransform(num,gen)):stream.getObj();(0,_primitives.isStream)(xrefEntry)||this._cacheMap.set(num,xrefEntry);return xrefEntry},fetchCompressed:function(ref,xrefEntry){var tableOffset=xrefEntry.offset,stream=this.fetch(_primitives.Ref.get(tableOffset,0));if(!(0,_primitives.isStream)(stream))throw new _util.FormatError("bad ObjStm stream");var first=stream.dict.get("First"),n=stream.dict.get("N");if(!Number.isInteger(first)||
|
|
731
|
+
!Number.isInteger(n))throw new _util.FormatError("invalid first and n parameters for ObjStm stream");stream=new _parser.Parser({lexer:new _parser.Lexer(stream),xref:this,allowStreams:!0});first=Array(n);for(var i=0;i<n;++i){var num=stream.getObj();if(!Number.isInteger(num))throw new _util.FormatError("invalid object number in the ObjStm stream: ".concat(num));var offset=stream.getObj();if(!Number.isInteger(offset))throw new _util.FormatError("invalid object offset in the ObjStm stream: ".concat(offset));
|
|
732
|
+
first[i]=num}i=Array(n);for(num=0;num<n;++num)if(offset=stream.getObj(),i[num]=offset,stream.buf1 instanceof _primitives.Cmd&&"endobj"===stream.buf1.cmd&&stream.shift(),!(0,_primitives.isStream)(offset)){var _num=first[num],entry=this.entries[_num];entry&&entry.offset===tableOffset&&entry.gen===num&&this._cacheMap.set(_num,offset)}xrefEntry=i[xrefEntry.gen];if(void 0===xrefEntry)throw new _core_utils.XRefEntryException("Bad (compressed) XRef entry: ".concat(ref));return xrefEntry},fetchIfRefAsync:function(){var _fetchIfRefAsync=
|
|
733
|
+
_asyncToGenerator(_regenerator["default"].mark(function _callee(obj,suppressEncryption){return _regenerator["default"].wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(!(obj instanceof _primitives.Ref)){_context.next=2;break}return _context.abrupt("return",this.fetchAsync(obj,suppressEncryption));case 2:return _context.abrupt("return",obj);case 3:case "end":return _context.stop()}},_callee,this)}));return function(_x,_x2){return _fetchIfRefAsync.apply(this,arguments)}}(),
|
|
734
|
+
fetchAsync:function(){var _fetchAsync=_asyncToGenerator(_regenerator["default"].mark(function _callee2(ref,suppressEncryption){return _regenerator["default"].wrap(function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.prev=0,_context2.abrupt("return",this.fetch(ref,suppressEncryption));case 4:_context2.prev=4;_context2.t0=_context2["catch"](0);if(_context2.t0 instanceof _core_utils.MissingDataException){_context2.next=8;break}throw _context2.t0;case 8:return _context2.next=
|
|
735
|
+
10,this.pdfManager.requestRange(_context2.t0.begin,_context2.t0.end);case 10:return _context2.abrupt("return",this.fetchAsync(ref,suppressEncryption));case 11:case "end":return _context2.stop()}},_callee2,this,[[0,4]])}));return function(_x3,_x4){return _fetchAsync.apply(this,arguments)}}(),getCatalogObj:function(){return this.root}};return XRef}();exports.XRef=module;module=function(){function NameOrNumberTree(root,xref,type){_classCallCheck(this,NameOrNumberTree);this.constructor===NameOrNumberTree&&
|
|
736
|
+
(0,_util.unreachable)("Cannot initialize NameOrNumberTree.");this.root=root;this.xref=xref;this._type=type}_createClass(NameOrNumberTree,[{key:"getAll",value:function(){var dict=Object.create(null);if(!this.root)return dict;var xref=this.xref,processed=new _primitives.RefSet;processed.put(this.root);for(var queue=[this.root];0<queue.length;){var obj=xref.fetchIfRef(queue.shift());if((0,_primitives.isDict)(obj))if(obj.has("Kids")){obj=obj.get("Kids");for(var i=0,ii=obj.length;i<ii;i++){var kid=obj[i];
|
|
737
|
+
if(processed.has(kid))throw new _util.FormatError('Duplicate entry in "'.concat(this._type,'" tree.'));queue.push(kid);processed.put(kid)}}else if(obj=obj.get(this._type),Array.isArray(obj))for(i=0,ii=obj.length;i<ii;i+=2)dict[xref.fetchIfRef(obj[i])]=xref.fetchIfRef(obj[i+1])}return dict}},{key:"get",value:function(key){if(!this.root)return null;for(var xref=this.xref,kidsOrEntries=xref.fetchIfRef(this.root),loopCount=0;kidsOrEntries.has("Kids");){if(10<++loopCount)return(0,_util.warn)('Search depth limit reached for "'.concat(this._type,
|
|
738
|
+
'" tree.')),null;var kids=kidsOrEntries.get("Kids");if(!Array.isArray(kids))return null;for(var l=0,r=kids.length-1;l<=r;){var m=l+r>>1,limits=xref.fetchIfRef(kids[m]).get("Limits");if(key<xref.fetchIfRef(limits[0]))r=m-1;else if(key>xref.fetchIfRef(limits[1]))l=m+1;else{kidsOrEntries=xref.fetchIfRef(kids[m]);break}}if(l>r)return null}kidsOrEntries=kidsOrEntries.get(this._type);if(Array.isArray(kidsOrEntries)){loopCount=0;for(kids=kidsOrEntries.length-2;loopCount<=kids;)if(l=loopCount+kids>>1,l+=
|
|
739
|
+
l&1,r=xref.fetchIfRef(kidsOrEntries[l]),key<r)kids=l-2;else if(key>r)loopCount=l+2;else return xref.fetchIfRef(kidsOrEntries[l+1]);(0,_util.info)('Falling back to an exhaustive search, for key "'.concat(key,'", ')+'in "'.concat(this._type,'" tree.'));loopCount=0;for(kids=kidsOrEntries.length;loopCount<kids;loopCount+=2)if(xref.fetchIfRef(kidsOrEntries[loopCount])===key)return(0,_util.warn)('The "'.concat(key,'" key was found at an incorrect, ')+'i.e. out-of-order, position in "'.concat(this._type,
|
|
740
|
+
'" tree.')),xref.fetchIfRef(kidsOrEntries[loopCount+1])}return null}}]);return NameOrNumberTree}();var NameTree=function(_NameOrNumberTree){function NameTree(root,xref){_classCallCheck(this,NameTree);return _possibleConstructorReturn(this,_getPrototypeOf(NameTree).call(this,root,xref,"Names"))}_inherits(NameTree,_NameOrNumberTree);return NameTree}(module),NumberTree=function(_NameOrNumberTree2){function NumberTree(root,xref){_classCallCheck(this,NumberTree);return _possibleConstructorReturn(this,
|
|
741
|
+
_getPrototypeOf(NumberTree).call(this,root,xref,"Nums"))}_inherits(NumberTree,_NameOrNumberTree2);return NumberTree}(module),FileSpec=function(){function FileSpec(root,xref){root&&(0,_primitives.isDict)(root)&&(this.xref=xref,this.root=root,root.has("FS")&&(this.fs=root.get("FS")),this.description=root.has("Desc")?(0,_util.stringToPDFString)(root.get("Desc")):"",root.has("RF")&&(0,_util.warn)("Related file specifications are not supported"),this.contentAvailable=!0,root.has("EF")||(this.contentAvailable=
|
|
742
|
+
!1,(0,_util.warn)("Non-embedded file specifications are not supported")))}function pickPlatformItem(dict){return dict.has("UF")?dict.get("UF"):dict.has("F")?dict.get("F"):dict.has("Unix")?dict.get("Unix"):dict.has("Mac")?dict.get("Mac"):dict.has("DOS")?dict.get("DOS"):null}FileSpec.prototype={get filename(){if(!this._filename&&this.root){var filename=pickPlatformItem(this.root)||"unnamed";this._filename=(0,_util.stringToPDFString)(filename).replace(/\\\\/g,"\\").replace(/\\\//g,"/").replace(/\\/g,
|
|
743
|
+
"/")}return this._filename},get content(){if(!this.contentAvailable)return null;!this.contentRef&&this.root&&(this.contentRef=pickPlatformItem(this.root.get("EF")));var content=null;if(this.contentRef){var fileObj=this.xref.fetchIfRef(this.contentRef);fileObj&&(0,_primitives.isStream)(fileObj)?content=fileObj.getBytes():(0,_util.warn)("Embedded file specification points to non-existing/invalid content")}else(0,_util.warn)("Embedded file specification does not have a content");return content},get serializable(){return{filename:this.filename,
|
|
744
|
+
content:this.content}}};return FileSpec}();exports.FileSpec=FileSpec;module=function(){function mayHaveChildren(value){return value instanceof _primitives.Ref||value instanceof _primitives.Dict||Array.isArray(value)||(0,_primitives.isStream)(value)}function ObjectLoader(dict,keys,xref){this.dict=dict;this.keys=keys;this.xref=xref;this.refSet=null}ObjectLoader.prototype={load:function(){var _load=_asyncToGenerator(_regenerator["default"].mark(function _callee3(){var keys,dict,nodesToVisit,i,ii,rawValue;
|
|
745
|
+
return _regenerator["default"].wrap(function(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if(this.xref.stream.allChunksLoaded&&!this.xref.stream.allChunksLoaded()){_context3.next=2;break}return _context3.abrupt("return",void 0);case 2:keys=this.keys;dict=this.dict;this.refSet=new _primitives.RefSet;nodesToVisit=[];i=0;for(ii=keys.length;i<ii;i++)rawValue=dict.getRaw(keys[i]),void 0!==rawValue&&nodesToVisit.push(rawValue);return _context3.abrupt("return",this._walk(nodesToVisit));
|
|
746
|
+
case 7:case "end":return _context3.stop()}},_callee3,this)}));return function(){return _load.apply(this,arguments)}}(),_walk:function(){var _walk2=_asyncToGenerator(_regenerator["default"].mark(function _callee4(nodesToVisit$jscomp$0){var nodesToRevisit,pendingRequests,currentNode,baseStreams,foundMissingData,i$jscomp$0,ii$jscomp$0,stream,_i5,_ii3,node$jscomp$0;return _regenerator["default"].wrap(function(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:nodesToRevisit=[],pendingRequests=
|
|
747
|
+
[];case 2:if(!nodesToVisit$jscomp$0.length){_context4.next=22;break}currentNode=nodesToVisit$jscomp$0.pop();if(!(currentNode instanceof _primitives.Ref)){_context4.next=18;break}if(!this.refSet.has(currentNode)){_context4.next=7;break}return _context4.abrupt("continue",2);case 7:_context4.prev=7;this.refSet.put(currentNode);currentNode=this.xref.fetch(currentNode);_context4.next=18;break;case 12:_context4.prev=12;_context4.t0=_context4["catch"](7);if(_context4.t0 instanceof _core_utils.MissingDataException){_context4.next=
|
|
748
|
+
16;break}throw _context4.t0;case 16:nodesToRevisit.push(currentNode),pendingRequests.push({begin:_context4.t0.begin,end:_context4.t0.end});case 18:if(currentNode&¤tNode.getBaseStreams){baseStreams=currentNode.getBaseStreams();foundMissingData=!1;i$jscomp$0=0;for(ii$jscomp$0=baseStreams.length;i$jscomp$0<ii$jscomp$0;i$jscomp$0++)stream=baseStreams[i$jscomp$0],stream.allChunksLoaded&&!stream.allChunksLoaded()&&(foundMissingData=!0,pendingRequests.push({begin:stream.start,end:stream.end}));foundMissingData&&
|
|
749
|
+
nodesToRevisit.push(currentNode)}var node=currentNode,nodesToVisit=nodesToVisit$jscomp$0;if(node instanceof _primitives.Dict||(0,_primitives.isStream)(node)){node=node instanceof _primitives.Dict?node:node.dict;for(var dictKeys=node.getKeys(),i=0,ii=dictKeys.length;i<ii;i++){var rawValue=node.getRaw(dictKeys[i]);mayHaveChildren(rawValue)&&nodesToVisit.push(rawValue)}}else if(Array.isArray(node))for(dictKeys=0,i=node.length;dictKeys<i;dictKeys++)ii=node[dictKeys],mayHaveChildren(ii)&&nodesToVisit.push(ii);
|
|
750
|
+
_context4.next=2;break;case 22:if(!pendingRequests.length){_context4.next=27;break}_context4.next=25;return this.xref.stream.manager.requestRanges(pendingRequests);case 25:_i5=0;for(_ii3=nodesToRevisit.length;_i5<_ii3;_i5++)node$jscomp$0=nodesToRevisit[_i5],node$jscomp$0 instanceof _primitives.Ref&&this.refSet.remove(node$jscomp$0);return _context4.abrupt("return",this._walk(nodesToRevisit));case 27:return this.refSet=null,_context4.abrupt("return",void 0);case 29:case "end":return _context4.stop()}},
|
|
751
|
+
_callee4,this,[[7,12]])}));return function(_x5){return _walk2.apply(this,arguments)}}()};return ObjectLoader}();exports.ObjectLoader=module},function(module,exports,__w_pdfjs_require__){function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;
|
|
752
|
+
"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}function computeAdler32(bytes){for(var bytesLength=bytes.length,a=1,b=0,i=0;i<bytesLength;++i)a+=bytes[i]&255,b+=a;return b%65521<<16|a%65521}function toHexDigit(ch){return 48<=ch&&57>=ch?ch&15:65<=ch&&
|
|
753
|
+
70>=ch||97<=ch&&102>=ch?(ch&15)+9:-1}Object.defineProperty(exports,"__esModule",{value:!0});exports.Parser=exports.Linearization=exports.Lexer=void 0;var _stream=__w_pdfjs_require__(195),_util=__w_pdfjs_require__(5),_primitives=__w_pdfjs_require__(188),_ccitt_stream=__w_pdfjs_require__(196),_jbig2_stream=__w_pdfjs_require__(198),_jpeg_stream=__w_pdfjs_require__(201),_jpx_stream=__w_pdfjs_require__(203),_core_utils=__w_pdfjs_require__(191),Parser=function(){function Parser(_ref){var lexer=_ref.lexer,
|
|
754
|
+
xref=_ref.xref,_ref$allowStreams=_ref.allowStreams;_ref$allowStreams=void 0===_ref$allowStreams?!1:_ref$allowStreams;_ref=_ref.recoveryMode;_ref=void 0===_ref?!1:_ref;_classCallCheck(this,Parser);this.lexer=lexer;this.xref=xref;this.allowStreams=_ref$allowStreams;this.recoveryMode=_ref;this.imageCache=Object.create(null);this.refill()}_createClass(Parser,[{key:"refill",value:function(){this.buf1=this.lexer.getObj();this.buf2=this.lexer.getObj()}},{key:"shift",value:function(){this.buf2 instanceof
|
|
755
|
+
_primitives.Cmd&&"ID"===this.buf2.cmd?(this.buf1=this.buf2,this.buf2=null):(this.buf1=this.buf2,this.buf2=this.lexer.getObj())}},{key:"tryShift",value:function(){try{return this.shift(),!0}catch(e){if(e instanceof _core_utils.MissingDataException)throw e;return!1}}},{key:"getObj",value:function(){var cipherTransform=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,buf1=this.buf1;this.shift();if(buf1 instanceof _primitives.Cmd)switch(buf1.cmd){case "BI":return this.makeInlineImage(cipherTransform);
|
|
745
756
|
case "[":for(buf1=[];!(0,_primitives.isCmd)(this.buf1,"]")&&!(0,_primitives.isEOF)(this.buf1);)buf1.push(this.getObj(cipherTransform));if((0,_primitives.isEOF)(this.buf1)){if(!this.recoveryMode)throw new _util.FormatError("End of file inside array");return buf1}this.shift();return buf1;case "<<":for(buf1=new _primitives.Dict(this.xref);!(0,_primitives.isCmd)(this.buf1,">>")&&!(0,_primitives.isEOF)(this.buf1);)if((0,_primitives.isName)(this.buf1)){var key=this.buf1.name;this.shift();if((0,_primitives.isEOF)(this.buf1))break;
|
|
746
757
|
buf1.set(key,this.getObj(cipherTransform))}else(0,_util.info)("Malformed dictionary: key must be a name object"),this.shift();if((0,_primitives.isEOF)(this.buf1)){if(!this.recoveryMode)throw new _util.FormatError("End of file inside dictionary");return buf1}if((0,_primitives.isCmd)(this.buf2,"stream"))return this.allowStreams?this.makeStream(buf1,cipherTransform):buf1;this.shift();return buf1;default:return buf1}return Number.isInteger(buf1)?Number.isInteger(this.buf1)&&(0,_primitives.isCmd)(this.buf2,
|
|
747
758
|
"R")?(cipherTransform=_primitives.Ref.get(buf1,this.buf1),this.shift(),this.shift(),cipherTransform):buf1:"string"===typeof buf1&&cipherTransform?cipherTransform.decryptString(buf1):buf1}},{key:"findDefaultInlineStreamEnd",value:function(stream){for(var startPos=stream.pos,state=0,ch,maybeEIPos;-1!==(ch=stream.getByte());)if(0===state)state=69===ch?1:0;else if(1===state)state=73===ch?2:0;else if((0,_util.assert)(2===state),32===ch||10===ch||13===ch){maybeEIPos=stream.pos;for(var followingBytes=stream.peekBytes(10),
|
|
@@ -779,439 +790,440 @@ comment)return!0;if("false"===comment)return!1;if("null"===comment)return null;"
|
|
|
779
790
|
null,[{key:"create",value:function(stream){function getInt(linDict,name){var allowZeroValue=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!1,obj=linDict.get(name);if(Number.isInteger(obj)&&(allowZeroValue?0<=obj:0<obj))return obj;throw Error('The "'.concat(name,'" parameter in the linearization ')+"dictionary is invalid.");}var parser=new Parser({lexer:new Lexer(stream),xref:null}),obj1=parser.getObj(),obj2=parser.getObj(),obj3=parser.getObj();parser=parser.getObj();var obj$jscomp$0;if(!(Number.isInteger(obj1)&&
|
|
780
791
|
Number.isInteger(obj2)&&(0,_primitives.isCmd)(obj3,"obj")&&(0,_primitives.isDict)(parser)&&(0,_util.isNum)(obj$jscomp$0=parser.get("Linearized"))&&0<obj$jscomp$0))return null;if((obj1=getInt(parser,"L"))!==stream.length)throw Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:obj1,hints:function(linDict){linDict=linDict.get("H");var hintsLength;if(Array.isArray(linDict)&&(2===(hintsLength=linDict.length)||4===hintsLength)){for(var index=0;index<
|
|
781
792
|
hintsLength;index++){var hint=linDict[index];if(!(Number.isInteger(hint)&&0<hint))throw Error("Hint (".concat(index,") in the linearization dictionary is invalid."));}return linDict}throw Error("Hint array in the linearization dictionary is invalid.");}(parser),objectNumberFirst:getInt(parser,"O"),endFirst:getInt(parser,"E"),numPages:getInt(parser,"N"),mainXRefEntriesOffset:getInt(parser,"T"),pageFirst:parser.has("P")?getInt(parser,"P",!0):0}}}]);return Linearization}();exports.Linearization=module},
|
|
782
|
-
function(module,exports,__w_pdfjs_require__){
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
(
|
|
791
|
-
|
|
792
|
-
streams;for(var
|
|
793
|
-
|
|
794
|
-
str;this.dict=str.dict;var cmf=str.getByte();str=str.getByte();if(-1===cmf||-1===str)throw new _util.FormatError("Invalid header in flate stream: ".concat(cmf,", ").concat(str));if(8!==(cmf&15))throw new _util.FormatError("Unknown compression method in flate stream: ".concat(cmf,", ").concat(str));if(0!==((cmf<<8)+str)%31)throw new _util.FormatError("Bad FCHECK in flate stream: ".concat(cmf,
|
|
795
|
-
this.codeBuf=this.codeSize=0;DecodeStream.call(this,maybeLength)}var codeLenCodeMap=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lengthDecode=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),distDecode=new Int32Array([1,2,3,4,
|
|
796
|
-
657409,658433,724993,727041,794625,798721,868353,876545]),fixedLitCodeTab=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59E4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,
|
|
797
|
-
590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,
|
|
798
|
-
524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,
|
|
799
|
-
589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,
|
|
800
|
-
589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,
|
|
801
|
-
590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,
|
|
802
|
-
524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,
|
|
803
|
-
589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],fixedDistCodeTab=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,
|
|
804
|
-
this.str,codeSize=this.codeSize,codeBuf=this.codeBuf,b;codeSize<bits;){if(-1===(b=str.getByte()))throw new _util.FormatError("Bad encoding in flate stream");codeBuf|=b<<codeSize;codeSize+=8}this.codeBuf=codeBuf>>bits;this.codeSize=codeSize-bits;return codeBuf&(1<<bits)-1};FlateStream.prototype.getCode=function(table){var str=this.str,codes=table[0],maxLen=table[1];
|
|
805
|
-
(1<<maxLen)-1];str=codes>>16;codes&=65535;if(1>str||table<str)throw new _util.FormatError("Bad encoding in flate stream");this.codeBuf=codeBuf>>str;this.codeSize=table-str;return codes};FlateStream.prototype.generateHuffmanTable=function(lengths){var n=lengths.length,maxLen=0,i;for(i=0;i<n;++i)lengths[i]>maxLen&&(maxLen=lengths[i]);for(var size=1<<maxLen,codes=new Int32Array(size),
|
|
806
|
-
t=code;for(i=0;i<len;++i)code2=code2<<1|t&1,t>>=1;for(i=code2;i<size;i+=skip)codes[i]=len<<16|val;++code}return[codes,maxLen]};FlateStream.prototype.readBlock=function(){var len=this.str;var buffer=this.getBits(3);buffer&1&&(this.eof=!0);buffer>>=1;if(0===buffer){if(-1===(buffer=len.getByte()))throw new _util.FormatError("Bad block header in flate stream");var blockLen=buffer;if(-1===
|
|
807
|
-
(buffer=len.getByte()))throw new _util.FormatError("Bad block header in flate stream");var check=buffer;if(-1===(buffer=len.getByte()))throw new _util.FormatError("Bad block header in flate stream");check|=buffer<<8;if(check!==(~blockLen&65535)&&(0!==blockLen||0!==check))throw new _util.FormatError("Bad uncompressed block length in flate stream");this.codeSize=this.codeBuf=0;check=this.bufferLength;
|
|
808
|
-
(this.eof=!0):(len=len.getBytes(blockLen),buffer.set(len,check),len.length<blockLen&&(this.eof=!0))}else{if(1===buffer)blockLen=fixedLitCodeTab,check=fixedDistCodeTab;else if(2===buffer){buffer=this.getBits(5)+257;end=this.getBits(5)+1;len=this.getBits(4)+4;check=new Uint8Array(codeLenCodeMap.length);for(blockLen=0;blockLen<len;++blockLen)check[codeLenCodeMap[blockLen]]=this.getBits(3);check=
|
|
809
|
-
bitsOffset,what;blockLen<end;){what=this.getCode(check);if(16===what)bitsLength=2,bitsOffset=3,what=len;else if(17===what)bitsOffset=bitsLength=3,what=len=0;else if(18===what)bitsLength=7,bitsOffset=11,what=len=0;else{codeLengths[blockLen++]=len=what;continue}for(bitsLength=this.getBits(bitsLength)+bitsOffset;0<bitsLength--;)codeLengths[blockLen++]=what}blockLen=this.generateHuffmanTable(codeLengths.subarray(0,
|
|
810
|
-
end=(buffer=this.buffer)?buffer.length:0;for(codeLengths=this.bufferLength;;)if(what=this.getCode(blockLen),256>what)codeLengths+1>=end&&(buffer=this.ensureBuffer(codeLengths+1),end=buffer.length),buffer[codeLengths++]=what;else{if(256===what){this.bufferLength=codeLengths;break}what-=257;what=lengthDecode[what];bitsLength=what>>16;0<bitsLength&&(bitsLength=
|
|
811
|
-
this.getBits(bitsLength));what=(what&65535)+bitsLength;codeLengths+len>=end&&(buffer=this.ensureBuffer(codeLengths+len),end=buffer.length);for(bitsLength=0;bitsLength<len;++bitsLength,++codeLengths)buffer[codeLengths]=buffer[codeLengths-what]}}};return FlateStream}();exports.FlateStream=module;module=function(){function PredictorStream(str,maybeLength,
|
|
812
|
-
(10>predictor||15<predictor))throw new _util.FormatError("Unsupported predictor: ".concat(predictor));this.readBlock=2===predictor?this.readBlockTiff:this.readBlockPng;this.str=str;this.dict=str.dict;str=this.colors=params.get("Colors")||1;predictor=this.bits=params.get("BitsPerComponent")||8;params=this.columns=params.get("Columns")||1;this.pixBytes=
|
|
813
|
-
PredictorStream.prototype.readBlockTiff=function(){var rowBytes=this.rowBytes,bufferLength=this.bufferLength,buffer=this.ensureBuffer(bufferLength+rowBytes),bits=this.bits,colors=this.colors,rawBytes=this.str.getBytes(rowBytes);this.eof=!rawBytes.length;if(!this.eof){var inbuf=0,outbuf=0,inbits=0,outbits=0,pos=bufferLength;if(1===
|
|
814
|
-
bits;else if(8===bits){for(bufferLength=0;bufferLength<colors;++bufferLength)buffer[pos++]=rawBytes[bufferLength];for(;bufferLength<rowBytes;++bufferLength)buffer[pos]=buffer[pos-colors]+rawBytes[bufferLength],pos++}else if(16===bits){inbuf=2*colors;for(bufferLength=0;bufferLength<inbuf;++bufferLength)buffer[pos++]=rawBytes[bufferLength];
|
|
815
|
-
255),buffer[pos++]=bits>>8&255,buffer[pos++]=bits&255}else{pos=new Uint8Array(colors+1);var bitMask=(1<<bits)-1,j=0,k=bufferLength,columns=this.columns;for(bufferLength=0;bufferLength<columns;++bufferLength)for(var kk=0;kk<colors;++kk)inbits<bits&&(inbuf=inbuf<<8|rawBytes[j++]&255,inbits+=8),pos[kk]=pos[kk]+(inbuf>>inbits-bits)&bitMask,
|
|
816
|
-
(1<<8-outbits)-1))}this.bufferLength+=rowBytes}};PredictorStream.prototype.readBlockPng=function(){var rowBytes=this.rowBytes,pixBytes=this.pixBytes,predictor=this.str.getByte(),rawBytes=this.str.getBytes(rowBytes);this.eof=!rawBytes.length;if(!this.eof){var bufferLength=this.bufferLength,buffer=this.ensureBuffer(bufferLength+rowBytes),
|
|
817
|
-
rowBytes;++predictor)buffer[bufferLength++]=rawBytes[predictor];break;case 1:for(predictor=0;predictor<pixBytes;++predictor)buffer[bufferLength++]=rawBytes[predictor];for(;predictor<rowBytes;++predictor)buffer[bufferLength]=buffer[bufferLength-pixBytes]+rawBytes[predictor]&255,bufferLength++;break;case 2:for(predictor=0;predictor<rowBytes;++predictor)buffer[bufferLength++]=
|
|
818
|
-
(prevRow[predictor]>>1)+rawBytes[predictor];for(;predictor<rowBytes;++predictor)buffer[bufferLength]=(prevRow[predictor]+buffer[bufferLength-pixBytes]>>1)+rawBytes[predictor]&255,bufferLength++;break;case 4:for(predictor=0;predictor<pixBytes;++predictor){var up=prevRow[predictor];var c=rawBytes[predictor];buffer[bufferLength++]=up+c}for(;predictor<rowBytes;++predictor){up=
|
|
819
|
-
pa&&(pa=-pa);var pb=c-up;0>pb&&(pb=-pb);var pc=c-upLeft;0>pc&&(pc=-pc);c=rawBytes[predictor];pa<=pb&&pa<=pc?buffer[bufferLength++]=left+c:pb<=pc?buffer[bufferLength++]=up+c:buffer[bufferLength++]=upLeft+c}break;default:throw new _util.FormatError("Unsupported predictor: ".concat(predictor));}this.bufferLength+=rowBytes}};return PredictorStream}();exports.PredictorStream=module;
|
|
820
|
-
null;this.initialized=!1;DecodeStream.call(this,maybeLength)}DecryptStream.prototype=Object.create(DecodeStream.prototype);DecryptStream.prototype.readBlock=function(){if(this.initialized)var chunk=this.nextChunk;else chunk=this.str.getBytes(512),this.initialized=!0;if(chunk&&0!==chunk.length){this.nextChunk=this.str.getBytes(512);var decrypt=this.decrypt;chunk=decrypt(chunk
|
|
821
|
-
n);for(i=0;i<n;i++)buffer[decrypt++]=chunk[i];this.bufferLength=decrypt}else this.eof=!0};return DecryptStream}();exports.DecryptStream=module;module=function(){function Ascii85Stream(str,maybeLength){this.str=str;this.dict=str.dict;this.input=new Uint8Array(5);maybeLength&&(maybeLength*=.8);DecodeStream.call(this,maybeLength)}Ascii85Stream.prototype=Object.create(DecodeStream.prototype);
|
|
822
|
-
if(-1===c||126===c)this.eof=!0;else{var bufferLength=this.bufferLength,i;if(122===c){str=this.ensureBuffer(bufferLength+4);for(i=0;4>i;++i)str[bufferLength+i]=0;this.bufferLength+=4}else{var input=this.input;input[0]=c;for(i=1;5>i;++i){for(c=str.getByte();(0,_util.isSpace)(c);)c=str.getByte();input[i]=c;if(-1===c||126===c)break}str=this.ensureBuffer(bufferLength+i-1);this.bufferLength+=
|
|
823
|
-
i]=c&255,c>>=8}}};return Ascii85Stream}();exports.Ascii85Stream=module;module=function(){function AsciiHexStream(str,maybeLength){this.str=str;this.dict=str.dict;this.firstDigit=-1;maybeLength&&(maybeLength*=.5);DecodeStream.call(this,maybeLength)}AsciiHexStream.prototype=Object.create(DecodeStream.prototype);AsciiHexStream.prototype.readBlock=function(){var bytes=this.str.getBytes(8E3);
|
|
824
|
-
firstDigit=this.firstDigit,i=0,ii=bytes.length;i<ii;i++){var ch=bytes[i];if(48<=ch&&57>=ch)ch&=15;else if(65<=ch&&70>=ch||97<=ch&&102>=ch)ch=(ch&15)+9;else if(62===ch){this.eof=!0;break}else continue;0>firstDigit?firstDigit=ch:(buffer[bufferLength++]=firstDigit<<4|ch,firstDigit=-1)}0<=firstDigit&&this.eof&&(buffer[bufferLength++]=firstDigit<<4,firstDigit=-1);this.firstDigit=firstDigit;
|
|
825
|
-
maybeLength){this.str=str;this.dict=str.dict;DecodeStream.call(this,maybeLength)}RunLengthStream.prototype=Object.create(DecodeStream.prototype);RunLengthStream.prototype.readBlock=function(){var repeatHeader=this.str.getBytes(2);if(!repeatHeader||2>repeatHeader.length||128===repeatHeader[0])this.eof=!0;else{var bufferLength=this.bufferLength,n=repeatHeader[0];
|
|
826
|
-
bufferLength),bufferLength+=n)}else{n=257-n;repeatHeader=repeatHeader[1];buffer=this.ensureBuffer(bufferLength+n+1);for(var i=0;i<n;i++)buffer[bufferLength++]=repeatHeader}this.bufferLength=bufferLength}};return RunLengthStream}();exports.RunLengthStream=module;module=function(){function LZWStream(str,maybeLength,earlyChange){this.str=str;
|
|
827
|
-
dictionaryPrevCodes:new Uint16Array(4096),currentSequence:new Uint8Array(4096),currentSequenceLength:0};for(earlyChange=0;256>earlyChange;++earlyChange)str.dictionaryValues[earlyChange]=earlyChange,str.dictionaryLengths[earlyChange]=1;this.lzwState=str;DecodeStream.call(this,maybeLength)}LZWStream.prototype=Object.create(DecodeStream.prototype);
|
|
828
|
-
|
|
829
|
-
prevCode=lzwState.prevCode,currentSequence=lzwState.currentSequence,currentSequenceLength=lzwState.currentSequenceLength,decodedLength=0,currentBufferLength=this.bufferLength,buffer=this.ensureBuffer(this.bufferLength+estimatedDecodedSize);for(i=0;512>i;i++){var code=this.readBits(codeLength),hasPrev=0<currentSequenceLength;if(256>
|
|
830
|
-
code;0<=j;j--)currentSequence[j]=dictionaryValues[q],q=dictionaryPrevCodes[q]}else currentSequence[currentSequenceLength++]=currentSequence[0];else if(256===code){codeLength=9;nextCode=258;currentSequenceLength=0;continue}else{this.eof=!0;delete this.lzwState;break}hasPrev&&(dictionaryPrevCodes[nextCode]=prevCode,dictionaryLengths[nextCode]=
|
|
831
|
-
earlyChange)/.6931471805599453+1,12)|0);prevCode=code;decodedLength+=currentSequenceLength;if(estimatedDecodedSize<decodedLength){do estimatedDecodedSize+=512;while(estimatedDecodedSize<decodedLength);buffer=this.ensureBuffer(this.bufferLength+estimatedDecodedSize)}for(j=0;j<currentSequenceLength;j++)buffer[currentBufferLength++]=
|
|
832
|
-
currentBufferLength}};return LZWStream}();exports.LZWStream=module;module=function(){function NullStream(){Stream.call(this,new Uint8Array(0))}NullStream.prototype=Stream.prototype;return NullStream}();exports.NullStream=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});
|
|
833
|
-
maybeLength,params){this.str=str;this.dict=str.dict;(0,_primitives.isDict)(params)||(params=_primitives.Dict.empty);this.ccittFaxDecoder=new _ccitt.CCITTFaxDecoder({next:function(){return str.getByte()}},{K:params.get("K"),EndOfLine:params.get("EndOfLine"),EncodedByteAlign:params.get("EncodedByteAlign"),Columns:params.get("Columns"),
|
|
834
|
-
CCITTFaxStream.prototype.readBlock=function(){for(;!this.eof;){var c=this.ccittFaxDecoder.readNextChar();if(-1===c){this.eof=!0;break}this.ensureBuffer(this.bufferLength+1);this.buffer[this.bufferLength++]=c}};return CCITTFaxStream}();exports.CCITTFaxStream=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,
|
|
835
|
-
void 0!==arguments[1]?arguments[1]:{};if(!source||"function"!==typeof source.next)throw Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=source;this.eof=!1;this.encoding=options.K||0;this.eoline=options.EndOfLine||!1;this.byteAlign=options.EncodedByteAlign||!1;this.columns=options.Columns||1728;this.rows=options.Rows||
|
|
836
|
-
1);this.refLine=new Uint32Array(this.columns+2);this.codingLine[0]=this.columns;this.row=this.codingPos=0;this.nextLine2D=0>this.encoding;this.outputBits=this.inputBuf=this.inputBits=0;for(this.rowsDone=!1;0===(options=this._lookBits(12));)this._eatBits(1);1===options&&this._eatBits(12);0<this.encoding&&(this.nextLine2D=!this._lookBits(1),
|
|
837
|
-
1
|
|
838
|
-
[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]
|
|
839
|
-
29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],
|
|
840
|
-
|
|
841
|
-
[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],
|
|
842
|
-
[
|
|
843
|
-
[
|
|
844
|
-
|
|
845
|
-
[
|
|
846
|
-
[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[
|
|
847
|
-
[
|
|
848
|
-
[10,64]],blackTable2=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],
|
|
849
|
-
[
|
|
850
|
-
[
|
|
851
|
-
[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];CCITTFaxDecoder.prototype=
|
|
852
|
-
(this.eof=!0);if(this.eof)return-1;this.err=!1;var code2,code3;if(this.nextLine2D){for(refPos=0;codingLine[refPos]<columns;++refPos)refLine[refPos]=codingLine[refPos];refLine[refPos++]=columns;refLine[refPos]=columns;for(blackPixels=refPos=this.codingPos=codingLine[0]=0;codingLine[this.codingPos]<columns;){var bits=this._getTwoDimCode();
|
|
853
|
-
this._getBlackCode();while(64<=code3);do code2+=code3=this._getWhiteCode();while(64<=code3)}else{do bits+=code3=this._getWhiteCode();while(64<=code3);do code2+=code3=this._getBlackCode();while(64<=code3)}this._addPixels(codingLine[this.codingPos]+bits,blackPixels);for(codingLine[this.codingPos]<columns&&this._addPixels(codingLine[this.codingPos]+
|
|
854
|
-
blackPixels
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
this._addPixels(columns,0),this.err=!0}}}else for(blackPixels=this.codingPos=codingLine[0]=0;codingLine[this.codingPos]<columns;){bits=0;if(blackPixels){do bits+=code3=this._getBlackCode();while(64<=code3)}else{do bits+=code3=this._getWhiteCode();while(64<=code3)}this._addPixels(codingLine[this.codingPos]+bits,blackPixels);blackPixels^=1}refLine
|
|
858
|
-
bits=this._lookBits(12);else for(;0===bits;)this._eatBits(1),bits=this._lookBits(12);1===bits?(this._eatBits(12),refLine=!0):-1===bits&&(this.eof=!0)}else this.rowsDone=!0;!this.eof&&0<this.encoding&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1));if(this.eoblock&&refLine&&this.byteAlign){if(bits=this._lookBits(12),
|
|
859
|
-
(0,_util.info)("bad rtc code: "+bits),this._eatBits(12),0<this.encoding&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){bits=this._lookBits(13);if(-1===bits)return this.eof=!0,-1;if(1===bits>>1)break;this._eatBits(1)}this._eatBits(12);0<this.encoding&&(this._eatBits(1),this.nextLine2D=!(bits&
|
|
860
|
-
8,0===this.outputBits&&codingLine[this.codingPos]<columns&&(this.codingPos++,this.outputBits=codingLine[this.codingPos]-codingLine[this.codingPos-1]);else{bits=8;refLine=0;do this.outputBits>bits?(refLine<<=bits,this.codingPos&1||(refLine|=255>>8-bits),this.outputBits-=bits,bits=0):(refLine<<=this.outputBits,this.codingPos&1||
|
|
861
|
-
1]):0<bits&&(refLine<<=bits,bits=0));while(bits)}this.black&&(refLine^=255);return refLine},_addPixels:function(a1,blackPixels){var codingLine=this.codingLine,codingPos=this.codingPos;a1>codingLine[codingPos]&&(a1>this.columns&&((0,_util.info)("row is wrong length"),this.err=!0,a1=this.columns),codingPos&
|
|
862
|
-
this.columns&&((0,_util.info)("row is wrong length"),this.err=!0,a1=this.columns),codingPos&1^blackPixels&&++codingPos,codingLine[codingPos]=a1;else if(a1<codingLine[codingPos]){0>a1&&((0,_util.info)("invalid code"),this.err=!0,a1=0);for(;0<codingPos&&a1<codingLine[codingPos-1];)--codingPos;codingLine[codingPos]=
|
|
863
|
-
end-start);if(!limit||code>=limit)if(code=table[code-limit],code[0]===start)return this._eatBits(start),[!0,code[1],!0]}return[!1,0,!1]},_getTwoDimCode:function(){if(this.eoblock){var code=this._lookBits(7);if((code=twoDimTable[code])&&0<code[0])return this._eatBits(code[0]),code[1]}else if(code=this._findTableCode(1,
|
|
864
|
-
code=0===code>>5?whiteTable1[code]:whiteTable2[code>>3];if(0<code[0])return this._eatBits(code[0]),code[1]}else{code=this._findTableCode(1,9,whiteTable2);if(code[0])return code[1];code=this._findTableCode(11,12,whiteTable1);if(code[0])return code[1]}(0,_util.info)("bad white code");this._eatBits(1);return 1},_getBlackCode:function(){if(this.eoblock){var code=
|
|
865
|
-
7];if(0<code[0])return this._eatBits(code[0]),code[1]}else{code=this._findTableCode(2,6,blackTable3);if(code[0])return code[1];code=this._findTableCode(7,12,blackTable2,64);if(code[0])return code[1];code=this._findTableCode(10,13,blackTable1);if(code[0])return code[1]}(0,_util.info)("bad black code");this._eatBits(1);return 1},_lookBits:function(n){for(var c;this.inputBits<
|
|
866
|
-
8|c;this.inputBits+=8}return this.inputBuf>>this.inputBits-n&65535>>16-n},_eatBits:function(n){0>(this.inputBits-=n)&&(this.inputBits=0)}};return CCITTFaxDecoder}();exports.CCITTFaxDecoder=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.Jbig2Stream=void 0;var _primitives=__w_pdfjs_require__(188),
|
|
867
|
-
maybeLength,dict,params){this.stream=stream;this.maybeLength=maybeLength;this.dict=dict;this.params=params;_stream.DecodeStream.call(this,maybeLength)}Jbig2Stream.prototype=Object.create(_stream.DecodeStream.prototype);Object.defineProperty(Jbig2Stream.prototype,"bytes",{get:function(){return(0,_util.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},
|
|
868
|
-
new _jbig.Jbig2Image,chunks=[];if((0,_primitives.isDict)(this.params)){var globalsStream=this.params.get("JBIG2Globals");(0,_primitives.isStream)(globalsStream)&&(globalsStream=globalsStream.getBytes(),chunks.push({data:globalsStream,start:0,end:globalsStream.length}))}chunks.push({data:this.bytes,start:0,end:this.bytes.length});jbig2Image=jbig2Image.parseChunks(chunks);
|
|
869
|
-
this.bufferLength=chunks;this.eof=!0}};return Jbig2Stream}();exports.Jbig2Stream=module},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?
|
|
870
|
-
Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,
|
|
871
|
-
Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}Object.defineProperty(exports,"__esModule",{value:!0});exports.Jbig2Image=void 0;var _util=__w_pdfjs_require__(5),_arithmetic_decoder=__w_pdfjs_require__(200),_ccitt=__w_pdfjs_require__(197),Jbig2Error=function(_BaseException){function Jbig2Error(msg){if(!(this instanceof
|
|
872
|
-
if(!msg||"object"!==_typeof(msg)&&"function"!==typeof msg){if(void 0===this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");msg=this}return msg}_inherits(Jbig2Error,_BaseException);return Jbig2Error}(_util.BaseException);module=function(){function ContextCache(){}function DecodingContext(data,start,end){this.data=data;this.start=
|
|
873
|
-
decoder.readBit(contexts,prev);prev=256>prev?prev<<1|bit:(prev<<1|bit)&511|256;v=v<<1|bit}return v>>>0}var contexts=contextCache.getContexts(procedure),prev=1;contextCache=readBits(1);procedure=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 0===contextCache?
|
|
874
|
-
for(var prev=1,i=0;i<codeLength;i++){var bit=decoder.readBit(contextCache,prev);prev=prev<<1|bit}return 31>codeLength?prev&(1<<codeLength)-1:prev&2147483647}function decodeBitmapTemplate0(width,height,decodingContext){var decoder=decodingContext.decoder;decodingContext=decodingContext.contextCache.getContexts("GB");var i,j,pixel,bitmap=[];for(i=0;i<height;i++){var row=
|
|
875
|
-
row2[2]<<11|row1[0]<<7|row1[1]<<6|row1[2]<<5|row1[3]<<4;for(j=0;j<width;j++)row[j]=pixel=decoder.readBit(decodingContext,contextLabel),contextLabel=(contextLabel&31735)<<1|(j+3<width?row2[j+3]<<11:0)|(j+4<width?row1[j+4]<<4:0)|pixel}return bitmap}function decodeBitmap(mmr,width,height,templateIndex,prediction,skip,at,decodingContext){if(mmr)return prediction=new Reader(decodingContext.data,
|
|
876
|
-
|
|
877
|
-
templateY[k]=template[k].y,minX=Math.min(minX,template[k].x),maxX=Math.max(maxX,template[k].x),minY=Math.min(minY,template[k].y),k<at-1&&template[k].y===template[k+1].y&&template[k].x===template[k+1].x-1?reuseMask|=1<<at-1-k:changingTemplateEntries.push(k);var changingEntriesLength=changingTemplateEntries.length,changingTemplateX=new Int8Array(changingEntriesLength),changingTemplateY=new Int8Array(changingEntriesLength),
|
|
878
|
-
changingTemplateEntries[c],changingTemplateX[c]=template[k].x,changingTemplateY[c]=template[k].y,changingTemplateBit[c]=1<<at-1-k;template=-minX;minY=-minY;maxX=width-maxX;templateIndex=ReusedContexts[templateIndex];changingTemplateEntries=new Uint8Array(width);minX=[];c=decodingContext.decoder;decodingContext=decodingContext.contextCache.getContexts("GB");for(var ltp=0,j,i0,j0,contextLabel=0,shift,i=
|
|
879
|
-
continue}changingTemplateEntries=new Uint8Array(changingTemplateEntries);minX.push(changingTemplateEntries);for(j=0;j<width;j++)if(mmr&&skip[i][j])changingTemplateEntries[j]=0;else{if(j>=template&&j<maxX&&i>=minY)for(contextLabel=contextLabel<<1&reuseMask,k=0;k<changingEntriesLength;k++){if(i0=i+changingTemplateY[k],j0=j+changingTemplateX[k],i0=minX[i0][j0])i0=changingTemplateBit[k],
|
|
880
|
-
0<=i0&&(i0=minX[i0][j0])&&(contextLabel|=i0<<shift));k=c.readBit(decodingContext,contextLabel);changingTemplateEntries[j]=k}}return minX}function decodeRefinement(width,height,templateIndex,referenceBitmap,offsetX,offsetY,prediction,at,decodingContext){var codingTemplate=RefinementTemplates[templateIndex].coding;0===templateIndex&&(codingTemplate=codingTemplate.concat([at[0]]));
|
|
881
|
-
k;for(k=0;k<codingTemplateLength;k++)codingTemplateX[k]=codingTemplate[k].x,codingTemplateY[k]=codingTemplate[k].y;var referenceTemplate=RefinementTemplates[templateIndex].reference;0===templateIndex&&(referenceTemplate=referenceTemplate.concat([at[1]]));at=referenceTemplate.length;codingTemplate=new Int32Array(at);var referenceTemplateY=new Int32Array(at);
|
|
882
|
-
var referenceHeight=referenceBitmap.length;templateIndex=RefinementReusedContexts[templateIndex];var bitmap=[],decoder=decodingContext.decoder;decodingContext=decodingContext.contextCache.getContexts("GR");for(var ltp=0,i=0;i<height;i++){if(prediction&&(k=decoder.readBit(decodingContext,templateIndex),ltp^=k))throw new Jbig2Error("prediction is not supported");
|
|
883
|
-
var j0=j+codingTemplateX[k];contextLabel=0>i0||0>j0||j0>=width?contextLabel<<1:contextLabel<<1|bitmap[i0][j0]}for(k=0;k<at;k++)i0=i+referenceTemplateY[k]-offsetY,j0=j+codingTemplate[k]-offsetX,contextLabel=0>i0||i0>=referenceHeight||0>j0||j0>=referenceTemplate?contextLabel<<1:contextLabel<<1|referenceBitmap[i0][j0];k=decoder.readBit(decodingContext,
|
|
884
|
-
symbolCodeLength,transposed,dsOffset,referenceCorner,combinationOperator,huffmanTables,refinementTemplateIndex,refinementAt,decodingContext,logStripSize,huffmanInput){if(huffman&&refinement)throw new Jbig2Error("refinement with Huffman is not supported");var bitmap=[],i;for(i=0;i<height;i++){var row=new Uint8Array(width);if(defaultPixelValue)for(var j=
|
|
885
|
-
|
|
886
|
-
currentT=huffman?huffmanTables.symbolIDTable.decode(huffmanInput):decodeIAID(defaultPixelValue,height,symbolCodeLength);var applyRefinement=refinement&&(huffman?huffmanInput.readBit():decodeInteger(defaultPixelValue,"IARI",height));currentT=inputSymbols[currentT];var symbolWidth=currentT[0].length,symbolHeight=
|
|
887
|
-
"IARDX",height),rdy=decodeInteger(defaultPixelValue,"IARDY",height);symbolWidth+=applyRefinement;symbolHeight+=rdh;currentT=decodeRefinement(symbolWidth,symbolHeight,refinementTemplateIndex,currentT,(applyRefinement>>1)+rdx,(rdh>>1)+rdy,!1,refinementAt,decodingContext)}applyRefinement=row-(referenceCorner&1?
|
|
888
|
-
applyRefinement,symbolWidth);switch(combinationOperator){case 0:for(rdy=0;rdy<maxWidth;rdy++)row[applyRefinement+rdy]|=symbolRow[rdy];break;case 2:for(rdy=0;rdy<maxWidth;rdy++)row[applyRefinement+rdy]^=symbolRow[rdy];break;default:throw new Jbig2Error("operator ".concat(combinationOperator," is not supported"));
|
|
889
|
-
rdx]|=symbolRow[rdx];break;case 2:for(rdx=0;rdx<symbolWidth;rdx++)row[rdh+rdx]^=symbolRow[rdx];break;default:throw new Jbig2Error("operator ".concat(combinationOperator," is not supported"));}deltaT+=symbolWidth-1}i++;currentT=huffman?huffmanTables.tableDeltaS.decode(huffmanInput):decodeInteger(defaultPixelValue,
|
|
890
|
-
end;){start$jscomp$0=data;var start=position;position={};position.number=(0,_util.readUint32)(start$jscomp$0,start);var ii=start$jscomp$0[start+4];var segmentType=ii&63;if(!SegmentTypes[segmentType])throw new Jbig2Error("invalid segment type: "+segmentType);position.type=segmentType;position.typeName=SegmentTypes[segmentType];
|
|
891
|
-
(0,_util.readUint32)(start$jscomp$0,start-1)&536870911,start+=3,referredFlags=referredToCount+7>>3,i[0]=start$jscomp$0[start++];0<--referredFlags;)i.push(start$jscomp$0[start++]);else if(5===referredFlags||6===referredFlags)throw new Jbig2Error("invalid referred-to flags");position.retainBits=i;referredFlags=
|
|
892
|
-
start):(0,_util.readUint32)(start$jscomp$0,start);referredTo.push(number);start+=referredFlags}position.referredTo=referredTo;ii?(position.pageAssociation=(0,_util.readUint32)(start$jscomp$0,start),start+=4):position.pageAssociation=start$jscomp$0[start++];position.length=(0,_util.readUint32)(start$jscomp$0,
|
|
893
|
-
1);segmentType=new Uint8Array(6);referredToCount||(segmentType[0]=255,segmentType[1]=172);segmentType[2]=ii.height>>>24&255;segmentType[3]=ii.height>>16&255;segmentType[4]=ii.height>>8&255;segmentType[5]=ii.height&255;i=start;for(ii=start$jscomp$0.length;i<ii;i++){for(referredToCount=0;6>referredToCount&&
|
|
894
|
-
}else throw new Jbig2Error("invalid unknown segment length");position.headerEnd=start;start$jscomp$0=position;position=start$jscomp$0.headerEnd;start={header:start$jscomp$0,data:data};header.randomAccess||(start.start=position,position+=start$jscomp$0.length,start.end=position);segments.push(start);
|
|
895
|
-
position;return segments}function readRegionSegmentInformation(data,start){return{width:(0,_util.readUint32)(data,start),height:(0,_util.readUint32)(data,start+4),x:(0,_util.readUint32)(data,start+8),y:(0,_util.readUint32)(data,start+12),combinationOperator:data[start+16]&7}}function processSegments(segments,
|
|
896
|
-
segment=segment.end;switch(header.type){case 0:var dictionary={};i$jscomp$0=(0,_util.readUint16)(data,position);dictionary.huffman=!!(i$jscomp$0&1);dictionary.refinement=!!(i$jscomp$0&2);dictionary.huffmanDHSelector=i$jscomp$0>>2&3;dictionary.huffmanDWSelector=i$jscomp$0>>4&3;dictionary.bitmapSizeSelector=i$jscomp$0>>
|
|
897
|
-
i$jscomp$0>>10&3;dictionary.refinementTemplate=i$jscomp$0>>12&1;position+=2;if(!dictionary.huffman){var atLength=0===dictionary.template?4:1;var at=[];for(i$jscomp$0=0;i$jscomp$0<atLength;i$jscomp$0++)at.push({x:(0,_util.readInt8)(data,position),y:(0,_util.readInt8)(data,position+1)}),position+=2;dictionary.at=
|
|
898
|
-
1)}),position+=2;dictionary.refinementAt=at}dictionary.numberOfExportedSymbols=(0,_util.readUint32)(data,position);position+=4;dictionary.numberOfNewSymbols=(0,_util.readUint32)(data,position);i$jscomp$0=[dictionary,header.number,header.referredTo,data,position+4,segment];break;case 6:case 7:atLength={};atLength.info=
|
|
899
|
-
atLength.refinement=!!(i$jscomp$0&2);atLength.logStripSize=i$jscomp$0>>2&3;atLength.stripSize=1<<atLength.logStripSize;atLength.referenceCorner=i$jscomp$0>>4&3;atLength.transposed=!!(i$jscomp$0&64);atLength.combinationOperator=i$jscomp$0>>7&3;atLength.defaultPixelValue=i$jscomp$0>>9&1;atLength.dsOffset=i$jscomp$0<<17>>
|
|
900
|
-
2&3,atLength.huffmanDT=i$jscomp$0>>4&3,atLength.huffmanRefinementDW=i$jscomp$0>>6&3,atLength.huffmanRefinementDH=i$jscomp$0>>8&3,atLength.huffmanRefinementDX=i$jscomp$0>>10&3,atLength.huffmanRefinementDY=i$jscomp$0>>12&3,atLength.huffmanRefinementSizeSelector=!!(i$jscomp$0&16384));if(atLength.refinement&&!atLength.refinementTemplate){at=
|
|
901
|
-
at}atLength.numberOfSymbolInstances=(0,_util.readUint32)(data,position);i$jscomp$0=[atLength,header.referredTo,data,position+4,segment];break;case 16:i$jscomp$0={};at=data[position++];i$jscomp$0.mmr=!!(at&1);i$jscomp$0.template=at>>1&3;i$jscomp$0.patternWidth=data[position++];i$jscomp$0.patternHeight=data[position++];i$jscomp$0.maxPatternIndex=
|
|
902
|
-
position);position+=RegionSegmentInformationFieldLength;at=data[position++];i$jscomp$0.mmr=!!(at&1);i$jscomp$0.template=at>>1&3;i$jscomp$0.enableSkip=!!(at&8);i$jscomp$0.combinationOperator=at>>4&7;i$jscomp$0.defaultPixelValue=at>>7&1;i$jscomp$0.gridWidth=(0,_util.readUint32)(data,position);position+=4;i$jscomp$0.gridHeight=
|
|
903
|
-
position)&4294967295;position+=4;i$jscomp$0.gridVectorX=(0,_util.readUint16)(data,position);position+=2;i$jscomp$0.gridVectorY=(0,_util.readUint16)(data,position);i$jscomp$0=[i$jscomp$0,header.referredTo,data,position+2,segment];break;case 38:case 39:dictionary={};dictionary.info=readRegionSegmentInformation(data,position);
|
|
904
|
-
8);if(!dictionary.mmr){atLength=0===dictionary.template?4:1;at=[];for(i$jscomp$0=0;i$jscomp$0<atLength;i$jscomp$0++)at.push({x:(0,_util.readInt8)(data,position),y:(0,_util.readInt8)(data,position+1)}),position+=2;dictionary.at=at}i$jscomp$0=[dictionary,data,position,segment];break;case 48:segment={width:(0,_util.readUint32)(data,
|
|
905
|
-
segment.height&&delete segment.height;i$jscomp$0=data[position+16];(0,_util.readUint16)(data,position+17);segment.lossless=!!(i$jscomp$0&1);segment.refinement=!!(i$jscomp$0&2);segment.defaultPixelValue=i$jscomp$0>>2&1;segment.combinationOperator=i$jscomp$0>>3&3;segment.requiresBuffer=!!(i$jscomp$0&32);segment.combinationOperatorOverride
|
|
906
|
-
default:throw new Jbig2Error("segment type ".concat(header.typeName,"(").concat(header.type,")")+" is not implemented");}header="on"+header.typeName;header in visitor&&visitor[header].apply(visitor,i$jscomp$0)}}function SimpleSegmentVisitor(){}function HuffmanLine(lineData){2===lineData.length?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=
|
|
907
|
-
lineData[2],this.prefixCode=lineData[3],this.isLowerRange="lower"===lineData[4])}function HuffmanTreeNode(line){this.children=[];line?(this.isLeaf=!0,this.rangeLength=line.rangeLength,this.rangeLow=line.rangeLow,this.isLowerRange=line.isLowerRange,this.isOOB=line.isOOB):this.isLeaf=!1}function HuffmanTable(lines,prefixCodesDone){prefixCodesDone||
|
|
908
|
-
lines[prefixCodesDone];0<line.prefixLength&&this.rootNode.buildTree(line,line.prefixLength-1)}}function getStandardTable(number){var table=standardTablesCache[number];if(table)return table;switch(number){case 1:table=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:table=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,
|
|
909
|
-
case 4:table=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:table=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:table=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],
|
|
910
|
-
5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:table=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,
|
|
911
|
-
9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:table=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],
|
|
912
|
-
[
|
|
913
|
-
6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:table=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:table=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new Jbig2Error("standard table B.".concat(number,
|
|
914
|
-
|
|
915
|
-
new _ccitt.CCITTFaxDecoder(input,{K:-1,Columns:width,Rows:height,BlackIs1:!0,EndOfBlock:endOfBlock});var bitmap=[],x,y,eof=!1;for(y=0;y<height;y++){var row=new Uint8Array(width);bitmap.push(row);var shift=-1;for(x=0;x<width;x++){if(0>shift){var currentByte=input.readNextChar();-1===currentByte&&(currentByte=0,eof=!0);shift=7}row[x]=currentByte>>shift&1;shift--}}if(endOfBlock
|
|
916
|
-
this?this[id]:this[id]=new Int8Array(65536)}};DecodingContext.prototype={get decoder(){var decoder=new _arithmetic_decoder.ArithmeticDecoder(this.data,this.start,this.end);return(0,_util.shadow)(this,"decoder",decoder)},get contextCache(){var cache=new ContextCache;return(0,_util.shadow)(this,"contextCache",cache)}};var SegmentTypes=["SymbolDictionary",
|
|
917
|
-
null,null,null,"
|
|
918
|
-
null,null,null,"Extension"],CodingTemplates=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,
|
|
919
|
-
{x:-2,y:0},{x:-1,y:0}]],RefinementTemplates=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],ReusedContexts=[39717,1941,229,405],RefinementReusedContexts=[32,
|
|
920
|
-
info;var buffer=new Uint8ClampedArray((info.width+7>>3)*info.height);if(info.defaultPixelValue){info=0;for(var ii=buffer.length;info<ii;info++)buffer[info]=255}this.buffer=buffer},drawBitmap:function(regionInfo,bitmap){var pageInfo=this.currentPageInfo,width=regionInfo.width,height=regionInfo.height,rowSize=pageInfo.width+7>>3,combinationOperator=pageInfo.combinationOperatorOverride?
|
|
921
|
-
regionInfo.y*rowSize+(regionInfo.x>>3);var j;switch(combinationOperator){case 0:for(combinationOperator=0;combinationOperator<height;combinationOperator++){var mask=mask0;var offset=regionInfo;for(j=0;j<width;j++)bitmap[combinationOperator][j]&&(pageInfo[offset]|=mask),mask>>=1,mask||(mask=128,offset++);regionInfo+=rowSize}break;case 2:for(combinationOperator=0;combinationOperator<
|
|
922
|
-
mask),mask>>=1,mask||(mask=128,offset++);regionInfo+=rowSize}break;default:throw new Jbig2Error("operator ".concat(combinationOperator," is not supported"));}},onImmediateGenericRegion:function(region,data,start,end){var regionInfo=region.info;data=new DecodingContext(data,start,end);region=decodeBitmap(region.mmr,regionInfo.width,regionInfo.height,region.template,region.prediction,
|
|
923
|
-
arguments)},onSymbolDictionary:function(dictionary,currentSegment,referredSegments,data,start,end){if(dictionary.huffman){var customTables=this.customTables,customIndex=0;switch(dictionary.huffmanDHSelector){case 0:case 1:var tableDeltaHeight=getStandardTable(dictionary.huffmanDHSelector+4);break;case 3:tableDeltaHeight=getCustomHuffmanTable(customIndex,referredSegments,
|
|
924
|
-
getStandardTable(dictionary.huffmanDWSelector+2);break;case 3:huffmanInput=getCustomHuffmanTable(customIndex,referredSegments,customTables);customIndex++;break;default:throw new Jbig2Error("invalid Huffman DW selector");}if(dictionary.bitmapSizeSelector){var huffmanTables=getCustomHuffmanTable(customIndex,referredSegments,customTables);
|
|
925
|
-
getStandardTable(1);huffmanTables={tableDeltaHeight:tableDeltaHeight,tableDeltaWidth:huffmanInput,tableBitmapSize:huffmanTables,tableAggregateInstances:customTables};huffmanInput=new Reader(data,start,end)}customIndex=this.symbols;customIndex||(this.symbols=customIndex={});customTables=[];tableDeltaHeight=0;for(var ii=referredSegments.length;tableDeltaHeight<
|
|
926
|
-
new DecodingContext(data,start,end);referredSegments=customIndex;end=dictionary.huffman;customIndex=dictionary.refinement;start=customTables;data=dictionary.numberOfNewSymbols;ii=huffmanTables;referredSymbols=dictionary.template;var at=dictionary.at,refinementTemplateIndex=dictionary.refinementTemplate,refinementAt=dictionary.refinementAt;
|
|
927
|
-
data);huffmanTables=tableDeltaHeight.decoder;customTables=tableDeltaHeight.contextCache;if(end){var tableB1=getStandardTable(1);var symbolWidths=[];symbolCodeLength=Math.max(symbolCodeLength,1)}for(;dictionary.length<data;){var deltaHeight=end?ii.tableDeltaHeight.decode(huffmanInput):decodeInteger(customTables,"IADH",huffmanTables);
|
|
928
|
-
"IADW",huffmanTables);if(null===deltaWidth)break;currentWidth+=deltaWidth;totalWidth+=currentWidth;if(customIndex){deltaWidth=decodeInteger(customTables,"IAAI",huffmanTables);if(1<deltaWidth)deltaWidth=decodeTextRegion(end,customIndex,currentWidth,currentHeight,0,deltaWidth,1,start.concat(dictionary),symbolCodeLength,
|
|
929
|
-
"IARDX",huffmanTables),rdy=decodeInteger(customTables,"IARDY",huffmanTables);deltaWidth=decodeRefinement(currentWidth,currentHeight,refinementTemplateIndex,deltaWidth<start.length?start[deltaWidth]:dictionary[deltaWidth-start.length],rdx,rdy,!1,refinementAt,tableDeltaHeight)}dictionary.push(deltaWidth)}else end?
|
|
930
|
-
ii.tableBitmapSize.decode(huffmanInput);huffmanInput.byteAlign();if(0===deltaWidth){currentWidth=huffmanInput;rdy=totalWidth;var height=currentHeight,bitmap=[];for(deltaWidth=0;deltaWidth<height;deltaWidth++){totalWidth=new Uint8Array(rdy);bitmap.push(totalWidth);for(rdx=0;rdx<rdy;rdx++)totalWidth[rdx]=currentWidth.readBit();
|
|
931
|
-
totalWidth,currentHeight,!1),huffmanInput.end=currentWidth,huffmanInput.position=deltaWidth;currentWidth=symbolWidths.length;if(deltaHeight===currentWidth-1)dictionary.push(totalWidth);else for(deltaWidth=0;deltaHeight<currentWidth;deltaHeight++){rdx=symbolWidths[deltaHeight];rdy=deltaWidth+rdx;height=[];for(rdx=
|
|
932
|
-
data;tableDeltaHeight.length<ii;){for(referredSymbols=end?tableB1.decode(huffmanInput):decodeInteger(customTables,"IAEX",huffmanTables);referredSymbols--;)tableDeltaHeight.push(customIndex);customIndex=!customIndex}tableB1=0;for(end=start.length;tableB1<end;tableB1++)tableDeltaHeight[tableB1]&&symbolWidths.push(start[tableB1]);
|
|
933
|
-
referredSegments,data,start,end){for(var regionInfo=region.info,huffmanTables,huffmanInput,symbols=this.symbols,inputSymbols=[],i=0,ii=referredSegments.length;i<ii;i++){var referredSymbols=symbols[referredSegments[i]];referredSymbols&&(inputSymbols=inputSymbols.concat(referredSymbols))}symbols=(0,_util.log2)(inputSymbols.length);
|
|
934
|
-
0;34>=i$jscomp$0;i$jscomp$0++){var codeLength=ii.readBits(4);referredSymbols.push(new HuffmanLine([i$jscomp$0,codeLength,0,0]))}var runCodesTable=new HuffmanTable(referredSymbols,!1);for(i$jscomp$0=referredSymbols.length=0;i$jscomp$0<i;)if(codeLength=runCodesTable.decode(ii),32<=codeLength){var j;switch(codeLength){case 32:if(0===
|
|
935
|
-
case 33:numberOfRepeats=ii.readBits(3)+3;codeLength=0;break;case 34:numberOfRepeats=ii.readBits(7)+11;codeLength=0;break;default:throw new Jbig2Error("invalid code length in symbol ID table");}for(j=0;j<numberOfRepeats;j++)referredSymbols.push(new HuffmanLine([i$jscomp$0,codeLength,0,0])),i$jscomp$0++}else referredSymbols.push(new HuffmanLine([i$jscomp$0,
|
|
936
|
-
|
|
937
|
-
11);break;case 3:referredSegments=getCustomHuffmanTable(i$jscomp$0,referredSegments,huffmanTables);break;default:throw new Jbig2Error("invalid Huffman DT selector");}if(region.refinement)throw new Jbig2Error("refinement with Huffman is not supported");huffmanTables={symbolIDTable:i,tableFirstS:ii,tableDeltaS:referredSymbols,
|
|
938
|
-
region.numberOfSymbolInstances,region.stripSize,inputSymbols,symbols,region.transposed,region.dsOffset,region.referenceCorner,region.combinationOperator,huffmanTables,region.refinementTemplate,region.refinementAt,data,region.logStripSize,huffmanInput);this.drawBitmap(regionInfo,region)},onImmediateLosslessTextRegion:function(){this.onImmediateTextRegion.apply(this,
|
|
939
|
-
patterns={});var decodingContext=new DecodingContext(data,start,end),mmr=dictionary.mmr;data=dictionary.patternWidth;start=dictionary.patternHeight;end=dictionary.maxPatternIndex;dictionary=dictionary.template;var at=[];mmr||(at.push({x:-data,y:0}),0===dictionary&&(at.push({x:-3,y:-1}),at.push({x:2,y:-2}),at.push({x:-2,y:-2})));dictionary=decodeBitmap(mmr,(end+1)*
|
|
940
|
-
data;for(y=0;y<start;y++)at.push(dictionary[y].subarray(xMin,xMax));decodingContext.push(at);mmr++}patterns[currentSegment]=decodingContext},onImmediateHalftoneRegion:function(region,referredSegments,data,start,end){referredSegments=this.patterns[referredSegments[0]];var regionInfo=region.info,decodingContext=new DecodingContext(data,start,end),mmr=region.mmr,template=
|
|
941
|
-
end=region.gridWidth;var gridHeight=region.gridHeight,gridOffsetX=region.gridOffsetX,gridOffsetY=region.gridOffsetY,gridVectorX=region.gridVectorX,gridVectorY=region.gridVectorY;if(region.enableSkip)throw new Jbig2Error("skip is not supported");if(0!==combinationOperator)throw new Jbig2Error("operator "+combinationOperator+" is not supported in halftone region");
|
|
942
|
-
defaultPixelValue;region.push(
|
|
943
|
-
1;0<=
|
|
944
|
-
gridVectorX-decodingContext*gridVectorY>>8;if(0<=template&&template+defaultPixelValue<=data&&0<=bitmap&&bitmap+
|
|
945
|
-
patternRow[j])}}this.drawBitmap(regionInfo,region)},onImmediateLosslessHalftoneRegion:function(){this.onImmediateHalftoneRegion.apply(this,arguments)},
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
new
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.ArithmeticDecoder=
|
|
955
|
-
switchFlag:
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
start,end){if(!(this instanceof ArithmeticDecoder))throw new TypeError("Cannot call a class as a function");this.data=data;this.bp=
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
{children:[],index:0}),p.children[p.index]=
|
|
972
|
-
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
s)throw new JpegError("invalid ACn encoding");successiveACNextValue=receiveAndExtend(s);successiveACState=r?2:3}continue;case 1:case 2:component.blockData[s]?
|
|
977
|
-
(readBit()<<successive))}k++}4===successiveACState&&(eobrun--,0===eobrun&&(successiveACState=0))}var parseDNLMarker=9<arguments.length&&void 0!==arguments[9]?
|
|
978
|
-
decodeACSuccessive:decodeBaseline;var mcu=0;var mcuExpected=1===componentsLength?components[0].blocksPerLine*components[0].blocksPerColumn:mcusPerLine*frame.mcusPerColumn;
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
else break
|
|
982
|
-
0;blockCol<frame;blockCol++){var blockBufferOffset=64*((component.blocksPerLine+1)*blockRow+blockCol),p=computationBuffer,qt=component.quantizationTable,blockData=component.blockData;
|
|
983
|
-
row
|
|
984
|
-
128>>8;v2=1567*v2-3784*v3+128>>8;v3=t;p4=p4+p5+1>>1;p5=p4-p5;p7=p7+p3+1>>1;p3=p7-p3;v0=v0+v3+1>>1;v3=v0-v3;v1=v1+v2+1>>1;v2=v1-v2;t=2276*p4+3406*p7+2048>>12;p4=3406*
|
|
985
|
-
|
|
986
|
-
12,v2=1567*v2-3784*v3+2048>>12,v3=t,p4=p4+p5+1>>1,p5=p4-p5,p7=p7+p3+1>>1,p3=p7-p3,v0=v0+v3+1>>1,v3=v0-v3,v1=v1+v2+1>>1,v2=v1-v2,t=2276*p4+3406*p7+2048>>12,p4=3406*p4-2276*p7+2048>>12,p7=t,
|
|
987
|
-
0:4080<=p6?255:p6>>4,p7=16>p7?0:4080<=p7?255:p7>>4,blockData[blockBufferOffset+qt]=t,blockData[blockBufferOffset+qt+8]=p1,blockData[blockBufferOffset+qt+16]=p2,blockData[blockBufferOffset+
|
|
988
|
-
maxPos=data.length-1;startPos=startPos<currentPos?startPos:currentPos;if(currentPos>=maxPos)return null;var currentMarker=data[currentPos]<<8|data[currentPos+1];if(65472<=currentMarker&&65534>=
|
|
989
|
-
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,
|
|
990
|
-
_util.warn)("readDataBlock - incorrect length, current marker is: "+fileMarker.invalid),length=fileMarker.offset);length=data.subarray(offset,length);offset+=length.length;return length}
|
|
991
|
-
Math.ceil(Math.ceil(frame.scanLines/8)*component.v/frame.maxV);component.blockData=new Int16Array(64*mcusPerColumn*component.v*(mcusPerLine*component.h+1));component.blocksPerLine=blocksPerLine;
|
|
992
|
-
0;_ref2$dnlScanLines=[];var huffmanTablesAC=[],huffmanTablesDC=[],fileMarker$jscomp$0=readUint16();if(65496!==fileMarker$jscomp$0)throw new JpegError("SOI not found");fileMarker$jscomp$0=readUint16();
|
|
993
|
-
74===j[0]&&70===j[1]&&73===j[2]&&70===j[3]&&0===j[4]&&(jfif={version:{major:j[5],minor:j[6]},densityUnits:j[7],xDensity:j[8]<<8|j[9],yDensity:j[10]<<8|j[11],thumbWidth:j[12],thumbHeight:j[13],thumbData:j.subarray(14,
|
|
994
|
-
data[offset++],tableData=new Uint16Array(64);if(0===quantizationTableSpec>>4)for(j=0;64>j;j++)z=dctZigZag[j],tableData[z]=data[offset++];else if(1===quantizationTableSpec>>4)for(j=
|
|
995
|
-
|
|
996
|
-
quantizationTableSpec<l&&(quantizationTableSpec=l);tableData<v&&(tableData=v);l=frame$jscomp$0.components.push({h:l,v:v,quantizationId:data[offset+2],quantizationTable:null});frame$jscomp$0.componentIds[z]=
|
|
997
|
-
tableData[j]=data[offset];v=new Uint8Array(l);for(j=0;j<l;j++,offset++)v[j]=data[offset];fileMarker$jscomp$0+=17+l;(0===quantizationTableSpec>>4?huffmanTablesDC:huffmanTablesAC)[quantizationTableSpec&15]=
|
|
998
|
-
frame$jscomp$0.componentIds[data[offset++]];var component=frame$jscomp$0.components[tableData];tableData=data[offset++];component.huffmanTableDC=huffmanTablesDC[tableData>>4];component.huffmanTableAC=
|
|
999
|
-
DNLMarkerError)return(0,_util.warn)("".concat(ex.message," -- attempting to re-parse the JPEG image.")),this.parse(data,{dnlScanLines:ex.scanLines});if(ex instanceof EOIMarkerError){(0,_util.warn)("".concat(ex.message,
|
|
1000
|
-
_util.warn)("JpegImage.parse - unexpected data, current marker is: "+j.invalid),offset=j.offset;else{if(offset>data.length-2){(0,_util.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");
|
|
1001
|
-
0;fileMarker$jscomp$0<frame$jscomp$0.components.length;fileMarker$jscomp$0++){component=frame$jscomp$0.components[fileMarker$jscomp$0];if(resetInterval=_ref2$dnlScanLines[component.quantizationId])component.quantizationTable=
|
|
1002
|
-
_getLinearizedBlockData:function(width,height){var isSourcePDF=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!1,scaleX=this.width/width,scaleY=this.height/height,x,i,numComponents=this.components.length,
|
|
1003
|
-
component.output;var blocksPerScanline=component.blocksPerLine+1<<3;for(x=0;x<width;x++)component=0|x*componentScaleX,xScaleBlockOffset[x]=(component&4294967288)<<3|component&7;for(componentScaleX=0;componentScaleX<
|
|
1004
|
-
scaleX||(scaleX=new Int32Array([-256,255,-256,255,-256,255,-256,255]));if(scaleX)for(i=0;i<dataLength;)for(isSourcePDF=component=0;component<numComponents;component++,i++,isSourcePDF+=2)data[i]=(data[i]*scaleX[isSourcePDF]>>
|
|
1005
|
-
3)Y=data[i],Cb=data[i+1],Cr=data[i+2],data[i]=Y-179.456+1.402*Cr,data[i+1]=Y+135.459-.344*Cb-.714*Cr,data[i+2]=Y-226.816+1.772*Cb;return data},_convertYcckToRgb:function(data){for(var Y,Cb,Cr,k,offset=0,i=0,length=data.length;i<
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
2]=481.816-Y-1.772*Cb;return data},_convertCmykToRgb:function(data){for(var c,m,y,k,offset=0,scale=1/255,i=0,length=data.length;i<length;i+=4)c=data[i]*scale,m=data[i+1]*scale,y=data[i+2]*scale,k=data[i+3]*scale,data[offset++]=
|
|
1009
|
-
|
|
1010
|
-
k-112.23884253719248)+y*(.03296041114873217*y+115.60384449646641*k-193.58209356861505)-k*(22.33816807309886*k+180.12613974708367);return data.subarray(0,offset)},getData:function(_ref3){var width=_ref3.width,height=
|
|
1011
|
-
this.numComponents&&_ref3$forceRGB){height=width.length;_ref3$forceRGB=new Uint8ClampedArray(3*height);for(var i=_ref3=0;i<height;i++){var grayColor=width[i];_ref3$forceRGB[_ref3++]=grayColor;_ref3$forceRGB[_ref3++]=
|
|
1012
|
-
if(_ref3$forceRGB)return this._convertCmykToRgb(width)}return width}};return JpegImage}();exports.JpegImage=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",
|
|
1013
|
-
maybeLength)}JpxStream.prototype=Object.create(_stream.DecodeStream.prototype);Object.defineProperty(JpxStream.prototype,"bytes",{get:function(){return(0,_util.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},
|
|
1014
|
-
jpxImage.tiles.length;if(1===tileCount)this.buffer=jpxImage.tiles[0].items;else{height=new Uint8ClampedArray(width*height*componentsCount);for(var k=0;k<tileCount;k++){var tileComponents=jpxImage.tiles[k],tileHeight=
|
|
1015
|
-
srcPosition+tileComponents);height.set(rowBytes,dataPosition);srcPosition+=tileComponents;dataPosition+=imgRowSize}}this.buffer=height}this.bufferLength=this.buffer.length;this.eof=!0}};return JpxStream}();exports.JpxStream=
|
|
1016
|
-
Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};
|
|
1017
|
-
writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};
|
|
1018
|
-
msg=_getPrototypeOf(JpxError).call(this,"JPX error: ".concat(msg));if(!msg||"object"!==_typeof(msg)&&"function"!==typeof msg){if(void 0===this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1019
|
-
1<<context,codeblockHeight=1<<dimensions,cbx0=subband.tbx0>>context,cby0=subband.tby0>>dimensions,cbx1=subband.tbx1+codeblockWidth-1>>context,cby1=subband.tby1+codeblockHeight-1>>dimensions,precinctParameters=subband.resolution.precinctParameters,
|
|
1020
|
-
codeblock.tby0_=Math.max(subband.tby0,codeblock.tby0);codeblock.tbx1_=Math.min(subband.tbx1,codeblock.tbx1);codeblock.tby1_=Math.min(subband.tby1,codeblock.tby1);var precinctNumber=Math.floor((codeblock.tbx0_-subband.tbx0)/precinctParameters.precinctWidthInSubband)+
|
|
1021
|
-
codeblock.tbx0_||codeblock.tby1_<=codeblock.tby0_)){codeblocks.push(codeblock);var precinct=precincts[precinctNumber];void 0!==precinct?(i<precinct.cbxMin?precinct.cbxMin=i:i>precinct.cbxMax&&(precinct.cbxMax=i),j<precinct.cbyMin?precinct.cbxMin=j:j>precinct.cbyMax&&
|
|
1022
|
-
cby0+1};subband.codeblocks=codeblocks;subband.precincts=precincts}function createPacket(resolution,precinctNumber,layerNumber){var precinctCodeblocks=[];resolution=resolution.subbands;for(var i=0,ii=resolution.length;i<ii;i++)for(var codeblocks=resolution[i].codeblocks,
|
|
1023
|
-
context.tiles[context.currentTile.index],layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,maxDecompositionLevelsCount=0;for(context=0;context<componentsCount;context++)maxDecompositionLevelsCount=
|
|
1024
|
-
tile.components[i];if(!(r>component.codingStyleParameters.decompositionLevelsCount)){component=component.resolutions[r];for(var numprecincts=component.precinctParameters.numprecincts;k<numprecincts;)return component=createPacket(component,
|
|
1025
|
-
maxDecompositionLevelsCount=0;for(context=0;context<componentsCount;context++)maxDecompositionLevelsCount=Math.max(maxDecompositionLevelsCount,tile.components[context].codingStyleParameters.decompositionLevelsCount);var r=0,l=0,i=
|
|
1026
|
-
component.precinctParameters.numprecincts;k<numprecincts;)return component=createPacket(component,k,l),k++,component;k=0}}i=0}l=0}throw new JpxError("Out of packets");}}function ResolutionPositionComponentLayerIterator(context){var tile=
|
|
1027
|
-
|
|
1028
|
-
if(!(r>component.codingStyleParameters.decompositionLevelsCount||(component=component.resolutions[r],p>=component.precinctParameters.numprecincts))){for(;l<layersCount;)return component=
|
|
1029
|
-
l=0,r=0,c=0,px=0,py=0;this.nextPacket=function(){for(;py<precinctsSizes.maxNumHigh;py++){for(;px<precinctsSizes.maxNumWide;px++){for(;c<componentsCount;c++){for(var component=
|
|
1030
|
-
createPacket(resolution,k,l),l++,component;l=0}}r=0}c=0}px=0}throw new JpxError("Out of packets");}}function ComponentPositionResolutionLayerIterator(context){var tile=context.tiles[context.currentTile.index],
|
|
1031
|
-
decompositionLevelsCount=component.codingStyleParameters.decompositionLevelsCount;py<precinctsIterationSizes.maxNumHigh;py++){for(;px<precinctsIterationSizes.maxNumWide;px++){for(;r<=decompositionLevelsCount;r++){var resolution=
|
|
1032
|
-
}}function getPrecinctIndexIfExist(pxIndex,pyIndex,sizeInImageScale,precinctIterationSizes,resolution){pxIndex*=precinctIterationSizes.minWidth;pyIndex*=precinctIterationSizes.minHeight;return 0!==pxIndex%sizeInImageScale.width||
|
|
1033
|
-
Number.MAX_VALUE,maxNumWide=0,maxNumHigh=0,sizePerComponent=Array(componentsCount),c=0;c<componentsCount;c++){for(var component=tile.components[c],decompositionLevelsCount=component.codingStyleParameters.decompositionLevelsCount,
|
|
1034
|
-
component.resolutions[decompositionLevelsCount],widthCurrentResolution=scale*resolution.precinctParameters.precinctWidth,heightCurrentResolution=scale*resolution.precinctParameters.precinctHeight;minWidthCurrentComponent=Math.min(minWidthCurrentComponent,
|
|
1035
|
-
Math.max(maxNumHighCurrentComponent,resolution.precinctParameters.numprecinctshigh);sizePerResolution[decompositionLevelsCount]={width:widthCurrentResolution,height:heightCurrentResolution};scale<<=1}minWidth=Math.min(minWidth,minWidthCurrentComponent);
|
|
1036
|
-
minHeight:minHeightCurrentComponent,maxNumWide:maxNumWideCurrentComponent,maxNumHigh:maxNumHighCurrentComponent}}return{components:sizePerComponent,minWidth:minWidth,minHeight:minHeight,maxNumWide:maxNumWide,maxNumHigh:maxNumHigh}}function parseTilePackets(context,
|
|
1037
|
-
count;return buffer>>>bufferSize&(1<<count)-1}function skipMarkerIfEqual(value){return 255===data[offset+position-1]&&data[offset+position]===value?(position+=1,!0):255===data[offset+position]&&data[offset+position+1]===value?(position+=2,!0):!1}function readCodingpasses(){if(0===
|
|
1038
|
-
|
|
1039
|
-
codeblock.cbx-precinct.cbxMin,codeblockRow=codeblock.cby-precinct.cbyMin,codeblockIncluded=!1,firstTimeInclusion=!1;if(void 0!==codeblock.included)codeblockIncluded=!!readBits(1);else{precinct=codeblock.precinct;if(void 0!==precinct.inclusionTree)var inclusionTree=precinct.inclusionTree;
|
|
1040
|
-
zeroBitPlanesTree);precinct.inclusionTree=inclusionTree;precinct.zeroBitPlanesTree=zeroBitPlanesTree}if(inclusionTree.reset(codeblockColumn,codeblockRow,layerNumber))for(;;)if(readBits(1)){if(valueReady=!inclusionTree.nextLevel()){codeblockIncluded=firstTimeInclusion=codeblock.included
|
|
1041
|
-
!zeroBitPlanesTree.nextLevel())break}else zeroBitPlanesTree.incrementValue();codeblock.zeroBitPlanes=zeroBitPlanesTree.value}for(precinct=readCodingpasses();readBits(1);)codeblock.Lblock++;codeblockColumn=(0,_util.log2)(precinct);codeblockColumn=readBits((precinct<
|
|
1042
|
-
queue.length;)packet=queue.shift(),codeblock=packet.codeblock,void 0===codeblock.data&&(codeblock.data=[]),codeblock.data.push({data:data,start:offset+position,end:offset+position+packet.dataLength,codingpasses:packet.codingpasses}),position+=packet.dataLength}}return position}
|
|
1043
|
-
8,lbox=(0,_util.readUint32)(data,position),tbox=(0,_util.readUint32)(data,position+4);position+=headerSize;1===lbox&&(lbox=4294967296*(0,_util.readUint32)(data,position)+(0,_util.readUint32)(data,position+4),position+=8,headerSize+=8);0===lbox&&(lbox=length-position+
|
|
1044
|
-
position+3),tbox){case 16:case 17:case 18:break;default:(0,_util.warn)("Unknown colorspace "+tbox)}else 2===tbox&&(0,_util.info)("ICC profile not supported");break;case 1785737827:this.parseCodestream(data,position,position+headerSize);break;case 1783636E3:218793738!==
|
|
1045
|
-
255,tbox>>8&255,tbox&255);(0,_util.warn)("Unsupported header type "+tbox+" ("+headerType+")")}lbox&&(position+=headerSize)}},parseImageProperties:function(stream){for(var newByte=stream.getByte();0<=newByte;){var oldByte=newByte;newByte=stream.getByte();if(65361===(oldByte<<
|
|
1046
|
-
oldByte-YOsiz;this.componentsCount=stream;this.bitsPerComponent=8;return}}throw new JpxError("No size marker found in JPX stream");},parseCodestream:function(data$jscomp$0,start,end){var context={},doNotRecover=!1;try{for(var position=start;position+1<end;){var code=(0,_util.readUint16)(data$jscomp$0,
|
|
1047
|
-
position
|
|
1048
|
-
var components=[];var j=position+38;for(var i=0;i<componentsCount;i++){var component={precision:(data$jscomp$0[j]&127)+1,isSigned:!!(data$jscomp$0[j]&128),XRsiz:data$jscomp$0[j+1],YRsiz:data$jscomp$0[j+2]};j+=3;var component$jscomp$0=component,siz$jscomp$0=siz;component$jscomp$0.x0=
|
|
1049
|
-
Math.ceil(siz$jscomp$0.
|
|
1050
|
-
siz$jscomp$1
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
data$jscomp$0[j++]
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
context$jscomp$1.currentTile.
|
|
1062
|
-
resolutions=[],subbands=[],r=0;r<=decompositionLevelsCount;r++){var r$jscomp$0=r,codOrCoc=component$jscomp$3.codingStyleParameters,result={};codOrCoc.entropyCoderWithCustomPrecincts?(result.PPx=codOrCoc.precinctsSizes[r$jscomp$0].PPx,result.PPy=codOrCoc.precinctsSizes[r$jscomp$0].PPy):
|
|
1063
|
-
var blocksDimensions=result;var resolution={},scale=1<<decompositionLevelsCount-r;resolution.trx0=Math.ceil(component$jscomp$3.tcx0/scale);resolution.try0=Math.ceil(component$jscomp$3.tcy0/scale);resolution.trx1=Math.ceil(component$jscomp$3.tcx1/scale);resolution.try1=Math.ceil(component$jscomp$3.tcy1/
|
|
1064
|
-
precinctWidth)-Math.floor(resolution.trx0/precinctWidth):0,numprecinctshigh=resolution.try1>resolution.try0?Math.ceil(resolution.try1/precinctHeight)-Math.floor(resolution.try0/precinctHeight):0;resolution.precinctParameters={precinctWidth:precinctWidth,precinctHeight:precinctHeight,
|
|
1065
|
-
(isZeroRes?0:-1)};resolutions.push(resolution);if(0===r){var subband={type:"LL"};subband.tbx0=Math.ceil(component$jscomp$3.tcx0/scale);subband.tby0=Math.ceil(component$jscomp$3.tcy0/scale);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/scale);subband.tby1=Math.ceil(component$jscomp$3.tcy1/
|
|
1066
|
-
[];subband={type:"HL"};subband.tbx0=Math.ceil(component$jscomp$3.tcx0/bscale-.5);subband.tby0=Math.ceil(component$jscomp$3.tcy0/bscale);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/bscale-.5);subband.tby1=Math.ceil(component$jscomp$3.tcy1/bscale);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,
|
|
1067
|
-
|
|
1068
|
-
bscale-.5);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,subband,blocksDimensions);subbands.push(subband);resolutionSubbands.push(subband);resolution.subbands=resolutionSubbands}}component$jscomp$3.resolutions=resolutions;component$jscomp$3.subbands=subbands}var progressionOrder=
|
|
1069
|
-
|
|
1070
|
-
position;parseTilePackets(context,data$jscomp$0,position,length);break;case 65365:case 65367:case 65368:case 65380:length=(0,_util.readUint16)(data$jscomp$0,position);break;case 65363:throw Error("Codestream code 0xFF53 (COC) is not implemented");default:throw Error("Unknown codestream code: "+
|
|
1071
|
-
context.components,componentsCount$jscomp$2=context.SIZ.Csiz,resultImages=[],i$jscomp$1=0,ii$jscomp$0=context.tiles.length;i$jscomp$1<ii$jscomp$0;i$jscomp$1++){var tile$jscomp$3=context.tiles[i$jscomp$1],transformedTiles=[],c$jscomp$1;for(c$jscomp$1=0;c$jscomp$1<componentsCount$jscomp$2;c$jscomp$1++){for(var JSCompiler_temp_const=
|
|
1072
|
-
quantizationParameters=component$jscomp$4.quantizationParameters,decompositionLevelsCount$jscomp$0=codingStyleParameters.decompositionLevelsCount,spqcds$jscomp$0=quantizationParameters.SPqcds,scalarExpounded$jscomp$0=quantizationParameters.scalarExpounded,guardBits=quantizationParameters.guardBits,segmentationSymbolUsed=codingStyleParameters.segmentationSymbolUsed,
|
|
1073
|
-
new IrreversibleTransform,subbandCoefficients=[],b=0,i$jscomp$2=0;i$jscomp$2<=decompositionLevelsCount$jscomp$0;i$jscomp$2++){for(var resolution$jscomp$0=component$jscomp$4.resolutions[i$jscomp$2],width=resolution$jscomp$0.trx1-resolution$jscomp$0.trx0,height=resolution$jscomp$0.try1-resolution$jscomp$0.try0,coefficients=new Float32Array(width*height),
|
|
1074
|
-
var epsilon=spqcds$jscomp$0[b].epsilon;b++}else mu=spqcds$jscomp$0[0].mu,epsilon=spqcds$jscomp$0[0].epsilon+(0<i$jscomp$2?1-i$jscomp$2:0);for(var subband$jscomp$0=resolution$jscomp$0.subbands[j$jscomp$1],gainLog2=SubbandsGainLog2[subband$jscomp$0.type],coefficients$jscomp$0=coefficients,levelWidth=width,subband$jscomp$1=subband$jscomp$0,delta=
|
|
1075
|
-
x0=subband$jscomp$1.tbx0,y0=subband$jscomp$1.tby0,width$jscomp$0=subband$jscomp$1.tbx1-subband$jscomp$1.tbx0,codeblocks=subband$jscomp$1.codeblocks,right="H"===subband$jscomp$1.type.charAt(0)?1:0,bottom="H"===subband$jscomp$1.type.charAt(1)?levelWidth:0,i$jscomp$3=0,ii$jscomp$1=codeblocks.length;i$jscomp$3<ii$jscomp$1;++i$jscomp$3){var codeblock=
|
|
1076
|
-
codeblock.data){var bitModel=new BitModel(blockWidth,blockHeight,codeblock.subbandType,codeblock.zeroBitPlanes,mb);var currentCodingpassType=2;var data=codeblock.data,totalLength=0,codingpasses=0,jj$jscomp$1;var j$jscomp$2=0;for(jj$jscomp$1=data.length;j$jscomp$2<jj$jscomp$1;j$jscomp$2++){var dataItem=data[j$jscomp$2];totalLength+=dataItem.end-
|
|
1077
|
-
jj$jscomp$1;j$jscomp$2++){dataItem=data[j$jscomp$2];var chunk=dataItem.data.subarray(dataItem.start,dataItem.end);encodedData.set(chunk,position$jscomp$0);position$jscomp$0+=chunk.length}var decoder=new _arithmetic_decoder.ArithmeticDecoder(encodedData,0,totalLength);bitModel.setDecoder(decoder);for(j$jscomp$2=0;j$jscomp$2<codingpasses;j$jscomp$2++){switch(currentCodingpassType){case 0:bitModel.runSignificancePropagationPass();
|
|
1078
|
-
segmentationSymbolUsed$jscomp$0&&bitModel.checkSegmentationSymbol()}currentCodingpassType=(currentCodingpassType+1)%3}var offset=codeblock.tbx0_-x0+(codeblock.tby0_-y0)*width$jscomp$0,sign=bitModel.coefficentsSign,magnitude=bitModel.coefficentsMagnitude,bitsDecoded=bitModel.bitsDecoded,magnitudeCorrection=reversible$jscomp$0?0:.5,k;position$jscomp$0=0;var interleave="LL"!==subband$jscomp$1.type;for(j$jscomp$2=
|
|
1079
|
-
width$jscomp$0)+right+bottom;for(k=0;k<blockWidth;k++){var n=magnitude[position$jscomp$0];if(0!==n){n=(n+magnitudeCorrection)*delta;0!==sign[position$jscomp$0]&&(n=-n);var nb=bitsDecoded[position$jscomp$0];coefficients$jscomp$0[interleave?levelOffset+(offset<<1):offset]=reversible$jscomp$0&&nb>=mb?n:n*(1<<mb-nb)}offset++;position$jscomp$0++}offset+=width$jscomp$0-blockWidth}}}}subbandCoefficients.push({width:width,
|
|
1080
|
-
component$jscomp$4.tcx0,component$jscomp$4.tcy0);JSCompiler_temp_const[JSCompiler_temp_const$jscomp$0]={left:component$jscomp$4.tcx0,top:component$jscomp$4.tcy0,width:result$jscomp$0.width,height:result$jscomp$0.height,items:result$jscomp$0.items}}var tile0=transformedTiles[0],out=new Uint8ClampedArray(tile0.items.length*componentsCount$jscomp$2),result$jscomp$1={left:tile0.left,top:tile0.top,width:tile0.width,
|
|
1081
|
-
4===componentsCount$jscomp$2,y0items=transformedTiles[0].items,y1items=transformedTiles[1].items,y2items=transformedTiles[2].items,y3items=fourComponents?transformedTiles[3].items:null;var shift=components$jscomp$1[0].precision-8;var offset$jscomp$0=(128<<shift)+.5;var component0=tile$jscomp$3.components[0],alpha01=componentsCount$jscomp$2-3;var jj$jscomp$2=
|
|
1082
|
-
y0items[j$jscomp$3]+offset$jscomp$0;var y1=y1items[j$jscomp$3];var y2=y2items[j$jscomp$3];var g=y0$jscomp$0-(y2+y1>>2);out[pos++]=g+y2>>shift;out[pos++]=g>>shift;out[pos++]=g+y1>>shift}else for(j$jscomp$3=0;j$jscomp$3<jj$jscomp$2;j$jscomp$3++,pos+=alpha01)y0$jscomp$0=y0items[j$jscomp$3]+offset$jscomp$0,y1=y1items[j$jscomp$3],y2=y2items[j$jscomp$3],
|
|
1083
|
-
0,pos=3;j$jscomp$3<jj$jscomp$2;j$jscomp$3++,pos+=4)out[pos]=y3items[j$jscomp$3]+offset$jscomp$0>>shift}else for(c$jscomp$1=0;c$jscomp$1<componentsCount$jscomp$2;c$jscomp$1++){var items=transformedTiles[c$jscomp$1].items;shift=components$jscomp$1[c$jscomp$1].precision-8;offset$jscomp$0=(128<<shift)+.5;pos=c$jscomp$1;j$jscomp$3=0;for(jj$jscomp$2=
|
|
1084
|
-
resultImages;this.width=context.SIZ.Xsiz-context.SIZ.XOsiz;this.height=context.SIZ.Ysiz-context.SIZ.YOsiz;this.componentsCount=context.SIZ.Csiz}};var TagTree=function(){function TagTree(width,height){var levelsLength=(0,_util.log2)(Math.max(width,height))+1;this.levels=[];for(var i=0;i<levelsLength;i++)this.levels.push({width:width,
|
|
1085
|
-
this.levels[currentLevel];var index=i+j*level.width;if(void 0!==level.items[index]){value=level.items[index];break}level.index=index;i>>=1;j>>=1;currentLevel++}currentLevel--;level=this.levels[currentLevel];level.items[level.index]=value;this.currentLevel=currentLevel;delete this.value},incrementValue:function(){var level=
|
|
1086
|
-
currentLevel--;if(0>currentLevel)return this.value=value,!1;this.currentLevel=currentLevel;level=this.levels[currentLevel];level.items[level.index]=value;return!0}};return TagTree}(),InclusionTree=function(){function InclusionTree(width,height,defaultValue){var levelsLength=(0,_util.log2)(Math.max(width,height))+1;this.levels=
|
|
1087
|
-
items:items});width=Math.ceil(width/2);height=Math.ceil(height/2)}}InclusionTree.prototype={reset:function(i,j,stopValue){for(var currentLevel=0;currentLevel<this.levels.length;){var level=this.levels[currentLevel],index=i+j*level.width;level.index=index;level=level.items[index];if(255===level)break;if(level>stopValue)return this.currentLevel=
|
|
1088
|
-
level.items[level.index]=stopValue+1;this.propagateValues()},propagateValues:function(){for(var levelIndex=this.currentLevel,level=this.levels[levelIndex],currentValue=level.items[level.index];0<=--levelIndex;)level=this.levels[levelIndex],level.items[level.index]=currentValue},nextLevel:function(){var currentLevel=
|
|
1089
|
-
this.levels[currentLevel];level.items[level.index]=value;return!0}};return InclusionTree}(),BitModel=function(){function BitModel(width,height,subband,zeroBitPlanes,mb){this.width=width;this.height=height;this.contextLabelTable="HH"===subband?HHContextLabel:"HL"===subband?HLContextLabel:LLAndLHContextsLabel;width*=
|
|
1090
|
-
this.processingFlags=new Uint8Array(width);mb=new Uint8Array(width);if(0!==zeroBitPlanes)for(height=0;height<width;height++)mb[height]=zeroBitPlanes;this.bitsDecoded=mb;this.reset()}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,
|
|
1091
|
-
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]),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]);BitModel.prototype={setDecoder:function(decoder){this.decoder=
|
|
1092
|
-
width=this.width,height=this.height,left=0<column;column=column+1<width;if(0<row){var i=index-width;left&&(neighborsSignificance[i-1]+=16);column&&(neighborsSignificance[i+1]+=16);neighborsSignificance[i]+=4}row+1<height&&(i=index+width,left&&(neighborsSignificance[i-1]+=16),column&&
|
|
1093
|
-
this.decoder,width=this.width,height=this.height,coefficentsMagnitude=this.coefficentsMagnitude,coefficentsSign=this.coefficentsSign,neighborsSignificance=this.neighborsSignificance,processingFlags=this.processingFlags,contexts=this.contexts,labels=this.contextLabelTable,
|
|
1094
|
-
labels[neighborsSignificance[index]])){var sign=this.decodeSignBit(i,j,index);coefficentsSign[index]=sign;coefficentsMagnitude[index]=1;this.setNeighborsSignificance(i,j,index);processingFlags[index]|=2}bitsDecoded[index]++;
|
|
1095
|
-
|
|
1096
|
-
sign0?(sign0=coefficentsSign[index-width],column=1-sign0-sign0+horizontalContribution):column=horizontalContribution;return 0<=column?this.decoder.readBit(this.contexts,9+column):this.decoder.readBit(this.contexts,9-column)^
|
|
1097
|
-
width*this.height,width4=4*width,index0=0,indexNext;index0<length;index0=indexNext){indexNext=Math.min(length,index0+width4);for(var j=0;j<width;j++)for(var index=index0+j;index<indexNext;index+=width)if(coefficentsMagnitude[index]&&
|
|
1098
|
-
1|contextLabel;bitsDecoded[index]++;processingFlags[index]|=1}}},runCleanupPass:function(){for(var decoder=this.decoder,width=this.width,height=this.height,neighborsSignificance=this.neighborsSignificance,coefficentsMagnitude=
|
|
1099
|
-
height);for(var indexBase=i0*width,checkAllEmpty=i0+3<height,j=0;j<width;j++){var index0=indexBase+j,i1=0,index=index0,i=i0;if(checkAllEmpty&&0===processingFlags[index0]&&0===processingFlags[index0+width]&&0===processingFlags[index0+
|
|
1100
|
-
bitsDecoded[index0+width]++;bitsDecoded[index0+twoRowsDown]++;bitsDecoded[index0+threeRowsDown]++;continue}i1=decoder.readBit(contexts,17)<<1|decoder.readBit(contexts,17);0!==i1&&(i=i0+i1,index+=i1*width);var sign=this.decodeSignBit(i,
|
|
1101
|
-
0!==(processingFlags[index]&1)||(1===decoder.readBit(contexts,labels[neighborsSignificance[index]])&&(sign=this.decodeSignBit(i,j,index),coefficentsSign[index]=sign,coefficentsMagnitude[index]=1,this.setNeighborsSignificance(i,
|
|
1102
|
-
17)))throw new JpxError("Invalid segmentation symbol");}};return BitModel}(),Transform=function(){function Transform(){}Transform.prototype.calculate=function(subbands,u0,v0){for(var ll=subbands[0],i=1,ii=subbands.length;i<ii;i++)ll=
|
|
1103
|
-
buffer[i1--]=buffer[j1++];buffer[offset++]=buffer[i2--];buffer[i1]=buffer[j1];buffer[offset]=buffer[i2]};Transform.prototype.iterate=function(ll,hl_lh_hh,u0,v0){var llWidth=ll.width,llHeight=ll.height,llItems=ll.items,width=hl_lh_hh.width,
|
|
1104
|
-
.5}else for(k=l=0;l<height;l++,k+=width)ll.set(hl_lh_hh.subarray(k,k+width),4),this.extend(ll,4,width),this.filter(ll,4,width),hl_lh_hh.set(ll.subarray(4,4+width),k);u0=16;llWidth=[];for(i=0;i<u0;i++)llWidth.push(new Float32Array(height+
|
|
1105
|
-
i=u0}i--;k=llWidth[i];this.extend(k,4,height);this.filter(k,4,height);if(0===i)for(k=v0-u0+1,l=4;l<ll;k+=width,l++)for(llHeight=0;llHeight<u0;llHeight++)hl_lh_hh[k+llHeight]=llWidth[llHeight][l]}return{width:width,height:height,items:hl_lh_hh}};
|
|
1106
|
-
0;var n;var j=offset-3;for(n=length+4;n--;j+=2)x[j]*=.8128930661159609;j=offset-2;var current=.443506852043971*x[j-1];for(n=length+3;n--;j+=2){var next=.443506852043971*x[j+1];x[j]=1.230174104914001*x[j]-current-next;if(n--)j+=2,current=.443506852043971*
|
|
1107
|
-
j=offset;current
|
|
1108
|
-
ReversibleTransform.prototype=Object.create(Transform.prototype);ReversibleTransform.prototype.filter=function(x,offset,length){length>>=1;offset|=0;var n;var j=offset;for(n=length+1;n--;j+=2)x[j]-=x[j-1]+x[j+1]+2>>2;j=offset+1;for(n=length;n--;j+=
|
|
1109
|
-
function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _possibleConstructorReturn(self,call){if(call&&("object"===
|
|
1110
|
-
Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");
|
|
1111
|
-
p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _defineProperties(target,
|
|
1112
|
-
protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.calculateSHA512=
|
|
1113
|
-
_stream=__w_pdfjs_require__(195),ARCFourCipher=function(){function ARCFourCipher(key){this.b=this.a=0;var s=new Uint8Array(256),i,j=0,keyLength=key.length;for(i=0;256>i;++i)s[i]=i;for(i=0;256>i;++i){var tmp=s[i];j=j+tmp+key[i%keyLength]&
|
|
1114
|
-
tmp2&255]}this.a=a;this.b=b;return output}};ARCFourCipher.prototype.decryptBlock=ARCFourCipher.prototype.encryptBlock;return ARCFourCipher}();exports.ARCFourCipher=ARCFourCipher;var calculateMD5=function(){var r=new Uint8Array([7,12,17,
|
|
1115
|
-
1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,
|
|
1116
|
-
|
|
1117
|
-
255;padded[i++]=0;padded[i++]=0;padded[i++]=0;data=new Int32Array(16);for(i=0;i<paddedLength;){for(length=0;16>length;++length,i+=4)data[length]=padded[i]|padded[i+1]<<8|padded[i+2]<<16|padded[i+3]<<24;var a=h0;offset=h1;var c=h2,d=
|
|
1118
|
-
offset=offset+(a<<f|a>>>32-f)|0;a=tmp}h0=h0+a|0;h1=h1+offset|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,
|
|
1119
|
-
|
|
1120
|
-
high=this.high
|
|
1121
|
-
24&255;bytes[offset+5]=this.low>>16&255;bytes[offset+6]=this.low>>8&255;bytes[offset+7]=this.low&255},assign:function(word){this.high=word.high;this.low=word.low}};return Word64}(),calculateSHA256=function(){function rotr(x,
|
|
1122
|
-
|
|
1123
|
-
h2=1013904242,h3=2773480762,h4=1359893119,h5=2600822924,h6=528734635,h7=1541459225,paddedLength=64*Math.ceil((length+9)/64),padded=new Uint8Array(paddedLength),i;for(i=0;i<length;++i)padded[i]=data[offset++];padded[i++]=
|
|
1124
|
-
0;16>length;++length)data[length]=padded[i]<<24|padded[i+1]<<16|padded[i+2]<<8|padded[i+3],i+=4;for(length=16;64>length;++length){offset=length;var x=data[length-2];x=(rotr(x,17)^rotr(x,19)^x>>>10)+data[length-7];var JSCompiler_inline_result=
|
|
1125
|
-
h6,h=h7;for(length=0;64>length;++length){var t1=h;h=e;h=rotr(h,6)^rotr(h,11)^rotr(h,25);t1=t1+h+(e&f^~e&g)+k[length]+data[length];h=offset;var t2=(rotr(h,2)^rotr(h,13)^rotr(h,22))+(offset&x^offset&JSCompiler_inline_result^x&JSCompiler_inline_result);
|
|
1126
|
-
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,
|
|
1127
|
-
|
|
1128
|
-
new Word64(
|
|
1129
|
-
new Word64(
|
|
1130
|
-
new Word64(
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
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);var paddedLength=128*Math.ceil((length+
|
|
1134
|
-
padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=length>>>29&255;padded[i++]=length>>21&255;padded[i++]=length>>13&255;padded[i++]=length>>5&255;padded[i++]=length<<3&255;data=Array(80);for(i=0;80>i;i++)data[i]=new Word64(0,0);offset=
|
|
1135
|
-
0;16>length;++length)data[length].high=padded[i]<<24|padded[i+1]<<16|padded[i+2]<<8|padded[i+3],data[length].low=padded[i+4]<<24|padded[i+5]<<16|padded[i+6]<<8|padded[i+7],i+=8;for(length=16;80>length;++length){var result=tmp3=data[length],
|
|
1136
|
-
tmp.assign(x);tmp.rotateRight(
|
|
1137
|
-
|
|
1138
|
-
tmp$jscomp$0.assign(x);tmp$jscomp$0.and(tmp);tmp3.xor(tmp$jscomp$0);t2.add(tmp1);tmp3=h;h=g;g=f;f=e;d.add(t1);e=d;d=c;c=b;b=offset;tmp3.assign(t1);tmp3.add(t2);offset=tmp3}h0.add(offset);h1.add(b);h2.add(c);h3.add(d);h4.add(e);h5.add(f);
|
|
1139
|
-
16),h3.copyTo(mode384,24),h4.copyTo(mode384,32),h5.copyTo(mode384,40),h6.copyTo(mode384,48),h7.copyTo(mode384,56));return mode384}}();exports.calculateSHA512=calculateSHA512;var calculateSHA384=function(){return function(data,
|
|
1140
|
-
AESBaseCipher);this.constructor===AESBaseCipher&&(0,_util.unreachable)("Cannot initialize AESBaseCipher.");this._s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,
|
|
1150
|
-
value:function(input,key){var u,state=new Uint8Array(16);state.set(input);input=0;for(u=this._keySize;16>input;++input,++u)state[input]^=key[u];for(input=this._cyclesOfRepetition-1;1<=input;--input){var t=
|
|
1151
|
-
|
|
1152
|
-
state[
|
|
1153
|
-
state
|
|
1154
|
-
v=state[
|
|
1155
|
-
data[i],++bufferLength,!(16>bufferLength)){bufferLength=this._decrypt(buffer,this._key);for(var j=0;16>j;++j)bufferLength[j]^=iv[j];iv=buffer;result.push(bufferLength);
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
sourceLength);return data}}]);return AESBaseCipher}();var AES128Cipher=function(_AESBaseCipher){function AES128Cipher(key){_classCallCheck(this,AES128Cipher);var _this=
|
|
1160
|
-
1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,
|
|
1161
|
-
102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141
|
|
1162
|
-
result[cipherKey-3],t2=result[cipherKey-2],t3=result[cipherKey-1],t4=result[cipherKey-4];t1=s[t1];t2=s[t2];t3=s[t3];t4=s[t4];t1^=rcon[i];for(var n=0;4>n;++n)result[cipherKey]=
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
new Uint8Array(password.length+
|
|
1167
|
-
return
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
hashData=
|
|
1177
|
-
|
|
1178
|
-
dict.get("
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
(0,_util.stringToBytes)(dict.get("
|
|
1182
|
-
null}if(!encryptionKey&&!password$jscomp$0)throw new _util.PasswordException("No password given",_util.PasswordResponses.NEED_PASSWORD);
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
4<=filter&&(filter=dict.get("CF"),(0,_primitives.isDict)(filter)&&(filter.suppressEncryption=!0),this.cf=filter,this.stmf=dict.get("StmF")||
|
|
1186
|
-
(key[i++]=115,key[i++]=65,key[i++]=108,key[i++]=84);return calculateMD5(key,0,i).subarray(0,Math.min(encryptionKey.length+5,16))}function buildCipherConstructor(cf,
|
|
1187
|
-
!
|
|
1188
|
-
this.algorithm||5===this.algorithm)return new CipherTransform(buildCipherConstructor(this.cf,this.stmf,num,gen,this.encryptionKey),buildCipherConstructor(this.cf,this.strf,
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
1
|
|
1198
|
-
actualHeight
|
|
1199
|
-
|
|
1200
|
-
IR
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
(
|
|
1205
|
-
(
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
value:function(src,srcOffset,
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
_getPrototypeOf(
|
|
1213
|
-
|
|
1214
|
-
|
|
793
|
+
function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.LZWStream=exports.StringStream=exports.StreamsSequenceStream=exports.Stream=exports.RunLengthStream=exports.PredictorStream=exports.NullStream=exports.FlateStream=exports.DecodeStream=exports.DecryptStream=exports.AsciiHexStream=exports.Ascii85Stream=void 0;var _util=__w_pdfjs_require__(5),_primitives=__w_pdfjs_require__(188),Stream=function(){function Stream(arrayBuffer,start,length,dict){this.bytes=
|
|
794
|
+
arrayBuffer instanceof Uint8Array?arrayBuffer:new Uint8Array(arrayBuffer);this.pos=this.start=start||0;this.end=start+length||this.bytes.length;this.dict=dict}Stream.prototype={get length(){return this.end-this.start},get isEmpty(){return 0===this.length},getByte:function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},getUint16:function(){var b0=this.getByte(),b1=this.getByte();return-1===b0||-1===b1?-1:(b0<<8)+b1},getInt32:function(){var b0=this.getByte(),b1=this.getByte(),b2=this.getByte(),
|
|
795
|
+
b3=this.getByte();return(b0<<24)+(b1<<16)+(b2<<8)+b3},getBytes:function(length){var forceClamped=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!1,bytes=this.bytes,pos=this.pos,strEnd=this.end;if(!length)return bytes=bytes.subarray(pos,strEnd),forceClamped?new Uint8ClampedArray(bytes):bytes;var end=pos+length;end>strEnd&&(end=strEnd);this.pos=end;bytes=bytes.subarray(pos,end);return forceClamped?new Uint8ClampedArray(bytes):bytes},peekByte:function(){var peekedByte=this.getByte();-1!==peekedByte&&
|
|
796
|
+
this.pos--;return peekedByte},peekBytes:function(length){var bytes=this.getBytes(length,1<arguments.length&&void 0!==arguments[1]?arguments[1]:!1);this.pos-=bytes.length;return bytes},getByteRange:function(begin,end){0>begin&&(begin=0);end>this.end&&(end=this.end);return this.bytes.subarray(begin,end)},skip:function(n){n||(n=1);this.pos+=n},reset:function(){this.pos=this.start},moveStart:function(){this.start=this.pos},makeSubStream:function(start,length,dict){return new Stream(this.bytes.buffer,
|
|
797
|
+
start,length,dict)}};return Stream}();exports.Stream=Stream;module=function(){function StringStream(str){str=(0,_util.stringToBytes)(str);Stream.call(this,str)}StringStream.prototype=Stream.prototype;return StringStream}();exports.StringStream=module;var DecodeStream=function(){function DecodeStream(maybeMinBufferLength){this._rawMinBufferLength=maybeMinBufferLength||0;this.bufferLength=this.pos=0;this.eof=!1;this.buffer=emptyBuffer;this.minBufferLength=512;if(maybeMinBufferLength)for(;this.minBufferLength<
|
|
798
|
+
maybeMinBufferLength;)this.minBufferLength*=2}var emptyBuffer=new Uint8Array(0);DecodeStream.prototype={get isEmpty(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength},ensureBuffer:function(requested){var buffer=this.buffer;if(requested<=buffer.byteLength)return buffer;for(var size=this.minBufferLength;size<requested;)size*=2;requested=new Uint8Array(size);requested.set(buffer);return this.buffer=requested},getByte:function(){for(var pos=this.pos;this.bufferLength<=
|
|
799
|
+
pos;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]},getUint16:function(){var b0=this.getByte(),b1=this.getByte();return-1===b0||-1===b1?-1:(b0<<8)+b1},getInt32:function(){var b0=this.getByte(),b1=this.getByte(),b2=this.getByte(),b3=this.getByte();return(b0<<24)+(b1<<16)+(b2<<8)+b3},getBytes:function(length){var forceClamped=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!1,end,pos=this.pos;if(length){this.ensureBuffer(pos+length);for(end=pos+length;!this.eof&&this.bufferLength<
|
|
800
|
+
end;)this.readBlock();var bufEnd=this.bufferLength;end>bufEnd&&(end=bufEnd)}else{for(;!this.eof;)this.readBlock();end=this.bufferLength}this.pos=end;end=this.buffer.subarray(pos,end);return!forceClamped||end instanceof Uint8ClampedArray?end:new Uint8ClampedArray(end)},peekByte:function(){var peekedByte=this.getByte();-1!==peekedByte&&this.pos--;return peekedByte},peekBytes:function(length){var bytes=this.getBytes(length,1<arguments.length&&void 0!==arguments[1]?arguments[1]:!1);this.pos-=bytes.length;
|
|
801
|
+
return bytes},makeSubStream:function(start,length,dict){for(var end=start+length;this.bufferLength<=end&&!this.eof;)this.readBlock();return new Stream(this.buffer,start,length,dict)},getByteRange:function(begin,end){(0,_util.unreachable)("Should not call DecodeStream.getByteRange")},skip:function(n){n||(n=1);this.pos+=n},reset:function(){this.pos=0},getBaseStreams:function(){return this.str&&this.str.getBaseStreams?this.str.getBaseStreams():[]}};return DecodeStream}();exports.DecodeStream=DecodeStream;
|
|
802
|
+
module=function(){function StreamsSequenceStream(streams){this.streams=streams;for(var maybeLength=0,i=0,ii=streams.length;i<ii;i++){var stream=streams[i];maybeLength=stream instanceof DecodeStream?maybeLength+stream._rawMinBufferLength:maybeLength+stream.length}DecodeStream.call(this,maybeLength)}StreamsSequenceStream.prototype=Object.create(DecodeStream.prototype);StreamsSequenceStream.prototype.readBlock=function(){var streams=this.streams;if(0===streams.length)this.eof=!0;else{streams=streams.shift().getBytes();
|
|
803
|
+
var bufferLength=this.bufferLength,newLength=bufferLength+streams.length;this.ensureBuffer(newLength).set(streams,bufferLength);this.bufferLength=newLength}};StreamsSequenceStream.prototype.getBaseStreams=function(){for(var baseStreams=[],i=0,ii=this.streams.length;i<ii;i++){var stream=this.streams[i];if(stream.getBaseStreams){var JSCompiler_temp_const=baseStreams.push,JSCompiler_temp_const$jscomp$0=JSCompiler_temp_const.apply;stream=stream.getBaseStreams();var JSCompiler_temp=stream;if(Array.isArray(JSCompiler_temp)){for(var i$jscomp$0=
|
|
804
|
+
0,arr2=Array(JSCompiler_temp.length);i$jscomp$0<JSCompiler_temp.length;i$jscomp$0++)arr2[i$jscomp$0]=JSCompiler_temp[i$jscomp$0];JSCompiler_temp=arr2}else JSCompiler_temp=void 0;JSCompiler_temp||(JSCompiler_temp=Symbol.iterator in Object(stream)||"[object Arguments]"===Object.prototype.toString.call(stream)?Array.from(stream):void 0);if(!(stream=JSCompiler_temp))throw new TypeError("Invalid attempt to spread non-iterable instance");JSCompiler_temp_const$jscomp$0.call(JSCompiler_temp_const,baseStreams,
|
|
805
|
+
stream)}}return baseStreams};return StreamsSequenceStream}();exports.StreamsSequenceStream=module;module=function(){function FlateStream(str,maybeLength){this.str=str;this.dict=str.dict;var cmf=str.getByte();str=str.getByte();if(-1===cmf||-1===str)throw new _util.FormatError("Invalid header in flate stream: ".concat(cmf,", ").concat(str));if(8!==(cmf&15))throw new _util.FormatError("Unknown compression method in flate stream: ".concat(cmf,", ").concat(str));if(0!==((cmf<<8)+str)%31)throw new _util.FormatError("Bad FCHECK in flate stream: ".concat(cmf,
|
|
806
|
+
", ").concat(str));if(str&32)throw new _util.FormatError("FDICT bit set in flate stream: ".concat(cmf,", ").concat(str));this.codeBuf=this.codeSize=0;DecodeStream.call(this,maybeLength)}var codeLenCodeMap=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lengthDecode=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),distDecode=new Int32Array([1,2,3,4,
|
|
807
|
+
65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),fixedLitCodeTab=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59E4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,
|
|
808
|
+
524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,
|
|
809
|
+
524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,
|
|
810
|
+
524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,
|
|
811
|
+
524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,
|
|
812
|
+
524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,
|
|
813
|
+
524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,
|
|
814
|
+
524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],fixedDistCodeTab=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,
|
|
815
|
+
327703,327695,0]),5];FlateStream.prototype=Object.create(DecodeStream.prototype);FlateStream.prototype.getBits=function(bits){for(var str=this.str,codeSize=this.codeSize,codeBuf=this.codeBuf,b;codeSize<bits;){if(-1===(b=str.getByte()))throw new _util.FormatError("Bad encoding in flate stream");codeBuf|=b<<codeSize;codeSize+=8}this.codeBuf=codeBuf>>bits;this.codeSize=codeSize-bits;return codeBuf&(1<<bits)-1};FlateStream.prototype.getCode=function(table){var str=this.str,codes=table[0],maxLen=table[1];
|
|
816
|
+
table=this.codeSize;for(var codeBuf=this.codeBuf,b;table<maxLen&&-1!==(b=str.getByte());)codeBuf|=b<<table,table+=8;codes=codes[codeBuf&(1<<maxLen)-1];str=codes>>16;codes&=65535;if(1>str||table<str)throw new _util.FormatError("Bad encoding in flate stream");this.codeBuf=codeBuf>>str;this.codeSize=table-str;return codes};FlateStream.prototype.generateHuffmanTable=function(lengths){var n=lengths.length,maxLen=0,i;for(i=0;i<n;++i)lengths[i]>maxLen&&(maxLen=lengths[i]);for(var size=1<<maxLen,codes=new Int32Array(size),
|
|
817
|
+
len=1,code=0,skip=2;len<=maxLen;++len,code<<=1,skip<<=1)for(var val=0;val<n;++val)if(lengths[val]===len){var code2=0,t=code;for(i=0;i<len;++i)code2=code2<<1|t&1,t>>=1;for(i=code2;i<size;i+=skip)codes[i]=len<<16|val;++code}return[codes,maxLen]};FlateStream.prototype.readBlock=function(){var len=this.str;var buffer=this.getBits(3);buffer&1&&(this.eof=!0);buffer>>=1;if(0===buffer){if(-1===(buffer=len.getByte()))throw new _util.FormatError("Bad block header in flate stream");var blockLen=buffer;if(-1===
|
|
818
|
+
(buffer=len.getByte()))throw new _util.FormatError("Bad block header in flate stream");blockLen|=buffer<<8;if(-1===(buffer=len.getByte()))throw new _util.FormatError("Bad block header in flate stream");var check=buffer;if(-1===(buffer=len.getByte()))throw new _util.FormatError("Bad block header in flate stream");check|=buffer<<8;if(check!==(~blockLen&65535)&&(0!==blockLen||0!==check))throw new _util.FormatError("Bad uncompressed block length in flate stream");this.codeSize=this.codeBuf=0;check=this.bufferLength;
|
|
819
|
+
var end=check+blockLen;buffer=this.ensureBuffer(end);this.bufferLength=end;0===blockLen?-1===len.peekByte()&&(this.eof=!0):(len=len.getBytes(blockLen),buffer.set(len,check),len.length<blockLen&&(this.eof=!0))}else{if(1===buffer)blockLen=fixedLitCodeTab,check=fixedDistCodeTab;else if(2===buffer){buffer=this.getBits(5)+257;end=this.getBits(5)+1;len=this.getBits(4)+4;check=new Uint8Array(codeLenCodeMap.length);for(blockLen=0;blockLen<len;++blockLen)check[codeLenCodeMap[blockLen]]=this.getBits(3);check=
|
|
820
|
+
this.generateHuffmanTable(check);blockLen=len=0;end=buffer+end;for(var codeLengths=new Uint8Array(end),bitsLength,bitsOffset,what;blockLen<end;){what=this.getCode(check);if(16===what)bitsLength=2,bitsOffset=3,what=len;else if(17===what)bitsOffset=bitsLength=3,what=len=0;else if(18===what)bitsLength=7,bitsOffset=11,what=len=0;else{codeLengths[blockLen++]=len=what;continue}for(bitsLength=this.getBits(bitsLength)+bitsOffset;0<bitsLength--;)codeLengths[blockLen++]=what}blockLen=this.generateHuffmanTable(codeLengths.subarray(0,
|
|
821
|
+
buffer));check=this.generateHuffmanTable(codeLengths.subarray(buffer,end))}else throw new _util.FormatError("Unknown block type in flate stream");end=(buffer=this.buffer)?buffer.length:0;for(codeLengths=this.bufferLength;;)if(what=this.getCode(blockLen),256>what)codeLengths+1>=end&&(buffer=this.ensureBuffer(codeLengths+1),end=buffer.length),buffer[codeLengths++]=what;else{if(256===what){this.bufferLength=codeLengths;break}what-=257;what=lengthDecode[what];bitsLength=what>>16;0<bitsLength&&(bitsLength=
|
|
822
|
+
this.getBits(bitsLength));len=(what&65535)+bitsLength;what=this.getCode(check);what=distDecode[what];bitsLength=what>>16;0<bitsLength&&(bitsLength=this.getBits(bitsLength));what=(what&65535)+bitsLength;codeLengths+len>=end&&(buffer=this.ensureBuffer(codeLengths+len),end=buffer.length);for(bitsLength=0;bitsLength<len;++bitsLength,++codeLengths)buffer[codeLengths]=buffer[codeLengths-what]}}};return FlateStream}();exports.FlateStream=module;module=function(){function PredictorStream(str,maybeLength,
|
|
823
|
+
params){if(!(0,_primitives.isDict)(params))return str;var predictor=this.predictor=params.get("Predictor")||1;if(1>=predictor)return str;if(2!==predictor&&(10>predictor||15<predictor))throw new _util.FormatError("Unsupported predictor: ".concat(predictor));this.readBlock=2===predictor?this.readBlockTiff:this.readBlockPng;this.str=str;this.dict=str.dict;str=this.colors=params.get("Colors")||1;predictor=this.bits=params.get("BitsPerComponent")||8;params=this.columns=params.get("Columns")||1;this.pixBytes=
|
|
824
|
+
str*predictor+7>>3;this.rowBytes=params*str*predictor+7>>3;DecodeStream.call(this,maybeLength);return this}PredictorStream.prototype=Object.create(DecodeStream.prototype);PredictorStream.prototype.readBlockTiff=function(){var rowBytes=this.rowBytes,bufferLength=this.bufferLength,buffer=this.ensureBuffer(bufferLength+rowBytes),bits=this.bits,colors=this.colors,rawBytes=this.str.getBytes(rowBytes);this.eof=!rawBytes.length;if(!this.eof){var inbuf=0,outbuf=0,inbits=0,outbits=0,pos=bufferLength;if(1===
|
|
825
|
+
bits&&1===colors)for(bufferLength=0;bufferLength<rowBytes;++bufferLength)bits=rawBytes[bufferLength]^inbuf,bits^=bits>>1,bits^=bits>>2,bits^=bits>>4,inbuf=(bits&1)<<7,buffer[pos++]=bits;else if(8===bits){for(bufferLength=0;bufferLength<colors;++bufferLength)buffer[pos++]=rawBytes[bufferLength];for(;bufferLength<rowBytes;++bufferLength)buffer[pos]=buffer[pos-colors]+rawBytes[bufferLength],pos++}else if(16===bits){inbuf=2*colors;for(bufferLength=0;bufferLength<inbuf;++bufferLength)buffer[pos++]=rawBytes[bufferLength];
|
|
826
|
+
for(;bufferLength<rowBytes;bufferLength+=2)bits=((rawBytes[bufferLength]&255)<<8)+(rawBytes[bufferLength+1]&255)+((buffer[pos-inbuf]&255)<<8)+(buffer[pos-inbuf+1]&255),buffer[pos++]=bits>>8&255,buffer[pos++]=bits&255}else{pos=new Uint8Array(colors+1);var bitMask=(1<<bits)-1,j=0,k=bufferLength,columns=this.columns;for(bufferLength=0;bufferLength<columns;++bufferLength)for(var kk=0;kk<colors;++kk)inbits<bits&&(inbuf=inbuf<<8|rawBytes[j++]&255,inbits+=8),pos[kk]=pos[kk]+(inbuf>>inbits-bits)&bitMask,
|
|
827
|
+
inbits-=bits,outbuf=outbuf<<bits|pos[kk],outbits+=bits,8<=outbits&&(buffer[k++]=outbuf>>outbits-8&255,outbits-=8);0<outbits&&(buffer[k++]=(outbuf<<8-outbits)+(inbuf&(1<<8-outbits)-1))}this.bufferLength+=rowBytes}};PredictorStream.prototype.readBlockPng=function(){var rowBytes=this.rowBytes,pixBytes=this.pixBytes,predictor=this.str.getByte(),rawBytes=this.str.getBytes(rowBytes);this.eof=!rawBytes.length;if(!this.eof){var bufferLength=this.bufferLength,buffer=this.ensureBuffer(bufferLength+rowBytes),
|
|
828
|
+
prevRow=buffer.subarray(bufferLength-rowBytes,bufferLength);0===prevRow.length&&(prevRow=new Uint8Array(rowBytes));switch(predictor){case 0:for(predictor=0;predictor<rowBytes;++predictor)buffer[bufferLength++]=rawBytes[predictor];break;case 1:for(predictor=0;predictor<pixBytes;++predictor)buffer[bufferLength++]=rawBytes[predictor];for(;predictor<rowBytes;++predictor)buffer[bufferLength]=buffer[bufferLength-pixBytes]+rawBytes[predictor]&255,bufferLength++;break;case 2:for(predictor=0;predictor<rowBytes;++predictor)buffer[bufferLength++]=
|
|
829
|
+
prevRow[predictor]+rawBytes[predictor]&255;break;case 3:for(predictor=0;predictor<pixBytes;++predictor)buffer[bufferLength++]=(prevRow[predictor]>>1)+rawBytes[predictor];for(;predictor<rowBytes;++predictor)buffer[bufferLength]=(prevRow[predictor]+buffer[bufferLength-pixBytes]>>1)+rawBytes[predictor]&255,bufferLength++;break;case 4:for(predictor=0;predictor<pixBytes;++predictor){var up=prevRow[predictor];var c=rawBytes[predictor];buffer[bufferLength++]=up+c}for(;predictor<rowBytes;++predictor){up=
|
|
830
|
+
prevRow[predictor];var upLeft=prevRow[predictor-pixBytes],left=buffer[bufferLength-pixBytes];c=left+up-upLeft;var pa=c-left;0>pa&&(pa=-pa);var pb=c-up;0>pb&&(pb=-pb);var pc=c-upLeft;0>pc&&(pc=-pc);c=rawBytes[predictor];pa<=pb&&pa<=pc?buffer[bufferLength++]=left+c:pb<=pc?buffer[bufferLength++]=up+c:buffer[bufferLength++]=upLeft+c}break;default:throw new _util.FormatError("Unsupported predictor: ".concat(predictor));}this.bufferLength+=rowBytes}};return PredictorStream}();exports.PredictorStream=module;
|
|
831
|
+
module=function(){function DecryptStream(str,maybeLength,decrypt){this.str=str;this.dict=str.dict;this.decrypt=decrypt;this.nextChunk=null;this.initialized=!1;DecodeStream.call(this,maybeLength)}DecryptStream.prototype=Object.create(DecodeStream.prototype);DecryptStream.prototype.readBlock=function(){if(this.initialized)var chunk=this.nextChunk;else chunk=this.str.getBytes(512),this.initialized=!0;if(chunk&&0!==chunk.length){this.nextChunk=this.str.getBytes(512);var decrypt=this.decrypt;chunk=decrypt(chunk,
|
|
832
|
+
!(this.nextChunk&&0<this.nextChunk.length));decrypt=this.bufferLength;var i,n=chunk.length,buffer=this.ensureBuffer(decrypt+n);for(i=0;i<n;i++)buffer[decrypt++]=chunk[i];this.bufferLength=decrypt}else this.eof=!0};return DecryptStream}();exports.DecryptStream=module;module=function(){function Ascii85Stream(str,maybeLength){this.str=str;this.dict=str.dict;this.input=new Uint8Array(5);maybeLength&&(maybeLength*=.8);DecodeStream.call(this,maybeLength)}Ascii85Stream.prototype=Object.create(DecodeStream.prototype);
|
|
833
|
+
Ascii85Stream.prototype.readBlock=function(){for(var str=this.str,c=str.getByte();(0,_util.isSpace)(c);)c=str.getByte();if(-1===c||126===c)this.eof=!0;else{var bufferLength=this.bufferLength,i;if(122===c){str=this.ensureBuffer(bufferLength+4);for(i=0;4>i;++i)str[bufferLength+i]=0;this.bufferLength+=4}else{var input=this.input;input[0]=c;for(i=1;5>i;++i){for(c=str.getByte();(0,_util.isSpace)(c);)c=str.getByte();input[i]=c;if(-1===c||126===c)break}str=this.ensureBuffer(bufferLength+i-1);this.bufferLength+=
|
|
834
|
+
i-1;if(5>i){for(;5>i;++i)input[i]=117;this.eof=!0}for(i=c=0;5>i;++i)c=85*c+(input[i]-33);for(i=3;0<=i;--i)str[bufferLength+i]=c&255,c>>=8}}};return Ascii85Stream}();exports.Ascii85Stream=module;module=function(){function AsciiHexStream(str,maybeLength){this.str=str;this.dict=str.dict;this.firstDigit=-1;maybeLength&&(maybeLength*=.5);DecodeStream.call(this,maybeLength)}AsciiHexStream.prototype=Object.create(DecodeStream.prototype);AsciiHexStream.prototype.readBlock=function(){var bytes=this.str.getBytes(8E3);
|
|
835
|
+
if(bytes.length){for(var buffer=this.ensureBuffer(this.bufferLength+(bytes.length+1>>1)),bufferLength=this.bufferLength,firstDigit=this.firstDigit,i=0,ii=bytes.length;i<ii;i++){var ch=bytes[i];if(48<=ch&&57>=ch)ch&=15;else if(65<=ch&&70>=ch||97<=ch&&102>=ch)ch=(ch&15)+9;else if(62===ch){this.eof=!0;break}else continue;0>firstDigit?firstDigit=ch:(buffer[bufferLength++]=firstDigit<<4|ch,firstDigit=-1)}0<=firstDigit&&this.eof&&(buffer[bufferLength++]=firstDigit<<4,firstDigit=-1);this.firstDigit=firstDigit;
|
|
836
|
+
this.bufferLength=bufferLength}else this.eof=!0};return AsciiHexStream}();exports.AsciiHexStream=module;module=function(){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(){var repeatHeader=this.str.getBytes(2);if(!repeatHeader||2>repeatHeader.length||128===repeatHeader[0])this.eof=!0;else{var bufferLength=this.bufferLength,n=repeatHeader[0];
|
|
837
|
+
if(128>n){var buffer=this.ensureBuffer(bufferLength+n+1);buffer[bufferLength++]=repeatHeader[1];0<n&&(repeatHeader=this.str.getBytes(n),buffer.set(repeatHeader,bufferLength),bufferLength+=n)}else{n=257-n;repeatHeader=repeatHeader[1];buffer=this.ensureBuffer(bufferLength+n+1);for(var i=0;i<n;i++)buffer[bufferLength++]=repeatHeader}this.bufferLength=bufferLength}};return RunLengthStream}();exports.RunLengthStream=module;module=function(){function LZWStream(str,maybeLength,earlyChange){this.str=str;
|
|
838
|
+
this.dict=str.dict;this.bitsCached=this.cachedData=0;str={earlyChange:earlyChange,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(4096),dictionaryLengths:new Uint16Array(4096),dictionaryPrevCodes:new Uint16Array(4096),currentSequence:new Uint8Array(4096),currentSequenceLength:0};for(earlyChange=0;256>earlyChange;++earlyChange)str.dictionaryValues[earlyChange]=earlyChange,str.dictionaryLengths[earlyChange]=1;this.lzwState=str;DecodeStream.call(this,maybeLength)}LZWStream.prototype=Object.create(DecodeStream.prototype);
|
|
839
|
+
LZWStream.prototype.readBits=function(n){for(var bitsCached=this.bitsCached,cachedData=this.cachedData;bitsCached<n;){var c=this.str.getByte();if(-1===c)return this.eof=!0,null;cachedData=cachedData<<8|c;bitsCached+=8}this.bitsCached=bitsCached-=n;this.cachedData=cachedData;this.lastCode=null;return cachedData>>>bitsCached&(1<<n)-1};LZWStream.prototype.readBlock=function(){var estimatedDecodedSize=1024,i,q,lzwState=this.lzwState;if(lzwState){var earlyChange=lzwState.earlyChange,nextCode=lzwState.nextCode,
|
|
840
|
+
dictionaryValues=lzwState.dictionaryValues,dictionaryLengths=lzwState.dictionaryLengths,dictionaryPrevCodes=lzwState.dictionaryPrevCodes,codeLength=lzwState.codeLength,prevCode=lzwState.prevCode,currentSequence=lzwState.currentSequence,currentSequenceLength=lzwState.currentSequenceLength,decodedLength=0,currentBufferLength=this.bufferLength,buffer=this.ensureBuffer(this.bufferLength+estimatedDecodedSize);for(i=0;512>i;i++){var code=this.readBits(codeLength),hasPrev=0<currentSequenceLength;if(256>
|
|
841
|
+
code)currentSequence[0]=code,currentSequenceLength=1;else if(258<=code)if(code<nextCode){currentSequenceLength=dictionaryLengths[code];var j=currentSequenceLength-1;for(q=code;0<=j;j--)currentSequence[j]=dictionaryValues[q],q=dictionaryPrevCodes[q]}else currentSequence[currentSequenceLength++]=currentSequence[0];else if(256===code){codeLength=9;nextCode=258;currentSequenceLength=0;continue}else{this.eof=!0;delete this.lzwState;break}hasPrev&&(dictionaryPrevCodes[nextCode]=prevCode,dictionaryLengths[nextCode]=
|
|
842
|
+
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<decodedLength){do estimatedDecodedSize+=512;while(estimatedDecodedSize<decodedLength);buffer=this.ensureBuffer(this.bufferLength+estimatedDecodedSize)}for(j=0;j<currentSequenceLength;j++)buffer[currentBufferLength++]=
|
|
843
|
+
currentSequence[j]}lzwState.nextCode=nextCode;lzwState.codeLength=codeLength;lzwState.prevCode=prevCode;lzwState.currentSequenceLength=currentSequenceLength;this.bufferLength=currentBufferLength}};return LZWStream}();exports.LZWStream=module;module=function(){function NullStream(){Stream.call(this,new Uint8Array(0))}NullStream.prototype=Stream.prototype;return NullStream}();exports.NullStream=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});
|
|
844
|
+
exports.CCITTFaxStream=void 0;var _primitives=__w_pdfjs_require__(188),_ccitt=__w_pdfjs_require__(197),_stream=__w_pdfjs_require__(195);module=function(){function CCITTFaxStream(str,maybeLength,params){this.str=str;this.dict=str.dict;(0,_primitives.isDict)(params)||(params=_primitives.Dict.empty);this.ccittFaxDecoder=new _ccitt.CCITTFaxDecoder({next:function(){return str.getByte()}},{K:params.get("K"),EndOfLine:params.get("EndOfLine"),EncodedByteAlign:params.get("EncodedByteAlign"),Columns:params.get("Columns"),
|
|
845
|
+
Rows:params.get("Rows"),EndOfBlock:params.get("EndOfBlock"),BlackIs1:params.get("BlackIs1")});_stream.DecodeStream.call(this,maybeLength)}CCITTFaxStream.prototype=Object.create(_stream.DecodeStream.prototype);CCITTFaxStream.prototype.readBlock=function(){for(;!this.eof;){var c=this.ccittFaxDecoder.readNextChar();if(-1===c){this.eof=!0;break}this.ensureBuffer(this.bufferLength+1);this.buffer[this.bufferLength++]=c}};return CCITTFaxStream}();exports.CCITTFaxStream=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,
|
|
846
|
+
"__esModule",{value:!0});exports.CCITTFaxDecoder=void 0;var _util=__w_pdfjs_require__(5);module=function(){function CCITTFaxDecoder(source){var options=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!source||"function"!==typeof source.next)throw Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=source;this.eof=!1;this.encoding=options.K||0;this.eoline=options.EndOfLine||!1;this.byteAlign=options.EncodedByteAlign||!1;this.columns=options.Columns||1728;this.rows=options.Rows||
|
|
847
|
+
0;var eoblock=options.EndOfBlock;if(null===eoblock||void 0===eoblock)eoblock=!0;this.eoblock=eoblock;this.black=options.BlackIs1||!1;this.codingLine=new Uint32Array(this.columns+1);this.refLine=new Uint32Array(this.columns+2);this.codingLine[0]=this.columns;this.row=this.codingPos=0;this.nextLine2D=0>this.encoding;this.outputBits=this.inputBuf=this.inputBits=0;for(this.rowsDone=!1;0===(options=this._lookBits(12));)this._eatBits(1);1===options&&this._eatBits(12);0<this.encoding&&(this.nextLine2D=!this._lookBits(1),
|
|
848
|
+
this._eatBits(1))}var twoDimTable=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],
|
|
849
|
+
[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],whiteTable1=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,
|
|
850
|
+
2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],whiteTable2=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],
|
|
851
|
+
[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,
|
|
852
|
+
10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],
|
|
853
|
+
[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],
|
|
854
|
+
[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],
|
|
855
|
+
[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],
|
|
856
|
+
[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],
|
|
857
|
+
[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],blackTable1=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],
|
|
858
|
+
[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,
|
|
859
|
+
448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],blackTable2=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],
|
|
860
|
+
[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],
|
|
861
|
+
[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,
|
|
862
|
+
12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],blackTable3=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];CCITTFaxDecoder.prototype=
|
|
863
|
+
{readNextChar:function(){if(this.eof)return-1;var refLine=this.refLine,codingLine=this.codingLine,columns=this.columns,refPos,blackPixels;if(0===this.outputBits){this.rowsDone&&(this.eof=!0);if(this.eof)return-1;this.err=!1;var code2,code3;if(this.nextLine2D){for(refPos=0;codingLine[refPos]<columns;++refPos)refLine[refPos]=codingLine[refPos];refLine[refPos++]=columns;refLine[refPos]=columns;for(blackPixels=refPos=this.codingPos=codingLine[0]=0;codingLine[this.codingPos]<columns;){var bits=this._getTwoDimCode();
|
|
864
|
+
switch(bits){case 0:this._addPixels(refLine[refPos+1],blackPixels);refLine[refPos+1]<columns&&(refPos+=2);break;case 1:bits=code2=0;if(blackPixels){do bits+=code3=this._getBlackCode();while(64<=code3);do code2+=code3=this._getWhiteCode();while(64<=code3)}else{do bits+=code3=this._getWhiteCode();while(64<=code3);do code2+=code3=this._getBlackCode();while(64<=code3)}this._addPixels(codingLine[this.codingPos]+bits,blackPixels);for(codingLine[this.codingPos]<columns&&this._addPixels(codingLine[this.codingPos]+
|
|
865
|
+
code2,blackPixels^1);refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case 7:this._addPixels(refLine[refPos]+3,blackPixels);blackPixels^=1;if(codingLine[this.codingPos]<columns)for(++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case 5:this._addPixels(refLine[refPos]+2,blackPixels);blackPixels^=1;if(codingLine[this.codingPos]<columns)for(++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=
|
|
866
|
+
2;break;case 3:this._addPixels(refLine[refPos]+1,blackPixels);blackPixels^=1;if(codingLine[this.codingPos]<columns)for(++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case 2:this._addPixels(refLine[refPos],blackPixels);blackPixels^=1;if(codingLine[this.codingPos]<columns)for(++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case 8:this._addPixelsNeg(refLine[refPos]-3,blackPixels);blackPixels^=1;if(codingLine[this.codingPos]<
|
|
867
|
+
columns)for(0<refPos?--refPos:++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case 6:this._addPixelsNeg(refLine[refPos]-2,blackPixels);blackPixels^=1;if(codingLine[this.codingPos]<columns)for(0<refPos?--refPos:++refPos;refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case 4:this._addPixelsNeg(refLine[refPos]-1,blackPixels);blackPixels^=1;if(codingLine[this.codingPos]<columns)for(0<refPos?--refPos:++refPos;refLine[refPos]<=
|
|
868
|
+
codingLine[this.codingPos]&&refLine[refPos]<columns;)refPos+=2;break;case -1:this._addPixels(columns,0);this.eof=!0;break;default:(0,_util.info)("bad 2d code"),this._addPixels(columns,0),this.err=!0}}}else for(blackPixels=this.codingPos=codingLine[0]=0;codingLine[this.codingPos]<columns;){bits=0;if(blackPixels){do bits+=code3=this._getBlackCode();while(64<=code3)}else{do bits+=code3=this._getWhiteCode();while(64<=code3)}this._addPixels(codingLine[this.codingPos]+bits,blackPixels);blackPixels^=1}refLine=
|
|
869
|
+
!1;this.byteAlign&&(this.inputBits&=-8);if(this.eoblock||this.row!==this.rows-1){bits=this._lookBits(12);if(this.eoline)for(;-1!==bits&&1!==bits;)this._eatBits(1),bits=this._lookBits(12);else for(;0===bits;)this._eatBits(1),bits=this._lookBits(12);1===bits?(this._eatBits(12),refLine=!0):-1===bits&&(this.eof=!0)}else this.rowsDone=!0;!this.eof&&0<this.encoding&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1));if(this.eoblock&&refLine&&this.byteAlign){if(bits=this._lookBits(12),
|
|
870
|
+
1===bits){this._eatBits(12);0<this.encoding&&(this._lookBits(1),this._eatBits(1));if(0<=this.encoding)for(refPos=0;4>refPos;++refPos)bits=this._lookBits(12),1!==bits&&(0,_util.info)("bad rtc code: "+bits),this._eatBits(12),0<this.encoding&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){bits=this._lookBits(13);if(-1===bits)return this.eof=!0,-1;if(1===bits>>1)break;this._eatBits(1)}this._eatBits(12);0<this.encoding&&(this._eatBits(1),this.nextLine2D=!(bits&
|
|
871
|
+
1))}this.outputBits=0<codingLine[0]?codingLine[this.codingPos=0]:codingLine[this.codingPos=1];this.row++}if(8<=this.outputBits)refLine=this.codingPos&1?0:255,this.outputBits-=8,0===this.outputBits&&codingLine[this.codingPos]<columns&&(this.codingPos++,this.outputBits=codingLine[this.codingPos]-codingLine[this.codingPos-1]);else{bits=8;refLine=0;do this.outputBits>bits?(refLine<<=bits,this.codingPos&1||(refLine|=255>>8-bits),this.outputBits-=bits,bits=0):(refLine<<=this.outputBits,this.codingPos&1||
|
|
872
|
+
(refLine|=255>>8-this.outputBits),bits-=this.outputBits,this.outputBits=0,codingLine[this.codingPos]<columns?(this.codingPos++,this.outputBits=codingLine[this.codingPos]-codingLine[this.codingPos-1]):0<bits&&(refLine<<=bits,bits=0));while(bits)}this.black&&(refLine^=255);return refLine},_addPixels:function(a1,blackPixels){var codingLine=this.codingLine,codingPos=this.codingPos;a1>codingLine[codingPos]&&(a1>this.columns&&((0,_util.info)("row is wrong length"),this.err=!0,a1=this.columns),codingPos&
|
|
873
|
+
1^blackPixels&&++codingPos,codingLine[codingPos]=a1);this.codingPos=codingPos},_addPixelsNeg:function(a1,blackPixels){var codingLine=this.codingLine,codingPos=this.codingPos;if(a1>codingLine[codingPos])a1>this.columns&&((0,_util.info)("row is wrong length"),this.err=!0,a1=this.columns),codingPos&1^blackPixels&&++codingPos,codingLine[codingPos]=a1;else if(a1<codingLine[codingPos]){0>a1&&((0,_util.info)("invalid code"),this.err=!0,a1=0);for(;0<codingPos&&a1<codingLine[codingPos-1];)--codingPos;codingLine[codingPos]=
|
|
874
|
+
a1}this.codingPos=codingPos},_findTableCode:function(start,end,table,limit){for(limit=limit||0;start<=end;++start){var code=this._lookBits(start);if(-1===code)return[!0,1,!1];start<end&&(code<<=end-start);if(!limit||code>=limit)if(code=table[code-limit],code[0]===start)return this._eatBits(start),[!0,code[1],!0]}return[!1,0,!1]},_getTwoDimCode:function(){if(this.eoblock){var code=this._lookBits(7);if((code=twoDimTable[code])&&0<code[0])return this._eatBits(code[0]),code[1]}else if(code=this._findTableCode(1,
|
|
875
|
+
7,twoDimTable),code[0]&&code[2])return code[1];(0,_util.info)("Bad two dim code");return-1},_getWhiteCode:function(){if(this.eoblock){var code=this._lookBits(12);if(-1===code)return 1;code=0===code>>5?whiteTable1[code]:whiteTable2[code>>3];if(0<code[0])return this._eatBits(code[0]),code[1]}else{code=this._findTableCode(1,9,whiteTable2);if(code[0])return code[1];code=this._findTableCode(11,12,whiteTable1);if(code[0])return code[1]}(0,_util.info)("bad white code");this._eatBits(1);return 1},_getBlackCode:function(){if(this.eoblock){var code=
|
|
876
|
+
this._lookBits(13);if(-1===code)return 1;code=0===code>>7?blackTable1[code]:0===code>>9&&0!==code>>7?blackTable2[(code>>1)-64]:blackTable3[code>>7];if(0<code[0])return this._eatBits(code[0]),code[1]}else{code=this._findTableCode(2,6,blackTable3);if(code[0])return code[1];code=this._findTableCode(7,12,blackTable2,64);if(code[0])return code[1];code=this._findTableCode(10,13,blackTable1);if(code[0])return code[1]}(0,_util.info)("bad black code");this._eatBits(1);return 1},_lookBits:function(n){for(var c;this.inputBits<
|
|
877
|
+
n;){if(-1===(c=this.source.next()))return 0===this.inputBits?-1:this.inputBuf<<n-this.inputBits&65535>>16-n;this.inputBuf=this.inputBuf<<8|c;this.inputBits+=8}return this.inputBuf>>this.inputBits-n&65535>>16-n},_eatBits:function(n){0>(this.inputBits-=n)&&(this.inputBits=0)}};return CCITTFaxDecoder}();exports.CCITTFaxDecoder=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.Jbig2Stream=void 0;var _primitives=__w_pdfjs_require__(188),
|
|
878
|
+
_stream=__w_pdfjs_require__(195),_jbig=__w_pdfjs_require__(199),_util=__w_pdfjs_require__(5);module=function(){function Jbig2Stream(stream,maybeLength,dict,params){this.stream=stream;this.maybeLength=maybeLength;this.dict=dict;this.params=params;_stream.DecodeStream.call(this,maybeLength)}Jbig2Stream.prototype=Object.create(_stream.DecodeStream.prototype);Object.defineProperty(Jbig2Stream.prototype,"bytes",{get:function(){return(0,_util.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},
|
|
879
|
+
configurable:!0});Jbig2Stream.prototype.ensureBuffer=function(requested){};Jbig2Stream.prototype.readBlock=function(){if(!this.eof){var jbig2Image=new _jbig.Jbig2Image,chunks=[];if((0,_primitives.isDict)(this.params)){var globalsStream=this.params.get("JBIG2Globals");(0,_primitives.isStream)(globalsStream)&&(globalsStream=globalsStream.getBytes(),chunks.push({data:globalsStream,start:0,end:globalsStream.length}))}chunks.push({data:this.bytes,start:0,end:this.bytes.length});jbig2Image=jbig2Image.parseChunks(chunks);
|
|
880
|
+
chunks=jbig2Image.length;for(globalsStream=0;globalsStream<chunks;globalsStream++)jbig2Image[globalsStream]^=255;this.buffer=jbig2Image;this.bufferLength=chunks;this.eof=!0}};return Jbig2Stream}();exports.Jbig2Stream=module},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?
|
|
881
|
+
"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,
|
|
882
|
+
writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}Object.defineProperty(exports,"__esModule",{value:!0});exports.Jbig2Image=void 0;var _util=__w_pdfjs_require__(5),_arithmetic_decoder=__w_pdfjs_require__(200),_ccitt=__w_pdfjs_require__(197),Jbig2Error=function(_BaseException){function Jbig2Error(msg){if(!(this instanceof
|
|
883
|
+
Jbig2Error))throw new TypeError("Cannot call a class as a function");msg=_getPrototypeOf(Jbig2Error).call(this,"JBIG2 error: ".concat(msg));if(!msg||"object"!==_typeof(msg)&&"function"!==typeof msg){if(void 0===this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");msg=this}return msg}_inherits(Jbig2Error,_BaseException);return Jbig2Error}(_util.BaseException);module=function(){function ContextCache(){}function DecodingContext(data,start,end){this.data=data;this.start=
|
|
884
|
+
start;this.end=end}function decodeInteger(contextCache,procedure,decoder){function readBits(length){for(var v=0,i=0;i<length;i++){var bit=decoder.readBit(contexts,prev);prev=256>prev?prev<<1|bit:(prev<<1|bit)&511|256;v=v<<1|bit}return v>>>0}var contexts=contextCache.getContexts(procedure),prev=1;contextCache=readBits(1);procedure=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 0===contextCache?
|
|
885
|
+
procedure:0<procedure?-procedure:null}function decodeIAID(contextCache,decoder,codeLength){contextCache=contextCache.getContexts("IAID");for(var prev=1,i=0;i<codeLength;i++){var bit=decoder.readBit(contextCache,prev);prev=prev<<1|bit}return 31>codeLength?prev&(1<<codeLength)-1:prev&2147483647}function decodeBitmapTemplate0(width,height,decodingContext){var decoder=decodingContext.decoder;decodingContext=decodingContext.contextCache.getContexts("GB");var i,j,pixel,bitmap=[];for(i=0;i<height;i++){var row=
|
|
886
|
+
bitmap[i]=new Uint8Array(width);var row1=1>i?row:bitmap[i-1];var row2=2>i?row:bitmap[i-2];var contextLabel=row2[0]<<13|row2[1]<<12|row2[2]<<11|row1[0]<<7|row1[1]<<6|row1[2]<<5|row1[3]<<4;for(j=0;j<width;j++)row[j]=pixel=decoder.readBit(decodingContext,contextLabel),contextLabel=(contextLabel&31735)<<1|(j+3<width?row2[j+3]<<11:0)|(j+4<width?row1[j+4]<<4:0)|pixel}return bitmap}function decodeBitmap(mmr,width,height,templateIndex,prediction,skip,at,decodingContext){if(mmr)return prediction=new Reader(decodingContext.data,
|
|
887
|
+
decodingContext.start,decodingContext.end),decodeMMRBitmap(prediction,width,height,!1);if(0===templateIndex&&!skip&&!prediction&&4===at.length&&3===at[0].x&&-1===at[0].y&&-3===at[1].x&&-1===at[1].y&&2===at[2].x&&-2===at[2].y&&-2===at[3].x&&-2===at[3].y)return decodeBitmapTemplate0(width,height,decodingContext);mmr=!!skip;var template=CodingTemplates[templateIndex].concat(at);template.sort(function(a,b){return a.y-b.y||a.x-b.x});at=template.length;var templateX=new Int8Array(at),templateY=new Int8Array(at),
|
|
888
|
+
changingTemplateEntries=[],reuseMask=0,minX=0,maxX=0,minY=0,c,k;for(k=0;k<at;k++)templateX[k]=template[k].x,templateY[k]=template[k].y,minX=Math.min(minX,template[k].x),maxX=Math.max(maxX,template[k].x),minY=Math.min(minY,template[k].y),k<at-1&&template[k].y===template[k+1].y&&template[k].x===template[k+1].x-1?reuseMask|=1<<at-1-k:changingTemplateEntries.push(k);var changingEntriesLength=changingTemplateEntries.length,changingTemplateX=new Int8Array(changingEntriesLength),changingTemplateY=new Int8Array(changingEntriesLength),
|
|
889
|
+
changingTemplateBit=new Uint16Array(changingEntriesLength);for(c=0;c<changingEntriesLength;c++)k=changingTemplateEntries[c],changingTemplateX[c]=template[k].x,changingTemplateY[c]=template[k].y,changingTemplateBit[c]=1<<at-1-k;template=-minX;minY=-minY;maxX=width-maxX;templateIndex=ReusedContexts[templateIndex];changingTemplateEntries=new Uint8Array(width);minX=[];c=decodingContext.decoder;decodingContext=decodingContext.contextCache.getContexts("GB");for(var ltp=0,j,i0,j0,contextLabel=0,shift,i=
|
|
890
|
+
0;i<height;i++){if(prediction&&(k=c.readBit(decodingContext,templateIndex),ltp^=k)){minX.push(changingTemplateEntries);continue}changingTemplateEntries=new Uint8Array(changingTemplateEntries);minX.push(changingTemplateEntries);for(j=0;j<width;j++)if(mmr&&skip[i][j])changingTemplateEntries[j]=0;else{if(j>=template&&j<maxX&&i>=minY)for(contextLabel=contextLabel<<1&reuseMask,k=0;k<changingEntriesLength;k++){if(i0=i+changingTemplateY[k],j0=j+changingTemplateX[k],i0=minX[i0][j0])i0=changingTemplateBit[k],
|
|
891
|
+
contextLabel|=i0}else for(contextLabel=0,shift=at-1,k=0;k<at;k++,shift--)j0=j+templateX[k],0<=j0&&j0<width&&(i0=i+templateY[k],0<=i0&&(i0=minX[i0][j0])&&(contextLabel|=i0<<shift));k=c.readBit(decodingContext,contextLabel);changingTemplateEntries[j]=k}}return minX}function decodeRefinement(width,height,templateIndex,referenceBitmap,offsetX,offsetY,prediction,at,decodingContext){var codingTemplate=RefinementTemplates[templateIndex].coding;0===templateIndex&&(codingTemplate=codingTemplate.concat([at[0]]));
|
|
892
|
+
var codingTemplateLength=codingTemplate.length,codingTemplateX=new Int32Array(codingTemplateLength),codingTemplateY=new Int32Array(codingTemplateLength),k;for(k=0;k<codingTemplateLength;k++)codingTemplateX[k]=codingTemplate[k].x,codingTemplateY[k]=codingTemplate[k].y;var referenceTemplate=RefinementTemplates[templateIndex].reference;0===templateIndex&&(referenceTemplate=referenceTemplate.concat([at[1]]));at=referenceTemplate.length;codingTemplate=new Int32Array(at);var referenceTemplateY=new Int32Array(at);
|
|
893
|
+
for(k=0;k<at;k++)codingTemplate[k]=referenceTemplate[k].x,referenceTemplateY[k]=referenceTemplate[k].y;referenceTemplate=referenceBitmap[0].length;var referenceHeight=referenceBitmap.length;templateIndex=RefinementReusedContexts[templateIndex];var bitmap=[],decoder=decodingContext.decoder;decodingContext=decodingContext.contextCache.getContexts("GR");for(var ltp=0,i=0;i<height;i++){if(prediction&&(k=decoder.readBit(decodingContext,templateIndex),ltp^=k))throw new Jbig2Error("prediction is not supported");
|
|
894
|
+
var row=new Uint8Array(width);bitmap.push(row);for(var j=0;j<width;j++){var contextLabel=0;for(k=0;k<codingTemplateLength;k++){var i0=i+codingTemplateY[k];var j0=j+codingTemplateX[k];contextLabel=0>i0||0>j0||j0>=width?contextLabel<<1:contextLabel<<1|bitmap[i0][j0]}for(k=0;k<at;k++)i0=i+referenceTemplateY[k]-offsetY,j0=j+codingTemplate[k]-offsetX,contextLabel=0>i0||i0>=referenceHeight||0>j0||j0>=referenceTemplate?contextLabel<<1:contextLabel<<1|referenceBitmap[i0][j0];k=decoder.readBit(decodingContext,
|
|
895
|
+
contextLabel);row[j]=k}}return bitmap}function decodeTextRegion(huffman,refinement,width,height,defaultPixelValue,numberOfSymbolInstances,stripSize,inputSymbols,symbolCodeLength,transposed,dsOffset,referenceCorner,combinationOperator,huffmanTables,refinementTemplateIndex,refinementAt,decodingContext,logStripSize,huffmanInput){if(huffman&&refinement)throw new Jbig2Error("refinement with Huffman is not supported");var bitmap=[],i;for(i=0;i<height;i++){var row=new Uint8Array(width);if(defaultPixelValue)for(var j=
|
|
896
|
+
0;j<width;j++)row[j]=defaultPixelValue;bitmap.push(row)}height=decodingContext.decoder;defaultPixelValue=decodingContext.contextCache;j=huffman?-huffmanTables.tableDeltaT.decode(huffmanInput):-decodeInteger(defaultPixelValue,"IADT",height);var firstS=0;for(i=0;i<numberOfSymbolInstances;){var deltaT=huffman?huffmanTables.tableDeltaT.decode(huffmanInput):decodeInteger(defaultPixelValue,"IADT",height);j+=deltaT;deltaT=huffman?huffmanTables.tableFirstS.decode(huffmanInput):decodeInteger(defaultPixelValue,
|
|
897
|
+
"IAFS",height);deltaT=firstS+=deltaT;do{var currentT=0;1<stripSize&&(currentT=huffman?huffmanInput.readBits(logStripSize):decodeInteger(defaultPixelValue,"IAIT",height));row=stripSize*j+currentT;currentT=huffman?huffmanTables.symbolIDTable.decode(huffmanInput):decodeIAID(defaultPixelValue,height,symbolCodeLength);var applyRefinement=refinement&&(huffman?huffmanInput.readBit():decodeInteger(defaultPixelValue,"IARI",height));currentT=inputSymbols[currentT];var symbolWidth=currentT[0].length,symbolHeight=
|
|
898
|
+
currentT.length;if(applyRefinement){applyRefinement=decodeInteger(defaultPixelValue,"IARDW",height);var rdh=decodeInteger(defaultPixelValue,"IARDH",height),rdx=decodeInteger(defaultPixelValue,"IARDX",height),rdy=decodeInteger(defaultPixelValue,"IARDY",height);symbolWidth+=applyRefinement;symbolHeight+=rdh;currentT=decodeRefinement(symbolWidth,symbolHeight,refinementTemplateIndex,currentT,(applyRefinement>>1)+rdx,(rdh>>1)+rdy,!1,refinementAt,decodingContext)}applyRefinement=row-(referenceCorner&1?
|
|
899
|
+
0:symbolHeight-1);rdh=deltaT-(referenceCorner&2?symbolWidth-1:0);if(transposed){for(rdx=0;rdx<symbolHeight;rdx++)if(row=bitmap[rdh+rdx]){var symbolRow=currentT[rdx];var maxWidth=Math.min(width-applyRefinement,symbolWidth);switch(combinationOperator){case 0:for(rdy=0;rdy<maxWidth;rdy++)row[applyRefinement+rdy]|=symbolRow[rdy];break;case 2:for(rdy=0;rdy<maxWidth;rdy++)row[applyRefinement+rdy]^=symbolRow[rdy];break;default:throw new Jbig2Error("operator ".concat(combinationOperator," is not supported"));
|
|
900
|
+
}}deltaT+=symbolHeight-1}else{for(rdy=0;rdy<symbolHeight;rdy++)if(row=bitmap[applyRefinement+rdy])switch(symbolRow=currentT[rdy],combinationOperator){case 0:for(rdx=0;rdx<symbolWidth;rdx++)row[rdh+rdx]|=symbolRow[rdx];break;case 2:for(rdx=0;rdx<symbolWidth;rdx++)row[rdh+rdx]^=symbolRow[rdx];break;default:throw new Jbig2Error("operator ".concat(combinationOperator," is not supported"));}deltaT+=symbolWidth-1}i++;currentT=huffman?huffmanTables.tableDeltaS.decode(huffmanInput):decodeInteger(defaultPixelValue,
|
|
901
|
+
"IADS",height);if(null===currentT)break;deltaT+=currentT+dsOffset}while(1)}return bitmap}function readSegments(header,data,start$jscomp$0,end){for(var segments=[],position=start$jscomp$0;position<end;){start$jscomp$0=data;var start=position;position={};position.number=(0,_util.readUint32)(start$jscomp$0,start);var ii=start$jscomp$0[start+4];var segmentType=ii&63;if(!SegmentTypes[segmentType])throw new Jbig2Error("invalid segment type: "+segmentType);position.type=segmentType;position.typeName=SegmentTypes[segmentType];
|
|
902
|
+
position.deferredNonRetain=!!(ii&128);ii=!!(ii&64);var referredFlags=start$jscomp$0[start+5],referredToCount=referredFlags>>5&7;var i=[referredFlags&31];start+=6;if(7===referredFlags)for(referredToCount=(0,_util.readUint32)(start$jscomp$0,start-1)&536870911,start+=3,referredFlags=referredToCount+7>>3,i[0]=start$jscomp$0[start++];0<--referredFlags;)i.push(start$jscomp$0[start++]);else if(5===referredFlags||6===referredFlags)throw new Jbig2Error("invalid referred-to flags");position.retainBits=i;referredFlags=
|
|
903
|
+
256>=position.number?1:65536>=position.number?2:4;var referredTo=[];for(i=0;i<referredToCount;i++){var number=1===referredFlags?start$jscomp$0[start]:2===referredFlags?(0,_util.readUint16)(start$jscomp$0,start):(0,_util.readUint32)(start$jscomp$0,start);referredTo.push(number);start+=referredFlags}position.referredTo=referredTo;ii?(position.pageAssociation=(0,_util.readUint32)(start$jscomp$0,start),start+=4):position.pageAssociation=start$jscomp$0[start++];position.length=(0,_util.readUint32)(start$jscomp$0,
|
|
904
|
+
start);start+=4;if(4294967295===position.length)if(38===segmentType){ii=readRegionSegmentInformation(start$jscomp$0,start);referredToCount=!!(start$jscomp$0[start+RegionSegmentInformationFieldLength]&1);segmentType=new Uint8Array(6);referredToCount||(segmentType[0]=255,segmentType[1]=172);segmentType[2]=ii.height>>>24&255;segmentType[3]=ii.height>>16&255;segmentType[4]=ii.height>>8&255;segmentType[5]=ii.height&255;i=start;for(ii=start$jscomp$0.length;i<ii;i++){for(referredToCount=0;6>referredToCount&&
|
|
905
|
+
segmentType[referredToCount]===start$jscomp$0[i+referredToCount];)referredToCount++;if(6===referredToCount){position.length=i+6;break}}if(4294967295===position.length)throw new Jbig2Error("segment end was not found");}else throw new Jbig2Error("invalid unknown segment length");position.headerEnd=start;start$jscomp$0=position;position=start$jscomp$0.headerEnd;start={header:start$jscomp$0,data:data};header.randomAccess||(start.start=position,position+=start$jscomp$0.length,start.end=position);segments.push(start);
|
|
906
|
+
if(51===start$jscomp$0.type)break}if(header.randomAccess)for(header=0,data=segments.length;header<data;header++)segments[header].start=position,position+=segments[header].header.length,segments[header].end=position;return segments}function readRegionSegmentInformation(data,start){return{width:(0,_util.readUint32)(data,start),height:(0,_util.readUint32)(data,start+4),x:(0,_util.readUint32)(data,start+8),y:(0,_util.readUint32)(data,start+12),combinationOperator:data[start+16]&7}}function processSegments(segments,
|
|
907
|
+
visitor$jscomp$0){for(var i=0,ii=segments.length;i<ii;i++){var i$jscomp$0=void 0;var segment=segments[i],visitor=visitor$jscomp$0,header=segment.header,data=segment.data,position=segment.start;segment=segment.end;switch(header.type){case 0:var dictionary={};i$jscomp$0=(0,_util.readUint16)(data,position);dictionary.huffman=!!(i$jscomp$0&1);dictionary.refinement=!!(i$jscomp$0&2);dictionary.huffmanDHSelector=i$jscomp$0>>2&3;dictionary.huffmanDWSelector=i$jscomp$0>>4&3;dictionary.bitmapSizeSelector=i$jscomp$0>>
|
|
908
|
+
6&1;dictionary.aggregationInstancesSelector=i$jscomp$0>>7&1;dictionary.bitmapCodingContextUsed=!!(i$jscomp$0&256);dictionary.bitmapCodingContextRetained=!!(i$jscomp$0&512);dictionary.template=i$jscomp$0>>10&3;dictionary.refinementTemplate=i$jscomp$0>>12&1;position+=2;if(!dictionary.huffman){var atLength=0===dictionary.template?4:1;var at=[];for(i$jscomp$0=0;i$jscomp$0<atLength;i$jscomp$0++)at.push({x:(0,_util.readInt8)(data,position),y:(0,_util.readInt8)(data,position+1)}),position+=2;dictionary.at=
|
|
909
|
+
at}if(dictionary.refinement&&!dictionary.refinementTemplate){at=[];for(i$jscomp$0=0;2>i$jscomp$0;i$jscomp$0++)at.push({x:(0,_util.readInt8)(data,position),y:(0,_util.readInt8)(data,position+1)}),position+=2;dictionary.refinementAt=at}dictionary.numberOfExportedSymbols=(0,_util.readUint32)(data,position);position+=4;dictionary.numberOfNewSymbols=(0,_util.readUint32)(data,position);i$jscomp$0=[dictionary,header.number,header.referredTo,data,position+4,segment];break;case 6:case 7:atLength={};atLength.info=
|
|
910
|
+
readRegionSegmentInformation(data,position);position+=RegionSegmentInformationFieldLength;i$jscomp$0=(0,_util.readUint16)(data,position);position+=2;atLength.huffman=!!(i$jscomp$0&1);atLength.refinement=!!(i$jscomp$0&2);atLength.logStripSize=i$jscomp$0>>2&3;atLength.stripSize=1<<atLength.logStripSize;atLength.referenceCorner=i$jscomp$0>>4&3;atLength.transposed=!!(i$jscomp$0&64);atLength.combinationOperator=i$jscomp$0>>7&3;atLength.defaultPixelValue=i$jscomp$0>>9&1;atLength.dsOffset=i$jscomp$0<<17>>
|
|
911
|
+
27;atLength.refinementTemplate=i$jscomp$0>>15&1;atLength.huffman&&(i$jscomp$0=(0,_util.readUint16)(data,position),position+=2,atLength.huffmanFS=i$jscomp$0&3,atLength.huffmanDS=i$jscomp$0>>2&3,atLength.huffmanDT=i$jscomp$0>>4&3,atLength.huffmanRefinementDW=i$jscomp$0>>6&3,atLength.huffmanRefinementDH=i$jscomp$0>>8&3,atLength.huffmanRefinementDX=i$jscomp$0>>10&3,atLength.huffmanRefinementDY=i$jscomp$0>>12&3,atLength.huffmanRefinementSizeSelector=!!(i$jscomp$0&16384));if(atLength.refinement&&!atLength.refinementTemplate){at=
|
|
912
|
+
[];for(i$jscomp$0=0;2>i$jscomp$0;i$jscomp$0++)at.push({x:(0,_util.readInt8)(data,position),y:(0,_util.readInt8)(data,position+1)}),position+=2;atLength.refinementAt=at}atLength.numberOfSymbolInstances=(0,_util.readUint32)(data,position);i$jscomp$0=[atLength,header.referredTo,data,position+4,segment];break;case 16:i$jscomp$0={};at=data[position++];i$jscomp$0.mmr=!!(at&1);i$jscomp$0.template=at>>1&3;i$jscomp$0.patternWidth=data[position++];i$jscomp$0.patternHeight=data[position++];i$jscomp$0.maxPatternIndex=
|
|
913
|
+
(0,_util.readUint32)(data,position);i$jscomp$0=[i$jscomp$0,header.number,data,position+4,segment];break;case 22:case 23:i$jscomp$0={};i$jscomp$0.info=readRegionSegmentInformation(data,position);position+=RegionSegmentInformationFieldLength;at=data[position++];i$jscomp$0.mmr=!!(at&1);i$jscomp$0.template=at>>1&3;i$jscomp$0.enableSkip=!!(at&8);i$jscomp$0.combinationOperator=at>>4&7;i$jscomp$0.defaultPixelValue=at>>7&1;i$jscomp$0.gridWidth=(0,_util.readUint32)(data,position);position+=4;i$jscomp$0.gridHeight=
|
|
914
|
+
(0,_util.readUint32)(data,position);position+=4;i$jscomp$0.gridOffsetX=(0,_util.readUint32)(data,position)&4294967295;position+=4;i$jscomp$0.gridOffsetY=(0,_util.readUint32)(data,position)&4294967295;position+=4;i$jscomp$0.gridVectorX=(0,_util.readUint16)(data,position);position+=2;i$jscomp$0.gridVectorY=(0,_util.readUint16)(data,position);i$jscomp$0=[i$jscomp$0,header.referredTo,data,position+2,segment];break;case 38:case 39:dictionary={};dictionary.info=readRegionSegmentInformation(data,position);
|
|
915
|
+
position+=RegionSegmentInformationFieldLength;i$jscomp$0=data[position++];dictionary.mmr=!!(i$jscomp$0&1);dictionary.template=i$jscomp$0>>1&3;dictionary.prediction=!!(i$jscomp$0&8);if(!dictionary.mmr){atLength=0===dictionary.template?4:1;at=[];for(i$jscomp$0=0;i$jscomp$0<atLength;i$jscomp$0++)at.push({x:(0,_util.readInt8)(data,position),y:(0,_util.readInt8)(data,position+1)}),position+=2;dictionary.at=at}i$jscomp$0=[dictionary,data,position,segment];break;case 48:segment={width:(0,_util.readUint32)(data,
|
|
916
|
+
position),height:(0,_util.readUint32)(data,position+4),resolutionX:(0,_util.readUint32)(data,position+8),resolutionY:(0,_util.readUint32)(data,position+12)};4294967295===segment.height&&delete segment.height;i$jscomp$0=data[position+16];(0,_util.readUint16)(data,position+17);segment.lossless=!!(i$jscomp$0&1);segment.refinement=!!(i$jscomp$0&2);segment.defaultPixelValue=i$jscomp$0>>2&1;segment.combinationOperator=i$jscomp$0>>3&3;segment.requiresBuffer=!!(i$jscomp$0&32);segment.combinationOperatorOverride=
|
|
917
|
+
!!(i$jscomp$0&64);i$jscomp$0=[segment];break;case 49:break;case 50:break;case 51:break;case 53:i$jscomp$0=[header.number,data,position,segment];break;case 62:break;default:throw new Jbig2Error("segment type ".concat(header.typeName,"(").concat(header.type,")")+" is not implemented");}header="on"+header.typeName;header in visitor&&visitor[header].apply(visitor,i$jscomp$0)}}function SimpleSegmentVisitor(){}function HuffmanLine(lineData){2===lineData.length?(this.isOOB=!0,this.rangeLow=0,this.prefixLength=
|
|
918
|
+
lineData[0],this.rangeLength=0,this.prefixCode=lineData[1],this.isLowerRange=!1):(this.isOOB=!1,this.rangeLow=lineData[0],this.prefixLength=lineData[1],this.rangeLength=lineData[2],this.prefixCode=lineData[3],this.isLowerRange="lower"===lineData[4])}function HuffmanTreeNode(line){this.children=[];line?(this.isLeaf=!0,this.rangeLength=line.rangeLength,this.rangeLow=line.rangeLow,this.isLowerRange=line.isLowerRange,this.isOOB=line.isOOB):this.isLeaf=!1}function HuffmanTable(lines,prefixCodesDone){prefixCodesDone||
|
|
919
|
+
this.assignPrefixCodes(lines);this.rootNode=new HuffmanTreeNode(null);var ii=lines.length;for(prefixCodesDone=0;prefixCodesDone<ii;prefixCodesDone++){var line=lines[prefixCodesDone];0<line.prefixLength&&this.rootNode.buildTree(line,line.prefixLength-1)}}function getStandardTable(number){var table=standardTablesCache[number];if(table)return table;switch(number){case 1:table=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:table=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,
|
|
920
|
+
6,32,62],[6,63]];break;case 3:table=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:table=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:table=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:table=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],
|
|
921
|
+
[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:table=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:table=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,
|
|
922
|
+
7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:table=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:table=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],
|
|
923
|
+
[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:table=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:table=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],
|
|
924
|
+
[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:table=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:table=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:table=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new Jbig2Error("standard table B.".concat(number,
|
|
925
|
+
" does not exist"));}var length=table.length,i;for(i=0;i<length;i++)table[i]=new HuffmanLine(table[i]);table=new HuffmanTable(table,!0);return standardTablesCache[number]=table}function Reader(data,start,end){this.data=data;this.start=start;this.end=end;this.position=start;this.shift=-1;this.currentByte=0}function getCustomHuffmanTable(index,referredTo,customTables){var currentIndex=0,i,ii=referredTo.length,table;for(i=0;i<ii;i++)if(table=customTables[referredTo[i]]){if(index===currentIndex)return table;
|
|
926
|
+
currentIndex++}throw new Jbig2Error("can't find custom Huffman table");}function decodeMMRBitmap(input,width,height,endOfBlock){input=new _ccitt.CCITTFaxDecoder(input,{K:-1,Columns:width,Rows:height,BlackIs1:!0,EndOfBlock:endOfBlock});var bitmap=[],x,y,eof=!1;for(y=0;y<height;y++){var row=new Uint8Array(width);bitmap.push(row);var shift=-1;for(x=0;x<width;x++){if(0>shift){var currentByte=input.readNextChar();-1===currentByte&&(currentByte=0,eof=!0);shift=7}row[x]=currentByte>>shift&1;shift--}}if(endOfBlock&&
|
|
927
|
+
!eof)for(width=0;5>width&&-1!==input.readNextChar();width++);return bitmap}function Jbig2Image(){}ContextCache.prototype={getContexts:function(id){return id in this?this[id]:this[id]=new Int8Array(65536)}};DecodingContext.prototype={get decoder(){var decoder=new _arithmetic_decoder.ArithmeticDecoder(this.data,this.start,this.end);return(0,_util.shadow)(this,"decoder",decoder)},get contextCache(){var cache=new ContextCache;return(0,_util.shadow)(this,"contextCache",cache)}};var SegmentTypes=["SymbolDictionary",
|
|
928
|
+
null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",
|
|
929
|
+
null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],CodingTemplates=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,
|
|
930
|
+
y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],RefinementTemplates=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],ReusedContexts=[39717,1941,229,405],RefinementReusedContexts=[32,
|
|
931
|
+
8],RegionSegmentInformationFieldLength=17;SimpleSegmentVisitor.prototype={onPageInformation:function(info){this.currentPageInfo=info;var buffer=new Uint8ClampedArray((info.width+7>>3)*info.height);if(info.defaultPixelValue){info=0;for(var ii=buffer.length;info<ii;info++)buffer[info]=255}this.buffer=buffer},drawBitmap:function(regionInfo,bitmap){var pageInfo=this.currentPageInfo,width=regionInfo.width,height=regionInfo.height,rowSize=pageInfo.width+7>>3,combinationOperator=pageInfo.combinationOperatorOverride?
|
|
932
|
+
regionInfo.combinationOperator:pageInfo.combinationOperator;pageInfo=this.buffer;var mask0=128>>(regionInfo.x&7);regionInfo=regionInfo.y*rowSize+(regionInfo.x>>3);var j;switch(combinationOperator){case 0:for(combinationOperator=0;combinationOperator<height;combinationOperator++){var mask=mask0;var offset=regionInfo;for(j=0;j<width;j++)bitmap[combinationOperator][j]&&(pageInfo[offset]|=mask),mask>>=1,mask||(mask=128,offset++);regionInfo+=rowSize}break;case 2:for(combinationOperator=0;combinationOperator<
|
|
933
|
+
height;combinationOperator++){mask=mask0;offset=regionInfo;for(j=0;j<width;j++)bitmap[combinationOperator][j]&&(pageInfo[offset]^=mask),mask>>=1,mask||(mask=128,offset++);regionInfo+=rowSize}break;default:throw new Jbig2Error("operator ".concat(combinationOperator," is not supported"));}},onImmediateGenericRegion:function(region,data,start,end){var regionInfo=region.info;data=new DecodingContext(data,start,end);region=decodeBitmap(region.mmr,regionInfo.width,regionInfo.height,region.template,region.prediction,
|
|
934
|
+
null,region.at,data);this.drawBitmap(regionInfo,region)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(dictionary,currentSegment,referredSegments,data,start,end){if(dictionary.huffman){var customTables=this.customTables,customIndex=0;switch(dictionary.huffmanDHSelector){case 0:case 1:var tableDeltaHeight=getStandardTable(dictionary.huffmanDHSelector+4);break;case 3:tableDeltaHeight=getCustomHuffmanTable(customIndex,referredSegments,
|
|
935
|
+
customTables);customIndex++;break;default:throw new Jbig2Error("invalid Huffman DH selector");}switch(dictionary.huffmanDWSelector){case 0:case 1:var huffmanInput=getStandardTable(dictionary.huffmanDWSelector+2);break;case 3:huffmanInput=getCustomHuffmanTable(customIndex,referredSegments,customTables);customIndex++;break;default:throw new Jbig2Error("invalid Huffman DW selector");}if(dictionary.bitmapSizeSelector){var huffmanTables=getCustomHuffmanTable(customIndex,referredSegments,customTables);
|
|
936
|
+
customIndex++}else huffmanTables=getStandardTable(1);customTables=dictionary.aggregationInstancesSelector?getCustomHuffmanTable(customIndex,referredSegments,customTables):getStandardTable(1);huffmanTables={tableDeltaHeight:tableDeltaHeight,tableDeltaWidth:huffmanInput,tableBitmapSize:huffmanTables,tableAggregateInstances:customTables};huffmanInput=new Reader(data,start,end)}customIndex=this.symbols;customIndex||(this.symbols=customIndex={});customTables=[];tableDeltaHeight=0;for(var ii=referredSegments.length;tableDeltaHeight<
|
|
937
|
+
ii;tableDeltaHeight++){var referredSymbols=customIndex[referredSegments[tableDeltaHeight]];referredSymbols&&(customTables=customTables.concat(referredSymbols))}tableDeltaHeight=new DecodingContext(data,start,end);referredSegments=customIndex;end=dictionary.huffman;customIndex=dictionary.refinement;start=customTables;data=dictionary.numberOfNewSymbols;ii=huffmanTables;referredSymbols=dictionary.template;var at=dictionary.at,refinementTemplateIndex=dictionary.refinementTemplate,refinementAt=dictionary.refinementAt;
|
|
938
|
+
if(end&&customIndex)throw new Jbig2Error("symbol refinement with Huffman is not supported");dictionary=[];var currentHeight=0,symbolCodeLength=(0,_util.log2)(start.length+data);huffmanTables=tableDeltaHeight.decoder;customTables=tableDeltaHeight.contextCache;if(end){var tableB1=getStandardTable(1);var symbolWidths=[];symbolCodeLength=Math.max(symbolCodeLength,1)}for(;dictionary.length<data;){var deltaHeight=end?ii.tableDeltaHeight.decode(huffmanInput):decodeInteger(customTables,"IADH",huffmanTables);
|
|
939
|
+
currentHeight+=deltaHeight;var currentWidth=0,totalWidth=0;for(deltaHeight=end?symbolWidths.length:0;;){var deltaWidth=end?ii.tableDeltaWidth.decode(huffmanInput):decodeInteger(customTables,"IADW",huffmanTables);if(null===deltaWidth)break;currentWidth+=deltaWidth;totalWidth+=currentWidth;if(customIndex){deltaWidth=decodeInteger(customTables,"IAAI",huffmanTables);if(1<deltaWidth)deltaWidth=decodeTextRegion(end,customIndex,currentWidth,currentHeight,0,deltaWidth,1,start.concat(dictionary),symbolCodeLength,
|
|
940
|
+
0,0,1,0,ii,refinementTemplateIndex,refinementAt,tableDeltaHeight,0,huffmanInput);else{deltaWidth=decodeIAID(customTables,huffmanTables,symbolCodeLength);var rdx=decodeInteger(customTables,"IARDX",huffmanTables),rdy=decodeInteger(customTables,"IARDY",huffmanTables);deltaWidth=decodeRefinement(currentWidth,currentHeight,refinementTemplateIndex,deltaWidth<start.length?start[deltaWidth]:dictionary[deltaWidth-start.length],rdx,rdy,!1,refinementAt,tableDeltaHeight)}dictionary.push(deltaWidth)}else end?
|
|
941
|
+
symbolWidths.push(currentWidth):(deltaWidth=decodeBitmap(!1,currentWidth,currentHeight,referredSymbols,!1,null,at,tableDeltaHeight),dictionary.push(deltaWidth))}if(end&&!customIndex){deltaWidth=ii.tableBitmapSize.decode(huffmanInput);huffmanInput.byteAlign();if(0===deltaWidth){currentWidth=huffmanInput;rdy=totalWidth;var height=currentHeight,bitmap=[];for(deltaWidth=0;deltaWidth<height;deltaWidth++){totalWidth=new Uint8Array(rdy);bitmap.push(totalWidth);for(rdx=0;rdx<rdy;rdx++)totalWidth[rdx]=currentWidth.readBit();
|
|
942
|
+
currentWidth.byteAlign()}totalWidth=bitmap}else currentWidth=huffmanInput.end,deltaWidth=huffmanInput.position+deltaWidth,huffmanInput.end=deltaWidth,totalWidth=decodeMMRBitmap(huffmanInput,totalWidth,currentHeight,!1),huffmanInput.end=currentWidth,huffmanInput.position=deltaWidth;currentWidth=symbolWidths.length;if(deltaHeight===currentWidth-1)dictionary.push(totalWidth);else for(deltaWidth=0;deltaHeight<currentWidth;deltaHeight++){rdx=symbolWidths[deltaHeight];rdy=deltaWidth+rdx;height=[];for(rdx=
|
|
943
|
+
0;rdx<currentHeight;rdx++)height.push(totalWidth[rdx].subarray(deltaWidth,rdy));dictionary.push(height);deltaWidth=rdy}}}symbolWidths=[];tableDeltaHeight=[];customIndex=!1;for(ii=start.length+data;tableDeltaHeight.length<ii;){for(referredSymbols=end?tableB1.decode(huffmanInput):decodeInteger(customTables,"IAEX",huffmanTables);referredSymbols--;)tableDeltaHeight.push(customIndex);customIndex=!customIndex}tableB1=0;for(end=start.length;tableB1<end;tableB1++)tableDeltaHeight[tableB1]&&symbolWidths.push(start[tableB1]);
|
|
944
|
+
for(start=0;start<data;tableB1++,start++)tableDeltaHeight[tableB1]&&symbolWidths.push(dictionary[start]);referredSegments[currentSegment]=symbolWidths},onImmediateTextRegion:function(region,referredSegments,data,start,end){for(var regionInfo=region.info,huffmanTables,huffmanInput,symbols=this.symbols,inputSymbols=[],i=0,ii=referredSegments.length;i<ii;i++){var referredSymbols=symbols[referredSegments[i]];referredSymbols&&(inputSymbols=inputSymbols.concat(referredSymbols))}symbols=(0,_util.log2)(inputSymbols.length);
|
|
945
|
+
if(region.huffman){huffmanInput=new Reader(data,start,end);huffmanTables=this.customTables;i=inputSymbols.length;ii=huffmanInput;referredSymbols=[];var i$jscomp$0;for(i$jscomp$0=0;34>=i$jscomp$0;i$jscomp$0++){var codeLength=ii.readBits(4);referredSymbols.push(new HuffmanLine([i$jscomp$0,codeLength,0,0]))}var runCodesTable=new HuffmanTable(referredSymbols,!1);for(i$jscomp$0=referredSymbols.length=0;i$jscomp$0<i;)if(codeLength=runCodesTable.decode(ii),32<=codeLength){var j;switch(codeLength){case 32:if(0===
|
|
946
|
+
i$jscomp$0)throw new Jbig2Error("no previous value in symbol ID table");var numberOfRepeats=ii.readBits(2)+3;codeLength=referredSymbols[i$jscomp$0-1].prefixLength;break;case 33:numberOfRepeats=ii.readBits(3)+3;codeLength=0;break;case 34:numberOfRepeats=ii.readBits(7)+11;codeLength=0;break;default:throw new Jbig2Error("invalid code length in symbol ID table");}for(j=0;j<numberOfRepeats;j++)referredSymbols.push(new HuffmanLine([i$jscomp$0,codeLength,0,0])),i$jscomp$0++}else referredSymbols.push(new HuffmanLine([i$jscomp$0,
|
|
947
|
+
codeLength,0,0])),i$jscomp$0++;ii.byteAlign();i=new HuffmanTable(referredSymbols,!1);i$jscomp$0=0;switch(region.huffmanFS){case 0:case 1:ii=getStandardTable(region.huffmanFS+6);break;case 3:ii=getCustomHuffmanTable(i$jscomp$0,referredSegments,huffmanTables);i$jscomp$0++;break;default:throw new Jbig2Error("invalid Huffman FS selector");}switch(region.huffmanDS){case 0:case 1:case 2:referredSymbols=getStandardTable(region.huffmanDS+8);break;case 3:referredSymbols=getCustomHuffmanTable(i$jscomp$0,referredSegments,
|
|
948
|
+
huffmanTables);i$jscomp$0++;break;default:throw new Jbig2Error("invalid Huffman DS selector");}switch(region.huffmanDT){case 0:case 1:case 2:referredSegments=getStandardTable(region.huffmanDT+11);break;case 3:referredSegments=getCustomHuffmanTable(i$jscomp$0,referredSegments,huffmanTables);break;default:throw new Jbig2Error("invalid Huffman DT selector");}if(region.refinement)throw new Jbig2Error("refinement with Huffman is not supported");huffmanTables={symbolIDTable:i,tableFirstS:ii,tableDeltaS:referredSymbols,
|
|
949
|
+
tableDeltaT:referredSegments}}data=new DecodingContext(data,start,end);region=decodeTextRegion(region.huffman,region.refinement,regionInfo.width,regionInfo.height,region.defaultPixelValue,region.numberOfSymbolInstances,region.stripSize,inputSymbols,symbols,region.transposed,region.dsOffset,region.referenceCorner,region.combinationOperator,huffmanTables,region.refinementTemplate,region.refinementAt,data,region.logStripSize,huffmanInput);this.drawBitmap(regionInfo,region)},onImmediateLosslessTextRegion:function(){this.onImmediateTextRegion.apply(this,
|
|
950
|
+
arguments)},onPatternDictionary:function(dictionary,currentSegment,data,start,end){var patterns=this.patterns;patterns||(this.patterns=patterns={});var decodingContext=new DecodingContext(data,start,end),mmr=dictionary.mmr;data=dictionary.patternWidth;start=dictionary.patternHeight;end=dictionary.maxPatternIndex;dictionary=dictionary.template;var at=[];mmr||(at.push({x:-data,y:0}),0===dictionary&&(at.push({x:-3,y:-1}),at.push({x:2,y:-2}),at.push({x:-2,y:-2})));dictionary=decodeBitmap(mmr,(end+1)*
|
|
951
|
+
data,start,dictionary,!1,null,at,decodingContext);decodingContext=[];mmr=0;for(var xMin,xMax,y;mmr<=end;){at=[];xMin=data*mmr;xMax=xMin+data;for(y=0;y<start;y++)at.push(dictionary[y].subarray(xMin,xMax));decodingContext.push(at);mmr++}patterns[currentSegment]=decodingContext},onImmediateHalftoneRegion:function(region,referredSegments,data,start,end){referredSegments=this.patterns[referredSegments[0]];var regionInfo=region.info,decodingContext=new DecodingContext(data,start,end),mmr=region.mmr,template=
|
|
952
|
+
region.template;data=regionInfo.width;start=regionInfo.height;var defaultPixelValue=region.defaultPixelValue,combinationOperator=region.combinationOperator;end=region.gridWidth;var gridHeight=region.gridHeight,gridOffsetX=region.gridOffsetX,gridOffsetY=region.gridOffsetY,gridVectorX=region.gridVectorX,gridVectorY=region.gridVectorY;if(region.enableSkip)throw new Jbig2Error("skip is not supported");if(0!==combinationOperator)throw new Jbig2Error("operator "+combinationOperator+" is not supported in halftone region");
|
|
953
|
+
region=[];var j;for(combinationOperator=0;combinationOperator<start;combinationOperator++){var row=new Uint8Array(data);if(defaultPixelValue)for(j=0;j<data;j++)row[j]=defaultPixelValue;region.push(row)}combinationOperator=referredSegments[0];defaultPixelValue=combinationOperator[0].length;row=combinationOperator.length;var bitsPerValue=(0,_util.log2)(referredSegments.length);j=[];mmr||(j.push({x:1>=template?3:2,y:-1}),0===template&&(j.push({x:-3,y:-1}),j.push({x:2,y:-2}),j.push({x:-2,y:-2})));var grayScaleBitPlanes=
|
|
954
|
+
[],mmrInput;mmr&&(mmrInput=new Reader(decodingContext.data,decodingContext.start,decodingContext.end));for(combinationOperator=bitsPerValue-1;0<=combinationOperator;combinationOperator--){var bitmap=mmr?decodeMMRBitmap(mmrInput,end,gridHeight,!0):decodeBitmap(!1,end,gridHeight,template,!1,null,j,decodingContext);grayScaleBitPlanes[combinationOperator]=bitmap}for(mmrInput=0;mmrInput<gridHeight;mmrInput++)for(decodingContext=0;decodingContext<end;decodingContext++){mmr=combinationOperator=0;for(j=bitsPerValue-
|
|
955
|
+
1;0<=j;j--)combinationOperator^=grayScaleBitPlanes[j][mmrInput][decodingContext],mmr|=combinationOperator<<j;mmr=referredSegments[mmr];template=gridOffsetX+mmrInput*gridVectorY+decodingContext*gridVectorX>>8;bitmap=gridOffsetY+mmrInput*gridVectorX-decodingContext*gridVectorY>>8;if(0<=template&&template+defaultPixelValue<=data&&0<=bitmap&&bitmap+row<=start)for(combinationOperator=0;combinationOperator<row;combinationOperator++){var regionRow=region[bitmap+combinationOperator];var patternRow=mmr[combinationOperator];
|
|
956
|
+
for(j=0;j<defaultPixelValue;j++)regionRow[template+j]|=patternRow[j]}else for(combinationOperator=0;combinationOperator<row;combinationOperator++)if(j=bitmap+combinationOperator,!(0>j||j>=start))for(regionRow=region[j],patternRow=mmr[combinationOperator],j=0;j<defaultPixelValue;j++){var regionX=template+j;0<=regionX&®ionX<data&&(regionRow[regionX]|=patternRow[j])}}this.drawBitmap(regionInfo,region)},onImmediateLosslessHalftoneRegion:function(){this.onImmediateHalftoneRegion.apply(this,arguments)},
|
|
957
|
+
onTables:function(currentSegment,data,start,end){var customTables=this.customTables;customTables||(this.customTables=customTables={});var JSCompiler_inline_result=data[start];var lowestValue=(0,_util.readUint32)(data,start+1)&4294967295,highestValue=(0,_util.readUint32)(data,start+5)&4294967295;data=new Reader(data,start+9,end);start=(JSCompiler_inline_result>>1&7)+1;end=(JSCompiler_inline_result>>4&7)+1;var lines=[],currentRangeLow=lowestValue;do{var prefixLength=data.readBits(start);var rangeLength=
|
|
958
|
+
data.readBits(end);lines.push(new HuffmanLine([currentRangeLow,prefixLength,rangeLength,0]));currentRangeLow+=1<<rangeLength}while(currentRangeLow<highestValue);prefixLength=data.readBits(start);lines.push(new HuffmanLine([lowestValue-1,prefixLength,32,0,"lower"]));prefixLength=data.readBits(start);lines.push(new HuffmanLine([highestValue,prefixLength,32,0]));JSCompiler_inline_result&1&&(prefixLength=data.readBits(start),lines.push(new HuffmanLine([prefixLength,0])));JSCompiler_inline_result=new HuffmanTable(lines,
|
|
959
|
+
!1);customTables[currentSegment]=JSCompiler_inline_result}};HuffmanTreeNode.prototype={buildTree:function(line,shift){var bit=line.prefixCode>>shift&1;if(0>=shift)this.children[bit]=new HuffmanTreeNode(line);else{var node=this.children[bit];node||(this.children[bit]=node=new HuffmanTreeNode(null));node.buildTree(line,shift-1)}},decodeNode:function(reader){if(this.isLeaf){if(this.isOOB)return null;reader=reader.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-reader:reader)}var node=
|
|
960
|
+
this.children[reader.readBit()];if(!node)throw new Jbig2Error("invalid Huffman data");return node.decodeNode(reader)}};HuffmanTable.prototype={decode:function(reader){return this.rootNode.decodeNode(reader)},assignPrefixCodes:function(lines){var linesLength=lines.length,prefixLengthMax=0,i;for(i=0;i<linesLength;i++)prefixLengthMax=Math.max(prefixLengthMax,lines[i].prefixLength);var histogram=new Uint32Array(prefixLengthMax+1);for(i=0;i<linesLength;i++)histogram[lines[i].prefixLength]++;i=1;var firstCode=
|
|
961
|
+
0,currentTemp;for(histogram[0]=0;i<=prefixLengthMax;){var currentCode=firstCode=firstCode+histogram[i-1]<<1;for(currentTemp=0;currentTemp<linesLength;){var line=lines[currentTemp];line.prefixLength===i&&(line.prefixCode=currentCode,currentCode++);currentTemp++}i++}}};var standardTablesCache={};Reader.prototype={readBit:function(){if(0>this.shift){if(this.position>=this.end)throw new Jbig2Error("end of data while reading bit");this.currentByte=this.data[this.position++];this.shift=7}var bit=this.currentByte>>
|
|
962
|
+
this.shift&1;this.shift--;return bit},readBits:function(numBits){var result=0;for(--numBits;0<=numBits;numBits--)result|=this.readBit()<<numBits;return result},byteAlign:function(){this.shift=-1},next:function(){return this.position>=this.end?-1:this.data[this.position++]}};Jbig2Image.prototype={parseChunks:function(chunks){for(var visitor=new SimpleSegmentVisitor,i=0,ii=chunks.length;i<ii;i++){var chunk=chunks[i];chunk=readSegments({},chunk.data,chunk.start,chunk.end);processSegments(chunk,visitor)}return visitor.buffer},
|
|
963
|
+
parse:function(data){var position=0,end=data.length;if(151!==data[position]||74!==data[position+1]||66!==data[position+2]||50!==data[position+3]||13!==data[position+4]||10!==data[position+5]||26!==data[position+6]||10!==data[position+7])throw new Jbig2Error("parseJbig2 - invalid header.");var header=Object.create(null);position+=8;var flags=data[position++];header.randomAccess=!(flags&1);flags&2||(header.numberOfPages=(0,_util.readUint32)(data,position),position+=4);data=readSegments(header,data,
|
|
964
|
+
position,end);end=new SimpleSegmentVisitor;processSegments(data,end);position=end.currentPageInfo;data=position.width;position=position.height;end=end.buffer;header=new Uint8ClampedArray(data*position);for(var k=flags=0,i=0;i<position;i++)for(var mask=0,buffer=void 0,j=0;j<data;j++)mask||(mask=128,buffer=end[k++]),header[flags++]=buffer&mask?0:255,mask>>=1;this.width=data;this.height=position;return header}};return Jbig2Image}();exports.Jbig2Image=module},function(module,exports,__w_pdfjs_require__){function _defineProperties(target,
|
|
965
|
+
props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.ArithmeticDecoder=
|
|
966
|
+
void 0;var QeTable=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,
|
|
967
|
+
switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,
|
|
968
|
+
nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,
|
|
969
|
+
nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];module=function(){function ArithmeticDecoder(data,start,end){if(!(this instanceof ArithmeticDecoder))throw new TypeError("Cannot call a class as a function");this.data=data;this.bp=
|
|
970
|
+
start;this.dataEnd=end;this.chigh=data[start];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&65535|this.clow>>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}_createClass(ArithmeticDecoder,[{key:"byteIn",value:function(){var data=this.data,bp=this.bp;255===data[bp]?143<data[bp+1]?(this.clow+=65280,this.ct=8):(bp++,this.clow+=data[bp]<<9,this.ct=7,this.bp=bp):(bp++,this.clow+=bp<this.dataEnd?data[bp]<<8:65280,this.ct=8,this.bp=bp);65535<this.clow&&(this.chigh+=this.clow>>16,this.clow&=
|
|
971
|
+
65535)}},{key:"readBit",value:function(contexts,pos){var cx_index=contexts[pos]>>1,cx_mps=contexts[pos]&1;cx_index=QeTable[cx_index];var qeIcx=cx_index.qe,a=this.a-qeIcx;if(this.chigh<qeIcx)a<qeIcx?(a=qeIcx,qeIcx=cx_mps,cx_index=cx_index.nmps):(a=qeIcx,qeIcx=1^cx_mps,1===cx_index.switchFlag&&(cx_mps=qeIcx),cx_index=cx_index.nlps);else{this.chigh-=qeIcx;if(0!==(a&32768))return this.a=a,cx_mps;a<qeIcx?(qeIcx=1^cx_mps,1===cx_index.switchFlag&&(cx_mps=qeIcx),cx_index=cx_index.nlps):(qeIcx=cx_mps,cx_index=
|
|
972
|
+
cx_index.nmps)}do 0===this.ct&&this.byteIn(),a<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while(0===(a&32768));this.a=a;contexts[pos]=cx_index<<1|cx_mps;return qeIcx}}]);return ArithmeticDecoder}();exports.ArithmeticDecoder=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.JpegStream=void 0;var _util=__w_pdfjs_require__(5),_stream=__w_pdfjs_require__(195),_primitives=__w_pdfjs_require__(188),
|
|
973
|
+
_jpg=__w_pdfjs_require__(202);module=function(){function JpegStream(stream,maybeLength,dict,params){for(var ch;-1!==(ch=stream.getByte());)if(255===ch){stream.skip(-1);break}this.stream=stream;this.maybeLength=maybeLength;this.dict=dict;this.params=params;_stream.DecodeStream.call(this,maybeLength)}JpegStream.prototype=Object.create(_stream.DecodeStream.prototype);Object.defineProperty(JpegStream.prototype,"bytes",{get:function(){return(0,_util.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},
|
|
974
|
+
configurable:!0});JpegStream.prototype.ensureBuffer=function(requested){};JpegStream.prototype.readBlock=function(){if(!this.eof){var jpegOptions={decodeTransform:void 0,colorTransform:void 0},decodeArr=this.dict.getArray("Decode","D");if(this.forceRGB&&Array.isArray(decodeArr)){var bitsPerComponent=this.dict.get("BitsPerComponent")||8,decodeArrLength=decodeArr.length,transform=new Int32Array(decodeArrLength),transformNeeded=!1;bitsPerComponent=(1<<bitsPerComponent)-1;for(var i=0;i<decodeArrLength;i+=
|
|
975
|
+
2)if(transform[i]=256*(decodeArr[i+1]-decodeArr[i])|0,transform[i+1]=decodeArr[i]*bitsPerComponent|0,256!==transform[i]||0!==transform[i+1])transformNeeded=!0;transformNeeded&&(jpegOptions.decodeTransform=transform)}(0,_primitives.isDict)(this.params)&&(decodeArr=this.params.get("ColorTransform"),Number.isInteger(decodeArr)&&(jpegOptions.colorTransform=decodeArr));jpegOptions=new _jpg.JpegImage(jpegOptions);jpegOptions.parse(this.bytes);this.buffer=jpegOptions=jpegOptions.getData({width:this.drawWidth,
|
|
976
|
+
height:this.drawHeight,forceRGB:this.forceRGB,isSourcePDF:!0});this.bufferLength=jpegOptions.length;this.eof=!0}};JpegStream.prototype.getIR=function(){return(0,_util.createObjectURL)(this.bytes,"image/jpeg",0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1)};return JpegStream}();exports.JpegStream=module},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:
|
|
977
|
+
function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"===typeof call))return call;if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
978
|
+
return self}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&
|
|
979
|
+
_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}Object.defineProperty(exports,"__esModule",{value:!0});exports.JpegImage=void 0;var _util=__w_pdfjs_require__(5),JpegError=function(_BaseException){function JpegError(msg){_classCallCheck(this,JpegError);return _possibleConstructorReturn(this,_getPrototypeOf(JpegError).call(this,"JPEG error: ".concat(msg)))}
|
|
980
|
+
_inherits(JpegError,_BaseException);return JpegError}(_util.BaseException),DNLMarkerError=function(_BaseException2){function DNLMarkerError(message,scanLines){_classCallCheck(this,DNLMarkerError);message=_possibleConstructorReturn(this,_getPrototypeOf(DNLMarkerError).call(this,message));message.scanLines=scanLines;return message}_inherits(DNLMarkerError,_BaseException2);return DNLMarkerError}(_util.BaseException),EOIMarkerError=function(_BaseException3){function EOIMarkerError(){_classCallCheck(this,
|
|
981
|
+
EOIMarkerError);return _possibleConstructorReturn(this,_getPrototypeOf(EOIMarkerError).apply(this,arguments))}_inherits(EOIMarkerError,_BaseException3);return EOIMarkerError}(_util.BaseException);module=function(){function JpegImage(){var _ref=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},_ref$decodeTransform=_ref.decodeTransform;_ref=_ref.colorTransform;this._decodeTransform=void 0===_ref$decodeTransform?null:_ref$decodeTransform;this._colorTransform=void 0===_ref?-1:_ref}function buildHuffmanTable(codeLengths,
|
|
982
|
+
values){for(var k=0,code=[],i,j,length=16;0<length&&!codeLengths[length-1];)length--;code.push({children:[],index:0});var p=code[0],q;for(i=0;i<length;i++){for(j=0;j<codeLengths[i];j++){p=code.pop();for(p.children[p.index]=values[k];0<p.index;)p=code.pop();p.index++;for(code.push(p);code.length<=i;)code.push(q={children:[],index:0}),p.children[p.index]=q.children,p=q;k++}i+1<length&&(code.push(q={children:[],index:0}),p.children[p.index]=q.children,p=q)}return code[0].children}function decodeScan(data,
|
|
983
|
+
offset$jscomp$0,frame,components,resetInterval,spectralStart,spectralEnd,successivePrev,successive){function readBit(){if(0<bitsCount)return bitsCount--,bitsData>>bitsCount&1;bitsData=data[offset$jscomp$0++];if(255===bitsData){var nextByte=data[offset$jscomp$0++];if(nextByte){if(220===nextByte&&parseDNLMarker){offset$jscomp$0+=2;var scanLines=data[offset$jscomp$0++]<<8|data[offset$jscomp$0++];if(0<scanLines&&scanLines!==frame.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",
|
|
984
|
+
scanLines);}else if(217===nextByte)throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data");throw new JpegError("unexpected marker ".concat((bitsData<<8|nextByte).toString(16)));}}bitsCount=7;return bitsData>>>7}function decodeHuffman(tree){for(;;){tree=tree[readBit()];if("number"===typeof tree)return tree;if("object"!==_typeof(tree))throw new JpegError("invalid huffman sequence");}}function receive(length){for(var n=0;0<length;)n=n<<1|readBit(),length--;return n}function receiveAndExtend(length){if(1===
|
|
985
|
+
length)return 1===readBit()?1:-1;var n=receive(length);return n>=1<<length-1?n:n+(-1<<length)+1}function decodeBaseline(component,offset){var t=decodeHuffman(component.huffmanTableDC);t=0===t?0:receiveAndExtend(t);component.blockData[offset]=component.pred+=t;for(t=1;64>t;){var rs=decodeHuffman(component.huffmanTableAC),s=rs&15;rs>>=4;if(0===s){if(15>rs)break;t+=16}else t+=rs,component.blockData[offset+dctZigZag[t]]=receiveAndExtend(s),t++}}function decodeDCFirst(component,offset){var t=decodeHuffman(component.huffmanTableDC);
|
|
986
|
+
t=0===t?0:receiveAndExtend(t)<<successive;component.blockData[offset]=component.pred+=t}function decodeDCSuccessive(component,offset){component.blockData[offset]|=readBit()<<successive}function decodeACFirst(component,offset){if(0<eobrun)eobrun--;else for(var k=spectralStart;k<=spectralEnd;){var rs=decodeHuffman(component.huffmanTableAC),s=rs&15;rs>>=4;if(0===s){if(15>rs){eobrun=receive(rs)+(1<<rs)-1;break}k+=16}else k+=rs,component.blockData[offset+dctZigZag[k]]=receiveAndExtend(s)*(1<<successive),
|
|
987
|
+
k++}}function decodeACSuccessive(component,offset){for(var k=spectralStart,r=0,s;k<=spectralEnd;){s=offset+dctZigZag[k];var sign=0>component.blockData[s]?-1:1;switch(successiveACState){case 0:r=decodeHuffman(component.huffmanTableAC);s=r&15;r>>=4;if(0===s)15>r?(eobrun=receive(r)+(1<<r),successiveACState=4):(r=16,successiveACState=1);else{if(1!==s)throw new JpegError("invalid ACn encoding");successiveACNextValue=receiveAndExtend(s);successiveACState=r?2:3}continue;case 1:case 2:component.blockData[s]?
|
|
988
|
+
component.blockData[s]+=sign*(readBit()<<successive):(r--,0===r&&(successiveACState=2===successiveACState?3:0));break;case 3:component.blockData[s]?component.blockData[s]+=sign*(readBit()<<successive):(component.blockData[s]=successiveACNextValue<<successive,successiveACState=0);break;case 4:component.blockData[s]&&(component.blockData[s]+=sign*(readBit()<<successive))}k++}4===successiveACState&&(eobrun--,0===eobrun&&(successiveACState=0))}var parseDNLMarker=9<arguments.length&&void 0!==arguments[9]?
|
|
989
|
+
arguments[9]:!1,mcusPerLine=frame.mcusPerLine,startOffset=offset$jscomp$0,bitsData=0,bitsCount=0,eobrun=0,successiveACState=0,successiveACNextValue,componentsLength=components.length,i,j,k$jscomp$0,n$jscomp$0;var decodeFn=frame.progressive?0===spectralStart?0===successivePrev?decodeDCFirst:decodeDCSuccessive:0===successivePrev?decodeACFirst:decodeACSuccessive:decodeBaseline;var mcu=0;var mcuExpected=1===componentsLength?components[0].blocksPerLine*components[0].blocksPerColumn:mcusPerLine*frame.mcusPerColumn;
|
|
990
|
+
for(var h,v;mcu<mcuExpected;){var mcuToRead=resetInterval?Math.min(mcuExpected-mcu,resetInterval):mcuExpected;for(i=0;i<componentsLength;i++)components[i].pred=0;eobrun=0;if(1===componentsLength){var component$jscomp$0=components[0];for(n$jscomp$0=0;n$jscomp$0<mcuToRead;n$jscomp$0++)decodeFn(component$jscomp$0,64*((component$jscomp$0.blocksPerLine+1)*(mcu/component$jscomp$0.blocksPerLine|0)+mcu%component$jscomp$0.blocksPerLine)),mcu++}else for(n$jscomp$0=0;n$jscomp$0<mcuToRead;n$jscomp$0++){for(i=
|
|
991
|
+
0;i<componentsLength;i++)for(component$jscomp$0=components[i],h=component$jscomp$0.h,v=component$jscomp$0.v,j=0;j<v;j++)for(k$jscomp$0=0;k$jscomp$0<h;k$jscomp$0++)decodeFn(component$jscomp$0,64*((component$jscomp$0.blocksPerLine+1)*((mcu/mcusPerLine|0)*component$jscomp$0.v+j)+(mcu%mcusPerLine*component$jscomp$0.h+k$jscomp$0)));mcu++}bitsCount=0;component$jscomp$0=findNextFileMarker(data,offset$jscomp$0);if(component$jscomp$0)component$jscomp$0.invalid&&((0,_util.warn)("decodeScan - unexpected MCU data, current marker is: "+
|
|
992
|
+
component$jscomp$0.invalid),offset$jscomp$0=component$jscomp$0.offset);else break;component$jscomp$0=component$jscomp$0&&component$jscomp$0.marker;if(!component$jscomp$0||65280>=component$jscomp$0)throw new JpegError("decodeScan - a valid marker was not found.");if(65488<=component$jscomp$0&&65495>=component$jscomp$0)offset$jscomp$0+=2;else break}(component$jscomp$0=findNextFileMarker(data,offset$jscomp$0))&&component$jscomp$0.invalid&&((0,_util.warn)("decodeScan - unexpected Scan data, current marker is: "+
|
|
993
|
+
component$jscomp$0.invalid),offset$jscomp$0=component$jscomp$0.offset);return offset$jscomp$0-startOffset}function buildComponentData(frame,component){frame=component.blocksPerLine;for(var blocksPerColumn=component.blocksPerColumn,computationBuffer=new Int16Array(64),blockRow=0;blockRow<blocksPerColumn;blockRow++)for(var blockCol=0;blockCol<frame;blockCol++){var blockBufferOffset=64*((component.blocksPerLine+1)*blockRow+blockCol),p=computationBuffer,qt=component.quantizationTable,blockData=component.blockData;
|
|
994
|
+
if(!qt)throw new JpegError("missing required Quantization Table.");for(var row=0;64>row;row+=8){var t=blockData[blockBufferOffset+row];var p1=blockData[blockBufferOffset+row+1];var p2=blockData[blockBufferOffset+row+2];var p3=blockData[blockBufferOffset+row+3];var p4=blockData[blockBufferOffset+row+4];var p5=blockData[blockBufferOffset+row+5];var p6=blockData[blockBufferOffset+row+6];var p7=blockData[blockBufferOffset+row+7];t*=qt[row];if(0===(p1|p2|p3|p4|p5|p6|p7))t=5793*t+512>>10,p[row]=t,p[row+
|
|
995
|
+
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;else{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];var v0=5793*t+128>>8;var v1=5793*p4+128>>8;var v2=p2;var v3=p6;p4=2896*(p1-p7)+128>>8;p7=2896*(p1+p7)+128>>8;p3<<=4;p5<<=4;v0=v0+v1+1>>1;v1=v0-v1;t=3784*v2+1567*v3+128>>8;v2=1567*v2-3784*v3+128>>8;v3=t;p4=p4+p5+1>>1;p5=p4-p5;p7=p7+p3+1>>1;p3=p7-p3;v0=v0+v3+1>>1;v3=v0-v3;v1=v1+v2+1>>1;v2=v1-v2;t=2276*p4+3406*p7+2048>>12;p4=3406*
|
|
996
|
+
p4-2276*p7+2048>>12;p7=t;t=799*p3+4017*p5+2048>>12;p3=4017*p3-799*p5+2048>>12;p5=t;p[row]=v0+p7;p[row+7]=v0-p7;p[row+1]=v1+p5;p[row+6]=v1-p5;p[row+2]=v2+p3;p[row+5]=v2-p3;p[row+3]=v3+p4;p[row+4]=v3-p4}}for(qt=0;8>qt;++qt)t=p[qt],p1=p[qt+8],p2=p[qt+16],p3=p[qt+24],p4=p[qt+32],p5=p[qt+40],p6=p[qt+48],p7=p[qt+56],0===(p1|p2|p3|p4|p5|p6|p7)?(t=5793*t+8192>>14,t=-2040>t?0:2024<=t?255:t+2056>>4,blockData[blockBufferOffset+qt]=t,blockData[blockBufferOffset+qt+8]=t,blockData[blockBufferOffset+qt+16]=t,blockData[blockBufferOffset+
|
|
997
|
+
qt+24]=t,blockData[blockBufferOffset+qt+32]=t,blockData[blockBufferOffset+qt+40]=t,blockData[blockBufferOffset+qt+48]=t,blockData[blockBufferOffset+qt+56]=t):(v0=5793*t+2048>>12,v1=5793*p4+2048>>12,v2=p2,v3=p6,p4=2896*(p1-p7)+2048>>12,p7=2896*(p1+p7)+2048>>12,v0=(v0+v1+1>>1)+4112,v1=v0-v1,t=3784*v2+1567*v3+2048>>12,v2=1567*v2-3784*v3+2048>>12,v3=t,p4=p4+p5+1>>1,p5=p4-p5,p7=p7+p3+1>>1,p3=p7-p3,v0=v0+v3+1>>1,v3=v0-v3,v1=v1+v2+1>>1,v2=v1-v2,t=2276*p4+3406*p7+2048>>12,p4=3406*p4-2276*p7+2048>>12,p7=t,
|
|
998
|
+
t=799*p3+4017*p5+2048>>12,p3=4017*p3-799*p5+2048>>12,p5=t,t=v0+p7,p7=v0-p7,p1=v1+p5,p6=v1-p5,p2=v2+p3,p5=v2-p3,p3=v3+p4,p4=v3-p4,t=16>t?0:4080<=t?255:t>>4,p1=16>p1?0:4080<=p1?255:p1>>4,p2=16>p2?0:4080<=p2?255:p2>>4,p3=16>p3?0:4080<=p3?255:p3>>4,p4=16>p4?0:4080<=p4?255:p4>>4,p5=16>p5?0:4080<=p5?255:p5>>4,p6=16>p6?0:4080<=p6?255:p6>>4,p7=16>p7?0:4080<=p7?255:p7>>4,blockData[blockBufferOffset+qt]=t,blockData[blockBufferOffset+qt+8]=p1,blockData[blockBufferOffset+qt+16]=p2,blockData[blockBufferOffset+
|
|
999
|
+
qt+24]=p3,blockData[blockBufferOffset+qt+32]=p4,blockData[blockBufferOffset+qt+40]=p5,blockData[blockBufferOffset+qt+48]=p6,blockData[blockBufferOffset+qt+56]=p7)}return component.blockData}function findNextFileMarker(data,currentPos){var startPos=2<arguments.length&&void 0!==arguments[2]?arguments[2]:currentPos,maxPos=data.length-1;startPos=startPos<currentPos?startPos:currentPos;if(currentPos>=maxPos)return null;var currentMarker=data[currentPos]<<8|data[currentPos+1];if(65472<=currentMarker&&65534>=
|
|
1000
|
+
currentMarker)return{invalid:null,marker:currentMarker,offset:currentPos};for(var newMarker=data[startPos]<<8|data[startPos+1];!(65472<=newMarker&&65534>=newMarker);){if(++startPos>=maxPos)return null;newMarker=data[startPos]<<8|data[startPos+1]}return{invalid:currentMarker.toString(16),marker:newMarker,offset:startPos}}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,
|
|
1001
|
+
31,39,46,53,60,61,54,47,55,62,63]);JpegImage.prototype={parse:function(data){function readUint16(){var value=data[offset]<<8|data[offset+1];offset+=2;return value}function readDataBlock(){var length=readUint16();length=offset+length-2;var fileMarker=findNextFileMarker(data,length,offset);fileMarker&&fileMarker.invalid&&((0,_util.warn)("readDataBlock - incorrect length, current marker is: "+fileMarker.invalid),length=fileMarker.offset);length=data.subarray(offset,length);offset+=length.length;return length}
|
|
1002
|
+
function prepareComponents(frame){for(var mcusPerLine=Math.ceil(frame.samplesPerLine/8/frame.maxH),mcusPerColumn=Math.ceil(frame.scanLines/8/frame.maxV),i=0;i<frame.components.length;i++){component=frame.components[i];var blocksPerLine=Math.ceil(Math.ceil(frame.samplesPerLine/8)*component.h/frame.maxH),blocksPerColumn=Math.ceil(Math.ceil(frame.scanLines/8)*component.v/frame.maxV);component.blockData=new Int16Array(64*mcusPerColumn*component.v*(mcusPerLine*component.h+1));component.blocksPerLine=blocksPerLine;
|
|
1003
|
+
component.blocksPerColumn=blocksPerColumn}frame.mcusPerLine=mcusPerLine;frame.mcusPerColumn=mcusPerColumn}var _ref2$dnlScanLines=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).dnlScanLines,dnlScanLines=void 0===_ref2$dnlScanLines?null:_ref2$dnlScanLines,offset=0,jfif=null,adobe=null,numSOSMarkers=0;_ref2$dnlScanLines=[];var huffmanTablesAC=[],huffmanTablesDC=[],fileMarker$jscomp$0=readUint16();if(65496!==fileMarker$jscomp$0)throw new JpegError("SOI not found");fileMarker$jscomp$0=readUint16();
|
|
1004
|
+
a:for(;65497!==fileMarker$jscomp$0;){switch(fileMarker$jscomp$0){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var j=readDataBlock();65504===fileMarker$jscomp$0&&74===j[0]&&70===j[1]&&73===j[2]&&70===j[3]&&0===j[4]&&(jfif={version:{major:j[5],minor:j[6]},densityUnits:j[7],xDensity:j[8]<<8|j[9],yDensity:j[10]<<8|j[11],thumbWidth:j[12],thumbHeight:j[13],thumbData:j.subarray(14,
|
|
1005
|
+
14+3*j[12]*j[13])});65518===fileMarker$jscomp$0&&65===j[0]&&100===j[1]&&111===j[2]&&98===j[3]&&101===j[4]&&(adobe={version:j[5]<<8|j[6],flags0:j[7]<<8|j[8],flags1:j[9]<<8|j[10],transformCode:j[11]});break;case 65499:fileMarker$jscomp$0=readUint16()+offset-2;for(var z;offset<fileMarker$jscomp$0;){var quantizationTableSpec=data[offset++],tableData=new Uint16Array(64);if(0===quantizationTableSpec>>4)for(j=0;64>j;j++)z=dctZigZag[j],tableData[z]=data[offset++];else if(1===quantizationTableSpec>>4)for(j=
|
|
1006
|
+
0;64>j;j++)z=dctZigZag[j],tableData[z]=readUint16();else throw new JpegError("DQT - invalid table spec");_ref2$dnlScanLines[quantizationTableSpec&15]=tableData}break;case 65472:case 65473:case 65474:if(frame$jscomp$0)throw new JpegError("Only single frame JPEGs supported");readUint16();var frame$jscomp$0={};frame$jscomp$0.extended=65473===fileMarker$jscomp$0;frame$jscomp$0.progressive=65474===fileMarker$jscomp$0;frame$jscomp$0.precision=data[offset++];fileMarker$jscomp$0=readUint16();frame$jscomp$0.scanLines=
|
|
1007
|
+
dnlScanLines||fileMarker$jscomp$0;frame$jscomp$0.samplesPerLine=readUint16();frame$jscomp$0.components=[];frame$jscomp$0.componentIds={};j=data[offset++];for(fileMarker$jscomp$0=tableData=quantizationTableSpec=0;fileMarker$jscomp$0<j;fileMarker$jscomp$0++){z=data[offset];var l=data[offset+1]>>4;var v=data[offset+1]&15;quantizationTableSpec<l&&(quantizationTableSpec=l);tableData<v&&(tableData=v);l=frame$jscomp$0.components.push({h:l,v:v,quantizationId:data[offset+2],quantizationTable:null});frame$jscomp$0.componentIds[z]=
|
|
1008
|
+
l-1;offset+=3}frame$jscomp$0.maxH=quantizationTableSpec;frame$jscomp$0.maxV=tableData;prepareComponents(frame$jscomp$0);break;case 65476:z=readUint16();for(fileMarker$jscomp$0=2;fileMarker$jscomp$0<z;){quantizationTableSpec=data[offset++];tableData=new Uint8Array(16);for(j=l=0;16>j;j++,offset++)l+=tableData[j]=data[offset];v=new Uint8Array(l);for(j=0;j<l;j++,offset++)v[j]=data[offset];fileMarker$jscomp$0+=17+l;(0===quantizationTableSpec>>4?huffmanTablesDC:huffmanTablesAC)[quantizationTableSpec&15]=
|
|
1009
|
+
buildHuffmanTable(tableData,v)}break;case 65501:readUint16();var resetInterval=readUint16();break;case 65498:j=1===++numSOSMarkers&&!dnlScanLines;readUint16();quantizationTableSpec=data[offset++];z=[];for(fileMarker$jscomp$0=0;fileMarker$jscomp$0<quantizationTableSpec;fileMarker$jscomp$0++){tableData=frame$jscomp$0.componentIds[data[offset++]];var component=frame$jscomp$0.components[tableData];tableData=data[offset++];component.huffmanTableDC=huffmanTablesDC[tableData>>4];component.huffmanTableAC=
|
|
1010
|
+
huffmanTablesAC[tableData&15];z.push(component)}fileMarker$jscomp$0=data[offset++];quantizationTableSpec=data[offset++];tableData=data[offset++];try{var processed=decodeScan(data,offset,frame$jscomp$0,z,resetInterval,fileMarker$jscomp$0,quantizationTableSpec,tableData>>4,tableData&15,j);offset+=processed}catch(ex){if(ex instanceof DNLMarkerError)return(0,_util.warn)("".concat(ex.message," -- attempting to re-parse the JPEG image.")),this.parse(data,{dnlScanLines:ex.scanLines});if(ex instanceof EOIMarkerError){(0,_util.warn)("".concat(ex.message,
|
|
1011
|
+
" -- ignoring the rest of the image data."));break a}throw ex;}break;case 65500:offset+=4;break;case 65535:255!==data[offset]&&offset--;break;default:if(255===data[offset-3]&&192<=data[offset-2]&&254>=data[offset-2])offset-=3;else if((j=findNextFileMarker(data,offset-2))&&j.invalid)(0,_util.warn)("JpegImage.parse - unexpected data, current marker is: "+j.invalid),offset=j.offset;else{if(offset>data.length-2){(0,_util.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");
|
|
1012
|
+
break a}throw new JpegError("JpegImage.parse - unknown marker: "+fileMarker$jscomp$0.toString(16));}}fileMarker$jscomp$0=readUint16()}this.width=frame$jscomp$0.samplesPerLine;this.height=frame$jscomp$0.scanLines;this.jfif=jfif;this.adobe=adobe;this.components=[];for(fileMarker$jscomp$0=0;fileMarker$jscomp$0<frame$jscomp$0.components.length;fileMarker$jscomp$0++){component=frame$jscomp$0.components[fileMarker$jscomp$0];if(resetInterval=_ref2$dnlScanLines[component.quantizationId])component.quantizationTable=
|
|
1013
|
+
resetInterval;this.components.push({output:buildComponentData(frame$jscomp$0,component),scaleX:component.h/frame$jscomp$0.maxH,scaleY:component.v/frame$jscomp$0.maxV,blocksPerLine:component.blocksPerLine,blocksPerColumn:component.blocksPerColumn})}this.numComponents=this.components.length},_getLinearizedBlockData:function(width,height){var isSourcePDF=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!1,scaleX=this.width/width,scaleY=this.height/height,x,i,numComponents=this.components.length,
|
|
1014
|
+
dataLength=width*height*numComponents,data=new Uint8ClampedArray(dataLength),xScaleBlockOffset=new Uint32Array(width);for(i=0;i<numComponents;i++){var component=this.components[i];var componentScaleX=component.scaleX*scaleX;var componentScaleY=component.scaleY*scaleY;var offset=i;var output=component.output;var blocksPerScanline=component.blocksPerLine+1<<3;for(x=0;x<width;x++)component=0|x*componentScaleX,xScaleBlockOffset[x]=(component&4294967288)<<3|component&7;for(componentScaleX=0;componentScaleX<
|
|
1015
|
+
height;componentScaleX++)for(component=0|componentScaleX*componentScaleY,component=blocksPerScanline*(component&4294967288)|(component&7)<<3,x=0;x<width;x++)data[offset]=output[component+xScaleBlockOffset[x]],offset+=numComponents}scaleX=this._decodeTransform;isSourcePDF||4!==numComponents||scaleX||(scaleX=new Int32Array([-256,255,-256,255,-256,255,-256,255]));if(scaleX)for(i=0;i<dataLength;)for(isSourcePDF=component=0;component<numComponents;component++,i++,isSourcePDF+=2)data[i]=(data[i]*scaleX[isSourcePDF]>>
|
|
1016
|
+
8)+scaleX[isSourcePDF+1];return data},get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0===this._colorTransform?!1:!0:1===this._colorTransform?!0:!1},_convertYccToRgb:function(data){for(var Y,Cb,Cr,i=0,length=data.length;i<length;i+=3)Y=data[i],Cb=data[i+1],Cr=data[i+2],data[i]=Y-179.456+1.402*Cr,data[i+1]=Y+135.459-.344*Cb-.714*Cr,data[i+2]=Y-226.816+1.772*Cb;return data},_convertYcckToRgb:function(data){for(var Y,Cb,Cr,k,offset=0,i=0,length=data.length;i<
|
|
1017
|
+
length;i+=4)Y=data[i],Cb=data[i+1],Cr=data[i+2],k=data[i+3],data[offset++]=-122.67195406894+Cb*(-6.60635669420364E-5*Cb+4.37130475926232E-4*Cr-5.4080610064599E-5*Y+4.8449797120281E-4*k-.154362151871126)+Cr*(-9.57964378445773E-4*Cr+8.17076911346625E-4*Y-.00477271405408747*k+1.53380253221734)+Y*(9.61250184130688E-4*Y-.00266257332283933*k+.48357088451265)+k*(-3.36197177618394E-4*k+.484791561490776),data[offset++]=107.268039397724+Cb*(2.19927104525741E-5*Cb-6.40992018297945E-4*Cr+6.59397001245577E-4*
|
|
1018
|
+
Y+4.26105652938837E-4*k-.176491792462875)+Cr*(-7.78269941513683E-4*Cr+.00130872261408275*Y+7.70482631801132E-4*k-.151051492775562)+Y*(.00126935368114843*Y-.00265090189010898*k+.25802910206845)+k*(-3.18913117588328E-4*k-.213742400323665),data[offset++]=-20.810012546947+Cb*(-5.70115196973677E-4*Cb-2.63409051004589E-5*Cr+.0020741088115012*Y-.00288260236853442*k+.814272968359295)+Cr*(-1.53496057440975E-5*Cr-1.32689043961446E-4*Y+5.60833691242812E-4*k-.195152027534049)+Y*(.00174418132927582*Y-.00255243321439347*
|
|
1019
|
+
k+.116935020465145)+k*(-3.43531996510555E-4*k+.24165260232407);return data.subarray(0,offset)},_convertYcckToCmyk:function(data){for(var Y,Cb,Cr,i=0,length=data.length;i<length;i+=4)Y=data[i],Cb=data[i+1],Cr=data[i+2],data[i]=434.456-Y-1.402*Cr,data[i+1]=119.541-Y+.344*Cb+.714*Cr,data[i+2]=481.816-Y-1.772*Cb;return data},_convertCmykToRgb:function(data){for(var c,m,y,k,offset=0,scale=1/255,i=0,length=data.length;i<length;i+=4)c=data[i]*scale,m=data[i+1]*scale,y=data[i+2]*scale,k=data[i+3]*scale,data[offset++]=
|
|
1020
|
+
255+c*(-4.387332384609988*c+54.48615194189176*m+18.82290502165302*y+212.25662451639585*k-285.2331026137004)+m*(1.7149763477362134*m-5.6096736904047315*y-17.873870861415444*k-5.497006427196366)+y*(-2.5217340131683033*y-21.248923337353073*k+17.5119270841813)-k*(21.86122147463605*k+189.48180835922747),data[offset++]=255+c*(8.841041422036149*c+60.118027045597366*m+6.871425592049007*y+31.159100130055922*k-79.2970844816548)+m*(-15.310361306967817*m+17.575251261109482*y+131.35250912493976*k-190.9453302588951)+
|
|
1021
|
+
y*(4.444339102852739*y+9.8632861493405*k-24.86741582555878)-k*(20.737325471181034*k+187.80453709719578),data[offset++]=255+c*(.8842522430003296*c+8.078677503112928*m+30.89978309703729*y-.23883238689178934*k-14.183576799673286)+m*(10.49593273432072*m+63.02378494754052*y+50.606957656360734*k-112.23884253719248)+y*(.03296041114873217*y+115.60384449646641*k-193.58209356861505)-k*(22.33816807309886*k+180.12613974708367);return data.subarray(0,offset)},getData:function(_ref3){var width=_ref3.width,height=
|
|
1022
|
+
_ref3.height,_ref3$forceRGB=_ref3.forceRGB;_ref3$forceRGB=void 0===_ref3$forceRGB?!1:_ref3$forceRGB;_ref3=_ref3.isSourcePDF;_ref3=void 0===_ref3?!1:_ref3;if(4<this.numComponents)throw new JpegError("Unsupported color mode");width=this._getLinearizedBlockData(width,height,_ref3);if(1===this.numComponents&&_ref3$forceRGB){height=width.length;_ref3$forceRGB=new Uint8ClampedArray(3*height);for(var i=_ref3=0;i<height;i++){var grayColor=width[i];_ref3$forceRGB[_ref3++]=grayColor;_ref3$forceRGB[_ref3++]=
|
|
1023
|
+
grayColor;_ref3$forceRGB[_ref3++]=grayColor}return _ref3$forceRGB}if(3===this.numComponents&&this._isColorConversionNeeded)return this._convertYccToRgb(width);if(4===this.numComponents){if(this._isColorConversionNeeded)return _ref3$forceRGB?this._convertYcckToRgb(width):this._convertYcckToCmyk(width);if(_ref3$forceRGB)return this._convertCmykToRgb(width)}return width}};return JpegImage}();exports.JpegImage=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",
|
|
1024
|
+
{value:!0});exports.JpxStream=void 0;var _stream=__w_pdfjs_require__(195),_jpx=__w_pdfjs_require__(204),_util=__w_pdfjs_require__(5);module=function(){function JpxStream(stream,maybeLength,dict,params){this.stream=stream;this.maybeLength=maybeLength;this.dict=dict;this.params=params;_stream.DecodeStream.call(this,maybeLength)}JpxStream.prototype=Object.create(_stream.DecodeStream.prototype);Object.defineProperty(JpxStream.prototype,"bytes",{get:function(){return(0,_util.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},
|
|
1025
|
+
configurable:!0});JpxStream.prototype.ensureBuffer=function(requested){};JpxStream.prototype.readBlock=function(){if(!this.eof){var jpxImage=new _jpx.JpxImage;jpxImage.parse(this.bytes);var width=jpxImage.width,height=jpxImage.height,componentsCount=jpxImage.componentsCount,tileCount=jpxImage.tiles.length;if(1===tileCount)this.buffer=jpxImage.tiles[0].items;else{height=new Uint8ClampedArray(width*height*componentsCount);for(var k=0;k<tileCount;k++){var tileComponents=jpxImage.tiles[k],tileHeight=
|
|
1026
|
+
tileComponents.height,src=tileComponents.items,srcPosition=0,dataPosition=(width*tileComponents.top+tileComponents.left)*componentsCount,imgRowSize=width*componentsCount;tileComponents=tileComponents.width*componentsCount;for(var j=0;j<tileHeight;j++){var rowBytes=src.subarray(srcPosition,srcPosition+tileComponents);height.set(rowBytes,dataPosition);srcPosition+=tileComponents;dataPosition+=imgRowSize}}this.buffer=height}this.bufferLength=this.buffer.length;this.eof=!0}};return JpxStream}();exports.JpxStream=
|
|
1027
|
+
module},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};
|
|
1028
|
+
return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};
|
|
1029
|
+
return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}Object.defineProperty(exports,"__esModule",{value:!0});exports.JpxImage=void 0;var _util=__w_pdfjs_require__(5),_arithmetic_decoder=__w_pdfjs_require__(200),JpxError=function(_BaseException){function JpxError(msg){if(!(this instanceof JpxError))throw new TypeError("Cannot call a class as a function");msg=_getPrototypeOf(JpxError).call(this,"JPX error: ".concat(msg));if(!msg||"object"!==_typeof(msg)&&"function"!==typeof msg){if(void 0===this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1030
|
+
msg=this}return msg}_inherits(JpxError,_BaseException);return JpxError}(_util.BaseException);module=function(){function JpxImage(){this.failOnCorruptedImage=!1}function buildCodeblocks(context,subband,dimensions){context=dimensions.xcb_;dimensions=dimensions.ycb_;var codeblockWidth=1<<context,codeblockHeight=1<<dimensions,cbx0=subband.tbx0>>context,cby0=subband.tby0>>dimensions,cbx1=subband.tbx1+codeblockWidth-1>>context,cby1=subband.tby1+codeblockHeight-1>>dimensions,precinctParameters=subband.resolution.precinctParameters,
|
|
1031
|
+
codeblocks=[],precincts=[],i,j;for(j=cby0;j<cby1;j++)for(i=cbx0;i<cbx1;i++){var codeblock={cbx:i,cby:j,tbx0:codeblockWidth*i,tby0:codeblockHeight*j,tbx1:codeblockWidth*(i+1),tby1:codeblockHeight*(j+1)};codeblock.tbx0_=Math.max(subband.tbx0,codeblock.tbx0);codeblock.tby0_=Math.max(subband.tby0,codeblock.tby0);codeblock.tbx1_=Math.min(subband.tbx1,codeblock.tbx1);codeblock.tby1_=Math.min(subband.tby1,codeblock.tby1);var precinctNumber=Math.floor((codeblock.tbx0_-subband.tbx0)/precinctParameters.precinctWidthInSubband)+
|
|
1032
|
+
Math.floor((codeblock.tby0_-subband.tby0)/precinctParameters.precinctHeightInSubband)*precinctParameters.numprecinctswide;codeblock.precinctNumber=precinctNumber;codeblock.subbandType=subband.type;codeblock.Lblock=3;if(!(codeblock.tbx1_<=codeblock.tbx0_||codeblock.tby1_<=codeblock.tby0_)){codeblocks.push(codeblock);var precinct=precincts[precinctNumber];void 0!==precinct?(i<precinct.cbxMin?precinct.cbxMin=i:i>precinct.cbxMax&&(precinct.cbxMax=i),j<precinct.cbyMin?precinct.cbxMin=j:j>precinct.cbyMax&&
|
|
1033
|
+
(precinct.cbyMax=j)):precincts[precinctNumber]=precinct={cbxMin:i,cbyMin:j,cbxMax:i,cbyMax:j};codeblock.precinct=precinct}}subband.codeblockParameters={codeblockWidth:context,codeblockHeight:dimensions,numcodeblockwide:cbx1-cbx0+1,numcodeblockhigh:cby1-cby0+1};subband.codeblocks=codeblocks;subband.precincts=precincts}function createPacket(resolution,precinctNumber,layerNumber){var precinctCodeblocks=[];resolution=resolution.subbands;for(var i=0,ii=resolution.length;i<ii;i++)for(var codeblocks=resolution[i].codeblocks,
|
|
1034
|
+
j=0,jj=codeblocks.length;j<jj;j++){var codeblock=codeblocks[j];codeblock.precinctNumber===precinctNumber&&precinctCodeblocks.push(codeblock)}return{layerNumber:layerNumber,codeblocks:precinctCodeblocks}}function LayerResolutionComponentPositionIterator(context){var tile=context.tiles[context.currentTile.index],layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,maxDecompositionLevelsCount=0;for(context=0;context<componentsCount;context++)maxDecompositionLevelsCount=
|
|
1035
|
+
Math.max(maxDecompositionLevelsCount,tile.components[context].codingStyleParameters.decompositionLevelsCount);var l=0,r=0,i=0,k=0;this.nextPacket=function(){for(;l<layersCount;l++){for(;r<=maxDecompositionLevelsCount;r++){for(;i<componentsCount;i++){var component=tile.components[i];if(!(r>component.codingStyleParameters.decompositionLevelsCount)){component=component.resolutions[r];for(var numprecincts=component.precinctParameters.numprecincts;k<numprecincts;)return component=createPacket(component,
|
|
1036
|
+
k,l),k++,component;k=0}}i=0}r=0}throw new JpxError("Out of packets");}}function ResolutionLayerComponentPositionIterator(context){var tile=context.tiles[context.currentTile.index],layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,maxDecompositionLevelsCount=0;for(context=0;context<componentsCount;context++)maxDecompositionLevelsCount=Math.max(maxDecompositionLevelsCount,tile.components[context].codingStyleParameters.decompositionLevelsCount);var r=0,l=0,i=
|
|
1037
|
+
0,k=0;this.nextPacket=function(){for(;r<=maxDecompositionLevelsCount;r++){for(;l<layersCount;l++){for(;i<componentsCount;i++){var component=tile.components[i];if(!(r>component.codingStyleParameters.decompositionLevelsCount)){component=component.resolutions[r];for(var numprecincts=component.precinctParameters.numprecincts;k<numprecincts;)return component=createPacket(component,k,l),k++,component;k=0}}i=0}l=0}throw new JpxError("Out of packets");}}function ResolutionPositionComponentLayerIterator(context){var tile=
|
|
1038
|
+
context.tiles[context.currentTile.index],layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,l,r,c,maxDecompositionLevelsCount=0;for(c=0;c<componentsCount;c++)maxDecompositionLevelsCount=Math.max(maxDecompositionLevelsCount,tile.components[c].codingStyleParameters.decompositionLevelsCount);var maxNumPrecinctsInLevel=new Int32Array(maxDecompositionLevelsCount+1);for(r=0;r<=maxDecompositionLevelsCount;++r){for(c=context=0;c<componentsCount;++c){var resolutions=
|
|
1039
|
+
tile.components[c].resolutions;r<resolutions.length&&(context=Math.max(context,resolutions[r].precinctParameters.numprecincts))}maxNumPrecinctsInLevel[r]=context}var p=c=r=l=0;this.nextPacket=function(){for(;r<=maxDecompositionLevelsCount;r++){for(;p<maxNumPrecinctsInLevel[r];p++){for(;c<componentsCount;c++){var component=tile.components[c];if(!(r>component.codingStyleParameters.decompositionLevelsCount||(component=component.resolutions[r],p>=component.precinctParameters.numprecincts))){for(;l<layersCount;)return component=
|
|
1040
|
+
createPacket(component,p,l),l++,component;l=0}}c=0}p=0}throw new JpxError("Out of packets");}}function PositionComponentResolutionLayerIterator(context){var tile=context.tiles[context.currentTile.index],layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,precinctsSizes=getPrecinctSizesInImageScale(tile),l=0,r=0,c=0,px=0,py=0;this.nextPacket=function(){for(;py<precinctsSizes.maxNumHigh;py++){for(;px<precinctsSizes.maxNumWide;px++){for(;c<componentsCount;c++){for(var component=
|
|
1041
|
+
tile.components[c],decompositionLevelsCount=component.codingStyleParameters.decompositionLevelsCount;r<=decompositionLevelsCount;r++){var resolution=component.resolutions[r],k=getPrecinctIndexIfExist(px,py,precinctsSizes.components[c].resolutions[r],precinctsSizes,resolution);if(null!==k){for(;l<layersCount;)return component=createPacket(resolution,k,l),l++,component;l=0}}r=0}c=0}px=0}throw new JpxError("Out of packets");}}function ComponentPositionResolutionLayerIterator(context){var tile=context.tiles[context.currentTile.index],
|
|
1042
|
+
layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,precinctsSizes=getPrecinctSizesInImageScale(tile),l=0,r=0,c=0,px=0,py=0;this.nextPacket=function(){for(;c<componentsCount;++c){for(var component=tile.components[c],precinctsIterationSizes=precinctsSizes.components[c],decompositionLevelsCount=component.codingStyleParameters.decompositionLevelsCount;py<precinctsIterationSizes.maxNumHigh;py++){for(;px<precinctsIterationSizes.maxNumWide;px++){for(;r<=decompositionLevelsCount;r++){var resolution=
|
|
1043
|
+
component.resolutions[r],k=getPrecinctIndexIfExist(px,py,precinctsIterationSizes.resolutions[r],precinctsIterationSizes,resolution);if(null!==k){for(;l<layersCount;)return component=createPacket(resolution,k,l),l++,component;l=0}}r=0}px=0}py=0}throw new JpxError("Out of packets");}}function getPrecinctIndexIfExist(pxIndex,pyIndex,sizeInImageScale,precinctIterationSizes,resolution){pxIndex*=precinctIterationSizes.minWidth;pyIndex*=precinctIterationSizes.minHeight;return 0!==pxIndex%sizeInImageScale.width||
|
|
1044
|
+
0!==pyIndex%sizeInImageScale.height?null:pxIndex/sizeInImageScale.height+pyIndex/sizeInImageScale.width*resolution.precinctParameters.numprecinctswide}function getPrecinctSizesInImageScale(tile){for(var componentsCount=tile.components.length,minWidth=Number.MAX_VALUE,minHeight=Number.MAX_VALUE,maxNumWide=0,maxNumHigh=0,sizePerComponent=Array(componentsCount),c=0;c<componentsCount;c++){for(var component=tile.components[c],decompositionLevelsCount=component.codingStyleParameters.decompositionLevelsCount,
|
|
1045
|
+
sizePerResolution=Array(decompositionLevelsCount+1),minWidthCurrentComponent=Number.MAX_VALUE,minHeightCurrentComponent=Number.MAX_VALUE,maxNumWideCurrentComponent=0,maxNumHighCurrentComponent=0,scale=1;0<=decompositionLevelsCount;--decompositionLevelsCount){var resolution=component.resolutions[decompositionLevelsCount],widthCurrentResolution=scale*resolution.precinctParameters.precinctWidth,heightCurrentResolution=scale*resolution.precinctParameters.precinctHeight;minWidthCurrentComponent=Math.min(minWidthCurrentComponent,
|
|
1046
|
+
widthCurrentResolution);minHeightCurrentComponent=Math.min(minHeightCurrentComponent,heightCurrentResolution);maxNumWideCurrentComponent=Math.max(maxNumWideCurrentComponent,resolution.precinctParameters.numprecinctswide);maxNumHighCurrentComponent=Math.max(maxNumHighCurrentComponent,resolution.precinctParameters.numprecinctshigh);sizePerResolution[decompositionLevelsCount]={width:widthCurrentResolution,height:heightCurrentResolution};scale<<=1}minWidth=Math.min(minWidth,minWidthCurrentComponent);
|
|
1047
|
+
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 parseTilePackets(context,
|
|
1048
|
+
data,offset,dataLength){function readBits(count){for(;bufferSize<count;){var b=data[offset+position];position++;skipNextBit?(buffer=buffer<<7|b,bufferSize+=7,skipNextBit=!1):(buffer=buffer<<8|b,bufferSize+=8);255===b&&(skipNextBit=!0)}bufferSize-=count;return buffer>>>bufferSize&(1<<count)-1}function skipMarkerIfEqual(value){return 255===data[offset+position-1]&&data[offset+position]===value?(position+=1,!0):255===data[offset+position]&&data[offset+position+1]===value?(position+=2,!0):!1}function readCodingpasses(){if(0===
|
|
1049
|
+
readBits(1))return 1;if(0===readBits(1))return 2;var value=readBits(2);if(3>value)return value+3;value=readBits(5);if(31>value)return value+6;value=readBits(7);return value+37}var position=0,buffer,bufferSize=0,skipNextBit=!1,sopMarkerUsed=context.COD.sopMarkerUsed,ephMarkerUsed=context.COD.ephMarkerUsed;for(context=context.tiles[context.currentTile.index].packetsIterator;position<dataLength;){bufferSize=0;skipNextBit&&(position++,skipNextBit=!1);sopMarkerUsed&&skipMarkerIfEqual(145)&&(position+=
|
|
1050
|
+
4);var packet=context.nextPacket();if(readBits(1)){for(var layerNumber=packet.layerNumber,queue=[],codeblock,i=0,ii=packet.codeblocks.length;i<ii;i++){codeblock=packet.codeblocks[i];var precinct=codeblock.precinct,codeblockColumn=codeblock.cbx-precinct.cbxMin,codeblockRow=codeblock.cby-precinct.cbyMin,codeblockIncluded=!1,firstTimeInclusion=!1;if(void 0!==codeblock.included)codeblockIncluded=!!readBits(1);else{precinct=codeblock.precinct;if(void 0!==precinct.inclusionTree)var inclusionTree=precinct.inclusionTree;
|
|
1051
|
+
else{var valueReady=precinct.cbxMax-precinct.cbxMin+1;var zeroBitPlanesTree=precinct.cbyMax-precinct.cbyMin+1;inclusionTree=new InclusionTree(valueReady,zeroBitPlanesTree,layerNumber);zeroBitPlanesTree=new TagTree(valueReady,zeroBitPlanesTree);precinct.inclusionTree=inclusionTree;precinct.zeroBitPlanesTree=zeroBitPlanesTree}if(inclusionTree.reset(codeblockColumn,codeblockRow,layerNumber))for(;;)if(readBits(1)){if(valueReady=!inclusionTree.nextLevel()){codeblockIncluded=firstTimeInclusion=codeblock.included=
|
|
1052
|
+
!0;break}}else{inclusionTree.incrementValue(layerNumber);break}}if(codeblockIncluded){if(firstTimeInclusion){zeroBitPlanesTree=precinct.zeroBitPlanesTree;for(zeroBitPlanesTree.reset(codeblockColumn,codeblockRow);;)if(readBits(1)){if(valueReady=!zeroBitPlanesTree.nextLevel())break}else zeroBitPlanesTree.incrementValue();codeblock.zeroBitPlanes=zeroBitPlanesTree.value}for(precinct=readCodingpasses();readBits(1);)codeblock.Lblock++;codeblockColumn=(0,_util.log2)(precinct);codeblockColumn=readBits((precinct<
|
|
1053
|
+
1<<codeblockColumn?codeblockColumn-1:codeblockColumn)+codeblock.Lblock);queue.push({codeblock:codeblock,codingpasses:precinct,dataLength:codeblockColumn})}}bufferSize=0;skipNextBit&&(position++,skipNextBit=!1);for(ephMarkerUsed&&skipMarkerIfEqual(146);0<queue.length;)packet=queue.shift(),codeblock=packet.codeblock,void 0===codeblock.data&&(codeblock.data=[]),codeblock.data.push({data:data,start:offset+position,end:offset+position+packet.dataLength,codingpasses:packet.codingpasses}),position+=packet.dataLength}}return position}
|
|
1054
|
+
var SubbandsGainLog2={LL:0,LH:1,HL:1,HH:2};JpxImage.prototype={parse:function(data){if(65359===(0,_util.readUint16)(data,0))this.parseCodestream(data,0,data.length);else for(var position=0,length=data.length;position<length;){var headerSize=8,lbox=(0,_util.readUint32)(data,position),tbox=(0,_util.readUint32)(data,position+4);position+=headerSize;1===lbox&&(lbox=4294967296*(0,_util.readUint32)(data,position)+(0,_util.readUint32)(data,position+4),position+=8,headerSize+=8);0===lbox&&(lbox=length-position+
|
|
1055
|
+
headerSize);if(lbox<headerSize)throw new JpxError("Invalid box field size");headerSize=lbox-headerSize;lbox=!0;switch(tbox){case 1785737832:lbox=!1;break;case 1668246642:tbox=data[position];if(1===tbox)switch(tbox=(0,_util.readUint32)(data,position+3),tbox){case 16:case 17:case 18:break;default:(0,_util.warn)("Unknown colorspace "+tbox)}else 2===tbox&&(0,_util.info)("ICC profile not supported");break;case 1785737827:this.parseCodestream(data,position,position+headerSize);break;case 1783636E3:218793738!==
|
|
1056
|
+
(0,_util.readUint32)(data,position)&&(0,_util.warn)("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var headerType=String.fromCharCode(tbox>>24&255,tbox>>16&255,tbox>>8&255,tbox&255);(0,_util.warn)("Unsupported header type "+tbox+" ("+headerType+")")}lbox&&(position+=headerSize)}},parseImageProperties:function(stream){for(var newByte=stream.getByte();0<=newByte;){var oldByte=newByte;newByte=stream.getByte();if(65361===(oldByte<<
|
|
1057
|
+
8|newByte)){stream.skip(4);newByte=stream.getInt32()>>>0;oldByte=stream.getInt32()>>>0;var XOsiz=stream.getInt32()>>>0,YOsiz=stream.getInt32()>>>0;stream.skip(16);stream=stream.getUint16();this.width=newByte-XOsiz;this.height=oldByte-YOsiz;this.componentsCount=stream;this.bitsPerComponent=8;return}}throw new JpxError("No size marker found in JPX stream");},parseCodestream:function(data$jscomp$0,start,end){var context={},doNotRecover=!1;try{for(var position=start;position+1<end;){var code=(0,_util.readUint16)(data$jscomp$0,
|
|
1058
|
+
position);position+=2;var length=0,spqcds;switch(code){case 65359:context.mainHeader=!0;break;case 65497:break;case 65361:length=(0,_util.readUint16)(data$jscomp$0,position);var siz={};siz.Xsiz=(0,_util.readUint32)(data$jscomp$0,position+4);siz.Ysiz=(0,_util.readUint32)(data$jscomp$0,position+8);siz.XOsiz=(0,_util.readUint32)(data$jscomp$0,position+12);siz.YOsiz=(0,_util.readUint32)(data$jscomp$0,position+16);siz.XTsiz=(0,_util.readUint32)(data$jscomp$0,position+20);siz.YTsiz=(0,_util.readUint32)(data$jscomp$0,
|
|
1059
|
+
position+24);siz.XTOsiz=(0,_util.readUint32)(data$jscomp$0,position+28);siz.YTOsiz=(0,_util.readUint32)(data$jscomp$0,position+32);var componentsCount=(0,_util.readUint16)(data$jscomp$0,position+36);siz.Csiz=componentsCount;var components=[];var j=position+38;for(var i=0;i<componentsCount;i++){var component={precision:(data$jscomp$0[j]&127)+1,isSigned:!!(data$jscomp$0[j]&128),XRsiz:data$jscomp$0[j+1],YRsiz:data$jscomp$0[j+2]};j+=3;var component$jscomp$0=component,siz$jscomp$0=siz;component$jscomp$0.x0=
|
|
1060
|
+
Math.ceil(siz$jscomp$0.XOsiz/component$jscomp$0.XRsiz);component$jscomp$0.x1=Math.ceil(siz$jscomp$0.Xsiz/component$jscomp$0.XRsiz);component$jscomp$0.y0=Math.ceil(siz$jscomp$0.YOsiz/component$jscomp$0.YRsiz);component$jscomp$0.y1=Math.ceil(siz$jscomp$0.Ysiz/component$jscomp$0.YRsiz);component$jscomp$0.width=component$jscomp$0.x1-component$jscomp$0.x0;component$jscomp$0.height=component$jscomp$0.y1-component$jscomp$0.y0;components.push(component)}context.SIZ=siz;context.components=components;for(var tile$jscomp$0=
|
|
1061
|
+
void 0,context$jscomp$0=context,components$jscomp$0=components,siz$jscomp$1=context$jscomp$0.SIZ,tiles=[],numXtiles=Math.ceil((siz$jscomp$1.Xsiz-siz$jscomp$1.XTOsiz)/siz$jscomp$1.XTsiz),numYtiles=Math.ceil((siz$jscomp$1.Ysiz-siz$jscomp$1.YTOsiz)/siz$jscomp$1.YTsiz),q=0;q<numYtiles;q++)for(var p=0;p<numXtiles;p++)tile$jscomp$0={},tile$jscomp$0.tx0=Math.max(siz$jscomp$1.XTOsiz+p*siz$jscomp$1.XTsiz,siz$jscomp$1.XOsiz),tile$jscomp$0.ty0=Math.max(siz$jscomp$1.YTOsiz+q*siz$jscomp$1.YTsiz,siz$jscomp$1.YOsiz),
|
|
1062
|
+
tile$jscomp$0.tx1=Math.min(siz$jscomp$1.XTOsiz+(p+1)*siz$jscomp$1.XTsiz,siz$jscomp$1.Xsiz),tile$jscomp$0.ty1=Math.min(siz$jscomp$1.YTOsiz+(q+1)*siz$jscomp$1.YTsiz,siz$jscomp$1.Ysiz),tile$jscomp$0.width=tile$jscomp$0.tx1-tile$jscomp$0.tx0,tile$jscomp$0.height=tile$jscomp$0.ty1-tile$jscomp$0.ty0,tile$jscomp$0.components=[],tiles.push(tile$jscomp$0);context$jscomp$0.tiles=tiles;for(var i$jscomp$0=0,ii=siz$jscomp$1.Csiz;i$jscomp$0<ii;i$jscomp$0++)for(var component$jscomp$1=components$jscomp$0[i$jscomp$0],
|
|
1063
|
+
j$jscomp$0=0,jj=tiles.length;j$jscomp$0<jj;j$jscomp$0++){var tileComponent={};tile$jscomp$0=tiles[j$jscomp$0];tileComponent.tcx0=Math.ceil(tile$jscomp$0.tx0/component$jscomp$1.XRsiz);tileComponent.tcy0=Math.ceil(tile$jscomp$0.ty0/component$jscomp$1.YRsiz);tileComponent.tcx1=Math.ceil(tile$jscomp$0.tx1/component$jscomp$1.XRsiz);tileComponent.tcy1=Math.ceil(tile$jscomp$0.ty1/component$jscomp$1.YRsiz);tileComponent.width=tileComponent.tcx1-tileComponent.tcx0;tileComponent.height=tileComponent.tcy1-tileComponent.tcy0;
|
|
1064
|
+
tile$jscomp$0.components[i$jscomp$0]=tileComponent}context.QCC=[];context.COC=[];break;case 65372:length=(0,_util.readUint16)(data$jscomp$0,position);var qcd={};j=position+2;var sqcd=data$jscomp$0[j++];switch(sqcd&31){case 0:var spqcdSize=8;var scalarExpounded=!0;break;case 1:spqcdSize=16;scalarExpounded=!1;break;case 2:spqcdSize=16;scalarExpounded=!0;break;default:throw Error("Invalid SQcd value "+sqcd);}qcd.noQuantization=8===spqcdSize;qcd.scalarExpounded=scalarExpounded;qcd.guardBits=sqcd>>5;for(spqcds=
|
|
1065
|
+
[];j<length+position;){var spqcd={};8===spqcdSize?(spqcd.epsilon=data$jscomp$0[j++]>>3,spqcd.mu=0):(spqcd.epsilon=data$jscomp$0[j]>>3,spqcd.mu=(data$jscomp$0[j]&7)<<8|data$jscomp$0[j+1],j+=2);spqcds.push(spqcd)}qcd.SPqcds=spqcds;context.mainHeader?context.QCD=qcd:(context.currentTile.QCD=qcd,context.currentTile.QCC=[]);break;case 65373:length=(0,_util.readUint16)(data$jscomp$0,position);var qcc={};j=position+2;if(257>context.SIZ.Csiz)var cqcc=data$jscomp$0[j++];else cqcc=(0,_util.readUint16)(data$jscomp$0,
|
|
1066
|
+
j),j+=2;sqcd=data$jscomp$0[j++];switch(sqcd&31){case 0:spqcdSize=8;scalarExpounded=!0;break;case 1:spqcdSize=16;scalarExpounded=!1;break;case 2:spqcdSize=16;scalarExpounded=!0;break;default:throw Error("Invalid SQcd value "+sqcd);}qcc.noQuantization=8===spqcdSize;qcc.scalarExpounded=scalarExpounded;qcc.guardBits=sqcd>>5;for(spqcds=[];j<length+position;)spqcd={},8===spqcdSize?(spqcd.epsilon=data$jscomp$0[j++]>>3,spqcd.mu=0):(spqcd.epsilon=data$jscomp$0[j]>>3,spqcd.mu=(data$jscomp$0[j]&7)<<8|data$jscomp$0[j+
|
|
1067
|
+
1],j+=2),spqcds.push(spqcd);qcc.SPqcds=spqcds;context.mainHeader?context.QCC[cqcc]=qcc:context.currentTile.QCC[cqcc]=qcc;break;case 65362:length=(0,_util.readUint16)(data$jscomp$0,position);var cod={};j=position+2;var scod=data$jscomp$0[j++];cod.entropyCoderWithCustomPrecincts=!!(scod&1);cod.sopMarkerUsed=!!(scod&2);cod.ephMarkerUsed=!!(scod&4);cod.progressionOrder=data$jscomp$0[j++];cod.layersCount=(0,_util.readUint16)(data$jscomp$0,j);j+=2;cod.multipleComponentTransform=data$jscomp$0[j++];cod.decompositionLevelsCount=
|
|
1068
|
+
data$jscomp$0[j++];cod.xcb=(data$jscomp$0[j++]&15)+2;cod.ycb=(data$jscomp$0[j++]&15)+2;var blockStyle=data$jscomp$0[j++];cod.selectiveArithmeticCodingBypass=!!(blockStyle&1);cod.resetContextProbabilities=!!(blockStyle&2);cod.terminationOnEachCodingPass=!!(blockStyle&4);cod.verticallyStripe=!!(blockStyle&8);cod.predictableTermination=!!(blockStyle&16);cod.segmentationSymbolUsed=!!(blockStyle&32);cod.reversibleTransformation=data$jscomp$0[j++];if(cod.entropyCoderWithCustomPrecincts){for(var precinctsSizes=
|
|
1069
|
+
[];j<length+position;){var precinctsSize=data$jscomp$0[j++];precinctsSizes.push({PPx:precinctsSize&15,PPy:precinctsSize>>4})}cod.precinctsSizes=precinctsSizes}var unsupported=[];cod.selectiveArithmeticCodingBypass&&unsupported.push("selectiveArithmeticCodingBypass");cod.resetContextProbabilities&&unsupported.push("resetContextProbabilities");cod.terminationOnEachCodingPass&&unsupported.push("terminationOnEachCodingPass");cod.verticallyStripe&&unsupported.push("verticallyStripe");cod.predictableTermination&&
|
|
1070
|
+
unsupported.push("predictableTermination");if(0<unsupported.length)throw doNotRecover=!0,Error("Unsupported COD options ("+unsupported.join(", ")+")");context.mainHeader?context.COD=cod:(context.currentTile.COD=cod,context.currentTile.COC=[]);break;case 65424:length=(0,_util.readUint16)(data$jscomp$0,position);var tile={};tile.index=(0,_util.readUint16)(data$jscomp$0,position+2);tile.length=(0,_util.readUint32)(data$jscomp$0,position+4);tile.dataEnd=tile.length+position-2;tile.partIndex=data$jscomp$0[position+
|
|
1071
|
+
8];tile.partsCount=data$jscomp$0[position+9];context.mainHeader=!1;0===tile.partIndex&&(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(0===tile.partIndex){for(var context$jscomp$1=context,componentsCount$jscomp$0=context$jscomp$1.SIZ.Csiz,tile$jscomp$1=context$jscomp$1.tiles[tile.index],c=0;c<componentsCount$jscomp$0;c++){var component$jscomp$2=tile$jscomp$1.components[c];
|
|
1072
|
+
component$jscomp$2.quantizationParameters=void 0!==context$jscomp$1.currentTile.QCC[c]?context$jscomp$1.currentTile.QCC[c]:context$jscomp$1.currentTile.QCD;component$jscomp$2.codingStyleParameters=void 0!==context$jscomp$1.currentTile.COC[c]?context$jscomp$1.currentTile.COC[c]:context$jscomp$1.currentTile.COD}tile$jscomp$1.codingStyleDefaultParameters=context$jscomp$1.currentTile.COD;for(var context$jscomp$2=context,tile$jscomp$2=context$jscomp$2.tiles[context$jscomp$2.currentTile.index],componentsCount$jscomp$1=
|
|
1073
|
+
context$jscomp$2.SIZ.Csiz,c$jscomp$0=0;c$jscomp$0<componentsCount$jscomp$1;c$jscomp$0++){for(var component$jscomp$3=tile$jscomp$2.components[c$jscomp$0],decompositionLevelsCount=component$jscomp$3.codingStyleParameters.decompositionLevelsCount,resolutions=[],subbands=[],r=0;r<=decompositionLevelsCount;r++){var r$jscomp$0=r,codOrCoc=component$jscomp$3.codingStyleParameters,result={};codOrCoc.entropyCoderWithCustomPrecincts?(result.PPx=codOrCoc.precinctsSizes[r$jscomp$0].PPx,result.PPy=codOrCoc.precinctsSizes[r$jscomp$0].PPy):
|
|
1074
|
+
(result.PPx=15,result.PPy=15);result.xcb_=0<r$jscomp$0?Math.min(codOrCoc.xcb,result.PPx-1):Math.min(codOrCoc.xcb,result.PPx);result.ycb_=0<r$jscomp$0?Math.min(codOrCoc.ycb,result.PPy-1):Math.min(codOrCoc.ycb,result.PPy);var blocksDimensions=result;var resolution={},scale=1<<decompositionLevelsCount-r;resolution.trx0=Math.ceil(component$jscomp$3.tcx0/scale);resolution.try0=Math.ceil(component$jscomp$3.tcy0/scale);resolution.trx1=Math.ceil(component$jscomp$3.tcx1/scale);resolution.try1=Math.ceil(component$jscomp$3.tcy1/
|
|
1075
|
+
scale);resolution.resLevel=r;var precinctWidth=1<<blocksDimensions.PPx,precinctHeight=1<<blocksDimensions.PPy,isZeroRes=0===resolution.resLevel,numprecinctswide=resolution.trx1>resolution.trx0?Math.ceil(resolution.trx1/precinctWidth)-Math.floor(resolution.trx0/precinctWidth):0,numprecinctshigh=resolution.try1>resolution.try0?Math.ceil(resolution.try1/precinctHeight)-Math.floor(resolution.try0/precinctHeight):0;resolution.precinctParameters={precinctWidth:precinctWidth,precinctHeight:precinctHeight,
|
|
1076
|
+
numprecinctswide:numprecinctswide,numprecinctshigh:numprecinctshigh,numprecincts:numprecinctswide*numprecinctshigh,precinctWidthInSubband:1<<blocksDimensions.PPx+(isZeroRes?0:-1),precinctHeightInSubband:1<<blocksDimensions.PPy+(isZeroRes?0:-1)};resolutions.push(resolution);if(0===r){var subband={type:"LL"};subband.tbx0=Math.ceil(component$jscomp$3.tcx0/scale);subband.tby0=Math.ceil(component$jscomp$3.tcy0/scale);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/scale);subband.tby1=Math.ceil(component$jscomp$3.tcy1/
|
|
1077
|
+
scale);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,subband,blocksDimensions);subbands.push(subband);resolution.subbands=[subband]}else{var bscale=1<<decompositionLevelsCount-r+1,resolutionSubbands=[];subband={type:"HL"};subband.tbx0=Math.ceil(component$jscomp$3.tcx0/bscale-.5);subband.tby0=Math.ceil(component$jscomp$3.tcy0/bscale);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/bscale-.5);subband.tby1=Math.ceil(component$jscomp$3.tcy1/bscale);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,
|
|
1078
|
+
subband,blocksDimensions);subbands.push(subband);resolutionSubbands.push(subband);subband={type:"LH"};subband.tbx0=Math.ceil(component$jscomp$3.tcx0/bscale);subband.tby0=Math.ceil(component$jscomp$3.tcy0/bscale-.5);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/bscale);subband.tby1=Math.ceil(component$jscomp$3.tcy1/bscale-.5);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,subband,blocksDimensions);subbands.push(subband);resolutionSubbands.push(subband);subband={type:"HH"};subband.tbx0=
|
|
1079
|
+
Math.ceil(component$jscomp$3.tcx0/bscale-.5);subband.tby0=Math.ceil(component$jscomp$3.tcy0/bscale-.5);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/bscale-.5);subband.tby1=Math.ceil(component$jscomp$3.tcy1/bscale-.5);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,subband,blocksDimensions);subbands.push(subband);resolutionSubbands.push(subband);resolution.subbands=resolutionSubbands}}component$jscomp$3.resolutions=resolutions;component$jscomp$3.subbands=subbands}var progressionOrder=
|
|
1080
|
+
tile$jscomp$2.codingStyleDefaultParameters.progressionOrder;switch(progressionOrder){case 0:tile$jscomp$2.packetsIterator=new LayerResolutionComponentPositionIterator(context$jscomp$2);break;case 1:tile$jscomp$2.packetsIterator=new ResolutionLayerComponentPositionIterator(context$jscomp$2);break;case 2:tile$jscomp$2.packetsIterator=new ResolutionPositionComponentLayerIterator(context$jscomp$2);break;case 3:tile$jscomp$2.packetsIterator=new PositionComponentResolutionLayerIterator(context$jscomp$2);
|
|
1081
|
+
break;case 4:tile$jscomp$2.packetsIterator=new ComponentPositionResolutionLayerIterator(context$jscomp$2);break;default:throw new JpxError("Unsupported progression order ".concat(progressionOrder));}}length=tile.dataEnd-position;parseTilePackets(context,data$jscomp$0,position,length);break;case 65365:case 65367:case 65368:case 65380:length=(0,_util.readUint16)(data$jscomp$0,position);break;case 65363:throw Error("Codestream code 0xFF53 (COC) is not implemented");default:throw Error("Unknown codestream code: "+
|
|
1082
|
+
code.toString(16));}position+=length}}catch(e){if(doNotRecover||this.failOnCorruptedImage)throw new JpxError(e.message);(0,_util.warn)("JPX: Trying to recover from: "+e.message)}for(var components$jscomp$1=context.components,componentsCount$jscomp$2=context.SIZ.Csiz,resultImages=[],i$jscomp$1=0,ii$jscomp$0=context.tiles.length;i$jscomp$1<ii$jscomp$0;i$jscomp$1++){var tile$jscomp$3=context.tiles[i$jscomp$1],transformedTiles=[],c$jscomp$1;for(c$jscomp$1=0;c$jscomp$1<componentsCount$jscomp$2;c$jscomp$1++){for(var JSCompiler_temp_const=
|
|
1083
|
+
transformedTiles,JSCompiler_temp_const$jscomp$0=c$jscomp$1,component$jscomp$4=tile$jscomp$3.components[c$jscomp$1],codingStyleParameters=component$jscomp$4.codingStyleParameters,quantizationParameters=component$jscomp$4.quantizationParameters,decompositionLevelsCount$jscomp$0=codingStyleParameters.decompositionLevelsCount,spqcds$jscomp$0=quantizationParameters.SPqcds,scalarExpounded$jscomp$0=quantizationParameters.scalarExpounded,guardBits=quantizationParameters.guardBits,segmentationSymbolUsed=codingStyleParameters.segmentationSymbolUsed,
|
|
1084
|
+
precision=context.components[c$jscomp$1].precision,reversible=codingStyleParameters.reversibleTransformation,transform=reversible?new ReversibleTransform:new IrreversibleTransform,subbandCoefficients=[],b=0,i$jscomp$2=0;i$jscomp$2<=decompositionLevelsCount$jscomp$0;i$jscomp$2++){for(var resolution$jscomp$0=component$jscomp$4.resolutions[i$jscomp$2],width=resolution$jscomp$0.trx1-resolution$jscomp$0.trx0,height=resolution$jscomp$0.try1-resolution$jscomp$0.try0,coefficients=new Float32Array(width*height),
|
|
1085
|
+
j$jscomp$1=0,jj$jscomp$0=resolution$jscomp$0.subbands.length;j$jscomp$1<jj$jscomp$0;j$jscomp$1++){if(scalarExpounded$jscomp$0){var mu=spqcds$jscomp$0[b].mu;var epsilon=spqcds$jscomp$0[b].epsilon;b++}else mu=spqcds$jscomp$0[0].mu,epsilon=spqcds$jscomp$0[0].epsilon+(0<i$jscomp$2?1-i$jscomp$2:0);for(var subband$jscomp$0=resolution$jscomp$0.subbands[j$jscomp$1],gainLog2=SubbandsGainLog2[subband$jscomp$0.type],coefficients$jscomp$0=coefficients,levelWidth=width,subband$jscomp$1=subband$jscomp$0,delta=
|
|
1086
|
+
reversible?1:Math.pow(2,precision+gainLog2-epsilon)*(1+mu/2048),mb=guardBits+epsilon-1,reversible$jscomp$0=reversible,segmentationSymbolUsed$jscomp$0=segmentationSymbolUsed,x0=subband$jscomp$1.tbx0,y0=subband$jscomp$1.tby0,width$jscomp$0=subband$jscomp$1.tbx1-subband$jscomp$1.tbx0,codeblocks=subband$jscomp$1.codeblocks,right="H"===subband$jscomp$1.type.charAt(0)?1:0,bottom="H"===subband$jscomp$1.type.charAt(1)?levelWidth:0,i$jscomp$3=0,ii$jscomp$1=codeblocks.length;i$jscomp$3<ii$jscomp$1;++i$jscomp$3){var codeblock=
|
|
1087
|
+
codeblocks[i$jscomp$3],blockWidth=codeblock.tbx1_-codeblock.tbx0_,blockHeight=codeblock.tby1_-codeblock.tby0_;if(0!==blockWidth&&0!==blockHeight&&void 0!==codeblock.data){var bitModel=new BitModel(blockWidth,blockHeight,codeblock.subbandType,codeblock.zeroBitPlanes,mb);var currentCodingpassType=2;var data=codeblock.data,totalLength=0,codingpasses=0,jj$jscomp$1;var j$jscomp$2=0;for(jj$jscomp$1=data.length;j$jscomp$2<jj$jscomp$1;j$jscomp$2++){var dataItem=data[j$jscomp$2];totalLength+=dataItem.end-
|
|
1088
|
+
dataItem.start;codingpasses+=dataItem.codingpasses}var encodedData=new Uint8Array(totalLength),position$jscomp$0=0;j$jscomp$2=0;for(jj$jscomp$1=data.length;j$jscomp$2<jj$jscomp$1;j$jscomp$2++){dataItem=data[j$jscomp$2];var chunk=dataItem.data.subarray(dataItem.start,dataItem.end);encodedData.set(chunk,position$jscomp$0);position$jscomp$0+=chunk.length}var decoder=new _arithmetic_decoder.ArithmeticDecoder(encodedData,0,totalLength);bitModel.setDecoder(decoder);for(j$jscomp$2=0;j$jscomp$2<codingpasses;j$jscomp$2++){switch(currentCodingpassType){case 0:bitModel.runSignificancePropagationPass();
|
|
1089
|
+
break;case 1:bitModel.runMagnitudeRefinementPass();break;case 2:bitModel.runCleanupPass(),segmentationSymbolUsed$jscomp$0&&bitModel.checkSegmentationSymbol()}currentCodingpassType=(currentCodingpassType+1)%3}var offset=codeblock.tbx0_-x0+(codeblock.tby0_-y0)*width$jscomp$0,sign=bitModel.coefficentsSign,magnitude=bitModel.coefficentsMagnitude,bitsDecoded=bitModel.bitsDecoded,magnitudeCorrection=reversible$jscomp$0?0:.5,k;position$jscomp$0=0;var interleave="LL"!==subband$jscomp$1.type;for(j$jscomp$2=
|
|
1090
|
+
0;j$jscomp$2<blockHeight;j$jscomp$2++){var levelOffset=2*(offset/width$jscomp$0|0)*(levelWidth-width$jscomp$0)+right+bottom;for(k=0;k<blockWidth;k++){var n=magnitude[position$jscomp$0];if(0!==n){n=(n+magnitudeCorrection)*delta;0!==sign[position$jscomp$0]&&(n=-n);var nb=bitsDecoded[position$jscomp$0];coefficients$jscomp$0[interleave?levelOffset+(offset<<1):offset]=reversible$jscomp$0&&nb>=mb?n:n*(1<<mb-nb)}offset++;position$jscomp$0++}offset+=width$jscomp$0-blockWidth}}}}subbandCoefficients.push({width:width,
|
|
1091
|
+
height:height,items:coefficients})}var result$jscomp$0=transform.calculate(subbandCoefficients,component$jscomp$4.tcx0,component$jscomp$4.tcy0);JSCompiler_temp_const[JSCompiler_temp_const$jscomp$0]={left:component$jscomp$4.tcx0,top:component$jscomp$4.tcy0,width:result$jscomp$0.width,height:result$jscomp$0.height,items:result$jscomp$0.items}}var tile0=transformedTiles[0],out=new Uint8ClampedArray(tile0.items.length*componentsCount$jscomp$2),result$jscomp$1={left:tile0.left,top:tile0.top,width:tile0.width,
|
|
1092
|
+
height:tile0.height,items:out},pos=0,j$jscomp$3;if(tile$jscomp$3.codingStyleDefaultParameters.multipleComponentTransform){var fourComponents=4===componentsCount$jscomp$2,y0items=transformedTiles[0].items,y1items=transformedTiles[1].items,y2items=transformedTiles[2].items,y3items=fourComponents?transformedTiles[3].items:null;var shift=components$jscomp$1[0].precision-8;var offset$jscomp$0=(128<<shift)+.5;var component0=tile$jscomp$3.components[0],alpha01=componentsCount$jscomp$2-3;var jj$jscomp$2=
|
|
1093
|
+
y0items.length;if(component0.codingStyleParameters.reversibleTransformation)for(j$jscomp$3=0;j$jscomp$3<jj$jscomp$2;j$jscomp$3++,pos+=alpha01){var y0$jscomp$0=y0items[j$jscomp$3]+offset$jscomp$0;var y1=y1items[j$jscomp$3];var y2=y2items[j$jscomp$3];var g=y0$jscomp$0-(y2+y1>>2);out[pos++]=g+y2>>shift;out[pos++]=g>>shift;out[pos++]=g+y1>>shift}else for(j$jscomp$3=0;j$jscomp$3<jj$jscomp$2;j$jscomp$3++,pos+=alpha01)y0$jscomp$0=y0items[j$jscomp$3]+offset$jscomp$0,y1=y1items[j$jscomp$3],y2=y2items[j$jscomp$3],
|
|
1094
|
+
out[pos++]=y0$jscomp$0+1.402*y2>>shift,out[pos++]=y0$jscomp$0-.34413*y1-.71414*y2>>shift,out[pos++]=y0$jscomp$0+1.772*y1>>shift;if(fourComponents)for(j$jscomp$3=0,pos=3;j$jscomp$3<jj$jscomp$2;j$jscomp$3++,pos+=4)out[pos]=y3items[j$jscomp$3]+offset$jscomp$0>>shift}else for(c$jscomp$1=0;c$jscomp$1<componentsCount$jscomp$2;c$jscomp$1++){var items=transformedTiles[c$jscomp$1].items;shift=components$jscomp$1[c$jscomp$1].precision-8;offset$jscomp$0=(128<<shift)+.5;pos=c$jscomp$1;j$jscomp$3=0;for(jj$jscomp$2=
|
|
1095
|
+
items.length;j$jscomp$3<jj$jscomp$2;j$jscomp$3++)out[pos]=items[j$jscomp$3]+offset$jscomp$0>>shift,pos+=componentsCount$jscomp$2}resultImages.push(result$jscomp$1)}this.tiles=resultImages;this.width=context.SIZ.Xsiz-context.SIZ.XOsiz;this.height=context.SIZ.Ysiz-context.SIZ.YOsiz;this.componentsCount=context.SIZ.Csiz}};var TagTree=function(){function TagTree(width,height){var levelsLength=(0,_util.log2)(Math.max(width,height))+1;this.levels=[];for(var i=0;i<levelsLength;i++)this.levels.push({width:width,
|
|
1096
|
+
height:height,items:[]}),width=Math.ceil(width/2),height=Math.ceil(height/2)}TagTree.prototype={reset:function(i,j){for(var currentLevel=0,value=0,level;currentLevel<this.levels.length;){level=this.levels[currentLevel];var index=i+j*level.width;if(void 0!==level.items[index]){value=level.items[index];break}level.index=index;i>>=1;j>>=1;currentLevel++}currentLevel--;level=this.levels[currentLevel];level.items[level.index]=value;this.currentLevel=currentLevel;delete this.value},incrementValue:function(){var level=
|
|
1097
|
+
this.levels[this.currentLevel];level.items[level.index]++},nextLevel:function(){var currentLevel=this.currentLevel,level=this.levels[currentLevel],value=level.items[level.index];currentLevel--;if(0>currentLevel)return this.value=value,!1;this.currentLevel=currentLevel;level=this.levels[currentLevel];level.items[level.index]=value;return!0}};return TagTree}(),InclusionTree=function(){function InclusionTree(width,height,defaultValue){var levelsLength=(0,_util.log2)(Math.max(width,height))+1;this.levels=
|
|
1098
|
+
[];for(var i=0;i<levelsLength;i++){for(var items=new Uint8Array(width*height),j=0,jj=items.length;j<jj;j++)items[j]=defaultValue;this.levels.push({width:width,height:height,items:items});width=Math.ceil(width/2);height=Math.ceil(height/2)}}InclusionTree.prototype={reset:function(i,j,stopValue){for(var currentLevel=0;currentLevel<this.levels.length;){var level=this.levels[currentLevel],index=i+j*level.width;level.index=index;level=level.items[index];if(255===level)break;if(level>stopValue)return this.currentLevel=
|
|
1099
|
+
currentLevel,this.propagateValues(),!1;i>>=1;j>>=1;currentLevel++}this.currentLevel=currentLevel-1;return!0},incrementValue:function(stopValue){var level=this.levels[this.currentLevel];level.items[level.index]=stopValue+1;this.propagateValues()},propagateValues:function(){for(var levelIndex=this.currentLevel,level=this.levels[levelIndex],currentValue=level.items[level.index];0<=--levelIndex;)level=this.levels[levelIndex],level.items[level.index]=currentValue},nextLevel:function(){var currentLevel=
|
|
1100
|
+
this.currentLevel,level=this.levels[currentLevel],value=level.items[level.index];level.items[level.index]=255;currentLevel--;if(0>currentLevel)return!1;this.currentLevel=currentLevel;level=this.levels[currentLevel];level.items[level.index]=value;return!0}};return InclusionTree}(),BitModel=function(){function BitModel(width,height,subband,zeroBitPlanes,mb){this.width=width;this.height=height;this.contextLabelTable="HH"===subband?HHContextLabel:"HL"===subband?HLContextLabel:LLAndLHContextsLabel;width*=
|
|
1101
|
+
height;this.neighborsSignificance=new Uint8Array(width);this.coefficentsSign=new Uint8Array(width);this.coefficentsMagnitude=14<mb?new Uint32Array(width):6<mb?new Uint16Array(width):new Uint8Array(width);this.processingFlags=new Uint8Array(width);mb=new Uint8Array(width);if(0!==zeroBitPlanes)for(height=0;height<width;height++)mb[height]=zeroBitPlanes;this.bitsDecoded=mb;this.reset()}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,
|
|
1102
|
+
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]),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]),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]);BitModel.prototype={setDecoder:function(decoder){this.decoder=
|
|
1103
|
+
decoder},reset:function(){this.contexts=new Int8Array(19);this.contexts[0]=8;this.contexts[17]=92;this.contexts[18]=6},setNeighborsSignificance:function(row,column,index){var neighborsSignificance=this.neighborsSignificance,width=this.width,height=this.height,left=0<column;column=column+1<width;if(0<row){var i=index-width;left&&(neighborsSignificance[i-1]+=16);column&&(neighborsSignificance[i+1]+=16);neighborsSignificance[i]+=4}row+1<height&&(i=index+width,left&&(neighborsSignificance[i-1]+=16),column&&
|
|
1104
|
+
(neighborsSignificance[i+1]+=16),neighborsSignificance[i]+=4);left&&(neighborsSignificance[index-1]+=1);column&&(neighborsSignificance[index+1]+=1);neighborsSignificance[index]|=128},runSignificancePropagationPass:function(){for(var decoder=this.decoder,width=this.width,height=this.height,coefficentsMagnitude=this.coefficentsMagnitude,coefficentsSign=this.coefficentsSign,neighborsSignificance=this.neighborsSignificance,processingFlags=this.processingFlags,contexts=this.contexts,labels=this.contextLabelTable,
|
|
1105
|
+
bitsDecoded=this.bitsDecoded,i0=0;i0<height;i0+=4)for(var j=0;j<width;j++)for(var index=i0*width+j,i1=0;4>i1;i1++,index+=width){var i=i0+i1;if(i>=height)break;processingFlags[index]&=-2;if(!coefficentsMagnitude[index]&&neighborsSignificance[index]){if(decoder.readBit(contexts,labels[neighborsSignificance[index]])){var sign=this.decodeSignBit(i,j,index);coefficentsSign[index]=sign;coefficentsMagnitude[index]=1;this.setNeighborsSignificance(i,j,index);processingFlags[index]|=2}bitsDecoded[index]++;
|
|
1106
|
+
processingFlags[index]|=1}}},decodeSignBit:function(row,column,index){var width=this.width,height=this.height,coefficentsMagnitude=this.coefficentsMagnitude,coefficentsSign=this.coefficentsSign;var sign0=0<column&&0!==coefficentsMagnitude[index-1];column+1<width&&0!==coefficentsMagnitude[index+1]?(column=coefficentsSign[index+1],sign0?(sign0=coefficentsSign[index-1],column=1-column-sign0):column=1-column-column):sign0?(sign0=coefficentsSign[index-1],column=1-sign0-sign0):column=0;var horizontalContribution=
|
|
1107
|
+
3*column;sign0=0<row&&0!==coefficentsMagnitude[index-width];row+1<height&&0!==coefficentsMagnitude[index+width]?(column=coefficentsSign[index+width],sign0?(sign0=coefficentsSign[index-width],column=1-column-sign0+horizontalContribution):column=1-column-column+horizontalContribution):sign0?(sign0=coefficentsSign[index-width],column=1-sign0-sign0+horizontalContribution):column=horizontalContribution;return 0<=column?this.decoder.readBit(this.contexts,9+column):this.decoder.readBit(this.contexts,9-column)^
|
|
1108
|
+
1},runMagnitudeRefinementPass:function(){for(var decoder=this.decoder,width=this.width,coefficentsMagnitude=this.coefficentsMagnitude,neighborsSignificance=this.neighborsSignificance,contexts=this.contexts,bitsDecoded=this.bitsDecoded,processingFlags=this.processingFlags,length=width*this.height,width4=4*width,index0=0,indexNext;index0<length;index0=indexNext){indexNext=Math.min(length,index0+width4);for(var j=0;j<width;j++)for(var index=index0+j;index<indexNext;index+=width)if(coefficentsMagnitude[index]&&
|
|
1109
|
+
0===(processingFlags[index]&1)){var contextLabel=16;0!==(processingFlags[index]&2)&&(processingFlags[index]^=2,contextLabel=0===(neighborsSignificance[index]&127)?15:14);contextLabel=decoder.readBit(contexts,contextLabel);coefficentsMagnitude[index]=coefficentsMagnitude[index]<<1|contextLabel;bitsDecoded[index]++;processingFlags[index]|=1}}},runCleanupPass:function(){for(var decoder=this.decoder,width=this.width,height=this.height,neighborsSignificance=this.neighborsSignificance,coefficentsMagnitude=
|
|
1110
|
+
this.coefficentsMagnitude,coefficentsSign=this.coefficentsSign,contexts=this.contexts,labels=this.contextLabelTable,bitsDecoded=this.bitsDecoded,processingFlags=this.processingFlags,twoRowsDown=2*width,threeRowsDown=3*width,iNext,i0=0;i0<height;i0=iNext){iNext=Math.min(i0+4,height);for(var indexBase=i0*width,checkAllEmpty=i0+3<height,j=0;j<width;j++){var index0=indexBase+j,i1=0,index=index0,i=i0;if(checkAllEmpty&&0===processingFlags[index0]&&0===processingFlags[index0+width]&&0===processingFlags[index0+
|
|
1111
|
+
twoRowsDown]&&0===processingFlags[index0+threeRowsDown]&&0===neighborsSignificance[index0]&&0===neighborsSignificance[index0+width]&&0===neighborsSignificance[index0+twoRowsDown]&&0===neighborsSignificance[index0+threeRowsDown]){if(!decoder.readBit(contexts,18)){bitsDecoded[index0]++;bitsDecoded[index0+width]++;bitsDecoded[index0+twoRowsDown]++;bitsDecoded[index0+threeRowsDown]++;continue}i1=decoder.readBit(contexts,17)<<1|decoder.readBit(contexts,17);0!==i1&&(i=i0+i1,index+=i1*width);var sign=this.decodeSignBit(i,
|
|
1112
|
+
j,index);coefficentsSign[index]=sign;coefficentsMagnitude[index]=1;this.setNeighborsSignificance(i,j,index);processingFlags[index]|=2;index=index0;for(index0=i0;index0<=i;index0++,index+=width)bitsDecoded[index]++;i1++}for(i=i0+i1;i<iNext;i++,index+=width)coefficentsMagnitude[index]||0!==(processingFlags[index]&1)||(1===decoder.readBit(contexts,labels[neighborsSignificance[index]])&&(sign=this.decodeSignBit(i,j,index),coefficentsSign[index]=sign,coefficentsMagnitude[index]=1,this.setNeighborsSignificance(i,
|
|
1113
|
+
j,index),processingFlags[index]|=2),bitsDecoded[index]++)}}},checkSegmentationSymbol:function(){var decoder=this.decoder,contexts=this.contexts;if(10!==(decoder.readBit(contexts,17)<<3|decoder.readBit(contexts,17)<<2|decoder.readBit(contexts,17)<<1|decoder.readBit(contexts,17)))throw new JpxError("Invalid segmentation symbol");}};return BitModel}(),Transform=function(){function Transform(){}Transform.prototype.calculate=function(subbands,u0,v0){for(var ll=subbands[0],i=1,ii=subbands.length;i<ii;i++)ll=
|
|
1114
|
+
this.iterate(ll,subbands[i],u0,v0);return ll};Transform.prototype.extend=function(buffer,offset,size){var i1=offset-1,j1=offset+1,i2=offset+size-2;offset+=size;buffer[i1--]=buffer[j1++];buffer[offset++]=buffer[i2--];buffer[i1--]=buffer[j1++];buffer[offset++]=buffer[i2--];buffer[i1--]=buffer[j1++];buffer[offset++]=buffer[i2--];buffer[i1]=buffer[j1];buffer[offset]=buffer[i2]};Transform.prototype.iterate=function(ll,hl_lh_hh,u0,v0){var llWidth=ll.width,llHeight=ll.height,llItems=ll.items,width=hl_lh_hh.width,
|
|
1115
|
+
height=hl_lh_hh.height;hl_lh_hh=hl_lh_hh.items;var i,j,k;for(i=k=0;i<llHeight;i++){var l=2*i*width;for(j=0;j<llWidth;j++,k++,l+=2)hl_lh_hh[l]=llItems[k]}ll.items=null;ll=new Float32Array(width+8);if(1===width){if(0!==(u0&1))for(k=l=0;l<height;l++,k+=width)hl_lh_hh[k]*=.5}else for(k=l=0;l<height;l++,k+=width)ll.set(hl_lh_hh.subarray(k,k+width),4),this.extend(ll,4,width),this.filter(ll,4,width),hl_lh_hh.set(ll.subarray(4,4+width),k);u0=16;llWidth=[];for(i=0;i<u0;i++)llWidth.push(new Float32Array(height+
|
|
1116
|
+
8));i=0;ll=4+height;if(1===height){if(0!==(v0&1))for(v0=0;v0<width;v0++)hl_lh_hh[v0]*=.5}else for(v0=0;v0<width;v0++){if(0===i){u0=Math.min(width-v0,u0);k=v0;for(l=4;l<ll;k+=width,l++)for(llHeight=0;llHeight<u0;llHeight++)llWidth[llHeight][l]=hl_lh_hh[k+llHeight];i=u0}i--;k=llWidth[i];this.extend(k,4,height);this.filter(k,4,height);if(0===i)for(k=v0-u0+1,l=4;l<ll;k+=width,l++)for(llHeight=0;llHeight<u0;llHeight++)hl_lh_hh[k+llHeight]=llWidth[llHeight][l]}return{width:width,height:height,items:hl_lh_hh}};
|
|
1117
|
+
return Transform}(),IrreversibleTransform=function(){function IrreversibleTransform(){Transform.call(this)}IrreversibleTransform.prototype=Object.create(Transform.prototype);IrreversibleTransform.prototype.filter=function(x,offset,length){length>>=1;offset|=0;var n;var j=offset-3;for(n=length+4;n--;j+=2)x[j]*=.8128930661159609;j=offset-2;var current=.443506852043971*x[j-1];for(n=length+3;n--;j+=2){var next=.443506852043971*x[j+1];x[j]=1.230174104914001*x[j]-current-next;if(n--)j+=2,current=.443506852043971*
|
|
1118
|
+
x[j+1],x[j]=1.230174104914001*x[j]-current-next;else break}j=offset-1;current=.882911075530934*x[j-1];for(n=length+2;n--;j+=2)if(next=.882911075530934*x[j+1],x[j]-=current+next,n--)j+=2,current=.882911075530934*x[j+1],x[j]-=current+next;else break;j=offset;current=-.052980118572961*x[j-1];for(n=length+1;n--;j+=2)if(next=-.052980118572961*x[j+1],x[j]-=current+next,n--)j+=2,current=-.052980118572961*x[j+1],x[j]-=current+next;else break;if(0!==length)for(j=offset+1,current=-1.586134342059924*x[j-1],
|
|
1119
|
+
n=length;n--;j+=2)if(next=-1.586134342059924*x[j+1],x[j]-=current+next,n--)j+=2,current=-1.586134342059924*x[j+1],x[j]-=current+next;else break};return IrreversibleTransform}(),ReversibleTransform=function(){function ReversibleTransform(){Transform.call(this)}ReversibleTransform.prototype=Object.create(Transform.prototype);ReversibleTransform.prototype.filter=function(x,offset,length){length>>=1;offset|=0;var n;var j=offset;for(n=length+1;n--;j+=2)x[j]-=x[j-1]+x[j+1]+2>>2;j=offset+1;for(n=length;n--;j+=
|
|
1120
|
+
2)x[j]+=x[j-1]+x[j+1]>>1};return ReversibleTransform}();return JpxImage}();exports.JpxImage=module},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _possibleConstructorReturn(self,call){if(call&&("object"===
|
|
1121
|
+
_typeof(call)||"function"===typeof call))return call;if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");
|
|
1122
|
+
subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _defineProperties(target,
|
|
1123
|
+
props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.calculateSHA512=
|
|
1124
|
+
exports.calculateSHA384=exports.calculateSHA256=exports.calculateMD5=exports.PDF20=exports.PDF17=exports.CipherTransformFactory=exports.ARCFourCipher=exports.AES256Cipher=exports.AES128Cipher=void 0;var _util=__w_pdfjs_require__(5),_primitives=__w_pdfjs_require__(188),_stream=__w_pdfjs_require__(195),ARCFourCipher=function(){function ARCFourCipher(key){this.b=this.a=0;var s=new Uint8Array(256),i,j=0,keyLength=key.length;for(i=0;256>i;++i)s[i]=i;for(i=0;256>i;++i){var tmp=s[i];j=j+tmp+key[i%keyLength]&
|
|
1125
|
+
255;s[i]=s[j];s[j]=tmp}this.s=s}ARCFourCipher.prototype={encryptBlock:function(data){var i,n=data.length,a=this.a,b=this.b,s=this.s,output=new Uint8Array(n);for(i=0;i<n;++i){a=a+1&255;var tmp=s[a];b=b+tmp&255;var tmp2=s[b];s[a]=tmp2;s[b]=tmp;output[i]=data[i]^s[tmp+tmp2&255]}this.a=a;this.b=b;return output}};ARCFourCipher.prototype.decryptBlock=ARCFourCipher.prototype.encryptBlock;return ARCFourCipher}();exports.ARCFourCipher=ARCFourCipher;var calculateMD5=function(){var r=new Uint8Array([7,12,17,
|
|
1126
|
+
22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]),k=new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,
|
|
1127
|
+
1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]);return function(data,offset,length){var h0=1732584193,h1=-271733879,h2=-1732584194,h3=271733878,paddedLength=length+72&-64,padded=
|
|
1128
|
+
new Uint8Array(paddedLength),i;for(i=0;i<length;++i)padded[i]=data[offset++];padded[i++]=128;for(data=paddedLength-8;i<data;)padded[i++]=0;padded[i++]=length<<3&255;padded[i++]=length>>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;data=new Int32Array(16);for(i=0;i<paddedLength;){for(length=0;16>length;++length,i+=4)data[length]=padded[i]|padded[i+1]<<8|padded[i+2]<<16|padded[i+3]<<24;var a=h0;offset=h1;var c=h2,d=
|
|
1129
|
+
h3;for(length=0;64>length;++length){if(16>length){var f=offset&c|~offset&d;var g=length}else 32>length?(f=d&offset|~d&c,g=5*length+1&15):48>length?(f=offset^c^d,g=3*length+5&15):(f=c^(offset|~d),g=7*length&15);var tmp=d;a=a+f+k[length]+data[g]|0;f=r[length];d=c;c=offset;offset=offset+(a<<f|a>>>32-f)|0;a=tmp}h0=h0+a|0;h1=h1+offset|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,
|
|
1130
|
+
h3>>8&255,h3>>16&255,h3>>>24&255])}}();exports.calculateMD5=calculateMD5;var Word64=function(){function Word64(highInteger,lowInteger){this.high=highInteger|0;this.low=lowInteger|0}Word64.prototype={and:function(word){this.high&=word.high;this.low&=word.low},xor:function(word){this.high^=word.high;this.low^=word.low},or:function(word){this.high|=word.high;this.low|=word.low},shiftRight:function(places){32<=places?(this.low=this.high>>>places-32|0,this.high=0):(this.low=this.low>>>places|this.high<<
|
|
1131
|
+
32-places,this.high=this.high>>>places|0)},shiftLeft:function(places){32<=places?(this.high=this.low<<places-32,this.low=0):(this.high=this.high<<places|this.low>>>32-places,this.low<<=places)},rotateRight:function(places){if(places&32){var high=this.low;var low=this.high}else low=this.low,high=this.high;places&=31;this.low=low>>>places|high<<32-places;this.high=high>>>places|low<<32-places},not:function(){this.high=~this.high;this.low=~this.low},add:function(word){var lowAdd=(this.low>>>0)+(word.low>>>
|
|
1132
|
+
0);word=(this.high>>>0)+(word.high>>>0);4294967295<lowAdd&&(word+=1);this.low=lowAdd|0;this.high=word|0},copyTo:function(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(word){this.high=word.high;this.low=word.low}};return Word64}(),calculateSHA256=function(){function rotr(x,
|
|
1133
|
+
n){return x>>>n|x<<32-n}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,
|
|
1134
|
+
3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];return function(data,offset,length){var h0=1779033703,h1=3144134277,h2=1013904242,h3=2773480762,h4=1359893119,h5=2600822924,h6=528734635,h7=1541459225,paddedLength=64*Math.ceil((length+9)/64),padded=new Uint8Array(paddedLength),i;for(i=0;i<length;++i)padded[i]=data[offset++];padded[i++]=
|
|
1135
|
+
128;for(data=paddedLength-8;i<data;)padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=length>>>29&255;padded[i++]=length>>21&255;padded[i++]=length>>13&255;padded[i++]=length>>5&255;padded[i++]=length<<3&255;data=new Uint32Array(64);for(i=0;i<paddedLength;){for(length=0;16>length;++length)data[length]=padded[i]<<24|padded[i+1]<<16|padded[i+2]<<8|padded[i+3],i+=4;for(length=16;64>length;++length){offset=length;var x=data[length-2];x=(rotr(x,17)^rotr(x,19)^x>>>10)+data[length-7];var JSCompiler_inline_result=
|
|
1136
|
+
data[length-15];JSCompiler_inline_result=rotr(JSCompiler_inline_result,7)^rotr(JSCompiler_inline_result,18)^JSCompiler_inline_result>>>3;data[offset]=x+JSCompiler_inline_result+data[length-16]|0}offset=h0;x=h1;JSCompiler_inline_result=h2;var d=h3,e=h4,f=h5,g=h6,h=h7;for(length=0;64>length;++length){var t1=h;h=e;h=rotr(h,6)^rotr(h,11)^rotr(h,25);t1=t1+h+(e&f^~e&g)+k[length]+data[length];h=offset;var t2=(rotr(h,2)^rotr(h,13)^rotr(h,22))+(offset&x^offset&JSCompiler_inline_result^x&JSCompiler_inline_result);
|
|
1137
|
+
h=g;g=f;f=e;e=d+t1|0;d=JSCompiler_inline_result;JSCompiler_inline_result=x;x=offset;offset=t1+t2|0}h0=h0+offset|0;h1=h1+x|0;h2=h2+JSCompiler_inline_result|0;h3=h3+d|0;h4=h4+e|0;h5=h5+f|0;h6=h6+g|0;h7=h7+h|0}return new Uint8Array([h0>>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,
|
|
1138
|
+
h7>>24&255,h7>>16&255,h7>>8&255,h7&255])}}();exports.calculateSHA256=calculateSHA256;var calculateSHA512=function(){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,
|
|
1139
|
+
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,
|
|
1140
|
+
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,
|
|
1141
|
+
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,
|
|
1142
|
+
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,
|
|
1143
|
+
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)];return function(data,offset,length,mode384){mode384=!!mode384;if(mode384){var h0=new Word64(3418070365,3238371032);var h1=new Word64(1654270250,914150663);var h2=new Word64(2438529370,812702999);var h3=new Word64(355462360,
|
|
1144
|
+
4144912697);var h4=new Word64(1731405415,4290775857);var h5=new Word64(2394180231,1750603025);var h6=new Word64(3675008525,1694076839);var h7=new Word64(1203062813,3204075428)}else 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);var paddedLength=128*Math.ceil((length+
|
|
1145
|
+
17)/128),padded=new Uint8Array(paddedLength),i;for(i=0;i<length;++i)padded[i]=data[offset++];padded[i++]=128;for(data=paddedLength-16;i<data;)padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=length>>>29&255;padded[i++]=length>>21&255;padded[i++]=length>>13&255;padded[i++]=length>>5&255;padded[i++]=length<<3&255;data=Array(80);for(i=0;80>i;i++)data[i]=new Word64(0,0);offset=
|
|
1146
|
+
new Word64(0,0);var b=new Word64(0,0),c=new Word64(0,0),d=new Word64(0,0),e=new Word64(0,0),f=new Word64(0,0),g=new Word64(0,0),h=new Word64(0,0),t1=new Word64(0,0),t2=new Word64(0,0),tmp1=new Word64(0,0),tmp2=new Word64(0,0),tmp3;for(i=0;i<paddedLength;){for(length=0;16>length;++length)data[length].high=padded[i]<<24|padded[i+1]<<16|padded[i+2]<<8|padded[i+3],data[length].low=padded[i+4]<<24|padded[i+5]<<16|padded[i+6]<<8|padded[i+7],i+=8;for(length=16;80>length;++length){var result=tmp3=data[length],
|
|
1147
|
+
x=data[length-2],tmp=tmp2;result.assign(x);result.rotateRight(19);tmp.assign(x);tmp.rotateRight(61);result.xor(tmp);tmp.assign(x);tmp.shiftRight(6);result.xor(tmp);tmp3.add(data[length-7]);result=tmp1;x=data[length-15];tmp=tmp2;result.assign(x);result.rotateRight(1);tmp.assign(x);tmp.rotateRight(8);result.xor(tmp);tmp.assign(x);tmp.shiftRight(7);result.xor(tmp);tmp3.add(tmp1);tmp3.add(data[length-16])}offset.assign(h0);b.assign(h1);c.assign(h2);d.assign(h3);e.assign(h4);f.assign(h5);g.assign(h6);
|
|
1148
|
+
h.assign(h7);for(length=0;80>length;++length){t1.assign(h);tmp3=tmp1;result=e;x=tmp2;tmp3.assign(result);tmp3.rotateRight(14);x.assign(result);x.rotateRight(18);tmp3.xor(x);x.assign(result);x.rotateRight(41);tmp3.xor(x);t1.add(tmp1);tmp3=tmp1;result=e;x=f;tmp=g;var tmp$jscomp$0=tmp2;tmp3.assign(result);tmp3.and(x);tmp$jscomp$0.assign(result);tmp$jscomp$0.not();tmp$jscomp$0.and(tmp);tmp3.xor(tmp$jscomp$0);t1.add(tmp1);t1.add(k[length]);t1.add(data[length]);tmp3=t2;result=offset;x=tmp2;tmp3.assign(result);
|
|
1149
|
+
tmp3.rotateRight(28);x.assign(result);x.rotateRight(34);tmp3.xor(x);x.assign(result);x.rotateRight(39);tmp3.xor(x);tmp3=tmp1;result=offset;x=b;tmp=c;tmp$jscomp$0=tmp2;tmp3.assign(result);tmp3.and(x);tmp$jscomp$0.assign(result);tmp$jscomp$0.and(tmp);tmp3.xor(tmp$jscomp$0);tmp$jscomp$0.assign(x);tmp$jscomp$0.and(tmp);tmp3.xor(tmp$jscomp$0);t2.add(tmp1);tmp3=h;h=g;g=f;f=e;d.add(t1);e=d;d=c;c=b;b=offset;tmp3.assign(t1);tmp3.add(t2);offset=tmp3}h0.add(offset);h1.add(b);h2.add(c);h3.add(d);h4.add(e);h5.add(f);
|
|
1150
|
+
h6.add(g);h7.add(h)}mode384?(mode384=new Uint8Array(48),h0.copyTo(mode384,0),h1.copyTo(mode384,8),h2.copyTo(mode384,16),h3.copyTo(mode384,24),h4.copyTo(mode384,32),h5.copyTo(mode384,40)):(mode384=new Uint8Array(64),h0.copyTo(mode384,0),h1.copyTo(mode384,8),h2.copyTo(mode384,16),h3.copyTo(mode384,24),h4.copyTo(mode384,32),h5.copyTo(mode384,40),h6.copyTo(mode384,48),h7.copyTo(mode384,56));return mode384}}();exports.calculateSHA512=calculateSHA512;var calculateSHA384=function(){return function(data,
|
|
1151
|
+
offset,length){return calculateSHA512(data,offset,length,!0)}}();exports.calculateSHA384=calculateSHA384;var NullCipher=function(){function NullCipher(){}NullCipher.prototype={decryptBlock:function(data){return data}};return NullCipher}();module=function(){function AESBaseCipher(){_classCallCheck(this,AESBaseCipher);this.constructor===AESBaseCipher&&(0,_util.unreachable)("Cannot initialize AESBaseCipher.");this._s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,
|
|
1152
|
+
201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,
|
|
1153
|
+
224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);this._inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,
|
|
1154
|
+
50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,
|
|
1155
|
+
27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);this._mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,
|
|
1156
|
+
4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,
|
|
1157
|
+
2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,
|
|
1158
|
+
2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,
|
|
1159
|
+
2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,
|
|
1160
|
+
3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,
|
|
1161
|
+
2370213795]);this._mixCol=new Uint8Array(256);for(var i=0;256>i;i++)this._mixCol[i]=128>i?i<<1:i<<1^27;this.buffer=new Uint8Array(16);this.bufferPosition=0}_createClass(AESBaseCipher,[{key:"_expandKey",value:function(cipherKey){(0,_util.unreachable)("Cannot call `_expandKey` on the base class")}},{key:"_decrypt",value:function(input,key){var u,state=new Uint8Array(16);state.set(input);input=0;for(u=this._keySize;16>input;++input,++u)state[input]^=key[u];for(input=this._cyclesOfRepetition-1;1<=input;--input){var t=
|
|
1162
|
+
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];var v=state[7];state[15]=state[3];state[11]=t;state[7]=u;state[3]=v;for(u=0;16>u;++u)state[u]=this._inv_s[state[u]];u=0;for(t=16*input;16>u;++u,++t)state[u]^=key[t];for(u=0;16>u;u+=4){t=this._mix[state[u+1]];v=this._mix[state[u+2]];var s3=this._mix[state[u+3]];t=this._mix[state[u]]^t>>>8^t<<24^v>>>16^v<<16^s3>>>24^s3<<
|
|
1163
|
+
8;state[u]=t>>>24&255;state[u+1]=t>>16&255;state[u+2]=t>>8&255;state[u+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(input=0;16>input;++input)state[input]=this._inv_s[state[input]],state[input]^=key[input];return state}},{key:"_encrypt",value:function(input,key){var s=this._s,t,state=
|
|
1164
|
+
new Uint8Array(16);state.set(input);for(input=0;16>input;++input)state[input]^=key[input];for(input=1;input<this._cyclesOfRepetition;input++){for(t=0;16>t;++t)state[t]=s[state[t]];var v=state[1];state[1]=state[5];state[5]=state[9];state[9]=state[13];state[13]=v;v=state[2];var 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(u=0;16>u;u+=4){v=state[u+0];var s1=state[u+1],s2=state[u+2],
|
|
1165
|
+
s3=state[u+3];t=v^s1^s2^s3;state[u+0]=state[u+0]^t^this._mixCol[v^s1];state[u+1]=state[u+1]^t^this._mixCol[s1^s2];state[u+2]=state[u+2]^t^this._mixCol[s2^s3];state[u+3]=state[u+3]^t^this._mixCol[s3^v]}t=0;for(u=16*input;16>t;++t,++u)state[t]^=key[u]}for(input=0;16>input;++input)state[input]=s[state[input]];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];
|
|
1166
|
+
state[3]=state[15];state[7]=v;state[11]=u;state[15]=t;s=0;for(input=this._keySize;16>s;++s,++input)state[s]^=key[input];return state}},{key:"_decryptBlock2",value:function(data,finalize){for(var sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition,result=[],iv=this.iv,i=0;i<sourceLength;++i)if(buffer[bufferLength]=data[i],++bufferLength,!(16>bufferLength)){bufferLength=this._decrypt(buffer,this._key);for(var j=0;16>j;++j)bufferLength[j]^=iv[j];iv=buffer;result.push(bufferLength);
|
|
1167
|
+
buffer=new Uint8Array(16);bufferLength=0}this.buffer=buffer;this.bufferLength=bufferLength;this.iv=iv;if(0===result.length)return new Uint8Array(0);data=16*result.length;if(finalize&&(finalize=result[result.length-1],sourceLength=finalize[15],16>=sourceLength)){buffer=15;for(iv=16-sourceLength;buffer>=iv;--buffer)if(finalize[buffer]!==sourceLength){sourceLength=0;break}data-=sourceLength;result[result.length-1]=finalize.subarray(0,16-sourceLength)}finalize=new Uint8Array(data);sourceLength=data=0;
|
|
1168
|
+
for(buffer=result.length;data<buffer;++data,sourceLength+=16)finalize.set(result[data],sourceLength);return finalize}},{key:"decryptBlock",value:function(data,finalize){var iv=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition;if(iv)this.iv=iv;else{for(iv=0;16>bufferLength&&iv<sourceLength;++iv,++bufferLength)buffer[bufferLength]=data[iv];if(16>bufferLength)return this.bufferLength=bufferLength,new Uint8Array(0);
|
|
1169
|
+
this.iv=buffer;data=data.subarray(16)}this.buffer=new Uint8Array(16);this.bufferLength=0;this.decryptBlock=this._decryptBlock2;return this.decryptBlock(data,finalize)}},{key:"encrypt",value:function(data,iv){var sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition,result=[];iv||(iv=new Uint8Array(16));for(var i=0;i<sourceLength;++i)if(buffer[bufferLength]=data[i],++bufferLength,!(16>bufferLength)){for(bufferLength=0;16>bufferLength;++bufferLength)buffer[bufferLength]^=iv[bufferLength];
|
|
1170
|
+
iv=buffer=this._encrypt(buffer,this._key);result.push(buffer);buffer=new Uint8Array(16);bufferLength=0}this.buffer=buffer;this.bufferLength=bufferLength;this.iv=iv;if(0===result.length)return new Uint8Array(0);data=new Uint8Array(16*result.length);sourceLength=iv=0;for(i=result.length;iv<i;++iv,sourceLength+=16)data.set(result[iv],sourceLength);return data}}]);return AESBaseCipher}();var AES128Cipher=function(_AESBaseCipher){function AES128Cipher(key){_classCallCheck(this,AES128Cipher);var _this=
|
|
1171
|
+
_possibleConstructorReturn(this,_getPrototypeOf(AES128Cipher).call(this));_this._cyclesOfRepetition=10;_this._keySize=160;_this._rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,
|
|
1172
|
+
203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,
|
|
1173
|
+
74,148,51,102,204,131,29,58,116,232,203,141]);_this._key=_this._expandKey(key);return _this}_inherits(AES128Cipher,_AESBaseCipher);_createClass(AES128Cipher,[{key:"_expandKey",value:function(cipherKey){var s=this._s,rcon=this._rcon,result=new Uint8Array(176);result.set(cipherKey);cipherKey=16;for(var i=1;176>cipherKey;++i){var t1=result[cipherKey-3],t2=result[cipherKey-2],t3=result[cipherKey-1],t4=result[cipherKey-4];t1=s[t1];t2=s[t2];t3=s[t3];t4=s[t4];t1^=rcon[i];for(var n=0;4>n;++n)result[cipherKey]=
|
|
1174
|
+
t1^=result[cipherKey-16],cipherKey++,result[cipherKey]=t2^=result[cipherKey-16],cipherKey++,result[cipherKey]=t3^=result[cipherKey-16],cipherKey++,result[cipherKey]=t4^=result[cipherKey-16],cipherKey++}return result}}]);return AES128Cipher}(module);exports.AES128Cipher=AES128Cipher;var AES256Cipher=function(_AESBaseCipher2){function AES256Cipher(key){_classCallCheck(this,AES256Cipher);var _this2=_possibleConstructorReturn(this,_getPrototypeOf(AES256Cipher).call(this));_this2._cyclesOfRepetition=14;
|
|
1175
|
+
_this2._keySize=224;_this2._key=_this2._expandKey(key);return _this2}_inherits(AES256Cipher,_AESBaseCipher2);_createClass(AES256Cipher,[{key:"_expandKey",value:function(cipherKey){var s=this._s,result=new Uint8Array(240);result.set(cipherKey);cipherKey=1;for(var t1,t2,t3,t4,j=32,i=1;240>j;++i){16===j%32?(t1=s[t1],t2=s[t2],t3=s[t3],t4=s[t4]):0===j%32&&(t1=result[j-3],t2=result[j-2],t3=result[j-1],t4=result[j-4],t1=s[t1],t2=s[t2],t3=s[t3],t4=s[t4],t1^=cipherKey,256<=(cipherKey<<=1)&&(cipherKey=(cipherKey^
|
|
1176
|
+
27)&255));for(var n=0;4>n;++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}}]);return AES256Cipher}(module);exports.AES256Cipher=AES256Cipher;var PDF17=function(){function compareByteArrays(array1,array2){if(array1.length!==array2.length)return!1;for(var i=0;i<array1.length;i++)if(array1[i]!==array2[i])return!1;return!0}function PDF17(){}PDF17.prototype={checkOwnerPassword:function(password,ownerValidationSalt,
|
|
1177
|
+
userBytes,ownerPassword){var hashData=new Uint8Array(password.length+56);hashData.set(password,0);hashData.set(ownerValidationSalt,password.length);hashData.set(userBytes,password.length+ownerValidationSalt.length);password=calculateSHA256(hashData,0,hashData.length);return compareByteArrays(password,ownerPassword)},checkUserPassword:function(password,userValidationSalt,userPassword){var hashData=new Uint8Array(password.length+8);hashData.set(password,0);hashData.set(userValidationSalt,password.length);
|
|
1178
|
+
password=calculateSHA256(hashData,0,hashData.length);return compareByteArrays(password,userPassword)},getOwnerKey:function(password,ownerKeySalt,userBytes,ownerEncryption){var hashData=new Uint8Array(password.length+56);hashData.set(password,0);hashData.set(ownerKeySalt,password.length);hashData.set(userBytes,password.length+ownerKeySalt.length);password=calculateSHA256(hashData,0,hashData.length);return(new AES256Cipher(password)).decryptBlock(ownerEncryption,!1,new Uint8Array(16))},getUserKey:function(password,
|
|
1179
|
+
userKeySalt,userEncryption){var hashData=new Uint8Array(password.length+8);hashData.set(password,0);hashData.set(userKeySalt,password.length);password=calculateSHA256(hashData,0,hashData.length);return(new AES256Cipher(password)).decryptBlock(userEncryption,!1,new Uint8Array(16))}};return PDF17}();exports.PDF17=PDF17;var PDF20=function(){function concatArrays(array1,array2){var t=new Uint8Array(array1.length+array2.length);t.set(array1,0);t.set(array2,array1.length);return t}function calculatePDF20Hash(password,
|
|
1180
|
+
input,userBytes){input=calculateSHA256(input,0,input.length).subarray(0,32);for(var e=[0],i=0;64>i||e[e.length-1]>i-32;){e=password.length+input.length+userBytes.length;var k1=new Uint8Array(64*e),array=concatArrays(password,input);array=concatArrays(array,userBytes);for(var j=0,pos=0;64>j;j++,pos+=e)k1.set(array,pos);e=(new AES128Cipher(input.subarray(0,16))).encrypt(k1,input.subarray(16,32));for(array=k1=0;16>array;array++)k1*=1,k1%=3,k1+=(e[array]>>>0)%3,k1%=3;0===k1?input=calculateSHA256(e,0,
|
|
1181
|
+
e.length):1===k1?input=calculateSHA384(e,0,e.length):2===k1&&(input=calculateSHA512(e,0,e.length));i++}return input.subarray(0,32)}function PDF20(){}function compareByteArrays(array1,array2){if(array1.length!==array2.length)return!1;for(var i=0;i<array1.length;i++)if(array1[i]!==array2[i])return!1;return!0}PDF20.prototype={hash:function(password,concatBytes,userBytes){return calculatePDF20Hash(password,concatBytes,userBytes)},checkOwnerPassword:function(password,ownerValidationSalt,userBytes,ownerPassword){var hashData=
|
|
1182
|
+
new Uint8Array(password.length+56);hashData.set(password,0);hashData.set(ownerValidationSalt,password.length);hashData.set(userBytes,password.length+ownerValidationSalt.length);password=calculatePDF20Hash(password,hashData,userBytes);return compareByteArrays(password,ownerPassword)},checkUserPassword:function(password,userValidationSalt,userPassword){var hashData=new Uint8Array(password.length+8);hashData.set(password,0);hashData.set(userValidationSalt,password.length);password=calculatePDF20Hash(password,
|
|
1183
|
+
hashData,[]);return compareByteArrays(password,userPassword)},getOwnerKey:function(password,ownerKeySalt,userBytes,ownerEncryption){var hashData=new Uint8Array(password.length+56);hashData.set(password,0);hashData.set(ownerKeySalt,password.length);hashData.set(userBytes,password.length+ownerKeySalt.length);password=calculatePDF20Hash(password,hashData,userBytes);return(new AES256Cipher(password)).decryptBlock(ownerEncryption,!1,new Uint8Array(16))},getUserKey:function(password,userKeySalt,userEncryption){var hashData=
|
|
1184
|
+
new Uint8Array(password.length+8);hashData.set(password,0);hashData.set(userKeySalt,password.length);password=calculatePDF20Hash(password,hashData,[]);return(new AES256Cipher(password)).decryptBlock(userEncryption,!1,new Uint8Array(16))}};return PDF20}();exports.PDF20=PDF20;var CipherTransform=function(){function CipherTransform(stringCipherConstructor,streamCipherConstructor){this.StringCipherConstructor=stringCipherConstructor;this.StreamCipherConstructor=streamCipherConstructor}CipherTransform.prototype=
|
|
1185
|
+
{createStream:function(stream,length){var cipher=new this.StreamCipherConstructor;return new _stream.DecryptStream(stream,length,function(data,finalize){return cipher.decryptBlock(data,finalize)})},decryptString:function(s){var cipher=new this.StringCipherConstructor;s=(0,_util.stringToBytes)(s);s=cipher.decryptBlock(s,!0);return(0,_util.bytesToString)(s)}};return CipherTransform}();module=function(){function prepareKeyData(fileId,password,ownerPassword,userPassword,flags,revision,keyLength,encryptMetadata){var hashData=
|
|
1186
|
+
new Uint8Array(40+ownerPassword.length+fileId.length),i=0,n;if(password)for(n=Math.min(32,password.length);i<n;++i)hashData[i]=password[i];for(password=0;32>i;)hashData[i++]=defaultPasswordBytes[password++];password=0;for(n=ownerPassword.length;password<n;++password)hashData[i++]=ownerPassword[password];hashData[i++]=flags&255;hashData[i++]=flags>>8&255;hashData[i++]=flags>>16&255;hashData[i++]=flags>>>24&255;password=0;for(n=fileId.length;password<n;++password)hashData[i++]=fileId[password];4<=revision&&
|
|
1187
|
+
!encryptMetadata&&(hashData[i++]=255,hashData[i++]=255,hashData[i++]=255,hashData[i++]=255);n=calculateMD5(hashData,0,i);i=keyLength>>3;if(3<=revision)for(password=0;50>password;++password)n=calculateMD5(n,0,i);keyLength=n.subarray(0,i);if(3<=revision){for(i=0;32>i;++i)hashData[i]=defaultPasswordBytes[i];password=0;for(n=fileId.length;password<n;++password)hashData[i++]=fileId[password];fileId=new ARCFourCipher(keyLength);hashData=fileId.encryptBlock(calculateMD5(hashData,0,i));n=keyLength.length;
|
|
1188
|
+
revision=new Uint8Array(n);for(password=1;19>=password;++password){for(fileId=0;fileId<n;++fileId)revision[fileId]=keyLength[fileId]^password;fileId=new ARCFourCipher(revision);hashData=fileId.encryptBlock(hashData)}}else fileId=new ARCFourCipher(keyLength),hashData=fileId.encryptBlock(defaultPasswordBytes);password=0;for(n=hashData.length;password<n;++password)if(userPassword[password]!==hashData[password])return null;return keyLength}function CipherTransformFactory(dict,fileId,password$jscomp$0){var filter=
|
|
1189
|
+
dict.get("Filter");if(!(0,_primitives.isName)(filter,"Standard"))throw new _util.FormatError("unknown encryption method");this.dict=dict;filter=dict.get("V");if(!Number.isInteger(filter)||1!==filter&&2!==filter&&4!==filter&&5!==filter)throw new _util.FormatError("unsupported encryption algorithm");this.algorithm=filter;var keyLength=dict.get("Length");if(!keyLength)if(3>=filter)keyLength=40;else{var cfDict=dict.get("CF"),streamCryptoName=dict.get("StmF");(0,_primitives.isDict)(cfDict)&&(0,_primitives.isName)(streamCryptoName)&&
|
|
1190
|
+
(cfDict.suppressEncryption=!0,keyLength=(keyLength=cfDict.get(streamCryptoName.name))&&keyLength.get("Length")||128,40>keyLength&&(keyLength<<=3))}if(!Number.isInteger(keyLength)||40>keyLength||0!==keyLength%8)throw new _util.FormatError("invalid key length");cfDict=(0,_util.stringToBytes)(dict.get("O")).subarray(0,32);streamCryptoName=(0,_util.stringToBytes)(dict.get("U")).subarray(0,32);var flags=dict.get("P"),revision=dict.get("R"),encryptMetadata=(4===filter||5===filter)&&!1!==dict.get("EncryptMetadata");
|
|
1191
|
+
this.encryptMetadata=encryptMetadata;fileId=(0,_util.stringToBytes)(fileId);if(password$jscomp$0){if(6===revision)try{password$jscomp$0=(0,_util.utf8StringToString)(password$jscomp$0)}catch(ex){(0,_util.warn)("CipherTransformFactory: Unable to convert UTF8 encoded password.")}var passwordBytes=(0,_util.stringToBytes)(password$jscomp$0)}if(5!==filter)var encryptionKey=prepareKeyData(fileId,passwordBytes,cfDict,streamCryptoName,flags,revision,keyLength,encryptMetadata);else{encryptionKey=(0,_util.stringToBytes)(dict.get("O")).subarray(32,
|
|
1192
|
+
40);var ownerKeySalt=(0,_util.stringToBytes)(dict.get("O")).subarray(40,48),uBytes=(0,_util.stringToBytes)(dict.get("U")).subarray(0,48),userValidationSalt=(0,_util.stringToBytes)(dict.get("U")).subarray(32,40),userKeySalt=(0,_util.stringToBytes)(dict.get("U")).subarray(40,48),ownerEncryption=(0,_util.stringToBytes)(dict.get("OE")),userEncryption=(0,_util.stringToBytes)(dict.get("UE"));(0,_util.stringToBytes)(dict.get("Perms"));var password=passwordBytes;password=password?password.subarray(0,Math.min(127,
|
|
1193
|
+
password.length)):[];var pdfAlgorithm=6===revision?new PDF20:new PDF17;encryptionKey=pdfAlgorithm.checkUserPassword(password,userValidationSalt,streamCryptoName)?pdfAlgorithm.getUserKey(password,userKeySalt,userEncryption):password.length&&pdfAlgorithm.checkOwnerPassword(password,encryptionKey,uBytes,cfDict)?pdfAlgorithm.getOwnerKey(password,ownerKeySalt,uBytes,ownerEncryption):null}if(!encryptionKey&&!password$jscomp$0)throw new _util.PasswordException("No password given",_util.PasswordResponses.NEED_PASSWORD);
|
|
1194
|
+
if(!encryptionKey&&password$jscomp$0){password$jscomp$0=passwordBytes;encryptionKey=keyLength;passwordBytes=new Uint8Array(32);ownerKeySalt=0;for(uBytes=Math.min(32,password$jscomp$0.length);ownerKeySalt<uBytes;++ownerKeySalt)passwordBytes[ownerKeySalt]=password$jscomp$0[ownerKeySalt];for(password$jscomp$0=0;32>ownerKeySalt;)passwordBytes[ownerKeySalt++]=defaultPasswordBytes[password$jscomp$0++];passwordBytes=calculateMD5(passwordBytes,0,ownerKeySalt);encryptionKey>>=3;if(3<=revision)for(password$jscomp$0=
|
|
1195
|
+
0;50>password$jscomp$0;++password$jscomp$0)passwordBytes=calculateMD5(passwordBytes,0,passwordBytes.length);if(3<=revision)for(ownerKeySalt=cfDict,uBytes=new Uint8Array(encryptionKey),password$jscomp$0=19;0<=password$jscomp$0;password$jscomp$0--){for(userValidationSalt=0;userValidationSalt<encryptionKey;++userValidationSalt)uBytes[userValidationSalt]=passwordBytes[userValidationSalt]^password$jscomp$0;userValidationSalt=new ARCFourCipher(uBytes);ownerKeySalt=userValidationSalt.encryptBlock(ownerKeySalt)}else userValidationSalt=
|
|
1196
|
+
new ARCFourCipher(passwordBytes.subarray(0,encryptionKey)),ownerKeySalt=userValidationSalt.encryptBlock(cfDict);encryptionKey=prepareKeyData(fileId,ownerKeySalt,cfDict,streamCryptoName,flags,revision,keyLength,encryptMetadata)}if(!encryptionKey)throw new _util.PasswordException("Incorrect Password",_util.PasswordResponses.INCORRECT_PASSWORD);this.encryptionKey=encryptionKey;4<=filter&&(filter=dict.get("CF"),(0,_primitives.isDict)(filter)&&(filter.suppressEncryption=!0),this.cf=filter,this.stmf=dict.get("StmF")||
|
|
1197
|
+
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),n;var i=0;for(n=encryptionKey.length;i<n;++i)key[i]=encryptionKey[i];key[i++]=num&255;key[i++]=num>>8&255;key[i++]=num>>16&255;key[i++]=gen&255;key[i++]=gen>>8&255;isAes&&(key[i++]=115,key[i++]=65,key[i++]=108,key[i++]=84);return calculateMD5(key,0,i).subarray(0,Math.min(encryptionKey.length+5,16))}function buildCipherConstructor(cf,
|
|
1198
|
+
name,num,gen,key){if(!(0,_primitives.isName)(name))throw new _util.FormatError("Invalid crypt filter name.");cf=cf.get(name.name);var cfm;null!==cf&&void 0!==cf&&(cfm=cf.get("CFM"));if(!cfm||"None"===cfm.name)return function(){return new NullCipher};if("V2"===cfm.name)return function(){return new ARCFourCipher(buildObjectKey(num,gen,key,!1))};if("AESV2"===cfm.name)return function(){return new AES128Cipher(buildObjectKey(num,gen,key,!0))};if("AESV3"===cfm.name)return function(){return new AES256Cipher(key)};
|
|
1199
|
+
throw new _util.FormatError("Unknown crypto method");}var defaultPasswordBytes=new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]),identityName=_primitives.Name.get("Identity");CipherTransformFactory.prototype={createCipherTransform:function(num,gen){if(4===this.algorithm||5===this.algorithm)return new CipherTransform(buildCipherConstructor(this.cf,this.stmf,num,gen,this.encryptionKey),buildCipherConstructor(this.cf,this.strf,
|
|
1200
|
+
num,gen,this.encryptionKey));var key=buildObjectKey(num,gen,this.encryptionKey,!1);num=function(){return new ARCFourCipher(key)};return new CipherTransform(num,num)}};return CipherTransformFactory}();exports.CipherTransformFactory=module},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&
|
|
1201
|
+
obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"===typeof call))return call;if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}
|
|
1202
|
+
function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,
|
|
1203
|
+
p$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&
|
|
1204
|
+
_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.ColorSpace=void 0;var _util=__w_pdfjs_require__(5),_primitives=__w_pdfjs_require__(188),ColorSpace=function(){function ColorSpace(name,numComps){_classCallCheck(this,ColorSpace);this.constructor===ColorSpace&&(0,_util.unreachable)("Cannot initialize ColorSpace.");this.name=name;this.numComps=numComps}_createClass(ColorSpace,
|
|
1205
|
+
[{key:"getRgb",value:function(src,srcOffset){var rgb=new Uint8ClampedArray(3);this.getRgbItem(src,srcOffset,rgb,0);return rgb}},{key:"getRgbItem",value:function(src,srcOffset,dest,destOffset){(0,_util.unreachable)("Should not call ColorSpace.getRgbItem")}},{key:"getRgbBuffer",value:function(src,srcOffset,count,dest,destOffset,bits,alpha01){(0,_util.unreachable)("Should not call ColorSpace.getRgbBuffer")}},{key:"getOutputLength",value:function(inputLength,alpha01){(0,_util.unreachable)("Should not call ColorSpace.getOutputLength")}},
|
|
1206
|
+
{key:"isPassthrough",value:function(bits){return!1}},{key:"isDefaultDecode",value:function(decodeMap,bpc){return ColorSpace.isDefaultDecode(decodeMap,this.numComps)}},{key:"fillRgb",value:function(dest,originalWidth,originalHeight,width,height,actualHeight,bpc,comps,alpha01){var count=originalWidth*originalHeight,rgbBuf=null,numComponentColors=1<<bpc,needsResizing=originalHeight!==height||originalWidth!==width;if(this.isPassthrough(bpc))rgbBuf=comps;else if(1===this.numComps&&count>numComponentColors&&
|
|
1207
|
+
"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){for(var allColors=8>=bpc?new Uint8Array(numComponentColors):new Uint16Array(numComponentColors),i=0;i<numComponentColors;i++)allColors[i]=i;i=new Uint8ClampedArray(3*numComponentColors);this.getRgbBuffer(allColors,0,numComponentColors,i,0,bpc,0);if(needsResizing)for(rgbBuf=new Uint8Array(3*count),numComponentColors=bpc=0;numComponentColors<count;++numComponentColors)allColors=3*comps[numComponentColors],rgbBuf[bpc++]=i[allColors],rgbBuf[bpc++]=i[allColors+
|
|
1208
|
+
1],rgbBuf[bpc++]=i[allColors+2];else for(numComponentColors=bpc=0;numComponentColors<count;++numComponentColors)allColors=3*comps[numComponentColors],dest[bpc++]=i[allColors],dest[bpc++]=i[allColors+1],dest[bpc++]=i[allColors+2],bpc+=alpha01}else needsResizing?(rgbBuf=new Uint8ClampedArray(3*count),this.getRgbBuffer(comps,0,count,rgbBuf,0,bpc,0)):this.getRgbBuffer(comps,0,width*actualHeight,dest,0,bpc,alpha01);if(rgbBuf)if(needsResizing){alpha01=1!==alpha01?0:alpha01;count=originalWidth/width;originalHeight/=
|
|
1209
|
+
height;actualHeight=0;comps=new Uint16Array(width);originalWidth*=3;for(needsResizing=0;needsResizing<width;needsResizing++)comps[needsResizing]=3*Math.floor(needsResizing*count);for(needsResizing=0;needsResizing<height;needsResizing++)for(i=Math.floor(needsResizing*originalHeight)*originalWidth,bpc=0;bpc<width;bpc++)count=i+comps[bpc],dest[actualHeight++]=rgbBuf[count++],dest[actualHeight++]=rgbBuf[count++],dest[actualHeight++]=rgbBuf[count++],actualHeight+=alpha01}else for(originalHeight=originalWidth=
|
|
1210
|
+
height=0,width*=actualHeight;originalHeight<width;originalHeight++)dest[height++]=rgbBuf[originalWidth++],dest[height++]=rgbBuf[originalWidth++],dest[height++]=rgbBuf[originalWidth++],height+=alpha01}},{key:"usesZeroToOneRange",get:function(){return(0,_util.shadow)(this,"usesZeroToOneRange",!0)}}],[{key:"parse",value:function(cs,xref,res,pdfFunctionFactory){cs=this.parseToIR(cs,xref,res,pdfFunctionFactory);return this.fromIR(cs)}},{key:"fromIR",value:function(IR){var name=Array.isArray(IR)?IR[0]:
|
|
1211
|
+
IR;switch(name){case "DeviceGrayCS":return this.singletons.gray;case "DeviceRgbCS":return this.singletons.rgb;case "DeviceCmykCS":return this.singletons.cmyk;case "CalGrayCS":name=IR[1];var blackPoint=IR[2];var gamma=IR[3];return new CalGrayCS(name,blackPoint,gamma);case "CalRGBCS":return name=IR[1],blackPoint=IR[2],gamma=IR[3],new CalRGBCS(name,blackPoint,gamma,IR[4]);case "PatternCS":return(IR=IR[1])&&(IR=this.fromIR(IR)),new PatternCS(IR);case "IndexedCS":return name=IR[2],blackPoint=IR[3],new IndexedCS(this.fromIR(IR[1]),
|
|
1212
|
+
name,blackPoint);case "AlternateCS":return name=IR[3],new AlternateCS(IR[1],this.fromIR(IR[2]),name);case "LabCS":return name=IR[1],blackPoint=IR[2],new LabCS(name,blackPoint,IR[3]);default:throw new _util.FormatError("Unknown colorspace name: ".concat(name));}}},{key:"parseToIR",value:function(cs,xref){var res=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,pdfFunctionFactory=3<arguments.length?arguments[3]:void 0;cs=xref.fetchIfRef(cs);if((0,_primitives.isName)(cs))switch(cs.name){case "DeviceGray":case "G":return"DeviceGrayCS";
|
|
1213
|
+
case "DeviceRGB":case "RGB":return"DeviceRgbCS";case "DeviceCMYK":case "CMYK":return"DeviceCmykCS";case "Pattern":return["PatternCS",null];default:if((0,_primitives.isDict)(res)){var colorSpaces=res.get("ColorSpace");if((0,_primitives.isDict)(colorSpaces)&&(colorSpaces=colorSpaces.get(cs.name))){if((0,_primitives.isName)(colorSpaces))return this.parseToIR(colorSpaces,xref,res,pdfFunctionFactory);cs=colorSpaces;break}}throw new _util.FormatError("unrecognized colorspace ".concat(cs.name));}if(Array.isArray(cs))switch(colorSpaces=
|
|
1214
|
+
xref.fetchIfRef(cs[0]).name,colorSpaces){case "DeviceGray":case "G":return"DeviceGrayCS";case "DeviceRGB":case "RGB":return"DeviceRgbCS";case "DeviceCMYK":case "CMYK":return"DeviceCmykCS";case "CalGray":var params=xref.fetchIfRef(cs[1]);pdfFunctionFactory=params.getArray("WhitePoint");res=params.getArray("BlackPoint");colorSpaces=params.get("Gamma");return["CalGrayCS",pdfFunctionFactory,res,colorSpaces];case "CalRGB":return params=xref.fetchIfRef(cs[1]),pdfFunctionFactory=params.getArray("WhitePoint"),
|
|
1215
|
+
res=params.getArray("BlackPoint"),colorSpaces=params.getArray("Gamma"),params=params.getArray("Matrix"),["CalRGBCS",pdfFunctionFactory,res,colorSpaces,params];case "ICCBased":params=xref.fetchIfRef(cs[1]).dict;colorSpaces=params.get("N");if(params=params.get("Alternate")){res=this.parseToIR(params,xref,res,pdfFunctionFactory);if(this.fromIR(res,pdfFunctionFactory).numComps===colorSpaces)return res;(0,_util.warn)("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===colorSpaces)return"DeviceGrayCS";
|
|
1216
|
+
if(3===colorSpaces)return"DeviceRgbCS";if(4===colorSpaces)return"DeviceCmykCS";break;case "Pattern":return(colorSpaces=cs[1]||null)&&(colorSpaces=this.parseToIR(colorSpaces,xref,res,pdfFunctionFactory)),["PatternCS",colorSpaces];case "Indexed":case "I":return pdfFunctionFactory=this.parseToIR(cs[1],xref,res,pdfFunctionFactory),res=xref.fetchIfRef(cs[2])+1,colorSpaces=xref.fetchIfRef(cs[3]),(0,_primitives.isStream)(colorSpaces)&&(colorSpaces=colorSpaces.getBytes()),["IndexedCS",pdfFunctionFactory,
|
|
1217
|
+
res,colorSpaces];case "Separation":case "DeviceN":return colorSpaces=xref.fetchIfRef(cs[1]),colorSpaces=Array.isArray(colorSpaces)?colorSpaces.length:1,params=this.parseToIR(cs[2],xref,res,pdfFunctionFactory),pdfFunctionFactory=pdfFunctionFactory.create(xref.fetchIfRef(cs[3])),["AlternateCS",colorSpaces,params,pdfFunctionFactory];case "Lab":return params=xref.fetchIfRef(cs[1]),pdfFunctionFactory=params.getArray("WhitePoint"),res=params.getArray("BlackPoint"),colorSpaces=params.getArray("Range"),["LabCS",
|
|
1218
|
+
pdfFunctionFactory,res,colorSpaces];default:throw new _util.FormatError('unimplemented color space object "'.concat(colorSpaces,'"'));}throw new _util.FormatError('unrecognized color space object: "'.concat(cs,'"'));}},{key:"isDefaultDecode",value:function(decode,numComps){if(!Array.isArray(decode))return!0;if(2*numComps!==decode.length)return(0,_util.warn)("The decode map is not the correct length"),!0;numComps=0;for(var ii=decode.length;numComps<ii;numComps+=2)if(0!==decode[numComps]||1!==decode[numComps+
|
|
1219
|
+
1])return!1;return!0}},{key:"singletons",get:function(){return(0,_util.shadow)(this,"singletons",{get gray(){return(0,_util.shadow)(this,"gray",new DeviceGrayCS)},get rgb(){return(0,_util.shadow)(this,"rgb",new DeviceRgbCS)},get cmyk(){return(0,_util.shadow)(this,"cmyk",new DeviceCmykCS)}})}}]);return ColorSpace}();exports.ColorSpace=ColorSpace;var AlternateCS=function(_ColorSpace){function AlternateCS(numComps,base,tintFn){_classCallCheck(this,AlternateCS);numComps=_possibleConstructorReturn(this,
|
|
1220
|
+
_getPrototypeOf(AlternateCS).call(this,"Alternate",numComps));numComps.base=base;numComps.tintFn=tintFn;numComps.tmpBuf=new Float32Array(base.numComps);return numComps}_inherits(AlternateCS,_ColorSpace);_createClass(AlternateCS,[{key:"getRgbItem",value:function(src,srcOffset,dest,destOffset){var tmpBuf=this.tmpBuf;this.tintFn(src,srcOffset,tmpBuf,0);this.base.getRgbItem(tmpBuf,0,dest,destOffset)}},{key:"getRgbBuffer",value:function(src,srcOffset,count,dest,destOffset,bits,alpha01){var tintFn=this.tintFn,
|
|
1221
|
+
base=this.base;bits=1/((1<<bits)-1);var baseNumComps=base.numComps,usesZeroToOneRange=base.usesZeroToOneRange,isPassthrough=(base.isPassthrough(8)||!usesZeroToOneRange)&&0===alpha01,pos=isPassthrough?destOffset:0,baseBuf=isPassthrough?dest:new Uint8ClampedArray(baseNumComps*count),numComps=this.numComps,scaled=new Float32Array(numComps),tinted=new Float32Array(baseNumComps),i,j;for(i=0;i<count;i++){for(j=0;j<numComps;j++)scaled[j]=src[srcOffset++]*bits;tintFn(scaled,0,tinted,0);if(usesZeroToOneRange)for(j=
|
|
1222
|
+
0;j<baseNumComps;j++)baseBuf[pos++]=255*tinted[j];else base.getRgbItem(tinted,0,baseBuf,pos),pos+=baseNumComps}isPassthrough||base.getRgbBuffer(baseBuf,0,count,dest,destOffset,8,alpha01)}},{key:"getOutputLength",value:function(inputLength,alpha01){return this.base.getOutputLength(inputLength*this.base.numComps/this.numComps,alpha01)}}]);return AlternateCS}(ColorSpace),PatternCS=function(_ColorSpace2){function PatternCS(baseCS){_classCallCheck(this,PatternCS);var _this2=_possibleConstructorReturn(this,
|
|
1223
|
+
_getPrototypeOf(PatternCS).call(this,"Pattern",null));_this2.base=baseCS;return _this2}_inherits(PatternCS,_ColorSpace2);_createClass(PatternCS,[{key:"isDefaultDecode",value:function(decodeMap,bpc){(0,_util.unreachable)("Should not call PatternCS.isDefaultDecode")}}]);return PatternCS}(ColorSpace),IndexedCS=function(_ColorSpace3){function IndexedCS(base,highVal,lookup){_classCallCheck(this,IndexedCS);var _this3=_possibleConstructorReturn(this,_getPrototypeOf(IndexedCS).call(this,"Indexed",1));_this3.base=
|
|
1224
|
+
base;_this3.highVal=highVal;base=base.numComps*highVal;if((0,_primitives.isStream)(lookup))_this3.lookup=new Uint8Array(base),lookup=lookup.getBytes(base),_this3.lookup.set(lookup);else if((0,_util.isString)(lookup))for(_this3.lookup=new Uint8Array(base),highVal=0;highVal<base;++highVal)_this3.lookup[highVal]=lookup.charCodeAt(highVal);else if(lookup instanceof Uint8Array)_this3.lookup=lookup;else throw new _util.FormatError("Unrecognized lookup table: ".concat(lookup));return _this3}_inherits(IndexedCS,
|
|
1225
|
+
_ColorSpace3);_createClass(IndexedCS,[{key:"getRgbItem",value:function(src,srcOffset,dest,destOffset){this.base.getRgbBuffer(this.lookup,src[srcOffset]*this.base.numComps,1,dest,destOffset,8,0)}},{key:"getRgbBuffer",value:function(src,srcOffset,count,dest,destOffset,bits,alpha01){bits=this.base;for(var numComps=bits.numComps,outputDelta=bits.getOutputLength(numComps,alpha01),lookup=this.lookup,i=0;i<count;++i){var lookupPos=src[srcOffset++]*numComps;bits.getRgbBuffer(lookup,lookupPos,1,dest,destOffset,
|
|
1226
|
+
8,alpha01);destOffset+=outputDelta}}},{key:"getOutputLength",value:function(inputLength,alpha01){return this.base.getOutputLength(inputLength*this.base.numComps,alpha01)}},{key:"isDefaultDecode",value:function(decodeMap,bpc){return Array.isArray(decodeMap)?2!==decodeMap.length?((0,_util.warn)("Decode map length is not correct"),!0):!Number.isInteger(bpc)||1>bpc?((0,_util.warn)("Bits per component is not correct"),!0):0===decodeMap[0]&&decodeMap[1]===(1<<bpc)-1:!0}}]);return IndexedCS}(ColorSpace),
|
|
1215
1227
|
DeviceGrayCS=function(_ColorSpace4){function DeviceGrayCS(){_classCallCheck(this,DeviceGrayCS);return _possibleConstructorReturn(this,_getPrototypeOf(DeviceGrayCS).call(this,"DeviceGray",1))}_inherits(DeviceGrayCS,_ColorSpace4);_createClass(DeviceGrayCS,[{key:"getRgbItem",value:function(src,srcOffset,dest,destOffset){dest[destOffset]=dest[destOffset+1]=dest[destOffset+2]=255*src[srcOffset]}},{key:"getRgbBuffer",value:function(src,srcOffset,count,dest,destOffset,bits,alpha01){bits=255/((1<<bits)-1);
|
|
1216
1228
|
for(var i=0;i<count;++i){var c=bits*src[srcOffset++];dest[destOffset++]=c;dest[destOffset++]=c;dest[destOffset++]=c;destOffset+=alpha01}}},{key:"getOutputLength",value:function(inputLength,alpha01){return inputLength*(3+alpha01)}}]);return DeviceGrayCS}(ColorSpace),DeviceRgbCS=function(_ColorSpace5){function DeviceRgbCS(){_classCallCheck(this,DeviceRgbCS);return _possibleConstructorReturn(this,_getPrototypeOf(DeviceRgbCS).call(this,"DeviceRGB",3))}_inherits(DeviceRgbCS,_ColorSpace5);_createClass(DeviceRgbCS,
|
|
1217
1229
|
[{key:"getRgbItem",value:function(src,srcOffset,dest,destOffset){dest[destOffset]=255*src[srcOffset];dest[destOffset+1]=255*src[srcOffset+1];dest[destOffset+2]=255*src[srcOffset+2]}},{key:"getRgbBuffer",value:function(src,srcOffset,count,dest,destOffset,bits,alpha01){if(8===bits&&0===alpha01)dest.set(src.subarray(srcOffset,srcOffset+3*count),destOffset);else{bits=255/((1<<bits)-1);for(var i=0;i<count;++i)dest[destOffset++]=bits*src[srcOffset++],dest[destOffset++]=bits*src[srcOffset++],dest[destOffset++]=
|
|
@@ -1259,21 +1271,21 @@ appearanceStates.get("N"),(0,_primitives.isStream)(appearanceStates)?this.appear
|
|
|
1259
1271
|
{key:"getOperatorList",value:function(evaluator,task,renderForms){var _this=this;if(!this.appearance)return Promise.resolve(new _operator_list.OperatorList);renderForms=this.data.pushButton;var forceRender=global$jscomp$0.renderFormFields;if(!(this.data.forceRender||forceRender||renderForms||"Widget"!==this.data.subtype&&"Link"!==this.data.subtype))return Promise.resolve(new _operator_list.OperatorList);this.data.forceRender&&(this.data.blockRender=!0);var data=this.data;renderForms=this.appearance.dict;
|
|
1260
1272
|
forceRender=this.loadResources("ExtGState ColorSpace Pattern Shading XObject Font".split(" "));var bbox=renderForms.getArray("BBox")||[0,0,1,1],matrix=renderForms.getArray("Matrix")||[1,0,0,1,0,0],transform=getTransformMatrix(data.rect,bbox,matrix);return forceRender.then(function(resources){var opList=new _operator_list.OperatorList;opList.addOp(_util.OPS.beginAnnotation,[data.rect,transform,matrix]);return evaluator.getOperatorList({stream:_this.appearance,task:task,resources:resources,operatorList:opList}).then(function(){opList.addOp(_util.OPS.endAnnotation,
|
|
1261
1273
|
[]);_this.appearance.reset();return opList})})}},{key:"viewable",get:function(){return 0===this.flags?!0:this._isViewable(this.flags)}},{key:"printable",get:function(){return 0===this.flags?!1:this._isPrintable(this.flags)}}]);return Annotation}();exports.Annotation=Annotation;var AnnotationBorderStyle=function(){function AnnotationBorderStyle(){_classCallCheck(this,AnnotationBorderStyle);this.width=1;this.style=_util.AnnotationBorderStyleType.SOLID;this.dashArray=[3];this.verticalCornerRadius=this.horizontalCornerRadius=
|
|
1262
|
-
0}_createClass(AnnotationBorderStyle,[{key:"setWidth",value:function(width){var rect=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[0,0,0,0];if((0,_primitives.isName)(width))this.width=0;else if(Number.isInteger(width)){if(0<width){var maxWidth=(rect[2]-rect[0])/2;rect=(rect[3]-rect[1])/2;0<maxWidth&&0<rect&&(width>maxWidth||width>rect)&&((0,_util.warn)("AnnotationBorderStyle.setWidth - ignoring width: ".concat(width)),width=1)}this.width=width}}},{key:"setStyle",value:function(style){if((0,
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1274
|
+
0}_createClass(AnnotationBorderStyle,[{key:"setWidth",value:function(width){var rect=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[0,0,0,0];if((0,_primitives.isName)(width))this.width=0;else if(Number.isInteger(width)){if(0<width){var maxWidth=(rect[2]-rect[0])/2;rect=(rect[3]-rect[1])/2;0<maxWidth&&0<rect&&(width>maxWidth||width>rect)&&((0,_util.warn)("AnnotationBorderStyle.setWidth - ignoring width: ".concat(width)),width=1)}this.width=width}}},{key:"setStyle",value:function(style){if((0,_primitives.isName)(style))switch(style.name){case "S":this.style=
|
|
1275
|
+
_util.AnnotationBorderStyleType.SOLID;break;case "D":this.style=_util.AnnotationBorderStyleType.DASHED;break;case "B":this.style=_util.AnnotationBorderStyleType.BEVELED;break;case "I":this.style=_util.AnnotationBorderStyleType.INSET;break;case "U":this.style=_util.AnnotationBorderStyleType.UNDERLINE}}},{key:"setDashArray",value:function(dashArray){if(Array.isArray(dashArray)&&0<dashArray.length){var isValid=!0,allZeros=!0,_iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _iterator=
|
|
1276
|
+
dashArray[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var element=_step.value;if(0<=+element)0<element&&(allZeros=!1);else{isValid=!1;break}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&null!=_iterator["return"])_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}isValid&&!allZeros?this.dashArray=dashArray:this.width=0}else dashArray&&(this.width=0)}},{key:"setHorizontalCornerRadius",
|
|
1277
|
+
value:function(radius){Number.isInteger(radius)&&(this.horizontalCornerRadius=radius)}},{key:"setVerticalCornerRadius",value:function(radius){Number.isInteger(radius)&&(this.verticalCornerRadius=radius)}}]);return AnnotationBorderStyle}();exports.AnnotationBorderStyle=AnnotationBorderStyle;module=function(_Annotation){function MarkupAnnotation(parameters){_classCallCheck(this,MarkupAnnotation);var _this2=_possibleConstructorReturn(this,_getPrototypeOf(MarkupAnnotation).call(this,parameters));parameters=
|
|
1278
|
+
parameters.dict;if(parameters.has("IRT")){var rawIRT=parameters.getRaw("IRT");_this2.data.inReplyTo=(0,_primitives.isRef)(rawIRT)?rawIRT.toString():null;rawIRT=parameters.get("RT");_this2.data.replyType=(0,_primitives.isName)(rawIRT)?rawIRT.name:_util.AnnotationReplyType.REPLY}_this2.data.replyType===_util.AnnotationReplyType.GROUP?(parameters=parameters.get("IRT"),_this2.data.title=(0,_util.stringToPDFString)(parameters.get("T")||""),_this2.setContents(parameters.get("Contents")),_this2.data.contents=
|
|
1279
|
+
_this2.contents,parameters.has("CreationDate")?(_this2.setCreationDate(parameters.get("CreationDate")),_this2.data.creationDate=_this2.creationDate):_this2.data.creationDate=null,parameters.has("M")?(_this2.setModificationDate(parameters.get("M")),_this2.data.modificationDate=_this2.modificationDate):_this2.data.modificationDate=null,_this2.data.hasPopup=parameters.has("Popup"),parameters.has("C")?(_this2.setColor(parameters.getArray("C")),_this2.data.color=_this2.color):_this2.data.color=null):(_this2.data.title=
|
|
1280
|
+
(0,_util.stringToPDFString)(parameters.get("T")||""),_this2.setCreationDate(parameters.get("CreationDate")),_this2.data.creationDate=_this2.creationDate,_this2.data.hasPopup=parameters.has("Popup"),parameters.has("C")||(_this2.data.color=null));return _this2}_inherits(MarkupAnnotation,_Annotation);_createClass(MarkupAnnotation,[{key:"setCreationDate",value:function(creationDate){this.creationDate=(0,_util.isString)(creationDate)?creationDate:null}}]);return MarkupAnnotation}(Annotation);exports.MarkupAnnotation=
|
|
1281
|
+
module;var WidgetAnnotation=function(_Annotation2){function WidgetAnnotation(params){_classCallCheck(this,WidgetAnnotation);var _this3=_possibleConstructorReturn(this,_getPrototypeOf(WidgetAnnotation).call(this,params));var dict=params.dict,data=_this3.data;data.annotationType=_util.AnnotationType.WIDGET;data.fieldName=_this3._constructFieldName(dict);data.fieldValue=(0,_core_utils.getInheritableProperty)({dict:dict,key:"V",getArray:!0});data.alternativeText=(0,_util.stringToPDFString)(dict.get("TU")||
|
|
1282
|
+
"");data.defaultAppearance=(0,_core_utils.getInheritableProperty)({dict:dict,key:"DA"})||"";var fieldType=(0,_core_utils.getInheritableProperty)({dict:dict,key:"FT"});data.fieldType=(0,_primitives.isName)(fieldType)?fieldType.name:null;_this3.fieldResources=(0,_core_utils.getInheritableProperty)({dict:dict,key:"DR"})||_primitives.Dict.empty;data.fieldFlags=(0,_core_utils.getInheritableProperty)({dict:dict,key:"Ff"});if(!Number.isInteger(data.fieldFlags)||0>data.fieldFlags)data.fieldFlags=0;data.readOnly=
|
|
1283
|
+
_this3.hasFieldFlag(_util.AnnotationFieldFlag.READONLY);data.hidden=_this3._hasFlag(_this3.flags,_util.AnnotationFlag.HIDDEN);data.isRequired=_this3.hasFieldFlag(_util.AnnotationFieldFlag.REQUIRED);"Sig"===data.fieldType&&(data.fieldValue=null,_this3.setFlags(_util.AnnotationFlag.HIDDEN));_obj.Catalog.parseDestDictionary({destDict:params.dict,resultObj:_this3.data,docBaseUrl:params.pdfManager.docBaseUrl});return _this3}_inherits(WidgetAnnotation,_Annotation2);_createClass(WidgetAnnotation,[{key:"_constructFieldName",
|
|
1284
|
+
value:function(dict){if(!dict.has("T")&&!dict.has("Parent"))return(0,_util.warn)("Unknown field name, falling back to empty field name."),"";if(!dict.has("Parent"))return(0,_util.stringToPDFString)(dict.get("T"));var fieldName=[];for(dict.has("T")&&fieldName.unshift((0,_util.stringToPDFString)(dict.get("T")));dict.has("Parent");){dict=dict.get("Parent");if(!(0,_primitives.isDict)(dict))break;dict.has("T")&&fieldName.unshift((0,_util.stringToPDFString)(dict.get("T")))}return fieldName.join(".")}},
|
|
1285
|
+
{key:"hasFieldFlag",value:function(flag){return!!(this.data.fieldFlags&flag)}},{key:"getOperatorList",value:function(evaluator,task,renderForms){return renderForms?Promise.resolve(new _operator_list.OperatorList):_get(_getPrototypeOf(WidgetAnnotation.prototype),"getOperatorList",this).call(this,evaluator,task,renderForms)}}]);return WidgetAnnotation}(Annotation),TextWidgetAnnotation=function(_WidgetAnnotation){function TextWidgetAnnotation(params){_classCallCheck(this,TextWidgetAnnotation);var _this4=
|
|
1286
|
+
_possibleConstructorReturn(this,_getPrototypeOf(TextWidgetAnnotation).call(this,params));params=params.dict;_this4.data.fieldValue=(0,_util.stringToPDFString)(_this4.data.fieldValue||"");var alignment=(0,_core_utils.getInheritableProperty)({dict:params,key:"Q"});if(!Number.isInteger(alignment)||0>alignment||2<alignment)alignment=null;_this4.data.textAlignment=alignment;params=(0,_core_utils.getInheritableProperty)({dict:params,key:"MaxLen"});if(!Number.isInteger(params)||0>params)params=null;_this4.data.maxLen=
|
|
1287
|
+
params;_this4.data.multiLine=_this4.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE);_this4.data.comb=_this4.hasFieldFlag(_util.AnnotationFieldFlag.COMB)&&!_this4.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE)&&!_this4.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD)&&!_this4.hasFieldFlag(_util.AnnotationFieldFlag.FILESELECT)&&null!==_this4.data.maxLen;return _this4}_inherits(TextWidgetAnnotation,_WidgetAnnotation);_createClass(TextWidgetAnnotation,[{key:"getOperatorList",value:function(evaluator,
|
|
1288
|
+
task,renderForms){if(renderForms||this.appearance)return _get(_getPrototypeOf(TextWidgetAnnotation.prototype),"getOperatorList",this).call(this,evaluator,task,renderForms);var operatorList=new _operator_list.OperatorList;if(!this.data.defaultAppearance)return Promise.resolve(operatorList);renderForms=new _stream.Stream((0,_util.stringToBytes)(this.data.defaultAppearance));return evaluator.getOperatorList({stream:renderForms,task:task,resources:this.fieldResources,operatorList:operatorList}).then(function(){return operatorList})}}]);
|
|
1277
1289
|
return TextWidgetAnnotation}(WidgetAnnotation),ButtonWidgetAnnotation=function(_WidgetAnnotation2){function ButtonWidgetAnnotation(params){_classCallCheck(this,ButtonWidgetAnnotation);var _this5=_possibleConstructorReturn(this,_getPrototypeOf(ButtonWidgetAnnotation).call(this,params));_this5.data.checkBox=!_this5.hasFieldFlag(_util.AnnotationFieldFlag.RADIO)&&!_this5.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);_this5.data.radioButton=_this5.hasFieldFlag(_util.AnnotationFieldFlag.RADIO)&&!_this5.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
|
|
1278
1290
|
_this5.data.pushButton=_this5.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);_this5.data.checkBox?_this5._processCheckBox(params):_this5.data.radioButton?_this5._processRadioButton(params):_this5.data.pushButton?_this5._processPushButton(params):(0,_util.warn)("Invalid field flags for button widget annotation");return _this5}_inherits(ButtonWidgetAnnotation,_WidgetAnnotation2);_createClass(ButtonWidgetAnnotation,[{key:"_processCheckBox",value:function(params){(0,_primitives.isName)(this.data.fieldValue)&&
|
|
1279
1291
|
(this.data.fieldValue=this.data.fieldValue.name);params=params.dict.get("AP");if((0,_primitives.isDict)(params)){var NValuesDict=params.get("N");if((0,_primitives.isDict)(NValuesDict)&&(NValuesDict=NValuesDict.getKeys())&&NValuesDict.length)for(var i=0;i<NValuesDict.length;i++){var key=NValuesDict[i];if("Off"!==key){this.data.widgetAP=key;break}}params=params.get("D");(0,_primitives.isDict)(params)&&(params=params.getKeys(),2===params.length&&(this.data.exportValue="Off"===params[0]?params[1]:params[0]))}}},
|
|
@@ -1317,7 +1329,7 @@ _util.OPS.setTextMatrix,_util.OPS.showText,_util.OPS.endText],null,function(cont
|
|
|
1317
1329
|
!1:!0;case 4:return fnArray[i]===_util.OPS.endText}throw Error("iterateShowTextGroup - invalid pos: ".concat(pos));},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,curr=context.iCurr,iFirstBeginText=curr-4,iFirstSetFont=curr-3,firstSetFontArg0=argsArray[iFirstSetFont][0],firstSetFontArg1=argsArray[iFirstSetFont][1];context=Math.min(Math.floor((i-iFirstBeginText)/5),1E3);if(3>context)return i-(i-iFirstBeginText)%5;i=iFirstBeginText;4<=iFirstBeginText&&fnArray[iFirstBeginText-
|
|
1318
1330
|
4]===fnArray[iFirstSetFont]&&fnArray[iFirstBeginText-3]===fnArray[curr-2]&&fnArray[iFirstBeginText-2]===fnArray[curr-1]&&fnArray[iFirstBeginText-1]===fnArray[curr]&&argsArray[iFirstBeginText-4][0]===firstSetFontArg0&&argsArray[iFirstBeginText-4][1]===firstSetFontArg1&&(context++,i-=5);i+=4;for(curr=1;curr<context;curr++)fnArray.splice(i,3),argsArray.splice(i,3),i+=2;return i+1});QueueOptimizer.prototype={_optimize:function(){var fnArray=this.queue.fnArray,i=this.lastProcessed,ii=fnArray.length,state=
|
|
1319
1331
|
this.state,match=this.match;if(state||match||i+1!==ii||InitialState[fnArray[i]]){for(var context=this.context;i<ii;){if(match){if((0,match.iterateFn)(context,i)){i++;continue}i=(0,match.processFn)(context,i+1);ii=fnArray.length;state=match=null;if(i>=ii)break}state=(state||InitialState)[fnArray[i]];if(!state||Array.isArray(state))i++;else{context.iCurr=i;i++;if(!state.checkFn||(0,state.checkFn)(context))match=state;state=null}}this.state=state;this.match=match;this.lastProcessed=i}else this.lastProcessed=
|
|
1320
|
-
ii},push:function(fn,args){this.queue.fnArray.push(fn);this.queue.argsArray.push(args);this._optimize()},flush:function(){for(;this.match;)
|
|
1332
|
+
ii},push:function(fn,args){this.queue.fnArray.push(fn);this.queue.argsArray.push(args);this._optimize()},flush:function(){for(;this.match;)this.lastProcessed=(0,this.match.processFn)(this.context,this.queue.fnArray.length),this.state=this.match=null,this._optimize()},reset:function(){this.match=this.state=null;this.lastProcessed=0}};return QueueOptimizer}(),NullOptimizer=function(){function NullOptimizer(queue){this.queue=queue}NullOptimizer.prototype={push:function(fn,args){this.queue.fnArray.push(fn);
|
|
1321
1333
|
this.queue.argsArray.push(args)},flush:function(){},reset:function(){}};return NullOptimizer}();module=function(){function OperatorList(intent,streamSink,pageIndex){this._streamSink=streamSink;this.fnArray=[];this.argsArray=[];this.optimizer=streamSink&&"oplist"!==intent?new QueueOptimizer(this):new NullOptimizer(this);this.dependencies=Object.create(null);this._totalLength=0;this.pageIndex=pageIndex;this.intent=intent;this.weight=0;this._resolved=streamSink?null:Promise.resolve()}OperatorList.prototype=
|
|
1322
1334
|
{get length(){return this.argsArray.length},get ready(){return this._resolved||this._streamSink.ready},get totalLength(){return this._totalLength+this.length},addOp:function(fn,args){this.optimizer.push(fn,args);this.weight++;this._streamSink&&(1E3<=this.weight?this.flush():995<=this.weight&&(fn===_util.OPS.restore||fn===_util.OPS.endText)&&this.flush())},addDependency:function(dependency){dependency in this.dependencies||(this.dependencies[dependency]=!0,this.addOp(_util.OPS.dependency,[dependency]))},
|
|
1323
1335
|
addDependencies:function(dependencies){for(var key in dependencies)this.addDependency(key)},addOpList:function(opList){Object.assign(this.dependencies,opList.dependencies);for(var i=0,ii=opList.length;i<ii;i++)this.addOp(opList.fnArray[i],opList.argsArray[i])},getIR:function(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}},get _transfers(){for(var transfers=[],fnArray=this.fnArray,argsArray=this.argsArray,length=this.length,i=0;i<length;i++)switch(fnArray[i]){case _util.OPS.paintInlineImageXObject:case _util.OPS.paintInlineImageXObjectGroup:case _util.OPS.paintImageMaskXObject:var arg=
|
|
@@ -1386,84 +1398,84 @@ resolve())}))["catch"](function(reason){if(!(reason instanceof _util.AbortExcept
|
|
|
1386
1398
|
font.loadedName in seenStyles||(seenStyles[font.loadedName]=!0,textContent.styles[font.loadedName]={fontFamily:font.fallbackName,ascent:font.ascent,descent:font.descent,vertical:!!font.vertical});textContentItem.fontName=font.loadedName;var tsm=[textState.fontSize*textState.textHScale,0,0,textState.fontSize,0,textState.textRise];if(font.isType3Font&&1>=textState.fontSize&&!(0,_util.isArrayEqual)(textState.fontMatrix,_util.FONT_IDENTITY_MATRIX)){var glyphHeight=font.bbox[3]-font.bbox[1];0<glyphHeight&&
|
|
1387
1399
|
(tsm[3]=tsm[3]*glyphHeight*textState.fontMatrix[3])}tsm=_util.Util.transform(textState.ctm,_util.Util.transform(textState.textMatrix,tsm));textContentItem.transform=tsm;font.vertical?(textContentItem.width=Math.sqrt(tsm[0]*tsm[0]+tsm[1]*tsm[1]),textContentItem.height=0,textContentItem.vertical=!0):(textContentItem.width=0,textContentItem.height=Math.sqrt(tsm[2]*tsm[2]+tsm[3]*tsm[3]),textContentItem.vertical=!1);tsm=textState.textLineMatrix[0];glyphHeight=textState.textLineMatrix[1];var scaleLineX=
|
|
1388
1400
|
Math.sqrt(tsm*tsm+glyphHeight*glyphHeight);tsm=textState.ctm[0];glyphHeight=textState.ctm[1];textContentItem.textAdvanceScale=Math.sqrt(tsm*tsm+glyphHeight*glyphHeight)*scaleLineX;textContentItem.lastAdvanceWidth=0;textContentItem.lastAdvanceHeight=0;Array.isArray(font.widths)||(font.widths=Object.keys(font.widths).reduce(function(acc,index){acc[index]=font.widths[index];return acc},[]));(tsm=Math.min.apply(null,font.widths.filter(function(w){return!!w}))/1E3*textState.fontSize)?(textContentItem.spaceWidth=
|
|
1389
|
-
tsm,textContentItem.fakeSpaceMin=.3*tsm,textContentItem.fakeMultiSpaceMin=1.5*tsm,textContentItem.fakeMultiSpaceMax=4*tsm,textContentItem.textRunBreakAllowed=!font.isMonospace):(textContentItem.spaceWidth=0,textContentItem.fakeSpaceMin=Infinity,textContentItem.fakeMultiSpaceMin=Infinity,textContentItem.fakeMultiSpaceMax=0,textContentItem.textRunBreakAllowed=!1);textContentItem.initialized=!0;return textContentItem}function
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
width
|
|
1394
|
-
(
|
|
1395
|
-
_ref7$stateManager=_ref7.stateManager,stateManager=void 0===_ref7$stateManager?null:_ref7$stateManager;_ref7$stateManager=_ref7.normalizeWhitespace;var normalizeWhitespace=void 0===_ref7$stateManager?!1:_ref7$stateManager;_ref7$stateManager=_ref7.combineTextItems;var combineTextItems=void 0===_ref7$stateManager?!1:_ref7$stateManager,sink=_ref7.sink;_ref7=_ref7.seenStyles;var seenStyles=void 0===_ref7?Object.create(null):
|
|
1396
|
-
new StateManager(new TextState);var WhitespaceRegexp=/\s/g,textContent={items:[],styles:Object.create(null)},textContentItem={initialized:!1,str:[],width:0,height:0,vertical:!1,lastAdvanceWidth:0,lastAdvanceHeight:0,textAdvanceScale:0,spaceWidth:0,fakeSpaceMin:Infinity,fakeMultiSpaceMin:Infinity,fakeMultiSpaceMax:-0,textRunBreakAllowed:!1,transform:null,fontName:null},self=this;_ref7=this.xref;var xobjs=null,skipEmptyXObjs=
|
|
1397
|
-
textState,timeSlotManager=new TimeSlotManager;return(new Promise(function promiseBody(resolve,reject){var next=function(promise){enqueueChunk();Promise.all([promise,sink.ready]).then(function(){try{promiseBody(resolve,reject)}catch(ex){reject(ex)}},reject)};task.ensureNotTerminated();timeSlotManager.reset();for(var stop,operation={},args=[];!(stop=timeSlotManager.check());){args.length=0;operation.args=args;if(!preprocessor.read(operation))break;
|
|
1398
|
-
operation.args;switch(stop|0){case _util.OPS.setFont:stop=args[0].name;var fontSizeArg=args[1];if(textState.font&&stop===textState.fontName&&fontSizeArg===textState.fontSize)break;flushTextContentItem();textState.fontName=stop;textState.fontSize=fontSizeArg;next(handleSetFont(stop,null));return;case _util.OPS.setTextRise:flushTextContentItem();textState.textRise=args[0];break;case _util.OPS.setHScale:flushTextContentItem();textState.textHScale=args[0]/
|
|
1399
|
-
textState.leading=args[0];break;case _util.OPS.moveText:fontSizeArg=textState.font?0===(textState.font.vertical?args[0]:args[1]):!1;stop=args[0]-args[1];if(combineTextItems&&fontSizeArg&&textContentItem.initialized&&0<stop&&stop<=textContentItem.fakeMultiSpaceMax){textState.translateTextLineMatrix(args[0],args[1]);textContentItem.width+=args[0]-textContentItem.lastAdvanceWidth;textContentItem.height+=args[1]-textContentItem.lastAdvanceHeight;
|
|
1400
|
-
textContentItem.lastAdvanceHeight);addFakeSpaces(stop,textContentItem.str);break}flushTextContentItem();textState.translateTextLineMatrix(args[0],args[1]);textState.textMatrix=textState.textLineMatrix.slice();break;case _util.OPS.setLeadingMoveText:flushTextContentItem();textState.leading=-args[1];textState.translateTextLineMatrix(args[0],args[1]);textState.textMatrix=textState.textLineMatrix.slice();break;case _util.OPS.nextLine:flushTextContentItem();
|
|
1401
|
-
textState.calcTextLineMatrixAdvance(args[0],args[1],args[2],args[3],args[4],args[5]);if(combineTextItems&&null!==stop&&textContentItem.initialized&&0<stop.value&&stop.value<=textContentItem.fakeMultiSpaceMax){textState.translateTextLineMatrix(stop.width,stop.height);textContentItem.width+=stop.width-textContentItem.lastAdvanceWidth;textContentItem.height+=stop.height-textContentItem.lastAdvanceHeight;stop=stop.width-textContentItem.lastAdvanceWidth-
|
|
1402
|
-
addFakeSpaces(stop,textContentItem.str);break}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 _util.OPS.setCharSpacing:textState.charSpacing=args[0];break;case _util.OPS.setWordSpacing:textState.wordSpacing=args[0];break;case _util.OPS.beginText:flushTextContentItem();textState.textMatrix=_util.IDENTITY_MATRIX.slice();
|
|
1403
|
-
break;case _util.OPS.showSpacedText:fontSizeArg=args[0];for(var offset,j=0,jj=fontSizeArg.length;j<jj;j++)if("string"===typeof fontSizeArg[j])buildTextContentItem(fontSizeArg[j]);else if((0,_util.isNum)(fontSizeArg[j])){ensureTextContentItem();stop=fontSizeArg[j]*textState.fontSize/1E3;var breakTextRun=!1;textState.font.vertical?(offset=stop,textState.translateTextMatrix(0,offset),breakTextRun=textContentItem.textRunBreakAllowed&&stop>textContentItem.fakeMultiSpaceMax,
|
|
1404
|
-
offset)):(stop=-stop,offset=stop*textState.textHScale,textState.translateTextMatrix(offset,0),breakTextRun=textContentItem.textRunBreakAllowed&&stop>textContentItem.fakeMultiSpaceMax,breakTextRun||(textContentItem.width+=offset));breakTextRun?flushTextContentItem():0<stop&&addFakeSpaces(stop,textContentItem.str)}break;case _util.OPS.showText:buildTextContentItem(args[0]);break;case _util.OPS.nextLineShowText:flushTextContentItem();textState.carriageReturn();
|
|
1405
|
-
textState.wordSpacing=args[0];textState.charSpacing=args[1];textState.carriageReturn();buildTextContentItem(args[2]);break;case _util.OPS.paintXObject:flushTextContentItem();xobjs||(xobjs=resources.get("XObject")||_primitives.Dict.empty);var name=args[0].name;if(name&&void 0!==skipEmptyXObjs[name])break;next((new Promise(function(resolveXObject,rejectXObject){if(!name)throw new _util.FormatError("XObject must be referred to by name.");
|
|
1406
|
-
var type=xobj.dict.get("Subtype");if(!(0,_primitives.isName)(type))throw new _util.FormatError("XObject should have a Name subtype");if("Form"!==type.name)skipEmptyXObjs[name]=!0,resolveXObject();else{type=stateManager.state.clone();type=new StateManager(type);var matrix=xobj.dict.getArray("Matrix");Array.isArray(matrix)&&6===matrix.length&&type.transform(matrix);enqueueChunk();
|
|
1407
|
-
get ready(){return sink.ready}};self.getTextContent({stream:xobj,task:task,resources:xobj.dict.get("Resources")||resources,stateManager:type,normalizeWhitespace:normalizeWhitespace,combineTextItems:combineTextItems,sink:sinkWrapper,seenStyles:seenStyles}).then(function(){sinkWrapper.enqueueInvoked||(skipEmptyXObjs[name]=!0);resolveXObject()},rejectXObject)}}else resolveXObject()}))["catch"](function(reason){if(!(reason instanceof
|
|
1408
|
-
'".'));else throw reason;}));return;case _util.OPS.setGState:if(flushTextContentItem(),stop=args[0],fontSizeArg=resources.get("ExtGState"),(0,_primitives.isDict)(fontSizeArg)&&(0,_primitives.isName)(stop)&&(stop=fontSizeArg.get(stop.name),(0,_primitives.isDict)(stop)&&(stop=stop.get("Font")))){textState.fontName=null;textState.fontSize=stop[1];next(handleSetFont(null,stop[0]));return}}if(textContent.items.length>=
|
|
1409
|
-
resolve())}))["catch"](function(reason){if(!(reason instanceof _util.AbortException))if(_this9.options.ignoreErrors)(0,_util.warn)('getTextContent - ignoring errors during "'.concat(task.name,'" ')+'task: "'.concat(reason,'".')),flushTextContentItem(),enqueueChunk();else throw reason;})},extractDataStructures:function(dict,baseDict,properties){var _this10=this,xref=this.xref,cidToGidBytes;baseDict=(baseDict=
|
|
1410
|
-
if(properties.composite){var cidSystemInfo=dict.get("CIDSystemInfo");(0,_primitives.isDict)(cidSystemInfo)&&(properties.cidSystemInfo={registry:(0,_util.stringToPDFString)(cidSystemInfo.get("Registry")),ordering:(0,_util.stringToPDFString)(cidSystemInfo.get("Ordering")),supplement:cidSystemInfo.get("Supplement")});cidSystemInfo=dict.get("CIDToGIDMap");(0,_primitives.isStream)(cidSystemInfo)&&(cidToGidBytes=
|
|
1411
|
-
dict.get("Encoding");if((0,_primitives.isDict)(encoding)){if(baseEncodingName=encoding.get("BaseEncoding"),baseEncodingName=(0,_primitives.isName)(baseEncodingName)?baseEncodingName.name:null,encoding.has("Differences")){encoding=encoding.get("Differences");for(var index=0,j=0,jj=encoding.length;j<jj;j++){var data=xref.fetchIfRef(encoding[j]);if((0,_util.isNum)(data))index=data;else if((0,_primitives.isName)(data))cidSystemInfo[index++]=
|
|
1412
|
-
}}}else if((0,_primitives.isName)(encoding))baseEncodingName=encoding.name;else throw new _util.FormatError("Encoding is not a Name nor a Dict");"MacRomanEncoding"!==baseEncodingName&&"MacExpertEncoding"!==baseEncodingName&&"WinAnsiEncoding"!==baseEncodingName&&(baseEncodingName=null)}baseEncodingName?properties.defaultEncoding=(0,_encodings.getEncoding)(baseEncodingName).slice():(xref=!!(properties.flags&
|
|
1413
|
-
_encodings.StandardEncoding,"TrueType"!==properties.type||index||(encoding=_encodings.WinAnsiEncoding),xref&&(encoding=_encodings.MacRomanEncoding,properties.file||(/Symbol/i.test(properties.name)?encoding=_encodings.SymbolSetEncoding:/Dingbats/i.test(properties.name)&&(encoding=_encodings.ZapfDingbatsEncoding))),properties.defaultEncoding=encoding);properties.differences=cidSystemInfo;properties.baseEncodingName=
|
|
1414
|
-
dict;return baseDict.then(function(toUnicode){properties.toUnicode=toUnicode;return _this10.buildToUnicode(properties)}).then(function(toUnicode){properties.toUnicode=toUnicode;cidToGidBytes&&(properties.cidToGidMap=_this10.readCidToGidMap(cidToGidBytes,toUnicode));return properties})},_buildSimpleFontToUnicode:function(properties){var forceGlyphs=1<arguments.length&&void 0!==arguments[1]?arguments[1]
|
|
1415
|
-
properties.defaultEncoding.slice(),baseEncodingName=properties.baseEncodingName,differences=properties.differences;for(charcode in differences){var glyphName=differences[charcode];".notdef"!==glyphName&&(encoding[charcode]=glyphName)}differences=(0,_glyphlist.getGlyphsUnicode)();for(charcode in encoding)if(glyphName=encoding[charcode],""!==glyphName)if(void 0===differences[glyphName]){var code=0;
|
|
1416
|
-
glyphName.length&&(code=parseInt(glyphName.substring(1),16));break;case "C":case "c":if(3<=glyphName.length&&4>=glyphName.length){var codeStr=glyphName.substring(1);if(forceGlyphs)code=parseInt(codeStr,16);else if(code=+codeStr,Number.isNaN(code)&&Number.isInteger(parseInt(codeStr,16)))return this._buildSimpleFontToUnicode(properties,!0)}break;default:codeStr=(0,_unicode.getUnicodeForGlyph)(glyphName,
|
|
1417
|
-
(0,_encodings.getEncoding)(baseEncodingName))&&(glyphName=codeStr[charcode])){toUnicode[charcode]=String.fromCharCode(differences[glyphName]);continue}toUnicode[charcode]=String.fromCodePoint(code)}}else toUnicode[charcode]=String.fromCharCode(differences[glyphName]);return new _fonts.ToUnicodeMap(toUnicode)},buildToUnicode:function(properties){properties.hasIncludedToUnicodeMap=!!properties.toUnicode&&
|
|
1418
|
-
properties.hasEncoding&&(properties.fallbackToUnicode=this._buildSimpleFontToUnicode(properties)),Promise.resolve(properties.toUnicode);if(!properties.composite)return Promise.resolve(this._buildSimpleFontToUnicode(properties));if(properties.composite&&(properties.cMap.builtInCMap&&!(properties.cMap instanceof _cmap.IdentityCMap)||"Adobe"===properties.cidSystemInfo.registry&&("GB1"===properties.cidSystemInfo.ordering||
|
|
1419
|
-
"Korea1"===properties.cidSystemInfo.ordering))){var ordering=properties.cidSystemInfo.ordering;ordering=_primitives.Name.get("".concat(properties.cidSystemInfo.registry,"-").concat(ordering,"-UCS2"));return _cmap.CMapFactory.create({encoding:ordering,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(ucs2CMap){var toUnicode=[];properties.cMap.forEach(function(charcode,cid){if(65535<cid)throw new _util.FormatError("Max size of CID is 65,535");
|
|
1420
|
-
String.fromCharCode((cid.charCodeAt(0)<<8)+cid.charCodeAt(1)))});return new _fonts.ToUnicodeMap(toUnicode)})}return Promise.resolve(new _fonts.IdentityToUnicodeMap(properties.firstChar,properties.lastChar))},readToUnicode:function(toUnicode){return(0,_primitives.isName)(toUnicode)?_cmap.CMapFactory.create({encoding:toUnicode,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(cmap){return cmap instanceof _cmap.IdentityCMap?new _fonts.IdentityToUnicodeMap(0,
|
|
1421
|
-
(0,_primitives.isStream)(toUnicode)?_cmap.CMapFactory.create({encoding:toUnicode,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(cmap){if(cmap instanceof _cmap.IdentityCMap)return new _fonts.IdentityToUnicodeMap(0,65535);var map=Array(cmap.length);cmap.forEach(function(charCode,token){if("number"===typeof token)map[charCode]=String.fromCodePoint(token);else{for(var str=[],k=0;k<token.length;k+=2){var w1=token.charCodeAt(k)<<8|token.charCodeAt(k+
|
|
1422
|
-
else{k+=2;var w2=token.charCodeAt(k)<<8|token.charCodeAt(k+1);str.push(((w1&1023)<<10)+(w2&1023)+65536)}}map[charCode]=String.fromCodePoint.apply(String,str)}});return new _fonts.ToUnicodeMap(map)}):Promise.resolve(null)},readCidToGidMap:function(glyphsData,toUnicode){for(var result=[],j=0,jj=glyphsData.length;j<jj;j++){var glyphID=glyphsData[j++]<<8|glyphsData[j],code=j>>1;if(0!==glyphID||toUnicode.has(code))result[code]=glyphID}return result},extractWidths:function(dict,
|
|
1423
|
-
this.xref,glyphsWidths=[],defaultWidth=0,glyphsVMetrics=[],ii,jj,widths;if(properties.composite){defaultWidth=dict.has("DW")?dict.get("DW"):1E3;if(widths=dict.get("W")){var i=0;for(ii=widths.length;i<ii;i++){descriptor=xref.fetchIfRef(widths[i++]);var code=xref.fetchIfRef(widths[i]);if(Array.isArray(code)){var j=0;for(jj=code.length;j<jj;j++)glyphsWidths[descriptor++]=xref.fetchIfRef(code[j])}else for(jj=xref.fetchIfRef(widths[++i]),j=descriptor;j<=code;j++)glyphsWidths[j]=
|
|
1424
|
-
dict.getArray("DW2")||[880,-1E3];var defaultVMetrics=[widths[1],.5*defaultWidth,widths[0]];if(widths=dict.get("W2"))for(i=0,ii=widths.length;i<ii;i++)if(descriptor=xref.fetchIfRef(widths[i++]),code=xref.fetchIfRef(widths[i]),Array.isArray(code))for(j=0,jj=code.length;j<jj;j++)glyphsVMetrics[descriptor++]=[xref.fetchIfRef(code[j++]),xref.fetchIfRef(code[j++]),xref.fetchIfRef(code[j])];else for(dict=[xref.fetchIfRef(widths[++i]),xref.fetchIfRef(widths[++i]),xref.fetchIfRef(widths[++i])],
|
|
1425
|
-
code;j++)glyphsVMetrics[j]=dict}}else if(i=properties.firstChar,widths=dict.get("Widths")){j=i;i=0;for(ii=widths.length;i<ii;i++)glyphsWidths[j++]=xref.fetchIfRef(widths[i]);defaultWidth=parseFloat(descriptor.get("MissingWidth"))||0}else xref=dict.get("BaseFont"),(0,_primitives.isName)(xref)&&(defaultWidth=this.getBaseFontMetrics(xref.name),glyphsWidths=this.buildCharCodeToWidth(defaultWidth.widths,properties),defaultWidth=defaultWidth.defaultWidth);xref=!0;dict=defaultWidth;for(var glyph in glyphsWidths)if(i=
|
|
1401
|
+
tsm,textContentItem.fakeSpaceMin=.3*tsm,textContentItem.fakeMultiSpaceMin=1.5*tsm,textContentItem.fakeMultiSpaceMax=4*tsm,textContentItem.textRunBreakAllowed=!font.isMonospace):(textContentItem.spaceWidth=0,textContentItem.fakeSpaceMin=Infinity,textContentItem.fakeMultiSpaceMin=Infinity,textContentItem.fakeMultiSpaceMax=0,textContentItem.textRunBreakAllowed=!1);textContentItem.initialized=!0;return textContentItem}function handleSetFont(fontName,fontRef){return self.loadFont(fontName,fontRef,resources).then(function(translated){textState.font=
|
|
1402
|
+
translated.font;textState.fontMatrix=translated.font.fontMatrix||_util.FONT_IDENTITY_MATRIX})}function buildTextContentItem(chars){var font=textState.font,textChunk=ensureTextContentItem(),width=0,height=0;chars=font.charsToGlyphs(chars);for(var i=0;i<chars.length;i++){var glyph=chars[i];var glyphWidth=font.vertical&&glyph.vmetric?glyph.vmetric[0]:glyph.width;var glyphUnicode=glyph.unicode,NormalizedUnicodes=(0,_unicode.getNormalizedUnicodes)();void 0!==NormalizedUnicodes[glyphUnicode]&&(glyphUnicode=
|
|
1403
|
+
NormalizedUnicodes[glyphUnicode]);glyphUnicode=(0,_unicode.reverseIfRtl)(glyphUnicode);NormalizedUnicodes=textState.charSpacing;glyph.isSpace&&(glyph=textState.wordSpacing,NormalizedUnicodes+=glyph,0<glyph&&addFakeSpaces(glyph,textChunk.str));var ty=glyph=0;font.vertical?(ty=glyphWidth*textState.fontMatrix[0]*textState.fontSize+NormalizedUnicodes,height+=ty):(glyph=(glyphWidth*textState.fontMatrix[0]*textState.fontSize+NormalizedUnicodes)*textState.textHScale,width+=glyph);textState.translateTextMatrix(glyph,
|
|
1404
|
+
ty);textChunk.str.push(glyphUnicode)}font.vertical?(textChunk.lastAdvanceHeight=height,textChunk.height+=Math.abs(height)):(textChunk.lastAdvanceWidth=width,textChunk.width+=width);return textChunk}function addFakeSpaces(width,strBuf){if(!(width<textContentItem.fakeSpaceMin))if(width<textContentItem.fakeMultiSpaceMin)strBuf.push(" ");else for(width=Math.round(width/textContentItem.spaceWidth);0<width--;)strBuf.push(" ")}function flushTextContentItem(){if(textContentItem.initialized){textContentItem.vertical?
|
|
1405
|
+
textContentItem.height*=textContentItem.textAdvanceScale:textContentItem.width*=textContentItem.textAdvanceScale;var JSCompiler_temp_const=textContent.items,JSCompiler_temp_const$jscomp$0=JSCompiler_temp_const.push,textChunk=textContentItem,str=textChunk.str.join("");str=(0,_bidi.bidi)(str,-1,textChunk.vertical);var JSCompiler_temp;if(normalizeWhitespace){for(var str$jscomp$0=str.str,i=0,ii=str$jscomp$0.length;i<ii&&32<=(JSCompiler_temp=str$jscomp$0.charCodeAt(i))&&127>=JSCompiler_temp;)i++;JSCompiler_temp=
|
|
1406
|
+
i<ii?str$jscomp$0.replace(WhitespaceRegexp," "):str$jscomp$0}else JSCompiler_temp=str.str;JSCompiler_temp_const$jscomp$0.call(JSCompiler_temp_const,{str:JSCompiler_temp,dir:str.dir,width:textChunk.width,height:textChunk.height,transform:textChunk.transform,fontName:textChunk.fontName});textContentItem.initialized=!1;textContentItem.str.length=0}}function enqueueChunk(){var length=textContent.items.length;0<length&&(sink.enqueue(textContent,length),textContent.items=[],textContent.styles=Object.create(null))}
|
|
1407
|
+
var _this9=this,stream=_ref7.stream,task=_ref7.task,resources=_ref7.resources,_ref7$stateManager=_ref7.stateManager,stateManager=void 0===_ref7$stateManager?null:_ref7$stateManager;_ref7$stateManager=_ref7.normalizeWhitespace;var normalizeWhitespace=void 0===_ref7$stateManager?!1:_ref7$stateManager;_ref7$stateManager=_ref7.combineTextItems;var combineTextItems=void 0===_ref7$stateManager?!1:_ref7$stateManager,sink=_ref7.sink;_ref7=_ref7.seenStyles;var seenStyles=void 0===_ref7?Object.create(null):
|
|
1408
|
+
_ref7;resources=resources||_primitives.Dict.empty;stateManager=stateManager||new StateManager(new TextState);var WhitespaceRegexp=/\s/g,textContent={items:[],styles:Object.create(null)},textContentItem={initialized:!1,str:[],width:0,height:0,vertical:!1,lastAdvanceWidth:0,lastAdvanceHeight:0,textAdvanceScale:0,spaceWidth:0,fakeSpaceMin:Infinity,fakeMultiSpaceMin:Infinity,fakeMultiSpaceMax:-0,textRunBreakAllowed:!1,transform:null,fontName:null},self=this;_ref7=this.xref;var xobjs=null,skipEmptyXObjs=
|
|
1409
|
+
Object.create(null),preprocessor=new EvaluatorPreprocessor(stream,_ref7,stateManager),textState,timeSlotManager=new TimeSlotManager;return(new Promise(function promiseBody(resolve,reject){var next=function(promise){enqueueChunk();Promise.all([promise,sink.ready]).then(function(){try{promiseBody(resolve,reject)}catch(ex){reject(ex)}},reject)};task.ensureNotTerminated();timeSlotManager.reset();for(var stop,operation={},args=[];!(stop=timeSlotManager.check());){args.length=0;operation.args=args;if(!preprocessor.read(operation))break;
|
|
1410
|
+
textState=stateManager.state;stop=operation.fn;args=operation.args;switch(stop|0){case _util.OPS.setFont:stop=args[0].name;var fontSizeArg=args[1];if(textState.font&&stop===textState.fontName&&fontSizeArg===textState.fontSize)break;flushTextContentItem();textState.fontName=stop;textState.fontSize=fontSizeArg;next(handleSetFont(stop,null));return;case _util.OPS.setTextRise:flushTextContentItem();textState.textRise=args[0];break;case _util.OPS.setHScale:flushTextContentItem();textState.textHScale=args[0]/
|
|
1411
|
+
100;break;case _util.OPS.setLeading:flushTextContentItem();textState.leading=args[0];break;case _util.OPS.moveText:fontSizeArg=textState.font?0===(textState.font.vertical?args[0]:args[1]):!1;stop=args[0]-args[1];if(combineTextItems&&fontSizeArg&&textContentItem.initialized&&0<stop&&stop<=textContentItem.fakeMultiSpaceMax){textState.translateTextLineMatrix(args[0],args[1]);textContentItem.width+=args[0]-textContentItem.lastAdvanceWidth;textContentItem.height+=args[1]-textContentItem.lastAdvanceHeight;
|
|
1412
|
+
stop=args[0]-textContentItem.lastAdvanceWidth-(args[1]-textContentItem.lastAdvanceHeight);addFakeSpaces(stop,textContentItem.str);break}flushTextContentItem();textState.translateTextLineMatrix(args[0],args[1]);textState.textMatrix=textState.textLineMatrix.slice();break;case _util.OPS.setLeadingMoveText:flushTextContentItem();textState.leading=-args[1];textState.translateTextLineMatrix(args[0],args[1]);textState.textMatrix=textState.textLineMatrix.slice();break;case _util.OPS.nextLine:flushTextContentItem();
|
|
1413
|
+
textState.carriageReturn();break;case _util.OPS.setTextMatrix:stop=textState.calcTextLineMatrixAdvance(args[0],args[1],args[2],args[3],args[4],args[5]);if(combineTextItems&&null!==stop&&textContentItem.initialized&&0<stop.value&&stop.value<=textContentItem.fakeMultiSpaceMax){textState.translateTextLineMatrix(stop.width,stop.height);textContentItem.width+=stop.width-textContentItem.lastAdvanceWidth;textContentItem.height+=stop.height-textContentItem.lastAdvanceHeight;stop=stop.width-textContentItem.lastAdvanceWidth-
|
|
1414
|
+
(stop.height-textContentItem.lastAdvanceHeight);addFakeSpaces(stop,textContentItem.str);break}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 _util.OPS.setCharSpacing:textState.charSpacing=args[0];break;case _util.OPS.setWordSpacing:textState.wordSpacing=args[0];break;case _util.OPS.beginText:flushTextContentItem();textState.textMatrix=_util.IDENTITY_MATRIX.slice();
|
|
1415
|
+
textState.textLineMatrix=_util.IDENTITY_MATRIX.slice();break;case _util.OPS.showSpacedText:fontSizeArg=args[0];for(var offset,j=0,jj=fontSizeArg.length;j<jj;j++)if("string"===typeof fontSizeArg[j])buildTextContentItem(fontSizeArg[j]);else if((0,_util.isNum)(fontSizeArg[j])){ensureTextContentItem();stop=fontSizeArg[j]*textState.fontSize/1E3;var breakTextRun=!1;textState.font.vertical?(offset=stop,textState.translateTextMatrix(0,offset),breakTextRun=textContentItem.textRunBreakAllowed&&stop>textContentItem.fakeMultiSpaceMax,
|
|
1416
|
+
breakTextRun||(textContentItem.height+=offset)):(stop=-stop,offset=stop*textState.textHScale,textState.translateTextMatrix(offset,0),breakTextRun=textContentItem.textRunBreakAllowed&&stop>textContentItem.fakeMultiSpaceMax,breakTextRun||(textContentItem.width+=offset));breakTextRun?flushTextContentItem():0<stop&&addFakeSpaces(stop,textContentItem.str)}break;case _util.OPS.showText:buildTextContentItem(args[0]);break;case _util.OPS.nextLineShowText:flushTextContentItem();textState.carriageReturn();
|
|
1417
|
+
buildTextContentItem(args[0]);break;case _util.OPS.nextLineSetSpacingShowText:flushTextContentItem();textState.wordSpacing=args[0];textState.charSpacing=args[1];textState.carriageReturn();buildTextContentItem(args[2]);break;case _util.OPS.paintXObject:flushTextContentItem();xobjs||(xobjs=resources.get("XObject")||_primitives.Dict.empty);var name=args[0].name;if(name&&void 0!==skipEmptyXObjs[name])break;next((new Promise(function(resolveXObject,rejectXObject){if(!name)throw new _util.FormatError("XObject must be referred to by name.");
|
|
1418
|
+
var xobj=xobjs.get(name);if(xobj){if(!(0,_primitives.isStream)(xobj))throw new _util.FormatError("XObject should be a stream");var type=xobj.dict.get("Subtype");if(!(0,_primitives.isName)(type))throw new _util.FormatError("XObject should have a Name subtype");if("Form"!==type.name)skipEmptyXObjs[name]=!0,resolveXObject();else{type=stateManager.state.clone();type=new StateManager(type);var matrix=xobj.dict.getArray("Matrix");Array.isArray(matrix)&&6===matrix.length&&type.transform(matrix);enqueueChunk();
|
|
1419
|
+
var sinkWrapper={enqueueInvoked:!1,enqueue:function(chunk,size){this.enqueueInvoked=!0;sink.enqueue(chunk,size)},get desiredSize(){return sink.desiredSize},get ready(){return sink.ready}};self.getTextContent({stream:xobj,task:task,resources:xobj.dict.get("Resources")||resources,stateManager:type,normalizeWhitespace:normalizeWhitespace,combineTextItems:combineTextItems,sink:sinkWrapper,seenStyles:seenStyles}).then(function(){sinkWrapper.enqueueInvoked||(skipEmptyXObjs[name]=!0);resolveXObject()},rejectXObject)}}else resolveXObject()}))["catch"](function(reason){if(!(reason instanceof
|
|
1420
|
+
_util.AbortException))if(self.options.ignoreErrors)(0,_util.warn)('getTextContent - ignoring XObject: "'.concat(reason,'".'));else throw reason;}));return;case _util.OPS.setGState:if(flushTextContentItem(),stop=args[0],fontSizeArg=resources.get("ExtGState"),(0,_primitives.isDict)(fontSizeArg)&&(0,_primitives.isName)(stop)&&(stop=fontSizeArg.get(stop.name),(0,_primitives.isDict)(stop)&&(stop=stop.get("Font")))){textState.fontName=null;textState.fontSize=stop[1];next(handleSetFont(null,stop[0]));return}}if(textContent.items.length>=
|
|
1421
|
+
sink.desiredSize){stop=!0;break}}stop?next(deferred):(flushTextContentItem(),enqueueChunk(),resolve())}))["catch"](function(reason){if(!(reason instanceof _util.AbortException))if(_this9.options.ignoreErrors)(0,_util.warn)('getTextContent - ignoring errors during "'.concat(task.name,'" ')+'task: "'.concat(reason,'".')),flushTextContentItem(),enqueueChunk();else throw reason;})},extractDataStructures:function(dict,baseDict,properties){var _this10=this,xref=this.xref,cidToGidBytes;baseDict=(baseDict=
|
|
1422
|
+
dict.get("ToUnicode")||baseDict.get("ToUnicode"))?this.readToUnicode(baseDict):Promise.resolve(void 0);if(properties.composite){var cidSystemInfo=dict.get("CIDSystemInfo");(0,_primitives.isDict)(cidSystemInfo)&&(properties.cidSystemInfo={registry:(0,_util.stringToPDFString)(cidSystemInfo.get("Registry")),ordering:(0,_util.stringToPDFString)(cidSystemInfo.get("Ordering")),supplement:cidSystemInfo.get("Supplement")});cidSystemInfo=dict.get("CIDToGIDMap");(0,_primitives.isStream)(cidSystemInfo)&&(cidToGidBytes=
|
|
1423
|
+
cidSystemInfo.getBytes())}cidSystemInfo=[];var baseEncodingName=null;if(dict.has("Encoding")){var encoding=dict.get("Encoding");if((0,_primitives.isDict)(encoding)){if(baseEncodingName=encoding.get("BaseEncoding"),baseEncodingName=(0,_primitives.isName)(baseEncodingName)?baseEncodingName.name:null,encoding.has("Differences")){encoding=encoding.get("Differences");for(var index=0,j=0,jj=encoding.length;j<jj;j++){var data=xref.fetchIfRef(encoding[j]);if((0,_util.isNum)(data))index=data;else if((0,_primitives.isName)(data))cidSystemInfo[index++]=
|
|
1424
|
+
data.name;else throw new _util.FormatError("Invalid entry in 'Differences' array: ".concat(data));}}}else if((0,_primitives.isName)(encoding))baseEncodingName=encoding.name;else throw new _util.FormatError("Encoding is not a Name nor a Dict");"MacRomanEncoding"!==baseEncodingName&&"MacExpertEncoding"!==baseEncodingName&&"WinAnsiEncoding"!==baseEncodingName&&(baseEncodingName=null)}baseEncodingName?properties.defaultEncoding=(0,_encodings.getEncoding)(baseEncodingName).slice():(xref=!!(properties.flags&
|
|
1425
|
+
_fonts.FontFlags.Symbolic),index=!!(properties.flags&_fonts.FontFlags.Nonsymbolic),encoding=_encodings.StandardEncoding,"TrueType"!==properties.type||index||(encoding=_encodings.WinAnsiEncoding),xref&&(encoding=_encodings.MacRomanEncoding,properties.file||(/Symbol/i.test(properties.name)?encoding=_encodings.SymbolSetEncoding:/Dingbats/i.test(properties.name)&&(encoding=_encodings.ZapfDingbatsEncoding))),properties.defaultEncoding=encoding);properties.differences=cidSystemInfo;properties.baseEncodingName=
|
|
1426
|
+
baseEncodingName;properties.hasEncoding=!!baseEncodingName||0<cidSystemInfo.length;properties.dict=dict;return baseDict.then(function(toUnicode){properties.toUnicode=toUnicode;return _this10.buildToUnicode(properties)}).then(function(toUnicode){properties.toUnicode=toUnicode;cidToGidBytes&&(properties.cidToGidMap=_this10.readCidToGidMap(cidToGidBytes,toUnicode));return properties})},_buildSimpleFontToUnicode:function(properties){var forceGlyphs=1<arguments.length&&void 0!==arguments[1]?arguments[1]:
|
|
1427
|
+
!1;(0,_util.assert)(!properties.composite,"Must be a simple font.");var toUnicode=[],charcode,encoding=properties.defaultEncoding.slice(),baseEncodingName=properties.baseEncodingName,differences=properties.differences;for(charcode in differences){var glyphName=differences[charcode];".notdef"!==glyphName&&(encoding[charcode]=glyphName)}differences=(0,_glyphlist.getGlyphsUnicode)();for(charcode in encoding)if(glyphName=encoding[charcode],""!==glyphName)if(void 0===differences[glyphName]){var code=0;
|
|
1428
|
+
switch(glyphName[0]){case "G":3===glyphName.length&&(code=parseInt(glyphName.substring(1),16));break;case "g":5===glyphName.length&&(code=parseInt(glyphName.substring(1),16));break;case "C":case "c":if(3<=glyphName.length&&4>=glyphName.length){var codeStr=glyphName.substring(1);if(forceGlyphs)code=parseInt(codeStr,16);else if(code=+codeStr,Number.isNaN(code)&&Number.isInteger(parseInt(codeStr,16)))return this._buildSimpleFontToUnicode(properties,!0)}break;default:codeStr=(0,_unicode.getUnicodeForGlyph)(glyphName,
|
|
1429
|
+
differences),-1!==codeStr&&(code=codeStr)}if(code){if(baseEncodingName&&code===+charcode&&(codeStr=(0,_encodings.getEncoding)(baseEncodingName))&&(glyphName=codeStr[charcode])){toUnicode[charcode]=String.fromCharCode(differences[glyphName]);continue}toUnicode[charcode]=String.fromCodePoint(code)}}else toUnicode[charcode]=String.fromCharCode(differences[glyphName]);return new _fonts.ToUnicodeMap(toUnicode)},buildToUnicode:function(properties){properties.hasIncludedToUnicodeMap=!!properties.toUnicode&&
|
|
1430
|
+
0<properties.toUnicode.length;if(properties.hasIncludedToUnicodeMap)return!properties.composite&&properties.hasEncoding&&(properties.fallbackToUnicode=this._buildSimpleFontToUnicode(properties)),Promise.resolve(properties.toUnicode);if(!properties.composite)return Promise.resolve(this._buildSimpleFontToUnicode(properties));if(properties.composite&&(properties.cMap.builtInCMap&&!(properties.cMap instanceof _cmap.IdentityCMap)||"Adobe"===properties.cidSystemInfo.registry&&("GB1"===properties.cidSystemInfo.ordering||
|
|
1431
|
+
"CNS1"===properties.cidSystemInfo.ordering||"Japan1"===properties.cidSystemInfo.ordering||"Korea1"===properties.cidSystemInfo.ordering))){var ordering=properties.cidSystemInfo.ordering;ordering=_primitives.Name.get("".concat(properties.cidSystemInfo.registry,"-").concat(ordering,"-UCS2"));return _cmap.CMapFactory.create({encoding:ordering,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(ucs2CMap){var toUnicode=[];properties.cMap.forEach(function(charcode,cid){if(65535<cid)throw new _util.FormatError("Max size of CID is 65,535");
|
|
1432
|
+
(cid=ucs2CMap.lookup(cid))&&(toUnicode[charcode]=String.fromCharCode((cid.charCodeAt(0)<<8)+cid.charCodeAt(1)))});return new _fonts.ToUnicodeMap(toUnicode)})}return Promise.resolve(new _fonts.IdentityToUnicodeMap(properties.firstChar,properties.lastChar))},readToUnicode:function(toUnicode){return(0,_primitives.isName)(toUnicode)?_cmap.CMapFactory.create({encoding:toUnicode,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(cmap){return cmap instanceof _cmap.IdentityCMap?new _fonts.IdentityToUnicodeMap(0,
|
|
1433
|
+
65535):new _fonts.ToUnicodeMap(cmap.getMap())}):(0,_primitives.isStream)(toUnicode)?_cmap.CMapFactory.create({encoding:toUnicode,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(cmap){if(cmap instanceof _cmap.IdentityCMap)return new _fonts.IdentityToUnicodeMap(0,65535);var map=Array(cmap.length);cmap.forEach(function(charCode,token){if("number"===typeof token)map[charCode]=String.fromCodePoint(token);else{for(var str=[],k=0;k<token.length;k+=2){var w1=token.charCodeAt(k)<<8|token.charCodeAt(k+
|
|
1434
|
+
1);if(55296!==(w1&63488))str.push(w1);else{k+=2;var w2=token.charCodeAt(k)<<8|token.charCodeAt(k+1);str.push(((w1&1023)<<10)+(w2&1023)+65536)}}map[charCode]=String.fromCodePoint.apply(String,str)}});return new _fonts.ToUnicodeMap(map)}):Promise.resolve(null)},readCidToGidMap:function(glyphsData,toUnicode){for(var result=[],j=0,jj=glyphsData.length;j<jj;j++){var glyphID=glyphsData[j++]<<8|glyphsData[j],code=j>>1;if(0!==glyphID||toUnicode.has(code))result[code]=glyphID}return result},extractWidths:function(dict,
|
|
1435
|
+
descriptor,properties){var xref=this.xref,glyphsWidths=[],defaultWidth=0,glyphsVMetrics=[],ii,jj,widths;if(properties.composite){defaultWidth=dict.has("DW")?dict.get("DW"):1E3;if(widths=dict.get("W")){var i=0;for(ii=widths.length;i<ii;i++){descriptor=xref.fetchIfRef(widths[i++]);var code=xref.fetchIfRef(widths[i]);if(Array.isArray(code)){var j=0;for(jj=code.length;j<jj;j++)glyphsWidths[descriptor++]=xref.fetchIfRef(code[j])}else for(jj=xref.fetchIfRef(widths[++i]),j=descriptor;j<=code;j++)glyphsWidths[j]=
|
|
1436
|
+
jj}}if(properties.vertical){widths=dict.getArray("DW2")||[880,-1E3];var defaultVMetrics=[widths[1],.5*defaultWidth,widths[0]];if(widths=dict.get("W2"))for(i=0,ii=widths.length;i<ii;i++)if(descriptor=xref.fetchIfRef(widths[i++]),code=xref.fetchIfRef(widths[i]),Array.isArray(code))for(j=0,jj=code.length;j<jj;j++)glyphsVMetrics[descriptor++]=[xref.fetchIfRef(code[j++]),xref.fetchIfRef(code[j++]),xref.fetchIfRef(code[j])];else for(dict=[xref.fetchIfRef(widths[++i]),xref.fetchIfRef(widths[++i]),xref.fetchIfRef(widths[++i])],
|
|
1437
|
+
j=descriptor;j<=code;j++)glyphsVMetrics[j]=dict}}else if(i=properties.firstChar,widths=dict.get("Widths")){j=i;i=0;for(ii=widths.length;i<ii;i++)glyphsWidths[j++]=xref.fetchIfRef(widths[i]);defaultWidth=parseFloat(descriptor.get("MissingWidth"))||0}else xref=dict.get("BaseFont"),(0,_primitives.isName)(xref)&&(defaultWidth=this.getBaseFontMetrics(xref.name),glyphsWidths=this.buildCharCodeToWidth(defaultWidth.widths,properties),defaultWidth=defaultWidth.defaultWidth);xref=!0;dict=defaultWidth;for(var glyph in glyphsWidths)if(i=
|
|
1426
1438
|
glyphsWidths[glyph])if(!dict)dict=i;else if(dict!==i){xref=!1;break}xref&&(properties.flags|=_fonts.FontFlags.FixedPitch);properties.defaultWidth=defaultWidth;properties.widths=glyphsWidths;properties.defaultVMetrics=defaultVMetrics;properties.vmetrics=glyphsVMetrics},isSerifFont:function(baseFontName){baseFontName=baseFontName.split("-")[0];return baseFontName in(0,_standard_fonts.getSerifFonts)()||-1!==baseFontName.search(/serif/gi)},getBaseFontMetrics:function(name){var defaultWidth=0,widths=Object.create(null),
|
|
1427
1439
|
monospace=!1,lookupName=(0,_standard_fonts.getStdFontMap)()[name]||name,Metrics=(0,_metrics.getMetrics)();lookupName in Metrics||(lookupName=this.isSerifFont(name)?"Times-Roman":"Helvetica");name=Metrics[lookupName];(0,_util.isNum)(name)?(defaultWidth=name,monospace=!0):widths=name();return{defaultWidth:defaultWidth,monospace:monospace,widths:widths}},buildCharCodeToWidth:function(widthsByGlyphName,properties){var widths=Object.create(null),differences=properties.differences;properties=properties.defaultEncoding;
|
|
1428
1440
|
for(var charCode=0;256>charCode;charCode++)charCode in differences&&widthsByGlyphName[differences[charCode]]?widths[charCode]=widthsByGlyphName[differences[charCode]]:charCode in properties&&widthsByGlyphName[properties[charCode]]&&(widths[charCode]=widthsByGlyphName[properties[charCode]]);return widths},preEvaluateFont:function(dict){var baseDict=dict,type=dict.get("Subtype");if(!(0,_primitives.isName)(type))throw new _util.FormatError("invalid font Subtype");var composite=!1;if("Type0"===type.name){dict=
|
|
1429
|
-
dict.get("DescendantFonts");if(!dict)throw new _util.FormatError("Descendant fonts are not specified");dict=Array.isArray(dict)?this.xref.fetchIfRef(dict[0]):dict;type=dict.get("Subtype");if(!(0,_primitives.isName)(type))throw new _util.FormatError("invalid font Subtype");composite=!0}var descriptor=dict.get("FontDescriptor");if(descriptor){var hash=new _murmurhash.MurmurHash3_64;var uint8array=baseDict.getRaw("Encoding");if((0,_primitives.isName)(uint8array))hash.update(uint8array.name);else if((0,
|
|
1430
|
-
|
|
1431
|
-
diffEntry.
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
numArgs:
|
|
1452
|
-
numArgs:
|
|
1453
|
-
t.
|
|
1454
|
-
t.
|
|
1455
|
-
|
|
1456
|
-
t.
|
|
1457
|
-
t.
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1441
|
+
dict.get("DescendantFonts");if(!dict)throw new _util.FormatError("Descendant fonts are not specified");dict=Array.isArray(dict)?this.xref.fetchIfRef(dict[0]):dict;type=dict.get("Subtype");if(!(0,_primitives.isName)(type))throw new _util.FormatError("invalid font Subtype");composite=!0}var descriptor=dict.get("FontDescriptor");if(descriptor){var hash=new _murmurhash.MurmurHash3_64;var uint8array=baseDict.getRaw("Encoding");if((0,_primitives.isName)(uint8array))hash.update(uint8array.name);else if((0,_primitives.isRef)(uint8array))hash.update(uint8array.toString());
|
|
1442
|
+
else if((0,_primitives.isDict)(uint8array))for(var keys=uint8array.getKeys(),i=0,ii=keys.length;i<ii;i++){var entry=uint8array.getRaw(keys[i]);if((0,_primitives.isName)(entry))hash.update(entry.name);else if((0,_primitives.isRef)(entry))hash.update(entry.toString());else if(Array.isArray(entry)){for(var diffLength=entry.length,diffBuf=Array(diffLength),j=0;j<diffLength;j++){var diffEntry=entry[j];if((0,_primitives.isName)(diffEntry))diffBuf[j]=diffEntry.name;else if((0,_util.isNum)(diffEntry)||(0,_primitives.isRef)(diffEntry))diffBuf[j]=
|
|
1443
|
+
diffEntry.toString()}hash.update(diffBuf.join())}}uint8array=dict.get("FirstChar")||0;keys=dict.get("LastChar")||(composite?65535:255);hash.update("".concat(uint8array,"-").concat(keys));uint8array=dict.get("ToUnicode")||baseDict.get("ToUnicode");(0,_primitives.isStream)(uint8array)?(uint8array=uint8array.str||uint8array,uint8array=uint8array.buffer?new Uint8Array(uint8array.buffer.buffer,0,uint8array.bufferLength):new Uint8Array(uint8array.bytes.buffer,uint8array.start,uint8array.end-uint8array.start),
|
|
1444
|
+
hash.update(uint8array)):(0,_primitives.isName)(uint8array)&&hash.update(uint8array.name);if(uint8array=dict.get("Widths")||baseDict.get("Widths"))uint8array=new Uint8Array((new Uint32Array(uint8array)).buffer),hash.update(uint8array)}return{descriptor:descriptor,dict:dict,baseDict:baseDict,composite:composite,type:type.name,hash:hash?hash.hexdigest():""}},translateFont:function(preEvaluatedFont){var _this11=this,baseDict=preEvaluatedFont.baseDict,dict=preEvaluatedFont.dict,composite=preEvaluatedFont.composite,
|
|
1445
|
+
descriptor=preEvaluatedFont.descriptor,type=preEvaluatedFont.type;preEvaluatedFont=composite?65535:255;if(!descriptor)if("Type3"===type)descriptor=new _primitives.Dict(null),descriptor.set("FontName",_primitives.Name.get(type)),descriptor.set("FontBBox",dict.getArray("FontBBox"));else{var baseFontName=dict.get("BaseFont");if(!(0,_primitives.isName)(baseFontName))throw new _util.FormatError("Base font is not specified");baseFontName=baseFontName.name.replace(/[,_]/g,"-");var metrics=this.getBaseFontMetrics(baseFontName);
|
|
1446
|
+
composite=baseFontName.split("-")[0];composite=(this.isSerifFont(composite)?_fonts.FontFlags.Serif:0)|(metrics.monospace?_fonts.FontFlags.FixedPitch:0)|((0,_standard_fonts.getSymbolsFonts)()[composite]?_fonts.FontFlags.Symbolic:_fonts.FontFlags.Nonsymbolic);var properties$jscomp$0={type:type,name:baseFontName,widths:metrics.widths,defaultWidth:metrics.defaultWidth,flags:composite,firstChar:0,lastChar:preEvaluatedFont};return this.extractDataStructures(dict,dict,properties$jscomp$0).then(function(properties){properties.widths=
|
|
1447
|
+
_this11.buildCharCodeToWidth(metrics.widths,properties);return new _fonts.Font(baseFontName,null,properties)})}var firstChar=dict.get("FirstChar")||0,lastChar=dict.get("LastChar")||preEvaluatedFont,fontName=descriptor.get("FontName"),baseFont=dict.get("BaseFont");(0,_util.isString)(fontName)&&(fontName=_primitives.Name.get(fontName));(0,_util.isString)(baseFont)&&(baseFont=_primitives.Name.get(baseFont));if("Type3"!==type){var fontNameStr=fontName&&fontName.name,baseFontStr=baseFont&&baseFont.name;
|
|
1448
|
+
fontNameStr!==baseFontStr&&((0,_util.info)("The FontDescriptor's FontName is \"".concat(fontNameStr,'" but ')+"should be the same as the Font's BaseFont \"".concat(baseFontStr,'".')),fontNameStr&&baseFontStr&&baseFontStr.startsWith(fontNameStr)&&(fontName=baseFont))}fontName=fontName||baseFont;if(!(0,_primitives.isName)(fontName))throw new _util.FormatError("invalid font name");var fontFile=descriptor.get("FontFile","FontFile2","FontFile3");if(fontFile&&fontFile.dict){var subtype=fontFile.dict.get("Subtype");
|
|
1449
|
+
subtype&&(subtype=subtype.name);var length1=fontFile.dict.get("Length1"),length2=fontFile.dict.get("Length2"),length3=fontFile.dict.get("Length3")}properties$jscomp$0={type:type,name:fontName.name,subtype:subtype,file:fontFile,length1:length1,length2:length2,length3:length3,loadedName:baseDict.loadedName,composite:composite,wideChars:composite,fixedPitch:!1,fontMatrix:dict.getArray("FontMatrix")||_util.FONT_IDENTITY_MATRIX,firstChar:firstChar||0,lastChar:lastChar||preEvaluatedFont,bbox:descriptor.getArray("FontBBox"),
|
|
1450
|
+
ascent:descriptor.get("Ascent"),descent:descriptor.get("Descent"),xHeight:descriptor.get("XHeight"),capHeight:descriptor.get("CapHeight"),flags:descriptor.get("Flags"),italicAngle:descriptor.get("ItalicAngle"),isType3Font:!1};composite?(preEvaluatedFont=baseDict.get("Encoding"),(0,_primitives.isName)(preEvaluatedFont)&&(properties$jscomp$0.cidEncoding=preEvaluatedFont.name),preEvaluatedFont=_cmap.CMapFactory.create({encoding:preEvaluatedFont,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(cMap){properties$jscomp$0.cMap=
|
|
1451
|
+
cMap;properties$jscomp$0.vertical=properties$jscomp$0.cMap.vertical})):preEvaluatedFont=Promise.resolve(void 0);return preEvaluatedFont.then(function(){return _this11.extractDataStructures(dict,baseDict,properties$jscomp$0)}).then(function(properties){_this11.extractWidths(dict,descriptor,properties);"Type3"===type&&(properties.isType3Font=!0);return new _fonts.Font(fontName.name,fontFile,properties)})}};PartialEvaluator.buildFontPaths=function(font,glyphs,handler){function buildPath(fontChar){font.renderer.hasBuiltPath(fontChar)||
|
|
1452
|
+
handler.send("commonobj",["".concat(font.loadedName,"_path_").concat(fontChar),"FontPath",font.renderer.getPathJs(fontChar)])}var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _iterator=glyphs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var glyph=_step.value;buildPath(glyph.fontChar);var accent=glyph.accent;accent&&accent.fontChar&&buildPath(accent.fontChar)}}catch(err){_didIteratorError=!0,
|
|
1453
|
+
_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&null!=_iterator["return"])_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}};return PartialEvaluator}();exports.PartialEvaluator=PartialEvaluator;var TranslatedFont=function(){function TranslatedFont(loadedName,font,dict){this.loadedName=loadedName;this.font=font;this.dict=dict;this.type3Loaded=null;this.sent=!1}TranslatedFont.prototype={send:function(handler){this.sent||(this.sent=!0,handler.send("commonobj",[this.loadedName,
|
|
1454
|
+
"Font",this.font.exportData()]))},fallback:function(handler){this.font.data&&(this.font.disableFontFace=!0,PartialEvaluator.buildFontPaths(this.font,this.font.glyphCacheValues,handler))},loadType3Data:function(evaluator,resources,parentOperatorList,task){if(!this.font.isType3Font)throw Error("Must be a Type3 font.");if(this.type3Loaded)return this.type3Loaded;var type3Options=Object.create(evaluator.options);type3Options.ignoreErrors=!1;type3Options.nativeImageDecoderSupport=_util.NativeImageDecoding.NONE;
|
|
1455
|
+
var type3Evaluator=evaluator.clone(type3Options);type3Evaluator.parsingType3Font=!0;var translatedFont=this.font,loadCharProcsPromise=Promise.resolve(),charProcs=this.dict.get("CharProcs"),fontResources=this.dict.get("Resources")||resources,charProcKeys=charProcs.getKeys(),charProcOperatorList=Object.create(null);evaluator=function(){var key=charProcKeys[i];loadCharProcsPromise=loadCharProcsPromise.then(function(){var glyphStream=charProcs.get(key),operatorList=new _operator_list.OperatorList;return type3Evaluator.getOperatorList({stream:glyphStream,
|
|
1456
|
+
task:task,resources:fontResources,operatorList:operatorList}).then(function(){charProcOperatorList[key]=operatorList.getIR();parentOperatorList.addDependencies(operatorList.dependencies)})["catch"](function(reason){(0,_util.warn)('Type3 font resource "'.concat(key,'" is not available.'));reason=new _operator_list.OperatorList;charProcOperatorList[key]=reason.getIR()})})};var i=0;for(resources=charProcKeys.length;i<resources;++i)evaluator();return this.type3Loaded=loadCharProcsPromise.then(function(){translatedFont.charProcOperatorList=
|
|
1457
|
+
charProcOperatorList})}};return TranslatedFont}(),StateManager=function(){function StateManager(initialState){this.state=initialState;this.stateStack=[]}StateManager.prototype={save:function(){var old=this.state;this.stateStack.push(this.state);this.state=old.clone()},restore:function(){var prev=this.stateStack.pop();prev&&(this.state=prev)},transform:function(args){this.state.ctm=_util.Util.transform(this.state.ctm,args)}};return StateManager}(),TextState=function(){function TextState(){this.ctm=
|
|
1458
|
+
new Float32Array(_util.IDENTITY_MATRIX);this.fontName=null;this.fontSize=0;this.font=null;this.fontMatrix=_util.FONT_IDENTITY_MATRIX;this.textMatrix=_util.IDENTITY_MATRIX.slice();this.textLineMatrix=_util.IDENTITY_MATRIX.slice();this.leading=this.wordSpacing=this.charSpacing=0;this.textHScale=1;this.textRise=0}TextState.prototype={setTextMatrix:function(a,b,c,d,e,f){var m=this.textMatrix;m[0]=a;m[1]=b;m[2]=c;m[3]=d;m[4]=e;m[5]=f},setTextLineMatrix:function(a,b,c,d,e,f){var m=this.textLineMatrix;m[0]=
|
|
1459
|
+
a;m[1]=b;m[2]=c;m[3]=d;m[4]=e;m[5]=f},translateTextMatrix:function(x,y){var m=this.textMatrix;m[4]=m[0]*x+m[2]*y+m[4];m[5]=m[1]*x+m[3]*y+m[5]},translateTextLineMatrix:function(x,y){var m=this.textLineMatrix;m[4]=m[0]*x+m[2]*y+m[4];m[5]=m[1]*x+m[3]*y+m[5]},calcTextLineMatrixAdvance:function(a,b,c,d,e,f){var font=this.font;if(!font)return null;var m=this.textLineMatrix;if(a!==m[0]||b!==m[1]||c!==m[2]||d!==m[3])return null;e-=m[4];f-=m[5];if(font.vertical&&0!==e||!font.vertical&&0!==f)return null;m=
|
|
1460
|
+
a*d-b*c;font.vertical?(c=-f*c/m,a=f*a/m):(c=e*d/m,a=-e*b/m);return{width:c,height:a,value:font.vertical?a:c}},calcRenderMatrix:function(ctm){return _util.Util.transform(ctm,_util.Util.transform(this.textMatrix,[this.fontSize*this.textHScale,0,0,this.fontSize,0,this.textRise]))},carriageReturn:function(){this.translateTextLineMatrix(0,-this.leading);this.textMatrix=this.textLineMatrix.slice()},clone:function(){var clone=Object.create(this);clone.textMatrix=this.textMatrix.slice();clone.textLineMatrix=
|
|
1461
|
+
this.textLineMatrix.slice();clone.fontMatrix=this.fontMatrix.slice();return clone}};return TextState}(),EvalState=function(){function EvalState(){this.ctm=new Float32Array(_util.IDENTITY_MATRIX);this.font=null;this.textRenderingMode=_util.TextRenderingMode.FILL;this.strokeColorSpace=this.fillColorSpace=_colorspace.ColorSpace.singletons.gray}EvalState.prototype={clone:function(){return Object.create(this)}};return EvalState}(),EvaluatorPreprocessor=function(){function EvaluatorPreprocessor(stream,
|
|
1462
|
+
xref,stateManager){this.opMap=getOPMap();this.parser=new _parser.Parser({lexer:new _parser.Lexer(stream,this.opMap),xref:xref});this.stateManager=stateManager;this.nonProcessedArgs=[];this._numInvalidPathOPS=0}var getOPMap=(0,_core_utils.getLookupTableFactory)(function(t){t.w={id:_util.OPS.setLineWidth,numArgs:1,variableArgs:!1};t.J={id:_util.OPS.setLineCap,numArgs:1,variableArgs:!1};t.j={id:_util.OPS.setLineJoin,numArgs:1,variableArgs:!1};t.M={id:_util.OPS.setMiterLimit,numArgs:1,variableArgs:!1};
|
|
1463
|
+
t.d={id:_util.OPS.setDash,numArgs:2,variableArgs:!1};t.ri={id:_util.OPS.setRenderingIntent,numArgs:1,variableArgs:!1};t.i={id:_util.OPS.setFlatness,numArgs:1,variableArgs:!1};t.gs={id:_util.OPS.setGState,numArgs:1,variableArgs:!1};t.q={id:_util.OPS.save,numArgs:0,variableArgs:!1};t.Q={id:_util.OPS.restore,numArgs:0,variableArgs:!1};t.cm={id:_util.OPS.transform,numArgs:6,variableArgs:!1};t.m={id:_util.OPS.moveTo,numArgs:2,variableArgs:!1};t.l={id:_util.OPS.lineTo,numArgs:2,variableArgs:!1};t.c={id:_util.OPS.curveTo,
|
|
1464
|
+
numArgs:6,variableArgs:!1};t.v={id:_util.OPS.curveTo2,numArgs:4,variableArgs:!1};t.y={id:_util.OPS.curveTo3,numArgs:4,variableArgs:!1};t.h={id:_util.OPS.closePath,numArgs:0,variableArgs:!1};t.re={id:_util.OPS.rectangle,numArgs:4,variableArgs:!1};t.S={id:_util.OPS.stroke,numArgs:0,variableArgs:!1};t.s={id:_util.OPS.closeStroke,numArgs:0,variableArgs:!1};t.f={id:_util.OPS.fill,numArgs:0,variableArgs:!1};t.F={id:_util.OPS.fill,numArgs:0,variableArgs:!1};t["f*"]={id:_util.OPS.eoFill,numArgs:0,variableArgs:!1};
|
|
1465
|
+
t.B={id:_util.OPS.fillStroke,numArgs:0,variableArgs:!1};t["B*"]={id:_util.OPS.eoFillStroke,numArgs:0,variableArgs:!1};t.b={id:_util.OPS.closeFillStroke,numArgs:0,variableArgs:!1};t["b*"]={id:_util.OPS.closeEOFillStroke,numArgs:0,variableArgs:!1};t.n={id:_util.OPS.endPath,numArgs:0,variableArgs:!1};t.W={id:_util.OPS.clip,numArgs:0,variableArgs:!1};t["W*"]={id:_util.OPS.eoClip,numArgs:0,variableArgs:!1};t.BT={id:_util.OPS.beginText,numArgs:0,variableArgs:!1};t.ET={id:_util.OPS.endText,numArgs:0,variableArgs:!1};
|
|
1466
|
+
t.Tc={id:_util.OPS.setCharSpacing,numArgs:1,variableArgs:!1};t.Tw={id:_util.OPS.setWordSpacing,numArgs:1,variableArgs:!1};t.Tz={id:_util.OPS.setHScale,numArgs:1,variableArgs:!1};t.TL={id:_util.OPS.setLeading,numArgs:1,variableArgs:!1};t.Tf={id:_util.OPS.setFont,numArgs:2,variableArgs:!1};t.Tr={id:_util.OPS.setTextRenderingMode,numArgs:1,variableArgs:!1};t.Ts={id:_util.OPS.setTextRise,numArgs:1,variableArgs:!1};t.Td={id:_util.OPS.moveText,numArgs:2,variableArgs:!1};t.TD={id:_util.OPS.setLeadingMoveText,
|
|
1467
|
+
numArgs:2,variableArgs:!1};t.Tm={id:_util.OPS.setTextMatrix,numArgs:6,variableArgs:!1};t["T*"]={id:_util.OPS.nextLine,numArgs:0,variableArgs:!1};t.Tj={id:_util.OPS.showText,numArgs:1,variableArgs:!1};t.TJ={id:_util.OPS.showSpacedText,numArgs:1,variableArgs:!1};t["'"]={id:_util.OPS.nextLineShowText,numArgs:1,variableArgs:!1};t['"']={id:_util.OPS.nextLineSetSpacingShowText,numArgs:3,variableArgs:!1};t.d0={id:_util.OPS.setCharWidth,numArgs:2,variableArgs:!1};t.d1={id:_util.OPS.setCharWidthAndBounds,
|
|
1468
|
+
numArgs:6,variableArgs:!1};t.CS={id:_util.OPS.setStrokeColorSpace,numArgs:1,variableArgs:!1};t.cs={id:_util.OPS.setFillColorSpace,numArgs:1,variableArgs:!1};t.SC={id:_util.OPS.setStrokeColor,numArgs:4,variableArgs:!0};t.SCN={id:_util.OPS.setStrokeColorN,numArgs:33,variableArgs:!0};t.sc={id:_util.OPS.setFillColor,numArgs:4,variableArgs:!0};t.scn={id:_util.OPS.setFillColorN,numArgs:33,variableArgs:!0};t.G={id:_util.OPS.setStrokeGray,numArgs:1,variableArgs:!1};t.g={id:_util.OPS.setFillGray,numArgs:1,
|
|
1469
|
+
variableArgs:!1};t.RG={id:_util.OPS.setStrokeRGBColor,numArgs:3,variableArgs:!1};t.rg={id:_util.OPS.setFillRGBColor,numArgs:3,variableArgs:!1};t.K={id:_util.OPS.setStrokeCMYKColor,numArgs:4,variableArgs:!1};t.k={id:_util.OPS.setFillCMYKColor,numArgs:4,variableArgs:!1};t.sh={id:_util.OPS.shadingFill,numArgs:1,variableArgs:!1};t.BI={id:_util.OPS.beginInlineImage,numArgs:0,variableArgs:!1};t.ID={id:_util.OPS.beginImageData,numArgs:0,variableArgs:!1};t.EI={id:_util.OPS.endInlineImage,numArgs:1,variableArgs:!1};
|
|
1470
|
+
t.Do={id:_util.OPS.paintXObject,numArgs:1,variableArgs:!1};t.MP={id:_util.OPS.markPoint,numArgs:1,variableArgs:!1};t.DP={id:_util.OPS.markPointProps,numArgs:2,variableArgs:!1};t.BMC={id:_util.OPS.beginMarkedContent,numArgs:1,variableArgs:!1};t.BDC={id:_util.OPS.beginMarkedContentProps,numArgs:2,variableArgs:!1};t.EMC={id:_util.OPS.endMarkedContent,numArgs:0,variableArgs:!1};t.BX={id:_util.OPS.beginCompat,numArgs:0,variableArgs:!1};t.EX={id:_util.OPS.endCompat,numArgs:0,variableArgs:!1};t.BM=null;
|
|
1471
|
+
t.BD=null;t["true"]=null;t.fa=null;t.fal=null;t.fals=null;t["false"]=null;t.nu=null;t.nul=null;t["null"]=null});EvaluatorPreprocessor.prototype={get savedStatesDepth(){return this.stateManager.stateStack.length},read:function(operation){for(var args=operation.args;;){var obj=this.parser.getObj();if(obj instanceof _primitives.Cmd){var cmd=obj.cmd,opSpec=this.opMap[cmd];if(!opSpec){(0,_util.warn)('Unknown command "'.concat(cmd,'".'));continue}obj=opSpec.id;var numArgs=opSpec.numArgs,argsLength=null!==
|
|
1472
|
+
args?args.length:0;if(opSpec.variableArgs)argsLength>numArgs&&(0,_util.info)("Command ".concat(cmd,": expected [0, ").concat(numArgs,"] args, ")+"but received ".concat(argsLength," args."));else{if(argsLength!==numArgs){for(opSpec=this.nonProcessedArgs;argsLength>numArgs;)opSpec.push(args.shift()),argsLength--;for(;argsLength<numArgs&&0!==opSpec.length;)null===args&&(args=[]),args.unshift(opSpec.pop()),argsLength++}if(argsLength<numArgs){cmd="command ".concat(cmd,": expected ").concat(numArgs," args, ")+
|
|
1473
|
+
"but received ".concat(argsLength," args.");if(obj>=_util.OPS.moveTo&&obj<=_util.OPS.endPath&&20<++this._numInvalidPathOPS)throw new _util.FormatError("Invalid ".concat(cmd));(0,_util.warn)("Skipping ".concat(cmd));null!==args&&(args.length=0);continue}}this.preprocessCommand(obj,args);operation.fn=obj;operation.args=args;return!0}if(obj===_primitives.EOF)return!1;if(null!==obj&&(null===args&&(args=[]),args.push(obj),33<args.length))throw new _util.FormatError("Too many arguments");}},preprocessCommand:function(fn,
|
|
1474
|
+
args){switch(fn|0){case _util.OPS.save:this.stateManager.save();break;case _util.OPS.restore:this.stateManager.restore();break;case _util.OPS.transform:this.stateManager.transform(args)}}};return EvaluatorPreprocessor}()},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?
|
|
1475
|
+
"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,
|
|
1476
|
+
writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=
|
|
1477
|
+
descriptor.enumerable||!1;descriptor.configurable=!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.CMapFactory=exports.IdentityCMap=exports.CMap=void 0;var _util=__w_pdfjs_require__(5),
|
|
1478
|
+
_primitives=__w_pdfjs_require__(188),_parser=__w_pdfjs_require__(194),_core_utils=__w_pdfjs_require__(191),_stream=__w_pdfjs_require__(195),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".split(" "),
|
|
1467
1479
|
CMap=function(){function CMap(){var builtInCMap=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1;_classCallCheck(this,CMap);this.codespaceRanges=[[],[],[],[]];this.numCodespaceRanges=0;this._map=[];this.name="";this.vertical=!1;this.useCMap=null;this.builtInCMap=builtInCMap}_createClass(CMap,[{key:"addCodespaceRange",value:function(n,low,high){this.codespaceRanges[n-1].push(low,high);this.numCodespaceRanges++}},{key:"mapCidRange",value:function(low,high,dstLow){for(;low<=high;)this._map[low++]=
|
|
1468
1480
|
dstLow++}},{key:"mapBfRange",value:function(low,high,dstLow){for(var lastByte=dstLow.length-1;low<=high;)this._map[low++]=dstLow,dstLow=dstLow.substring(0,lastByte)+String.fromCharCode(dstLow.charCodeAt(lastByte)+1)}},{key:"mapBfRangeToArray",value:function(low,high,array){for(var i=0,ii=array.length;low<=high&&i<ii;)this._map[low]=array[i++],++low}},{key:"mapOne",value:function(src,dst){this._map[src]=dst}},{key:"lookup",value:function(code){return this._map[code]}},{key:"contains",value:function(code){return void 0!==
|
|
1469
1481
|
this._map[code]}},{key:"forEach",value:function(callback){var map=this._map,length=map.length;if(65536>=length)for(var i=0;i<length;i++)void 0!==map[i]&&callback(i,map[i]);else for(i in map)callback(i,map[i])}},{key:"charCodeOf",value:function(value){var map=this._map;if(65536>=map.length)return map.indexOf(value);for(var charCode in map)if(map[charCode]===value)return charCode|0;return-1}},{key:"getMap",value:function(){return this._map}},{key:"readCharCode",value:function(str,offset,out){for(var c=
|
|
@@ -1480,9 +1492,9 @@ b),addHex(start,end,b),stream.readHexNumber(end,b),addHex(end,start,b),cMap.addC
|
|
|
1480
1492
|
1;i<subitemsCount;i++)incHex(_char4,b),sequence||(stream.readHexNumber(tmp,b),addHex(_char4,tmp,b)),code=stream.readSigned()+(code+1),cMap.mapOne(hexToInt(_char4,b),code);break;case 3:stream.readHex(start,b);stream.readHexNumber(end,b);addHex(end,start,b);code=stream.readNumber();cMap.mapCidRange(hexToInt(start,b),hexToInt(end,b),code);for(i=1;i<subitemsCount;i++)incHex(end,b),sequence?start.set(end):(stream.readHexNumber(start,b),addHex(start,end,b)),stream.readHexNumber(end,b),addHex(end,start,
|
|
1481
1493
|
b),code=stream.readNumber(),cMap.mapCidRange(hexToInt(start,b),hexToInt(end,b),code);break;case 4:stream.readHex(_char4,1);stream.readHex(charCode,b);cMap.mapOne(hexToInt(_char4,1),hexToStr(charCode,b));for(i=1;i<subitemsCount;i++)incHex(_char4,1),sequence||(stream.readHexNumber(tmp,1),addHex(_char4,tmp,1)),incHex(charCode,b),stream.readHexSigned(tmp,b),addHex(charCode,tmp,b),cMap.mapOne(hexToInt(_char4,1),hexToStr(charCode,b));break;case 5:stream.readHex(start,1);stream.readHexNumber(end,1);addHex(end,
|
|
1482
1494
|
start,1);stream.readHex(charCode,b);cMap.mapBfRange(hexToInt(start,1),hexToInt(end,1),hexToStr(charCode,b));for(i=1;i<subitemsCount;i++)incHex(end,1),sequence?start.set(end):(stream.readHexNumber(start,1),addHex(start,end,1)),stream.readHexNumber(end,1),addHex(end,start,1),stream.readHex(charCode,b),cMap.mapBfRange(hexToInt(start,1),hexToInt(end,1),hexToStr(charCode,b));break;default:reject(Error("processBinaryCMap: Unknown type: "+code));return}}header?resolve(extend(header)):resolve(cMap)})}};return BinaryCMapReader}();
|
|
1483
|
-
module=function(){function strToInt(str){for(var a=0,i=0;i<str.length;i++)a=a<<8|str.charCodeAt(i);return a>>>0}function expectString(obj){if(!(0,_util.isString)(obj))throw new _util.FormatError("Malformed CMap: expected string.");}function expectInt(obj){if(!Number.isInteger(obj))throw new _util.FormatError("Malformed CMap: expected int.");}function parseCMap(cMap$jscomp$0,lexer$jscomp$0,fetchBuiltInCMap,useCMap){a:for(;;)try{var obj=lexer$jscomp$0.getObj();if((0,_primitives.isEOF)(obj))break;else if((0,
|
|
1484
|
-
|
|
1485
|
-
|
|
1495
|
+
module=function(){function strToInt(str){for(var a=0,i=0;i<str.length;i++)a=a<<8|str.charCodeAt(i);return a>>>0}function expectString(obj){if(!(0,_util.isString)(obj))throw new _util.FormatError("Malformed CMap: expected string.");}function expectInt(obj){if(!Number.isInteger(obj))throw new _util.FormatError("Malformed CMap: expected int.");}function parseCMap(cMap$jscomp$0,lexer$jscomp$0,fetchBuiltInCMap,useCMap){a:for(;;)try{var obj=lexer$jscomp$0.getObj();if((0,_primitives.isEOF)(obj))break;else if((0,_primitives.isName)(obj)){if("WMode"===
|
|
1496
|
+
obj.name){var cMap=cMap$jscomp$0,obj$jscomp$0=lexer$jscomp$0.getObj();Number.isInteger(obj$jscomp$0)&&(cMap.vertical=!!obj$jscomp$0)}else if("CMapName"===obj.name){cMap=cMap$jscomp$0;var obj$jscomp$1=lexer$jscomp$0.getObj();(0,_primitives.isName)(obj$jscomp$1)&&(0,_util.isString)(obj$jscomp$1.name)&&(cMap.name=obj$jscomp$1.name)}var previous=obj}else if((0,_primitives.isCmd)(obj))switch(obj.cmd){case "endcmap":break a;case "usecmap":if((0,_primitives.isName)(previous))var embeddedUseCMap=previous.name;
|
|
1497
|
+
break;case "begincodespacerange":b:{cMap=cMap$jscomp$0;for(var lexer=lexer$jscomp$0;;){var obj$jscomp$2=lexer.getObj();if((0,_primitives.isEOF)(obj$jscomp$2))break;if((0,_primitives.isCmd)(obj$jscomp$2,"endcodespacerange"))break b;if(!(0,_util.isString)(obj$jscomp$2))break;var low=strToInt(obj$jscomp$2);obj$jscomp$2=lexer.getObj();if(!(0,_util.isString)(obj$jscomp$2))break;var high=strToInt(obj$jscomp$2);cMap.addCodespaceRange(obj$jscomp$2.length,low,high)}throw new _util.FormatError("Invalid codespace range.");
|
|
1486
1498
|
}break;case "beginbfchar":b:for(cMap=cMap$jscomp$0,lexer=lexer$jscomp$0;;){var obj$jscomp$3=lexer.getObj();if((0,_primitives.isEOF)(obj$jscomp$3))break;if((0,_primitives.isCmd)(obj$jscomp$3,"endbfchar"))break b;expectString(obj$jscomp$3);var src=strToInt(obj$jscomp$3);obj$jscomp$3=lexer.getObj();expectString(obj$jscomp$3);cMap.mapOne(src,obj$jscomp$3)}break;case "begincidchar":b:for(cMap=cMap$jscomp$0,lexer=lexer$jscomp$0;;){var obj$jscomp$4=lexer.getObj();if((0,_primitives.isEOF)(obj$jscomp$4))break;
|
|
1487
1499
|
if((0,_primitives.isCmd)(obj$jscomp$4,"endcidchar"))break b;expectString(obj$jscomp$4);var src$jscomp$0=strToInt(obj$jscomp$4);obj$jscomp$4=lexer.getObj();expectInt(obj$jscomp$4);cMap.mapOne(src$jscomp$0,obj$jscomp$4)}break;case "beginbfrange":b:{cMap=cMap$jscomp$0;for(lexer=lexer$jscomp$0;;){var obj$jscomp$5=lexer.getObj();if((0,_primitives.isEOF)(obj$jscomp$5))break;if((0,_primitives.isCmd)(obj$jscomp$5,"endbfrange"))break b;expectString(obj$jscomp$5);var low$jscomp$0=strToInt(obj$jscomp$5);obj$jscomp$5=
|
|
1488
1500
|
lexer.getObj();expectString(obj$jscomp$5);var high$jscomp$0=strToInt(obj$jscomp$5);obj$jscomp$5=lexer.getObj();if(Number.isInteger(obj$jscomp$5)||(0,_util.isString)(obj$jscomp$5)){var dstLow=Number.isInteger(obj$jscomp$5)?String.fromCharCode(obj$jscomp$5):obj$jscomp$5;cMap.mapBfRange(low$jscomp$0,high$jscomp$0,dstLow)}else if((0,_primitives.isCmd)(obj$jscomp$5,"[")){obj$jscomp$5=lexer.getObj();for(var array=[];!(0,_primitives.isCmd)(obj$jscomp$5,"]")&&!(0,_primitives.isEOF)(obj$jscomp$5);)array.push(obj$jscomp$5),
|
|
@@ -1492,14 +1504,13 @@ newCMap;if(0===cMap.numCodespaceRanges){newCMap=cMap.useCMap.codespaceRanges;for
|
|
|
1492
1504
|
BUILT_IN_CMAPS.includes(name)?fetchBuiltInCMap?fetchBuiltInCMap(name).then(function(data){var cMapData=data.cMapData;data=data.compressionType;var cMap=new CMap(!0);return data===_util.CMapCompressionType.BINARY?(new BinaryCMapReader).process(cMapData,cMap,function(useCMap){return extendCMap(cMap,fetchBuiltInCMap,useCMap)}):data===_util.CMapCompressionType.NONE?(cMapData=new _parser.Lexer(new _stream.Stream(cMapData)),parseCMap(cMap,cMapData,fetchBuiltInCMap,null)):Promise.reject(Error("TODO: Only BINARY/NONE CMap compression is currently supported."))}):
|
|
1493
1505
|
Promise.reject(Error("Built-in CMap parameters are not provided.")):Promise.reject(Error("Unknown CMap name: "+name))}return{create:function(params){var encoding=params.encoding,fetchBuiltInCMap=params.fetchBuiltInCMap;params=params.useCMap;if((0,_primitives.isName)(encoding))return createBuiltInCMap(encoding.name,fetchBuiltInCMap);if((0,_primitives.isStream)(encoding)){var cMap=new CMap;encoding=new _parser.Lexer(encoding);return parseCMap(cMap,encoding,fetchBuiltInCMap,params).then(function(parsedCMap){return parsedCMap.isIdentityCMap?
|
|
1494
1506
|
createBuiltInCMap(parsedCMap.name,fetchBuiltInCMap):parsedCMap})}return Promise.reject(Error("Encoding required."))}}}();exports.CMapFactory=module},function(module,exports,__w_pdfjs_require__){function adjustWidths(properties){if(properties.fontMatrix&&properties.fontMatrix[0]!==_util.FONT_IDENTITY_MATRIX[0]){var scale=.001/properties.fontMatrix[0],glyphsWidths=properties.widths,glyph;for(glyph in glyphsWidths)glyphsWidths[glyph]*=scale;properties.defaultWidth*=scale}}function adjustToUnicode(properties,
|
|
1495
|
-
builtInEncoding){if(!(properties.hasIncludedToUnicodeMap||properties.hasEncoding||builtInEncoding===properties.defaultEncoding||properties.toUnicode instanceof IdentityToUnicodeMap)){var toUnicode=[],glyphsUnicodeMap=(0,_glyphlist.getGlyphsUnicode)(),charCode;for(charCode in builtInEncoding){var
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
".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".split(" "),
|
|
1507
|
+
builtInEncoding){if(!(properties.hasIncludedToUnicodeMap||properties.hasEncoding||builtInEncoding===properties.defaultEncoding||properties.toUnicode instanceof IdentityToUnicodeMap)){var toUnicode=[],glyphsUnicodeMap=(0,_glyphlist.getGlyphsUnicode)(),charCode;for(charCode in builtInEncoding){var unicode=(0,_unicode.getUnicodeForGlyph)(builtInEncoding[charCode],glyphsUnicodeMap);-1!==unicode&&(toUnicode[charCode]=String.fromCharCode(unicode))}properties.toUnicode.amend(toUnicode)}}function getFontType(type,
|
|
1508
|
+
subtype){switch(type){case "Type1":return"Type1C"===subtype?_util.FontType.TYPE1C:_util.FontType.TYPE1;case "CIDFontType0":return"CIDFontType0C"===subtype?_util.FontType.CIDFONTTYPE0C:_util.FontType.CIDFONTTYPE0;case "OpenType":return _util.FontType.OPENTYPE;case "TrueType":return _util.FontType.TRUETYPE;case "CIDFontType2":return _util.FontType.CIDFONTTYPE2;case "MMType1":return _util.FontType.MMTYPE1;case "Type0":return _util.FontType.TYPE0;default:return _util.FontType.UNKNOWN}}function recoverGlyphName(name,
|
|
1509
|
+
glyphsUnicodeMap){if(void 0!==glyphsUnicodeMap[name])return name;var unicode=(0,_unicode.getUnicodeForGlyph)(name,glyphsUnicodeMap);if(-1!==unicode)for(var key in glyphsUnicodeMap)if(glyphsUnicodeMap[key]===unicode)return key;(0,_util.info)("Unable to recover a standard glyph name for: "+name);return name}function type1FontGlyphMapping(properties,builtInEncoding,glyphNames){var charCodeToGlyphId=Object.create(null),charCode;var baseEncoding=!!(properties.flags&FontFlags.Symbolic);if(properties.baseEncodingName)for(baseEncoding=
|
|
1510
|
+
(0,_encodings.getEncoding)(properties.baseEncodingName),charCode=0;charCode<baseEncoding.length;charCode++)builtInEncoding=glyphNames.indexOf(baseEncoding[charCode]),charCodeToGlyphId[charCode]=0<=builtInEncoding?builtInEncoding:0;else if(baseEncoding)for(charCode in builtInEncoding)charCodeToGlyphId[charCode]=builtInEncoding[charCode];else for(baseEncoding=_encodings.StandardEncoding,charCode=0;charCode<baseEncoding.length;charCode++)builtInEncoding=glyphNames.indexOf(baseEncoding[charCode]),charCodeToGlyphId[charCode]=
|
|
1511
|
+
0<=builtInEncoding?builtInEncoding:0;properties=properties.differences;var glyphsUnicodeMap;if(properties)for(charCode in properties){baseEncoding=properties[charCode];builtInEncoding=glyphNames.indexOf(baseEncoding);if(-1===builtInEncoding){glyphsUnicodeMap||(glyphsUnicodeMap=(0,_glyphlist.getGlyphsUnicode)());var standardGlyphName=recoverGlyphName(baseEncoding,glyphsUnicodeMap);standardGlyphName!==baseEncoding&&(builtInEncoding=glyphNames.indexOf(standardGlyphName))}charCodeToGlyphId[charCode]=
|
|
1512
|
+
0<=builtInEncoding?builtInEncoding:0}return charCodeToGlyphId}Object.defineProperty(exports,"__esModule",{value:!0});exports.getFontType=getFontType;exports.IdentityToUnicodeMap=exports.ToUnicodeMap=exports.FontFlags=exports.Font=exports.ErrorFont=exports.SEAC_ANALYSIS_ENABLED=void 0;var _util=__w_pdfjs_require__(5),_cff_parser=__w_pdfjs_require__(212),_glyphlist=__w_pdfjs_require__(215),_encodings=__w_pdfjs_require__(214),_standard_fonts=__w_pdfjs_require__(216),_unicode=__w_pdfjs_require__(217),
|
|
1513
|
+
_font_renderer=__w_pdfjs_require__(218),_cmap=__w_pdfjs_require__(210),_core_utils=__w_pdfjs_require__(191),_stream=__w_pdfjs_require__(195),_type1_parser=__w_pdfjs_require__(219),PRIVATE_USE_AREAS=[[57344,63743],[1048576,1114109]];exports.SEAC_ANALYSIS_ENABLED=!0;var FontFlags={FixedPitch:1,Serif:2,Symbolic:4,Script:8,Nonsymbolic:32,Italic:64,AllCap:65536,SmallCap:131072,ForceBold:262144};exports.FontFlags=FontFlags;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".split(" "),
|
|
1503
1514
|
Glyph=function(){function Glyph(fontChar,unicode,accent,width,vmetric,operatorListId,isSpace,isInFont){this.fontChar=fontChar;this.unicode=unicode;this.accent=accent;this.width=width;this.vmetric=vmetric;this.operatorListId=operatorListId;this.isSpace=isSpace;this.isInFont=isInFont}Glyph.prototype.matchesForCache=function(fontChar,unicode,accent,width,vmetric,operatorListId,isSpace,isInFont){return this.fontChar===fontChar&&this.unicode===unicode&&this.accent===accent&&this.width===width&&this.vmetric===
|
|
1504
1515
|
vmetric&&this.operatorListId===operatorListId&&this.isSpace===isSpace&&this.isInFont===isInFont};return Glyph}(),ToUnicodeMap=function(){function ToUnicodeMap(){this._map=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]}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 void 0!==this._map[i]},get:function(i){return this._map[i]},charCodeOf:function(value){var map=
|
|
1505
1516
|
this._map;if(65536>=map.length)return map.indexOf(value);for(var charCode in map)if(map[charCode]===value)return charCode|0;return-1},amend:function(map){for(var charCode in map)this._map[charCode]=map[charCode]}};return ToUnicodeMap}();exports.ToUnicodeMap=ToUnicodeMap;var IdentityToUnicodeMap=function(){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=
|
|
@@ -1529,95 +1540,94 @@ jj;++j)glyphsIds+=string16(codes[j])}0<trailingRangesCount&&(endCount+="\u00ff\u
|
|
|
1529
1540
|
12)}return numGlyphs+"\x00\u0004"+string16(trailingRangesCount.length+4)+trailingRangesCount+i+segCount}function validateOS2Table(os2){var stream=new _stream.Stream(os2.data),version=stream.getUint16();stream.getBytes(60);var selection=stream.getUint16();if(4>version&&selection&768)return!1;version=stream.getUint16();selection=stream.getUint16();if(version>selection)return!1;stream.getBytes(6);if(0===stream.getUint16())return!1;os2.data[8]=os2.data[9]=0;return!0}function createOS2Table(properties,
|
|
1530
1541
|
charstrings,override){override=override||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};var ulUnicodeRange1=0,ulUnicodeRange2=0,ulUnicodeRange3=0,ulUnicodeRange4=0,firstCharIndex=null,lastCharIndex=0;if(charstrings){for(var code in charstrings){code|=0;if(firstCharIndex>code||!firstCharIndex)firstCharIndex=code;lastCharIndex<code&&(lastCharIndex=code);charstrings=(0,_unicode.getUnicodeRangeFor)(code);if(32>charstrings)ulUnicodeRange1|=1<<charstrings;else if(64>charstrings)ulUnicodeRange2|=1<<charstrings-
|
|
1531
1542
|
32;else if(96>charstrings)ulUnicodeRange3|=1<<charstrings-64;else if(123>charstrings)ulUnicodeRange4|=1<<charstrings-96;else throw new _util.FormatError("Unicode ranges Bits > 123 are reserved for internal usage");}65535<lastCharIndex&&(lastCharIndex=65535)}else firstCharIndex=0,lastCharIndex=255;charstrings=properties.bbox||[0,0,0,0];code=override.unitsPerEm||1/(properties.fontMatrix||_util.FONT_IDENTITY_MATRIX)[0];var scale=properties.ascentScaled?1:code/1E3;code=override.ascent||Math.round(scale*
|
|
1532
|
-
(properties.ascent||charstrings[3]));scale=override.descent||Math.round(scale*(properties.descent||charstrings[1]));0<scale&&0<properties.descent&&0>charstrings[1]&&(scale=-scale);charstrings=override.yMax||code;override=-override.yMin||-scale;return"\x00\u0003\u0002$\u0001\u00f4\x00\u0005\x00\x00\u0002\u008a\u0002\u00bb\x00\x00\x00\u008c\u0002\u008a\u0002\u00bb\x00\x00\u0001\u00df\x001\u0001\u0002\x00\x00\x00\x00\u0006"+String.fromCharCode(properties.fixedPitch?9:0)+"\x00\x00\x00\x00\x00\x00"+(0,
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
this.
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
ttContext
|
|
1575
|
-
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
this.
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
file.
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
return(new _cff_parser.CFFCompiler(cff)).compile()}};return Type1Font}(),CFFFont=function(){function CFFFont(file,properties){this.properties=properties;this.cff=(new _cff_parser.CFFParser(file,properties,!0)).parse();this.cff.duplicateFirstGlyph();var compiler=new _cff_parser.CFFCompiler(this.cff);this.seacs=this.cff.seacs;try{this.data=compiler.compile()}catch(e){(0,_util.warn)("Failed to compile font "+properties.loadedName),this.data=file}}CFFFont.prototype={get numGlyphs(){return this.cff.charStrings.count},
|
|
1543
|
+
(properties.ascent||charstrings[3]));scale=override.descent||Math.round(scale*(properties.descent||charstrings[1]));0<scale&&0<properties.descent&&0>charstrings[1]&&(scale=-scale);charstrings=override.yMax||code;override=-override.yMin||-scale;return"\x00\u0003\u0002$\u0001\u00f4\x00\u0005\x00\x00\u0002\u008a\u0002\u00bb\x00\x00\x00\u008c\u0002\u008a\u0002\u00bb\x00\x00\u0001\u00df\x001\u0001\u0002\x00\x00\x00\x00\u0006"+String.fromCharCode(properties.fixedPitch?9:0)+"\x00\x00\x00\x00\x00\x00"+(0,_util.string32)(ulUnicodeRange1)+
|
|
1544
|
+
(0,_util.string32)(ulUnicodeRange2)+(0,_util.string32)(ulUnicodeRange3)+(0,_util.string32)(ulUnicodeRange4)+"*21*"+string16(properties.italicAngle?1:0)+string16(firstCharIndex||properties.firstChar)+string16(lastCharIndex||properties.lastChar)+string16(code)+string16(scale)+"\x00d"+string16(charstrings)+string16(override)+"\x00\x00\x00\x00\x00\x00\x00\x00"+string16(properties.xHeight)+string16(properties.capHeight)+string16(0)+string16(firstCharIndex||properties.firstChar)+"\x00\u0003"}function createPostTable(properties){return"\x00\u0003\x00\x00"+
|
|
1545
|
+
(0,_util.string32)(Math.floor(properties.italicAngle*Math.pow(2,16)))+"\x00\x00\x00\x00"+(0,_util.string32)(properties.fixedPitch)+"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}function createNameTable(name,proto){proto||(proto=[[],[]]);name=[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=
|
|
1546
|
+
[],ii,jj;var i=0;for(ii=name.length;i<ii;i++){var str=proto[1][i]||name[i];var strBufUnicode=[];var j=0;for(jj=str.length;j<jj;j++)strBufUnicode.push(string16(str.charCodeAt(j)));stringsUnicode.push(strBufUnicode.join(""))}proto=[name,stringsUnicode];strBufUnicode=["\x00\u0001","\x00\u0003"];var encodings=["\x00\x00","\x00\u0001"],languages=["\x00\x00","\u0004\t"];i=name.length*strBufUnicode.length;var nameTable="\x00\x00"+string16(i)+string16(12*i+6),strOffset=0;i=0;for(ii=strBufUnicode.length;i<
|
|
1547
|
+
ii;i++){var strs=proto[i];j=0;for(jj=strs.length;j<jj;j++){str=strs[j];var nameRecord=strBufUnicode[i]+encodings[i]+languages[i]+string16(j)+string16(str.length)+string16(strOffset);nameTable+=nameRecord;strOffset+=str.length}}return nameTable+=name.join("")+stringsUnicode.join("")}Font.getFontID=function(){var ID=1;return function(){return String(ID++)}}();Font.prototype={name:null,font:null,mimetype:null,encoding:null,disableFontFace:!1,get renderer(){var renderer=_font_renderer.FontRendererFactory.create(this,
|
|
1548
|
+
!0);return(0,_util.shadow)(this,"renderer",renderer)},exportData:function(){var data={},i;for(i in this)this.hasOwnProperty(i)&&(data[i]=this[i]);return data},fallbackToSystemFont:function(properties){var _this=this;this.missingFile=!0;var unicode,name=this.name,type=this.type,subtype=this.subtype,fontName=name.replace(/[,_]/g,"-"),stdFontMap=(0,_standard_fonts.getStdFontMap)(),nonStdFontMap=(0,_standard_fonts.getNonStdFontMap)(),isStandardFont=!!stdFontMap[fontName]||!(!nonStdFontMap[fontName]||
|
|
1549
|
+
!stdFontMap[nonStdFontMap[fontName]]);fontName=stdFontMap[fontName]||nonStdFontMap[fontName]||fontName;this.bold=-1!==fontName.search(/bold/gi);this.italic=-1!==fontName.search(/oblique/gi)||-1!==fontName.search(/italic/gi);this.black=-1!==name.search(/Black/g);this.remeasure=0<Object.keys(this.widths).length;if(isStandardFont&&"CIDFontType2"===type&&this.cidEncoding.startsWith("Identity-")){var cidToGidMap=properties.cidToGidMap,map=[];applyStandardFontGlyphMap(map,(0,_standard_fonts.getGlyphMapForStandardFonts)());
|
|
1550
|
+
/Arial-?Black/i.test(name)?applyStandardFontGlyphMap(map,(0,_standard_fonts.getSupplementalGlyphMapForArialBlack)()):/Calibri/i.test(name)&&applyStandardFontGlyphMap(map,(0,_standard_fonts.getSupplementalGlyphMapForCalibri)());if(cidToGidMap){for(var _charCode in map)name=map[_charCode],void 0!==cidToGidMap[name]&&(map[+_charCode]=cidToGidMap[name]);cidToGidMap.length!==this.toUnicode.length&&properties.hasIncludedToUnicodeMap&&this.toUnicode instanceof IdentityToUnicodeMap&&this.toUnicode.forEach(function(charCode,
|
|
1551
|
+
unicodeCharCode){void 0===cidToGidMap[map[charCode]]&&(map[+charCode]=unicodeCharCode)})}this.toUnicode instanceof IdentityToUnicodeMap||this.toUnicode.forEach(function(charCode,unicodeCharCode){map[+charCode]=unicodeCharCode});this.toFontChar=map;this.toUnicode=new ToUnicodeMap(map)}else if(/Symbol/i.test(fontName))this.toFontChar=buildToFontChar(_encodings.SymbolSetEncoding,(0,_glyphlist.getGlyphsUnicode)(),this.differences);else if(/Dingbats/i.test(fontName))/Wingdings/i.test(name)&&(0,_util.warn)("Non-embedded Wingdings font, falling back to ZapfDingbats."),
|
|
1552
|
+
this.toFontChar=buildToFontChar(_encodings.ZapfDingbatsEncoding,(0,_glyphlist.getDingbatsGlyphsUnicode)(),this.differences);else if(isStandardFont)this.toFontChar=buildToFontChar(this.defaultEncoding,(0,_glyphlist.getGlyphsUnicode)(),this.differences);else{var glyphsUnicodeMap=(0,_glyphlist.getGlyphsUnicode)(),_map=[];this.toUnicode.forEach(function(charCode,unicodeCharCode){_this.composite||(unicode=(0,_unicode.getUnicodeForGlyph)(_this.differences[charCode]||_this.defaultEncoding[charCode],glyphsUnicodeMap),
|
|
1553
|
+
-1!==unicode&&(unicodeCharCode=unicode));_map[+charCode]=unicodeCharCode});this.composite&&this.toUnicode instanceof IdentityToUnicodeMap&&/Verdana/i.test(name)&&applyStandardFontGlyphMap(_map,(0,_standard_fonts.getGlyphMapForStandardFonts)());this.toFontChar=_map}this.loadedName=fontName.split("-")[0];this.fontType=getFontType(type,subtype)},checkAndRepair:function(name,font$jscomp$0,properties$jscomp$0){function readTables(file,numTables){file=Object.create(null);file["OS/2"]=null;file.cmap=null;
|
|
1554
|
+
file.head=null;file.hhea=null;file.hmtx=null;file.maxp=null;file.name=null;file.post=null;for(var i=0;i<numTables;i++){var table=font$jscomp$0;var tag=(0,_util.bytesToString)(table.getBytes(4)),checksum=table.getInt32()>>>0,offset=table.getInt32()>>>0,length=table.getInt32()>>>0,previousPosition=table.pos;table.pos=table.start?table.start:0;table.skip(offset);var data=table.getBytes(length);table.pos=previousPosition;"head"===tag&&(data[8]=data[9]=data[10]=data[11]=0,data[17]|=32);table={tag:tag,
|
|
1555
|
+
checksum:checksum,length:length,offset:offset,data:data};VALID_TABLES.includes(table.tag)&&0!==table.length&&(file[table.tag]=table)}return file}function readOpenTypeHeader(ttf){return{version:(0,_util.bytesToString)(ttf.getBytes(4)),numTables:ttf.getUint16(),searchRange:ttf.getUint16(),entrySelector:ttf.getUint16(),rangeShift:ttf.getUint16()}}function readTrueTypeCollectionData(ttc,fontName){a:{var _readTrueTypeCollecti=(0,_util.bytesToString)(ttc.getBytes(4));(0,_util.assert)("ttcf"===_readTrueTypeCollecti,
|
|
1556
|
+
"Must be a TrueType Collection font.");for(var majorVersion=ttc.getUint16(),minorVersion=ttc.getUint16(),numFonts=ttc.getInt32()>>>0,offsetTable=[],i=0;i<numFonts;i++)offsetTable.push(ttc.getInt32()>>>0);_readTrueTypeCollecti={ttcTag:_readTrueTypeCollecti,majorVersion:majorVersion,minorVersion:minorVersion,numFonts:numFonts,offsetTable:offsetTable};switch(majorVersion){case 1:break a;case 2:_readTrueTypeCollecti.dsigTag=ttc.getInt32()>>>0;_readTrueTypeCollecti.dsigLength=ttc.getInt32()>>>0;_readTrueTypeCollecti.dsigOffset=
|
|
1557
|
+
ttc.getInt32()>>>0;break a}throw new _util.FormatError("Invalid TrueType Collection majorVersion: ".concat(majorVersion,"."));}majorVersion=_readTrueTypeCollecti.numFonts;_readTrueTypeCollecti=_readTrueTypeCollecti.offsetTable;for(minorVersion=0;minorVersion<majorVersion;minorVersion++){ttc.pos=(ttc.start||0)+_readTrueTypeCollecti[minorVersion];numFonts=readOpenTypeHeader(ttc);offsetTable=readTables(ttc,numFonts.numTables);if(!offsetTable.name)throw new _util.FormatError('TrueType Collection font must contain a "name" table.');
|
|
1558
|
+
i=readNameTable(offsetTable.name);for(var j=0,jj=i.length;j<jj;j++)for(var k=0,kk=i[j].length;k<kk;k++){var nameEntry=i[j][k];if(nameEntry&&nameEntry.replace(/\s/g,"")===fontName)return{header:numFonts,tables:offsetTable}}}throw new _util.FormatError('TrueType Collection does not contain "'.concat(fontName,'" font.'));}function readCmapTable(cmap,font,isSymbolicFont,hasEncoding){if(!cmap)return(0,_util.warn)("No cmap table available."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};var segment;
|
|
1559
|
+
cmap=(font.start?font.start:0)+cmap.offset;font.pos=cmap;font.getUint16();var numTables=font.getUint16(),potentialTable,canBreak=!1;for(segment=0;segment<numTables;segment++){var platformId=font.getUint16(),encodingId=font.getUint16(),offset=font.getInt32()>>>0,useTable=!1;if(!potentialTable||potentialTable.platformId!==platformId||potentialTable.encodingId!==encodingId)if(0===platformId&&0===encodingId?useTable=!0:1===platformId&&0===encodingId?useTable=!0:3!==platformId||1!==encodingId||!hasEncoding&&
|
|
1560
|
+
potentialTable?isSymbolicFont&&3===platformId&&0===encodingId&&(canBreak=useTable=!0):(useTable=!0,isSymbolicFont||(canBreak=!0)),useTable&&(potentialTable={platformId:platformId,encodingId:encodingId,offset:offset}),canBreak)break}potentialTable&&(font.pos=cmap+potentialTable.offset);if(!potentialTable||-1===font.peekByte())return(0,_util.warn)("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};cmap=font.getUint16();font.getUint16();font.getUint16();
|
|
1561
|
+
hasEncoding=!1;isSymbolicFont=[];if(0===cmap){for(segment=0;256>segment;segment++)(hasEncoding=font.getByte())&&isSymbolicFont.push({charCode:segment,glyphId:hasEncoding});hasEncoding=!0}else if(2===cmap){cmap=[];for(numTables=segment=0;256>numTables;numTables++)canBreak=font.getUint16()>>3,cmap.push(canBreak),segment=Math.max(canBreak,segment);canBreak=[];for(numTables=0;numTables<=segment;numTables++)canBreak.push({firstCode:font.getUint16(),entryCount:font.getUint16(),idDelta:signedInt16(font.getByte(),
|
|
1562
|
+
font.getByte()),idRangePos:font.pos+font.getUint16()});for(platformId=0;256>platformId;platformId++)if(0===cmap[platformId])font.pos=canBreak[0].idRangePos+2*platformId,numTables=font.getUint16(),isSymbolicFont.push({charCode:platformId,glyphId:numTables});else for(encodingId=canBreak[cmap[platformId]],segment=0;segment<encodingId.entryCount;segment++)offset=(platformId<<8)+segment+encodingId.firstCode,font.pos=encodingId.idRangePos+2*segment,numTables=font.getUint16(),0!==numTables&&(numTables=(numTables+
|
|
1563
|
+
encodingId.idDelta)%65536),isSymbolicFont.push({charCode:offset,glyphId:numTables})}else if(4===cmap){canBreak=font.getUint16()>>1;font.getBytes(6);encodingId=[];for(platformId=0;platformId<canBreak;platformId++)encodingId.push({end:font.getUint16()});font.getUint16();for(platformId=0;platformId<canBreak;platformId++)encodingId[platformId].start=font.getUint16();for(platformId=0;platformId<canBreak;platformId++)encodingId[platformId].delta=font.getUint16();for(platformId=cmap=0;platformId<canBreak;platformId++)segment=
|
|
1564
|
+
encodingId[platformId],(numTables=font.getUint16())?(offset=(numTables>>1)-(canBreak-platformId),segment.offsetIndex=offset,cmap=Math.max(cmap,offset+segment.end-segment.start+1)):segment.offsetIndex=-1;useTable=[];for(segment=0;segment<cmap;segment++)useTable.push(font.getUint16());for(platformId=0;platformId<canBreak;platformId++){segment=encodingId[platformId];cmap=segment.start;font=segment.end;var delta=segment.delta;offset=segment.offsetIndex;for(segment=cmap;segment<=font;segment++)65535!==
|
|
1565
|
+
segment&&(numTables=0>offset?segment:useTable[offset+segment-cmap],numTables=numTables+delta&65535,isSymbolicFont.push({charCode:segment,glyphId:numTables}))}}else if(6===cmap)for(cmap=font.getUint16(),canBreak=font.getUint16(),segment=0;segment<canBreak;segment++)numTables=font.getUint16(),isSymbolicFont.push({charCode:cmap+segment,glyphId:numTables});else return(0,_util.warn)("cmap table has unsupported format: "+cmap),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};isSymbolicFont.sort(function(a,
|
|
1566
|
+
b){return a.charCode-b.charCode});for(segment=1;segment<isSymbolicFont.length;segment++)isSymbolicFont[segment-1].charCode===isSymbolicFont[segment].charCode&&(isSymbolicFont.splice(segment,1),segment--);return{platformId:potentialTable.platformId,encodingId:potentialTable.encodingId,mappings:isSymbolicFont,hasShortCmap:hasEncoding}}function sanitizeGlyph(source,sourceStart,sourceEnd,dest,destStart,hintsValid){var glyphProfile={length:0,sizeOfInstructions:0};if(12>=sourceEnd-sourceStart)return glyphProfile;
|
|
1567
|
+
source=source.subarray(sourceStart,sourceEnd);var contoursCount=signedInt16(source[0],source[1]);if(0>contoursCount)return source[1]=-1,source[0]=16777215,dest.set(source,destStart),glyphProfile.length=source.length,glyphProfile;sourceEnd=10;var flagsCount=0;for(sourceStart=0;sourceStart<contoursCount;sourceStart++)flagsCount=(source[sourceEnd]<<8|source[sourceEnd+1])+1,sourceEnd+=2;contoursCount=sourceEnd;var instructionsLength=source[sourceEnd]<<8|source[sourceEnd+1];glyphProfile.sizeOfInstructions=
|
|
1568
|
+
instructionsLength;var instructionsEnd=sourceEnd+=2+instructionsLength,coordinatesLength=0;for(sourceStart=0;sourceStart<flagsCount;sourceStart++){var flag=source[sourceEnd++];flag&192&&(source[sourceEnd-1]=flag&63);var xyLength=(flag&2?1:flag&16?0:2)+(flag&4?1:flag&32?0:2);coordinatesLength+=xyLength;flag&8&&(flag=source[sourceEnd++],sourceStart+=flag,coordinatesLength+=flag*xyLength)}if(0===coordinatesLength)return glyphProfile;sourceStart=sourceEnd+coordinatesLength;if(sourceStart>source.length)return glyphProfile;
|
|
1569
|
+
if(!hintsValid&&0<instructionsLength)return dest.set(source.subarray(0,contoursCount),destStart),dest.set([0,0],destStart+contoursCount),dest.set(source.subarray(instructionsEnd,sourceStart),destStart+contoursCount+2),sourceStart-=instructionsLength,3<source.length-sourceStart&&(sourceStart=sourceStart+3&-4),glyphProfile.length=sourceStart,glyphProfile;if(3<source.length-sourceStart)return sourceStart=sourceStart+3&-4,dest.set(source.subarray(0,sourceStart),destStart),glyphProfile.length=sourceStart,
|
|
1570
|
+
glyphProfile;dest.set(source,destStart);glyphProfile.length=source.length;return glyphProfile}function sanitizeGlyphLocations(loca,glyf,numGlyphs,isGlyphLocationsLong,hintsValid,dupFirstEntry,maxSizeOfInstructions){if(isGlyphLocationsLong){isGlyphLocationsLong=4;var itemDecode=function(data,offset){return data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3]};var itemEncode=function(data,offset,value){data[offset]=value>>>24&255;data[offset+1]=value>>16&255;data[offset+2]=value>>8&
|
|
1571
|
+
255;data[offset+3]=value&255}}else isGlyphLocationsLong=2,itemDecode=function(data,offset){return data[offset]<<9|data[offset+1]<<1},itemEncode=function(data,offset,value){data[offset]=value>>9&255;data[offset+1]=value>>1&255};var numGlyphsOut=dupFirstEntry?numGlyphs+1:numGlyphs,locaDataSize=isGlyphLocationsLong*(1+numGlyphsOut),locaData=new Uint8Array(locaDataSize);locaData.set(loca.data.subarray(0,locaDataSize));loca.data=locaData;var oldGlyfData=glyf.data,oldGlyfDataLength=oldGlyfData.length,newGlyfData=
|
|
1572
|
+
new Uint8Array(oldGlyfDataLength),startOffset=itemDecode(locaData,0),writeOffset=0;locaDataSize=Object.create(null);itemEncode(locaData,0,writeOffset);var j;var i=0;for(j=isGlyphLocationsLong;i<numGlyphs;i++,j+=isGlyphLocationsLong){var endOffset=itemDecode(locaData,j);0===endOffset&&(endOffset=startOffset);endOffset>oldGlyfDataLength&&(oldGlyfDataLength+3&-4)===endOffset&&(endOffset=oldGlyfDataLength);endOffset>oldGlyfDataLength&&(startOffset=endOffset);startOffset=sanitizeGlyph(oldGlyfData,startOffset,
|
|
1573
|
+
endOffset,newGlyfData,writeOffset,hintsValid);var newLength=startOffset.length;0===newLength&&(locaDataSize[i]=!0);startOffset.sizeOfInstructions>maxSizeOfInstructions&&(maxSizeOfInstructions=startOffset.sizeOfInstructions);writeOffset+=newLength;itemEncode(locaData,j,writeOffset);startOffset=endOffset}if(0===writeOffset){loca=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);i=0;for(j=isGlyphLocationsLong;i<numGlyphsOut;i++,j+=isGlyphLocationsLong)itemEncode(locaData,j,loca.length);glyf.data=loca}else dupFirstEntry?
|
|
1574
|
+
(numGlyphs=itemDecode(locaData,isGlyphLocationsLong),newGlyfData.length>numGlyphs+writeOffset?glyf.data=newGlyfData.subarray(0,numGlyphs+writeOffset):(glyf.data=new Uint8Array(numGlyphs+writeOffset),glyf.data.set(newGlyfData.subarray(0,writeOffset))),glyf.data.set(newGlyfData.subarray(0,numGlyphs),writeOffset),itemEncode(loca.data,locaData.length-isGlyphLocationsLong,writeOffset+numGlyphs)):glyf.data=newGlyfData.subarray(0,writeOffset);return{missingGlyphs:locaDataSize,maxSizeOfInstructions:maxSizeOfInstructions}}
|
|
1575
|
+
function readPostScriptTable(post,properties,maxpNumGlyphs){var start=(font$jscomp$0.start?font$jscomp$0.start:0)+post.offset;font$jscomp$0.pos=start;start+=post.length;var version=font$jscomp$0.getInt32();font$jscomp$0.getBytes(28);post=!0;switch(version){case 65536:var glyphNames=MacStandardGlyphOrdering;break;case 131072:version=font$jscomp$0.getUint16();if(version!==maxpNumGlyphs){post=!1;break}var glyphNameIndexes=[];for(maxpNumGlyphs=0;maxpNumGlyphs<version;++maxpNumGlyphs){var index=font$jscomp$0.getUint16();
|
|
1576
|
+
if(32768<=index){post=!1;break}glyphNameIndexes.push(index)}if(!post)break;index=[];for(glyphNames=[];font$jscomp$0.pos<start;){var stringLength=font$jscomp$0.getByte();glyphNames.length=stringLength;for(maxpNumGlyphs=0;maxpNumGlyphs<stringLength;++maxpNumGlyphs)glyphNames[maxpNumGlyphs]=String.fromCharCode(font$jscomp$0.getByte());index.push(glyphNames.join(""))}glyphNames=[];for(maxpNumGlyphs=0;maxpNumGlyphs<version;++maxpNumGlyphs)start=glyphNameIndexes[maxpNumGlyphs],258>start?glyphNames.push(MacStandardGlyphOrdering[start]):
|
|
1577
|
+
glyphNames.push(index[start-258]);break;case 196608:break;default:(0,_util.warn)("Unknown/unsupported post table version "+version),post=!1,properties.defaultEncoding&&(glyphNames=properties.defaultEncoding)}properties.glyphNames=glyphNames;return post}function readNameTable(nameTable){var start=(font$jscomp$0.start?font$jscomp$0.start:0)+nameTable.offset;font$jscomp$0.pos=start;var names=[[],[]],length=nameTable.length;nameTable=start+length;if(0!==font$jscomp$0.getUint16()||6>length)return names;
|
|
1578
|
+
var numRecords=font$jscomp$0.getUint16();length=font$jscomp$0.getUint16();var records=[],i;for(i=0;i<numRecords&&font$jscomp$0.pos+12<=nameTable;i++){var r={platform:font$jscomp$0.getUint16(),encoding:font$jscomp$0.getUint16(),language:font$jscomp$0.getUint16(),name:font$jscomp$0.getUint16(),length:font$jscomp$0.getUint16(),offset:font$jscomp$0.getUint16()};(1===r.platform&&0===r.encoding&&0===r.language||3===r.platform&&1===r.encoding&&1033===r.language)&&records.push(r)}i=0;for(numRecords=records.length;i<
|
|
1579
|
+
numRecords;i++)if(r=records[i],!(0>=r.length)){var pos=start+length+r.offset;if(!(pos+r.length>nameTable))if(font$jscomp$0.pos=pos,pos=r.name,r.encoding){var str="",j=0;for(r=r.length;j<r;j+=2)str+=String.fromCharCode(font$jscomp$0.getUint16());names[1][pos]=str}else names[0][pos]=(0,_util.bytesToString)(font$jscomp$0.getBytes(r.length))}return names}function sanitizeTTProgram(table,ttContext){for(var data=table.data,i=0,j,n,b,lastEndf=0,lastDeff=0,stack=[],callstack=[],functionsCalled=[],tooComplexToFollowFunctions=
|
|
1580
|
+
ttContext.tooComplexToFollowFunctions,inFDEF=!1,ifLevel=0,inELSE=0,ii=data.length;i<ii;){var op=data[i++];if(64===op)if(n=data[i++],inFDEF||inELSE)i+=n;else for(j=0;j<n;j++)stack.push(data[i++]);else if(65===op)if(n=data[i++],inFDEF||inELSE)i+=2*n;else for(j=0;j<n;j++)b=data[i++],stack.push(b<<8|data[i++]);else if(176===(op&248))if(n=op-176+1,inFDEF||inELSE)i+=n;else for(j=0;j<n;j++)stack.push(data[i++]);else if(184===(op&248))if(n=op-184+1,inFDEF||inELSE)i+=2*n;else for(j=0;j<n;j++)b=data[i++],stack.push(b<<
|
|
1581
|
+
8|data[i++]);else if(43!==op||tooComplexToFollowFunctions)if(44!==op||tooComplexToFollowFunctions)if(45===op)if(inFDEF)inFDEF=!1,lastEndf=i;else{j=callstack.pop();if(!j){(0,_util.warn)("TT: ENDF bad stack");ttContext.hintsValid=!1;return}n=functionsCalled.pop();data=j.data;i=j.i;ttContext.functionsStackDeltas[n]=stack.length-j.stackTop}else if(137===op){if(inFDEF||inELSE)(0,_util.warn)("TT: nested IDEFs not allowed"),tooComplexToFollowFunctions=!0;inFDEF=!0;lastDeff=i}else 88===op?++ifLevel:27===
|
|
1582
|
+
op?inELSE=ifLevel:89===op?(inELSE===ifLevel&&(inELSE=0),--ifLevel):28!==op||inFDEF||inELSE||(n=stack[stack.length-1],0<n&&(i+=n-1));else{if(inFDEF||inELSE)(0,_util.warn)("TT: nested FDEFs not allowed"),tooComplexToFollowFunctions=!0;inFDEF=!0;lastDeff=i;n=stack.pop();ttContext.functionsDefined[n]={data:data,i:i}}else if(!inFDEF&&!inELSE)if(n=stack[stack.length-1],isNaN(n))(0,_util.info)("TT: CALL empty stack (or invalid entry).");else if(ttContext.functionsUsed[n]=!0,n in ttContext.functionsStackDeltas){n=
|
|
1583
|
+
stack.length+ttContext.functionsStackDeltas[n];if(0>n){(0,_util.warn)("TT: CALL invalid functions stack delta.");ttContext.hintsValid=!1;return}stack.length=n}else if(n in ttContext.functionsDefined&&!functionsCalled.includes(n)){callstack.push({data:data,i:i,stackTop:stack.length-1});functionsCalled.push(n);j=ttContext.functionsDefined[n];if(!j){(0,_util.warn)("TT: CALL non-existent function");ttContext.hintsValid=!1;return}data=j.data;i=j.i}if(!inFDEF&&!inELSE){j=142>=op?TTOpsStackDeltas[op]:192<=
|
|
1584
|
+
op&&223>=op?-1:224<=op?-2:0;113<=op&&117>=op&&(n=stack.pop(),isNaN(n)||(j=2*-n));for(;0>j&&0<stack.length;)stack.pop(),j++;for(;0<j;)stack.push(NaN),j--}}ttContext.tooComplexToFollowFunctions=tooComplexToFollowFunctions;ttContext=[data];i>data.length&&ttContext.push(new Uint8Array(i-data.length));lastDeff>lastEndf&&((0,_util.warn)("TT: complementing a missing function tail"),ttContext.push(new Uint8Array([34,45])));if(1<ttContext.length){i=data=0;for(lastEndf=ttContext.length;i<lastEndf;i++)data+=
|
|
1585
|
+
ttContext[i].length;data=data+3&-4;lastDeff=new Uint8Array(data);i=stack=0;for(lastEndf=ttContext.length;i<lastEndf;i++)lastDeff.set(ttContext[i],stack),stack+=ttContext[i].length;table.data=lastDeff;table.length=data}}var VALID_TABLES="OS/2;cmap;head;hhea;hmtx;maxp;name;post;loca;glyf;fpgm;prep;cvt ;CFF ".split(";"),TTOpsStackDeltas=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,
|
|
1586
|
+
-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];font$jscomp$0=new _stream.Stream(new Uint8Array(font$jscomp$0.getBytes()));if(isTrueTypeCollectionFile(font$jscomp$0)){var tables=readTrueTypeCollectionData(font$jscomp$0,this.name);var header$jscomp$0=tables.header;tables=tables.tables}else header$jscomp$0=readOpenTypeHeader(font$jscomp$0),
|
|
1587
|
+
tables=readTables(font$jscomp$0,header$jscomp$0.numTables);var isTrueType=!tables["CFF "];if(isTrueType){if(!tables.loca)throw new _util.FormatError('Required "loca" table is not found');tables.glyf||((0,_util.warn)('Required "glyf" table is not found -- trying to recover.'),tables.glyf={tag:"glyf",data:new Uint8Array(0)});this.isOpenType=!1}else{var isComposite=properties$jscomp$0.composite&&(0<(properties$jscomp$0.cidToGidMap||[]).length||!(properties$jscomp$0.cMap instanceof _cmap.IdentityCMap));
|
|
1588
|
+
if("OTTO"===header$jscomp$0.version&&!isComposite||!tables.head||!tables.hhea||!tables.maxp||!tables.post){var cffFile=new _stream.Stream(tables["CFF "].data);var cff=new CFFFont(cffFile,properties$jscomp$0);adjustWidths(properties$jscomp$0);return this.convert(name,cff,properties$jscomp$0)}delete tables.glyf;delete tables.loca;delete tables.fpgm;delete tables.prep;delete tables["cvt "];this.isOpenType=!0}if(!tables.maxp)throw new _util.FormatError('Required "maxp" table is not found');font$jscomp$0.pos=
|
|
1589
|
+
(font$jscomp$0.start||0)+tables.maxp.offset;var version$jscomp$0=font$jscomp$0.getInt32(),numGlyphs$jscomp$0=font$jscomp$0.getUint16();isComposite=numGlyphs$jscomp$0+1;var dupFirstEntry=!0;65535<isComposite&&(dupFirstEntry=!1,isComposite=numGlyphs$jscomp$0,(0,_util.warn)("Not enough space in glyfs to duplicate first glyph."));var maxFunctionDefs=0,maxSizeOfInstructions=0;65536<=version$jscomp$0&&22<=tables.maxp.length&&(font$jscomp$0.pos+=8,2<font$jscomp$0.getUint16()&&(tables.maxp.data[14]=0,tables.maxp.data[15]=
|
|
1590
|
+
2),font$jscomp$0.pos+=4,maxFunctionDefs=font$jscomp$0.getUint16(),font$jscomp$0.pos+=4,maxSizeOfInstructions=font$jscomp$0.getUint16());tables.maxp.data[4]=isComposite>>8;tables.maxp.data[5]=isComposite&255;maxFunctionDefs=function(fpgm,prep,cvt,maxFunctionDefs){var ttContext={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};fpgm&&sanitizeTTProgram(fpgm,ttContext);prep&&sanitizeTTProgram(prep,ttContext);if(fpgm&&!ttContext.tooComplexToFollowFunctions)if(ttContext.functionsDefined.length>
|
|
1591
|
+
maxFunctionDefs)(0,_util.warn)("TT: more functions defined than expected"),ttContext.hintsValid=!1;else for(fpgm=0,prep=ttContext.functionsUsed.length;fpgm<prep;fpgm++){if(fpgm>maxFunctionDefs){(0,_util.warn)("TT: invalid function id: "+fpgm);ttContext.hintsValid=!1;break}if(ttContext.functionsUsed[fpgm]&&!ttContext.functionsDefined[fpgm]){(0,_util.warn)("TT: undefined function: "+fpgm);ttContext.hintsValid=!1;break}}cvt&&cvt.length&1&&(maxFunctionDefs=new Uint8Array(cvt.length+1),maxFunctionDefs.set(cvt.data),
|
|
1592
|
+
cvt.data=maxFunctionDefs);return ttContext.hintsValid}(tables.fpgm,tables.prep,tables["cvt "],maxFunctionDefs);maxFunctionDefs||(delete tables.fpgm,delete tables.prep,delete tables["cvt "]);(function(font,header,metrics,numGlyphs,dupFirstEntry){header?(font.pos=(font.start?font.start:0)+header.offset,font.pos+=4,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=8,font.pos+=2,font=font.getUint16(),font>numGlyphs&&((0,_util.info)("The numOfMetrics ("+
|
|
1593
|
+
font+") should not be greater than the numGlyphs ("+numGlyphs+")"),font=numGlyphs,header.data[34]=(font&65280)>>8,header.data[35]=font&255),header=numGlyphs-font-(metrics.length-4*font>>1),0<header&&(header=new Uint8Array(metrics.length+2*header),header.set(metrics.data),dupFirstEntry&&(header[metrics.length]=metrics.data[2],header[metrics.length+1]=metrics.data[3]),metrics.data=header)):metrics&&(metrics.data=null)})(font$jscomp$0,tables.hhea,tables.hmtx,isComposite,dupFirstEntry);if(!tables.head)throw new _util.FormatError('Required "head" table is not found');
|
|
1594
|
+
(function(head,numGlyphs,locaLength){head=head.data;var version=(head[0]<<24)+(head[1]<<16)+(head[2]<<8)+head[3];1!==version>>16&&((0,_util.info)("Attempting to fix invalid version in head table: "+version),head[0]=0,head[1]=1,head[2]=0,head[3]=0);version=(head[50]<<8)+head[51];if(0>version||1<version)if((0,_util.info)("Attempting to fix invalid indexToLocFormat in head table: "+version),numGlyphs+=1,locaLength===numGlyphs<<1)head[50]=0,head[51]=0;else if(locaLength===numGlyphs<<2)head[50]=0,head[51]=
|
|
1595
|
+
1;else throw new _util.FormatError("Could not fix indexToLocFormat: "+version);})(tables.head,numGlyphs$jscomp$0,isTrueType?tables.loca.length:0);var missingGlyphs=Object.create(null);isTrueType&&(maxSizeOfInstructions=sanitizeGlyphLocations(tables.loca,tables.glyf,numGlyphs$jscomp$0,(tables.head.data[50]<<8)+tables.head.data[51],maxFunctionDefs,dupFirstEntry,maxSizeOfInstructions),missingGlyphs=maxSizeOfInstructions.missingGlyphs,65536<=version$jscomp$0&&22<=tables.maxp.length&&(tables.maxp.data[26]=
|
|
1596
|
+
maxSizeOfInstructions.maxSizeOfInstructions>>8,tables.maxp.data[27]=maxSizeOfInstructions.maxSizeOfInstructions&255));if(!tables.hhea)throw new _util.FormatError('Required "hhea" table is not found');0===tables.hhea.data[10]&&0===tables.hhea.data[11]&&(tables.hhea.data[10]=255,tables.hhea.data[11]=255);version$jscomp$0={unitsPerEm:(tables.head.data[18]<<8)+tables.head.data[19],yMax:(tables.head.data[42]<<8)+tables.head.data[43],yMin:signedInt16(tables.head.data[38],tables.head.data[39]),ascent:(tables.hhea.data[4]<<
|
|
1597
|
+
8)+tables.hhea.data[5],descent:signedInt16(tables.hhea.data[6],tables.hhea.data[7])};this.ascent=version$jscomp$0.ascent/version$jscomp$0.unitsPerEm;this.descent=version$jscomp$0.descent/version$jscomp$0.unitsPerEm;tables.post&&readPostScriptTable(tables.post,properties$jscomp$0,numGlyphs$jscomp$0);tables.post={tag:"post",data:createPostTable(properties$jscomp$0)};var charCodeToGlyphId=[],charCode$jscomp$0;if(properties$jscomp$0.composite){var cidToGidMap=properties$jscomp$0.cidToGidMap||[],isCidToGidMapEmpty=
|
|
1598
|
+
0===cidToGidMap.length;properties$jscomp$0.cMap.forEach(function(charCode,cid){if(65535<cid)throw new _util.FormatError("Max size of CID is 65,535");var glyphId=-1;isCidToGidMapEmpty?glyphId=cid:void 0!==cidToGidMap[cid]&&(glyphId=cidToGidMap[cid]);0<=glyphId&&glyphId<numGlyphs$jscomp$0&&!missingGlyphs[glyphId]&&(charCodeToGlyphId[charCode]=glyphId)})}else{maxFunctionDefs=readCmapTable(tables.cmap,font$jscomp$0,this.isSymbolicFont,properties$jscomp$0.hasEncoding);maxSizeOfInstructions=maxFunctionDefs.platformId;
|
|
1599
|
+
var cmapEncodingId=maxFunctionDefs.encodingId;maxFunctionDefs=maxFunctionDefs.mappings;var cmapMappingsLength=maxFunctionDefs.length;if(properties$jscomp$0.hasEncoding&&(3===maxSizeOfInstructions&&1===cmapEncodingId||1===maxSizeOfInstructions&&0===cmapEncodingId)||-1===maxSizeOfInstructions&&-1===cmapEncodingId&&(0,_encodings.getEncoding)(properties$jscomp$0.baseEncodingName)){var baseEncoding=[];if("MacRomanEncoding"===properties$jscomp$0.baseEncodingName||"WinAnsiEncoding"===properties$jscomp$0.baseEncodingName)baseEncoding=
|
|
1600
|
+
(0,_encodings.getEncoding)(properties$jscomp$0.baseEncodingName);var glyphsUnicodeMap=(0,_glyphlist.getGlyphsUnicode)();for(charCode$jscomp$0=0;256>charCode$jscomp$0;charCode$jscomp$0++){var glyphName;if(glyphName=this.differences&&charCode$jscomp$0 in this.differences?this.differences[charCode$jscomp$0]:charCode$jscomp$0 in baseEncoding&&""!==baseEncoding[charCode$jscomp$0]?baseEncoding[charCode$jscomp$0]:_encodings.StandardEncoding[charCode$jscomp$0]){var standardGlyphName=recoverGlyphName(glyphName,
|
|
1601
|
+
glyphsUnicodeMap);var unicodeOrCharCode;3===maxSizeOfInstructions&&1===cmapEncodingId?unicodeOrCharCode=glyphsUnicodeMap[standardGlyphName]:1===maxSizeOfInstructions&&0===cmapEncodingId&&(unicodeOrCharCode=_encodings.MacRomanEncoding.indexOf(standardGlyphName));for(var found=!1,i$jscomp$0=0;i$jscomp$0<cmapMappingsLength;++i$jscomp$0)if(maxFunctionDefs[i$jscomp$0].charCode===unicodeOrCharCode){charCodeToGlyphId[charCode$jscomp$0]=maxFunctionDefs[i$jscomp$0].glyphId;found=!0;break}!found&&properties$jscomp$0.glyphNames&&
|
|
1602
|
+
(found=properties$jscomp$0.glyphNames.indexOf(glyphName),-1===found&&standardGlyphName!==glyphName&&(found=properties$jscomp$0.glyphNames.indexOf(standardGlyphName)),0<found&&!missingGlyphs[found]&&(charCodeToGlyphId[charCode$jscomp$0]=found))}}}else if(0===maxSizeOfInstructions&&0===cmapEncodingId)for(unicodeOrCharCode=0;unicodeOrCharCode<cmapMappingsLength;++unicodeOrCharCode)charCodeToGlyphId[maxFunctionDefs[unicodeOrCharCode].charCode]=maxFunctionDefs[unicodeOrCharCode].glyphId;else for(unicodeOrCharCode=
|
|
1603
|
+
0;unicodeOrCharCode<cmapMappingsLength;++unicodeOrCharCode)charCode$jscomp$0=maxFunctionDefs[unicodeOrCharCode].charCode,3===maxSizeOfInstructions&&61440<=charCode$jscomp$0&&61695>=charCode$jscomp$0&&(charCode$jscomp$0&=255),charCodeToGlyphId[charCode$jscomp$0]=maxFunctionDefs[unicodeOrCharCode].glyphId}0===charCodeToGlyphId.length&&(charCodeToGlyphId[0]=0);unicodeOrCharCode=isComposite-1;dupFirstEntry||(unicodeOrCharCode=0);dupFirstEntry=adjustMapping(charCodeToGlyphId,function(glyphId){return!missingGlyphs[glyphId]},
|
|
1604
|
+
unicodeOrCharCode);this.toFontChar=dupFirstEntry.toFontChar;tables.cmap={tag:"cmap",data:createCmapTable(dupFirstEntry.charCodeToGlyphId,isComposite)};tables["OS/2"]&&validateOS2Table(tables["OS/2"])||(tables["OS/2"]={tag:"OS/2",data:createOS2Table(properties$jscomp$0,dupFirstEntry.charCodeToGlyphId,version$jscomp$0)});if(!isTrueType)try{cffFile=new _stream.Stream(tables["CFF "].data);cff=(new _cff_parser.CFFParser(cffFile,properties$jscomp$0,!0)).parse();cff.duplicateFirstGlyph();var compiler=new _cff_parser.CFFCompiler(cff);
|
|
1605
|
+
tables["CFF "].data=compiler.compile()}catch(e){(0,_util.warn)("Failed to compile font "+properties$jscomp$0.loadedName)}tables.name?(properties$jscomp$0=readNameTable(tables.name),tables.name.data=createNameTable(name,properties$jscomp$0)):tables.name={tag:"name",data:createNameTable(this.name)};name=new OpenTypeFileBuilder(header$jscomp$0.version);for(var tableTag in tables)name.addTable(tableTag,tables[tableTag].data);return name.toArray()},convert:function(fontName,font,properties){function getCharCodes(charCodeToGlyphId,
|
|
1606
|
+
glyphId){var charCodes=null,charCode;for(charCode in charCodeToGlyphId)glyphId===charCodeToGlyphId[charCode]&&(charCodes||(charCodes=[]),charCodes.push(charCode|0));return charCodes}function createCharCode(charCodeToGlyphId,glyphId){for(var charCode in charCodeToGlyphId)if(glyphId===charCodeToGlyphId[charCode])return charCode|0;newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode]=glyphId;return newMapping.nextAvailableFontCharCode++}properties.fixedPitch=!1;properties.builtInEncoding&&
|
|
1607
|
+
adjustToUnicode(properties,properties.builtInEncoding);var glyphZeroId=1;font instanceof CFFFont&&(glyphZeroId=font.numGlyphs-1);var mapping=font.getGlyphMapping(properties),newMapping=adjustMapping(mapping,font.hasGlyphId.bind(font),glyphZeroId);this.toFontChar=newMapping.toFontChar;var numGlyphs=font.numGlyphs;if((glyphZeroId=font.seacs)&&glyphZeroId.length){var matrix=properties.fontMatrix||_util.FONT_IDENTITY_MATRIX,charset=font.getCharset(),seacMap=Object.create(null);for(glyphId$jscomp$0 in glyphZeroId){glyphId$jscomp$0|=
|
|
1608
|
+
0;var seac=glyphZeroId[glyphId$jscomp$0],accentGlyphName=_encodings.StandardEncoding[seac[3]],baseGlyphId=charset.indexOf(_encodings.StandardEncoding[seac[2]]);accentGlyphName=charset.indexOf(accentGlyphName);if(!(0>baseGlyphId||0>accentGlyphName)){seac={x:seac[0]*matrix[0]+seac[1]*matrix[2]+matrix[4],y:seac[0]*matrix[1]+seac[1]*matrix[3]+matrix[5]};var charCodes=getCharCodes(mapping,glyphId$jscomp$0);if(charCodes)for(var i$jscomp$0=0,ii=charCodes.length;i$jscomp$0<ii;i$jscomp$0++){var charCode$jscomp$0=
|
|
1609
|
+
charCodes[i$jscomp$0],charCodeToGlyphId$jscomp$0=newMapping.charCodeToGlyphId,baseFontCharCode=createCharCode(charCodeToGlyphId$jscomp$0,baseGlyphId);charCodeToGlyphId$jscomp$0=createCharCode(charCodeToGlyphId$jscomp$0,accentGlyphName);seacMap[charCode$jscomp$0]={baseFontCharCode:baseFontCharCode,accentFontCharCode:charCodeToGlyphId$jscomp$0,accentOffset:seac}}}}properties.seacMap=seacMap}mapping=1/(properties.fontMatrix||_util.FONT_IDENTITY_MATRIX)[0];var glyphId$jscomp$0=new OpenTypeFileBuilder("OTTO");
|
|
1610
|
+
glyphId$jscomp$0.addTable("CFF ",font.data);glyphId$jscomp$0.addTable("OS/2",createOS2Table(properties,newMapping.charCodeToGlyphId));glyphId$jscomp$0.addTable("cmap",createCmapTable(newMapping.charCodeToGlyphId,numGlyphs));glyphId$jscomp$0.addTable("head","\x00\u0001\x00\x00\x00\x00\u0010\x00\x00\x00\x00\x00_\u000f<\u00f5\x00\x00"+safeString16(mapping)+"\x00\x00\x00\x00\u009e\v~'\x00\x00\x00\x00\u009e\v~'\x00\x00"+safeString16(properties.descent)+"\u000f\u00ff"+safeString16(properties.ascent)+string16(properties.italicAngle?
|
|
1611
|
+
2:0)+"\x00\u0011\x00\x00\x00\x00\x00\x00");glyphId$jscomp$0.addTable("hhea","\x00\u0001\x00\x00"+safeString16(properties.ascent)+safeString16(properties.descent)+"\x00\x00\u00ff\u00ff\x00\x00\x00\x00\x00\x00"+safeString16(properties.capHeight)+safeString16(Math.tan(properties.italicAngle)*properties.xHeight)+"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"+string16(numGlyphs));glyphId$jscomp$0.addTable("hmtx",function(){for(var charstrings=font.charstrings,cffWidths=font.cff?font.cff.widths:null,
|
|
1612
|
+
hmtx="\x00\x00\x00\x00",i=1;i<numGlyphs;i++){var width=0;charstrings?(width=charstrings[i-1],width="width"in width?width.width:0):cffWidths&&(width=Math.ceil(cffWidths[i]||0));hmtx+=string16(width)+string16(0)}return hmtx}());glyphId$jscomp$0.addTable("maxp","\x00\x00P\x00"+string16(numGlyphs));glyphId$jscomp$0.addTable("name",createNameTable(fontName));glyphId$jscomp$0.addTable("post",createPostTable(properties));return glyphId$jscomp$0.toArray()},get spaceWidth(){if("_shadowWidth"in this)return this._shadowWidth;
|
|
1613
|
+
for(var possibleSpaceReplacements=["space","minus","one","i","I"],width,i=0,ii=possibleSpaceReplacements.length;i<ii;i++){width=possibleSpaceReplacements[i];if(width in this.widths){width=this.widths[width];break}width=(0,_glyphlist.getGlyphsUnicode)()[width];var charcode=0;this.composite&&this.cMap.contains(width)&&(charcode=this.cMap.lookup(width));!charcode&&this.toUnicode&&(charcode=this.toUnicode.charCodeOf(width));0>=charcode&&(charcode=width);if(width=this.widths[charcode])break}return this._shadowWidth=
|
|
1614
|
+
width=width||this.defaultWidth},charToGlyph:function(charcode,isSpace){var operatorListId,widthCode=charcode;this.cMap&&this.cMap.contains(charcode)&&(widthCode=this.cMap.lookup(charcode));var width=this.widths[widthCode];width=(0,_util.isNum)(width)?width:this.defaultWidth;widthCode=this.vmetrics&&this.vmetrics[widthCode];var unicode=this.toUnicode.get(charcode)||this.fallbackToUnicode.get(charcode)||charcode;"number"===typeof unicode&&(unicode=String.fromCharCode(unicode));var isInFont=charcode in
|
|
1615
|
+
this.toFontChar;var fontCharCode=this.toFontChar[charcode]||charcode;this.missingFile&&(fontCharCode=(0,_unicode.mapSpecialUnicodeValues)(fontCharCode));this.isType3Font&&(operatorListId=fontCharCode);var accent=null;this.seacMap&&this.seacMap[charcode]&&(isInFont=!0,accent=this.seacMap[charcode],fontCharCode=accent.baseFontCharCode,accent={fontChar:String.fromCodePoint(accent.accentFontCharCode),offset:accent.accentOffset});fontCharCode="number"===typeof fontCharCode?String.fromCodePoint(fontCharCode):
|
|
1616
|
+
"";var glyph=this.glyphCache[charcode];glyph&&glyph.matchesForCache(fontCharCode,unicode,accent,width,widthCode,operatorListId,isSpace,isInFont)||(glyph=new Glyph(fontCharCode,unicode,accent,width,widthCode,operatorListId,isSpace,isInFont),this.glyphCache[charcode]=glyph);return glyph},charsToGlyphs:function(chars){var charsCache=this.charsCache,glyphs;if(charsCache&&(glyphs=charsCache[chars]))return glyphs;charsCache||(charsCache=this.charsCache=Object.create(null));glyphs=[];var i=0,ii;if(this.cMap)for(ii=
|
|
1617
|
+
Object.create(null);i<chars.length;){this.cMap.readCharCode(chars,i,ii);var glyph=ii.charcode;var length=ii.length;i+=length;length=1===length&&32===chars.charCodeAt(i-1);glyph=this.charToGlyph(glyph,length);glyphs.push(glyph)}else for(i=0,ii=chars.length;i<ii;++i)glyph=chars.charCodeAt(i),glyph=this.charToGlyph(glyph,32===glyph),glyphs.push(glyph);return charsCache[chars]=glyphs},get glyphCacheValues(){return Object.values(this.glyphCache)}};return Font}();exports.Font=module;module=function(){function ErrorFont(error){this.error=
|
|
1618
|
+
error;this.loadedName="g_font_error";this.missingFile=!0}ErrorFont.prototype={charsToGlyphs:function(){return[]},exportData:function(){return{error:this.error}}};return ErrorFont}();exports.ErrorFont=module;var Type1Font=function(){function findBlock(streamBytes,signature,startIndex){for(var streamBytesLength=streamBytes.length,signatureLength=signature.length,scanLength=streamBytesLength-signatureLength,j,found=!1;startIndex<scanLength;){for(j=0;j<signatureLength&&streamBytes[startIndex+j]===signature[j];)j++;
|
|
1619
|
+
if(j>=signatureLength){for(startIndex+=j;startIndex<streamBytesLength&&(0,_util.isSpace)(streamBytes[startIndex]);)startIndex++;found=!0;break}startIndex++}return{found:found,length:startIndex}}function Type1Font(name,file,properties){var headerBlockLength=properties.length1,pfbHeader=file.peekBytes(6),pfbHeaderPresent=128===pfbHeader[0]&&1===pfbHeader[1];pfbHeaderPresent&&(file.skip(6),headerBlockLength=pfbHeader[5]<<24|pfbHeader[4]<<16|pfbHeader[3]<<8|pfbHeader[2]);a:{pfbHeader=[101,101,120,101,
|
|
1620
|
+
99];var streamStartPos=file.pos;try{var headerBytes=file.getBytes(headerBlockLength);var headerBytesLength=headerBytes.length}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;}if(headerBytesLength===headerBlockLength&&(headerBytesLength=findBlock(headerBytes,pfbHeader,headerBlockLength-2*pfbHeader.length),headerBytesLength.found&&headerBytesLength.length===headerBlockLength)){var JSCompiler_object_inline_stream_1331=new _stream.Stream(headerBytes);break a}(0,_util.warn)('Invalid "Length1" property in Type1 font -- trying to recover.');
|
|
1621
|
+
for(file.pos=streamStartPos;;){headerBytes=file.peekBytes(2048);headerBytesLength=findBlock(headerBytes,pfbHeader,0);if(0===headerBytesLength.length)break;file.pos+=headerBytesLength.length;if(headerBytesLength.found){JSCompiler_object_inline_stream_1331=file.pos-streamStartPos;break}}file.pos=streamStartPos;JSCompiler_object_inline_stream_1331?JSCompiler_object_inline_stream_1331=new _stream.Stream(file.getBytes(JSCompiler_object_inline_stream_1331)):((0,_util.warn)('Unable to recover "Length1" property in Type1 font -- using as is.'),
|
|
1622
|
+
JSCompiler_object_inline_stream_1331=new _stream.Stream(file.getBytes(headerBlockLength)))}(new _type1_parser.Type1Parser(JSCompiler_object_inline_stream_1331,!1,!0)).extractFontHeader(properties);pfbHeaderPresent&&file.getBytes(6);file=file.getBytes();file=new _stream.Stream(file);file=(new _type1_parser.Type1Parser(file,!0,!0)).extractFontProgram(properties);for(var info in file.properties)properties[info]=file.properties[info];info=file.charstrings;pfbHeaderPresent=this.getType2Charstrings(info);
|
|
1623
|
+
JSCompiler_object_inline_stream_1331=this.getType2Subrs(file.subrs);this.charstrings=info;this.data=this.wrap(name,pfbHeaderPresent,this.charstrings,JSCompiler_object_inline_stream_1331,properties);this.seacs=this.getSeacs(file.charstrings)}Type1Font.prototype={get numGlyphs(){return this.charstrings.length+1},getCharset:function(){for(var charset=[".notdef"],charstrings=this.charstrings,glyphId=0;glyphId<charstrings.length;glyphId++)charset.push(charstrings[glyphId].glyphName);return charset},getGlyphMapping:function(properties){var charstrings=
|
|
1624
|
+
this.charstrings,glyphNames=[".notdef"],glyphId;for(glyphId=0;glyphId<charstrings.length;glyphId++)glyphNames.push(charstrings[glyphId].glyphName);if(charstrings=properties.builtInEncoding){var builtInEncoding=Object.create(null),charCode;for(charCode in charstrings)glyphId=glyphNames.indexOf(charstrings[charCode]),0<=glyphId&&(builtInEncoding[charCode]=glyphId)}return type1FontGlyphMapping(properties,builtInEncoding,glyphNames)},hasGlyphId:function(id){return 0>id||id>=this.numGlyphs?!1:0===id?!0:
|
|
1625
|
+
0<this.charstrings[id-1].charstring.length},getSeacs:function(charstrings){var ii,seacMap=[];var i=0;for(ii=charstrings.length;i<ii;i++){var charstring=charstrings[i];charstring.seac&&(seacMap[i+1]=charstring.seac)}return seacMap},getType2Charstrings:function(type1Charstrings){for(var type2Charstrings=[],i=0,ii=type1Charstrings.length;i<ii;i++)type2Charstrings.push(type1Charstrings[i].charstring);return type2Charstrings},getType2Subrs:function(type1Subrs){var count=type1Subrs.length;var bias=1133>
|
|
1626
|
+
count?107:33769>count?1131:32768;var type2Subrs=[],i;for(i=0;i<bias;i++)type2Subrs.push([11]);for(i=0;i<count;i++)type2Subrs.push(type1Subrs[i]);return type2Subrs},wrap:function(name,glyphs,charstrings,subrs,properties){var cff=new _cff_parser.CFF;cff.header=new _cff_parser.CFFHeader(1,0,4,4);cff.names=[name];var topDict=new _cff_parser.CFFTopDict;topDict.setByName("version",391);topDict.setByName("Notice",392);topDict.setByName("FullName",393);topDict.setByName("FamilyName",394);topDict.setByName("Weight",
|
|
1627
|
+
395);topDict.setByName("Encoding",null);topDict.setByName("FontMatrix",properties.fontMatrix);topDict.setByName("FontBBox",properties.bbox);topDict.setByName("charset",null);topDict.setByName("CharStrings",null);topDict.setByName("Private",null);cff.topDict=topDict;topDict=new _cff_parser.CFFStrings;topDict.add("Version 0.11");topDict.add("See original notice");topDict.add(name);topDict.add(name);topDict.add("Medium");cff.strings=topDict;cff.globalSubrIndex=new _cff_parser.CFFIndex;var count=glyphs.length,
|
|
1628
|
+
charsetArray=[".notdef"];for(name=0;name<count;name++){var glyphName=charstrings[name].glyphName;-1===_cff_parser.CFFStandardStrings.indexOf(glyphName)&&topDict.add(glyphName);charsetArray.push(glyphName)}cff.charset=new _cff_parser.CFFCharset(!1,0,charsetArray);charstrings=new _cff_parser.CFFIndex;charstrings.add([139,14]);for(name=0;name<count;name++)charstrings.add(glyphs[name]);cff.charStrings=charstrings;charstrings=new _cff_parser.CFFPrivateDict;charstrings.setByName("Subrs",null);topDict="BlueValues OtherBlues FamilyBlues FamilyOtherBlues StemSnapH StemSnapV BlueShift BlueFuzz BlueScale LanguageGroup ExpansionFactor ForceBold StdHW StdVW".split(" ");
|
|
1629
|
+
name=0;for(glyphs=topDict.length;name<glyphs;name++)if(count=topDict[name],count in properties.privateData){charsetArray=properties.privateData[count];if(Array.isArray(charsetArray))for(glyphName=charsetArray.length-1;0<glyphName;glyphName--)charsetArray[glyphName]-=charsetArray[glyphName-1];charstrings.setByName(count,charsetArray)}cff.topDict.privateDict=charstrings;properties=new _cff_parser.CFFIndex;name=0;for(glyphs=subrs.length;name<glyphs;name++)properties.add(subrs[name]);charstrings.subrsIndex=
|
|
1630
|
+
properties;return(new _cff_parser.CFFCompiler(cff)).compile()}};return Type1Font}(),CFFFont=function(){function CFFFont(file,properties){this.properties=properties;this.cff=(new _cff_parser.CFFParser(file,properties,!0)).parse();this.cff.duplicateFirstGlyph();var compiler=new _cff_parser.CFFCompiler(this.cff);this.seacs=this.cff.seacs;try{this.data=compiler.compile()}catch(e){(0,_util.warn)("Failed to compile font "+properties.loadedName),this.data=file}}CFFFont.prototype={get numGlyphs(){return this.cff.charStrings.count},
|
|
1621
1631
|
getCharset:function(){return this.cff.charset.charset},getGlyphMapping:function(){var cff=this.cff,properties=this.properties,charsets=cff.charset.charset,glyphId;if(properties.composite){var charCodeToGlyphId=Object.create(null);if(cff.isCIDFont)for(glyphId=0;glyphId<charsets.length;glyphId++){var charCode=properties.cMap.charCodeOf(charsets[glyphId]);charCodeToGlyphId[charCode]=glyphId}else for(glyphId=0;glyphId<cff.charStrings.count;glyphId++)charCode=properties.cMap.charCodeOf(glyphId),charCodeToGlyphId[charCode]=
|
|
1622
1632
|
glyphId;return charCodeToGlyphId}return charCodeToGlyphId=type1FontGlyphMapping(properties,cff.encoding?cff.encoding.encoding:null,charsets)},hasGlyphId:function(id){return this.cff.hasGlyphId(id)}};return CFFFont}()},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.CFFFDSelect=exports.CFFCompiler=exports.CFFPrivateDict=exports.CFFTopDict=exports.CFFCharset=exports.CFFIndex=exports.CFFStrings=exports.CFFHeader=exports.CFF=exports.CFFParser=
|
|
1623
1633
|
exports.CFFStandardStrings=void 0;var _util=__w_pdfjs_require__(5),_charsets=__w_pdfjs_require__(213),_encodings=__w_pdfjs_require__(214),CFFStandardStrings=".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 exclamsmall Hungarumlautsmall dollaroldstyle dollarsuperior ampersandsmall Acutesmall parenleftsuperior parenrightsuperior twodotenleader onedotenleader zerooldstyle oneoldstyle twooldstyle threeoldstyle fouroldstyle fiveoldstyle sixoldstyle sevenoldstyle eightoldstyle nineoldstyle commasuperior threequartersemdash periodsuperior questionsmall asuperior bsuperior centsuperior dsuperior esuperior isuperior lsuperior msuperior nsuperior osuperior rsuperior ssuperior tsuperior ff 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 questiondownsmall oneeighth threeeighths fiveeighths seveneighths onethird twothirds zerosuperior 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 001.000 001.001 001.002 001.003 Black Bold Book Light Medium Regular Roman Semibold".split(" ");
|
|
@@ -1682,8 +1692,7 @@ compileCharset:function(charset,numGlyphs,strings,isCIDFont){--numGlyphs;if(isCI
|
|
|
1682
1692
|
sid>>8&255;isCIDFont[i+1]=sid&255}}return this.compileTypedArray(isCIDFont)},compileEncoding:function(encoding){return this.compileTypedArray(encoding.raw)},compileFDSelect:function(fdSelect){var format=fdSelect.format;switch(format){case 0:var out=new Uint8Array(1+fdSelect.fdSelect.length);out[0]=format;for(format=0;format<fdSelect.fdSelect.length;format++)out[format+1]=fdSelect.fdSelect[format];break;case 3:out=fdSelect.fdSelect[0];var ranges=[format,0,0,0,0,out];for(format=1;format<fdSelect.fdSelect.length;format++){var currentFD=
|
|
1683
1693
|
fdSelect.fdSelect[format];currentFD!==out&&(ranges.push(format>>8&255,format&255,currentFD),out=currentFD)}fdSelect=(ranges.length-3)/3;ranges[1]=fdSelect>>8&255;ranges[2]=fdSelect&255;ranges.push(format>>8&255,format&255);out=new Uint8Array(ranges)}return this.compileTypedArray(out)},compileTypedArray:function(data){for(var out=[],i=0,ii=data.length;i<ii;++i)out[i]=data[i];return out},compileIndex:function(index,trackers){trackers=trackers||[];index=index.objects;var count=index.length;if(0===count)return[0,
|
|
1684
1694
|
0,0];var data=[count>>8&255,count&255],lastOffset=1,i;for(i=0;i<count;++i)lastOffset+=index[i].length;lastOffset=256>lastOffset?1:65536>lastOffset?2:16777216>lastOffset?3:4;data.push(lastOffset);var relativeOffset=1;for(i=0;i<count+1;i++)1===lastOffset?data.push(relativeOffset&255):2===lastOffset?data.push(relativeOffset>>8&255,relativeOffset&255):3===lastOffset?data.push(relativeOffset>>16&255,relativeOffset>>8&255,relativeOffset&255):data.push(relativeOffset>>>24&255,relativeOffset>>16&255,relativeOffset>>
|
|
1685
|
-
8&255,relativeOffset&255),index[i]&&(relativeOffset+=index[i].length);for(i=0;i<count;i++)for(trackers[i]&&trackers[i].offset(data.length),lastOffset=0,relativeOffset=index[i].length;lastOffset<relativeOffset;lastOffset++)data.push(index[i][lastOffset]);return data}};return CFFCompiler}();exports.CFFCompiler=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.
|
|
1686
|
-
".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".split(" ");
|
|
1695
|
+
8&255,relativeOffset&255),index[i]&&(relativeOffset+=index[i].length);for(i=0;i<count;i++)for(trackers[i]&&trackers[i].offset(data.length),lastOffset=0,relativeOffset=index[i].length;lastOffset<relativeOffset;lastOffset++)data.push(index[i][lastOffset]);return data}};return CFFCompiler}();exports.CFFCompiler=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.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".split(" ");
|
|
1687
1696
|
exports.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".split(" ");
|
|
1688
1697
|
exports.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".split(" ")},
|
|
1689
1698
|
function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.getEncoding=function(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;
|
|
@@ -2001,13 +2010,13 @@ length+tag);if(4===offset){getUshort(cmap,length+tag+2);offset=getUshort(cmap,le
|
|
|
2001
2010
|
[];for(var j=0,jj=ranges[length].end-ranges[length].start+1;j<jj;j++)ranges[length].ids[j]=getUshort(cmap,tag+idOffset),idOffset+=2}}cmap=ranges}else if(12===offset){getLong(cmap,length+tag+4);offset=getLong(cmap,length+tag+12);tag=length+tag+16;ranges=[];for(length=0;length<offset;length++)ranges.push({start:getLong(cmap,tag),end:getLong(cmap,tag+4),idDelta:getLong(cmap,tag+8)-getLong(cmap,tag)}),tag+=12;cmap=ranges}else throw new _util.FormatError("unsupported cmap: ".concat(offset));break;case "glyf":glyf=
|
|
2002
2011
|
data.subarray(offset,offset+length);break;case "loca":loca=data.subarray(offset,offset+length);break;case "head":unitsPerEm=getUshort(data,offset+18);indexToLocFormat=getUshort(data,offset+50);break;case "CFF ":cff=seacAnalysisEnabled,cff=(new _cff_parser.CFFParser(new _stream.Stream(data,offset,offset+length-offset),{},cff)).parse(),cff={glyphs:cff.charStrings.objects,subrs:cff.topDict.privateDict&&cff.topDict.privateDict.subrsIndex&&cff.topDict.privateDict.subrsIndex.objects,gsubrs:cff.globalSubrIndex&&
|
|
2003
2012
|
cff.globalSubrIndex.objects,isCFFCIDFont:cff.isCIDFont,fdSelect:cff.fdSelect,fdArray:cff.fdArray}}}return glyf?(font=unitsPerEm?[1/unitsPerEm,0,0,1/unitsPerEm,0,0]:font.fontMatrix,new TrueTypeCompiled(parseGlyfTable(glyf,loca,indexToLocFormat),cmap,font)):new Type2Compiled(cff,cmap,font.fontMatrix,font.glyphNameMap)}}}();exports.FontRendererFactory=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.Type1Parser=void 0;var _util=__w_pdfjs_require__(5),
|
|
2004
|
-
_encodings=__w_pdfjs_require__(214),_stream=__w_pdfjs_require__(195),Type1CharString=function(){function Type1CharString(){this.lsb=this.width=0;this.flexing=!1;this.output=[];this.stack=[]}var
|
|
2005
|
-
[21],
|
|
2006
|
-
sbx);break}error=this.executeCommand(1,
|
|
2007
|
-
if(!subrs[sbx]){error=!0;break}error=this.convert(subrs[sbx],subrs,seacAnalysisEnabled);break;case 11:return error;case 13:if(2>this.stack.length){error=!0;break}error=this.stack.pop();this.lsb=sbx=this.stack.pop();this.width=error;this.stack.push(error,sbx);error=this.executeCommand(2,
|
|
2008
|
-
break;case 22:if(this.flexing){this.stack.push(0);break}error=this.executeCommand(1,
|
|
2009
|
-
error=this.executeCommand(4,
|
|
2010
|
-
break}sbx=this.stack.pop();sby=this.stack.pop();0===sbx&&3===sby?(sbx=this.stack.splice(this.stack.length-17,17),this.stack.push(sbx[2]+sbx[0],sbx[3]+sbx[1],sbx[4],sbx[5],sbx[6],sbx[7],sbx[8],sbx[9],sbx[10],sbx[11],sbx[12],sbx[13],sbx[14]),error=this.executeCommand(13,
|
|
2013
|
+
_encodings=__w_pdfjs_require__(214),_stream=__w_pdfjs_require__(195),Type1CharString=function(){function Type1CharString(){this.lsb=this.width=0;this.flexing=!1;this.output=[];this.stack=[]}var JSCompiler_object_inline_vmoveto_1337=[4],JSCompiler_object_inline_rlineto_1338=[5],JSCompiler_object_inline_hlineto_1339=[6],JSCompiler_object_inline_vlineto_1340=[7],JSCompiler_object_inline_rrcurveto_1341=[8],JSCompiler_object_inline_flex_1343=[12,35],JSCompiler_object_inline_endchar_1345=[14],JSCompiler_object_inline_rmoveto_1346=
|
|
2014
|
+
[21],JSCompiler_object_inline_hmoveto_1347=[22],JSCompiler_object_inline_vhcurveto_1348=[30],JSCompiler_object_inline_hvcurveto_1349=[31];Type1CharString.prototype={convert:function(encoded,subrs,seacAnalysisEnabled){for(var count=encoded.length,error=!1,sbx,i=0;i<count;i++)if(sbx=encoded[i],32>sbx){12===sbx&&(sbx=(sbx<<8)+encoded[++i]);switch(sbx){case 1:this.stack=[];break;case 3:this.stack=[];break;case 4:if(this.flexing){if(1>this.stack.length){error=!0;break}sbx=this.stack.pop();this.stack.push(0,
|
|
2015
|
+
sbx);break}error=this.executeCommand(1,JSCompiler_object_inline_vmoveto_1337);break;case 5:error=this.executeCommand(2,JSCompiler_object_inline_rlineto_1338);break;case 6:error=this.executeCommand(1,JSCompiler_object_inline_hlineto_1339);break;case 7:error=this.executeCommand(1,JSCompiler_object_inline_vlineto_1340);break;case 8:error=this.executeCommand(6,JSCompiler_object_inline_rrcurveto_1341);break;case 9:this.stack=[];break;case 10:if(1>this.stack.length){error=!0;break}sbx=this.stack.pop();
|
|
2016
|
+
if(!subrs[sbx]){error=!0;break}error=this.convert(subrs[sbx],subrs,seacAnalysisEnabled);break;case 11:return error;case 13:if(2>this.stack.length){error=!0;break}error=this.stack.pop();this.lsb=sbx=this.stack.pop();this.width=error;this.stack.push(error,sbx);error=this.executeCommand(2,JSCompiler_object_inline_hmoveto_1347);break;case 14:this.output.push(JSCompiler_object_inline_endchar_1345[0]);break;case 21:if(this.flexing)break;error=this.executeCommand(2,JSCompiler_object_inline_rmoveto_1346);
|
|
2017
|
+
break;case 22:if(this.flexing){this.stack.push(0);break}error=this.executeCommand(1,JSCompiler_object_inline_hmoveto_1347);break;case 30:error=this.executeCommand(4,JSCompiler_object_inline_vhcurveto_1348);break;case 31:error=this.executeCommand(4,JSCompiler_object_inline_hvcurveto_1349);break;case 3072:this.stack=[];break;case 3073:this.stack=[];break;case 3074:this.stack=[];break;case 3078:seacAnalysisEnabled?(this.seac=this.stack.splice(-4,4),error=this.executeCommand(0,JSCompiler_object_inline_endchar_1345)):
|
|
2018
|
+
error=this.executeCommand(4,JSCompiler_object_inline_endchar_1345);break;case 3079:if(4>this.stack.length){error=!0;break}this.stack.pop();error=this.stack.pop();var sby=this.stack.pop();this.lsb=sbx=this.stack.pop();this.width=error;this.stack.push(error,sbx,sby);error=this.executeCommand(3,JSCompiler_object_inline_rmoveto_1346);break;case 3084:if(2>this.stack.length){error=!0;break}sbx=this.stack.pop();sby=this.stack.pop();this.stack.push(sby/sbx);break;case 3088:if(2>this.stack.length){error=!0;
|
|
2019
|
+
break}sbx=this.stack.pop();sby=this.stack.pop();0===sbx&&3===sby?(sbx=this.stack.splice(this.stack.length-17,17),this.stack.push(sbx[2]+sbx[0],sbx[3]+sbx[1],sbx[4],sbx[5],sbx[6],sbx[7],sbx[8],sbx[9],sbx[10],sbx[11],sbx[12],sbx[13],sbx[14]),error=this.executeCommand(13,JSCompiler_object_inline_flex_1343,!0),this.flexing=!1,this.stack.push(sbx[15],sbx[16])):1===sbx&&0===sby&&(this.flexing=!0);break;case 3089:break;case 3105:this.stack=[];break;default:(0,_util.warn)('Unknown type 1 charstring command of "'+
|
|
2011
2020
|
sbx+'"')}if(error)break}else sbx=246>=sbx?sbx-139:250>=sbx?256*(sbx-247)+encoded[++i]+108:254>=sbx?-(256*(sbx-251))-encoded[++i]-108:(encoded[++i]&255)<<24|(encoded[++i]&255)<<16|(encoded[++i]&255)<<8|(encoded[++i]&255)<<0,this.stack.push(sbx);return error},executeCommand:function(howManyArgs,command,keepStack){var stackLength=this.stack.length;if(howManyArgs>stackLength)return!0;for(var start=stackLength-howManyArgs,i=start;i<stackLength;i++){var value=this.stack[i];Number.isInteger(value)?this.output.push(28,
|
|
2012
2021
|
value>>8&255,value&255):(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);keepStack?this.stack.splice(start,howManyArgs):this.stack.length=0;return!1}};return Type1CharString}();module=function(){function isHexDigit(code){return 48<=code&&57>=code||65<=code&&70>=code||97<=code&&102>=code}function decrypt(data,key,discardNumber){if(discardNumber>=data.length)return new Uint8Array(0);key|=0;var i;for(i=0;i<discardNumber;i++)key=
|
|
2013
2022
|
52845*(data[i]+key)+22719&65535;var count=data.length-discardNumber,decrypted=new Uint8Array(count);i=discardNumber;for(discardNumber=0;discardNumber<count;i++,discardNumber++){var value=data[i];decrypted[discardNumber]=value^key>>8;key=52845*(value+key)+22719&65535}return decrypted}function isSpecial(c){return 47===c||91===c||93===c||123===c||125===c||40===c||41===c}function Type1Parser(stream,encrypted,seacAnalysisEnabled){if(encrypted){encrypted=stream.getBytes();var isBinary=!(isHexDigit(encrypted[0])&&
|
|
@@ -2282,8 +2291,8 @@ createBuffer(length,encodingOrOffset);value=length.write(value,that);value!==enc
|
|
|
2282
2291
|
0;return that}function fromArrayLike(that,array){var length=0>array.length?0:checked(array.length)|0;that=createBuffer(that,length);for(var i=0;i<length;i+=1)that[i]=array[i]&255;return that}function fromObject(that,obj){if(Buffer.isBuffer(obj)){var len=checked(obj.length)|0;that=createBuffer(that,len);if(0===that.length)return that;obj.copy(that,0,0,len);return that}if(obj){if("undefined"!==typeof ArrayBuffer&&obj.buffer instanceof ArrayBuffer||"length"in obj)return(len="number"!==typeof obj.length)||
|
|
2283
2292
|
(len=obj.length,len=len!==len),len?createBuffer(that,0):fromArrayLike(that,obj);if("Buffer"===obj.type&&isArray(obj.data))return fromArrayLike(that,obj.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");}function checked(length){if(length>=(Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");
|
|
2284
2293
|
return length|0}function byteLength$jscomp$0(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!==typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case "ascii":case "latin1":case "binary":return len;case "utf8":case "utf-8":case void 0:return utf8ToBytes(string).length;
|
|
2285
|
-
case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*len;case "hex":return len>>>1;case "base64":return
|
|
2286
|
-
|
|
2294
|
+
case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*len;case "hex":return len>>>1;case "base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase();loweredCase=!0}}function slowToString(encoding,start,end){var loweredCase=!1;if(void 0===start||0>start)start=0;if(start>this.length)return"";if(void 0===end||end>this.length)end=this.length;if(0>=end)return"";end>>>=0;start>>>=0;if(end<=start)return"";for(encoding||
|
|
2295
|
+
(encoding="utf8");;)switch(encoding){case "hex":encoding=start;start=end;end=this.length;if(!encoding||0>encoding)encoding=0;if(!start||0>start||start>end)start=end;loweredCase="";for(end=encoding;end<start;++end)encoding=loweredCase,loweredCase=this[end],loweredCase=16>loweredCase?"0"+loweredCase.toString(16):loweredCase.toString(16),loweredCase=encoding+loweredCase;return loweredCase;case "utf8":case "utf-8":return utf8Slice(this,start,end);case "ascii":encoding="";for(end=Math.min(this.length,
|
|
2287
2296
|
end);start<end;++start)encoding+=String.fromCharCode(this[start]&127);return encoding;case "latin1":case "binary":encoding="";for(end=Math.min(this.length,end);start<end;++start)encoding+=String.fromCharCode(this[start]);return encoding;case "base64":return start=0===start&&end===this.length?base64.fromByteArray(this):base64.fromByteArray(this.slice(start,end)),start;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":start=this.slice(start,end);end="";for(encoding=0;encoding<start.length;encoding+=
|
|
2288
2297
|
2)end+=String.fromCharCode(start[encoding]+256*start[encoding+1]);return end;default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;"string"===typeof byteOffset?(encoding=byteOffset,byteOffset=0):2147483647<byteOffset?byteOffset=2147483647:-2147483648>byteOffset&&(byteOffset=-2147483648);
|
|
2289
2298
|
byteOffset=+byteOffset;isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1);0>byteOffset&&(byteOffset=buffer.length+byteOffset);if(byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(0>byteOffset)if(dir)byteOffset=0;else return-1;"string"===typeof val&&(val=Buffer.from(val,encoding));if(Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"===typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?
|
|
@@ -2295,54 +2304,55 @@ firstByte);break;case 2:var secondByte=buf[start+1];128===(secondByte&192)&&(fir
|
|
|
2295
2304
|
0;start<buf;)end+=String.fromCharCode.apply(String,res.slice(start,start+=MAX_ARGUMENTS_LENGTH));res=end}return res}function checkOffset(offset,ext,length){if(0!==offset%1||0>offset)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length");}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||value<min)throw new RangeError('"value" argument is out of bounds');
|
|
2296
2305
|
if(offset+ext>buf.length)throw new RangeError("Index out of range");}function objectWriteUInt16(buf,value,offset,littleEndian){0>value&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i<j;++i)buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){0>value&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i<j;++i)buf[offset+i]=value>>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,
|
|
2297
2306
|
value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(0>offset)throw new RangeError("Index out of range");}function writeFloat(buf,value,offset,littleEndian,noAssert){noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886E38,-3.4028234663852886E38);ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157E308,-1.7976931348623157E308);
|
|
2298
|
-
ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}function
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
0;i<length&&!(i+offset>=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}var base64=__webpack_require__(4),ieee754=__webpack_require__(5),isArray=__webpack_require__(6);exports.Buffer=Buffer;exports.SlowBuffer=function(length){+length!=length&&(length=0);return Buffer.alloc(+length)};exports.INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=void 0!==
|
|
2302
|
-
Buffer.poolSize=8192;Buffer._augment=function(arr){arr.__proto__=Buffer.prototype;return arr};Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)};Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===
|
|
2303
|
-
size=0>=size?createBuffer(null,size):void 0!==fill?"string"===typeof encoding?createBuffer(null,size).fill(fill,encoding):createBuffer(null,size).fill(fill):createBuffer(null,size);return size};Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)};Buffer.isBuffer=function(b){return!(null==
|
|
2304
|
-
if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i];y=b[i];break}return x<y?-1:y<x?1:0};Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "latin1":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return!0;
|
|
2305
|
-
if(0===list.length)return Buffer.alloc(0);var i;if(void 0===length)for(i=length=0;i<list.length;++i)length+=list[i].length;length=Buffer.allocUnsafe(length);var pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(!Buffer.isBuffer(buf))throw new TypeError('"list" argument must be an Array of Buffers');buf.copy(length,pos);pos+=buf.length}return length};Buffer.byteLength=
|
|
2306
|
-
|
|
2307
|
-
Buffer.prototype.toString=function(){var length=this.length|0;return 0===length?"":0===arguments.length?utf8Slice(this,0,length):slowToString.apply(this,arguments)};Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b?!0:0===Buffer.compare(this,b)};
|
|
2308
|
-
return"<Buffer "+str+">"};Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");void 0===start&&(start=0);void 0===end&&(end=target?target.length:0);void 0===thisStart&&(thisStart=0);void 0===thisEnd&&(thisEnd=this.length);if(0>
|
|
2309
|
-
end)return 1;start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y);thisStart=this.slice(thisStart,thisEnd);target=target.slice(start,end);for(start=0;start<len;++start)if(thisStart[start]!==target[start]){x=thisStart[start];y=target[start];break}return x<
|
|
2310
|
-
encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!0)};Buffer.prototype.lastIndexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!1)};Buffer.prototype.write=function(string,offset,length,encoding){if(void 0===offset)encoding="utf8",length=this.length,offset=0;else if(void 0===
|
|
2311
|
-
"utf8")):(encoding=length,length=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var remaining=this.length-offset;if(void 0===length||length>remaining)length=remaining;if(0<string.length&&(0>length||0>offset)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");
|
|
2312
|
-
length>encoding&&(length=encoding)):length=encoding;encoding=string.length;if(0!==encoding%2)throw new TypeError("Invalid hex string");length>encoding/2&&(length=encoding/2);for(encoding=0;encoding<length;++encoding){remaining=parseInt(string.substr(2*encoding,2),16);if(isNaN(remaining)){string=encoding;break a}this[offset+encoding]=remaining}string=
|
|
2313
|
-
this,offset,length);case "latin1":case "binary":return blitBuffer(asciiToBytes(string),this,offset,length);case "base64":return blitBuffer(
|
|
2314
|
-
length);default:if(remaining)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();remaining=!0}};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start;
|
|
2315
|
-
start);if(Buffer.TYPED_ARRAY_SUPPORT)end=this.subarray(start,end),end.__proto__=Buffer.prototype;else{len=end-start;end=new Buffer(len,void 0);for(var i=0;i<len;++i)end[i]=this[i+start]}return end};Buffer.prototype.readUIntLE=function(offset,byteLength,noAssert){offset|=0;byteLength|=0;noAssert||checkOffset(offset,byteLength,this.length);noAssert=
|
|
2316
|
-
noAssert){offset|=0;byteLength|=0;noAssert||checkOffset(offset,byteLength,this.length);noAssert=this[offset+--byteLength];for(var mul=1;0<byteLength&&(mul*=256);)noAssert+=this[offset+--byteLength]*mul;return noAssert};Buffer.prototype.readUInt8=function(offset,noAssert){noAssert||checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=
|
|
2317
|
-
function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);return this[offset]
|
|
2318
|
-
function(offset,byteLength,noAssert){offset|=0;byteLength|=0;noAssert||checkOffset(offset,byteLength,this.length);noAssert=this[offset];for(var mul=1,i=0;++i<byteLength&&(mul*=256);)noAssert+=this[offset+i]*mul;noAssert>=128*mul&&(noAssert-=Math.pow(2,8*byteLength));return noAssert};Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0;byteLength|=0;noAssert||
|
|
2319
|
-
256);)val+=this[offset+--noAssert]*mul;val>=128*mul&&(val-=Math.pow(2,8*byteLength));return val};Buffer.prototype.readInt8=function(offset,noAssert){noAssert||checkOffset(offset,1,this.length);return this[offset]&128?-1*(255-this[offset]+1):this[offset]};Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);offset=this[offset]|this[offset+
|
|
2320
|
-
checkOffset(offset,2,this.length);offset=this[offset+1]|this[offset]<<8;return offset&32768?offset|4294901760:offset};Buffer.prototype.readInt32LE=function(offset,noAssert){noAssert||checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function(offset,noAssert){noAssert||checkOffset(offset,4,this.length);
|
|
2321
|
-
noAssert){noAssert||checkOffset(offset,4,this.length);return ieee754.read(this,offset,!0,23,4)};Buffer.prototype.readFloatBE=function(offset,noAssert){noAssert||checkOffset(offset,4,this.length);return ieee754.read(this,offset,!1,23,4)};Buffer.prototype.readDoubleLE=function(offset,noAssert){noAssert||checkOffset(offset,8,this.length);return ieee754.read(this,offset,!0,52,8)};
|
|
2322
|
-
offset,!1,52,8)};Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){value=+value;offset|=0;byteLength|=0;noAssert||checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0);noAssert=1;var i=0;for(this[offset]=value&255;++i<byteLength&&(noAssert*=256);)this[offset+i]=value/noAssert&255;return offset+byteLength};Buffer.prototype.writeUIntBE=function(value,
|
|
2323
|
-
8*byteLength)-1,0);noAssert=byteLength-1;var mul=1;for(this[offset+noAssert]=value&255;0<=--noAssert&&(mul*=256);)this[offset+noAssert]=value/mul&255;return offset+byteLength};Buffer.prototype.writeUInt8=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,1,255,0);Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value));this[offset]=value&
|
|
2324
|
-
value,offset,2,65535,0);Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value&255,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0);return offset+2};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,2,65535,0);Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=value&255):objectWriteUInt16(this,
|
|
2325
|
-
offset|=0;noAssert||checkInt(this,value,offset,4,4294967295,0);Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=value&255):objectWriteUInt32(this,value,offset,!0);return offset+4};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,4,4294967295,0);Buffer.TYPED_ARRAY_SUPPORT?
|
|
2326
|
-
3]=value&255):objectWriteUInt32(this,value,offset,!1);return offset+4};Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){value=+value;offset|=0;noAssert||(noAssert=Math.pow(2,8*byteLength-1),checkInt(this,value,offset,byteLength,noAssert-1,-noAssert));noAssert=0;var mul=1,sub=0;for(this[offset]=value&255;++noAssert<byteLength&&(mul*=256);)0>value&&0===sub&&0!==this[offset+noAssert-1]&&(sub=
|
|
2327
|
-
function(value,offset,byteLength,noAssert){value=+value;offset|=0;noAssert||(noAssert=Math.pow(2,8*byteLength-1),checkInt(this,value,offset,byteLength,noAssert-1,-noAssert));noAssert=byteLength-1;var mul=1,sub=0;for(this[offset+noAssert]=value&255;0<=--noAssert&&(mul*=256);)0>value&&0===sub&&0!==this[offset+noAssert+1]&&(sub=1),this[offset+noAssert]=(value/mul>>0)-sub&255;return offset+byteLength};
|
|
2328
|
-
value,offset,1,127,-128);Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value));0>value&&(value=255+value+1);this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,2,32767,-32768);Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value&255,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset
|
|
2329
|
-
0;noAssert||checkInt(this,value,offset,2,32767,-32768);Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=value&255):objectWriteUInt16(this,value,offset,!1);return offset+2};Buffer.prototype.writeInt32LE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,4,2147483647,-2147483648);Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value&255,this[offset+
|
|
2330
|
-
|
|
2331
|
-
Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)};Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)};Buffer.prototype.copy=function(target,targetStart,start,end){start||(start=0);end||
|
|
2332
|
-
targetStart||(targetStart=0);0<end&&end<start&&(end=start);if(end===start||0===target.length||0===this.length)return 0;if(0>targetStart)throw new RangeError("targetStart out of bounds");if(0>start||start>=this.length)throw new RangeError("sourceStart out of bounds");if(0>end)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length);target.length-targetStart<end-start&&(end=target.length-targetStart+
|
|
2333
|
-
end)for(end=len-1;0<=end;--end)target[end+targetStart]=this[end+start];else if(1E3>len||!Buffer.TYPED_ARRAY_SUPPORT)for(end=0;end<len;++end)target[end+targetStart]=this[end+start];else Uint8Array.prototype.set.call(target,this.subarray(start,start+len),targetStart);return len};Buffer.prototype.fill=function(val,start,end,encoding){if("string"===typeof val){"string"===typeof start?(encoding=start,start=0,end=this.length):"string"===
|
|
2334
|
-
val.charCodeAt(0);256>code&&(val=code)}if(void 0!==encoding&&"string"!==typeof encoding)throw new TypeError("encoding must be a string");if("string"===typeof encoding&&!Buffer.isEncoding(encoding))throw new TypeError("Unknown encoding: "+encoding);}else"number"===typeof val&&(val&=255);if(0>start||this.length<start||this.length<end)throw new RangeError("Out of range index");if(end<=start)return this;start>>>=0;end=void 0===end?
|
|
2335
|
-
start;encoding<end;++encoding)this[encoding]=val;else for(val=Buffer.isBuffer(val)?val:utf8ToBytes((new Buffer(val,encoding)).toString()),code=val.length,encoding=0;encoding<end-start;++encoding)this[encoding+start]=val[encoding%code];return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g}).call(this,__webpack_require__(0))},function(module,exports,__webpack_require__){function getLens(b64){var len=b64.length;if(0<len%4)throw Error("Invalid string. Length must be a multiple of 4");
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
nBytes
|
|
2342
|
-
(
|
|
2343
|
-
|
|
2344
|
-
if((
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2307
|
+
ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}function utf8ToBytes(string,units){units=units||Infinity;for(var codePoint,length=string.length,leadSurrogate=null,bytes=[],i=0;i<length;++i){codePoint=string.charCodeAt(i);if(55295<codePoint&&57344>codePoint){if(!leadSurrogate){if(56319<codePoint){-1<(units-=3)&&bytes.push(239,191,189);continue}else if(i+1===length){-1<(units-=3)&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(56320>codePoint){-1<(units-=3)&&
|
|
2308
|
+
bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else leadSurrogate&&-1<(units-=3)&&bytes.push(239,191,189);leadSurrogate=null;if(128>codePoint){if(0>--units)break;bytes.push(codePoint)}else if(2048>codePoint){if(0>(units-=2))break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(65536>codePoint){if(0>(units-=3))break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(1114112>codePoint){if(0>(units-=4))break;
|
|
2309
|
+
bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else throw Error("Invalid code point");}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i<str.length;++i)byteArray.push(str.charCodeAt(i)&255);return byteArray}function base64ToBytes(str){var JSCompiler_temp_const=base64,JSCompiler_temp_const$jscomp$0=JSCompiler_temp_const.toByteArray;str=(str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")).replace(INVALID_BASE64_RE,"");if(2>str.length)str="";else for(;0!==
|
|
2310
|
+
str.length%4;)str+="=";return JSCompiler_temp_const$jscomp$0.call(JSCompiler_temp_const,str)}function blitBuffer(src,dst,offset,length){for(var i=0;i<length&&!(i+offset>=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}var base64=__webpack_require__(4),ieee754=__webpack_require__(5),isArray=__webpack_require__(6);exports.Buffer=Buffer;exports.SlowBuffer=function(length){+length!=length&&(length=0);return Buffer.alloc(+length)};exports.INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=void 0!==
|
|
2311
|
+
global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:typedArraySupport();exports.kMaxLength=Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823;Buffer.poolSize=8192;Buffer._augment=function(arr){arr.__proto__=Buffer.prototype;return arr};Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)};Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===
|
|
2312
|
+
Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0}));Buffer.alloc=function(size,fill,encoding){assertSize(size);size=0>=size?createBuffer(null,size):void 0!==fill?"string"===typeof encoding?createBuffer(null,size).fill(fill,encoding):createBuffer(null,size).fill(fill):createBuffer(null,size);return size};Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)};Buffer.isBuffer=function(b){return!(null==
|
|
2313
|
+
b||!b._isBuffer)};Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i];y=b[i];break}return x<y?-1:y<x?1:0};Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "latin1":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return!0;
|
|
2314
|
+
default:return!1}};Buffer.concat=function(list,length){if(!isArray(list))throw new TypeError('"list" argument must be an Array of Buffers');if(0===list.length)return Buffer.alloc(0);var i;if(void 0===length)for(i=length=0;i<list.length;++i)length+=list[i].length;length=Buffer.allocUnsafe(length);var pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(!Buffer.isBuffer(buf))throw new TypeError('"list" argument must be an Array of Buffers');buf.copy(length,pos);pos+=buf.length}return length};Buffer.byteLength=
|
|
2315
|
+
byteLength$jscomp$0;Buffer.prototype._isBuffer=!0;Buffer.prototype.swap16=function(){var len=this.length;if(0!==len%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<len;i+=2)swap(this,i,i+1);return this};Buffer.prototype.swap32=function(){var len=this.length;if(0!==len%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<len;i+=4)swap(this,i,i+3),swap(this,i+1,i+2);return this};Buffer.prototype.swap64=function(){var len=this.length;if(0!==
|
|
2316
|
+
len%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<len;i+=8)swap(this,i,i+7),swap(this,i+1,i+6),swap(this,i+2,i+5),swap(this,i+3,i+4);return this};Buffer.prototype.toString=function(){var length=this.length|0;return 0===length?"":0===arguments.length?utf8Slice(this,0,length):slowToString.apply(this,arguments)};Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b?!0:0===Buffer.compare(this,b)};
|
|
2317
|
+
Buffer.prototype.inspect=function(){var str="",max=exports.INSPECT_MAX_BYTES;0<this.length&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... "));return"<Buffer "+str+">"};Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");void 0===start&&(start=0);void 0===end&&(end=target?target.length:0);void 0===thisStart&&(thisStart=0);void 0===thisEnd&&(thisEnd=this.length);if(0>
|
|
2318
|
+
start||end>target.length||0>thisStart||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y);thisStart=this.slice(thisStart,thisEnd);target=target.slice(start,end);for(start=0;start<len;++start)if(thisStart[start]!==target[start]){x=thisStart[start];y=target[start];break}return x<
|
|
2319
|
+
y?-1:y<x?1:0};Buffer.prototype.includes=function(val,byteOffset,encoding){return-1!==this.indexOf(val,byteOffset,encoding)};Buffer.prototype.indexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!0)};Buffer.prototype.lastIndexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!1)};Buffer.prototype.write=function(string,offset,length,encoding){if(void 0===offset)encoding="utf8",length=this.length,offset=0;else if(void 0===
|
|
2320
|
+
length&&"string"===typeof offset)encoding=offset,length=this.length,offset=0;else if(isFinite(offset))offset|=0,isFinite(length)?(length|=0,void 0===encoding&&(encoding="utf8")):(encoding=length,length=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var remaining=this.length-offset;if(void 0===length||length>remaining)length=remaining;if(0<string.length&&(0>length||0>offset)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");
|
|
2321
|
+
encoding||(encoding="utf8");for(remaining=!1;;)switch(encoding){case "hex":a:{offset=Number(offset)||0;encoding=this.length-offset;length?(length=Number(length),length>encoding&&(length=encoding)):length=encoding;encoding=string.length;if(0!==encoding%2)throw new TypeError("Invalid hex string");length>encoding/2&&(length=encoding/2);for(encoding=0;encoding<length;++encoding){remaining=parseInt(string.substr(2*encoding,2),16);if(isNaN(remaining)){string=encoding;break a}this[offset+encoding]=remaining}string=
|
|
2322
|
+
encoding}return string;case "utf8":case "utf-8":return blitBuffer(utf8ToBytes(string,this.length-offset),this,offset,length);case "ascii":return blitBuffer(asciiToBytes(string),this,offset,length);case "latin1":case "binary":return blitBuffer(asciiToBytes(string),this,offset,length);case "base64":return blitBuffer(base64ToBytes(string),this,offset,length);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":encoding=string;remaining=this.length-offset;for(var byteArray=[],i=0;i<encoding.length&&
|
|
2323
|
+
!(0>(remaining-=2));++i){var lo=encoding.charCodeAt(i);string=lo>>8;lo%=256;byteArray.push(lo);byteArray.push(string)}return blitBuffer(byteArray,this,offset,length);default:if(remaining)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();remaining=!0}};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start;
|
|
2324
|
+
end=void 0===end?len:~~end;0>start?(start+=len,0>start&&(start=0)):start>len&&(start=len);0>end?(end+=len,0>end&&(end=0)):end>len&&(end=len);end<start&&(end=start);if(Buffer.TYPED_ARRAY_SUPPORT)end=this.subarray(start,end),end.__proto__=Buffer.prototype;else{len=end-start;end=new Buffer(len,void 0);for(var i=0;i<len;++i)end[i]=this[i+start]}return end};Buffer.prototype.readUIntLE=function(offset,byteLength,noAssert){offset|=0;byteLength|=0;noAssert||checkOffset(offset,byteLength,this.length);noAssert=
|
|
2325
|
+
this[offset];for(var mul=1,i=0;++i<byteLength&&(mul*=256);)noAssert+=this[offset+i]*mul;return noAssert};Buffer.prototype.readUIntBE=function(offset,byteLength,noAssert){offset|=0;byteLength|=0;noAssert||checkOffset(offset,byteLength,this.length);noAssert=this[offset+--byteLength];for(var mul=1;0<byteLength&&(mul*=256);)noAssert+=this[offset+--byteLength]*mul;return noAssert};Buffer.prototype.readUInt8=function(offset,noAssert){noAssert||checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=
|
|
2326
|
+
function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function(offset,noAssert){noAssert||checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]};Buffer.prototype.readUInt32BE=function(offset,noAssert){noAssert||checkOffset(offset,
|
|
2327
|
+
4,this.length);return 16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset|=0;byteLength|=0;noAssert||checkOffset(offset,byteLength,this.length);noAssert=this[offset];for(var mul=1,i=0;++i<byteLength&&(mul*=256);)noAssert+=this[offset+i]*mul;noAssert>=128*mul&&(noAssert-=Math.pow(2,8*byteLength));return noAssert};Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0;byteLength|=0;noAssert||
|
|
2328
|
+
checkOffset(offset,byteLength,this.length);noAssert=byteLength;for(var mul=1,val=this[offset+--noAssert];0<noAssert&&(mul*=256);)val+=this[offset+--noAssert]*mul;val>=128*mul&&(val-=Math.pow(2,8*byteLength));return val};Buffer.prototype.readInt8=function(offset,noAssert){noAssert||checkOffset(offset,1,this.length);return this[offset]&128?-1*(255-this[offset]+1):this[offset]};Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);offset=this[offset]|this[offset+
|
|
2329
|
+
1]<<8;return offset&32768?offset|4294901760:offset};Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);offset=this[offset+1]|this[offset]<<8;return offset&32768?offset|4294901760:offset};Buffer.prototype.readInt32LE=function(offset,noAssert){noAssert||checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function(offset,noAssert){noAssert||checkOffset(offset,4,this.length);
|
|
2330
|
+
return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function(offset,noAssert){noAssert||checkOffset(offset,4,this.length);return ieee754.read(this,offset,!0,23,4)};Buffer.prototype.readFloatBE=function(offset,noAssert){noAssert||checkOffset(offset,4,this.length);return ieee754.read(this,offset,!1,23,4)};Buffer.prototype.readDoubleLE=function(offset,noAssert){noAssert||checkOffset(offset,8,this.length);return ieee754.read(this,offset,!0,52,8)};
|
|
2331
|
+
Buffer.prototype.readDoubleBE=function(offset,noAssert){noAssert||checkOffset(offset,8,this.length);return ieee754.read(this,offset,!1,52,8)};Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){value=+value;offset|=0;byteLength|=0;noAssert||checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0);noAssert=1;var i=0;for(this[offset]=value&255;++i<byteLength&&(noAssert*=256);)this[offset+i]=value/noAssert&255;return offset+byteLength};Buffer.prototype.writeUIntBE=function(value,
|
|
2332
|
+
offset,byteLength,noAssert){value=+value;offset|=0;byteLength|=0;noAssert||checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0);noAssert=byteLength-1;var mul=1;for(this[offset+noAssert]=value&255;0<=--noAssert&&(mul*=256);)this[offset+noAssert]=value/mul&255;return offset+byteLength};Buffer.prototype.writeUInt8=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,1,255,0);Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value));this[offset]=value&
|
|
2333
|
+
255;return offset+1};Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,2,65535,0);Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value&255,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0);return offset+2};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,2,65535,0);Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=value&255):objectWriteUInt16(this,
|
|
2334
|
+
value,offset,!1);return offset+2};Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,4,4294967295,0);Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=value&255):objectWriteUInt32(this,value,offset,!0);return offset+4};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,4,4294967295,0);Buffer.TYPED_ARRAY_SUPPORT?
|
|
2335
|
+
(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=value&255):objectWriteUInt32(this,value,offset,!1);return offset+4};Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){value=+value;offset|=0;noAssert||(noAssert=Math.pow(2,8*byteLength-1),checkInt(this,value,offset,byteLength,noAssert-1,-noAssert));noAssert=0;var mul=1,sub=0;for(this[offset]=value&255;++noAssert<byteLength&&(mul*=256);)0>value&&0===sub&&0!==this[offset+noAssert-1]&&(sub=
|
|
2336
|
+
1),this[offset+noAssert]=(value/mul>>0)-sub&255;return offset+byteLength};Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){value=+value;offset|=0;noAssert||(noAssert=Math.pow(2,8*byteLength-1),checkInt(this,value,offset,byteLength,noAssert-1,-noAssert));noAssert=byteLength-1;var mul=1,sub=0;for(this[offset+noAssert]=value&255;0<=--noAssert&&(mul*=256);)0>value&&0===sub&&0!==this[offset+noAssert+1]&&(sub=1),this[offset+noAssert]=(value/mul>>0)-sub&255;return offset+byteLength};
|
|
2337
|
+
Buffer.prototype.writeInt8=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,1,127,-128);Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value));0>value&&(value=255+value+1);this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,2,32767,-32768);Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value&255,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,
|
|
2338
|
+
!0);return offset+2};Buffer.prototype.writeInt16BE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,2,32767,-32768);Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=value&255):objectWriteUInt16(this,value,offset,!1);return offset+2};Buffer.prototype.writeInt32LE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,4,2147483647,-2147483648);Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value&255,this[offset+
|
|
2339
|
+
1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0);return offset+4};Buffer.prototype.writeInt32BE=function(value,offset,noAssert){value=+value;offset|=0;noAssert||checkInt(this,value,offset,4,2147483647,-2147483648);0>value&&(value=4294967295+value+1);Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=value&255):objectWriteUInt32(this,value,offset,!1);return offset+4};Buffer.prototype.writeFloatLE=
|
|
2340
|
+
function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)};Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)};Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)};Buffer.prototype.copy=function(target,targetStart,start,end){start||(start=0);end||
|
|
2341
|
+
0===end||(end=this.length);targetStart>=target.length&&(targetStart=target.length);targetStart||(targetStart=0);0<end&&end<start&&(end=start);if(end===start||0===target.length||0===this.length)return 0;if(0>targetStart)throw new RangeError("targetStart out of bounds");if(0>start||start>=this.length)throw new RangeError("sourceStart out of bounds");if(0>end)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length);target.length-targetStart<end-start&&(end=target.length-targetStart+
|
|
2342
|
+
start);var len=end-start;if(this===target&&start<targetStart&&targetStart<end)for(end=len-1;0<=end;--end)target[end+targetStart]=this[end+start];else if(1E3>len||!Buffer.TYPED_ARRAY_SUPPORT)for(end=0;end<len;++end)target[end+targetStart]=this[end+start];else Uint8Array.prototype.set.call(target,this.subarray(start,start+len),targetStart);return len};Buffer.prototype.fill=function(val,start,end,encoding){if("string"===typeof val){"string"===typeof start?(encoding=start,start=0,end=this.length):"string"===
|
|
2343
|
+
typeof end&&(encoding=end,end=this.length);if(1===val.length){var code=val.charCodeAt(0);256>code&&(val=code)}if(void 0!==encoding&&"string"!==typeof encoding)throw new TypeError("encoding must be a string");if("string"===typeof encoding&&!Buffer.isEncoding(encoding))throw new TypeError("Unknown encoding: "+encoding);}else"number"===typeof val&&(val&=255);if(0>start||this.length<start||this.length<end)throw new RangeError("Out of range index");if(end<=start)return this;start>>>=0;end=void 0===end?
|
|
2344
|
+
this.length:end>>>0;val||(val=0);if("number"===typeof val)for(encoding=start;encoding<end;++encoding)this[encoding]=val;else for(val=Buffer.isBuffer(val)?val:utf8ToBytes((new Buffer(val,encoding)).toString()),code=val.length,encoding=0;encoding<end-start;++encoding)this[encoding+start]=val[encoding%code];return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g}).call(this,__webpack_require__(0))},function(module,exports,__webpack_require__){function getLens(b64){var len=b64.length;if(0<len%4)throw Error("Invalid string. Length must be a multiple of 4");
|
|
2345
|
+
b64=b64.indexOf("=");-1===b64&&(b64=len);return[b64,b64===len?0:4-b64%4]}exports.byteLength=function(b64){b64=getLens(b64);var placeHoldersLen=b64[1];return 3*(b64[0]+placeHoldersLen)/4-placeHoldersLen};exports.toByteArray=function(b64){var lens=getLens(b64);var tmp=lens[0];lens=lens[1];var arr=new Arr(3*(tmp+lens)/4-lens),curByte=0,len=0<lens?tmp-4:tmp,i;for(i=0;i<len;i+=4)tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+
|
|
2346
|
+
3)],arr[curByte++]=tmp>>16&255,arr[curByte++]=tmp>>8&255,arr[curByte++]=tmp&255;2===lens&&(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[curByte++]=tmp&255);1===lens&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[curByte++]=tmp>>8&255,arr[curByte++]=tmp&255);return arr};exports.fromByteArray=function(uint8$jscomp$0){for(var len=uint8$jscomp$0.length,extraBytes=len%3,parts=[],i=0,len2=len-extraBytes;i<len2;i+=
|
|
2347
|
+
16383){for(var JSCompiler_temp_const=parts,JSCompiler_temp_const$jscomp$0=JSCompiler_temp_const.push,JSCompiler_inline_result,uint8=uint8$jscomp$0,end=i+16383>len2?len2:i+16383,output=[],i$jscomp$0=i;i$jscomp$0<end;i$jscomp$0+=3)JSCompiler_inline_result=(uint8[i$jscomp$0]<<16&16711680)+(uint8[i$jscomp$0+1]<<8&65280)+(uint8[i$jscomp$0+2]&255),output.push(lookup[JSCompiler_inline_result>>18&63]+lookup[JSCompiler_inline_result>>12&63]+lookup[JSCompiler_inline_result>>6&63]+lookup[JSCompiler_inline_result&
|
|
2348
|
+
63]);JSCompiler_inline_result=output.join("");JSCompiler_temp_const$jscomp$0.call(JSCompiler_temp_const,JSCompiler_inline_result)}1===extraBytes?(uint8$jscomp$0=uint8$jscomp$0[len-1],parts.push(lookup[uint8$jscomp$0>>2]+lookup[uint8$jscomp$0<<4&63]+"==")):2===extraBytes&&(uint8$jscomp$0=(uint8$jscomp$0[len-2]<<8)+uint8$jscomp$0[len-1],parts.push(lookup[uint8$jscomp$0>>10]+lookup[uint8$jscomp$0>>4&63]+lookup[uint8$jscomp$0<<2&63]+"="));return parts.join("")};var lookup=[],revLookup=[],Arr="undefined"!==
|
|
2349
|
+
typeof Uint8Array?Uint8Array:Array;for(module=0;64>module;++module)lookup[module]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[module],revLookup["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(module)]=module;revLookup[45]=62;revLookup[95]=63},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var m=8*nBytes-mLen-1;var eMax=(1<<m)-1,eBias=eMax>>1,nBits=-7;nBytes=isLE?nBytes-1:0;var d=isLE?-1:1,s=buffer[offset+nBytes];
|
|
2350
|
+
nBytes+=d;isLE=s&(1<<-nBits)-1;s>>=-nBits;for(nBits+=m;0<nBits;isLE=256*isLE+buffer[offset+nBytes],nBytes+=d,nBits-=8);m=isLE&(1<<-nBits)-1;isLE>>=-nBits;for(nBits+=mLen;0<nBits;m=256*m+buffer[offset+nBytes],nBytes+=d,nBits-=8);if(0===isLE)isLE=1-eBias;else{if(isLE===eMax)return m?NaN:Infinity*(s?-1:1);m+=Math.pow(2,mLen);isLE-=eBias}return(s?-1:1)*m*Math.pow(2,isLE-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var c,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=23===
|
|
2351
|
+
mLen?Math.pow(2,-24)-Math.pow(2,-77):0;nBytes=isLE?0:nBytes-1;var d=isLE?1:-1,s=0>value||0===value&&0>1/value?1:0;value=Math.abs(value);isNaN(value)||Infinity===value?(value=isNaN(value)?1:0,isLE=eMax):(isLE=Math.floor(Math.log(value)/Math.LN2),1>value*(c=Math.pow(2,-isLE))&&(isLE--,c*=2),value=1<=isLE+eBias?value+rt/c:value+rt*Math.pow(2,1-eBias),2<=value*c&&(isLE++,c/=2),isLE+eBias>=eMax?(value=0,isLE=eMax):1<=isLE+eBias?(value=(value*c-1)*Math.pow(2,mLen),isLE+=eBias):(value=value*Math.pow(2,eBias-
|
|
2352
|
+
1)*Math.pow(2,mLen),isLE=0));for(;8<=mLen;buffer[offset+nBytes]=value&255,nBytes+=d,value/=256,mLen-=8);isLE=isLE<<mLen|value;for(eLen+=mLen;0<eLen;buffer[offset+nBytes]=isLE&255,nBytes+=d,isLE/=256,eLen-=8);buffer[offset+nBytes-d]|=128*s}},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){function defaultSetTimout(){throw Error("setTimeout has not been defined");}function defaultClearTimeout(){throw Error("clearTimeout has not been defined");
|
|
2353
|
+
}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e$13){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&
|
|
2354
|
+
clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e$14){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){currentQueue=
|
|
2355
|
+
queue;for(queue=[];++queueIndex<len;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1;len=queue.length}currentQueue=null;draining=!1;runClearTimeout(timeout)}}function Item(fun,array){this.fun=fun;this.array=array}function noop(){}module=module.exports={};try{var cachedSetTimeout="function"===typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{var cachedClearTimeout="function"===typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e$12){cachedClearTimeout=
|
|
2356
|
+
defaultClearTimeout}var queue=[],draining=!1,currentQueue,queueIndex=-1;module.nextTick=function(fun){var args=Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args));1!==queue.length||draining||runTimeout(drainQueue)};Item.prototype.run=function(){this.fun.apply(null,this.array)};module.title="browser";module.browser=!0;module.env={};module.argv=[];module.version="";module.versions={};module.on=noop;module.addListener=
|
|
2357
|
+
noop;module.once=noop;module.off=noop;module.removeListener=noop;module.removeAllListeners=noop;module.emit=noop;module.prependListener=noop;module.prependOnceListener=noop;module.listeners=function(name){return[]};module.binding=function(name){throw Error("process.binding is not supported");};module.cwd=function(){return"/"};module.chdir=function(dir){throw Error("process.chdir is not supported");};module.umask=function(){return 0}},function(module$jscomp$0,exports){module$jscomp$0.exports=function(module){module.webpackPolyfill||
|
|
2358
|
+
(module.deprecate=function(){},module.paths=[],module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),module.webpackPolyfill=1);return module}}]);}).call(this || window)
|