12345678910111213141516171819202122 |
- /**
- * @licstart The following is the entire license notice for the
- * JavaScript code in this page
- *
- * Copyright 2022 Mozilla Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @licend The above is the entire license notice for the
- * JavaScript code in this page
- */
- !function webpackUniversalModuleDefinition(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("pdfjs-dist/image_decoders/pdf.image_decoders",[],r):"object"==typeof exports?exports["pdfjs-dist/image_decoders/pdf.image_decoders"]=r():t["pdfjs-dist/image_decoders/pdf.image_decoders"]=t.pdfjsImageDecoders=r()}(globalThis,(()=>(()=>{var t=[,(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.UNSUPPORTED_FEATURES=r.TextRenderingMode=r.StreamType=r.RenderingIntentFlag=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.LINE_FACTOR=r.LINE_DESCENT_FACTOR=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FontType=r.FeatureTest=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.AnnotationType=r.AnnotationStateModelType=r.AnnotationReviewState=r.AnnotationReplyType=r.AnnotationMode=r.AnnotationMarkedState=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationEditorType=r.AnnotationEditorPrefix=r.AnnotationEditorParamsType=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0;r.arrayByteLength=arrayByteLength;r.arraysToBytes=function arraysToBytes(t){var r=t.length;if(1===r&&t[0]instanceof Uint8Array)return t[0];for(var i=0,o=0;o<r;o++)i+=arrayByteLength(t[o]);for(var a=0,c=new Uint8Array(i),l=0;l<r;l++){var u=t[l];u instanceof Uint8Array||(u="string"==typeof u?stringToBytes(u):new Uint8Array(u));var h=u.byteLength;c.set(u,a);a+=h}return c};r.assert=function assert(t,r){t||unreachable(r)};r.bytesToString=function bytesToString(t){"object"===_typeof(t)&&null!==t&&void 0!==t.length||unreachable("Invalid argument for bytesToString");var r=t.length,i=8192;if(r<i)return String.fromCharCode.apply(null,t);for(var o=[],a=0;a<r;a+=i){var c=Math.min(a+i,r),l=t.subarray(a,c);o.push(String.fromCharCode.apply(null,l))}return o.join("")};r.createPromiseCapability=function createPromiseCapability(){var t=Object.create(null),r=!1;Object.defineProperty(t,"settled",{get:function get(){return r}});t.promise=new Promise((function(i,o){t.resolve=function(t){r=!0;i(t)};t.reject=function(t){r=!0;o(t)}}));return t};r.createValidAbsoluteUrl=function createValidAbsoluteUrl(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){var o=t.match(/\./g);o&&o.length>=2&&(t="http://".concat(t))}if(i.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}var a=r?new URL(t,r):new URL(t);if(_isValidProtocol(a))return a}catch(t){}return null};r.escapeString=function escapeString(t){return t.replace(/([()\\\n\r])/g,(function(t){return"\n"===t?"\\n":"\r"===t?"\\r":"\\".concat(t)}))};r.getModificationDate=function getModificationDate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")];return r.join("")};r.getVerbosityLevel=function getVerbosityLevel(){return a};r.info=function info(t){a>=o.INFOS&&console.log("Info: ".concat(t))};r.isArrayBuffer=function isArrayBuffer(t){return"object"===_typeof(t)&&null!==t&&void 0!==t.byteLength};r.isArrayEqual=function isArrayEqual(t,r){if(t.length!==r.length)return!1;for(var i=0,o=t.length;i<o;i++)if(t[i]!==r[i])return!1;return!0};r.isAscii=function isAscii(t){return/^[\x00-\x7F]*$/.test(t)};r.objectFromMap=function objectFromMap(t){var r,i=Object.create(null),o=function _createForOfIteratorHelper(t,r){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){i&&(t=i);var o=0,a=function F(){};return{s:a,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,l=!0,u=!1;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();l=t.done;return t},e:function e(t){u=!0;c=t},f:function f(){try{l||null==i.return||i.return()}finally{if(u)throw c}}}}(t);try{for(o.s();!(r=o.n()).done;){var a=(u=r.value,h=2,function _arrayWithHoles(t){if(Array.isArray(t))return t}(u)||function _iterableToArrayLimit(t,r){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var o,a,c=[],l=!0,u=!1;try{for(i=i.call(t);!(l=(o=i.next()).done);l=!0){c.push(o.value);if(r&&c.length===r)break}}catch(t){u=!0;a=t}finally{try{l||null==i.return||i.return()}finally{if(u)throw a}}return c}(u,h)||_unsupportedIterableToArray(u,h)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=a[0],l=a[1];i[c]=l}}catch(t){o.e(t)}finally{o.f()}var u,h;return i};r.objectSize=function objectSize(t){return Object.keys(t).length};r.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(a=t)};r.shadow=shadow;r.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};r.stringToBytes=stringToBytes;r.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){var r;"þ"===t[0]&&"ÿ"===t[1]?r="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?r="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(r="utf-8");if(r)try{var i=new TextDecoder(r,{fatal:!0}),o=stringToBytes(t);return i.decode(o)}catch(t){warn('stringToPDFString: "'.concat(t,'".'))}}for(var a=[],c=0,l=t.length;c<l;c++){var u=_[t.charCodeAt(c)];a.push(u?String.fromCharCode(u):t.charAt(c))}return a.join("")};r.stringToUTF16BEString=function stringToUTF16BEString(t){for(var r=["þÿ"],i=0,o=t.length;i<o;i++){var a=t.charCodeAt(i);r.push(String.fromCharCode(a>>8&255),String.fromCharCode(255&a))}return r.join("")};r.stringToUTF8String=stringToUTF8String;r.unreachable=unreachable;r.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};r.warn=warn;i(2);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);return"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,i){r&&_defineProperties(t.prototype,r);i&&_defineProperties(t,i);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var i,o=_getPrototypeOf(t);if(r){var a=_getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}r.IDENTITY_MATRIX=[1,0,0,1,0,0];r.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];r.LINE_FACTOR=1.35;r.LINE_DESCENT_FACTOR=.35;r.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.AnnotationEditorPrefix="pdfjs_internal_editor_";r.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};r.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};r.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};r.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};r.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};r.AnnotationReplyType={GROUP:"Group",REPLY:"R"};r.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.PageActionEventType={O:"PageOpen",C:"PageClose"};r.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};r.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};var o={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=o;r.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};r.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};r.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var a=o.WARNINGS;function warn(t){a>=o.WARNINGS&&console.log("Warning: ".concat(t))}function unreachable(t){throw new Error(t)}function _isValidProtocol(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function shadow(t,r,i){Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!1});return i}var c=function BaseExceptionClosure(){function BaseException(t,r){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=r}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();r.BaseException=c;var l=function(t){_inherits(PasswordException,t);var r=_createSuper(PasswordException);function PasswordException(t,i){var o;_classCallCheck(this,PasswordException);(o=r.call(this,t,"PasswordException")).code=i;return o}return _createClass(PasswordException)}(c);r.PasswordException=l;var u=function(t){_inherits(UnknownErrorException,t);var r=_createSuper(UnknownErrorException);function UnknownErrorException(t,i){var o;_classCallCheck(this,UnknownErrorException);(o=r.call(this,t,"UnknownErrorException")).details=i;return o}return _createClass(UnknownErrorException)}(c);r.UnknownErrorException=u;var h=function(t){_inherits(InvalidPDFException,t);var r=_createSuper(InvalidPDFException);function InvalidPDFException(t){_classCallCheck(this,InvalidPDFException);return r.call(this,t,"InvalidPDFException")}return _createClass(InvalidPDFException)}(c);r.InvalidPDFException=h;var p=function(t){_inherits(MissingPDFException,t);var r=_createSuper(MissingPDFException);function MissingPDFException(t){_classCallCheck(this,MissingPDFException);return r.call(this,t,"MissingPDFException")}return _createClass(MissingPDFException)}(c);r.MissingPDFException=p;var d=function(t){_inherits(UnexpectedResponseException,t);var r=_createSuper(UnexpectedResponseException);function UnexpectedResponseException(t,i){var o;_classCallCheck(this,UnexpectedResponseException);(o=r.call(this,t,"UnexpectedResponseException")).status=i;return o}return _createClass(UnexpectedResponseException)}(c);r.UnexpectedResponseException=d;var y=function(t){_inherits(FormatError,t);var r=_createSuper(FormatError);function FormatError(t){_classCallCheck(this,FormatError);return r.call(this,t,"FormatError")}return _createClass(FormatError)}(c);r.FormatError=y;var v=function(t){_inherits(AbortException,t);var r=_createSuper(AbortException);function AbortException(t){_classCallCheck(this,AbortException);return r.call(this,t,"AbortException")}return _createClass(AbortException)}(c);r.AbortException=v;function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");for(var r=t.length,i=new Uint8Array(r),o=0;o<r;++o)i[o]=255&t.charCodeAt(o);return i}function arrayByteLength(t){if(void 0!==t.length)return t.length;if(void 0!==t.byteLength)return t.byteLength;unreachable("Invalid argument for arrayByteLength")}var m=function(){function FeatureTest(){_classCallCheck(this,FeatureTest)}_createClass(FeatureTest,null,[{key:"isLittleEndian",get:function get(){return shadow(this,"isLittleEndian",function isLittleEndian(){var t=new Uint8Array(4);t[0]=1;return 1===new Uint32Array(t.buffer,0,1)[0]}())}},{key:"isEvalSupported",get:function get(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(t){return!1}}())}},{key:"isOffscreenCanvasSupported",get:function get(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}}]);return FeatureTest}();r.FeatureTest=m;var g=_toConsumableArray(Array(256).keys()).map((function(t){return t.toString(16).padStart(2,"0")})),b=function(){function Util(){_classCallCheck(this,Util)}_createClass(Util,null,[{key:"makeHexColor",value:function makeHexColor(t,r,i){return"#".concat(g[t]).concat(g[r]).concat(g[i])}},{key:"scaleMinMax",value:function scaleMinMax(t,r){var i;if(t[0]){if(t[0]<0){i=r[0];r[0]=r[1];r[1]=i}r[0]*=t[0];r[1]*=t[0];if(t[3]<0){i=r[2];r[2]=r[3];r[3]=i}r[2]*=t[3];r[3]*=t[3]}else{i=r[0];r[0]=r[2];r[2]=i;i=r[1];r[1]=r[3];r[3]=i;if(t[1]<0){i=r[2];r[2]=r[3];r[3]=i}r[2]*=t[1];r[3]*=t[1];if(t[2]<0){i=r[0];r[0]=r[1];r[1]=i}r[0]*=t[2];r[1]*=t[2]}r[0]+=t[4];r[1]+=t[4];r[2]+=t[5];r[3]+=t[5]}},{key:"transform",value:function transform(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}},{key:"applyTransform",value:function applyTransform(t,r){return[t[0]*r[0]+t[1]*r[2]+r[4],t[0]*r[1]+t[1]*r[3]+r[5]]}},{key:"applyInverseTransform",value:function applyInverseTransform(t,r){var i=r[0]*r[3]-r[1]*r[2];return[(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/i,(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/i]}},{key:"getAxialAlignedBoundingBox",value:function getAxialAlignedBoundingBox(t,r){var i=Util.applyTransform(t,r),o=Util.applyTransform(t.slice(2,4),r),a=Util.applyTransform([t[0],t[3]],r),c=Util.applyTransform([t[2],t[1]],r);return[Math.min(i[0],o[0],a[0],c[0]),Math.min(i[1],o[1],a[1],c[1]),Math.max(i[0],o[0],a[0],c[0]),Math.max(i[1],o[1],a[1],c[1])]}},{key:"inverseTransform",value:function inverseTransform(t){var r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]}},{key:"apply3dTransform",value:function apply3dTransform(t,r){return[t[0]*r[0]+t[1]*r[1]+t[2]*r[2],t[3]*r[0]+t[4]*r[1]+t[5]*r[2],t[6]*r[0]+t[7]*r[1]+t[8]*r[2]]}},{key:"singularValueDecompose2dScale",value:function singularValueDecompose2dScale(t){var r=[t[0],t[2],t[1],t[3]],i=t[0]*r[0]+t[1]*r[2],o=t[0]*r[1]+t[1]*r[3],a=t[2]*r[0]+t[3]*r[2],c=t[2]*r[1]+t[3]*r[3],l=(i+c)/2,u=Math.sqrt(Math.pow(i+c,2)-4*(i*c-a*o))/2,h=l+u||1,p=l-u||1;return[Math.sqrt(h),Math.sqrt(p)]}},{key:"normalizeRect",value:function normalizeRect(t){var r=t.slice(0);if(t[0]>t[2]){r[0]=t[2];r[2]=t[0]}if(t[1]>t[3]){r[1]=t[3];r[3]=t[1]}return r}},{key:"intersect",value:function intersect(t,r){var i=Math.max(Math.min(t[0],t[2]),Math.min(r[0],r[2])),o=Math.min(Math.max(t[0],t[2]),Math.max(r[0],r[2]));if(i>o)return null;var a=Math.max(Math.min(t[1],t[3]),Math.min(r[1],r[3])),c=Math.min(Math.max(t[1],t[3]),Math.max(r[1],r[3]));return a>c?null:[i,a,o,c]}},{key:"bezierBoundingBox",value:function bezierBoundingBox(t,r,i,o,a,c,l,u){for(var h,p,d,y,v,m,g,b,_=[],x=[[],[]],w=0;w<2;++w){if(0===w){p=6*t-12*i+6*a;h=-3*t+9*i-9*a+3*l;d=3*i-3*t}else{p=6*r-12*o+6*c;h=-3*r+9*o-9*c+3*u;d=3*o-3*r}if(Math.abs(h)<1e-12){if(Math.abs(p)<1e-12)continue;0<(y=-d/p)&&y<1&&_.push(y)}else{g=p*p-4*d*h;b=Math.sqrt(g);if(!(g<0)){0<(v=(-p+b)/(2*h))&&v<1&&_.push(v);0<(m=(-p-b)/(2*h))&&m<1&&_.push(m)}}}for(var C,T=_.length,P=T;T--;){C=1-(y=_[T]);x[0][T]=C*C*C*t+3*C*C*y*i+3*C*y*y*a+y*y*y*l;x[1][T]=C*C*C*r+3*C*C*y*o+3*C*y*y*c+y*y*y*u}x[0][P]=t;x[1][P]=r;x[0][P+1]=l;x[1][P+1]=u;x[0].length=x[1].length=P+2;return[Math.min.apply(Math,_toConsumableArray(x[0])),Math.min.apply(Math,_toConsumableArray(x[1])),Math.max.apply(Math,_toConsumableArray(x[0])),Math.max.apply(Math,_toConsumableArray(x[1]))]}}]);return Util}();r.Util=b;var _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(t){return decodeURIComponent(escape(t))}},(t,r,i)=>{"use strict";var o=i(3);if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;!function checkNodeBtoa(){!globalThis.btoa&&o.isNodeJS&&(globalThis.btoa=function(t){return Buffer.from(t,"binary").toString("base64")})}();!function checkNodeAtob(){!globalThis.atob&&o.isNodeJS&&(globalThis.atob=function(t){return Buffer.from(t,"base64").toString("binary")})}();!function checkDOMMatrix(){!globalThis.DOMMatrix&&o.isNodeJS&&(globalThis.DOMMatrix=require("dommatrix/dist/dommatrix.js"))}();!function checkReadableStream(){!globalThis.ReadableStream&&o.isNodeJS&&(globalThis.ReadableStream=require("web-streams-polyfill/dist/ponyfill.js").ReadableStream)}();!function checkArrayAt(){Array.prototype.at||i(4)}();!function checkTypedArrayAt(){Uint8Array.prototype.at||i(76)}()}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.isNodeJS=void 0;function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var i=!("object"!==("undefined"==typeof process?"undefined":_typeof(process))||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);r.isNodeJS=i},(t,r,i)=>{i(5);var o=i(75);t.exports=o("Array","at")},(t,r,i)=>{"use strict";var o=i(6),a=i(41),c=i(65),l=i(63),u=i(70);o({target:"Array",proto:!0},{at:function at(t){var r=a(this),i=c(r),o=l(t),u=o>=0?o:i+o;return u<0||u>=i?void 0:r[u]}});u("at")},(t,r,i)=>{var o=i(7),a=i(8).f,c=i(45),l=i(49),u=i(39),h=i(57),p=i(69);t.exports=function(t,r){var i,d,y,v,m,g=t.target,b=t.global,_=t.stat;if(i=b?o:_?o[g]||u(g,{}):(o[g]||{}).prototype)for(d in r){v=r[d];y=t.dontCallGetSet?(m=a(i,d))&&m.value:i[d];if(!p(b?d:g+(_?".":"#")+d,t.forced)&&void 0!==y){if(typeof v==typeof y)continue;h(v,y)}(t.sham||y&&y.sham)&&c(v,"sham",!0);l(i,d,v,t)}}},t=>{var check=function(t){return t&&t.Math==Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||Function("return this")()},(t,r,i)=>{var o=i(9),a=i(11),c=i(13),l=i(14),u=i(15),h=i(20),p=i(40),d=i(43),y=Object.getOwnPropertyDescriptor;r.f=o?y:function getOwnPropertyDescriptor(t,r){t=u(t);r=h(r);if(d)try{return y(t,r)}catch(t){}if(p(t,r))return l(!a(c.f,t,r),t[r])}},(t,r,i)=>{var o=i(10);t.exports=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,r,i)=>{var o=i(12),a=Function.prototype.call;t.exports=o?a.bind(a):function(){return a.apply(a,arguments)}},(t,r,i)=>{var o=i(10);t.exports=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},(t,r)=>{"use strict";var i={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!i.call({1:2},1);r.f=a?function propertyIsEnumerable(t){var r=o(this,t);return!!r&&r.enumerable}:i},t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},(t,r,i)=>{var o=i(16),a=i(19);t.exports=function(t){return o(a(t))}},(t,r,i)=>{var o=i(17),a=i(10),c=i(18),l=Object,u=o("".split);t.exports=a((function(){return!l("z").propertyIsEnumerable(0)}))?function(t){return"String"==c(t)?u(t,""):l(t)}:l},(t,r,i)=>{var o=i(12),a=Function.prototype,c=a.bind,l=a.call,u=o&&c.bind(l,l);t.exports=o?function(t){return t&&u(t)}:function(t){return t&&function(){return l.apply(t,arguments)}}},(t,r,i)=>{var o=i(17),a=o({}.toString),c=o("".slice);t.exports=function(t){return c(a(t),8,-1)}},t=>{var r=TypeError;t.exports=function(t){if(null==t)throw r("Can't call method on "+t);return t}},(t,r,i)=>{var o=i(21),a=i(24);t.exports=function(t){var r=o(t,"string");return a(r)?r:r+""}},(t,r,i)=>{var o=i(11),a=i(22),c=i(24),l=i(31),u=i(34),h=i(35),p=TypeError,d=h("toPrimitive");t.exports=function(t,r){if(!a(t)||c(t))return t;var i,h=l(t,d);if(h){void 0===r&&(r="default");i=o(h,t,r);if(!a(i)||c(i))return i;throw p("Can't convert object to primitive value")}void 0===r&&(r="number");return u(t,r)}},(t,r,i)=>{var o=i(23);t.exports=function(t){return"object"==typeof t?null!==t:o(t)}},t=>{t.exports=function(t){return"function"==typeof t}},(t,r,i)=>{var o=i(25),a=i(23),c=i(26),l=i(27),u=Object;t.exports=l?function(t){return"symbol"==typeof t}:function(t){var r=o("Symbol");return a(r)&&c(r.prototype,u(t))}},(t,r,i)=>{var o=i(7),a=i(23),aFunction=function(t){return a(t)?t:void 0};t.exports=function(t,r){return arguments.length<2?aFunction(o[t]):o[t]&&o[t][r]}},(t,r,i)=>{var o=i(17);t.exports=o({}.isPrototypeOf)},(t,r,i)=>{var o=i(28);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,r,i)=>{var o=i(29),a=i(10);t.exports=!!Object.getOwnPropertySymbols&&!a((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&o&&o<41}))},(t,r,i)=>{var o,a,c=i(7),l=i(30),u=c.process,h=c.Deno,p=u&&u.versions||h&&h.version,d=p&&p.v8;d&&(a=(o=d.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1]));!a&&l&&(!(o=l.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=l.match(/Chrome\/(\d+)/))&&(a=+o[1]);t.exports=a},(t,r,i)=>{var o=i(25);t.exports=o("navigator","userAgent")||""},(t,r,i)=>{var o=i(32);t.exports=function(t,r){var i=t[r];return null==i?void 0:o(i)}},(t,r,i)=>{var o=i(23),a=i(33),c=TypeError;t.exports=function(t){if(o(t))return t;throw c(a(t)+" is not a function")}},t=>{var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},(t,r,i)=>{var o=i(11),a=i(23),c=i(22),l=TypeError;t.exports=function(t,r){var i,u;if("string"===r&&a(i=t.toString)&&!c(u=o(i,t)))return u;if(a(i=t.valueOf)&&!c(u=o(i,t)))return u;if("string"!==r&&a(i=t.toString)&&!c(u=o(i,t)))return u;throw l("Can't convert object to primitive value")}},(t,r,i)=>{var o=i(7),a=i(36),c=i(40),l=i(42),u=i(28),h=i(27),p=a("wks"),d=o.Symbol,y=d&&d.for,v=h?d:d&&d.withoutSetter||l;t.exports=function(t){if(!c(p,t)||!u&&"string"!=typeof p[t]){var r="Symbol."+t;u&&c(d,t)?p[t]=d[t]:p[t]=h&&y?y(r):v(r)}return p[t]}},(t,r,i)=>{var o=i(37),a=i(38);(t.exports=function(t,r){return a[t]||(a[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.23.5",mode:o?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.5/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,r,i)=>{var o=i(7),a=i(39),c="__core-js_shared__",l=o[c]||a(c,{});t.exports=l},(t,r,i)=>{var o=i(7),a=Object.defineProperty;t.exports=function(t,r){try{a(o,t,{value:r,configurable:!0,writable:!0})}catch(i){o[t]=r}return r}},(t,r,i)=>{var o=i(17),a=i(41),c=o({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,r){return c(a(t),r)}},(t,r,i)=>{var o=i(19),a=Object;t.exports=function(t){return a(o(t))}},(t,r,i)=>{var o=i(17),a=0,c=Math.random(),l=o(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+l(++a+c,36)}},(t,r,i)=>{var o=i(9),a=i(10),c=i(44);t.exports=!o&&!a((function(){return 7!=Object.defineProperty(c("div"),"a",{get:function(){return 7}}).a}))},(t,r,i)=>{var o=i(7),a=i(22),c=o.document,l=a(c)&&a(c.createElement);t.exports=function(t){return l?c.createElement(t):{}}},(t,r,i)=>{var o=i(9),a=i(46),c=i(14);t.exports=o?function(t,r,i){return a.f(t,r,c(1,i))}:function(t,r,i){t[r]=i;return t}},(t,r,i)=>{var o=i(9),a=i(43),c=i(47),l=i(48),u=i(20),h=TypeError,p=Object.defineProperty,d=Object.getOwnPropertyDescriptor,y="enumerable",v="configurable",m="writable";r.f=o?c?function defineProperty(t,r,i){l(t);r=u(r);l(i);if("function"==typeof t&&"prototype"===r&&"value"in i&&m in i&&!i.writable){var o=d(t,r);if(o&&o.writable){t[r]=i.value;i={configurable:v in i?i.configurable:o.configurable,enumerable:y in i?i.enumerable:o.enumerable,writable:!1}}}return p(t,r,i)}:p:function defineProperty(t,r,i){l(t);r=u(r);l(i);if(a)try{return p(t,r,i)}catch(t){}if("get"in i||"set"in i)throw h("Accessors not supported");"value"in i&&(t[r]=i.value);return t}},(t,r,i)=>{var o=i(9),a=i(10);t.exports=o&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(t,r,i)=>{var o=i(22),a=String,c=TypeError;t.exports=function(t){if(o(t))return t;throw c(a(t)+" is not an object")}},(t,r,i)=>{var o=i(23),a=i(46),c=i(50),l=i(39);t.exports=function(t,r,i,u){u||(u={});var h=u.enumerable,p=void 0!==u.name?u.name:r;o(i)&&c(i,p,u);if(u.global)h?t[r]=i:l(r,i);else{try{u.unsafe?t[r]&&(h=!0):delete t[r]}catch(t){}h?t[r]=i:a.f(t,r,{value:i,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},(t,r,i)=>{var o=i(10),a=i(23),c=i(40),l=i(9),u=i(51).CONFIGURABLE,h=i(52),p=i(53),d=p.enforce,y=p.get,v=Object.defineProperty,m=l&&!o((function(){return 8!==v((function(){}),"length",{value:8}).length})),g=String(String).split("String"),b=t.exports=function(t,r,i){"Symbol("===String(r).slice(0,7)&&(r="["+String(r).replace(/^Symbol\(([^)]*)\)/,"$1")+"]");i&&i.getter&&(r="get "+r);i&&i.setter&&(r="set "+r);(!c(t,"name")||u&&t.name!==r)&&(l?v(t,"name",{value:r,configurable:!0}):t.name=r);m&&i&&c(i,"arity")&&t.length!==i.arity&&v(t,"length",{value:i.arity});try{i&&c(i,"constructor")&&i.constructor?l&&v(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var o=d(t);c(o,"source")||(o.source=g.join("string"==typeof r?r:""));return t};Function.prototype.toString=b((function toString(){return a(this)&&y(this).source||h(this)}),"toString")},(t,r,i)=>{var o=i(9),a=i(40),c=Function.prototype,l=o&&Object.getOwnPropertyDescriptor,u=a(c,"name"),h=u&&"something"===function something(){}.name,p=u&&(!o||o&&l(c,"name").configurable);t.exports={EXISTS:u,PROPER:h,CONFIGURABLE:p}},(t,r,i)=>{var o=i(17),a=i(23),c=i(38),l=o(Function.toString);a(c.inspectSource)||(c.inspectSource=function(t){return l(t)});t.exports=c.inspectSource},(t,r,i)=>{var o,a,c,l=i(54),u=i(7),h=i(17),p=i(22),d=i(45),y=i(40),v=i(38),m=i(55),g=i(56),b="Object already initialized",_=u.TypeError,x=u.WeakMap;if(l||v.state){var w=v.state||(v.state=new x),C=h(w.get),T=h(w.has),P=h(w.set);o=function(t,r){if(T(w,t))throw new _(b);r.facade=t;P(w,t,r);return r};a=function(t){return C(w,t)||{}};c=function(t){return T(w,t)}}else{var S=m("state");g[S]=!0;o=function(t,r){if(y(t,S))throw new _(b);r.facade=t;d(t,S,r);return r};a=function(t){return y(t,S)?t[S]:{}};c=function(t){return y(t,S)}}t.exports={set:o,get:a,has:c,enforce:function(t){return c(t)?a(t):o(t,{})},getterFor:function(t){return function(r){var i;if(!p(r)||(i=a(r)).type!==t)throw _("Incompatible receiver, "+t+" required");return i}}}},(t,r,i)=>{var o=i(7),a=i(23),c=i(52),l=o.WeakMap;t.exports=a(l)&&/native code/.test(c(l))},(t,r,i)=>{var o=i(36),a=i(42),c=o("keys");t.exports=function(t){return c[t]||(c[t]=a(t))}},t=>{t.exports={}},(t,r,i)=>{var o=i(40),a=i(58),c=i(8),l=i(46);t.exports=function(t,r,i){for(var u=a(r),h=l.f,p=c.f,d=0;d<u.length;d++){var y=u[d];o(t,y)||i&&o(i,y)||h(t,y,p(r,y))}}},(t,r,i)=>{var o=i(25),a=i(17),c=i(59),l=i(68),u=i(48),h=a([].concat);t.exports=o("Reflect","ownKeys")||function ownKeys(t){var r=c.f(u(t)),i=l.f;return i?h(r,i(t)):r}},(t,r,i)=>{var o=i(60),a=i(67).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return o(t,a)}},(t,r,i)=>{var o=i(17),a=i(40),c=i(15),l=i(61).indexOf,u=i(56),h=o([].push);t.exports=function(t,r){var i,o=c(t),p=0,d=[];for(i in o)!a(u,i)&&a(o,i)&&h(d,i);for(;r.length>p;)a(o,i=r[p++])&&(~l(d,i)||h(d,i));return d}},(t,r,i)=>{var o=i(15),a=i(62),c=i(65),createMethod=function(t){return function(r,i,l){var u,h=o(r),p=c(h),d=a(l,p);if(t&&i!=i){for(;p>d;)if((u=h[d++])!=u)return!0}else for(;p>d;d++)if((t||d in h)&&h[d]===i)return t||d||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(t,r,i)=>{var o=i(63),a=Math.max,c=Math.min;t.exports=function(t,r){var i=o(t);return i<0?a(i+r,0):c(i,r)}},(t,r,i)=>{var o=i(64);t.exports=function(t){var r=+t;return r!=r||0===r?0:o(r)}},t=>{var r=Math.ceil,i=Math.floor;t.exports=Math.trunc||function trunc(t){var o=+t;return(o>0?i:r)(o)}},(t,r,i)=>{var o=i(66);t.exports=function(t){return o(t.length)}},(t,r,i)=>{var o=i(63),a=Math.min;t.exports=function(t){return t>0?a(o(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,r)=>{r.f=Object.getOwnPropertySymbols},(t,r,i)=>{var o=i(10),a=i(23),c=/#|\.prototype\./,isForced=function(t,r){var i=u[l(t)];return i==p||i!=h&&(a(r)?o(r):!!r)},l=isForced.normalize=function(t){return String(t).replace(c,".").toLowerCase()},u=isForced.data={},h=isForced.NATIVE="N",p=isForced.POLYFILL="P";t.exports=isForced},(t,r,i)=>{var o=i(35),a=i(71),c=i(46).f,l=o("unscopables"),u=Array.prototype;null==u[l]&&c(u,l,{configurable:!0,value:a(null)});t.exports=function(t){u[l][t]=!0}},(t,r,i)=>{var o,a=i(48),c=i(72),l=i(67),u=i(56),h=i(74),p=i(44),d=i(55),y=d("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var r=t.parentWindow.Object;t=null;return r},NullProtoObject=function(){try{o=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&o?NullProtoObjectViaActiveX(o):function(){var t,r=p("iframe");r.style.display="none";h.appendChild(r);r.src=String("javascript:");(t=r.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(o);for(var t=l.length;t--;)delete NullProtoObject.prototype[l[t]];return NullProtoObject()};u[y]=!0;t.exports=Object.create||function create(t,r){var i;if(null!==t){EmptyConstructor.prototype=a(t);i=new EmptyConstructor;EmptyConstructor.prototype=null;i[y]=t}else i=NullProtoObject();return void 0===r?i:c.f(i,r)}},(t,r,i)=>{var o=i(9),a=i(47),c=i(46),l=i(48),u=i(15),h=i(73);r.f=o&&!a?Object.defineProperties:function defineProperties(t,r){l(t);for(var i,o=u(r),a=h(r),p=a.length,d=0;p>d;)c.f(t,i=a[d++],o[i]);return t}},(t,r,i)=>{var o=i(60),a=i(67);t.exports=Object.keys||function keys(t){return o(t,a)}},(t,r,i)=>{var o=i(25);t.exports=o("document","documentElement")},(t,r,i)=>{var o=i(7),a=i(17);t.exports=function(t,r){return a(o[t].prototype[r])}},(t,r,i)=>{i(77)},(t,r,i)=>{"use strict";var o=i(78),a=i(65),c=i(63),l=o.aTypedArray;(0,o.exportTypedArrayMethod)("at",(function at(t){var r=l(this),i=a(r),o=c(t),u=o>=0?o:i+o;return u<0||u>=i?void 0:r[u]}))},(t,r,i)=>{"use strict";var o,a,c,l=i(79),u=i(9),h=i(7),p=i(23),d=i(22),y=i(40),v=i(80),m=i(33),g=i(45),b=i(49),_=i(46).f,x=i(26),w=i(82),C=i(84),T=i(35),P=i(42),S=i(53),k=S.enforce,I=S.get,O=h.Int8Array,E=O&&O.prototype,A=h.Uint8ClampedArray,R=A&&A.prototype,B=O&&w(O),D=E&&w(E),L=Object.prototype,M=h.TypeError,N=T("toStringTag"),U=P("TYPED_ARRAY_TAG"),j="TypedArrayConstructor",H=l&&!!C&&"Opera"!==v(h.opera),z=!1,X={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Y={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var r=w(t);if(d(r)){var i=I(r);return i&&y(i,j)?i.TypedArrayConstructor:getTypedArrayConstructor(r)}},isTypedArray=function(t){if(!d(t))return!1;var r=v(t);return y(X,r)||y(Y,r)};for(o in X)(c=(a=h[o])&&a.prototype)?k(c).TypedArrayConstructor=a:H=!1;for(o in Y)(c=(a=h[o])&&a.prototype)&&(k(c).TypedArrayConstructor=a);if(!H||!p(B)||B===Function.prototype){B=function TypedArray(){throw M("Incorrect invocation")};if(H)for(o in X)h[o]&&C(h[o],B)}if(!H||!D||D===L){D=B.prototype;if(H)for(o in X)h[o]&&C(h[o].prototype,D)}H&&w(R)!==D&&C(R,D);if(u&&!y(D,N)){z=!0;_(D,N,{get:function(){return d(this)?this[U]:void 0}});for(o in X)h[o]&&g(h[o],U,o)}t.exports={NATIVE_ARRAY_BUFFER_VIEWS:H,TYPED_ARRAY_TAG:z&&U,aTypedArray:function(t){if(isTypedArray(t))return t;throw M("Target is not a typed array")},aTypedArrayConstructor:function(t){if(p(t)&&(!C||x(B,t)))return t;throw M(m(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,r,i,o){if(u){if(i)for(var a in X){var c=h[a];if(c&&y(c.prototype,t))try{delete c.prototype[t]}catch(i){try{c.prototype[t]=r}catch(t){}}}D[t]&&!i||b(D,t,i?r:H&&E[t]||r,o)}},exportTypedArrayStaticMethod:function(t,r,i){var o,a;if(u){if(C){if(i)for(o in X)if((a=h[o])&&y(a,t))try{delete a[t]}catch(t){}if(B[t]&&!i)return;try{return b(B,t,i?r:H&&B[t]||r)}catch(t){}}for(o in X)!(a=h[o])||a[t]&&!i||b(a,t,r)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(t){if(!d(t))return!1;var r=v(t);return"DataView"===r||y(X,r)||y(Y,r)},isTypedArray:isTypedArray,TypedArray:B,TypedArrayPrototype:D}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,r,i)=>{var o=i(81),a=i(23),c=i(18),l=i(35)("toStringTag"),u=Object,h="Arguments"==c(function(){return arguments}());t.exports=o?c:function(t){var r,i,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,r){try{return t[r]}catch(t){}}(r=u(t),l))?i:h?c(r):"Object"==(o=c(r))&&a(r.callee)?"Arguments":o}},(t,r,i)=>{var o={};o[i(35)("toStringTag")]="z";t.exports="[object z]"===String(o)},(t,r,i)=>{var o=i(40),a=i(23),c=i(41),l=i(55),u=i(83),h=l("IE_PROTO"),p=Object,d=p.prototype;t.exports=u?p.getPrototypeOf:function(t){var r=c(t);if(o(r,h))return r[h];var i=r.constructor;return a(i)&&r instanceof i?i.prototype:r instanceof p?d:null}},(t,r,i)=>{var o=i(10);t.exports=!o((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(t,r,i)=>{var o=i(17),a=i(48),c=i(85);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,i={};try{(t=o(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]);r=i instanceof Array}catch(t){}return function setPrototypeOf(i,o){a(i);c(o);r?t(i,o):i.__proto__=o;return i}}():void 0)},(t,r,i)=>{var o=i(23),a=String,c=TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw c("Can't set "+a(t)+" as a prototype")}},(t,r,i)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.Jbig2Image=void 0;var o=i(1),a=i(87),c=i(90),l=i(91);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){i&&(t=i);var o=0,a=function F(){};return{s:a,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,l=!0,u=!1;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();l=t.done;return t},e:function e(t){u=!0;c=t},f:function f(){try{l||null==i.return||i.return()}finally{if(u)throw c}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);return"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,i){r&&_defineProperties(t.prototype,r);i&&_defineProperties(t,i);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var i,o=_getPrototypeOf(t);if(r){var a=_getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(Jbig2Error,t);var r=_createSuper(Jbig2Error);function Jbig2Error(t){_classCallCheck(this,Jbig2Error);return r.call(this,"JBIG2 error: ".concat(t),"Jbig2Error")}return _createClass(Jbig2Error)}(o.BaseException),h=function(){function ContextCache(){_classCallCheck(this,ContextCache)}_createClass(ContextCache,[{key:"getContexts",value:function getContexts(t){return t in this?this[t]:this[t]=new Int8Array(65536)}}]);return ContextCache}(),p=function(){function DecodingContext(t,r,i){_classCallCheck(this,DecodingContext);this.data=t;this.start=r;this.end=i}_createClass(DecodingContext,[{key:"decoder",get:function get(){var t=new c.ArithmeticDecoder(this.data,this.start,this.end);return(0,o.shadow)(this,"decoder",t)}},{key:"contextCache",get:function get(){var t=new h;return(0,o.shadow)(this,"contextCache",t)}}]);return DecodingContext}();function decodeInteger(t,r,i){var o=t.getContexts(r),a=1;function readBits(t){for(var r=0,c=0;c<t;c++){var l=i.readBit(o,a);a=a<256?a<<1|l:511&(a<<1|l)|256;r=r<<1|l}return r>>>0}var c=readBits(1),l=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===c?l:l>0?-l:null}function decodeIAID(t,r,i){for(var o=t.getContexts("IAID"),a=1,c=0;c<i;c++){a=a<<1|r.readBit(o,a)}return i<31?a&(1<<i)-1:2147483647&a}var d=["SymbolDictionary",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",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],y=[[{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,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}]],v=[{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}]}],m=[39717,1941,229,405],g=[32,8];function decodeBitmap(t,r,i,o,a,c,l,u){if(t){return decodeMMRBitmap(new P(u.data,u.start,u.end),r,i,!1)}if(0===o&&!c&&!a&&4===l.length&&3===l[0].x&&-1===l[0].y&&-3===l[1].x&&-1===l[1].y&&2===l[2].x&&-2===l[2].y&&-2===l[3].x&&-2===l[3].y)return function decodeBitmapTemplate0(t,r,i){var o,a,c,l,u,h,p,d=i.decoder,y=i.contextCache.getContexts("GB"),v=[];for(a=0;a<r;a++){u=v[a]=new Uint8Array(t);h=a<1?u:v[a-1];o=(p=a<2?u:v[a-2])[0]<<13|p[1]<<12|p[2]<<11|h[0]<<7|h[1]<<6|h[2]<<5|h[3]<<4;for(c=0;c<t;c++){u[c]=l=d.readBit(y,o);o=(31735&o)<<1|(c+3<t?p[c+3]<<11:0)|(c+4<t?h[c+4]<<4:0)|l}}return v}(r,i,u);var h=!!c,p=y[o].concat(l);p.sort((function(t,r){return t.y-r.y||t.x-r.x}));var d,v,g=p.length,b=new Int8Array(g),_=new Int8Array(g),x=[],w=0,C=0,T=0,S=0;for(v=0;v<g;v++){b[v]=p[v].x;_[v]=p[v].y;C=Math.min(C,p[v].x);T=Math.max(T,p[v].x);S=Math.min(S,p[v].y);v<g-1&&p[v].y===p[v+1].y&&p[v].x===p[v+1].x-1?w|=1<<g-1-v:x.push(v)}var k=x.length,I=new Int8Array(k),O=new Int8Array(k),E=new Uint16Array(k);for(d=0;d<k;d++){v=x[d];I[d]=p[v].x;O[d]=p[v].y;E[d]=1<<g-1-v}for(var A,R,B,D,L,M=-C,N=-S,U=r-T,j=m[o],H=new Uint8Array(r),z=[],X=u.decoder,Y=u.contextCache.getContexts("GB"),G=0,W=0,J=0;J<i;J++){if(a){if(G^=X.readBit(Y,j)){z.push(H);continue}}H=new Uint8Array(H);z.push(H);for(A=0;A<r;A++)if(h&&c[J][A])H[A]=0;else{if(A>=M&&A<U&&J>=N){W=W<<1&w;for(v=0;v<k;v++){R=J+O[v];B=A+I[v];(D=z[R][B])&&(W|=D=E[v])}}else{W=0;L=g-1;for(v=0;v<g;v++,L--)(B=A+b[v])>=0&&B<r&&(R=J+_[v])>=0&&(D=z[R][B])&&(W|=D<<L)}var q=X.readBit(Y,W);H[A]=q}}return z}function decodeRefinement(t,r,i,o,a,c,l,h,p){var d=v[i].coding;0===i&&(d=d.concat([h[0]]));var y,m=d.length,b=new Int32Array(m),_=new Int32Array(m);for(y=0;y<m;y++){b[y]=d[y].x;_[y]=d[y].y}var x=v[i].reference;0===i&&(x=x.concat([h[1]]));var w=x.length,C=new Int32Array(w),T=new Int32Array(w);for(y=0;y<w;y++){C[y]=x[y].x;T[y]=x[y].y}for(var P=o[0].length,S=o.length,k=g[i],I=[],O=p.decoder,E=p.contextCache.getContexts("GR"),A=0,R=0;R<r;R++){if(l){if(A^=O.readBit(E,k))throw new u("prediction is not supported")}var B=new Uint8Array(t);I.push(B);for(var D=0;D<t;D++){var L=void 0,M=void 0,N=0;for(y=0;y<m;y++){L=R+_[y];M=D+b[y];L<0||M<0||M>=t?N<<=1:N=N<<1|I[L][M]}for(y=0;y<w;y++){L=R+T[y]-c;M=D+C[y]-a;L<0||L>=S||M<0||M>=P?N<<=1:N=N<<1|o[L][M]}var U=O.readBit(E,N);B[D]=U}}return I}function decodeTextRegion(t,r,i,o,a,c,l,h,p,d,y,v,m,g,b,_,x,w,C){if(t&&r)throw new u("refinement with Huffman is not supported");var T,P,S=[];for(T=0;T<o;T++){P=new Uint8Array(i);if(a)for(var k=0;k<i;k++)P[k]=a;S.push(P)}var I=x.decoder,O=x.contextCache,E=t?-g.tableDeltaT.decode(C):-decodeInteger(O,"IADT",I),A=0;T=0;for(;T<c;){E+=t?g.tableDeltaT.decode(C):decodeInteger(O,"IADT",I);for(var R=A+=t?g.tableFirstS.decode(C):decodeInteger(O,"IAFS",I);;){var B=0;l>1&&(B=t?C.readBits(w):decodeInteger(O,"IAIT",I));var D=l*E+B,L=t?g.symbolIDTable.decode(C):decodeIAID(O,I,p),M=r&&(t?C.readBit():decodeInteger(O,"IARI",I)),N=h[L],U=N[0].length,j=N.length;if(M){var H=decodeInteger(O,"IARDW",I),z=decodeInteger(O,"IARDH",I);N=decodeRefinement(U+=H,j+=z,b,N,(H>>1)+decodeInteger(O,"IARDX",I),(z>>1)+decodeInteger(O,"IARDY",I),!1,_,x)}var X=D-(1&v?0:j-1),Y=R-(2&v?U-1:0),G=void 0,W=void 0,J=void 0;if(d){for(G=0;G<j;G++)if(P=S[Y+G]){J=N[G];var q=Math.min(i-X,U);switch(m){case 0:for(W=0;W<q;W++)P[X+W]|=J[W];break;case 2:for(W=0;W<q;W++)P[X+W]^=J[W];break;default:throw new u("operator ".concat(m," is not supported"))}}R+=j-1}else{for(W=0;W<j;W++)if(P=S[X+W]){J=N[W];switch(m){case 0:for(G=0;G<U;G++)P[Y+G]|=J[G];break;case 2:for(G=0;G<U;G++)P[Y+G]^=J[G];break;default:throw new u("operator ".concat(m," is not supported"))}}R+=U-1}T++;var V=t?g.tableDeltaS.decode(C):decodeInteger(O,"IADS",I);if(null===V)break;R+=V+y}}return S}function readSegmentHeader(t,r){var i={};i.number=(0,a.readUint32)(t,r);var o=t[r+4],c=63&o;if(!d[c])throw new u("invalid segment type: "+c);i.type=c;i.typeName=d[c];i.deferredNonRetain=!!(128&o);var l=!!(64&o),h=t[r+5],p=h>>5&7,y=[31&h],v=r+6;if(7===h){p=536870911&(0,a.readUint32)(t,v-1);v+=3;var m=p+7>>3;y[0]=t[v++];for(;--m>0;)y.push(t[v++])}else if(5===h||6===h)throw new u("invalid referred-to flags");i.retainBits=y;var g=4;i.number<=256?g=1:i.number<=65536&&(g=2);var _,x,w=[];for(_=0;_<p;_++){var C=void 0;C=1===g?t[v]:2===g?(0,a.readUint16)(t,v):(0,a.readUint32)(t,v);w.push(C);v+=g}i.referredTo=w;if(l){i.pageAssociation=(0,a.readUint32)(t,v);v+=4}else i.pageAssociation=t[v++];i.length=(0,a.readUint32)(t,v);v+=4;if(4294967295===i.length){if(38!==c)throw new u("invalid unknown segment length");var T=readRegionSegmentInformation(t,v),P=!!(1&t[v+b]),S=new Uint8Array(6);if(!P){S[0]=255;S[1]=172}S[2]=T.height>>>24&255;S[3]=T.height>>16&255;S[4]=T.height>>8&255;S[5]=255&T.height;for(_=v,x=t.length;_<x;_++){for(var k=0;k<6&&S[k]===t[_+k];)k++;if(6===k){i.length=_+6;break}}if(4294967295===i.length)throw new u("segment end was not found")}i.headerEnd=v;return i}function readSegments(t,r,i,o){for(var a=[],c=i;c<o;){var l=readSegmentHeader(r,c);c=l.headerEnd;var u={header:l,data:r};if(!t.randomAccess){u.start=c;c+=l.length;u.end=c}a.push(u);if(51===l.type)break}if(t.randomAccess)for(var h=0,p=a.length;h<p;h++){a[h].start=c;c+=a[h].header.length;a[h].end=c}return a}function readRegionSegmentInformation(t,r){return{width:(0,a.readUint32)(t,r),height:(0,a.readUint32)(t,r+4),x:(0,a.readUint32)(t,r+8),y:(0,a.readUint32)(t,r+12),combinationOperator:7&t[r+16]}}var b=17;function processSegment(t,r){var i,o,c,l,h=t.header,p=t.data,d=t.end,y=t.start;switch(h.type){case 0:var v={},m=(0,a.readUint16)(p,y);v.huffman=!!(1&m);v.refinement=!!(2&m);v.huffmanDHSelector=m>>2&3;v.huffmanDWSelector=m>>4&3;v.bitmapSizeSelector=m>>6&1;v.aggregationInstancesSelector=m>>7&1;v.bitmapCodingContextUsed=!!(256&m);v.bitmapCodingContextRetained=!!(512&m);v.template=m>>10&3;v.refinementTemplate=m>>12&1;y+=2;if(!v.huffman){l=0===v.template?4:1;o=[];for(c=0;c<l;c++){o.push({x:(0,a.readInt8)(p,y),y:(0,a.readInt8)(p,y+1)});y+=2}v.at=o}if(v.refinement&&!v.refinementTemplate){o=[];for(c=0;c<2;c++){o.push({x:(0,a.readInt8)(p,y),y:(0,a.readInt8)(p,y+1)});y+=2}v.refinementAt=o}v.numberOfExportedSymbols=(0,a.readUint32)(p,y);y+=4;v.numberOfNewSymbols=(0,a.readUint32)(p,y);y+=4;i=[v,h.number,h.referredTo,p,y,d];break;case 6:case 7:var g={};g.info=readRegionSegmentInformation(p,y);y+=b;var _=(0,a.readUint16)(p,y);y+=2;g.huffman=!!(1&_);g.refinement=!!(2&_);g.logStripSize=_>>2&3;g.stripSize=1<<g.logStripSize;g.referenceCorner=_>>4&3;g.transposed=!!(64&_);g.combinationOperator=_>>7&3;g.defaultPixelValue=_>>9&1;g.dsOffset=_<<17>>27;g.refinementTemplate=_>>15&1;if(g.huffman){var x=(0,a.readUint16)(p,y);y+=2;g.huffmanFS=3&x;g.huffmanDS=x>>2&3;g.huffmanDT=x>>4&3;g.huffmanRefinementDW=x>>6&3;g.huffmanRefinementDH=x>>8&3;g.huffmanRefinementDX=x>>10&3;g.huffmanRefinementDY=x>>12&3;g.huffmanRefinementSizeSelector=!!(16384&x)}if(g.refinement&&!g.refinementTemplate){o=[];for(c=0;c<2;c++){o.push({x:(0,a.readInt8)(p,y),y:(0,a.readInt8)(p,y+1)});y+=2}g.refinementAt=o}g.numberOfSymbolInstances=(0,a.readUint32)(p,y);y+=4;i=[g,h.referredTo,p,y,d];break;case 16:var w={},C=p[y++];w.mmr=!!(1&C);w.template=C>>1&3;w.patternWidth=p[y++];w.patternHeight=p[y++];w.maxPatternIndex=(0,a.readUint32)(p,y);y+=4;i=[w,h.number,p,y,d];break;case 22:case 23:var T={};T.info=readRegionSegmentInformation(p,y);y+=b;var P=p[y++];T.mmr=!!(1&P);T.template=P>>1&3;T.enableSkip=!!(8&P);T.combinationOperator=P>>4&7;T.defaultPixelValue=P>>7&1;T.gridWidth=(0,a.readUint32)(p,y);y+=4;T.gridHeight=(0,a.readUint32)(p,y);y+=4;T.gridOffsetX=4294967295&(0,a.readUint32)(p,y);y+=4;T.gridOffsetY=4294967295&(0,a.readUint32)(p,y);y+=4;T.gridVectorX=(0,a.readUint16)(p,y);y+=2;T.gridVectorY=(0,a.readUint16)(p,y);y+=2;i=[T,h.referredTo,p,y,d];break;case 38:case 39:var S={};S.info=readRegionSegmentInformation(p,y);y+=b;var k=p[y++];S.mmr=!!(1&k);S.template=k>>1&3;S.prediction=!!(8&k);if(!S.mmr){l=0===S.template?4:1;o=[];for(c=0;c<l;c++){o.push({x:(0,a.readInt8)(p,y),y:(0,a.readInt8)(p,y+1)});y+=2}S.at=o}i=[S,p,y,d];break;case 48:var I={width:(0,a.readUint32)(p,y),height:(0,a.readUint32)(p,y+4),resolutionX:(0,a.readUint32)(p,y+8),resolutionY:(0,a.readUint32)(p,y+12)};4294967295===I.height&&delete I.height;var O=p[y+16];(0,a.readUint16)(p,y+17);I.lossless=!!(1&O);I.refinement=!!(2&O);I.defaultPixelValue=O>>2&1;I.combinationOperator=O>>3&3;I.requiresBuffer=!!(32&O);I.combinationOperatorOverride=!!(64&O);i=[I];break;case 49:case 50:case 51:case 62:break;case 53:i=[h.number,p,y,d];break;default:throw new u("segment type ".concat(h.typeName,"(").concat(h.type,") is not implemented"))}var E="on"+h.typeName;E in r&&r[E].apply(r,i)}function processSegments(t,r){for(var i=0,o=t.length;i<o;i++)processSegment(t[i],r)}var _=function(){function SimpleSegmentVisitor(){_classCallCheck(this,SimpleSegmentVisitor)}_createClass(SimpleSegmentVisitor,[{key:"onPageInformation",value:function onPageInformation(t){this.currentPageInfo=t;var r=t.width+7>>3,i=new Uint8ClampedArray(r*t.height);t.defaultPixelValue&&i.fill(255);this.buffer=i}},{key:"drawBitmap",value:function drawBitmap(t,r){var i,o,a,c,l=this.currentPageInfo,h=t.width,p=t.height,d=l.width+7>>3,y=l.combinationOperatorOverride?t.combinationOperator:l.combinationOperator,v=this.buffer,m=128>>(7&t.x),g=t.y*d+(t.x>>3);switch(y){case 0:for(i=0;i<p;i++){a=m;c=g;for(o=0;o<h;o++){r[i][o]&&(v[c]|=a);if(!(a>>=1)){a=128;c++}}g+=d}break;case 2:for(i=0;i<p;i++){a=m;c=g;for(o=0;o<h;o++){r[i][o]&&(v[c]^=a);if(!(a>>=1)){a=128;c++}}g+=d}break;default:throw new u("operator ".concat(y," is not supported"))}}},{key:"onImmediateGenericRegion",value:function onImmediateGenericRegion(t,r,i,o){var a=t.info,c=new p(r,i,o),l=decodeBitmap(t.mmr,a.width,a.height,t.template,t.prediction,null,t.at,c);this.drawBitmap(a,l)}},{key:"onImmediateLosslessGenericRegion",value:function onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion.apply(this,arguments)}},{key:"onSymbolDictionary",value:function onSymbolDictionary(t,r,i,o,c,l){var h,d;if(t.huffman){h=function getSymbolDictionaryHuffmanTables(t,r,i){var o,a,c,l,h=0;switch(t.huffmanDHSelector){case 0:case 1:o=getStandardTable(t.huffmanDHSelector+4);break;case 3:o=getCustomHuffmanTable(h,r,i);h++;break;default:throw new u("invalid Huffman DH selector")}switch(t.huffmanDWSelector){case 0:case 1:a=getStandardTable(t.huffmanDWSelector+2);break;case 3:a=getCustomHuffmanTable(h,r,i);h++;break;default:throw new u("invalid Huffman DW selector")}if(t.bitmapSizeSelector){c=getCustomHuffmanTable(h,r,i);h++}else c=getStandardTable(1);l=t.aggregationInstancesSelector?getCustomHuffmanTable(h,r,i):getStandardTable(1);return{tableDeltaHeight:o,tableDeltaWidth:a,tableBitmapSize:c,tableAggregateInstances:l}}(t,i,this.customTables);d=new P(o,c,l)}var y=this.symbols;y||(this.symbols=y={});var v,m=[],g=_createForOfIteratorHelper(i);try{for(g.s();!(v=g.n()).done;){var b=y[v.value];b&&m.push.apply(m,_toConsumableArray(b))}}catch(t){g.e(t)}finally{g.f()}var _=new p(o,c,l);y[r]=function decodeSymbolDictionary(t,r,i,o,c,l,h,p,d,y,v,m){if(t&&r)throw new u("symbol refinement with Huffman is not supported");var g,b,_=[],x=0,w=(0,a.log2)(i.length+o),C=v.decoder,T=v.contextCache;if(t){g=getStandardTable(1);b=[];w=Math.max(w,1)}for(;_.length<o;){x+=t?l.tableDeltaHeight.decode(m):decodeInteger(T,"IADH",C);for(var P=0,S=0,k=t?b.length:0;;){var I=t?l.tableDeltaWidth.decode(m):decodeInteger(T,"IADW",C);if(null===I)break;S+=P+=I;var O=void 0;if(r){var E=decodeInteger(T,"IAAI",C);if(E>1)O=decodeTextRegion(t,r,P,x,0,E,1,i.concat(_),w,0,0,1,0,l,d,y,v,0,m);else{var A=decodeIAID(T,C,w),R=decodeInteger(T,"IARDX",C),B=decodeInteger(T,"IARDY",C);O=decodeRefinement(P,x,d,A<i.length?i[A]:_[A-i.length],R,B,!1,y,v)}_.push(O)}else if(t)b.push(P);else{O=decodeBitmap(!1,P,x,h,!1,null,p,v);_.push(O)}}if(t&&!r){var D=l.tableBitmapSize.decode(m);m.byteAlign();var L=void 0;if(0===D)L=readUncompressedBitmap(m,S,x);else{var M=m.end,N=m.position+D;m.end=N;L=decodeMMRBitmap(m,S,x,!1);m.end=M;m.position=N}var U=b.length;if(k===U-1)_.push(L);else{var j=void 0,H=void 0,z=0,X=void 0,Y=void 0;for(j=k;j<U;j++){X=z+b[j];Y=[];for(H=0;H<x;H++)Y.push(L[H].subarray(z,X));_.push(Y);z=X}}}}for(var G,W,J=[],q=[],V=!1,K=i.length+o;q.length<K;){for(var Q=t?g.decode(m):decodeInteger(T,"IAEX",C);Q--;)q.push(V);V=!V}for(G=0,W=i.length;G<W;G++)q[G]&&J.push(i[G]);for(var Z=0;Z<o;G++,Z++)q[G]&&J.push(_[Z]);return J}(t.huffman,t.refinement,m,t.numberOfNewSymbols,t.numberOfExportedSymbols,h,t.template,t.at,t.refinementTemplate,t.refinementAt,_,d)}},{key:"onImmediateTextRegion",value:function onImmediateTextRegion(t,r,i,o,c){var l,h,d,y=t.info,v=this.symbols,m=[],g=_createForOfIteratorHelper(r);try{for(g.s();!(d=g.n()).done;){var b=v[d.value];b&&m.push.apply(m,_toConsumableArray(b))}}catch(t){g.e(t)}finally{g.f()}var _=(0,a.log2)(m.length);if(t.huffman){h=new P(i,o,c);l=function getTextRegionHuffmanTables(t,r,i,o,a){for(var c=[],l=0;l<=34;l++){var h=a.readBits(4);c.push(new x([l,h,0,0]))}var p=new C(c,!1);c.length=0;for(var d=0;d<o;){var y=p.decode(a);if(y>=32){var v=void 0,m=void 0,g=void 0;switch(y){case 32:if(0===d)throw new u("no previous value in symbol ID table");m=a.readBits(2)+3;v=c[d-1].prefixLength;break;case 33:m=a.readBits(3)+3;v=0;break;case 34:m=a.readBits(7)+11;v=0;break;default:throw new u("invalid code length in symbol ID table")}for(g=0;g<m;g++){c.push(new x([d,v,0,0]));d++}}else{c.push(new x([d,y,0,0]));d++}}a.byteAlign();var b,_,w,T=new C(c,!1),P=0;switch(t.huffmanFS){case 0:case 1:b=getStandardTable(t.huffmanFS+6);break;case 3:b=getCustomHuffmanTable(P,r,i);P++;break;default:throw new u("invalid Huffman FS selector")}switch(t.huffmanDS){case 0:case 1:case 2:_=getStandardTable(t.huffmanDS+8);break;case 3:_=getCustomHuffmanTable(P,r,i);P++;break;default:throw new u("invalid Huffman DS selector")}switch(t.huffmanDT){case 0:case 1:case 2:w=getStandardTable(t.huffmanDT+11);break;case 3:w=getCustomHuffmanTable(P,r,i);P++;break;default:throw new u("invalid Huffman DT selector")}if(t.refinement)throw new u("refinement with Huffman is not supported");return{symbolIDTable:T,tableFirstS:b,tableDeltaS:_,tableDeltaT:w}}(t,r,this.customTables,m.length,h)}var w=new p(i,o,c),T=decodeTextRegion(t.huffman,t.refinement,y.width,y.height,t.defaultPixelValue,t.numberOfSymbolInstances,t.stripSize,m,_,t.transposed,t.dsOffset,t.referenceCorner,t.combinationOperator,l,t.refinementTemplate,t.refinementAt,w,t.logStripSize,h);this.drawBitmap(y,T)}},{key:"onImmediateLosslessTextRegion",value:function onImmediateLosslessTextRegion(){this.onImmediateTextRegion.apply(this,arguments)}},{key:"onPatternDictionary",value:function onPatternDictionary(t,r,i,o,a){var c=this.patterns;c||(this.patterns=c={});var l=new p(i,o,a);c[r]=function decodePatternDictionary(t,r,i,o,a,c){var l=[];if(!t){l.push({x:-r,y:0});0===a&&l.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}for(var u=decodeBitmap(t,(o+1)*r,i,a,!1,null,l,c),h=[],p=0;p<=o;p++){for(var d=[],y=r*p,v=y+r,m=0;m<i;m++)d.push(u[m].subarray(y,v));h.push(d)}return h}(t.mmr,t.patternWidth,t.patternHeight,t.maxPatternIndex,t.template,l)}},{key:"onImmediateHalftoneRegion",value:function onImmediateHalftoneRegion(t,r,i,o,c){var l=this.patterns[r[0]],h=t.info,d=new p(i,o,c),y=function decodeHalftoneRegion(t,r,i,o,c,l,h,p,d,y,v,m,g,b,_){if(h)throw new u("skip is not supported");if(0!==p)throw new u('operator "'.concat(p,'" is not supported in halftone region'));var x,w,C,T=[];for(x=0;x<c;x++){C=new Uint8Array(o);if(l)for(w=0;w<o;w++)C[w]=l;T.push(C)}var S=r.length,k=r[0],I=k[0].length,O=k.length,E=(0,a.log2)(S),A=[];if(!t){A.push({x:i<=1?3:2,y:-1});0===i&&A.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}var R,B,D,L,M,N,U,j,H,z,X,Y=[];t&&(R=new P(_.data,_.start,_.end));for(x=E-1;x>=0;x--){B=t?decodeMMRBitmap(R,d,y,!0):decodeBitmap(!1,d,y,i,!1,null,A,_);Y[x]=B}for(D=0;D<y;D++)for(L=0;L<d;L++){M=0;N=0;for(w=E-1;w>=0;w--)N|=(M^=Y[w][D][L])<<w;U=r[N];H=m+D*g-L*b>>8;if((j=v+D*b+L*g>>8)>=0&&j+I<=o&&H>=0&&H+O<=c)for(x=0;x<O;x++){X=T[H+x];z=U[x];for(w=0;w<I;w++)X[j+w]|=z[w]}else{var G=void 0,W=void 0;for(x=0;x<O;x++)if(!((W=H+x)<0||W>=c)){X=T[W];z=U[x];for(w=0;w<I;w++)(G=j+w)>=0&&G<o&&(X[G]|=z[w])}}}return T}(t.mmr,l,t.template,h.width,h.height,t.defaultPixelValue,t.enableSkip,t.combinationOperator,t.gridWidth,t.gridHeight,t.gridOffsetX,t.gridOffsetY,t.gridVectorX,t.gridVectorY,d);this.drawBitmap(h,y)}},{key:"onImmediateLosslessHalftoneRegion",value:function onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion.apply(this,arguments)}},{key:"onTables",value:function onTables(t,r,i,o){var c=this.customTables;c||(this.customTables=c={});c[t]=function decodeTablesSegment(t,r,i){var o,c,l=t[r],u=4294967295&(0,a.readUint32)(t,r+1),h=4294967295&(0,a.readUint32)(t,r+5),p=new P(t,r+9,i),d=1+(l>>1&7),y=1+(l>>4&7),v=[],m=u;do{o=p.readBits(d);c=p.readBits(y);v.push(new x([m,o,c,0]));m+=1<<c}while(m<h);o=p.readBits(d);v.push(new x([u-1,o,32,0,"lower"]));o=p.readBits(d);v.push(new x([h,o,32,0]));if(1&l){o=p.readBits(d);v.push(new x([o,0]))}return new C(v,!1)}(r,i,o)}}]);return SimpleSegmentVisitor}(),x=_createClass((function HuffmanLine(t){_classCallCheck(this,HuffmanLine);if(2===t.length){this.isOOB=!0;this.rangeLow=0;this.prefixLength=t[0];this.rangeLength=0;this.prefixCode=t[1];this.isLowerRange=!1}else{this.isOOB=!1;this.rangeLow=t[0];this.prefixLength=t[1];this.rangeLength=t[2];this.prefixCode=t[3];this.isLowerRange="lower"===t[4]}})),w=function(){function HuffmanTreeNode(t){_classCallCheck(this,HuffmanTreeNode);this.children=[];if(t){this.isLeaf=!0;this.rangeLength=t.rangeLength;this.rangeLow=t.rangeLow;this.isLowerRange=t.isLowerRange;this.isOOB=t.isOOB}else this.isLeaf=!1}_createClass(HuffmanTreeNode,[{key:"buildTree",value:function buildTree(t,r){var i=t.prefixCode>>r&1;if(r<=0)this.children[i]=new HuffmanTreeNode(t);else{var o=this.children[i];o||(this.children[i]=o=new HuffmanTreeNode(null));o.buildTree(t,r-1)}}},{key:"decodeNode",value:function decodeNode(t){if(this.isLeaf){if(this.isOOB)return null;var r=t.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-r:r)}var i=this.children[t.readBit()];if(!i)throw new u("invalid Huffman data");return i.decodeNode(t)}}]);return HuffmanTreeNode}(),C=function(){function HuffmanTable(t,r){_classCallCheck(this,HuffmanTable);r||this.assignPrefixCodes(t);this.rootNode=new w(null);for(var i=0,o=t.length;i<o;i++){var a=t[i];a.prefixLength>0&&this.rootNode.buildTree(a,a.prefixLength-1)}}_createClass(HuffmanTable,[{key:"decode",value:function decode(t){return this.rootNode.decodeNode(t)}},{key:"assignPrefixCodes",value:function assignPrefixCodes(t){for(var r=t.length,i=0,o=0;o<r;o++)i=Math.max(i,t[o].prefixLength);for(var a=new Uint32Array(i+1),c=0;c<r;c++)a[t[c].prefixLength]++;var l,u,h,p=1,d=0;a[0]=0;for(;p<=i;){l=d=d+a[p-1]<<1;u=0;for(;u<r;){if((h=t[u]).prefixLength===p){h.prefixCode=l;l++}u++}p++}}}]);return HuffmanTable}();var T={};function getStandardTable(t){var r,i=T[t];if(i)return i;switch(t){case 1:r=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:r=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:r=[[-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:r=[[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:r=[[-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:r=[[-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],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:r=[[-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:r=[[-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,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:r=[[-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:r=[[-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],[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:r=[[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:r=[[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],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:r=[[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:r=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:r=[[-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 u("standard table B.".concat(t," does not exist"))}for(var o=0,a=r.length;o<a;o++)r[o]=new x(r[o]);i=new C(r,!0);T[t]=i;return i}var P=function(){function Reader(t,r,i){_classCallCheck(this,Reader);this.data=t;this.start=r;this.end=i;this.position=r;this.shift=-1;this.currentByte=0}_createClass(Reader,[{key:"readBit",value:function readBit(){if(this.shift<0){if(this.position>=this.end)throw new u("end of data while reading bit");this.currentByte=this.data[this.position++];this.shift=7}var t=this.currentByte>>this.shift&1;this.shift--;return t}},{key:"readBits",value:function readBits(t){var r,i=0;for(r=t-1;r>=0;r--)i|=this.readBit()<<r;return i}},{key:"byteAlign",value:function byteAlign(){this.shift=-1}},{key:"next",value:function next(){return this.position>=this.end?-1:this.data[this.position++]}}]);return Reader}();function getCustomHuffmanTable(t,r,i){for(var o=0,a=0,c=r.length;a<c;a++){var l=i[r[a]];if(l){if(t===o)return l;o++}}throw new u("can't find custom Huffman table")}function readUncompressedBitmap(t,r,i){for(var o=[],a=0;a<i;a++){var c=new Uint8Array(r);o.push(c);for(var l=0;l<r;l++)c[l]=t.readBit();t.byteAlign()}return o}function decodeMMRBitmap(t,r,i,o){for(var a,c={K:-1,Columns:r,Rows:i,BlackIs1:!0,EndOfBlock:o},u=new l.CCITTFaxDecoder(t,c),h=[],p=!1,d=0;d<i;d++){var y=new Uint8Array(r);h.push(y);for(var v=-1,m=0;m<r;m++){if(v<0){if(-1===(a=u.readNextChar())){a=0;p=!0}v=7}y[m]=a>>v&1;v--}}if(o&&!p)for(var g=0;g<5&&-1!==u.readNextChar();g++);return h}var S=function(){function Jbig2Image(){_classCallCheck(this,Jbig2Image)}_createClass(Jbig2Image,[{key:"parseChunks",value:function parseChunks(t){return function parseJbig2Chunks(t){for(var r=new _,i=0,o=t.length;i<o;i++){var a=t[i];processSegments(readSegments({},a.data,a.start,a.end),r)}return r.buffer}(t)}},{key:"parse",value:function parse(t){var r=function parseJbig2(t){var r=t.length,i=0;if(151!==t[i]||74!==t[i+1]||66!==t[i+2]||50!==t[i+3]||13!==t[i+4]||10!==t[i+5]||26!==t[i+6]||10!==t[i+7])throw new u("parseJbig2 - invalid header.");var o=Object.create(null);i+=8;var c=t[i++];o.randomAccess=!(1&c);if(!(2&c)){o.numberOfPages=(0,a.readUint32)(t,i);i+=4}var l=readSegments(o,t,i,r),h=new _;processSegments(l,h);for(var p=h.currentPageInfo,d=p.width,y=p.height,v=h.buffer,m=new Uint8ClampedArray(d*y),g=0,b=0,x=0;x<y;x++)for(var w=0,C=void 0,T=0;T<d;T++){if(!w){w=128;C=v[b++]}m[g++]=C&w?0:255;w>>=1}return{imgData:m,width:d,height:y}}(t),i=r.imgData,o=r.width,c=r.height;this.width=o;this.height=c;return i}}]);return Jbig2Image}();r.Jbig2Image=S},(t,r,i)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.XRefParseException=r.XRefEntryException=r.ParserEOFException=r.MissingDataException=r.DocStats=void 0;r.collectActions=function collectActions(t,r,i){var c=Object.create(null),l=getInheritableProperty({dict:r,key:"AA",stopWhenFound:!1});if(l)for(var u=l.length-1;u>=0;u--){var h=l[u];if(h instanceof a.Dict){var p,d=_createForOfIteratorHelper(h.getKeys());try{for(d.s();!(p=d.n()).done;){var y=p.value,v=i[y];if(v){var m=h.getRaw(y),g=new a.RefSet,b=[];_collectJS(m,t,b,g);b.length>0&&(c[v]=b)}}}catch(t){d.e(t)}finally{d.f()}}}if(r.has("A")){var _=r.get("A"),x=new a.RefSet,w=[];_collectJS(_,t,w,x);w.length>0&&(c.Action=w)}return(0,o.objectSize)(c)>0?c:null};r.encodeToXmlString=function encodeToXmlString(t){for(var r=[],i=0,o=0,a=t.length;o<a;o++){var c=t.codePointAt(o);if(32<=c&&c<=126){var l=v[c];if(l){i<o&&r.push(t.substring(i,o));r.push(l);i=o+1}}else{i<o&&r.push(t.substring(i,o));r.push("&#x".concat(c.toString(16).toUpperCase(),";"));c>55295&&(c<57344||c>65533)&&o++;i=o+1}}if(0===r.length)return t;i<t.length&&r.push(t.substring(i,t.length));return r.join("")};r.escapePDFName=function escapePDFName(t){for(var r=[],i=0,o=0,a=t.length;o<a;o++){var c=t.charCodeAt(o);if(c<33||c>126||35===c||40===c||41===c||60===c||62===c||91===c||93===c||123===c||125===c||47===c||37===c){i<o&&r.push(t.substring(i,o));r.push("#".concat(c.toString(16)));i=o+1}}if(0===r.length)return t;i<t.length&&r.push(t.substring(i,t.length));return r.join("")};r.getArrayLookupTableFactory=function getArrayLookupTableFactory(t){var r;return function(){if(t){var i=t();t=null;r=Object.create(null);for(var o=0,a=i.length;o<a;o+=2)r[i[o]]=i[o+1];i=null}return r}};r.getInheritableProperty=getInheritableProperty;r.getLookupTableFactory=function getLookupTableFactory(t){var r;return function(){if(t){r=Object.create(null);t(r);t=null}return r}};r.getNewAnnotationsMap=function getNewAnnotationsMap(t){if(!t)return null;var r,i=new Map,a=_createForOfIteratorHelper(t);try{for(a.s();!(r=a.n()).done;){var c=(p=r.value,d=2,function _arrayWithHoles(t){if(Array.isArray(t))return t}(p)||function _iterableToArrayLimit(t,r){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var o,a,c=[],l=!0,u=!1;try{for(i=i.call(t);!(l=(o=i.next()).done);l=!0){c.push(o.value);if(r&&c.length===r)break}}catch(t){u=!0;a=t}finally{try{l||null==i.return||i.return()}finally{if(u)throw a}}return c}(p,d)||_unsupportedIterableToArray(p,d)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=c[0],u=c[1];if(l.startsWith(o.AnnotationEditorPrefix)){var h=i.get(u.pageIndex);if(!h){h=[];i.set(u.pageIndex,h)}h.push(u)}}}catch(t){a.e(t)}finally{a.f()}var p,d;return i.size>0?i:null};r.isWhiteSpace=function isWhiteSpace(t){return 32===t||9===t||13===t||10===t};r.log2=function log2(t){if(t<=0)return 0;return Math.ceil(Math.log2(t))};r.numberToString=function numberToString(t){if(Number.isInteger(t))return t.toString();var r=Math.round(100*t);if(r%100==0)return(r/100).toString();if(r%10==0)return t.toFixed(1);return t.toFixed(2)};r.parseXFAPath=function parseXFAPath(t){var r=/(.+)\[(\d+)\]$/;return t.split(".").map((function(t){var i=t.match(r);return i?{name:i[1],pos:parseInt(i[2],10)}:{name:t,pos:0}}))};r.readInt8=function readInt8(t,r){return t[r]<<24>>24};r.readUint16=function readUint16(t,r){return t[r]<<8|t[r+1]};r.readUint32=function readUint32(t,r){return(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0};r.recoverJsURL=function recoverJsURL(t){var r=new RegExp("^\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").split(".").join("\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec(t);if(r&&r[2]){var i=r[2],o=!1;"true"===r[3]&&"app.launchURL"===r[1]&&(o=!0);return{url:i,newWindow:o}}return null};r.toRomanNumerals=function toRomanNumerals(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,o.assert)(Number.isInteger(t)&&t>0,"The number should be a positive integer.");var i,a=[];for(;t>=1e3;){t-=1e3;a.push("M")}i=t/100|0;t%=100;a.push(y[i]);i=t/10|0;t%=10;a.push(y[10+i]);a.push(y[20+t]);var c=a.join("");return r?c.toLowerCase():c};r.validateCSSFont=function validateCSSFont(t){var r=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),i=t.fontFamily,a=t.fontWeight,c=t.italicAngle;if(/^".*"$/.test(i)){if(/[^\\]"/.test(i.slice(1,i.length-1))){(0,o.warn)('XFA - FontFamily contains some unescaped ": '.concat(i,"."));return!1}}else if(/^'.*'$/.test(i)){if(/[^\\]'/.test(i.slice(1,i.length-1))){(0,o.warn)("XFA - FontFamily contains some unescaped ': ".concat(i,"."));return!1}}else{var l,u=_createForOfIteratorHelper(i.split(/[ \t]+/));try{for(u.s();!(l=u.n()).done;){var h=l.value;if(/^(\d|(-(\d|-)))/.test(h)||!/^[\w-\\]+$/.test(h)){(0,o.warn)("XFA - FontFamily contains some invalid <custom-ident>: ".concat(i,"."));return!1}}}catch(t){u.e(t)}finally{u.f()}}var p=a?a.toString():"";t.fontWeight=r.has(p)?p:"400";var d=parseFloat(c);t.italicAngle=isNaN(d)||d<-90||d>90?"14":c.toString();return!0};var o=i(1),a=i(88),c=i(89);function _createForOfIteratorHelper(t,r){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){i&&(t=i);var o=0,a=function F(){};return{s:a,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,l=!0,u=!1;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();l=t.done;return t},e:function e(t){u=!0;c=t},f:function f(){try{l||null==i.return||i.return()}finally{if(u)throw c}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);return"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,i){r&&_defineProperties(t.prototype,r);i&&_defineProperties(t,i);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var i,o=_getPrototypeOf(t);if(r){var a=_getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var l=function(t){_inherits(MissingDataException,t);var r=_createSuper(MissingDataException);function MissingDataException(t,i){var o;_classCallCheck(this,MissingDataException);(o=r.call(this,"Missing data [".concat(t,", ").concat(i,")"),"MissingDataException")).begin=t;o.end=i;return o}return _createClass(MissingDataException)}(o.BaseException);r.MissingDataException=l;var u=function(t){_inherits(ParserEOFException,t);var r=_createSuper(ParserEOFException);function ParserEOFException(t){_classCallCheck(this,ParserEOFException);return r.call(this,t,"ParserEOFException")}return _createClass(ParserEOFException)}(o.BaseException);r.ParserEOFException=u;var h=function(t){_inherits(XRefEntryException,t);var r=_createSuper(XRefEntryException);function XRefEntryException(t){_classCallCheck(this,XRefEntryException);return r.call(this,t,"XRefEntryException")}return _createClass(XRefEntryException)}(o.BaseException);r.XRefEntryException=h;var p=function(t){_inherits(XRefParseException,t);var r=_createSuper(XRefParseException);function XRefParseException(t){_classCallCheck(this,XRefParseException);return r.call(this,t,"XRefParseException")}return _createClass(XRefParseException)}(o.BaseException);r.XRefParseException=p;var d=function(){function DocStats(t){_classCallCheck(this,DocStats);this._handler=t;this._streamTypes=new Set;this._fontTypes=new Set}_createClass(DocStats,[{key:"_send",value:function _send(){var t,r=Object.create(null),i=Object.create(null),o=_createForOfIteratorHelper(this._streamTypes);try{for(o.s();!(t=o.n()).done;){r[t.value]=!0}}catch(t){o.e(t)}finally{o.f()}var a,c=_createForOfIteratorHelper(this._fontTypes);try{for(c.s();!(a=c.n()).done;){i[a.value]=!0}}catch(t){c.e(t)}finally{c.f()}this._handler.send("DocStats",{streamTypes:r,fontTypes:i})}},{key:"addStreamType",value:function addStreamType(t){if(!this._streamTypes.has(t)){this._streamTypes.add(t);this._send()}}},{key:"addFontType",value:function addFontType(t){if(!this._fontTypes.has(t)){this._fontTypes.add(t);this._send()}}}]);return DocStats}();r.DocStats=d;function getInheritableProperty(t){for(var r,i=t.dict,o=t.key,c=t.getArray,l=void 0!==c&&c,u=t.stopWhenFound,h=void 0===u||u,p=new a.RefSet;i instanceof a.Dict&&(!i.objId||!p.has(i.objId));){i.objId&&p.put(i.objId);var d=l?i.getArray(o):i.get(o);if(void 0!==d){if(h)return d;r||(r=[]);r.push(d)}i=i.get("Parent")}return r}var y=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function _collectJS(t,r,i,l){if(t){var u=null;if(t instanceof a.Ref){if(l.has(t))return;u=t;l.put(u);t=r.fetch(t)}if(Array.isArray(t)){var h,p=_createForOfIteratorHelper(t);try{for(p.s();!(h=p.n()).done;){_collectJS(h.value,r,i,l)}}catch(t){p.e(t)}finally{p.f()}}else if(t instanceof a.Dict){if((0,a.isName)(t.get("S"),"JavaScript")){var d,y=t.get("JS");y instanceof c.BaseStream?d=y.getString():"string"==typeof y&&(d=y);(d=d&&(0,o.stringToPDFString)(d).replace(/\u0000/g,""))&&i.push(d)}_collectJS(t.getRaw("Next"),r,i,l)}u&&l.remove(u)}}var v={60:"<",62:">",38:"&",34:""",39:"'"}},(t,r,i)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.RefSetCache=r.RefSet=r.Ref=r.Name=r.EOF=r.Dict=r.Cmd=r.CIRCULAR_REF=void 0;r.clearPrimitiveCaches=function clearPrimitiveCaches(){u._clearCache();l._clearCache();d._clearCache()};r.isCmd=function isCmd(t,r){return t instanceof u&&(void 0===r||t.cmd===r)};r.isDict=function isDict(t,r){return t instanceof p&&(void 0===r||isName(t.get("Type"),r))};r.isName=isName;r.isRefsEqual=function isRefsEqual(t,r){return t.num===r.num&&t.gen===r.gen};var o=i(1);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var o,a,c=[],l=!0,u=!1;try{for(i=i.call(t);!(l=(o=i.next()).done);l=!0){c.push(o.value);if(r&&c.length===r)break}}catch(t){u=!0;a=t}finally{try{l||null==i.return||i.return()}finally{if(u)throw a}}return c}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){i&&(t=i);var o=0,a=function F(){};return{s:a,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,l=!0,u=!1;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();l=t.done;return t},e:function e(t){u=!0;c=t},f:function f(){try{l||null==i.return||i.return()}finally{if(u)throw c}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);return"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return t};var t={},r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function define(t,r,i){return Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,i){return t[r]=i}}function wrap(t,r,i,o){var a=r&&r.prototype instanceof Generator?r:Generator,c=Object.create(a.prototype),l=new Context(o||[]);return c._invoke=function(t,r,i){var o="suspendedStart";return function(a,c){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===a)throw c;return doneResult()}for(i.method=a,i.arg=c;;){var l=i.delegate;if(l){var h=maybeInvokeDelegate(l,i);if(h){if(h===u)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===o)throw o="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o="executing";var p=tryCatch(t,r,i);if("normal"===p.type){if(o=i.done?"completed":"suspendedYield",p.arg===u)continue;return{value:p.arg,done:i.done}}"throw"===p.type&&(o="completed",i.method="throw",i.arg=p.arg)}}}(t,i,l),c}function tryCatch(t,r,i){try{return{type:"normal",arg:t.call(r,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=wrap;var u={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var h={};define(h,a,(function(){return this}));var p=Object.getPrototypeOf,d=p&&p(p(values([])));d&&d!==r&&i.call(d,a)&&(h=d);var y=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(h);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){function invoke(o,a,c,l){var u=tryCatch(t[o],t,a);if("throw"!==u.type){var h=u.arg,p=h.value;return p&&"object"==_typeof(p)&&i.call(p,"__await")?r.resolve(p.__await).then((function(t){invoke("next",t,c,l)}),(function(t){invoke("throw",t,c,l)})):r.resolve(p).then((function(t){h.value=t,c(h)}),(function(t){return invoke("throw",t,c,l)}))}l(u.arg)}var o;this._invoke=function(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,o){invoke(t,i,r,o)}))}return o=o?o.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,r){var i=t.iterator[r.method];if(void 0===i){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=void 0,maybeInvokeDelegate(t,r),"throw"===r.method))return u;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var o=tryCatch(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,u;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,u):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,u)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,c=function next(){for(;++o<t.length;)if(i.call(t,o))return next.value=t[o],next.done=!1,next;return next.value=void 0,next.done=!0,next};return c.next=c}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(y,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,l,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),t.AsyncIterator=AsyncIterator,t.async=function(r,i,o,a,c){void 0===c&&(c=Promise);var l=new AsyncIterator(wrap(r,i,o,a),c);return t.isGeneratorFunction(i)?l:l.next().then((function(t){return t.done?t.value:l.next()}))},defineIteratorMethods(y),define(y,l,"Generator"),define(y,a,(function(){return this})),define(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var r=[];for(var i in t)r.push(i);return r.reverse(),function next(){for(;r.length;){var i=r.pop();if(i in t)return next.value=i,next.done=!1,next}return next.done=!0,next}},t.values=values,Context.prototype={constructor:Context,reset:function reset(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var r=this;function handle(i,o){return c.type="throw",c.arg=t,r.next=i,o&&(r.method="next",r.arg=void 0),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return handle("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return handle(a.catchLoc,!0);if(this.prev<a.finallyLoc)return handle(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return handle(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return handle(a.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o];if(a.tryLoc<=this.prev&&i.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var c=a;break}}c&&("break"===t||"continue"===t)&&c.tryLoc<=r&&r<=c.finallyLoc&&(c=null);var l=c?c.completion:{};return l.type=t,l.arg=r,c?(this.method="next",this.next=c.finallyLoc,u):this.complete(l)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),u},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),resetTryEntry(i),u}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc===t){var o=i.completion;if("throw"===o.type){var a=o.arg;resetTryEntry(i)}return a}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,r,i){return this.delegate={iterator:values(t),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},t}function asyncGeneratorStep(t,r,i,o,a,c,l){try{var u=t[c](l),h=u.value}catch(t){i(t);return}u.done?r(h):Promise.resolve(h).then(o,a)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,i){r&&_defineProperties(t.prototype,r);i&&_defineProperties(t,i);Object.defineProperty(t,"prototype",{writable:!1});return t}var a=Symbol("CIRCULAR_REF");r.CIRCULAR_REF=a;var c=Symbol("EOF");r.EOF=c;var l=function NameClosure(){var t=Object.create(null);return function(){function Name(t){_classCallCheck(this,Name);this.name=t}_createClass(Name,null,[{key:"get",value:function get(r){return t[r]||(t[r]=new Name(r))}},{key:"_clearCache",value:function _clearCache(){t=Object.create(null)}}]);return Name}()}();r.Name=l;var u=function CmdClosure(){var t=Object.create(null);return function(){function Cmd(t){_classCallCheck(this,Cmd);this.cmd=t}_createClass(Cmd,null,[{key:"get",value:function get(r){return t[r]||(t[r]=new Cmd(r))}},{key:"_clearCache",value:function _clearCache(){t=Object.create(null)}}]);return Cmd}()}();r.Cmd=u;var h=function nonSerializableClosure(){return h},p=function(){function Dict(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_classCallCheck(this,Dict);this._map=Object.create(null);this.xref=t;this.objId=null;this.suppressEncryption=!1;this.__nonSerializable__=h}_createClass(Dict,[{key:"assignXref",value:function assignXref(t){this.xref=t}},{key:"size",get:function get(){return Object.keys(this._map).length}},{key:"get",value:function get(t,r,i){var o=this._map[t];void 0===o&&void 0!==r&&void 0===(o=this._map[r])&&void 0!==i&&(o=this._map[i]);return o instanceof d&&this.xref?this.xref.fetch(o,this.suppressEncryption):o}},{key:"getAsync",value:(t=function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(void 0)}))}}(_regeneratorRuntime().mark((function _callee(t,r,i){var o;return _regeneratorRuntime().wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:void 0===(o=this._map[t])&&void 0!==r&&void 0===(o=this._map[r])&&void 0!==i&&(o=this._map[i]);if(!(o instanceof d&&this.xref)){a.next=4;break}return a.abrupt("return",this.xref.fetchAsync(o,this.suppressEncryption));case 4:return a.abrupt("return",o);case 5:case"end":return a.stop()}}),_callee,this)}))),function getAsync(r,i,o){return t.apply(this,arguments)})},{key:"getArray",value:function getArray(t,r,i){var o=this._map[t];void 0===o&&void 0!==r&&void 0===(o=this._map[r])&&void 0!==i&&(o=this._map[i]);o instanceof d&&this.xref&&(o=this.xref.fetch(o,this.suppressEncryption));if(Array.isArray(o))for(var a=0,c=(o=o.slice()).length;a<c;a++)o[a]instanceof d&&this.xref&&(o[a]=this.xref.fetch(o[a],this.suppressEncryption));return o}},{key:"getRaw",value:function getRaw(t){return this._map[t]}},{key:"getKeys",value:function getKeys(){return Object.keys(this._map)}},{key:"getRawValues",value:function getRawValues(){return Object.values(this._map)}},{key:"set",value:function set(t,r){this._map[t]=r}},{key:"has",value:function has(t){return void 0!==this._map[t]}},{key:"forEach",value:function forEach(t){for(var r in this._map)t(r,this.get(r))}}],[{key:"empty",get:function get(){var t=new Dict(null);t.set=function(t,r){(0,o.unreachable)("Should not call `set` on the empty dictionary.")};return(0,o.shadow)(this,"empty",t)}},{key:"merge",value:function merge(t){var r,i=t.xref,o=t.dictArray,a=t.mergeSubDicts,c=void 0!==a&&a,l=new Dict(i),u=new Map,h=_createForOfIteratorHelper(o);try{for(h.s();!(r=h.n()).done;){var p=r.value;if(p instanceof Dict)for(var d=0,y=Object.entries(p._map);d<y.length;d++){var v=_slicedToArray(y[d],2),m=v[0],g=v[1],b=u.get(m);if(void 0===b){b=[];u.set(m,b)}else if(!(c&&g instanceof Dict))continue;b.push(g)}}}catch(t){h.e(t)}finally{h.f()}var _,x=_createForOfIteratorHelper(u);try{for(x.s();!(_=x.n()).done;){var w=_slicedToArray(_.value,2),C=w[0],T=w[1];if(1!==T.length&&T[0]instanceof Dict){var P,S=new Dict(i),k=_createForOfIteratorHelper(T);try{for(k.s();!(P=k.n()).done;)for(var I=P.value,O=0,E=Object.entries(I._map);O<E.length;O++){var A=_slicedToArray(E[O],2),R=A[0],B=A[1];void 0===S._map[R]&&(S._map[R]=B)}}catch(t){k.e(t)}finally{k.f()}S.size>0&&(l._map[C]=S)}else l._map[C]=T[0]}}catch(t){x.e(t)}finally{x.f()}u.clear();return l.size>0?l:Dict.empty}}]);var t;return Dict}();r.Dict=p;var d=function RefClosure(){var t=Object.create(null);return function(){function Ref(t,r){_classCallCheck(this,Ref);this.num=t;this.gen=r}_createClass(Ref,[{key:"toString",value:function toString(){return 0===this.gen?"".concat(this.num,"R"):"".concat(this.num,"R").concat(this.gen)}}],[{key:"get",value:function get(r,i){var o=0===i?"".concat(r,"R"):"".concat(r,"R").concat(i);return t[o]||(t[o]=new Ref(r,i))}},{key:"_clearCache",value:function _clearCache(){t=Object.create(null)}}]);return Ref}()}();r.Ref=d;var y=function(t){function RefSet(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_classCallCheck(this,RefSet);this._set=new Set(t&&t._set)}_createClass(RefSet,[{key:"has",value:function has(t){return this._set.has(t.toString())}},{key:"put",value:function put(t){this._set.add(t.toString())}},{key:"remove",value:function remove(t){this._set.delete(t.toString())}},{key:Symbol.iterator,value:function value(){return this._set.values()}},{key:"clear",value:function clear(){this._set.clear()}}]);return RefSet}();r.RefSet=y;var v=function(t){function RefSetCache(){_classCallCheck(this,RefSetCache);this._map=new Map}_createClass(RefSetCache,[{key:"size",get:function get(){return this._map.size}},{key:"get",value:function get(t){return this._map.get(t.toString())}},{key:"has",value:function has(t){return this._map.has(t.toString())}},{key:"put",value:function put(t,r){this._map.set(t.toString(),r)}},{key:"putAlias",value:function putAlias(t,r){this._map.set(t.toString(),this.get(r))}},{key:Symbol.iterator,value:function value(){return this._map.values()}},{key:"clear",value:function clear(){this._map.clear()}}]);return RefSetCache}();r.RefSetCache=v;function isName(t,r){return t instanceof l&&(void 0===r||t.name===r)}},(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.BaseStream=void 0;var o=i(1);function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}var a=function(){function BaseStream(){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,BaseStream);this.constructor===BaseStream&&(0,o.unreachable)("Cannot initialize BaseStream.")}!function _createClass(t,r,i){r&&_defineProperties(t.prototype,r);i&&_defineProperties(t,i);Object.defineProperty(t,"prototype",{writable:!1});return t}(BaseStream,[{key:"length",get:function get(){(0,o.unreachable)("Abstract getter `length` accessed")}},{key:"isEmpty",get:function get(){(0,o.unreachable)("Abstract getter `isEmpty` accessed")}},{key:"isDataLoaded",get:function get(){return(0,o.shadow)(this,"isDataLoaded",!0)}},{key:"getByte",value:function getByte(){(0,o.unreachable)("Abstract method `getByte` called")}},{key:"getBytes",value:function getBytes(t){(0,o.unreachable)("Abstract method `getBytes` called")}},{key:"peekByte",value:function peekByte(){var t=this.getByte();-1!==t&&this.pos--;return t}},{key:"peekBytes",value:function peekBytes(t){var r=this.getBytes(t);this.pos-=r.length;return r}},{key:"getUint16",value:function getUint16(){var t=this.getByte(),r=this.getByte();return-1===t||-1===r?-1:(t<<8)+r}},{key:"getInt32",value:function getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}},{key:"getByteRange",value:function getByteRange(t,r){(0,o.unreachable)("Abstract method `getByteRange` called")}},{key:"getString",value:function getString(t){return(0,o.bytesToString)(this.getBytes(t))}},{key:"skip",value:function skip(t){this.pos+=t||1}},{key:"reset",value:function reset(){(0,o.unreachable)("Abstract method `reset` called")}},{key:"moveStart",value:function moveStart(){(0,o.unreachable)("Abstract method `moveStart` called")}},{key:"makeSubStream",value:function makeSubStream(t,r){(0,o.unreachable)("Abstract method `makeSubStream` called")}},{key:"getBaseStreams",value:function getBaseStreams(){return null}}]);return BaseStream}();r.BaseStream=a},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ArithmeticDecoder=void 0;function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}var i=[{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,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,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,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}],o=function(){function ArithmeticDecoder(t,r,i){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,ArithmeticDecoder);this.data=t;this.bp=r;this.dataEnd=i;this.chigh=t[r];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}!function _createClass(t,r,i){r&&_defineProperties(t.prototype,r);i&&_defineProperties(t,i);Object.defineProperty(t,"prototype",{writable:!1});return t}(ArithmeticDecoder,[{key:"byteIn",value:function byteIn(){var t=this.data,r=this.bp;if(255===t[r])if(t[r+1]>143){this.clow+=65280;this.ct=8}else{r++;this.clow+=t[r]<<9;this.ct=7;this.bp=r}else{r++;this.clow+=r<this.dataEnd?t[r]<<8:65280;this.ct=8;this.bp=r}if(this.clow>65535){this.chigh+=this.clow>>16;this.clow&=65535}}},{key:"readBit",value:function readBit(t,r){var o,a=t[r]>>1,c=1&t[r],l=i[a],u=l.qe,h=this.a-u;if(this.chigh<u)if(h<u){h=u;o=c;a=l.nmps}else{h=u;o=1^c;1===l.switchFlag&&(c=o);a=l.nlps}else{this.chigh-=u;if(0!=(32768&h)){this.a=h;return c}if(h<u){o=1^c;1===l.switchFlag&&(c=o);a=l.nlps}else{o=c;a=l.nmps}}do{0===this.ct&&this.byteIn();h<<=1;this.chigh=this.chigh<<1&65535|this.clow>>15&1;this.clow=this.clow<<1&65535;this.ct--}while(0==(32768&h));this.a=h;t[r]=a<<1|c;return o}}]);return ArithmeticDecoder}();r.ArithmeticDecoder=o},(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.CCITTFaxDecoder=void 0;var o=i(1);function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}var a=-1,c=[[-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],[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]],l=[[-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,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],u=[[-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],[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,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],[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],[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],[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],[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],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],h=[[-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],[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,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]],p=[[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],[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],[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,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],d=[[-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]],y=function(){function CCITTFaxDecoder(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,CCITTFaxDecoder);if(!t||"function"!=typeof t.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=t;this.eof=!1;this.encoding=r.K||0;this.eoline=r.EndOfLine||!1;this.byteAlign=r.EncodedByteAlign||!1;this.columns=r.Columns||1728;this.rows=r.Rows||0;var i,o=r.EndOfBlock;null==o&&(o=!0);this.eoblock=o;this.black=r.BlackIs1||!1;this.codingLine=new Uint32Array(this.columns+1);this.refLine=new Uint32Array(this.columns+2);this.codingLine[0]=this.columns;this.codingPos=0;this.row=0;this.nextLine2D=this.encoding<0;this.inputBits=0;this.inputBuf=0;this.outputBits=0;this.rowsDone=!1;for(;0===(i=this._lookBits(12));)this._eatBits(1);1===i&&this._eatBits(12);if(this.encoding>0){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}}!function _createClass(t,r,i){r&&_defineProperties(t.prototype,r);i&&_defineProperties(t,i);Object.defineProperty(t,"prototype",{writable:!1});return t}(CCITTFaxDecoder,[{key:"readNextChar",value:function readNextChar(){if(this.eof)return-1;var t,r,i,c,l,u=this.refLine,h=this.codingLine,p=this.columns;if(0===this.outputBits){this.rowsDone&&(this.eof=!0);if(this.eof)return-1;this.err=!1;var d,y,v;if(this.nextLine2D){for(c=0;h[c]<p;++c)u[c]=h[c];u[c++]=p;u[c]=p;h[0]=0;this.codingPos=0;t=0;r=0;for(;h[this.codingPos]<p;)switch(d=this._getTwoDimCode()){case 0:this._addPixels(u[t+1],r);u[t+1]<p&&(t+=2);break;case 1:d=y=0;if(r){do{d+=v=this._getBlackCode()}while(v>=64);do{y+=v=this._getWhiteCode()}while(v>=64)}else{do{d+=v=this._getWhiteCode()}while(v>=64);do{y+=v=this._getBlackCode()}while(v>=64)}this._addPixels(h[this.codingPos]+d,r);h[this.codingPos]<p&&this._addPixels(h[this.codingPos]+y,1^r);for(;u[t]<=h[this.codingPos]&&u[t]<p;)t+=2;break;case 7:this._addPixels(u[t]+3,r);r^=1;if(h[this.codingPos]<p){++t;for(;u[t]<=h[this.codingPos]&&u[t]<p;)t+=2}break;case 5:this._addPixels(u[t]+2,r);r^=1;if(h[this.codingPos]<p){++t;for(;u[t]<=h[this.codingPos]&&u[t]<p;)t+=2}break;case 3:this._addPixels(u[t]+1,r);r^=1;if(h[this.codingPos]<p){++t;for(;u[t]<=h[this.codingPos]&&u[t]<p;)t+=2}break;case 2:this._addPixels(u[t],r);r^=1;if(h[this.codingPos]<p){++t;for(;u[t]<=h[this.codingPos]&&u[t]<p;)t+=2}break;case 8:this._addPixelsNeg(u[t]-3,r);r^=1;if(h[this.codingPos]<p){t>0?--t:++t;for(;u[t]<=h[this.codingPos]&&u[t]<p;)t+=2}break;case 6:this._addPixelsNeg(u[t]-2,r);r^=1;if(h[this.codingPos]<p){t>0?--t:++t;for(;u[t]<=h[this.codingPos]&&u[t]<p;)t+=2}break;case 4:this._addPixelsNeg(u[t]-1,r);r^=1;if(h[this.codingPos]<p){t>0?--t:++t;for(;u[t]<=h[this.codingPos]&&u[t]<p;)t+=2}break;case a:this._addPixels(p,0);this.eof=!0;break;default:(0,o.info)("bad 2d code");this._addPixels(p,0);this.err=!0}}else{h[0]=0;this.codingPos=0;r=0;for(;h[this.codingPos]<p;){d=0;if(r)do{d+=v=this._getBlackCode()}while(v>=64);else do{d+=v=this._getWhiteCode()}while(v>=64);this._addPixels(h[this.codingPos]+d,r);r^=1}}var m=!1;this.byteAlign&&(this.inputBits&=-8);if(this.eoblock||this.row!==this.rows-1){d=this._lookBits(12);if(this.eoline)for(;d!==a&&1!==d;){this._eatBits(1);d=this._lookBits(12)}else for(;0===d;){this._eatBits(1);d=this._lookBits(12)}if(1===d){this._eatBits(12);m=!0}else d===a&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}if(this.eoblock&&m&&this.byteAlign){if(1===(d=this._lookBits(12))){this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}if(this.encoding>=0)for(c=0;c<4;++c){1!==(d=this._lookBits(12))&&(0,o.info)("bad rtc code: "+d);this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}}this.eof=!0}}else if(this.err&&this.eoline){for(;;){if((d=this._lookBits(13))===a){this.eof=!0;return-1}if(d>>1==1)break;this._eatBits(1)}this._eatBits(12);if(this.encoding>0){this._eatBits(1);this.nextLine2D=!(1&d)}}h[0]>0?this.outputBits=h[this.codingPos=0]:this.outputBits=h[this.codingPos=1];this.row++}if(this.outputBits>=8){l=1&this.codingPos?0:255;this.outputBits-=8;if(0===this.outputBits&&h[this.codingPos]<p){this.codingPos++;this.outputBits=h[this.codingPos]-h[this.codingPos-1]}}else{i=8;l=0;do{if("number"!=typeof this.outputBits)throw new o.FormatError('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');if(this.outputBits>i){l<<=i;1&this.codingPos||(l|=255>>8-i);this.outputBits-=i;i=0}else{l<<=this.outputBits;1&this.codingPos||(l|=255>>8-this.outputBits);i-=this.outputBits;this.outputBits=0;if(h[this.codingPos]<p){this.codingPos++;this.outputBits=h[this.codingPos]-h[this.codingPos-1]}else if(i>0){l<<=i;i=0}}}while(i)}this.black&&(l^=255);return l}},{key:"_addPixels",value:function _addPixels(t,r){var i=this.codingLine,a=this.codingPos;if(t>i[a]){if(t>this.columns){(0,o.info)("row is wrong length");this.err=!0;t=this.columns}1&a^r&&++a;i[a]=t}this.codingPos=a}},{key:"_addPixelsNeg",value:function _addPixelsNeg(t,r){var i=this.codingLine,a=this.codingPos;if(t>i[a]){if(t>this.columns){(0,o.info)("row is wrong length");this.err=!0;t=this.columns}1&a^r&&++a;i[a]=t}else if(t<i[a]){if(t<0){(0,o.info)("invalid code");this.err=!0;t=0}for(;a>0&&t<i[a-1];)--a;i[a]=t}this.codingPos=a}},{key:"_findTableCode",value:function _findTableCode(t,r,i,o){for(var c=o||0,l=t;l<=r;++l){var u=this._lookBits(l);if(u===a)return[!0,1,!1];l<r&&(u<<=r-l);if(!c||u>=c){var h=i[u-c];if(h[0]===l){this._eatBits(l);return[!0,h[1],!0]}}}return[!1,0,!1]}},{key:"_getTwoDimCode",value:function _getTwoDimCode(){var t,r=0;if(this.eoblock){r=this._lookBits(7);if((t=c[r])&&t[0]>0){this._eatBits(t[0]);return t[1]}}else{var i=this._findTableCode(1,7,c);if(i[0]&&i[2])return i[1]}(0,o.info)("Bad two dim code");return a}},{key:"_getWhiteCode",value:function _getWhiteCode(){var t,r=0;if(this.eoblock){if((r=this._lookBits(12))===a)return 1;if((t=r>>5==0?l[r]:u[r>>3])[0]>0){this._eatBits(t[0]);return t[1]}}else{var i=this._findTableCode(1,9,u);if(i[0])return i[1];if((i=this._findTableCode(11,12,l))[0])return i[1]}(0,o.info)("bad white code");this._eatBits(1);return 1}},{key:"_getBlackCode",value:function _getBlackCode(){var t,r;if(this.eoblock){if((t=this._lookBits(13))===a)return 1;if((r=t>>7==0?h[t]:t>>9==0&&t>>7!=0?p[(t>>1)-64]:d[t>>7])[0]>0){this._eatBits(r[0]);return r[1]}}else{var i=this._findTableCode(2,6,d);if(i[0])return i[1];if((i=this._findTableCode(7,12,p,64))[0])return i[1];if((i=this._findTableCode(10,13,h))[0])return i[1]}(0,o.info)("bad black code");this._eatBits(1);return 1}},{key:"_lookBits",value:function _lookBits(t){for(var r;this.inputBits<t;){if(-1===(r=this.source.next()))return 0===this.inputBits?a:this.inputBuf<<t-this.inputBits&65535>>16-t;this.inputBuf=this.inputBuf<<8|r;this.inputBits+=8}return this.inputBuf>>this.inputBits-t&65535>>16-t}},{key:"_eatBits",value:function _eatBits(t){(this.inputBits-=t)<0&&(this.inputBits=0)}}]);return CCITTFaxDecoder}();r.CCITTFaxDecoder=y},(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.JpegImage=void 0;var o=i(1),a=i(87);function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,i){r&&_defineProperties(t.prototype,r);i&&_defineProperties(t,i);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var i,o=_getPrototypeOf(t);if(r){var a=_getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var c=function(t){_inherits(JpegError,t);var r=_createSuper(JpegError);function JpegError(t){_classCallCheck(this,JpegError);return r.call(this,"JPEG error: ".concat(t),"JpegError")}return _createClass(JpegError)}(o.BaseException),l=function(t){_inherits(DNLMarkerError,t);var r=_createSuper(DNLMarkerError);function DNLMarkerError(t,i){var o;_classCallCheck(this,DNLMarkerError);(o=r.call(this,t,"DNLMarkerError")).scanLines=i;return o}return _createClass(DNLMarkerError)}(o.BaseException),u=function(t){_inherits(EOIMarkerError,t);var r=_createSuper(EOIMarkerError);function EOIMarkerError(t){_classCallCheck(this,EOIMarkerError);return r.call(this,t,"EOIMarkerError")}return _createClass(EOIMarkerError)}(o.BaseException),h=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),p=4017,d=799,y=3406,v=2276,m=1567,g=3784,b=5793,_=2896;function buildHuffmanTable(t,r){for(var i,o,a=0,c=16;c>0&&!t[c-1];)c--;var l,u=[{children:[],index:0}],h=u[0];for(i=0;i<c;i++){for(o=0;o<t[i];o++){(h=u.pop()).children[h.index]=r[a];for(;h.index>0;)h=u.pop();h.index++;u.push(h);for(;u.length<=i;){u.push(l={children:[],index:0});h.children[h.index]=l.children;h=l}a++}if(i+1<c){u.push(l={children:[],index:0});h.children[h.index]=l.children;h=l}}return u[0].children}function getBlockBufferOffset(t,r,i){return 64*((t.blocksPerLine+1)*r+i)}function decodeScan(t,r,i,p,d,y,v,m,g){var b=arguments.length>9&&void 0!==arguments[9]&&arguments[9],_=i.mcusPerLine,x=i.progressive,w=r,C=0,T=0;function readBit(){if(T>0){T--;return C>>T&1}if(255===(C=t[r++])){var o=t[r++];if(o){if(220===o&&b){r+=2;var h=(0,a.readUint16)(t,r);r+=2;if(h>0&&h!==i.scanLines)throw new l("Found DNL marker (0xFFDC) while parsing scan data",h)}else if(217===o){if(b){var p=I*(8===i.precision?8:0);if(p>0&&Math.round(i.scanLines/p)>=10)throw new l("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",p)}throw new u("Found EOI marker (0xFFD9) while parsing scan data")}throw new c("unexpected marker ".concat((C<<8|o).toString(16)))}}T=7;return C>>>7}function decodeHuffman(t){for(var r=t;;){switch(_typeof(r=r[readBit()])){case"number":return r;case"object":continue}throw new c("invalid huffman sequence")}}function receive(t){for(var r=0;t>0;){r=r<<1|readBit();t--}return r}function receiveAndExtend(t){if(1===t)return 1===readBit()?1:-1;var r=receive(t);return r>=1<<t-1?r:r+(-1<<t)+1}function decodeBaseline(t,r){var i=decodeHuffman(t.huffmanTableDC),o=0===i?0:receiveAndExtend(i);t.blockData[r]=t.pred+=o;for(var a=1;a<64;){var c=decodeHuffman(t.huffmanTableAC),l=15&c,u=c>>4;if(0!==l){var p=h[a+=u];t.blockData[r+p]=receiveAndExtend(l);a++}else{if(u<15)break;a+=16}}}function decodeDCFirst(t,r){var i=decodeHuffman(t.huffmanTableDC),o=0===i?0:receiveAndExtend(i)<<g;t.blockData[r]=t.pred+=o}function decodeDCSuccessive(t,r){t.blockData[r]|=readBit()<<g}var P=0;function decodeACFirst(t,r){if(P>0)P--;else for(var i=y,o=v;i<=o;){var a=decodeHuffman(t.huffmanTableAC),c=15&a,l=a>>4;if(0!==c){var u=h[i+=l];t.blockData[r+u]=receiveAndExtend(c)*(1<<g);i++}else{if(l<15){P=receive(l)+(1<<l)-1;break}i+=16}}}var S,k=0;function decodeACSuccessive(t,r){for(var i,o,a=y,l=v,u=0;a<=l;){var p=r+h[a],d=t.blockData[p]<0?-1:1;switch(k){case 0:u=(o=decodeHuffman(t.huffmanTableAC))>>4;if(0===(i=15&o))if(u<15){P=receive(u)+(1<<u);k=4}else{u=16;k=1}else{if(1!==i)throw new c("invalid ACn encoding");S=receiveAndExtend(i);k=u?2:3}continue;case 1:case 2:t.blockData[p]?t.blockData[p]+=d*(readBit()<<g):0===--u&&(k=2===k?3:0);break;case 3:if(t.blockData[p])t.blockData[p]+=d*(readBit()<<g);else{t.blockData[p]=S<<g;k=0}break;case 4:t.blockData[p]&&(t.blockData[p]+=d*(readBit()<<g))}a++}4===k&&0===--P&&(k=0)}var I=0;function decodeMcu(t,r,i,o,a){var c=i%_;I=(i/_|0)*t.v+o;var l=c*t.h+a;r(t,getBlockBufferOffset(t,I,l))}function decodeBlock(t,r,i){I=i/t.blocksPerLine|0;var o=i%t.blocksPerLine;r(t,getBlockBufferOffset(t,I,o))}var O,E,A,R,B,D,L=p.length;D=x?0===y?0===m?decodeDCFirst:decodeDCSuccessive:0===m?decodeACFirst:decodeACSuccessive:decodeBaseline;var M,N,U,j,H=0;N=1===L?p[0].blocksPerLine*p[0].blocksPerColumn:_*i.mcusPerColumn;for(;H<=N;){var z=d?Math.min(N-H,d):N;if(z>0){for(E=0;E<L;E++)p[E].pred=0;P=0;if(1===L){O=p[0];for(B=0;B<z;B++){decodeBlock(O,D,H);H++}}else for(B=0;B<z;B++){for(E=0;E<L;E++){U=(O=p[E]).h;j=O.v;for(A=0;A<j;A++)for(R=0;R<U;R++)decodeMcu(O,D,H,A,R)}H++}}T=0;if(!(M=findNextFileMarker(t,r)))break;if(M.invalid){var X=z>0?"unexpected":"excessive";(0,o.warn)("decodeScan - ".concat(X," MCU data, current marker is: ").concat(M.invalid));r=M.offset}if(!(M.marker>=65488&&M.marker<=65495))break;r+=2}return r-w}function quantizeAndInverse(t,r,i){var o,a,l,u,h,x,w,C,T,P,S,k,I,O,E,A,R,B=t.quantizationTable,D=t.blockData;if(!B)throw new c("missing required Quantization Table.");for(var L=0;L<64;L+=8){T=D[r+L];P=D[r+L+1];S=D[r+L+2];k=D[r+L+3];I=D[r+L+4];O=D[r+L+5];E=D[r+L+6];A=D[r+L+7];T*=B[L];if(0!=(P|S|k|I|O|E|A)){P*=B[L+1];S*=B[L+2];k*=B[L+3];I*=B[L+4];O*=B[L+5];E*=B[L+6];A*=B[L+7];a=(o=(o=b*T+128>>8)+(a=b*I+128>>8)+1>>1)-a;R=(l=S)*g+(u=E)*m+128>>8;l=l*m-u*g+128>>8;w=(h=(h=_*(P-A)+128>>8)+(w=O<<4)+1>>1)-w;x=(C=(C=_*(P+A)+128>>8)+(x=k<<4)+1>>1)-x;u=(o=o+(u=R)+1>>1)-u;l=(a=a+l+1>>1)-l;R=h*v+C*y+2048>>12;h=h*y-C*v+2048>>12;C=R;R=x*d+w*p+2048>>12;x=x*p-w*d+2048>>12;w=R;i[L]=o+C;i[L+7]=o-C;i[L+1]=a+w;i[L+6]=a-w;i[L+2]=l+x;i[L+5]=l-x;i[L+3]=u+h;i[L+4]=u-h}else{R=b*T+512>>10;i[L]=R;i[L+1]=R;i[L+2]=R;i[L+3]=R;i[L+4]=R;i[L+5]=R;i[L+6]=R;i[L+7]=R}}for(var M=0;M<8;++M){T=i[M];if(0!=((P=i[M+8])|(S=i[M+16])|(k=i[M+24])|(I=i[M+32])|(O=i[M+40])|(E=i[M+48])|(A=i[M+56]))){a=(o=4112+((o=b*T+2048>>12)+(a=b*I+2048>>12)+1>>1))-a;R=(l=S)*g+(u=E)*m+2048>>12;l=l*m-u*g+2048>>12;u=R;w=(h=(h=_*(P-A)+2048>>12)+(w=O)+1>>1)-w;x=(C=(C=_*(P+A)+2048>>12)+(x=k)+1>>1)-x;R=h*v+C*y+2048>>12;h=h*y-C*v+2048>>12;C=R;R=x*d+w*p+2048>>12;x=x*p-w*d+2048>>12;(T=(o=o+u+1>>1)+C)<16?T=0:T>=4080?T=255:T>>=4;(P=(a=a+l+1>>1)+(w=R))<16?P=0:P>=4080?P=255:P>>=4;(S=(l=a-l)+x)<16?S=0:S>=4080?S=255:S>>=4;(k=(u=o-u)+h)<16?k=0:k>=4080?k=255:k>>=4;(I=u-h)<16?I=0:I>=4080?I=255:I>>=4;(O=l-x)<16?O=0:O>=4080?O=255:O>>=4;(E=a-w)<16?E=0:E>=4080?E=255:E>>=4;(A=o-C)<16?A=0:A>=4080?A=255:A>>=4;D[r+M]=T;D[r+M+8]=P;D[r+M+16]=S;D[r+M+24]=k;D[r+M+32]=I;D[r+M+40]=O;D[r+M+48]=E;D[r+M+56]=A}else{R=(R=b*T+8192>>14)<-2040?0:R>=2024?255:R+2056>>4;D[r+M]=R;D[r+M+8]=R;D[r+M+16]=R;D[r+M+24]=R;D[r+M+32]=R;D[r+M+40]=R;D[r+M+48]=R;D[r+M+56]=R}}}function buildComponentData(t,r){for(var i=r.blocksPerLine,o=r.blocksPerColumn,a=new Int16Array(64),c=0;c<o;c++)for(var l=0;l<i;l++){quantizeAndInverse(r,getBlockBufferOffset(r,c,l),a)}return r.blockData}function findNextFileMarker(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,o=t.length-1,c=i<r?i:r;if(r>=o)return null;var l=(0,a.readUint16)(t,r);if(l>=65472&&l<=65534)return{invalid:null,marker:l,offset:r};for(var u=(0,a.readUint16)(t,c);!(u>=65472&&u<=65534);){if(++c>=o)return null;u=(0,a.readUint16)(t,c)}return{invalid:l.toString(16),marker:u,offset:c}}var x=function(){function JpegImage(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.decodeTransform,i=void 0===r?null:r,o=t.colorTransform,a=void 0===o?-1:o;_classCallCheck(this,JpegImage);this._decodeTransform=i;this._colorTransform=a}_createClass(JpegImage,[{key:"parse",value:function parse(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.dnlScanLines,p=void 0===i?null:i;function readDataBlock(){var r=(0,a.readUint16)(t,v),i=(v+=2)+r-2,c=findNextFileMarker(t,i,v);if(c&&c.invalid){(0,o.warn)("readDataBlock - incorrect length, current marker is: "+c.invalid);i=c.offset}var l=t.subarray(v,i);v+=l.length;return l}function prepareComponents(t){for(var r=Math.ceil(t.samplesPerLine/8/t.maxH),i=Math.ceil(t.scanLines/8/t.maxV),o=0,a=t.components.length;o<a;o++){var c=t.components[o],l=Math.ceil(Math.ceil(t.samplesPerLine/8)*c.h/t.maxH),u=Math.ceil(Math.ceil(t.scanLines/8)*c.v/t.maxV),h=r*c.h,p=64*(i*c.v)*(h+1);c.blockData=new Int16Array(p);c.blocksPerLine=l;c.blocksPerColumn=u}t.mcusPerLine=r;t.mcusPerColumn=i}var d,y,v=0,m=null,g=null,b=0,_=[],x=[],w=[],C=(0,a.readUint16)(t,v);v+=2;if(65496!==C)throw new c("SOI not found");C=(0,a.readUint16)(t,v);v+=2;e:for(;65497!==C;){var T=void 0,P=void 0,S=void 0;switch(C){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 k=readDataBlock();65504===C&&74===k[0]&&70===k[1]&&73===k[2]&&70===k[3]&&0===k[4]&&(m={version:{major:k[5],minor:k[6]},densityUnits:k[7],xDensity:k[8]<<8|k[9],yDensity:k[10]<<8|k[11],thumbWidth:k[12],thumbHeight:k[13],thumbData:k.subarray(14,14+3*k[12]*k[13])});65518===C&&65===k[0]&&100===k[1]&&111===k[2]&&98===k[3]&&101===k[4]&&(g={version:k[5]<<8|k[6],flags0:k[7]<<8|k[8],flags1:k[9]<<8|k[10],transformCode:k[11]});break;case 65499:for(var I=(0,a.readUint16)(t,v),O=I+(v+=2)-2;v<O;){var E=t[v++],A=new Uint16Array(64);if(E>>4==0)for(P=0;P<64;P++)A[h[P]]=t[v++];else{if(E>>4!=1)throw new c("DQT - invalid table spec");for(P=0;P<64;P++){A[h[P]]=(0,a.readUint16)(t,v);v+=2}}_[15&E]=A}break;case 65472:case 65473:case 65474:if(d)throw new c("Only single frame JPEGs supported");v+=2;(d={}).extended=65473===C;d.progressive=65474===C;d.precision=t[v++];var R=(0,a.readUint16)(t,v);v+=2;d.scanLines=p||R;d.samplesPerLine=(0,a.readUint16)(t,v);v+=2;d.components=[];d.componentIds={};var B=t[v++],D=0,L=0;for(T=0;T<B;T++){var M=t[v],N=t[v+1]>>4,U=15&t[v+1];D<N&&(D=N);L<U&&(L=U);var j=t[v+2];S=d.components.push({h:N,v:U,quantizationId:j,quantizationTable:null});d.componentIds[M]=S-1;v+=3}d.maxH=D;d.maxV=L;prepareComponents(d);break;case 65476:var H=(0,a.readUint16)(t,v);v+=2;for(T=2;T<H;){var z=t[v++],X=new Uint8Array(16),Y=0;for(P=0;P<16;P++,v++)Y+=X[P]=t[v];var G=new Uint8Array(Y);for(P=0;P<Y;P++,v++)G[P]=t[v];T+=17+Y;(z>>4==0?w:x)[15&z]=buildHuffmanTable(X,G)}break;case 65501:v+=2;y=(0,a.readUint16)(t,v);v+=2;break;case 65498:var W=1==++b&&!p;v+=2;var J=t[v++],q=[];for(T=0;T<J;T++){var V=t[v++],K=d.componentIds[V],Q=d.components[K];Q.index=V;var Z=t[v++];Q.huffmanTableDC=w[Z>>4];Q.huffmanTableAC=x[15&Z];q.push(Q)}var $=t[v++],ee=t[v++],te=t[v++];try{var re=decodeScan(t,v,d,q,y,$,ee,te>>4,15&te,W);v+=re}catch(r){if(r instanceof l){(0,o.warn)("".concat(r.message," -- attempting to re-parse the JPEG image."));return this.parse(t,{dnlScanLines:r.scanLines})}if(r instanceof u){(0,o.warn)("".concat(r.message," -- ignoring the rest of the image data."));break e}throw r}break;case 65500:v+=4;break;case 65535:255!==t[v]&&v--;break;default:var ne=findNextFileMarker(t,v-2,v-3);if(ne&&ne.invalid){(0,o.warn)("JpegImage.parse - unexpected data, current marker is: "+ne.invalid);v=ne.offset;break}if(!ne||v>=t.length-1){(0,o.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new c("JpegImage.parse - unknown marker: "+C.toString(16))}C=(0,a.readUint16)(t,v);v+=2}this.width=d.samplesPerLine;this.height=d.scanLines;this.jfif=m;this.adobe=g;this.components=[];for(var ie=0,oe=d.components.length;ie<oe;ie++){var ae=d.components[ie],se=_[ae.quantizationId];se&&(ae.quantizationTable=se);this.components.push({index:ae.index,output:buildComponentData(0,ae),scaleX:ae.h/d.maxH,scaleY:ae.v/d.maxV,blocksPerLine:ae.blocksPerLine,blocksPerColumn:ae.blocksPerColumn})}this.numComponents=this.components.length}},{key:"_getLinearizedBlockData",value:function _getLinearizedBlockData(t,r){var i,o,a,c,l,u,h,p,d,y,v,m,g=arguments.length>2&&void 0!==arguments[2]&&arguments[2],b=this.width/t,_=this.height/r,x=0,w=this.components.length,C=t*r*w,T=new Uint8ClampedArray(C),P=new Uint32Array(t),S=4294967288;for(h=0;h<w;h++){o=(i=this.components[h]).scaleX*b;a=i.scaleY*_;x=h;v=i.output;c=i.blocksPerLine+1<<3;if(o!==m){for(l=0;l<t;l++){p=0|l*o;P[l]=(p&S)<<3|7&p}m=o}for(u=0;u<r;u++){y=c*((p=0|u*a)&S)|(7&p)<<3;for(l=0;l<t;l++){T[x]=v[y+P[l]];x+=w}}}var k=this._decodeTransform;g||4!==w||k||(k=new Int32Array([-256,255,-256,255,-256,255,-256,255]));if(k)for(h=0;h<C;)for(p=0,d=0;p<w;p++,h++,d+=2)T[h]=(T[h]*k[d]>>8)+k[d+1];return T}},{key:"_isColorConversionNeeded",get:function get(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform}},{key:"_convertYccToRgb",value:function _convertYccToRgb(t){for(var r,i,o,a=0,c=t.length;a<c;a+=3){r=t[a];i=t[a+1];o=t[a+2];t[a]=r-179.456+1.402*o;t[a+1]=r+135.459-.344*i-.714*o;t[a+2]=r-226.816+1.772*i}return t}},{key:"_convertYcckToRgb",value:function _convertYcckToRgb(t){for(var r,i,o,a,c=0,l=0,u=t.length;l<u;l+=4){r=t[l];i=t[l+1];o=t[l+2];a=t[l+3];t[c++]=i*(-660635669420364e-19*i+.000437130475926232*o-54080610064599e-18*r+.00048449797120281*a-.154362151871126)-122.67195406894+o*(-.000957964378445773*o+.000817076911346625*r-.00477271405408747*a+1.53380253221734)+r*(.000961250184130688*r-.00266257332283933*a+.48357088451265)+a*(-.000336197177618394*a+.484791561490776);t[c++]=107.268039397724+i*(219927104525741e-19*i-.000640992018297945*o+.000659397001245577*r+.000426105652938837*a-.176491792462875)+o*(-.000778269941513683*o+.00130872261408275*r+.000770482631801132*a-.151051492775562)+r*(.00126935368114843*r-.00265090189010898*a+.25802910206845)+a*(-.000318913117588328*a-.213742400323665);t[c++]=i*(-.000570115196973677*i-263409051004589e-19*o+.0020741088115012*r-.00288260236853442*a+.814272968359295)-20.810012546947+o*(-153496057440975e-19*o-.000132689043961446*r+.000560833691242812*a-.195152027534049)+r*(.00174418132927582*r-.00255243321439347*a+.116935020465145)+a*(-.000343531996510555*a+.24165260232407)}return t.subarray(0,c)}},{key:"_convertYcckToCmyk",value:function _convertYcckToCmyk(t){for(var r,i,o,a=0,c=t.length;a<c;a+=4){r=t[a];i=t[a+1];o=t[a+2];t[a]=434.456-r-1.402*o;t[a+1]=119.541-r+.344*i+.714*o;t[a+2]=481.816-r-1.772*i}return t}},{key:"_convertCmykToRgb",value:function _convertCmykToRgb(t){for(var r,i,o,a,c=0,l=0,u=t.length;l<u;l+=4){r=t[l];i=t[l+1];o=t[l+2];a=t[l+3];t[c++]=255+r*(-6747147073602441e-20*r+.0008379262121013727*i+.0002894718188643294*o+.003264231057537806*a-1.1185611867203937)+i*(26374107616089405e-21*i-8626949158638572e-20*o-.0002748769067499491*a-.02155688794978967)+o*(-3878099212869363e-20*o-.0003267808279485286*a+.0686742238595345)-a*(.0003361971776183937*a+.7430659151342254);t[c++]=255+r*(.00013596372813588848*r+.000924537132573585*i+.00010567359618683593*o+.0004791864687436512*a-.3109689587515875)+i*(-.00023545346108370344*i+.0002702845253534714*o+.0020200308977307156*a-.7488052167015494)+o*(6834815998235662e-20*o+.00015168452363460973*a-.09751927774728933)-a*(.0003189131175883281*a+.7364883807733168);t[c++]=255+r*(13598650411385307e-21*r+.00012423956175490851*i+.0004751985097583589*o-36729317476630422e-22*a-.05562186980264034)+i*(.00016141380598724676*i+.0009692239130725186*o+.0007782692450036253*a-.44015232367526463)+o*(5.068882914068769e-7*o+.0017778369011375071*a-.7591454649749609)-a*(.0003435319965105553*a+.7063770186160144)}return t.subarray(0,c)}},{key:"getData",value:function getData(t){var r=t.width,i=t.height,o=t.forceRGB,a=void 0!==o&&o,l=t.isSourcePDF,u=void 0!==l&&l;if(this.numComponents>4)throw new c("Unsupported color mode");var h=this._getLinearizedBlockData(r,i,u);if(1===this.numComponents&&a){for(var p=h.length,d=new Uint8ClampedArray(3*p),y=0,v=0;v<p;v++){var m=h[v];d[y++]=m;d[y++]=m;d[y++]=m}return d}if(3===this.numComponents&&this._isColorConversionNeeded)return this._convertYccToRgb(h);if(4===this.numComponents){if(this._isColorConversionNeeded)return a?this._convertYcckToRgb(h):this._convertYcckToCmyk(h);if(a)return this._convertCmykToRgb(h)}return h}}]);return JpegImage}();r.JpegImage=x},(t,r,i)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.JpxImage=void 0;var o=i(1),a=i(87),c=i(90);function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,i){r&&_defineProperties(t.prototype,r);i&&_defineProperties(t,i);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var i,o=_getPrototypeOf(t);if(r){var a=_getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var l=function(t){_inherits(JpxError,t);var r=_createSuper(JpxError);function JpxError(t){_classCallCheck(this,JpxError);return r.call(this,"JPX error: ".concat(t),"JpxError")}return _createClass(JpxError)}(o.BaseException),u={LL:0,LH:1,HL:1,HH:2},h=function(){function JpxImage(){_classCallCheck(this,JpxImage);this.failOnCorruptedImage=!1}_createClass(JpxImage,[{key:"parse",value:function parse(t){if(65359!==(0,a.readUint16)(t,0))for(var r=t.length,i=0;i<r;){var c=8,u=(0,a.readUint32)(t,i),h=(0,a.readUint32)(t,i+4);i+=c;if(1===u){u=4294967296*(0,a.readUint32)(t,i)+(0,a.readUint32)(t,i+4);i+=8;c+=8}0===u&&(u=r-i+c);if(u<c)throw new l("Invalid box field size");var p=u-c,d=!0;switch(h){case 1785737832:d=!1;break;case 1668246642:var y=t[i];if(1===y){var v=(0,a.readUint32)(t,i+3);switch(v){case 16:case 17:case 18:break;default:(0,o.warn)("Unknown colorspace "+v)}}else 2===y&&(0,o.info)("ICC profile not supported");break;case 1785737827:this.parseCodestream(t,i,i+p);break;case 1783636e3:218793738!==(0,a.readUint32)(t,i)&&(0,o.warn)("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var m=String.fromCharCode(h>>24&255,h>>16&255,h>>8&255,255&h);(0,o.warn)("Unsupported header type ".concat(h," (").concat(m,")."))}d&&(i+=p)}else this.parseCodestream(t,0,t.length)}},{key:"parseImageProperties",value:function parseImageProperties(t){for(var r=t.getByte();r>=0;){if(65361===(r<<8|(r=t.getByte()))){t.skip(4);var i=t.getInt32()>>>0,o=t.getInt32()>>>0,a=t.getInt32()>>>0,c=t.getInt32()>>>0;t.skip(16);var u=t.getUint16();this.width=i-a;this.height=o-c;this.componentsCount=u;this.bitsPerComponent=8;return}}throw new l("No size marker found in JPX stream")}},{key:"parseCodestream",value:function parseCodestream(t,r,i){var c={},u=!1;try{for(var h=r;h+1<i;){var p=(0,a.readUint16)(t,h);h+=2;var d=0,y=void 0,v=void 0,m=void 0,g=void 0,b=void 0,_=void 0;switch(p){case 65359:c.mainHeader=!0;break;case 65497:break;case 65361:d=(0,a.readUint16)(t,h);var x={};x.Xsiz=(0,a.readUint32)(t,h+4);x.Ysiz=(0,a.readUint32)(t,h+8);x.XOsiz=(0,a.readUint32)(t,h+12);x.YOsiz=(0,a.readUint32)(t,h+16);x.XTsiz=(0,a.readUint32)(t,h+20);x.YTsiz=(0,a.readUint32)(t,h+24);x.XTOsiz=(0,a.readUint32)(t,h+28);x.YTOsiz=(0,a.readUint32)(t,h+32);var w=(0,a.readUint16)(t,h+36);x.Csiz=w;var C=[];y=h+38;for(var T=0;T<w;T++){var P={precision:1+(127&t[y]),isSigned:!!(128&t[y]),XRsiz:t[y+1],YRsiz:t[y+2]};y+=3;calculateComponentDimensions(P,x);C.push(P)}c.SIZ=x;c.components=C;calculateTileGrids(c,C);c.QCC=[];c.COC=[];break;case 65372:d=(0,a.readUint16)(t,h);var S={};y=h+2;switch(31&(v=t[y++])){case 0:g=8;b=!0;break;case 1:g=16;b=!1;break;case 2:g=16;b=!0;break;default:throw new Error("Invalid SQcd value "+v)}S.noQuantization=8===g;S.scalarExpounded=b;S.guardBits=v>>5;m=[];for(;y<d+h;){var k={};if(8===g){k.epsilon=t[y++]>>3;k.mu=0}else{k.epsilon=t[y]>>3;k.mu=(7&t[y])<<8|t[y+1];y+=2}m.push(k)}S.SPqcds=m;if(c.mainHeader)c.QCD=S;else{c.currentTile.QCD=S;c.currentTile.QCC=[]}break;case 65373:d=(0,a.readUint16)(t,h);var I={};y=h+2;var O=void 0;if(c.SIZ.Csiz<257)O=t[y++];else{O=(0,a.readUint16)(t,y);y+=2}switch(31&(v=t[y++])){case 0:g=8;b=!0;break;case 1:g=16;b=!1;break;case 2:g=16;b=!0;break;default:throw new Error("Invalid SQcd value "+v)}I.noQuantization=8===g;I.scalarExpounded=b;I.guardBits=v>>5;m=[];for(;y<d+h;){var E={};if(8===g){E.epsilon=t[y++]>>3;E.mu=0}else{E.epsilon=t[y]>>3;E.mu=(7&t[y])<<8|t[y+1];y+=2}m.push(E)}I.SPqcds=m;c.mainHeader?c.QCC[O]=I:c.currentTile.QCC[O]=I;break;case 65362:d=(0,a.readUint16)(t,h);var A={};y=h+2;var R=t[y++];A.entropyCoderWithCustomPrecincts=!!(1&R);A.sopMarkerUsed=!!(2&R);A.ephMarkerUsed=!!(4&R);A.progressionOrder=t[y++];A.layersCount=(0,a.readUint16)(t,y);y+=2;A.multipleComponentTransform=t[y++];A.decompositionLevelsCount=t[y++];A.xcb=2+(15&t[y++]);A.ycb=2+(15&t[y++]);var B=t[y++];A.selectiveArithmeticCodingBypass=!!(1&B);A.resetContextProbabilities=!!(2&B);A.terminationOnEachCodingPass=!!(4&B);A.verticallyStripe=!!(8&B);A.predictableTermination=!!(16&B);A.segmentationSymbolUsed=!!(32&B);A.reversibleTransformation=t[y++];if(A.entropyCoderWithCustomPrecincts){for(var D=[];y<d+h;){var L=t[y++];D.push({PPx:15&L,PPy:L>>4})}A.precinctsSizes=D}var M=[];A.selectiveArithmeticCodingBypass&&M.push("selectiveArithmeticCodingBypass");A.terminationOnEachCodingPass&&M.push("terminationOnEachCodingPass");A.verticallyStripe&&M.push("verticallyStripe");A.predictableTermination&&M.push("predictableTermination");if(M.length>0){u=!0;(0,o.warn)("JPX: Unsupported COD options (".concat(M.join(", "),")."))}if(c.mainHeader)c.COD=A;else{c.currentTile.COD=A;c.currentTile.COC=[]}break;case 65424:d=(0,a.readUint16)(t,h);(_={}).index=(0,a.readUint16)(t,h+2);_.length=(0,a.readUint32)(t,h+4);_.dataEnd=_.length+h-2;_.partIndex=t[h+8];_.partsCount=t[h+9];c.mainHeader=!1;if(0===_.partIndex){_.COD=c.COD;_.COC=c.COC.slice(0);_.QCD=c.QCD;_.QCC=c.QCC.slice(0)}c.currentTile=_;break;case 65427:if(0===(_=c.currentTile).partIndex){initializeTile(c,_.index);buildPackets(c)}parseTilePackets(c,t,h,d=_.dataEnd-h);break;case 65363:(0,o.warn)("JPX: Codestream code 0xFF53 (COC) is not implemented.");case 65365:case 65367:case 65368:case 65380:d=(0,a.readUint16)(t,h);break;default:throw new Error("Unknown codestream code: "+p.toString(16))}h+=d}}catch(t){if(u||this.failOnCorruptedImage)throw new l(t.message);(0,o.warn)('JPX: Trying to recover from: "'.concat(t.message,'".'))}this.tiles=function transformComponents(t){for(var r=t.SIZ,i=t.components,o=r.Csiz,a=[],c=0,l=t.tiles.length;c<l;c++){for(var u=t.tiles[c],h=[],p=0;p<o;p++)h[p]=transformTile(t,u,p);var d=h[0],y=new Uint8ClampedArray(d.items.length*o),v={left:d.left,top:d.top,width:d.width,height:d.height,items:y},m=void 0,g=void 0,b=0,_=void 0,x=void 0,w=void 0,C=void 0,T=void 0;if(u.codingStyleDefaultParameters.multipleComponentTransform){var P=4===o,S=h[0].items,k=h[1].items,I=h[2].items,O=P?h[3].items:null;g=.5+(128<<(m=i[0].precision-8));var E=u.components[0],A=o-3;x=S.length;if(E.codingStyleParameters.reversibleTransformation)for(_=0;_<x;_++,b+=A){w=S[_]+g;C=k[_];var R=w-((T=I[_])+C>>2);y[b++]=R+T>>m;y[b++]=R>>m;y[b++]=R+C>>m}else for(_=0;_<x;_++,b+=A){w=S[_]+g;C=k[_];T=I[_];y[b++]=w+1.402*T>>m;y[b++]=w-.34413*C-.71414*T>>m;y[b++]=w+1.772*C>>m}if(P)for(_=0,b=3;_<x;_++,b+=4)y[b]=O[_]+g>>m}else for(var B=0;B<o;B++){var D=h[B].items;g=.5+(128<<(m=i[B].precision-8));for(b=B,_=0,x=D.length;_<x;_++){y[b]=D[_]+g>>m;b+=o}}a.push(v)}return a}(c);this.width=c.SIZ.Xsiz-c.SIZ.XOsiz;this.height=c.SIZ.Ysiz-c.SIZ.YOsiz;this.componentsCount=c.SIZ.Csiz}}]);return JpxImage}();r.JpxImage=h;function calculateComponentDimensions(t,r){t.x0=Math.ceil(r.XOsiz/t.XRsiz);t.x1=Math.ceil(r.Xsiz/t.XRsiz);t.y0=Math.ceil(r.YOsiz/t.YRsiz);t.y1=Math.ceil(r.Ysiz/t.YRsiz);t.width=t.x1-t.x0;t.height=t.y1-t.y0}function calculateTileGrids(t,r){for(var i,o=t.SIZ,a=[],c=Math.ceil((o.Xsiz-o.XTOsiz)/o.XTsiz),l=Math.ceil((o.Ysiz-o.YTOsiz)/o.YTsiz),u=0;u<l;u++)for(var h=0;h<c;h++){(i={}).tx0=Math.max(o.XTOsiz+h*o.XTsiz,o.XOsiz);i.ty0=Math.max(o.YTOsiz+u*o.YTsiz,o.YOsiz);i.tx1=Math.min(o.XTOsiz+(h+1)*o.XTsiz,o.Xsiz);i.ty1=Math.min(o.YTOsiz+(u+1)*o.YTsiz,o.Ysiz);i.width=i.tx1-i.tx0;i.height=i.ty1-i.ty0;i.components=[];a.push(i)}t.tiles=a;for(var p=0,d=o.Csiz;p<d;p++)for(var y=r[p],v=0,m=a.length;v<m;v++){var g={};i=a[v];g.tcx0=Math.ceil(i.tx0/y.XRsiz);g.tcy0=Math.ceil(i.ty0/y.YRsiz);g.tcx1=Math.ceil(i.tx1/y.XRsiz);g.tcy1=Math.ceil(i.ty1/y.YRsiz);g.width=g.tcx1-g.tcx0;g.height=g.tcy1-g.tcy0;i.components[p]=g}}function getBlocksDimensions(t,r,i){var o=r.codingStyleParameters,a={};if(o.entropyCoderWithCustomPrecincts){a.PPx=o.precinctsSizes[i].PPx;a.PPy=o.precinctsSizes[i].PPy}else{a.PPx=15;a.PPy=15}a.xcb_=i>0?Math.min(o.xcb,a.PPx-1):Math.min(o.xcb,a.PPx);a.ycb_=i>0?Math.min(o.ycb,a.PPy-1):Math.min(o.ycb,a.PPy);return a}function buildPrecincts(t,r,i){var o=1<<i.PPx,a=1<<i.PPy,c=0===r.resLevel,l=1<<i.PPx+(c?0:-1),u=1<<i.PPy+(c?0:-1),h=r.trx1>r.trx0?Math.ceil(r.trx1/o)-Math.floor(r.trx0/o):0,p=r.try1>r.try0?Math.ceil(r.try1/a)-Math.floor(r.try0/a):0,d=h*p;r.precinctParameters={precinctWidth:o,precinctHeight:a,numprecinctswide:h,numprecinctshigh:p,numprecincts:d,precinctWidthInSubband:l,precinctHeightInSubband:u}}function buildCodeblocks(t,r,i){var o,a,c,l,u=i.xcb_,h=i.ycb_,p=1<<u,d=1<<h,y=r.tbx0>>u,v=r.tby0>>h,m=r.tbx1+p-1>>u,g=r.tby1+d-1>>h,b=r.resolution.precinctParameters,_=[],x=[];for(a=v;a<g;a++)for(o=y;o<m;o++){(c={cbx:o,cby:a,tbx0:p*o,tby0:d*a,tbx1:p*(o+1),tby1:d*(a+1)}).tbx0_=Math.max(r.tbx0,c.tbx0);c.tby0_=Math.max(r.tby0,c.tby0);c.tbx1_=Math.min(r.tbx1,c.tbx1);c.tby1_=Math.min(r.tby1,c.tby1);l=Math.floor((c.tbx0_-r.tbx0)/b.precinctWidthInSubband)+Math.floor((c.tby0_-r.tby0)/b.precinctHeightInSubband)*b.numprecinctswide;c.precinctNumber=l;c.subbandType=r.type;c.Lblock=3;if(!(c.tbx1_<=c.tbx0_||c.tby1_<=c.tby0_)){_.push(c);var w=x[l];if(void 0!==w){o<w.cbxMin?w.cbxMin=o:o>w.cbxMax&&(w.cbxMax=o);a<w.cbyMin?w.cbxMin=a:a>w.cbyMax&&(w.cbyMax=a)}else x[l]=w={cbxMin:o,cbyMin:a,cbxMax:o,cbyMax:a};c.precinct=w}}r.codeblockParameters={codeblockWidth:u,codeblockHeight:h,numcodeblockwide:m-y+1,numcodeblockhigh:g-v+1};r.codeblocks=_;r.precincts=x}function createPacket(t,r,i){for(var o=[],a=t.subbands,c=0,l=a.length;c<l;c++)for(var u=a[c].codeblocks,h=0,p=u.length;h<p;h++){var d=u[h];d.precinctNumber===r&&o.push(d)}return{layerNumber:i,codeblocks:o}}function LayerResolutionComponentPositionIterator(t){for(var r=t.SIZ,i=t.currentTile.index,o=t.tiles[i],a=o.codingStyleDefaultParameters.layersCount,c=r.Csiz,u=0,h=0;h<c;h++)u=Math.max(u,o.components[h].codingStyleParameters.decompositionLevelsCount);var p=0,d=0,y=0,v=0;this.nextPacket=function JpxImage_nextPacket(){for(;p<a;p++){for(;d<=u;d++){for(;y<c;y++){var t=o.components[y];if(!(d>t.codingStyleParameters.decompositionLevelsCount)){for(var r=t.resolutions[d],i=r.precinctParameters.numprecincts;v<i;){var h=createPacket(r,v,p);v++;return h}v=0}}y=0}d=0}throw new l("Out of packets")}}function ResolutionLayerComponentPositionIterator(t){for(var r=t.SIZ,i=t.currentTile.index,o=t.tiles[i],a=o.codingStyleDefaultParameters.layersCount,c=r.Csiz,u=0,h=0;h<c;h++)u=Math.max(u,o.components[h].codingStyleParameters.decompositionLevelsCount);var p=0,d=0,y=0,v=0;this.nextPacket=function JpxImage_nextPacket(){for(;p<=u;p++){for(;d<a;d++){for(;y<c;y++){var t=o.components[y];if(!(p>t.codingStyleParameters.decompositionLevelsCount)){for(var r=t.resolutions[p],i=r.precinctParameters.numprecincts;v<i;){var h=createPacket(r,v,d);v++;return h}v=0}}y=0}d=0}throw new l("Out of packets")}}function ResolutionPositionComponentLayerIterator(t){var r,i,o,a,c=t.SIZ,u=t.currentTile.index,h=t.tiles[u],p=h.codingStyleDefaultParameters.layersCount,d=c.Csiz,y=0;for(o=0;o<d;o++){var v=h.components[o];y=Math.max(y,v.codingStyleParameters.decompositionLevelsCount)}var m=new Int32Array(y+1);for(i=0;i<=y;++i){var g=0;for(o=0;o<d;++o){var b=h.components[o].resolutions;i<b.length&&(g=Math.max(g,b[i].precinctParameters.numprecincts))}m[i]=g}r=0;i=0;o=0;a=0;this.nextPacket=function JpxImage_nextPacket(){for(;i<=y;i++){for(;a<m[i];a++){for(;o<d;o++){var t=h.components[o];if(!(i>t.codingStyleParameters.decompositionLevelsCount)){var c=t.resolutions[i],u=c.precinctParameters.numprecincts;if(!(a>=u)){for(;r<p;){var v=createPacket(c,a,r);r++;return v}r=0}}}o=0}a=0}throw new l("Out of packets")}}function PositionComponentResolutionLayerIterator(t){var r=t.SIZ,i=t.currentTile.index,o=t.tiles[i],a=o.codingStyleDefaultParameters.layersCount,c=r.Csiz,u=getPrecinctSizesInImageScale(o),h=u,p=0,d=0,y=0,v=0,m=0;this.nextPacket=function JpxImage_nextPacket(){for(;m<h.maxNumHigh;m++){for(;v<h.maxNumWide;v++){for(;y<c;y++){for(var t=o.components[y],r=t.codingStyleParameters.decompositionLevelsCount;d<=r;d++){var i=t.resolutions[d],g=u.components[y].resolutions[d],b=getPrecinctIndexIfExist(v,m,g,h,i);if(null!==b){for(;p<a;){var _=createPacket(i,b,p);p++;return _}p=0}}d=0}y=0}v=0}throw new l("Out of packets")}}function ComponentPositionResolutionLayerIterator(t){var r=t.SIZ,i=t.currentTile.index,o=t.tiles[i],a=o.codingStyleDefaultParameters.layersCount,c=r.Csiz,u=getPrecinctSizesInImageScale(o),h=0,p=0,d=0,y=0,v=0;this.nextPacket=function JpxImage_nextPacket(){for(;d<c;++d){for(var t=o.components[d],r=u.components[d],i=t.codingStyleParameters.decompositionLevelsCount;v<r.maxNumHigh;v++){for(;y<r.maxNumWide;y++){for(;p<=i;p++){var m=t.resolutions[p],g=r.resolutions[p],b=getPrecinctIndexIfExist(y,v,g,r,m);if(null!==b){for(;h<a;){var _=createPacket(m,b,h);h++;return _}h=0}}p=0}y=0}v=0}throw new l("Out of packets")}}function getPrecinctIndexIfExist(t,r,i,o,a){var c=t*o.minWidth,l=r*o.minHeight;if(c%i.width!=0||l%i.height!=0)return null;var u=l/i.width*a.precinctParameters.numprecinctswide;return c/i.height+u}function getPrecinctSizesInImageScale(t){for(var r=t.components.length,i=Number.MAX_VALUE,o=Number.MAX_VALUE,a=0,c=0,l=new Array(r),u=0;u<r;u++){for(var h=t.components[u],p=h.codingStyleParameters.decompositionLevelsCount,d=new Array(p+1),y=Number.MAX_VALUE,v=Number.MAX_VALUE,m=0,g=0,b=1,_=p;_>=0;--_){var x=h.resolutions[_],w=b*x.precinctParameters.precinctWidth,C=b*x.precinctParameters.precinctHeight;y=Math.min(y,w);v=Math.min(v,C);m=Math.max(m,x.precinctParameters.numprecinctswide);g=Math.max(g,x.precinctParameters.numprecinctshigh);d[_]={width:w,height:C};b<<=1}i=Math.min(i,y);o=Math.min(o,v);a=Math.max(a,m);c=Math.max(c,g);l[u]={resolutions:d,minWidth:y,minHeight:v,maxNumWide:m,maxNumHigh:g}}return{components:l,minWidth:i,minHeight:o,maxNumWide:a,maxNumHigh:c}}function buildPackets(t){for(var r=t.SIZ,i=t.currentTile.index,o=t.tiles[i],a=r.Csiz,c=0;c<a;c++){for(var u=o.components[c],h=u.codingStyleParameters.decompositionLevelsCount,p=[],d=[],y=0;y<=h;y++){var v=getBlocksDimensions(0,u,y),m={},g=1<<h-y;m.trx0=Math.ceil(u.tcx0/g);m.try0=Math.ceil(u.tcy0/g);m.trx1=Math.ceil(u.tcx1/g);m.try1=Math.ceil(u.tcy1/g);m.resLevel=y;buildPrecincts(0,m,v);p.push(m);var b=void 0;if(0===y){(b={}).type="LL";b.tbx0=Math.ceil(u.tcx0/g);b.tby0=Math.ceil(u.tcy0/g);b.tbx1=Math.ceil(u.tcx1/g);b.tby1=Math.ceil(u.tcy1/g);b.resolution=m;buildCodeblocks(0,b,v);d.push(b);m.subbands=[b]}else{var _=1<<h-y+1,x=[];(b={}).type="HL";b.tbx0=Math.ceil(u.tcx0/_-.5);b.tby0=Math.ceil(u.tcy0/_);b.tbx1=Math.ceil(u.tcx1/_-.5);b.tby1=Math.ceil(u.tcy1/_);b.resolution=m;buildCodeblocks(0,b,v);d.push(b);x.push(b);(b={}).type="LH";b.tbx0=Math.ceil(u.tcx0/_);b.tby0=Math.ceil(u.tcy0/_-.5);b.tbx1=Math.ceil(u.tcx1/_);b.tby1=Math.ceil(u.tcy1/_-.5);b.resolution=m;buildCodeblocks(0,b,v);d.push(b);x.push(b);(b={}).type="HH";b.tbx0=Math.ceil(u.tcx0/_-.5);b.tby0=Math.ceil(u.tcy0/_-.5);b.tbx1=Math.ceil(u.tcx1/_-.5);b.tby1=Math.ceil(u.tcy1/_-.5);b.resolution=m;buildCodeblocks(0,b,v);d.push(b);x.push(b);m.subbands=x}}u.resolutions=p;u.subbands=d}var w=o.codingStyleDefaultParameters.progressionOrder;switch(w){case 0:o.packetsIterator=new LayerResolutionComponentPositionIterator(t);break;case 1:o.packetsIterator=new ResolutionLayerComponentPositionIterator(t);break;case 2:o.packetsIterator=new ResolutionPositionComponentLayerIterator(t);break;case 3:o.packetsIterator=new PositionComponentResolutionLayerIterator(t);break;case 4:o.packetsIterator=new ComponentPositionResolutionLayerIterator(t);break;default:throw new l("Unsupported progression order ".concat(w))}}function parseTilePackets(t,r,i,o){var c,u=0,h=0,y=!1;function readBits(t){for(;h<t;){var o=r[i+u];u++;if(y){c=c<<7|o;h+=7;y=!1}else{c=c<<8|o;h+=8}255===o&&(y=!0)}return c>>>(h-=t)&(1<<t)-1}function skipMarkerIfEqual(t){if(255===r[i+u-1]&&r[i+u]===t){skipBytes(1);return!0}if(255===r[i+u]&&r[i+u+1]===t){skipBytes(2);return!0}return!1}function skipBytes(t){u+=t}function alignToByte(){h=0;if(y){u++;y=!1}}function readCodingpasses(){if(0===readBits(1))return 1;if(0===readBits(1))return 2;var t=readBits(2);return t<3?t+3:(t=readBits(5))<31?t+6:(t=readBits(7))+37}for(var v=t.currentTile.index,m=t.tiles[v],g=t.COD.sopMarkerUsed,b=t.COD.ephMarkerUsed,_=m.packetsIterator;u<o;){alignToByte();g&&skipMarkerIfEqual(145)&&skipBytes(4);var x=_.nextPacket();if(readBits(1)){for(var w=x.layerNumber,C=[],T=void 0,P=0,S=x.codeblocks.length;P<S;P++){var k=(T=x.codeblocks[P]).precinct,I=T.cbx-k.cbxMin,O=T.cby-k.cbyMin,E=!1,A=!1,R=void 0;if(void 0!==T.included)E=!!readBits(1);else{var B=void 0;if(void 0!==(k=T.precinct).inclusionTree)B=k.inclusionTree;else{var D=k.cbxMax-k.cbxMin+1,L=k.cbyMax-k.cbyMin+1;B=new d(D,L,w);R=new p(D,L);k.inclusionTree=B;k.zeroBitPlanesTree=R;for(var M=0;M<w;M++)if(0!==readBits(1))throw new l("Invalid tag tree")}if(B.reset(I,O,w))for(;;){if(!readBits(1)){B.incrementValue(w);break}if(!B.nextLevel()){T.included=!0;E=A=!0;break}}}if(E){if(A){(R=k.zeroBitPlanesTree).reset(I,O);for(;;)if(readBits(1)){if(!R.nextLevel())break}else R.incrementValue();T.zeroBitPlanes=R.value}for(var N=readCodingpasses();readBits(1);)T.Lblock++;var U=(0,a.log2)(N),j=readBits((N<1<<U?U-1:U)+T.Lblock);C.push({codeblock:T,codingpasses:N,dataLength:j})}}alignToByte();b&&skipMarkerIfEqual(146);for(;C.length>0;){var H=C.shift();void 0===(T=H.codeblock).data&&(T.data=[]);T.data.push({data:r,start:i+u,end:i+u+H.dataLength,codingpasses:H.codingpasses});u+=H.dataLength}}}return u}function copyCoefficients(t,r,i,o,a,l,u,h,p){for(var d=o.tbx0,v=o.tby0,m=o.tbx1-o.tbx0,g=o.codeblocks,b="H"===o.type.charAt(0)?1:0,_="H"===o.type.charAt(1)?r:0,x=0,w=g.length;x<w;++x){var C=g[x],T=C.tbx1_-C.tbx0_,P=C.tby1_-C.tby0_;if(0!==T&&0!==P&&void 0!==C.data){var S=new y(T,P,C.subbandType,C.zeroBitPlanes,l),k=2,I=C.data,O=0,E=0,A=void 0,R=void 0,B=void 0;for(A=0,R=I.length;A<R;A++){O+=(B=I[A]).end-B.start;E+=B.codingpasses}var D=new Uint8Array(O),L=0;for(A=0,R=I.length;A<R;A++){var M=(B=I[A]).data.subarray(B.start,B.end);D.set(M,L);L+=M.length}var N=new c.ArithmeticDecoder(D,0,O);S.setDecoder(N);for(A=0;A<E;A++){switch(k){case 0:S.runSignificancePropagationPass();break;case 1:S.runMagnitudeRefinementPass();break;case 2:S.runCleanupPass();h&&S.checkSegmentationSymbol()}p&&S.reset();k=(k+1)%3}var U=C.tbx0_-d+(C.tby0_-v)*m,j=S.coefficentsSign,H=S.coefficentsMagnitude,z=S.bitsDecoded,X=u?0:.5,Y=void 0,G=void 0,W=void 0;L=0;var J="LL"!==o.type;for(A=0;A<P;A++){var q=2*(U/m|0)*(r-m)+b+_;for(Y=0;Y<T;Y++){if(0!==(G=H[L])){G=(G+X)*a;0!==j[L]&&(G=-G);W=z[L];var V=J?q+(U<<1):U;t[V]=u&&W>=l?G:G*(1<<l-W)}U++;L++}U+=m-T}}}}function transformTile(t,r,i){for(var o=r.components[i],a=o.codingStyleParameters,c=o.quantizationParameters,l=a.decompositionLevelsCount,h=c.SPqcds,p=c.scalarExpounded,d=c.guardBits,y=a.segmentationSymbolUsed,v=a.resetContextProbabilities,b=t.components[i].precision,_=a.reversibleTransformation,x=_?new g:new m,w=[],C=0,T=0;T<=l;T++){for(var P=o.resolutions[T],S=P.trx1-P.trx0,k=P.try1-P.try0,I=new Float32Array(S*k),O=0,E=P.subbands.length;O<E;O++){var A=void 0,R=void 0;if(p){A=h[C].mu;R=h[C].epsilon;C++}else{A=h[0].mu;R=h[0].epsilon+(T>0?1-T:0)}var B=P.subbands[O],D=u[B.type];copyCoefficients(I,S,0,B,_?1:Math.pow(2,b+D-R)*(1+A/2048),d+R-1,_,y,v)}w.push({width:S,height:k,items:I})}var L=x.calculate(w,o.tcx0,o.tcy0);return{left:o.tcx0,top:o.tcy0,width:L.width,height:L.height,items:L.items}}function initializeTile(t,r){for(var i=t.SIZ.Csiz,o=t.tiles[r],a=0;a<i;a++){var c=o.components[a],l=void 0!==t.currentTile.QCC[a]?t.currentTile.QCC[a]:t.currentTile.QCD;c.quantizationParameters=l;var u=void 0!==t.currentTile.COC[a]?t.currentTile.COC[a]:t.currentTile.COD;c.codingStyleParameters=u}o.codingStyleDefaultParameters=t.currentTile.COD}var p=function(){function TagTree(t,r){_classCallCheck(this,TagTree);var i=(0,a.log2)(Math.max(t,r))+1;this.levels=[];for(var o=0;o<i;o++){var c={width:t,height:r,items:[]};this.levels.push(c);t=Math.ceil(t/2);r=Math.ceil(r/2)}}_createClass(TagTree,[{key:"reset",value:function reset(t,r){for(var i,o=0,a=0;o<this.levels.length;){var c=t+r*(i=this.levels[o]).width;if(void 0!==i.items[c]){a=i.items[c];break}i.index=c;t>>=1;r>>=1;o++}o--;(i=this.levels[o]).items[i.index]=a;this.currentLevel=o;delete this.value}},{key:"incrementValue",value:function incrementValue(){var t=this.levels[this.currentLevel];t.items[t.index]++}},{key:"nextLevel",value:function nextLevel(){var t=this.currentLevel,r=this.levels[t],i=r.items[r.index];if(--t<0){this.value=i;return!1}this.currentLevel=t;(r=this.levels[t]).items[r.index]=i;return!0}}]);return TagTree}(),d=function(){function InclusionTree(t,r,i){_classCallCheck(this,InclusionTree);var o=(0,a.log2)(Math.max(t,r))+1;this.levels=[];for(var c=0;c<o;c++){for(var l=new Uint8Array(t*r),u=0,h=l.length;u<h;u++)l[u]=i;var p={width:t,height:r,items:l};this.levels.push(p);t=Math.ceil(t/2);r=Math.ceil(r/2)}}_createClass(InclusionTree,[{key:"reset",value:function reset(t,r,i){for(var o=0;o<this.levels.length;){var a=this.levels[o],c=t+r*a.width;a.index=c;var l=a.items[c];if(255===l)break;if(l>i){this.currentLevel=o;this.propagateValues();return!1}t>>=1;r>>=1;o++}this.currentLevel=o-1;return!0}},{key:"incrementValue",value:function incrementValue(t){var r=this.levels[this.currentLevel];r.items[r.index]=t+1;this.propagateValues()}},{key:"propagateValues",value:function propagateValues(){for(var t=this.currentLevel,r=this.levels[t],i=r.items[r.index];--t>=0;)(r=this.levels[t]).items[r.index]=i}},{key:"nextLevel",value:function nextLevel(){var t=this.currentLevel,r=this.levels[t],i=r.items[r.index];r.items[r.index]=255;if(--t<0)return!1;this.currentLevel=t;(r=this.levels[t]).items[r.index]=i;return!0}}]);return InclusionTree}(),y=function BitModelClosure(){var t=17,r=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),i=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]),o=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]);return function(){function BitModel(t,a,c,l,u){_classCallCheck(this,BitModel);this.width=t;this.height=a;var h;h="HH"===c?o:"HL"===c?i:r;this.contextLabelTable=h;var p,d=t*a;this.neighborsSignificance=new Uint8Array(d);this.coefficentsSign=new Uint8Array(d);p=u>14?new Uint32Array(d):u>6?new Uint16Array(d):new Uint8Array(d);this.coefficentsMagnitude=p;this.processingFlags=new Uint8Array(d);var y=new Uint8Array(d);if(0!==l)for(var v=0;v<d;v++)y[v]=l;this.bitsDecoded=y;this.reset()}_createClass(BitModel,[{key:"setDecoder",value:function setDecoder(t){this.decoder=t}},{key:"reset",value:function reset(){this.contexts=new Int8Array(19);this.contexts[0]=8;this.contexts[17]=92;this.contexts[18]=6}},{key:"setNeighborsSignificance",value:function setNeighborsSignificance(t,r,i){var o,a=this.neighborsSignificance,c=this.width,l=this.height,u=r>0,h=r+1<c;if(t>0){o=i-c;u&&(a[o-1]+=16);h&&(a[o+1]+=16);a[o]+=4}if(t+1<l){o=i+c;u&&(a[o-1]+=16);h&&(a[o+1]+=16);a[o]+=4}u&&(a[i-1]+=1);h&&(a[i+1]+=1);a[i]|=128}},{key:"runSignificancePropagationPass",value:function runSignificancePropagationPass(){for(var t=this.decoder,r=this.width,i=this.height,o=this.coefficentsMagnitude,a=this.coefficentsSign,c=this.neighborsSignificance,l=this.processingFlags,u=this.contexts,h=this.contextLabelTable,p=this.bitsDecoded,d=0;d<i;d+=4)for(var y=0;y<r;y++)for(var v=d*r+y,m=0;m<4;m++,v+=r){var g=d+m;if(g>=i)break;l[v]&=-2;if(!o[v]&&c[v]){var b=h[c[v]];if(t.readBit(u,b)){var _=this.decodeSignBit(g,y,v);a[v]=_;o[v]=1;this.setNeighborsSignificance(g,y,v);l[v]|=2}p[v]++;l[v]|=1}}}},{key:"decodeSignBit",value:function decodeSignBit(t,r,i){var o,a,c,l,u,h,p=this.width,d=this.height,y=this.coefficentsMagnitude,v=this.coefficentsSign;l=r>0&&0!==y[i-1];if(r+1<p&&0!==y[i+1]){c=v[i+1];o=l?1-c-(a=v[i-1]):1-c-c}else o=l?1-(a=v[i-1])-a:0;var m=3*o;l=t>0&&0!==y[i-p];if(t+1<d&&0!==y[i+p]){c=v[i+p];o=l?1-c-(a=v[i-p])+m:1-c-c+m}else o=l?1-(a=v[i-p])-a+m:m;if(o>=0){u=9+o;h=this.decoder.readBit(this.contexts,u)}else{u=9-o;h=1^this.decoder.readBit(this.contexts,u)}return h}},{key:"runMagnitudeRefinementPass",value:function runMagnitudeRefinementPass(){for(var t,r=this.decoder,i=this.width,o=this.height,a=this.coefficentsMagnitude,c=this.neighborsSignificance,l=this.contexts,u=this.bitsDecoded,h=this.processingFlags,p=i*o,d=4*i,y=0;y<p;y=t){t=Math.min(p,y+d);for(var v=0;v<i;v++)for(var m=y+v;m<t;m+=i)if(a[m]&&0==(1&h[m])){var g=16;if(0!=(2&h[m])){h[m]^=2;g=0===(127&c[m])?15:14}var b=r.readBit(l,g);a[m]=a[m]<<1|b;u[m]++;h[m]|=1}}}},{key:"runCleanupPass",value:function runCleanupPass(){for(var r,i=this.decoder,o=this.width,a=this.height,c=this.neighborsSignificance,l=this.coefficentsMagnitude,u=this.coefficentsSign,h=this.contexts,p=this.contextLabelTable,d=this.bitsDecoded,y=this.processingFlags,v=o,m=2*o,g=3*o,b=0;b<a;b=r){r=Math.min(b+4,a);for(var _=b*o,x=b+3<a,w=0;w<o;w++){var C=_+w,T=0,P=C,S=b,k=void 0;if(x&&0===y[C]&&0===y[C+v]&&0===y[C+m]&&0===y[C+g]&&0===c[C]&&0===c[C+v]&&0===c[C+m]&&0===c[C+g]){if(!i.readBit(h,18)){d[C]++;d[C+v]++;d[C+m]++;d[C+g]++;continue}if(0!==(T=i.readBit(h,t)<<1|i.readBit(h,t))){S=b+T;P+=T*o}k=this.decodeSignBit(S,w,P);u[P]=k;l[P]=1;this.setNeighborsSignificance(S,w,P);y[P]|=2;P=C;for(var I=b;I<=S;I++,P+=o)d[P]++;T++}for(S=b+T;S<r;S++,P+=o)if(!l[P]&&0==(1&y[P])){var O=p[c[P]];if(1===i.readBit(h,O)){k=this.decodeSignBit(S,w,P);u[P]=k;l[P]=1;this.setNeighborsSignificance(S,w,P);y[P]|=2}d[P]++}}}}},{key:"checkSegmentationSymbol",value:function checkSegmentationSymbol(){var r=this.decoder,i=this.contexts;if(10!==(r.readBit(i,t)<<3|r.readBit(i,t)<<2|r.readBit(i,t)<<1|r.readBit(i,t)))throw new l("Invalid segmentation symbol")}}]);return BitModel}()}(),v=function(){function Transform(){_classCallCheck(this,Transform);this.constructor===Transform&&(0,o.unreachable)("Cannot initialize Transform.")}_createClass(Transform,[{key:"calculate",value:function calculate(t,r,i){for(var o=t[0],a=1,c=t.length;a<c;a++)o=this.iterate(o,t[a],r,i);return o}},{key:"extend",value:function extend(t,r,i){var o=r-1,a=r+1,c=r+i-2,l=r+i;t[o--]=t[a++];t[l++]=t[c--];t[o--]=t[a++];t[l++]=t[c--];t[o--]=t[a++];t[l++]=t[c--];t[o]=t[a];t[l]=t[c]}},{key:"filter",value:function filter(t,r,i){(0,o.unreachable)("Abstract method `filter` called")}},{key:"iterate",value:function iterate(t,r,i,o){var a,c,l,u,h,p,d=t.width,y=t.height,v=t.items,m=r.width,g=r.height,b=r.items;for(l=0,a=0;a<y;a++){u=2*a*m;for(c=0;c<d;c++,l++,u+=2)b[u]=v[l]}v=t.items=null;var _=new Float32Array(m+8);if(1===m){if(0!=(1&i))for(p=0,l=0;p<g;p++,l+=m)b[l]*=.5}else for(p=0,l=0;p<g;p++,l+=m){_.set(b.subarray(l,l+m),4);this.extend(_,4,m);this.filter(_,4,m);b.set(_.subarray(4,4+m),l)}var x=16,w=[];for(a=0;a<x;a++)w.push(new Float32Array(g+8));var C,T=0;t=4+g;if(1===g){if(0!=(1&o))for(h=0;h<m;h++)b[h]*=.5}else for(h=0;h<m;h++){if(0===T){x=Math.min(m-h,x);for(l=h,u=4;u<t;l+=m,u++)for(C=0;C<x;C++)w[C][u]=b[l+C];T=x}var P=w[--T];this.extend(P,4,g);this.filter(P,4,g);if(0===T){l=h-x+1;for(u=4;u<t;l+=m,u++)for(C=0;C<x;C++)b[l+C]=w[C][u]}}return{width:m,height:g,items:b}}}]);return Transform}(),m=function(t){_inherits(IrreversibleTransform,t);var r=_createSuper(IrreversibleTransform);function IrreversibleTransform(){_classCallCheck(this,IrreversibleTransform);return r.apply(this,arguments)}_createClass(IrreversibleTransform,[{key:"filter",value:function filter(t,r,i){var o,a,c,l,u=i>>1,h=-1.586134342059924,p=-.052980118572961,d=.882911075530934,y=.443506852043971,v=1.230174104914001;o=(r|=0)-3;for(a=u+4;a--;o+=2)t[o]*=.8128930661159609;c=y*t[(o=r-2)-1];for(a=u+3;a--;o+=2){l=y*t[o+1];t[o]=v*t[o]-c-l;if(!a--)break;c=y*t[(o+=2)+1];t[o]=v*t[o]-c-l}c=d*t[(o=r-1)-1];for(a=u+2;a--;o+=2){l=d*t[o+1];t[o]-=c+l;if(!a--)break;c=d*t[(o+=2)+1];t[o]-=c+l}c=p*t[(o=r)-1];for(a=u+1;a--;o+=2){l=p*t[o+1];t[o]-=c+l;if(!a--)break;c=p*t[(o+=2)+1];t[o]-=c+l}if(0!==u){c=h*t[(o=r+1)-1];for(a=u;a--;o+=2){l=h*t[o+1];t[o]-=c+l;if(!a--)break;c=h*t[(o+=2)+1];t[o]-=c+l}}}}]);return IrreversibleTransform}(v),g=function(t){_inherits(ReversibleTransform,t);var r=_createSuper(ReversibleTransform);function ReversibleTransform(){_classCallCheck(this,ReversibleTransform);return r.apply(this,arguments)}_createClass(ReversibleTransform,[{key:"filter",value:function filter(t,r,i){var o,a,c=i>>1;for(o=r|=0,a=c+1;a--;o+=2)t[o]-=t[o-1]+t[o+1]+2>>2;for(o=r+1,a=c;a--;o+=2)t[o]+=t[o-1]+t[o+1]>>1}}]);return ReversibleTransform}(v)}],r={};function __w_pdfjs_require__(i){var o=r[i];if(void 0!==o)return o.exports;var a=r[i]={exports:{}};t[i](a,a.exports,__w_pdfjs_require__);return a.exports}var i={};(()=>{"use strict";var t=i;Object.defineProperty(t,"__esModule",{value:!0});Object.defineProperty(t,"Jbig2Image",{enumerable:!0,get:function get(){return o.Jbig2Image}});Object.defineProperty(t,"JpegImage",{enumerable:!0,get:function get(){return a.JpegImage}});Object.defineProperty(t,"JpxImage",{enumerable:!0,get:function get(){return c.JpxImage}});Object.defineProperty(t,"getVerbosityLevel",{enumerable:!0,get:function get(){return r.getVerbosityLevel}});Object.defineProperty(t,"setVerbosityLevel",{enumerable:!0,get:function get(){return r.setVerbosityLevel}});var r=__w_pdfjs_require__(1),o=__w_pdfjs_require__(86),a=__w_pdfjs_require__(92),c=__w_pdfjs_require__(93)})();return i})()));
|