@pdftron/pdfjs-express 8.1.1 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/core/22.chunk.js +8 -0
- package/public/core/23.chunk.js +8 -0
- package/public/core/AndroidContentPartRetriever.chunk.js +2 -2
- package/public/core/ArrayBufferPdfPartRetriever.chunk.js +1 -1
- package/public/core/AzurePartRetriever.chunk.js +2 -2
- package/public/core/ContentEdit.chunk.js +27 -0
- package/public/core/ExternalAnnotationMerger.chunk.js +13 -13
- package/public/core/ExternalPdfPartRetriever.chunk.js +6 -6
- package/public/core/HttpPartRetriever.chunk.js +13 -13
- package/public/core/IOSPartRetriever.chunk.js +2 -2
- package/public/core/LocalPartRetriever.chunk.js +4 -4
- package/public/core/LocalPdfPartRetriever.chunk.js +3 -3
- package/public/core/PDFInfoVersion1.chunk.js +16 -16
- package/public/core/SelectionInfoOld.chunk.js +14 -14
- package/public/core/StreamingPartRetriever.chunk.js +9 -9
- package/public/core/WebDBPartRetriever.chunk.js +2 -2
- package/public/core/WebViewerServerPartRetriever.chunk.js +32 -29
- package/public/core/WinRTPartRetriever.chunk.js +2 -2
- package/public/core/external/pikaday.css +1 -1
- package/public/core/external/pikaday.override.css +105 -0
- package/public/core/external/webcomponents-bundle.js +370 -0
- package/public/core/legacyOffice/LegacyOfficeWorker.js +1 -1
- package/public/core/pdfjs/PDFJSDocumentType.js +1414 -987
- package/public/core/pdfjs/pdf.worker.js +605 -602
- package/public/core/pdfjs/pdfjsexpress.asm.js +1 -1
- package/public/core/pdfjs/pdfjsexpress.wasm +0 -0
- package/public/core/pdfjs/pikaday.chunk.js +41 -0
- package/public/core/pdfjs/vendors.pikaday.chunk.js +154 -0
- package/public/core/pikaday.chunk.js +34 -33
- package/public/core/vendors.ascii85.chunk.js +6 -6
- package/public/core/vendors.ascii85.quill.chunk.js +34 -34
- package/public/core/vendors.pako.chunk.js +80 -80
- package/public/core/vendors.quill.chunk.js +421 -421
- package/public/core/webviewer-core.min.js +2671 -2477
- package/public/ui/chunks/10.chunk.js +2 -1
- package/public/ui/chunks/10.chunk.js.map +1 -0
- package/public/ui/chunks/100.chunk.js +2 -1
- package/public/ui/chunks/100.chunk.js.map +1 -0
- package/public/ui/chunks/101.chunk.js +2 -1
- package/public/ui/chunks/101.chunk.js.map +1 -0
- package/public/ui/chunks/102.chunk.js +2 -1
- package/public/ui/chunks/102.chunk.js.map +1 -0
- package/public/ui/chunks/103.chunk.js +2 -1
- package/public/ui/chunks/103.chunk.js.map +1 -0
- package/public/ui/chunks/104.chunk.js +2 -1
- package/public/ui/chunks/104.chunk.js.map +1 -0
- package/public/ui/chunks/105.chunk.js +2 -1
- package/public/ui/chunks/105.chunk.js.map +1 -0
- package/public/ui/chunks/106.chunk.js +2 -1
- package/public/ui/chunks/106.chunk.js.map +1 -0
- package/public/ui/chunks/107.chunk.js +2 -1
- package/public/ui/chunks/107.chunk.js.map +1 -0
- package/public/ui/chunks/108.chunk.js +2 -1
- package/public/ui/chunks/108.chunk.js.map +1 -0
- package/public/ui/chunks/109.chunk.js +2 -1
- package/public/ui/chunks/109.chunk.js.map +1 -0
- package/public/ui/chunks/11.chunk.js +2 -1
- package/public/ui/chunks/11.chunk.js.map +1 -0
- package/public/ui/chunks/110.chunk.js +2 -1
- package/public/ui/chunks/110.chunk.js.map +1 -0
- package/public/ui/chunks/111.chunk.js +2 -1
- package/public/ui/chunks/111.chunk.js.map +1 -0
- package/public/ui/chunks/112.chunk.js +2 -1
- package/public/ui/chunks/112.chunk.js.map +1 -0
- package/public/ui/chunks/113.chunk.js +2 -1
- package/public/ui/chunks/113.chunk.js.map +1 -0
- package/public/ui/chunks/114.chunk.js +2 -1
- package/public/ui/chunks/114.chunk.js.map +1 -0
- package/public/ui/chunks/115.chunk.js +2 -1
- package/public/ui/chunks/115.chunk.js.map +1 -0
- package/public/ui/chunks/116.chunk.js +2 -1
- package/public/ui/chunks/116.chunk.js.map +1 -0
- package/public/ui/chunks/117.chunk.js +2 -1
- package/public/ui/chunks/117.chunk.js.map +1 -0
- package/public/ui/chunks/118.chunk.js +2 -1
- package/public/ui/chunks/118.chunk.js.map +1 -0
- package/public/ui/chunks/119.chunk.js +2 -1
- package/public/ui/chunks/119.chunk.js.map +1 -0
- package/public/ui/chunks/12.chunk.js +2 -1
- package/public/ui/chunks/12.chunk.js.map +1 -0
- package/public/ui/chunks/120.chunk.js +2 -1
- package/public/ui/chunks/120.chunk.js.map +1 -0
- package/public/ui/chunks/121.chunk.js +2 -1
- package/public/ui/chunks/121.chunk.js.map +1 -0
- package/public/ui/chunks/122.chunk.js +2 -1
- package/public/ui/chunks/122.chunk.js.map +1 -0
- package/public/ui/chunks/123.chunk.js +2 -1
- package/public/ui/chunks/123.chunk.js.map +1 -0
- package/public/ui/chunks/124.chunk.js +2 -1
- package/public/ui/chunks/124.chunk.js.map +1 -0
- package/public/ui/chunks/125.chunk.js +2 -1
- package/public/ui/chunks/125.chunk.js.map +1 -0
- package/public/ui/chunks/126.chunk.js +2 -1
- package/public/ui/chunks/126.chunk.js.map +1 -0
- package/public/ui/chunks/127.chunk.js +2 -1
- package/public/ui/chunks/127.chunk.js.map +1 -0
- package/public/ui/chunks/128.chunk.js +2 -1
- package/public/ui/chunks/128.chunk.js.map +1 -0
- package/public/ui/chunks/129.chunk.js +2 -1
- package/public/ui/chunks/129.chunk.js.map +1 -0
- package/public/ui/chunks/13.chunk.js +2 -1
- package/public/ui/chunks/13.chunk.js.map +1 -0
- package/public/ui/chunks/130.chunk.js +2 -1
- package/public/ui/chunks/130.chunk.js.map +1 -0
- package/public/ui/chunks/131.chunk.js +2 -1
- package/public/ui/chunks/131.chunk.js.map +1 -0
- package/public/ui/chunks/132.chunk.js +2 -1
- package/public/ui/chunks/132.chunk.js.map +1 -0
- package/public/ui/chunks/133.chunk.js +2 -1
- package/public/ui/chunks/133.chunk.js.map +1 -0
- package/public/ui/chunks/134.chunk.js +2 -1
- package/public/ui/chunks/134.chunk.js.map +1 -0
- package/public/ui/chunks/135.chunk.js +2 -1
- package/public/ui/chunks/135.chunk.js.map +1 -0
- package/public/ui/chunks/136.chunk.js +2 -1
- package/public/ui/chunks/136.chunk.js.map +1 -0
- package/public/ui/chunks/137.chunk.js +2 -1
- package/public/ui/chunks/137.chunk.js.map +1 -0
- package/public/ui/chunks/138.chunk.js +2 -1
- package/public/ui/chunks/138.chunk.js.map +1 -0
- package/public/ui/chunks/139.chunk.js +2 -1
- package/public/ui/chunks/139.chunk.js.map +1 -0
- package/public/ui/chunks/14.chunk.js +2 -1
- package/public/ui/chunks/14.chunk.js.map +1 -0
- package/public/ui/chunks/140.chunk.js +2 -1
- package/public/ui/chunks/140.chunk.js.map +1 -0
- package/public/ui/chunks/141.chunk.js +2 -1
- package/public/ui/chunks/141.chunk.js.map +1 -0
- package/public/ui/chunks/142.chunk.js +2 -1
- package/public/ui/chunks/142.chunk.js.map +1 -0
- package/public/ui/chunks/143.chunk.js +2 -1
- package/public/ui/chunks/143.chunk.js.map +1 -0
- package/public/ui/chunks/144.chunk.js +2 -1
- package/public/ui/chunks/144.chunk.js.map +1 -0
- package/public/ui/chunks/145.chunk.js +2 -1
- package/public/ui/chunks/145.chunk.js.map +1 -0
- package/public/ui/chunks/15.chunk.js +2 -1
- package/public/ui/chunks/15.chunk.js.map +1 -0
- package/public/ui/chunks/16.chunk.js +2 -1
- package/public/ui/chunks/16.chunk.js.map +1 -0
- package/public/ui/chunks/17.chunk.js +2 -1
- package/public/ui/chunks/17.chunk.js.map +1 -0
- package/public/ui/chunks/18.chunk.js +2 -1
- package/public/ui/chunks/18.chunk.js.map +1 -0
- package/public/ui/chunks/19.chunk.js +2 -1
- package/public/ui/chunks/19.chunk.js.map +1 -0
- package/public/ui/chunks/20.chunk.js +2 -1
- package/public/ui/chunks/20.chunk.js.map +1 -0
- package/public/ui/chunks/21.chunk.js +2 -1
- package/public/ui/chunks/21.chunk.js.map +1 -0
- package/public/ui/chunks/22.chunk.js +2 -1
- package/public/ui/chunks/22.chunk.js.map +1 -0
- package/public/ui/chunks/23.chunk.js +2 -1
- package/public/ui/chunks/23.chunk.js.map +1 -0
- package/public/ui/chunks/24.chunk.js +2 -1
- package/public/ui/chunks/24.chunk.js.map +1 -0
- package/public/ui/chunks/25.chunk.js +2 -1
- package/public/ui/chunks/25.chunk.js.map +1 -0
- package/public/ui/chunks/26.chunk.js +2 -1
- package/public/ui/chunks/26.chunk.js.map +1 -0
- package/public/ui/chunks/27.chunk.js +2 -1
- package/public/ui/chunks/27.chunk.js.map +1 -0
- package/public/ui/chunks/28.chunk.js +2 -1
- package/public/ui/chunks/28.chunk.js.map +1 -0
- package/public/ui/chunks/29.chunk.js +2 -1
- package/public/ui/chunks/29.chunk.js.map +1 -0
- package/public/ui/chunks/30.chunk.js +2 -1
- package/public/ui/chunks/30.chunk.js.map +1 -0
- package/public/ui/chunks/31.chunk.js +2 -1
- package/public/ui/chunks/31.chunk.js.map +1 -0
- package/public/ui/chunks/32.chunk.js +2 -1
- package/public/ui/chunks/32.chunk.js.map +1 -0
- package/public/ui/chunks/33.chunk.js +2 -1
- package/public/ui/chunks/33.chunk.js.map +1 -0
- package/public/ui/chunks/34.chunk.js +2 -1
- package/public/ui/chunks/34.chunk.js.map +1 -0
- package/public/ui/chunks/35.chunk.js +2 -1
- package/public/ui/chunks/35.chunk.js.map +1 -0
- package/public/ui/chunks/36.chunk.js +2 -1
- package/public/ui/chunks/36.chunk.js.map +1 -0
- package/public/ui/chunks/37.chunk.js +2 -1
- package/public/ui/chunks/37.chunk.js.map +1 -0
- package/public/ui/chunks/38.chunk.js +2 -1
- package/public/ui/chunks/38.chunk.js.map +1 -0
- package/public/ui/chunks/39.chunk.js +2 -1
- package/public/ui/chunks/39.chunk.js.map +1 -0
- package/public/ui/chunks/4.chunk.js +2 -1
- package/public/ui/chunks/4.chunk.js.map +1 -0
- package/public/ui/chunks/40.chunk.js +2 -1
- package/public/ui/chunks/40.chunk.js.map +1 -0
- package/public/ui/chunks/41.chunk.js +2 -1
- package/public/ui/chunks/41.chunk.js.map +1 -0
- package/public/ui/chunks/42.chunk.js +2 -1
- package/public/ui/chunks/42.chunk.js.map +1 -0
- package/public/ui/chunks/43.chunk.js +2 -1
- package/public/ui/chunks/43.chunk.js.map +1 -0
- package/public/ui/chunks/44.chunk.js +2 -1
- package/public/ui/chunks/44.chunk.js.map +1 -0
- package/public/ui/chunks/45.chunk.js +2 -1
- package/public/ui/chunks/45.chunk.js.map +1 -0
- package/public/ui/chunks/46.chunk.js +2 -1
- package/public/ui/chunks/46.chunk.js.map +1 -0
- package/public/ui/chunks/47.chunk.js +2 -1
- package/public/ui/chunks/47.chunk.js.map +1 -0
- package/public/ui/chunks/48.chunk.js +2 -1
- package/public/ui/chunks/48.chunk.js.map +1 -0
- package/public/ui/chunks/49.chunk.js +2 -1
- package/public/ui/chunks/49.chunk.js.map +1 -0
- package/public/ui/chunks/5.chunk.js +2 -1
- package/public/ui/chunks/5.chunk.js.map +1 -0
- package/public/ui/chunks/50.chunk.js +2 -1
- package/public/ui/chunks/50.chunk.js.map +1 -0
- package/public/ui/chunks/51.chunk.js +2 -1
- package/public/ui/chunks/51.chunk.js.map +1 -0
- package/public/ui/chunks/52.chunk.js +2 -1
- package/public/ui/chunks/52.chunk.js.map +1 -0
- package/public/ui/chunks/53.chunk.js +2 -1
- package/public/ui/chunks/53.chunk.js.map +1 -0
- package/public/ui/chunks/54.chunk.js +2 -1
- package/public/ui/chunks/54.chunk.js.map +1 -0
- package/public/ui/chunks/55.chunk.js +2 -1
- package/public/ui/chunks/55.chunk.js.map +1 -0
- package/public/ui/chunks/56.chunk.js +2 -1
- package/public/ui/chunks/56.chunk.js.map +1 -0
- package/public/ui/chunks/57.chunk.js +2 -1
- package/public/ui/chunks/57.chunk.js.map +1 -0
- package/public/ui/chunks/58.chunk.js +2 -1
- package/public/ui/chunks/58.chunk.js.map +1 -0
- package/public/ui/chunks/59.chunk.js +2 -1
- package/public/ui/chunks/59.chunk.js.map +1 -0
- package/public/ui/chunks/6.chunk.js +2 -1
- package/public/ui/chunks/6.chunk.js.map +1 -0
- package/public/ui/chunks/60.chunk.js +2 -1
- package/public/ui/chunks/60.chunk.js.map +1 -0
- package/public/ui/chunks/61.chunk.js +2 -1
- package/public/ui/chunks/61.chunk.js.map +1 -0
- package/public/ui/chunks/62.chunk.js +2 -1
- package/public/ui/chunks/62.chunk.js.map +1 -0
- package/public/ui/chunks/63.chunk.js +2 -1
- package/public/ui/chunks/63.chunk.js.map +1 -0
- package/public/ui/chunks/64.chunk.js +2 -1
- package/public/ui/chunks/64.chunk.js.map +1 -0
- package/public/ui/chunks/65.chunk.js +2 -1
- package/public/ui/chunks/65.chunk.js.map +1 -0
- package/public/ui/chunks/66.chunk.js +2 -1
- package/public/ui/chunks/66.chunk.js.map +1 -0
- package/public/ui/chunks/67.chunk.js +2 -1
- package/public/ui/chunks/67.chunk.js.map +1 -0
- package/public/ui/chunks/68.chunk.js +2 -1
- package/public/ui/chunks/68.chunk.js.map +1 -0
- package/public/ui/chunks/69.chunk.js +2 -1
- package/public/ui/chunks/69.chunk.js.map +1 -0
- package/public/ui/chunks/7.chunk.js +2 -1
- package/public/ui/chunks/7.chunk.js.map +1 -0
- package/public/ui/chunks/70.chunk.js +2 -1
- package/public/ui/chunks/70.chunk.js.map +1 -0
- package/public/ui/chunks/71.chunk.js +2 -1
- package/public/ui/chunks/71.chunk.js.map +1 -0
- package/public/ui/chunks/72.chunk.js +2 -1
- package/public/ui/chunks/72.chunk.js.map +1 -0
- package/public/ui/chunks/73.chunk.js +2 -1
- package/public/ui/chunks/73.chunk.js.map +1 -0
- package/public/ui/chunks/74.chunk.js +2 -1
- package/public/ui/chunks/74.chunk.js.map +1 -0
- package/public/ui/chunks/75.chunk.js +2 -1
- package/public/ui/chunks/75.chunk.js.map +1 -0
- package/public/ui/chunks/76.chunk.js +2 -1
- package/public/ui/chunks/76.chunk.js.map +1 -0
- package/public/ui/chunks/77.chunk.js +2 -1
- package/public/ui/chunks/77.chunk.js.map +1 -0
- package/public/ui/chunks/78.chunk.js +2 -1
- package/public/ui/chunks/78.chunk.js.map +1 -0
- package/public/ui/chunks/79.chunk.js +2 -1
- package/public/ui/chunks/79.chunk.js.map +1 -0
- package/public/ui/chunks/8.chunk.js +2 -1
- package/public/ui/chunks/8.chunk.js.map +1 -0
- package/public/ui/chunks/80.chunk.js +2 -1
- package/public/ui/chunks/80.chunk.js.map +1 -0
- package/public/ui/chunks/81.chunk.js +2 -1
- package/public/ui/chunks/81.chunk.js.map +1 -0
- package/public/ui/chunks/82.chunk.js +2 -1
- package/public/ui/chunks/82.chunk.js.map +1 -0
- package/public/ui/chunks/83.chunk.js +2 -1
- package/public/ui/chunks/83.chunk.js.map +1 -0
- package/public/ui/chunks/84.chunk.js +2 -1
- package/public/ui/chunks/84.chunk.js.map +1 -0
- package/public/ui/chunks/85.chunk.js +2 -1
- package/public/ui/chunks/85.chunk.js.map +1 -0
- package/public/ui/chunks/86.chunk.js +2 -1
- package/public/ui/chunks/86.chunk.js.map +1 -0
- package/public/ui/chunks/87.chunk.js +2 -1
- package/public/ui/chunks/87.chunk.js.map +1 -0
- package/public/ui/chunks/88.chunk.js +2 -1
- package/public/ui/chunks/88.chunk.js.map +1 -0
- package/public/ui/chunks/89.chunk.js +2 -1
- package/public/ui/chunks/89.chunk.js.map +1 -0
- package/public/ui/chunks/9.chunk.js +2 -1
- package/public/ui/chunks/9.chunk.js.map +1 -0
- package/public/ui/chunks/90.chunk.js +2 -1
- package/public/ui/chunks/90.chunk.js.map +1 -0
- package/public/ui/chunks/91.chunk.js +2 -1
- package/public/ui/chunks/91.chunk.js.map +1 -0
- package/public/ui/chunks/92.chunk.js +2 -1
- package/public/ui/chunks/92.chunk.js.map +1 -0
- package/public/ui/chunks/93.chunk.js +2 -1
- package/public/ui/chunks/93.chunk.js.map +1 -0
- package/public/ui/chunks/94.chunk.js +2 -1
- package/public/ui/chunks/94.chunk.js.map +1 -0
- package/public/ui/chunks/95.chunk.js +2 -1
- package/public/ui/chunks/95.chunk.js.map +1 -0
- package/public/ui/chunks/96.chunk.js +2 -1
- package/public/ui/chunks/96.chunk.js.map +1 -0
- package/public/ui/chunks/97.chunk.js +2 -1
- package/public/ui/chunks/97.chunk.js.map +1 -0
- package/public/ui/chunks/98.chunk.js +2 -1
- package/public/ui/chunks/98.chunk.js.map +1 -0
- package/public/ui/chunks/99.chunk.js +2 -1
- package/public/ui/chunks/99.chunk.js.map +1 -0
- package/public/ui/chunks/mention.chunk.css +3 -1
- package/public/ui/chunks/mention.chunk.css.map +1 -0
- package/public/ui/chunks/mention.chunk.js +2 -1
- package/public/ui/chunks/mention.chunk.js.map +1 -0
- package/public/ui/chunks/vendors.html2canvas.chunk.js +2 -1
- package/public/ui/chunks/vendors.html2canvas.chunk.js.map +1 -0
- package/public/ui/chunks/vendors.mention.chunk.js +2 -1
- package/public/ui/chunks/vendors.mention.chunk.js.map +1 -0
- package/public/ui/i18n/translation-bn.json +826 -0
- package/public/ui/i18n/translation-de.json +232 -72
- package/public/ui/i18n/translation-el.json +826 -0
- package/public/ui/i18n/translation-en.json +179 -19
- package/public/ui/i18n/translation-es.json +175 -15
- package/public/ui/i18n/translation-fr.json +274 -114
- package/public/ui/i18n/translation-hi.json +826 -0
- package/public/ui/i18n/translation-id.json +826 -0
- package/public/ui/i18n/translation-it.json +176 -16
- package/public/ui/i18n/translation-ja.json +260 -100
- package/public/ui/i18n/translation-ko.json +358 -198
- package/public/ui/i18n/translation-ms.json +826 -0
- package/public/ui/i18n/translation-nl.json +189 -29
- package/public/ui/i18n/translation-pt_br.json +176 -16
- package/public/ui/i18n/translation-ru.json +177 -17
- package/public/ui/i18n/translation-tr.json +826 -0
- package/public/ui/i18n/translation-uk.json +826 -0
- package/public/ui/i18n/translation-vi.json +826 -0
- package/public/ui/i18n/translation-zh_cn.json +179 -19
- package/public/ui/i18n/translation-zh_tw.json +176 -16
- package/public/ui/style.css +127 -93
- package/public/ui/style.css.map +1 -0
- package/public/ui/webviewer-ui.min.js +48 -15
- package/public/ui/webviewer-ui.min.js.map +1 -0
- package/webviewer.min.js +1 -1
- package/public/core/21.chunk.js +0 -8
|
@@ -68,7 +68,7 @@ $jscomp.polyfill("String.prototype.codePointAt",function(orig){return orig?orig:
|
|
|
68
68
|
name,{enumerable:!0,get:getter})};__webpack_require__.r=function(exports){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});Object.defineProperty(exports,"__esModule",{value:!0})};__webpack_require__.t=function(value,mode){mode&1&&(value=__webpack_require__(value));if(mode&8||mode&4&&"object"===typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);__webpack_require__.r(ns);Object.defineProperty(ns,"default",
|
|
69
69
|
{enumerable:!0,value:value});if(mode&2&&"string"!=typeof value)for(var key$jscomp$0 in value)__webpack_require__.d(ns,key$jscomp$0,function(key){return value[key]}.bind(null,key$jscomp$0));return ns};__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module["default"]}:function(){return module};__webpack_require__.d(getter,"a",getter);return getter};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)};
|
|
70
70
|
__webpack_require__.p="/core/pdfjs/";return __webpack_require__(__webpack_require__.s=1)})([function(module,exports){exports=function(){return this}();try{exports=exports||(new Function("return this"))()}catch(e){"object"===typeof window&&(exports=window)}module.exports=exports},function(module,exports,__webpack_require__){module.exports=__webpack_require__(2)},function(module$jscomp$2,exports$jscomp$1,__webpack_require__){(function(Buffer,global$jscomp$0,process,module$jscomp$1){function _typeof2(obj$jscomp$0){"@babel/helpers - typeof";
|
|
71
|
-
_typeof2="function"
|
|
71
|
+
return _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof2(obj$jscomp$0)}var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(root,factory){"object"===_typeof2(exports$jscomp$1)&&"object"===_typeof2(module$jscomp$1)?module$jscomp$1.exports=factory():!(__WEBPACK_AMD_DEFINE_ARRAY__=
|
|
72
72
|
[],__WEBPACK_AMD_DEFINE_FACTORY__=factory,__WEBPACK_AMD_DEFINE_RESULT__="function"===typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports$jscomp$1,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__,void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module$jscomp$1.exports=__WEBPACK_AMD_DEFINE_RESULT__))})(this,function(){return function(modules){function __w_pdfjs_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]=
|
|
73
73
|
{i:moduleId,l:!1,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__w_pdfjs_require__);module.l=!0;return module.exports}var installedModules={};__w_pdfjs_require__.m=modules;__w_pdfjs_require__.c=installedModules;__w_pdfjs_require__.d=function(exports,name,getter){__w_pdfjs_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})};__w_pdfjs_require__.r=function(exports){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,
|
|
74
74
|
Symbol.toStringTag,{value:"Module"});Object.defineProperty(exports,"__esModule",{value:!0})};__w_pdfjs_require__.t=function(value,mode){mode&1&&(value=__w_pdfjs_require__(value));if(mode&8||mode&4&&"object"===_typeof2(value)&&value&&value.__esModule)return value;var ns=Object.create(null);__w_pdfjs_require__.r(ns);Object.defineProperty(ns,"default",{enumerable:!0,value:value});if(mode&2&&"string"!=typeof value)for(var key$jscomp$0 in value)__w_pdfjs_require__.d(ns,key$jscomp$0,function(key){return value[key]}.bind(null,
|
|
@@ -88,7 +88,7 @@ pdfManager?pdfManager.sendProgressiveData(data):cachedChunks.push(data);fullRequ
|
|
|
88
88
|
new WorkerTask("PasswordException: response ".concat(ex.code));WorkerTasks.push(task);handler.sendWithPromise("PasswordRequest",ex).then(function(data){finishWorkerTask(task);pdfManager.updatePassword(data.password);pdfManagerReady()})["catch"](function(){finishWorkerTask(task);handler.send("DocException",ex)})}else ex instanceof _util.InvalidPDFException||ex instanceof _util.MissingPDFException||ex instanceof _util.UnexpectedResponseException||ex instanceof _util.UnknownErrorException?handler.send("DocException",
|
|
89
89
|
ex):handler.send("DocException",new _util.UnknownErrorException(ex.message,ex.toString()))}function pdfManagerReady(){ensureNotTerminated();loadDocument(!1).then(onSuccess,function(ex){ensureNotTerminated();ex instanceof _core_utils.XRefParseException?(pdfManager.requestLoadedStream(),pdfManager.onLoadedStream().then(function(){ensureNotTerminated();loadDocument(!0).then(onSuccess,onFailure)})):onFailure(ex)},onFailure)}ensureNotTerminated();getPdfManager(data$jscomp$0,{forceDataSchema:data$jscomp$0.disableCreateObjectURL,
|
|
90
90
|
maxImageSize:data$jscomp$0.maxImageSize,disableFontFace:data$jscomp$0.disableFontFace,nativeImageDecoderSupport:data$jscomp$0.nativeImageDecoderSupport,ignoreErrors:data$jscomp$0.ignoreErrors,isEvalSupported:data$jscomp$0.isEvalSupported}).then(function(newPdfManager){if(terminated)throw newPdfManager.terminate(new _util.AbortException("Worker was terminated.")),Error("Worker was terminated");pdfManager=newPdfManager;pdfManager.onLoadedStream().then(function(stream){handler.send("DataLoaded",{length:stream.bytes.byteLength})})}).then(pdfManagerReady,
|
|
91
|
-
onFailure)}var pdfManager,terminated=!1,cancelXHRs=null,WorkerTasks=[],verbosity=(0,_util.getVerbosityLevel)(),apiVersion=docParams.apiVersion;if("2.4.
|
|
91
|
+
onFailure)}var pdfManager,terminated=!1,cancelXHRs=null,WorkerTasks=[],verbosity=(0,_util.getVerbosityLevel)(),apiVersion=docParams.apiVersion;if("2.4.283"!==apiVersion)throw Error('The API version "'.concat(apiVersion,'" does not match ')+'the Worker version "'.concat("2.4.283",'".'));var docId=docParams.docId,docBaseUrl=docParams.docBaseUrl;apiVersion=docParams.docId+"_worker";var disableFlattenedAnnotations=docParams.disableFlattenedAnnotations,renderFormFields=docParams.renderFormFields;"undefined"!==
|
|
92
92
|
typeof self&&(self.disableFlattenedAnnotations=disableFlattenedAnnotations,self.renderFormFields=renderFormFields);"undefined"!==typeof window&&(window.disableFlattenedAnnotations=disableFlattenedAnnotations,window.renderFormFields=renderFormFields);var handler=new _message_handler.MessageHandler(apiVersion,docId,port);handler.postMessageTransfers=docParams.postMessageTransfers;handler.on("GetPage",function(data){return pdfManager.getPage(data.pageIndex).then(function(page){return Promise.all([pdfManager.ensure(page,
|
|
93
93
|
"rotate"),pdfManager.ensure(page,"ref"),pdfManager.ensure(page,"userUnit"),pdfManager.ensure(page,"view")]).then(function(_ref){_ref=_slicedToArray(_ref,4);return{rotate:_ref[0],ref:_ref[1],userUnit:_ref[2],view:_ref[3]}})})});handler.on("GetPageIndex",function(data){data=_primitives.Ref.get(data.ref.num,data.ref.gen);return pdfManager.pdfDocument.catalog.getPageIndex(data)});handler.on("GetDestinations",function(data){return pdfManager.ensureCatalog("destinations")});handler.on("GetDestination",
|
|
94
94
|
function(data){return pdfManager.ensureCatalog("getDestination",[data.id])});handler.on("GetPageLabels",function(data){return pdfManager.ensureCatalog("pageLabels")});handler.on("GetPageLayout",function(data){return pdfManager.ensureCatalog("pageLayout")});handler.on("GetPageMode",function(data){return pdfManager.ensureCatalog("pageMode")});handler.on("GetViewerPreferences",function(data){return pdfManager.ensureCatalog("viewerPreferences")});handler.on("GetOpenActionDestination",function(data){return pdfManager.ensureCatalog("openActionDestination")});
|
|
@@ -289,25 +289,25 @@ result="";input=arrayFrom(input);for(index=0;index<input.length;index++)result+=
|
|
|
289
289
|
0;swaps();){length=null;if(0<value)if("."==swaps()&&4>value)pointer++;else return;if(!DIGIT.test(swaps()))return;for(;DIGIT.test(swaps());){var number=parseInt(swaps(),10);if(null===length)length=number;else{if(0==length)return;length=10*length+number}if(255<length)return;pointer++}address[pieceIndex]=256*address[pieceIndex]+length;value++;2!=value&&4!=value||pieceIndex++}if(4!=value)return;break}else if(":"==swaps()){if(pointer++,!swaps())return}else if(swaps())return;address[pieceIndex++]=value}}if(null!==
|
|
290
290
|
compress)for(swaps=pieceIndex-compress,pieceIndex=7;0!=pieceIndex&&0<swaps;)value=address[pieceIndex],address[pieceIndex--]=address[compress+swaps-1],address[compress+--swaps]=value;else if(8!=pieceIndex)return;return address},serializeHost=function(host){var index,ignore0;if("number"==typeof host){var result=[];for(index=0;4>index;index++)result.unshift(host%256),host=floor(host/256);return result.join(".")}if("object"==_typeof2(host)){result="";index=null;var compress=1;for(var currStart=null,currLength=
|
|
291
291
|
0,index$jscomp$0=0;8>index$jscomp$0;index$jscomp$0++)0!==host[index$jscomp$0]?(currLength>compress&&(index=currStart,compress=currLength),currStart=null,currLength=0):(null===currStart&&(currStart=index$jscomp$0),++currLength);currLength>compress&&(index=currStart);compress=index;for(index=0;8>index;index++)ignore0&&0===host[index]||(ignore0&&(ignore0=!1),compress===index?(result+=index?":":"::",ignore0=!0):(result+=host[index].toString(16),7>index&&(result+=":")));return"["+result+"]"}return host},
|
|
292
|
-
C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(
|
|
292
|
+
C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(_char2,set){var code=codeAt(_char2,0);return 32<code&&127>code&&!has(set,_char2)?_char2:encodeURIComponent(_char2)},specialSchemes={ftp:21,file:null,http:80,
|
|
293
293
|
https:443,ws:80,wss:443},isSpecial=function(url){return has(specialSchemes,url.scheme)},cannotHaveUsernamePasswordPort=function(url){return!url.host||url.cannotBeABaseURL||"file"==url.scheme},isWindowsDriveLetter=function(string,normalized){var second;return 2==string.length&&ALPHA.test(string.charAt(0))&&(":"==(second=string.charAt(1))||!normalized&&"|"==second)},startsWithWindowsDriveLetter=function(string){var third;return 1<string.length&&isWindowsDriveLetter(string.slice(0,2))&&(2==string.length||
|
|
294
294
|
"/"===(third=string.charAt(2))||"\\"===third||"?"===third||"#"===third)},shortenURLsPath=function(url){var path=url.path,pathSize=path.length;!pathSize||"file"==url.scheme&&1==pathSize&&isWindowsDriveLetter(path[0],!0)||path.pop()},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START=
|
|
295
295
|
{},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},parseURL=function(url,input,stateOverride,base){var state=stateOverride||SCHEME_START,pointer=0,buffer="",seenAt=!1,seenBracket=!1,seenPasswordToken=!1;stateOverride||(url.scheme="",url.username="",url.password="",url.host=null,url.port=null,url.path=[],url.query=null,url.fragment=null,url.cannotBeABaseURL=!1,input=input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE,""));input=input.replace(TAB_AND_NEW_LINE,"");for(input=arrayFrom(input);pointer<=
|
|
296
|
-
input.length;){var
|
|
296
|
+
input.length;){var _char3=input[pointer];switch(state){case SCHEME_START:if(_char3&&ALPHA.test(_char3))buffer+=_char3.toLowerCase(),state=SCHEME;else{if(stateOverride)return"Invalid scheme";state=NO_SCHEME;continue}break;case SCHEME:if(_char3&&(ALPHANUMERIC.test(_char3)||"+"==_char3||"-"==_char3||"."==_char3))buffer+=_char3.toLowerCase();else if(":"==_char3){if(stateOverride&&(isSpecial(url)!=has(specialSchemes,buffer)||"file"==buffer&&(""!=url.username||""!=url.password||null!==url.port)||"file"==
|
|
297
297
|
url.scheme&&!url.host))return;url.scheme=buffer;if(stateOverride){isSpecial(url)&&specialSchemes[url.scheme]==url.port&&(url.port=null);return}buffer="";"file"==url.scheme?state=FILE:isSpecial(url)&&base&&base.scheme==url.scheme?state=SPECIAL_RELATIVE_OR_AUTHORITY:isSpecial(url)?state=SPECIAL_AUTHORITY_SLASHES:"/"==input[pointer+1]?(state=PATH_OR_AUTHORITY,pointer++):(url.cannotBeABaseURL=!0,url.path.push(""),state=CANNOT_BE_A_BASE_URL_PATH)}else{if(stateOverride)return"Invalid scheme";buffer="";
|
|
298
|
-
state=NO_SCHEME;pointer=0;continue}break;case NO_SCHEME:if(!base||base.cannotBeABaseURL&&"#"!=
|
|
299
|
-
case PATH_OR_AUTHORITY:if("/"==
|
|
300
|
-
"",state=QUERY;else if("#"==
|
|
301
|
-
base.password;url.host=base.host;url.port=base.port;state=PATH;continue}else state=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:state=SPECIAL_AUTHORITY_IGNORE_SLASHES;if("/"!=
|
|
302
|
-
buffer[
|
|
303
|
-
continue}else if(":"!=
|
|
304
|
-
parseHost(url,buffer))return state;buffer="";state=PORT;if(stateOverride==HOSTNAME)return}break;case PORT:if(DIGIT.test(
|
|
305
|
-
"file";if("/"==
|
|
306
|
-
state=PATH;continue}else{state=PATH;continue}break;case FILE_SLASH:if("/"==
|
|
307
|
-
parseHost(url,buffer))return state;"localhost"==url.host&&(url.host="");if(stateOverride)return;buffer=""}state=PATH_START}continue}else buffer+=
|
|
308
|
-
!stateOverride&&("?"==
|
|
309
|
-
buffer="";if("file"==url.scheme&&(void 0==
|
|
310
|
-
"#"!=
|
|
298
|
+
state=NO_SCHEME;pointer=0;continue}break;case NO_SCHEME:if(!base||base.cannotBeABaseURL&&"#"!=_char3)return"Invalid scheme";if(base.cannotBeABaseURL&&"#"==_char3){url.scheme=base.scheme;url.path=base.path.slice();url.query=base.query;url.fragment="";url.cannotBeABaseURL=!0;state=FRAGMENT;break}state="file"==base.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"==_char3&&"/"==input[pointer+1])state=SPECIAL_AUTHORITY_IGNORE_SLASHES,pointer++;else{state=RELATIVE;continue}break;
|
|
299
|
+
case PATH_OR_AUTHORITY:if("/"==_char3){state=AUTHORITY;break}else{state=PATH;continue}case RELATIVE:url.scheme=base.scheme;if(void 0==_char3)url.username=base.username,url.password=base.password,url.host=base.host,url.port=base.port,url.path=base.path.slice(),url.query=base.query;else if("/"==_char3||"\\"==_char3&&isSpecial(url))state=RELATIVE_SLASH;else if("?"==_char3)url.username=base.username,url.password=base.password,url.host=base.host,url.port=base.port,url.path=base.path.slice(),url.query=
|
|
300
|
+
"",state=QUERY;else if("#"==_char3)url.username=base.username,url.password=base.password,url.host=base.host,url.port=base.port,url.path=base.path.slice(),url.query=base.query,url.fragment="",state=FRAGMENT;else{url.username=base.username;url.password=base.password;url.host=base.host;url.port=base.port;url.path=base.path.slice();url.path.pop();state=PATH;continue}break;case RELATIVE_SLASH:if(!isSpecial(url)||"/"!=_char3&&"\\"!=_char3)if("/"==_char3)state=AUTHORITY;else{url.username=base.username;url.password=
|
|
301
|
+
base.password;url.host=base.host;url.port=base.port;state=PATH;continue}else state=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:state=SPECIAL_AUTHORITY_IGNORE_SLASHES;if("/"!=_char3||"/"!=buffer.charAt(pointer+1))continue;pointer++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=_char3&&"\\"!=_char3){state=AUTHORITY;continue}break;case AUTHORITY:if("@"==_char3){seenAt&&(buffer="%40"+buffer);seenAt=!0;buffer=arrayFrom(buffer);for(_char3=0;_char3<buffer.length;_char3++){var codePoint=
|
|
302
|
+
buffer[_char3];":"!=codePoint||seenPasswordToken?(codePoint=percentEncode(codePoint,userinfoPercentEncodeSet),seenPasswordToken?url.password+=codePoint:url.username+=codePoint):seenPasswordToken=!0}buffer=""}else if(void 0==_char3||"/"==_char3||"?"==_char3||"#"==_char3||"\\"==_char3&&isSpecial(url)){if(seenAt&&""==buffer)return"Invalid authority";pointer-=arrayFrom(buffer).length+1;buffer="";state=HOST}else buffer+=_char3;break;case HOST:case HOSTNAME:if(stateOverride&&"file"==url.scheme){state=FILE_HOST;
|
|
303
|
+
continue}else if(":"!=_char3||seenBracket)if(void 0==_char3||"/"==_char3||"?"==_char3||"#"==_char3||"\\"==_char3&&isSpecial(url)){if(isSpecial(url)&&""==buffer)return"Invalid host";if(stateOverride&&""==buffer&&(""!=url.username||""!=url.password||null!==url.port))return;if(state=parseHost(url,buffer))return state;buffer="";state=PATH_START;if(stateOverride)return;continue}else"["==_char3?seenBracket=!0:"]"==_char3&&(seenBracket=!1),buffer+=_char3;else{if(""==buffer)return"Invalid host";if(state=
|
|
304
|
+
parseHost(url,buffer))return state;buffer="";state=PORT;if(stateOverride==HOSTNAME)return}break;case PORT:if(DIGIT.test(_char3))buffer+=_char3;else if(void 0==_char3||"/"==_char3||"?"==_char3||"#"==_char3||"\\"==_char3&&isSpecial(url)||stateOverride){if(""!=buffer){state=parseInt(buffer,10);if(65535<state)return"Invalid port";url.port=isSpecial(url)&&state===specialSchemes[url.scheme]?null:state;buffer=""}if(stateOverride)return;state=PATH_START;continue}else return"Invalid port";break;case FILE:url.scheme=
|
|
305
|
+
"file";if("/"==_char3||"\\"==_char3)state=FILE_SLASH;else if(base&&"file"==base.scheme)if(void 0==_char3)url.host=base.host,url.path=base.path.slice(),url.query=base.query;else if("?"==_char3)url.host=base.host,url.path=base.path.slice(),url.query="",state=QUERY;else if("#"==_char3)url.host=base.host,url.path=base.path.slice(),url.query=base.query,url.fragment="",state=FRAGMENT;else{startsWithWindowsDriveLetter(input.slice(pointer).join(""))||(url.host=base.host,url.path=base.path.slice(),shortenURLsPath(url));
|
|
306
|
+
state=PATH;continue}else{state=PATH;continue}break;case FILE_SLASH:if("/"==_char3||"\\"==_char3){state=FILE_HOST;break}base&&"file"==base.scheme&&!startsWithWindowsDriveLetter(input.slice(pointer).join(""))&&(isWindowsDriveLetter(base.path[0],!0)?url.path.push(base.path[0]):url.host=base.host);state=PATH;continue;case FILE_HOST:if(void 0==_char3||"/"==_char3||"\\"==_char3||"?"==_char3||"#"==_char3){if(!stateOverride&&isWindowsDriveLetter(buffer))state=PATH;else{if(""==buffer){if(url.host="",stateOverride)return}else{if(state=
|
|
307
|
+
parseHost(url,buffer))return state;"localhost"==url.host&&(url.host="");if(stateOverride)return;buffer=""}state=PATH_START}continue}else buffer+=_char3;break;case PATH_START:if(isSpecial(url)){if(state=PATH,"/"!=_char3&&"\\"!=_char3)continue}else if(!stateOverride&&"?"==_char3)url.query="",state=QUERY;else if(!stateOverride&&"#"==_char3)url.fragment="",state=FRAGMENT;else if(void 0!=_char3&&(state=PATH,"/"!=_char3))continue;break;case PATH:if(void 0==_char3||"/"==_char3||"\\"==_char3&&isSpecial(url)||
|
|
308
|
+
!stateOverride&&("?"==_char3||"#"==_char3)){codePoint=buffer;codePoint=codePoint.toLowerCase();".."===codePoint||"%2e."===codePoint||".%2e"===codePoint||"%2e%2e"===codePoint?(shortenURLsPath(url),"/"==_char3||"\\"==_char3&&isSpecial(url)||url.path.push("")):"."===buffer||"%2e"===buffer.toLowerCase()?"/"==_char3||"\\"==_char3&&isSpecial(url)||url.path.push(""):("file"==url.scheme&&!url.path.length&&isWindowsDriveLetter(buffer)&&(url.host&&(url.host=""),buffer=buffer.charAt(0)+":"),url.path.push(buffer));
|
|
309
|
+
buffer="";if("file"==url.scheme&&(void 0==_char3||"?"==_char3||"#"==_char3))for(;1<url.path.length&&""===url.path[0];)url.path.shift();"?"==_char3?(url.query="",state=QUERY):"#"==_char3&&(url.fragment="",state=FRAGMENT)}else buffer+=percentEncode(_char3,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==_char3?(url.query="",state=QUERY):"#"==_char3?(url.fragment="",state=FRAGMENT):void 0!=_char3&&(url.path[0]+=percentEncode(_char3,C0ControlPercentEncodeSet));break;case QUERY:stateOverride||
|
|
310
|
+
"#"!=_char3?void 0!=_char3&&("'"==_char3&&isSpecial(url)?url.query+="%27":url.query="#"==_char3?url.query+"%23":url.query+percentEncode(_char3,C0ControlPercentEncodeSet)):(url.fragment="",state=FRAGMENT);break;case FRAGMENT:void 0!=_char3&&(url.fragment+=percentEncode(_char3,fragmentPercentEncodeSet))}pointer++}},URLConstructor=function(url){var that=anInstance(this,URLConstructor,"URL"),base=1<arguments.length?arguments[1]:void 0,urlString=String(url),state=setInternalState(that,{type:"URL"}),failure;
|
|
311
311
|
if(void 0!==base)if(base instanceof URLConstructor)var baseState=getInternalURLState(base);else if(failure=parseURL(baseState={},String(base)))throw TypeError(failure);if(failure=parseURL(state,urlString,null,baseState))throw TypeError(failure);var searchParams=state.searchParams=new URLSearchParams;base=getInternalSearchParamsState(searchParams);base.updateSearchParams(state.query);base.updateURL=function(){state.query=String(searchParams)||null};DESCRIPTORS||(that.href=serializeURL.call(that),that.origin=
|
|
312
312
|
getOrigin.call(that),that.protocol=getProtocol.call(that),that.username=getUsername.call(that),that.password=getPassword.call(that),that.host=getHost.call(that),that.hostname=getHostname.call(that),that.port=getPort.call(that),that.pathname=getPathname.call(that),that.search=getSearch.call(that),that.searchParams=getSearchParams.call(that),that.hash=getHash.call(that))};__w_pdfjs_require__=URLConstructor.prototype;var serializeURL=function(){var url=getInternalURLState(this),scheme=url.scheme,username=
|
|
313
313
|
url.username,password=url.password,host=url.host,port=url.port,path=url.path,query=url.query,fragment=url.fragment,output=scheme+":";if(null!==host){output+="//";if(""!=url.username||""!=url.password)output+=username+(password?":"+password:"")+"@";output+=serializeHost(host);null!==port&&(output+=":"+port)}else"file"==scheme&&(output+="//");output+=url.cannotBeABaseURL?path[0]:path.length?"/"+path.join("/"):"";null!==query&&(output+="?"+query);null!==fragment&&(output+="#"+fragment);return output},
|
|
@@ -618,74 +618,76 @@ exports.XRefEntryException=module;module=function(_BaseException3){function XRef
|
|
|
618
618
|
exports,__w_pdfjs_require__){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,
|
|
619
619
|
reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}function _slicedToArray(arr,i){var JSCompiler_temp=Array.isArray(arr)?arr:void 0;if(!JSCompiler_temp)if(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)){JSCompiler_temp=[];var _n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(JSCompiler_temp.push(_s.value),!i||JSCompiler_temp.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&
|
|
620
620
|
null!=_i["return"])_i["return"]()}finally{if(_d)throw _e;}}}else JSCompiler_temp=void 0;if(!(arr=JSCompiler_temp))throw new TypeError("Invalid attempt to destructure non-iterable instance");return arr}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=
|
|
621
|
-
!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}function isAnnotationRenderable(annotation,intent){return self.disableFlattenedAnnotations?!1:"
|
|
622
|
-
3<arguments.length&&void 0!==arguments[3]?arguments[3]:!1,signatureLength=signature.length,scanBytes=stream.peekBytes(2<arguments.length&&void 0!==arguments[2]?arguments[2]:1024),scanLength=scanBytes.length-signatureLength;if(0>=scanLength)return!1;if(backwards)for(scanLength=signatureLength-1,backwards=scanBytes.length-1;backwards>=scanLength;){for(var j=0;j<signatureLength&&scanBytes[backwards-
|
|
623
|
-
0;backwards<=scanLength;){for(j=0;j<signatureLength&&scanBytes[backwards+j]===signature[j];)j++;if(j>=signatureLength)return stream.pos+=backwards,!0;backwards++}return!1}Object.defineProperty(exports,"__esModule",{value:!0});exports.PDFDocument=exports.Page=void 0;var _regenerator=function(obj){return obj&&obj.__esModule?obj:{"default":obj}}(__w_pdfjs_require__(2)),_util=
|
|
624
|
-
_stream2=__w_pdfjs_require__(195),_annotation=__w_pdfjs_require__(207),_crypto=__w_pdfjs_require__(205),_parser=__w_pdfjs_require__(194),_operator_list=__w_pdfjs_require__(208),_evaluator=__w_pdfjs_require__(209),_function=__w_pdfjs_require__(223),LETTER_SIZE_MEDIABOX=[0,0,612,792],Page=function(){function Page(_ref){var pdfManager=_ref.pdfManager,xref=_ref.xref,pageIndex=
|
|
625
|
-
_classCallCheck(this,Page);this.pdfManager=pdfManager;this.pageIndex=pageIndex;this.pageDict=pageDict;this.xref=xref;this.ref=ref;this.fontCache=fontCache;this.builtInCMapCache=builtInCMapCache;this.pdfFunctionFactory=_ref;this.evaluatorOptions=pdfManager.evaluatorOptions;this.resourcesPromise=null;var
|
|
626
|
-
_createClass(Page,[{key:"_getInheritableProperty",value:function(key){var getArray
|
|
627
|
-
4===box.length){if(0!==box[2]-box[0]&&0!==box[3]-box[1])return box;(0,_util.warn)("Empty /".concat(name," entry."))}return null}},{key:"getContentStream",value:function(){var content=this.content;if(Array.isArray(content)){var xref=this.xref,streams=[],_iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _iterator=content[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion
|
|
628
|
-
!0,_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&null!=_iterator["return"])_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}content=new _stream2.StreamsSequenceStream(streams)}else content=(0,_primitives.isStream)(content)?content:new _stream2.NullStream;return content}},{key:"loadResources",value:function(keys){var _this=this;this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,
|
|
629
|
-
keys,_this.xref)).load()})}},{key:"getOperatorList",value:function(_ref2){var _this2=this,handler=_ref2.handler,sink=_ref2.sink,task=_ref2.task,intent=_ref2.intent,renderInteractiveForms=_ref2.renderInteractiveForms;_ref2=this.pdfManager.ensure(this,"getContentStream");var resourcesPromise=this.loadResources("ExtGState ColorSpace Pattern Shading XObject Font".split(" ")),partialEvaluator=new _evaluator.PartialEvaluator({xref:this.xref,
|
|
630
|
-
fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,options:this.evaluatorOptions,pdfFunctionFactory:this.pdfFunctionFactory});_ref2=Promise.all([_ref2,resourcesPromise]).then(function(_ref3){_ref3=_slicedToArray(_ref3,1)[0];var opList=new _operator_list.OperatorList(intent,sink,_this2.pageIndex);handler.send("StartRenderPage",{transparency:partialEvaluator.hasBlendModes(_this2.resources),pageIndex:_this2.pageIndex,intent:intent});
|
|
631
|
-
task:task,resources:_this2.resources,operatorList:opList}).then(function(){return opList})});return Promise.all([_ref2,this._parsedAnnotations]).then(function(_ref5){_ref5=_slicedToArray(_ref5,2);var pageOpList=_ref5[0];_ref5=_ref5[1];if(0===_ref5.length)return pageOpList.flush(!0),{length:pageOpList.totalLength};var opListPromises=[],_iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _iterator2=_ref5[Symbol.iterator](),
|
|
632
|
-
_iterator2.next()).done);_iteratorNormalCompletion2=!0){var annotation=_step2.value;isAnnotationRenderable(annotation,intent)&&opListPromises.push(annotation.getOperatorList(partialEvaluator,task,renderInteractiveForms))}}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&null!=_iterator2["return"])_iterator2["return"]()}finally{if(_didIteratorError2)throw _iteratorError2;}}return Promise.all(opListPromises).then(function(opLists){pageOpList.addOp(_util.OPS.beginAnnotations,
|
|
621
|
+
!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}function isAnnotationRenderable(annotation,intent){return self.disableFlattenedAnnotations?!1:"Sig"===annotation.data.fieldType&&4!==annotation.data.annotationFlags?annotation.data.forceRender=!0:"display"===
|
|
622
|
+
intent&&annotation.viewable||"print"===intent&&annotation.printable}function find(stream,signature){var backwards=3<arguments.length&&void 0!==arguments[3]?arguments[3]:!1,signatureLength=signature.length,scanBytes=stream.peekBytes(2<arguments.length&&void 0!==arguments[2]?arguments[2]:1024),scanLength=scanBytes.length-signatureLength;if(0>=scanLength)return!1;if(backwards)for(scanLength=signatureLength-1,backwards=scanBytes.length-1;backwards>=scanLength;){for(var j=0;j<signatureLength&&scanBytes[backwards-
|
|
623
|
+
j]===signature[scanLength-j];)j++;if(j>=signatureLength)return stream.pos+=backwards-scanLength,!0;backwards--}else for(backwards=0;backwards<=scanLength;){for(j=0;j<signatureLength&&scanBytes[backwards+j]===signature[j];)j++;if(j>=signatureLength)return stream.pos+=backwards,!0;backwards++}return!1}Object.defineProperty(exports,"__esModule",{value:!0});exports.PDFDocument=exports.Page=void 0;var _regenerator=function(obj){return obj&&obj.__esModule?obj:{"default":obj}}(__w_pdfjs_require__(2)),_util=
|
|
624
|
+
__w_pdfjs_require__(5),_obj=__w_pdfjs_require__(193),_primitives=__w_pdfjs_require__(188),_core_utils=__w_pdfjs_require__(191),_stream2=__w_pdfjs_require__(195),_annotation=__w_pdfjs_require__(207),_crypto=__w_pdfjs_require__(205),_parser=__w_pdfjs_require__(194),_operator_list=__w_pdfjs_require__(208),_evaluator=__w_pdfjs_require__(209),_function=__w_pdfjs_require__(223),LETTER_SIZE_MEDIABOX=[0,0,612,792],Page=function(){function Page(_ref){var pdfManager=_ref.pdfManager,xref=_ref.xref,pageIndex=
|
|
625
|
+
_ref.pageIndex,pageDict=_ref.pageDict,ref=_ref.ref,fontCache=_ref.fontCache,builtInCMapCache=_ref.builtInCMapCache;_ref=_ref.pdfFunctionFactory;_classCallCheck(this,Page);this.pdfManager=pdfManager;this.pageIndex=pageIndex;this.pageDict=pageDict;this.xref=xref;this.ref=ref;this.fontCache=fontCache;this.builtInCMapCache=builtInCMapCache;this.pdfFunctionFactory=_ref;this.evaluatorOptions=pdfManager.evaluatorOptions;this.resourcesPromise=null;var JSCompiler_object_inline_obj_1327=0;this.idFactory={createObjId:function(){return"p".concat(pageIndex,
|
|
626
|
+
"_").concat(++JSCompiler_object_inline_obj_1327)},getDocId:function(){return"g_".concat(pdfManager.docId)}}}_createClass(Page,[{key:"_getInheritableProperty",value:function(key){var value=(0,_core_utils.getInheritableProperty)({dict:this.pageDict,key:key,getArray:1<arguments.length&&void 0!==arguments[1]?arguments[1]:!1,stopWhenFound:!1});return Array.isArray(value)?1!==value.length&&(0,_primitives.isDict)(value[0])?_primitives.Dict.merge(this.xref,value):value[0]:value}},{key:"_getBoundingBox",value:function(name){var box=
|
|
627
|
+
this._getInheritableProperty(name,!0);if(Array.isArray(box)&&4===box.length){if(0!==box[2]-box[0]&&0!==box[3]-box[1])return box;(0,_util.warn)("Empty /".concat(name," entry."))}return null}},{key:"getContentStream",value:function(){var content=this.content;if(Array.isArray(content)){var xref=this.xref,streams=[],_iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _iterator=content[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=
|
|
628
|
+
!0)streams.push(xref.fetchIfRef(_step.value))}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&null!=_iterator["return"])_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}content=new _stream2.StreamsSequenceStream(streams)}else content=(0,_primitives.isStream)(content)?content:new _stream2.NullStream;return content}},{key:"loadResources",value:function(keys){var _this=this;this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,
|
|
629
|
+
"resources"));return this.resourcesPromise.then(function(){return(new _obj.ObjectLoader(_this.resources,keys,_this.xref)).load()})}},{key:"getOperatorList",value:function(_ref2){var _this2=this,handler=_ref2.handler,sink=_ref2.sink,task=_ref2.task,intent=_ref2.intent,renderInteractiveForms=_ref2.renderInteractiveForms;_ref2=this.pdfManager.ensure(this,"getContentStream");var resourcesPromise=this.loadResources("ExtGState ColorSpace Pattern Shading XObject Font".split(" ")),partialEvaluator=new _evaluator.PartialEvaluator({xref:this.xref,
|
|
630
|
+
handler:handler,pageIndex:this.pageIndex,idFactory:this.idFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,options:this.evaluatorOptions,pdfFunctionFactory:this.pdfFunctionFactory});_ref2=Promise.all([_ref2,resourcesPromise]).then(function(_ref3){_ref3=_slicedToArray(_ref3,1)[0];var opList=new _operator_list.OperatorList(intent,sink,_this2.pageIndex);handler.send("StartRenderPage",{transparency:partialEvaluator.hasBlendModes(_this2.resources),pageIndex:_this2.pageIndex,intent:intent});
|
|
631
|
+
return partialEvaluator.getOperatorList({stream:_ref3,task:task,resources:_this2.resources,operatorList:opList}).then(function(){return opList})});return Promise.all([_ref2,this._parsedAnnotations]).then(function(_ref5){_ref5=_slicedToArray(_ref5,2);var pageOpList=_ref5[0];_ref5=_ref5[1];if(0===_ref5.length)return pageOpList.flush(!0),{length:pageOpList.totalLength};var opListPromises=[],_iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _iterator2=_ref5[Symbol.iterator](),
|
|
632
|
+
_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0){var annotation=_step2.value;isAnnotationRenderable(annotation,intent)&&opListPromises.push(annotation.getOperatorList(partialEvaluator,task,renderInteractiveForms))}}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&null!=_iterator2["return"])_iterator2["return"]()}finally{if(_didIteratorError2)throw _iteratorError2;}}return Promise.all(opListPromises).then(function(opLists){pageOpList.addOp(_util.OPS.beginAnnotations,
|
|
633
633
|
[]);var _iteratorNormalCompletion3=!0,_didIteratorError3=!1,_iteratorError3=void 0;try{for(var _iterator3=opLists[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=!0)pageOpList.addOpList(_step3.value)}catch(err$7){_didIteratorError3=!0,_iteratorError3=err$7}finally{try{if(!_iteratorNormalCompletion3&&null!=_iterator3["return"])_iterator3["return"]()}finally{if(_didIteratorError3)throw _iteratorError3;}}pageOpList.addOp(_util.OPS.endAnnotations,
|
|
634
634
|
[]);pageOpList.flush(!0);return{length:pageOpList.totalLength}})})}},{key:"extractTextContent",value:function(_ref7){var _this3=this,handler=_ref7.handler,task=_ref7.task,normalizeWhitespace=_ref7.normalizeWhitespace,sink=_ref7.sink,combineTextItems=_ref7.combineTextItems;_ref7=this.pdfManager.ensure(this,"getContentStream");var resourcesPromise=this.loadResources(["ExtGState","XObject","Font"]);return Promise.all([_ref7,resourcesPromise]).then(function(_ref8){_ref8=_slicedToArray(_ref8,1)[0];return(new _evaluator.PartialEvaluator({xref:_this3.xref,
|
|
635
635
|
handler:handler,pageIndex:_this3.pageIndex,idFactory:_this3.idFactory,fontCache:_this3.fontCache,builtInCMapCache:_this3.builtInCMapCache,options:_this3.evaluatorOptions,pdfFunctionFactory:_this3.pdfFunctionFactory})).getTextContent({stream:_ref8,task:task,resources:_this3.resources,normalizeWhitespace:normalizeWhitespace,combineTextItems:combineTextItems,sink:sink})})}},{key:"getAnnotationsData",value:function(intent){return this._parsedAnnotations.then(function(annotations){for(var annotationsData=
|
|
636
636
|
[],i=0,ii=annotations.length;i<ii;i++)intent&&!isAnnotationRenderable(annotations[i],intent)||annotationsData.push(annotations[i].data);return annotationsData})}},{key:"content",get:function(){return this.pageDict.get("Contents")}},{key:"resources",get:function(){return(0,_util.shadow)(this,"resources",this._getInheritableProperty("Resources")||_primitives.Dict.empty)}},{key:"mediaBox",get:function(){return(0,_util.shadow)(this,"mediaBox",this._getBoundingBox("MediaBox")||LETTER_SIZE_MEDIABOX)}},
|
|
637
637
|
{key:"cropBox",get:function(){return(0,_util.shadow)(this,"cropBox",this._getBoundingBox("CropBox")||this.mediaBox)}},{key:"userUnit",get:function(){var obj=this.pageDict.get("UserUnit");if(!(0,_util.isNum)(obj)||0>=obj)obj=1;return(0,_util.shadow)(this,"userUnit",obj)}},{key:"view",get:function(){var cropBox=this.cropBox,mediaBox=this.mediaBox;if(cropBox===mediaBox||(0,_util.isArrayEqual)(cropBox,mediaBox))var view=mediaBox;else(cropBox=_util.Util.intersect(cropBox,mediaBox))&&0!==cropBox[2]-cropBox[0]&&
|
|
638
638
|
0!==cropBox[3]-cropBox[1]?view=cropBox:(0,_util.warn)("Empty /CropBox and /MediaBox intersection.");return(0,_util.shadow)(this,"view",view||mediaBox)}},{key:"rotate",get:function(){var rotate=this._getInheritableProperty("Rotate")||0;0!==rotate%90?rotate=0:360<=rotate?rotate%=360:0>rotate&&(rotate=(rotate%360+360)%360);return(0,_util.shadow)(this,"rotate",rotate)}},{key:"annotations",get:function(){return(0,_util.shadow)(this,"annotations",this._getInheritableProperty("Annots")||[])}},{key:"_parsedAnnotations",
|
|
639
|
-
get:function(){var _this4=this,parsedAnnotations=this.pdfManager.ensure(this,"annotations").then(function(){for(var annotationRefs=_this4.annotations,annotationPromises=[],i=0,ii=annotationRefs.length;i<
|
|
639
|
+
get:function(){var _this4=this,parsedAnnotations=this.pdfManager.ensure(this,"annotations").then(function(){function isInkOverlapping(inkAnnotation,widgetAnnotation){widgetAnnotation=widgetAnnotation.rectangle;inkAnnotation=inkAnnotation.rectangle;return!(widgetAnnotation[0]>inkAnnotation[2]||inkAnnotation[0]>widgetAnnotation[2]||widgetAnnotation[1]>inkAnnotation[3]||inkAnnotation[1]>widgetAnnotation[3])}for(var annotationRefs=_this4.annotations,annotationPromises=[],i=0,ii=annotationRefs.length;i<
|
|
640
|
+
ii;i++)annotationPromises.push(_annotation.AnnotationFactory.create(_this4.xref,annotationRefs[i],_this4.pdfManager,_this4.idFactory,annotationRefs));return Promise.all(annotationPromises).then(function(annotations){var _annotations$reduce=annotations.reduce(function(acc,annot){"InkAnnotation"===annot.type&&acc[1].push(annot);"Sig"===annot.data.fieldType&&acc[0].push(annot);return acc},[[],[]]),_annotations$reduce2=_slicedToArray(_annotations$reduce,2);_annotations$reduce=_annotations$reduce2[0];
|
|
641
|
+
var inks=_annotations$reduce2[1];_annotations$reduce2=!0;var _didIteratorError4=!1,_iteratorError4=void 0;try{for(var _iterator4=inks[Symbol.iterator](),_step4;!(_annotations$reduce2=(_step4=_iterator4.next()).done);_annotations$reduce2=!0){var ink=_step4.value;inks=!0;var _didIteratorError5=!1,_iteratorError5=void 0;try{for(var _iterator5=_annotations$reduce[Symbol.iterator](),_step5;!(inks=(_step5=_iterator5.next()).done);inks=!0){var widget=_step5.value;isInkOverlapping(ink,widget)&&(widget.data.blockRender=
|
|
642
|
+
!0)}}catch(err){_didIteratorError5=!0,_iteratorError5=err}finally{try{if(!inks&&null!=_iterator5["return"])_iterator5["return"]()}finally{if(_didIteratorError5)throw _iteratorError5;}}}}catch(err$8){_didIteratorError4=!0,_iteratorError4=err$8}finally{try{if(!_annotations$reduce2&&null!=_iterator4["return"])_iterator4["return"]()}finally{if(_didIteratorError4)throw _iteratorError4;}}return annotations.filter(function(annotation){return!!annotation})},function(reason){(0,_util.warn)('_parsedAnnotations: "'.concat(reason,
|
|
640
643
|
'".'));return[]})});return(0,_util.shadow)(this,"_parsedAnnotations",parsedAnnotations)}}]);return Page}();exports.Page=Page;var PDF_HEADER_SIGNATURE=new Uint8Array([37,80,68,70,45]),STARTXREF_SIGNATURE=new Uint8Array([115,116,97,114,116,120,114,101,102]),ENDOBJ_SIGNATURE=new Uint8Array([101,110,100,111,98,106]);module=function(){function PDFDocument(pdfManager,arg){_classCallCheck(this,PDFDocument);if(!(0,_primitives.isStream)(arg))if((0,_util.isArrayBuffer)(arg))arg=new _stream2.Stream(arg);else throw Error("PDFDocument: Unknown argument type");
|
|
641
644
|
if(0>=arg.length)throw new _util.InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=pdfManager;this.stream=arg;this.xref=new _obj.XRef(arg,pdfManager);this.pdfFunctionFactory=new _function.PDFFunctionFactory({xref:this.xref,isEvalSupported:pdfManager.evaluatorOptions.isEvalSupported});this._pagePromises=[]}_createClass(PDFDocument,[{key:"parse",value:function(recoveryMode){this.setup(recoveryMode);recoveryMode=this.catalog.catDict.get("Version");(0,_primitives.isName)(recoveryMode)&&
|
|
642
645
|
(this.pdfFormatVersion=recoveryMode.name);try{if(this.acroForm=this.catalog.catDict.get("AcroForm")){this.xfa=this.acroForm.get("XFA");var fields=this.acroForm.get("Fields");Array.isArray(fields)&&0!==fields.length||this.xfa||(this.acroForm=null)}}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;(0,_util.info)("Cannot fetch AcroForm entry; assuming no AcroForms are present");this.acroForm=null}try{var collection=this.catalog.catDict.get("Collection");(0,_primitives.isDict)(collection)&&
|
|
643
|
-
0<collection.getKeys().length&&(this.collection=collection)}catch(ex$
|
|
646
|
+
0<collection.getKeys().length&&(this.collection=collection)}catch(ex$9){if(ex$9 instanceof _core_utils.MissingDataException)throw ex$9;(0,_util.info)("Cannot fetch Collection dictionary.")}}},{key:"checkHeader",value:function(){var stream=this.stream;stream.reset();if(find(stream,PDF_HEADER_SIGNATURE)){stream.moveStart();for(var version="",ch;32<(ch=stream.getByte())&&!(12<=version.length);)version+=String.fromCharCode(ch);this.pdfFormatVersion||(this.pdfFormatVersion=version.substring(5))}}},{key:"parseStartXRef",
|
|
644
647
|
value:function(){this.xref.setStartXRef(this.startXRef)}},{key:"setup",value:function(recoveryMode){this.xref.parse(recoveryMode);this.catalog=new _obj.Catalog(this.pdfManager,this.xref)}},{key:"_getLinearizationPage",value:function(pageIndex){var catalog=this.catalog,linearization=this.linearization;(0,_util.assert)(linearization&&linearization.pageFirst===pageIndex);var ref=_primitives.Ref.get(linearization.objectNumberFirst,0);return this.xref.fetchAsync(ref).then(function(obj){if((0,_primitives.isDict)(obj,
|
|
645
648
|
"Page")||(0,_primitives.isDict)(obj)&&!obj.has("Type")&&obj.has("Contents"))return ref&&!catalog.pageKidsCountCache.has(ref)&&catalog.pageKidsCountCache.put(ref,1),[obj,ref];throw new _util.FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.");})["catch"](function(reason){(0,_util.info)(reason);return catalog.getPageDict(pageIndex)})}},{key:"getPage",value:function(pageIndex){var _this5=this;if(void 0!==this._pagePromises[pageIndex])return this._pagePromises[pageIndex];
|
|
646
649
|
var catalog=this.catalog,linearization=this.linearization;linearization=linearization&&linearization.pageFirst===pageIndex?this._getLinearizationPage(pageIndex):catalog.getPageDict(pageIndex);return this._pagePromises[pageIndex]=linearization.then(function(_ref10){_ref10=_slicedToArray(_ref10,2);return new Page({pdfManager:_this5.pdfManager,xref:_this5.xref,pageIndex:pageIndex,pageDict:_ref10[0],ref:_ref10[1],fontCache:catalog.fontCache,builtInCMapCache:catalog.builtInCMapCache,pdfFunctionFactory:_this5.pdfFunctionFactory})})}},
|
|
647
650
|
{key:"checkFirstPage",value:function(){var _this6=this;return this.getPage(0)["catch"](function(){var _ref12=_asyncToGenerator(_regenerator["default"].mark(function _callee(reason){return _regenerator["default"].wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(!(reason instanceof _core_utils.XRefEntryException)){_context.next=5;break}_this6._pagePromises.length=0;_context.next=4;return _this6.cleanup();case 4:throw new _core_utils.XRefParseException;case 5:case "end":return _context.stop()}},
|
|
648
651
|
_callee)}));return function(_x){return _ref12.apply(this,arguments)}}())}},{key:"fontFallback",value:function(id,handler){return this.catalog.fontFallback(id,handler)}},{key:"cleanup",value:function(){return this.catalog.cleanup()}},{key:"linearization",get:function(){var linearization=null;try{linearization=_parser.Linearization.create(this.stream)}catch(err){if(err instanceof _core_utils.MissingDataException)throw err;(0,_util.info)(err)}return(0,_util.shadow)(this,"linearization",linearization)}},
|
|
649
652
|
{key:"startXRef",get:function(){var stream=this.stream,startXRef=0;if(this.linearization)stream.reset(),find(stream,ENDOBJ_SIGNATURE)&&(startXRef=stream.pos+6-stream.start);else{for(var startXRefLength=STARTXREF_SIGNATURE.length,found=!1,pos=stream.end;!found&&0<pos;)pos-=1024-startXRefLength,0>pos&&(pos=0),stream.pos=pos,found=find(stream,STARTXREF_SIGNATURE,1024,!0);if(found){stream.skip(9);do startXRef=stream.getByte();while((0,_util.isSpace)(startXRef));for(startXRefLength="";32<=startXRef&&57>=
|
|
650
|
-
startXRef;)startXRefLength+=String.fromCharCode(startXRef),startXRef=stream.getByte();startXRef=parseInt(startXRefLength,10);isNaN(startXRef)&&(startXRef=0)}}return(0,_util.shadow)(this,"startXRef",startXRef)}},{key:"numPages",get:function(){var linearization=this.linearization;
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
Object.
|
|
657
|
-
p
|
|
658
|
-
resolve,reject,_next,_throw,"
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
style
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
return(0,_util.shadow)(this,"
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
if(ViewerPreferencesValidators[key](value)){var prefValue=void 0;switch(key){case "NonFullScreenPageMode":switch(value.name){case "UseNone":case "UseOutlines":case "UseThumbs":case "UseOC":prefValue=value.name;break;default:prefValue="UseNone"}break;case "Direction":switch(value.name){case "L2R":case "R2L":prefValue=value.name;break;default:prefValue="L2R"}break;case "ViewArea":case "ViewClip":case "PrintArea":case "PrintClip":switch(value.name){case "MediaBox":case "CropBox":case "BleedBox":case "TrimBox":case "ArtBox":prefValue=
|
|
653
|
+
startXRef;)startXRefLength+=String.fromCharCode(startXRef),startXRef=stream.getByte();startXRef=parseInt(startXRefLength,10);isNaN(startXRef)&&(startXRef=0)}}return(0,_util.shadow)(this,"startXRef",startXRef)}},{key:"numPages",get:function(){var linearization=this.linearization;return(0,_util.shadow)(this,"numPages",linearization?linearization.numPages:this.catalog.numPages)}},{key:"documentInfo",get:function(){var DocumentInfoValidators={Title:_util.isString,Author:_util.isString,Subject:_util.isString,
|
|
654
|
+
Keywords:_util.isString,Creator:_util.isString,Producer:_util.isString,CreationDate:_util.isString,ModDate:_util.isString,Trapped:_primitives.isName},docInfo={PDFFormatVersion:this.pdfFormatVersion,IsLinearized:!!this.linearization,IsAcroFormPresent:!!this.acroForm,IsXFAPresent:!!this.xfa,IsCollectionPresent:!!this.collection};try{var infoDict=this.xref.trailer.get("Info")}catch(err){if(err instanceof _core_utils.MissingDataException)throw err;(0,_util.info)("The document information dictionary is invalid.")}if((0,_primitives.isDict)(infoDict)){var _iteratorNormalCompletion6=
|
|
655
|
+
!0,_didIteratorError6=!1,_iteratorError6=void 0;try{for(var _iterator6=infoDict.getKeys()[Symbol.iterator](),_step6;!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=!0){var key=_step6.value,value=infoDict.get(key);if(DocumentInfoValidators[key])DocumentInfoValidators[key](value)?docInfo[key]="string"!==typeof value?value:(0,_util.stringToPDFString)(value):(0,_util.info)('Bad value in document info for "'.concat(key,'".'));else if("string"===typeof key){var customValue=
|
|
656
|
+
void 0;if((0,_util.isString)(value))customValue=(0,_util.stringToPDFString)(value);else if((0,_primitives.isName)(value)||(0,_util.isNum)(value)||(0,_util.isBool)(value))customValue=value;else{(0,_util.info)('Unsupported value in document info for (custom) "'.concat(key,'".'));continue}docInfo.Custom||(docInfo.Custom=Object.create(null));docInfo.Custom[key]=customValue}}}catch(err$10){_didIteratorError6=!0,_iteratorError6=err$10}finally{try{if(!_iteratorNormalCompletion6&&null!=_iterator6["return"])_iterator6["return"]()}finally{if(_didIteratorError6)throw _iteratorError6;
|
|
657
|
+
}}}return(0,_util.shadow)(this,"documentInfo",docInfo)}},{key:"fingerprint",get:function(){var hash=this.xref.trailer.get("ID");hash=Array.isArray(hash)&&hash[0]&&(0,_util.isString)(hash[0])&&"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"!==hash[0]?(0,_util.stringToBytes)(hash[0]):(0,_crypto.calculateMD5)(this.stream.getByteRange(0,1024),0,1024);for(var fingerprintBuf=[],i=0,ii=hash.length;i<ii;i++){var hex=hash[i].toString(16);fingerprintBuf.push(hex.padStart(2,"0"))}return(0,_util.shadow)(this,
|
|
658
|
+
"fingerprint",fingerprintBuf.join(""))}}]);return PDFDocument}();exports.PDFDocument=module},function(module,exports,__w_pdfjs_require__){function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"===typeof call))return call;if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||
|
|
659
|
+
Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,
|
|
660
|
+
p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,
|
|
661
|
+
resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");
|
|
662
|
+
}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}function fetchDestination(dest){return(0,_primitives.isDict)(dest)?
|
|
663
|
+
dest.get("D"):dest}Object.defineProperty(exports,"__esModule",{value:!0});exports.FileSpec=exports.XRef=exports.ObjectLoader=exports.Catalog=void 0;var _regenerator=function(obj){return obj&&obj.__esModule?obj:{"default":obj}}(__w_pdfjs_require__(2)),_util=__w_pdfjs_require__(5),_primitives=__w_pdfjs_require__(188),_parser=__w_pdfjs_require__(194),_core_utils=__w_pdfjs_require__(191),_crypto=__w_pdfjs_require__(205),_colorspace=__w_pdfjs_require__(206);module=function(){function Catalog(pdfManager,
|
|
664
|
+
xref){_classCallCheck(this,Catalog);this.pdfManager=pdfManager;this.xref=xref;this.catDict=xref.getCatalogObj();if(!(0,_primitives.isDict)(this.catDict))throw new _util.FormatError("Catalog object is not a dictionary.");this.fontCache=new _primitives.RefSetCache;this.builtInCMapCache=new Map;this.pageKidsCountCache=new _primitives.RefSetCache}_createClass(Catalog,[{key:"_readDocumentOutline",value:function(){var obj=this.catDict.get("Outlines");if(!(0,_primitives.isDict)(obj))return null;obj=obj.getRaw("First");
|
|
665
|
+
if(!(0,_primitives.isRef)(obj))return null;var root={items:[]},queue=[{obj:obj,parent:root}],processed=new _primitives.RefSet;processed.put(obj);for(var xref=this.xref,blackColor=new Uint8ClampedArray(3);0<queue.length;){var i=queue.shift(),outlineDict=xref.fetchIfRef(i.obj);if(null!==outlineDict){if(!outlineDict.has("Title"))throw new _util.FormatError("Invalid outline item encountered.");obj={url:null,dest:null};Catalog.parseDestDictionary({destDict:outlineDict,resultObj:obj,docBaseUrl:this.pdfManager.docBaseUrl});
|
|
666
|
+
var title=outlineDict.get("Title"),flags=outlineDict.get("F")||0,color=outlineDict.getArray("C"),count=outlineDict.get("Count"),rgbColor=blackColor;!Array.isArray(color)||3!==color.length||0===color[0]&&0===color[1]&&0===color[2]||(rgbColor=_colorspace.ColorSpace.singletons.rgb.getRgb(color,0));title={dest:obj.dest,url:obj.url,unsafeUrl:obj.unsafeUrl,newWindow:obj.newWindow,title:(0,_util.stringToPDFString)(title),color:rgbColor,count:Number.isInteger(count)?count:void 0,bold:!!(flags&2),italic:!!(flags&
|
|
667
|
+
1),items:[]};i.parent.items.push(title);obj=outlineDict.getRaw("First");(0,_primitives.isRef)(obj)&&!processed.has(obj)&&(queue.push({obj:obj,parent:title}),processed.put(obj));obj=outlineDict.getRaw("Next");(0,_primitives.isRef)(obj)&&!processed.has(obj)&&(queue.push({obj:obj,parent:i.parent}),processed.put(obj))}}return 0<root.items.length?root.items:null}},{key:"_readPermissions",value:function(){var encrypt=this.xref.trailer.get("Encrypt");if(!(0,_primitives.isDict)(encrypt))return null;encrypt=
|
|
668
|
+
encrypt.get("P");if(!(0,_util.isNum)(encrypt))return null;encrypt+=Math.pow(2,32);var permissions=[],key;for(key in _util.PermissionFlag){var value=_util.PermissionFlag[key];encrypt&value&&permissions.push(value)}return permissions}},{key:"getDestination",value:function(destinationId){var obj=this._readDests();return obj instanceof NameTree||obj instanceof _primitives.Dict?fetchDestination(obj.get(destinationId)||null):null}},{key:"_readDests",value:function(){var obj=this.catDict.get("Names");if(obj&&
|
|
669
|
+
obj.has("Dests"))return new NameTree(obj.getRaw("Dests"),this.xref);if(this.catDict.has("Dests"))return this.catDict.get("Dests")}},{key:"_readPageLabels",value:function(){var obj=this.catDict.getRaw("PageLabels");if(!obj)return null;var pageLabels=Array(this.numPages),style=null,prefix="";obj=(new NumberTree(obj,this.xref)).getAll();for(var currentLabel,currentIndex=1,i=0,ii=this.numPages;i<ii;i++){if(i in obj){currentIndex=obj[i];if(!(0,_primitives.isDict)(currentIndex))throw new _util.FormatError("PageLabel is not a dictionary.");
|
|
670
|
+
if(currentIndex.has("Type")&&!(0,_primitives.isName)(currentIndex.get("Type"),"PageLabel"))throw new _util.FormatError("Invalid type in PageLabel dictionary.");if(currentIndex.has("S")){style=currentIndex.get("S");if(!(0,_primitives.isName)(style))throw new _util.FormatError("Invalid style in PageLabel dictionary.");style=style.name}else style=null;if(currentIndex.has("P")){prefix=currentIndex.get("P");if(!(0,_util.isString)(prefix))throw new _util.FormatError("Invalid prefix in PageLabel dictionary.");
|
|
671
|
+
prefix=(0,_util.stringToPDFString)(prefix)}else prefix="";if(currentIndex.has("St")){if(currentIndex=currentIndex.get("St"),!(Number.isInteger(currentIndex)&&1<=currentIndex))throw new _util.FormatError("Invalid start in PageLabel dictionary.");}else currentIndex=1}switch(style){case "D":currentLabel=currentIndex;break;case "R":case "r":currentLabel=(0,_core_utils.toRomanNumerals)(currentIndex,"r"===style);break;case "A":case "a":var letterIndex=currentIndex-1;currentLabel=String.fromCharCode(("a"===
|
|
672
|
+
style?97:65)+letterIndex%26);var charBuf=[],j=0;for(letterIndex=letterIndex/26|0;j<=letterIndex;j++)charBuf.push(currentLabel);currentLabel=charBuf.join("");break;default:if(style)throw new _util.FormatError('Invalid style "'.concat(style,'" in PageLabel dictionary.'));currentLabel=""}pageLabels[i]=prefix+currentLabel;currentIndex++}return pageLabels}},{key:"fontFallback",value:function(id,handler){var promises=[];this.fontCache.forEach(function(promise){promises.push(promise)});return Promise.all(promises).then(function(translatedFonts){var _iteratorNormalCompletion=
|
|
673
|
+
!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _iterator=translatedFonts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var translatedFont=_step.value;if(translatedFont.loadedName===id){translatedFont.fallback(handler);break}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&null!=_iterator["return"])_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}})}},
|
|
674
|
+
{key:"cleanup",value:function(){var _this=this;(0,_primitives.clearPrimitiveCaches)();this.pageKidsCountCache.clear();var promises=[];this.fontCache.forEach(function(promise){promises.push(promise)});return Promise.all(promises).then(function(translatedFonts){var _iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _iterator2=translatedFonts[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0)delete _step2.value.dict.translated}catch(err){_didIteratorError2=
|
|
675
|
+
!0,_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&null!=_iterator2["return"])_iterator2["return"]()}finally{if(_didIteratorError2)throw _iteratorError2;}}_this.fontCache.clear();_this.builtInCMapCache.clear()})}},{key:"getPageDict",value:function(pageIndex){function next(){for(var _loop=function(){var currentNode=nodesToVisit.pop();if((0,_primitives.isRef)(currentNode)){count=pageKidsCountCache.get(currentNode);if(0<count&¤tPageIndex+count<pageIndex)return currentPageIndex+=
|
|
676
|
+
count,"continue";xref.fetchAsync(currentNode).then(function(obj){(0,_primitives.isDict)(obj,"Page")||(0,_primitives.isDict)(obj)&&!obj.has("Kids")?pageIndex===currentPageIndex?(currentNode&&!pageKidsCountCache.has(currentNode)&&pageKidsCountCache.put(currentNode,1),capability.resolve([obj,currentNode])):(currentPageIndex++,next()):(nodesToVisit.push(obj),next())},capability.reject);return{v:void 0}}if(!(0,_primitives.isDict)(currentNode))return capability.reject(new _util.FormatError("Page dictionary kid reference points to wrong type of object.")),
|
|
677
|
+
{v:void 0};count=currentNode.get("Count");if(Number.isInteger(count)&&0<=count){var objId=currentNode.objId;objId&&!pageKidsCountCache.has(objId)&&pageKidsCountCache.put(objId,count);if(currentPageIndex+count<=pageIndex)return currentPageIndex+=count,"continue"}objId=currentNode.get("Kids");if(!Array.isArray(objId)){if((0,_primitives.isName)(currentNode.get("Type"),"Page")||!currentNode.has("Type")&¤tNode.has("Contents")){if(currentPageIndex===pageIndex)return capability.resolve([currentNode,
|
|
678
|
+
null]),{v:void 0};currentPageIndex++;return"continue"}capability.reject(new _util.FormatError("Page dictionary kids object is not an array."));return{v:void 0}}for(var last=objId.length-1;0<=last;last--)nodesToVisit.push(objId[last])};nodesToVisit.length;){var _ret=_loop();switch(_ret){case "continue":continue;default:if("object"===_typeof(_ret))return _ret.v}}capability.reject(Error("Page index ".concat(pageIndex," not found.")))}var capability=(0,_util.createPromiseCapability)(),nodesToVisit=[this.catDict.getRaw("Pages")],
|
|
679
|
+
xref=this.xref,pageKidsCountCache=this.pageKidsCountCache,count,currentPageIndex=0;next();return capability.promise}},{key:"getPageIndex",value:function(pageRef){function pagesBeforeRef(kidRef){var total=0,parentRef;return xref.fetchAsync(kidRef).then(function(node){if((0,_primitives.isRefsEqual)(kidRef,pageRef)&&!(0,_primitives.isDict)(node,"Page")&&(!(0,_primitives.isDict)(node)||node.has("Type")||!node.has("Contents")))throw new _util.FormatError("The reference does not point to a /Page dictionary.");
|
|
680
|
+
if(!node)return null;if(!(0,_primitives.isDict)(node))throw new _util.FormatError("Node must be a dictionary.");parentRef=node.getRaw("Parent");return node.getAsync("Parent")}).then(function(parent){if(!parent)return null;if(!(0,_primitives.isDict)(parent))throw new _util.FormatError("Parent must be a dictionary.");return parent.getAsync("Kids")}).then(function(kids){if(!kids)return null;for(var kidPromises=[],found=!1,i=0,ii=kids.length;i<ii;i++){var kid=kids[i];if(!(0,_primitives.isRef)(kid))throw new _util.FormatError("Kid must be a reference.");
|
|
681
|
+
if((0,_primitives.isRefsEqual)(kid,kidRef)){found=!0;break}kidPromises.push(xref.fetchAsync(kid).then(function(kid){if(!(0,_primitives.isDict)(kid))throw new _util.FormatError("Kid node must be a dictionary.");kid.has("Count")?total+=kid.get("Count"):total++}))}if(!found)throw new _util.FormatError("Kid reference not found in parent's kids.");return Promise.all(kidPromises).then(function(){return[total,parentRef]})})}function next(ref){return pagesBeforeRef(ref).then(function(args){if(!args)return total;
|
|
682
|
+
var JSCompiler_temp=Array.isArray(args)?args:void 0;if(!JSCompiler_temp)if(Symbol.iterator in Object(args)||"[object Arguments]"===Object.prototype.toString.call(args)){JSCompiler_temp=[];var _n=!0,_d=!1,_e=void 0;try{for(var _i=args[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(JSCompiler_temp.push(_s.value),2!==JSCompiler_temp.length);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i["return"])_i["return"]()}finally{if(_d)throw _e;}}}else JSCompiler_temp=void 0;if(!(args=JSCompiler_temp))throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
683
|
+
_i=args[1];total+=args[0];return next(_i)})}var xref=this.xref,total=0;return next(pageRef)}},{key:"metadata",get:function(){var streamRef=this.catDict.getRaw("Metadata");if(!(0,_primitives.isRef)(streamRef))return(0,_util.shadow)(this,"metadata",null);streamRef=this.xref.fetch(streamRef,!(this.xref.encrypt&&this.xref.encrypt.encryptMetadata));if(streamRef&&(0,_primitives.isDict)(streamRef.dict)){var type=streamRef.dict.get("Type"),subtype=streamRef.dict.get("Subtype");if((0,_primitives.isName)(type,
|
|
684
|
+
"Metadata")&&(0,_primitives.isName)(subtype,"XML"))try{var metadata=(0,_util.stringToUTF8String)((0,_util.bytesToString)(streamRef.getBytes()))}catch(e){if(e instanceof _core_utils.MissingDataException)throw e;(0,_util.info)("Skipping invalid metadata.")}}return(0,_util.shadow)(this,"metadata",metadata)}},{key:"toplevelPagesDict",get:function(){var pagesObj=this.catDict.get("Pages");if(!(0,_primitives.isDict)(pagesObj))throw new _util.FormatError("Invalid top-level pages dictionary.");return(0,_util.shadow)(this,
|
|
685
|
+
"toplevelPagesDict",pagesObj)}},{key:"documentOutline",get:function(){var obj=null;try{obj=this._readDocumentOutline()}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;(0,_util.warn)("Unable to read document outline.")}return(0,_util.shadow)(this,"documentOutline",obj)}},{key:"permissions",get:function(){var permissions=null;try{permissions=this._readPermissions()}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;(0,_util.warn)("Unable to read permissions.")}return(0,_util.shadow)(this,
|
|
686
|
+
"permissions",permissions)}},{key:"numPages",get:function(){var obj=this.toplevelPagesDict.get("Count");if(!Number.isInteger(obj))throw new _util.FormatError("Page count in top-level pages dictionary is not an integer.");return(0,_util.shadow)(this,"numPages",obj)}},{key:"destinations",get:function(){var obj=this._readDests(),dests=Object.create(null);if(obj instanceof NameTree){obj=obj.getAll();for(var name in obj)dests[name]=fetchDestination(obj[name])}else obj instanceof _primitives.Dict&&obj.forEach(function(key,
|
|
687
|
+
value){value&&(dests[key]=fetchDestination(value))});return(0,_util.shadow)(this,"destinations",dests)}},{key:"pageLabels",get:function(){var obj=null;try{obj=this._readPageLabels()}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;(0,_util.warn)("Unable to read page labels.")}return(0,_util.shadow)(this,"pageLabels",obj)}},{key:"pageLayout",get:function(){var obj=this.catDict.get("PageLayout"),pageLayout="";if((0,_primitives.isName)(obj))switch(obj.name){case "SinglePage":case "OneColumn":case "TwoColumnLeft":case "TwoColumnRight":case "TwoPageLeft":case "TwoPageRight":pageLayout=
|
|
688
|
+
obj.name}return(0,_util.shadow)(this,"pageLayout",pageLayout)}},{key:"pageMode",get:function(){var obj=this.catDict.get("PageMode"),pageMode="UseNone";if((0,_primitives.isName)(obj))switch(obj.name){case "UseNone":case "UseOutlines":case "UseThumbs":case "FullScreen":case "UseOC":case "UseAttachments":pageMode=obj.name}return(0,_util.shadow)(this,"pageMode",pageMode)}},{key:"viewerPreferences",get:function(){var _this2=this,ViewerPreferencesValidators={HideToolbar:_util.isBool,HideMenubar:_util.isBool,
|
|
689
|
+
HideWindowUI:_util.isBool,FitWindow:_util.isBool,CenterWindow:_util.isBool,DisplayDocTitle:_util.isBool,NonFullScreenPageMode:_primitives.isName,Direction:_primitives.isName,ViewArea:_primitives.isName,ViewClip:_primitives.isName,PrintArea:_primitives.isName,PrintClip:_primitives.isName,PrintScaling:_primitives.isName,Duplex:_primitives.isName,PickTrayByPDFSize:_util.isBool,PrintPageRange:Array.isArray,NumCopies:Number.isInteger},obj=this.catDict.get("ViewerPreferences"),prefs=Object.create(null);
|
|
690
|
+
if((0,_primitives.isDict)(obj))for(var key in ViewerPreferencesValidators)if(obj.has(key)){var value=obj.get(key);if(ViewerPreferencesValidators[key](value)){var prefValue=void 0;switch(key){case "NonFullScreenPageMode":switch(value.name){case "UseNone":case "UseOutlines":case "UseThumbs":case "UseOC":prefValue=value.name;break;default:prefValue="UseNone"}break;case "Direction":switch(value.name){case "L2R":case "R2L":prefValue=value.name;break;default:prefValue="L2R"}break;case "ViewArea":case "ViewClip":case "PrintArea":case "PrintClip":switch(value.name){case "MediaBox":case "CropBox":case "BleedBox":case "TrimBox":case "ArtBox":prefValue=
|
|
689
691
|
value.name;break;default:prefValue="CropBox"}break;case "PrintScaling":switch(value.name){case "None":case "AppDefault":prefValue=value.name;break;default:prefValue="AppDefault"}break;case "Duplex":switch(value.name){case "Simplex":case "DuplexFlipShortEdge":case "DuplexFlipLongEdge":prefValue=value.name;break;default:prefValue="None"}break;case "PrintPageRange":if(0!==value.length%2)break;value.every(function(page,i,arr){return Number.isInteger(page)&&0<page&&(0===i||page>=arr[i-1])&&page<=_this2.numPages})&&
|
|
690
692
|
(prefValue=value);break;case "NumCopies":0<value&&(prefValue=value);break;default:(0,_util.assert)("boolean"===typeof value),prefValue=value}void 0!==prefValue?prefs[key]=prefValue:(0,_util.info)('Bad value in ViewerPreferences for "'.concat(key,'".'))}else(0,_util.info)('Bad value in ViewerPreferences for "'.concat(key,'".'))}return(0,_util.shadow)(this,"viewerPreferences",prefs)}},{key:"openActionDestination",get:function(){var obj=this.catDict.get("OpenAction"),openActionDest=null;if((0,_primitives.isDict)(obj)){var destDict=
|
|
691
693
|
new _primitives.Dict(this.xref);destDict.set("A",obj);obj={url:null,dest:null};Catalog.parseDestDictionary({destDict:destDict,resultObj:obj});Array.isArray(obj.dest)&&(openActionDest=obj.dest)}else Array.isArray(obj)&&(openActionDest=obj);return(0,_util.shadow)(this,"openActionDestination",openActionDest)}},{key:"attachments",get:function(){var obj=this.catDict.get("Names"),attachments=null;if(obj&&obj.has("EmbeddedFiles")){obj=(new NameTree(obj.getRaw("EmbeddedFiles"),this.xref)).getAll();for(var name in obj){var fs=
|
|
@@ -701,7 +703,7 @@ addDefaultProtocolToUrl(url$jscomp$0));break;case "GoTo":var dest=action$jscomp$
|
|
|
701
703
|
_js=(0,_util.bytesToString)(action.getBytes()):(0,_util.isString)(action)&&(_js=action);resultObj.additionalActions=resultObj.additionalActions||{};resultObj.additionalActions[actionType]={js:_js,actionType:actionType};"C"===actionType&&(_js=destDict.xref.topDict.get("Root").get("AcroForm").get("CO"),resultObj.additionalActions[actionType].calculationOrder=_js.reduce(function(acc,element){element=destDict.xref.fetchIfRef(element).get("T");acc.push(element);return acc},[]))}};dest=destDict.get("AA");
|
|
702
704
|
(0,_primitives.isDict)(dest)&&(url$jscomp$0(dest.get("K"),"K"),url$jscomp$0(dest.get("F"),"F"),url$jscomp$0(dest.get("V"),"V"),url$jscomp$0(dest.get("C"),"C"))}}else(0,_util.warn)("parseDestDictionary: `destDict` must be a dictionary.")}}]);return Catalog}();exports.Catalog=module;module=function(){function XRef(stream,pdfManager){this.stream=stream;this.pdfManager=pdfManager;this.entries=[];this.xrefstms=Object.create(null);this._cacheMap=new Map;this.stats={streamTypes:Object.create(null),fontTypes:Object.create(null)}}
|
|
703
705
|
XRef.prototype={setStartXRef:function(startXRef){this.startXRefQueue=[startXRef]},parse:function(recoveryMode){if(recoveryMode){(0,_util.warn)("Indexing all PDF objects");var trailerDict=this.indexObjects()}else trailerDict=this.readXRef();trailerDict.assignXref(this);this.trailer=trailerDict;try{var encrypt=trailerDict.get("Encrypt")}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;(0,_util.warn)('XRef.parse - Invalid "Encrypt" reference: "'.concat(ex,'".'))}if((0,_primitives.isDict)(encrypt)){var ids=
|
|
704
|
-
trailerDict.get("ID");ids=ids&&ids.length?ids[0]:"";encrypt.suppressEncryption=!0;this.encrypt=new _crypto.CipherTransformFactory(encrypt,ids,this.pdfManager.password)}try{var root=trailerDict.get("Root")}catch(ex$
|
|
706
|
+
trailerDict.get("ID");ids=ids&&ids.length?ids[0]:"";encrypt.suppressEncryption=!0;this.encrypt=new _crypto.CipherTransformFactory(encrypt,ids,this.pdfManager.password)}try{var root=trailerDict.get("Root")}catch(ex$11){if(ex$11 instanceof _core_utils.MissingDataException)throw ex$11;(0,_util.warn)('XRef.parse - Invalid "Root" reference: "'.concat(ex$11,'".'))}if((0,_primitives.isDict)(root)&&root.has("Pages"))this.root=root;else{if(!recoveryMode)throw new _core_utils.XRefParseException;throw new _util.FormatError("Invalid root reference");
|
|
705
707
|
}},processXRefTable:function(parser){"tableState"in this||(this.tableState={entryNum:0,streamPos:parser.lexer.stream.pos,parserBuf1:parser.buf1,parserBuf2:parser.buf2});var obj=this.readXRefTable(parser);if(!(0,_primitives.isCmd)(obj,"trailer"))throw new _util.FormatError("Invalid XRef table: could not find trailer dictionary");parser=parser.getObj();!(0,_primitives.isDict)(parser)&&parser.dict&&(parser=parser.dict);if(!(0,_primitives.isDict)(parser))throw new _util.FormatError("Invalid XRef table: could not parse trailer dictionary");
|
|
706
708
|
delete this.tableState;return parser},readXRefTable:function(parser){var stream=parser.lexer.stream,tableState=this.tableState;stream.pos=tableState.streamPos;parser.buf1=tableState.parserBuf1;parser.buf2=tableState.parserBuf2;for(var obj;;){if(!("firstEntryNum"in tableState&&"entryCount"in tableState)){if((0,_primitives.isCmd)(obj=parser.getObj(),"trailer"))break;tableState.firstEntryNum=obj;tableState.entryCount=parser.getObj()}obj=tableState.firstEntryNum;var count=tableState.entryCount;if(!Number.isInteger(obj)||
|
|
707
709
|
!Number.isInteger(count))throw new _util.FormatError("Invalid XRef table: wrong types in subsection header");for(var i=tableState.entryNum;i<count;i++){tableState.streamPos=stream.pos;tableState.entryNum=i;tableState.parserBuf1=parser.buf1;tableState.parserBuf2=parser.buf2;var entry={};entry.offset=parser.getObj();entry.gen=parser.getObj();var type=parser.getObj();if(type instanceof _primitives.Cmd)switch(type.cmd){case "f":entry.free=!0;break;case "n":entry.uncompressed=!0}if(!Number.isInteger(entry.offset)||
|
|
@@ -712,42 +714,42 @@ for(var typeFieldWidth=i[0],offsetFieldWidth=i[1],generationFieldWidth=i[2],entr
|
|
|
712
714
|
}this.entries[first+i]||(this.entries[first+i]=j)}streamState.entryNum=0;streamState.streamPos=stream.pos;entryRanges.splice(0,2)}},indexObjects:function(){function readToken(data,offset){for(var token="",ch=data[offset];10!==ch&&13!==ch&&60!==ch&&!(++offset>=data.length);)token+=String.fromCharCode(ch),ch=data[offset];return token}function skipUntil(data,offset,what){for(var length=what.length,dataLength=data.length,skipped=0;offset<dataLength;){for(var i=0;i<length&&data[offset+i]===what[i];)++i;
|
|
713
715
|
if(i>=length)break;offset++;skipped++}return skipped}var objRegExp=/^(\d+)\s+(\d+)\s+obj\b/,endobjRegExp=/\bendobj[\b\s]$/,nestedObjRegExp=/\s+(\d+\s+\d+\s+obj[\b\s<])$/,trailerBytes=new Uint8Array([116,114,97,105,108,101,114]),startxrefBytes=new Uint8Array([115,116,97,114,116,120,114,101,102]),objBytes=new Uint8Array([111,98,106]),xrefBytes=new Uint8Array([47,88,82,101,102]);this.entries.length=0;var stream=this.stream;stream.pos=0;for(var buffer=stream.getBytes(),position=stream.start,length$jscomp$0=
|
|
714
716
|
buffer.length,trailers=[],xrefStms=[];position<length$jscomp$0;){var ch$jscomp$0=buffer[position];if(9===ch$jscomp$0||10===ch$jscomp$0||13===ch$jscomp$0||32===ch$jscomp$0)++position;else if(37===ch$jscomp$0){do{++position;if(position>=length$jscomp$0)break;ch$jscomp$0=buffer[position]}while(10!==ch$jscomp$0&&13!==ch$jscomp$0)}else{var token$jscomp$0=readToken(buffer,position),m;if(token$jscomp$0.startsWith("xref")&&(4===token$jscomp$0.length||/\s/.test(token$jscomp$0[4])))position+=skipUntil(buffer,
|
|
715
|
-
position,trailerBytes),trailers.push(position),position+=skipUntil(buffer,position,startxrefBytes);else if(m=objRegExp.exec(token$jscomp$0)){ch$jscomp$0=m[1]|0;m=m[2]|0;this.entries[ch$jscomp$0]&&this.entries[ch$jscomp$0].gen!==m||(this.entries[ch$jscomp$0]={offset:position-stream.start,gen:m,uncompressed:!0});ch$jscomp$0=void 0;for(m=position+token$jscomp$0.length;m<buffer.length;){token$jscomp$0=m+skipUntil(buffer,m,objBytes)+4;ch$jscomp$0=token$jscomp$0-position;m=Math.max(token$jscomp$0-
|
|
716
|
-
m
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
cacheEntry=
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
if(
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
"
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
717
|
+
position,trailerBytes),trailers.push(position),position+=skipUntil(buffer,position,startxrefBytes);else if(m=objRegExp.exec(token$jscomp$0)){ch$jscomp$0=m[1]|0;m=m[2]|0;this.entries[ch$jscomp$0]&&this.entries[ch$jscomp$0].gen!==m||(this.entries[ch$jscomp$0]={offset:position-stream.start,gen:m,uncompressed:!0});ch$jscomp$0=void 0;for(m=position+token$jscomp$0.length;m<buffer.length;){token$jscomp$0=m+skipUntil(buffer,m,objBytes)+4;ch$jscomp$0=token$jscomp$0-position;m=(0,_util.bytesToString)(buffer.subarray(Math.max(token$jscomp$0-
|
|
718
|
+
25,m),token$jscomp$0));if(endobjRegExp.test(m))break;else if((m=nestedObjRegExp.exec(m))&&m[1]){(0,_util.warn)('indexObjects: Found new "obj" inside of another "obj", caused by missing "endobj" -- trying to recover.');ch$jscomp$0-=m[1].length;break}m=token$jscomp$0}token$jscomp$0=buffer.subarray(position,position+ch$jscomp$0);m=skipUntil(token$jscomp$0,0,xrefBytes);m<ch$jscomp$0&&64>token$jscomp$0[m+5]&&(xrefStms.push(position-stream.start),this.xrefstms[position-stream.start]=1);position+=ch$jscomp$0}else token$jscomp$0.startsWith("trailer")&&
|
|
719
|
+
(7===token$jscomp$0.length||/\s/.test(token$jscomp$0[7]))?(trailers.push(position),position+=skipUntil(buffer,position,startxrefBytes)):position+=token$jscomp$0.length+1}}objRegExp=0;for(endobjRegExp=xrefStms.length;objRegExp<endobjRegExp;++objRegExp)this.startXRefQueue.push(xrefStms[objRegExp]),this.readXRef(!0);objRegExp=0;for(endobjRegExp=trailers.length;objRegExp<endobjRegExp;++objRegExp)if(stream.pos=trailers[objRegExp],xrefStms=new _parser.Parser({lexer:new _parser.Lexer(stream),xref:this,allowStreams:!0,
|
|
720
|
+
recoveryMode:!0}),nestedObjRegExp=xrefStms.getObj(),(0,_primitives.isCmd)(nestedObjRegExp,"trailer")&&(xrefStms=xrefStms.getObj(),(0,_primitives.isDict)(xrefStms))){nestedObjRegExp=void 0;try{nestedObjRegExp=xrefStms.get("Root")}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;continue}if((0,_primitives.isDict)(nestedObjRegExp)&&nestedObjRegExp.has("Pages")){if(xrefStms.has("ID"))return xrefStms;var trailerDict=xrefStms}}if(trailerDict)return trailerDict;throw new _util.InvalidPDFException("Invalid PDF structure.");
|
|
721
|
+
},readXRef:function(recoveryMode){var stream=this.stream,startXRefParsedCache=Object.create(null);try{for(;this.startXRefQueue.length;){var startXRef=this.startXRefQueue[0];if(startXRefParsedCache[startXRef])(0,_util.warn)("readXRef - skipping XRef table since it was already parsed.");else{startXRefParsedCache[startXRef]=!0;stream.pos=startXRef+stream.start;var parser=new _parser.Parser({lexer:new _parser.Lexer(stream),xref:this,allowStreams:!0}),obj=parser.getObj();if((0,_primitives.isCmd)(obj,"xref")){var dict=
|
|
722
|
+
this.processXRefTable(parser);this.topDict||(this.topDict=dict);obj=dict.get("XRefStm");if(Number.isInteger(obj)){var pos=obj;pos in this.xrefstms||(this.xrefstms[pos]=1,this.startXRefQueue.push(pos))}}else if(Number.isInteger(obj)){if(!Number.isInteger(parser.getObj())||!(0,_primitives.isCmd)(parser.getObj(),"obj")||!(0,_primitives.isStream)(obj=parser.getObj()))throw new _util.FormatError("Invalid XRef stream");dict=this.processXRefStream(obj);this.topDict||(this.topDict=dict);if(!dict)throw new _util.FormatError("Failed to read XRef stream");
|
|
723
|
+
}else throw new _util.FormatError("Invalid XRef stream header");obj=dict.get("Prev");Number.isInteger(obj)?this.startXRefQueue.push(obj):(0,_primitives.isRef)(obj)&&this.startXRefQueue.push(obj.num)}this.startXRefQueue.shift()}return this.topDict}catch(e){if(e instanceof _core_utils.MissingDataException)throw e;(0,_util.info)("(while reading XRef): "+e)}if(!recoveryMode)throw new _core_utils.XRefParseException;},getEntry:function(i){return(i=this.entries[i])&&!i.free&&i.offset?i:null},fetchIfRef:function(obj,
|
|
724
|
+
suppressEncryption){return obj instanceof _primitives.Ref?this.fetch(obj,suppressEncryption):obj},fetch:function(ref,suppressEncryption){if(!(ref instanceof _primitives.Ref))throw Error("ref object is not a reference");var num=ref.num,cacheEntry=this._cacheMap.get(num);if(void 0!==cacheEntry)return cacheEntry instanceof _primitives.Dict&&!cacheEntry.objId&&(cacheEntry.objId=ref.toString()),cacheEntry;cacheEntry=this.getEntry(num);if(null===cacheEntry)return this._cacheMap.set(num,cacheEntry),cacheEntry;
|
|
725
|
+
cacheEntry=cacheEntry.uncompressed?this.fetchUncompressed(ref,cacheEntry,suppressEncryption):this.fetchCompressed(ref,cacheEntry,suppressEncryption);(0,_primitives.isDict)(cacheEntry)?cacheEntry.objId=ref.toString():(0,_primitives.isStream)(cacheEntry)&&(cacheEntry.dict.objId=ref.toString());return cacheEntry},fetchUncompressed:function(ref,xrefEntry){var suppressEncryption=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!1,gen=ref.gen,num=ref.num;if(xrefEntry.gen!==gen)throw new _core_utils.XRefEntryException("Inconsistent generation in XRef: ".concat(ref));
|
|
726
|
+
var stream=this.stream.makeSubStream(xrefEntry.offset+this.stream.start);stream=new _parser.Parser({lexer:new _parser.Lexer(stream),xref:this,allowStreams:!0});var obj1=stream.getObj(),obj2=stream.getObj(),obj3=stream.getObj();if(obj1!==num||obj2!==gen||!(obj3 instanceof _primitives.Cmd))throw new _core_utils.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(ref));if("obj"!==obj3.cmd){if(obj3.cmd.startsWith("obj")&&(num=parseInt(obj3.cmd.substring(3),10),!Number.isNaN(num)))return num;throw new _core_utils.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(ref));
|
|
727
|
+
}xrefEntry=this.encrypt&&!suppressEncryption?stream.getObj(this.encrypt.createCipherTransform(num,gen)):stream.getObj();(0,_primitives.isStream)(xrefEntry)||this._cacheMap.set(num,xrefEntry);return xrefEntry},fetchCompressed:function(ref,xrefEntry){var tableOffset=xrefEntry.offset,stream=this.fetch(_primitives.Ref.get(tableOffset,0));if(!(0,_primitives.isStream)(stream))throw new _util.FormatError("bad ObjStm stream");var first=stream.dict.get("First"),n=stream.dict.get("N");if(!Number.isInteger(first)||
|
|
728
|
+
!Number.isInteger(n))throw new _util.FormatError("invalid first and n parameters for ObjStm stream");stream=new _parser.Parser({lexer:new _parser.Lexer(stream),xref:this,allowStreams:!0});first=Array(n);for(var i=0;i<n;++i){var num=stream.getObj();if(!Number.isInteger(num))throw new _util.FormatError("invalid object number in the ObjStm stream: ".concat(num));var offset=stream.getObj();if(!Number.isInteger(offset))throw new _util.FormatError("invalid object offset in the ObjStm stream: ".concat(offset));
|
|
729
|
+
first[i]=num}i=Array(n);for(num=0;num<n;++num)if(offset=stream.getObj(),i[num]=offset,stream.buf1 instanceof _primitives.Cmd&&"endobj"===stream.buf1.cmd&&stream.shift(),!(0,_primitives.isStream)(offset)){var _num=first[num],entry=this.entries[_num];entry&&entry.offset===tableOffset&&entry.gen===num&&this._cacheMap.set(_num,offset)}xrefEntry=i[xrefEntry.gen];if(void 0===xrefEntry)throw new _core_utils.XRefEntryException("Bad (compressed) XRef entry: ".concat(ref));return xrefEntry},fetchIfRefAsync:function(){var _fetchIfRefAsync=
|
|
730
|
+
_asyncToGenerator(_regenerator["default"].mark(function _callee(obj,suppressEncryption){return _regenerator["default"].wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(!(obj instanceof _primitives.Ref)){_context.next=2;break}return _context.abrupt("return",this.fetchAsync(obj,suppressEncryption));case 2:return _context.abrupt("return",obj);case 3:case "end":return _context.stop()}},_callee,this)}));return function(_x,_x2){return _fetchIfRefAsync.apply(this,arguments)}}(),
|
|
731
|
+
fetchAsync:function(){var _fetchAsync=_asyncToGenerator(_regenerator["default"].mark(function _callee2(ref,suppressEncryption){return _regenerator["default"].wrap(function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.prev=0,_context2.abrupt("return",this.fetch(ref,suppressEncryption));case 4:_context2.prev=4;_context2.t0=_context2["catch"](0);if(_context2.t0 instanceof _core_utils.MissingDataException){_context2.next=8;break}throw _context2.t0;case 8:return _context2.next=
|
|
732
|
+
10,this.pdfManager.requestRange(_context2.t0.begin,_context2.t0.end);case 10:return _context2.abrupt("return",this.fetchAsync(ref,suppressEncryption));case 11:case "end":return _context2.stop()}},_callee2,this,[[0,4]])}));return function(_x3,_x4){return _fetchAsync.apply(this,arguments)}}(),getCatalogObj:function(){return this.root}};return XRef}();exports.XRef=module;module=function(){function NameOrNumberTree(root,xref,type){_classCallCheck(this,NameOrNumberTree);this.constructor===NameOrNumberTree&&
|
|
733
|
+
(0,_util.unreachable)("Cannot initialize NameOrNumberTree.");this.root=root;this.xref=xref;this._type=type}_createClass(NameOrNumberTree,[{key:"getAll",value:function(){var dict=Object.create(null);if(!this.root)return dict;var xref=this.xref,processed=new _primitives.RefSet;processed.put(this.root);for(var queue=[this.root];0<queue.length;){var obj=xref.fetchIfRef(queue.shift());if((0,_primitives.isDict)(obj))if(obj.has("Kids")){obj=obj.get("Kids");for(var i=0,ii=obj.length;i<ii;i++){var kid=obj[i];
|
|
734
|
+
if(processed.has(kid))throw new _util.FormatError('Duplicate entry in "'.concat(this._type,'" tree.'));queue.push(kid);processed.put(kid)}}else if(obj=obj.get(this._type),Array.isArray(obj))for(i=0,ii=obj.length;i<ii;i+=2)dict[xref.fetchIfRef(obj[i])]=xref.fetchIfRef(obj[i+1])}return dict}},{key:"get",value:function(key){if(!this.root)return null;for(var xref=this.xref,kidsOrEntries=xref.fetchIfRef(this.root),loopCount=0;kidsOrEntries.has("Kids");){if(10<++loopCount)return(0,_util.warn)('Search depth limit reached for "'.concat(this._type,
|
|
735
|
+
'" tree.')),null;var kids=kidsOrEntries.get("Kids");if(!Array.isArray(kids))return null;for(var l=0,r=kids.length-1;l<=r;){var m=l+r>>1,limits=xref.fetchIfRef(kids[m]).get("Limits");if(key<xref.fetchIfRef(limits[0]))r=m-1;else if(key>xref.fetchIfRef(limits[1]))l=m+1;else{kidsOrEntries=xref.fetchIfRef(kids[m]);break}}if(l>r)return null}kidsOrEntries=kidsOrEntries.get(this._type);if(Array.isArray(kidsOrEntries)){loopCount=0;for(kids=kidsOrEntries.length-2;loopCount<=kids;)if(l=loopCount+kids>>1,l+=
|
|
736
|
+
l&1,r=xref.fetchIfRef(kidsOrEntries[l]),key<r)kids=l-2;else if(key>r)loopCount=l+2;else return xref.fetchIfRef(kidsOrEntries[l+1]);(0,_util.info)('Falling back to an exhaustive search, for key "'.concat(key,'", ')+'in "'.concat(this._type,'" tree.'));loopCount=0;for(kids=kidsOrEntries.length;loopCount<kids;loopCount+=2)if(xref.fetchIfRef(kidsOrEntries[loopCount])===key)return(0,_util.warn)('The "'.concat(key,'" key was found at an incorrect, ')+'i.e. out-of-order, position in "'.concat(this._type,
|
|
737
|
+
'" tree.')),xref.fetchIfRef(kidsOrEntries[loopCount+1])}return null}}]);return NameOrNumberTree}();var NameTree=function(_NameOrNumberTree){function NameTree(root,xref){_classCallCheck(this,NameTree);return _possibleConstructorReturn(this,_getPrototypeOf(NameTree).call(this,root,xref,"Names"))}_inherits(NameTree,_NameOrNumberTree);return NameTree}(module),NumberTree=function(_NameOrNumberTree2){function NumberTree(root,xref){_classCallCheck(this,NumberTree);return _possibleConstructorReturn(this,
|
|
738
|
+
_getPrototypeOf(NumberTree).call(this,root,xref,"Nums"))}_inherits(NumberTree,_NameOrNumberTree2);return NumberTree}(module),FileSpec=function(){function FileSpec(root,xref){root&&(0,_primitives.isDict)(root)&&(this.xref=xref,this.root=root,root.has("FS")&&(this.fs=root.get("FS")),this.description=root.has("Desc")?(0,_util.stringToPDFString)(root.get("Desc")):"",root.has("RF")&&(0,_util.warn)("Related file specifications are not supported"),this.contentAvailable=!0,root.has("EF")||(this.contentAvailable=
|
|
739
|
+
!1,(0,_util.warn)("Non-embedded file specifications are not supported")))}function pickPlatformItem(dict){return dict.has("UF")?dict.get("UF"):dict.has("F")?dict.get("F"):dict.has("Unix")?dict.get("Unix"):dict.has("Mac")?dict.get("Mac"):dict.has("DOS")?dict.get("DOS"):null}FileSpec.prototype={get filename(){if(!this._filename&&this.root){var filename=pickPlatformItem(this.root)||"unnamed";this._filename=(0,_util.stringToPDFString)(filename).replace(/\\\\/g,"\\").replace(/\\\//g,"/").replace(/\\/g,
|
|
740
|
+
"/")}return this._filename},get content(){if(!this.contentAvailable)return null;!this.contentRef&&this.root&&(this.contentRef=pickPlatformItem(this.root.get("EF")));var content=null;if(this.contentRef){var fileObj=this.xref.fetchIfRef(this.contentRef);fileObj&&(0,_primitives.isStream)(fileObj)?content=fileObj.getBytes():(0,_util.warn)("Embedded file specification points to non-existing/invalid content")}else(0,_util.warn)("Embedded file specification does not have a content");return content},get serializable(){return{filename:this.filename,
|
|
741
|
+
content:this.content}}};return FileSpec}();exports.FileSpec=FileSpec;module=function(){function mayHaveChildren(value){return value instanceof _primitives.Ref||value instanceof _primitives.Dict||Array.isArray(value)||(0,_primitives.isStream)(value)}function ObjectLoader(dict,keys,xref){this.dict=dict;this.keys=keys;this.xref=xref;this.refSet=null}ObjectLoader.prototype={load:function(){var _load=_asyncToGenerator(_regenerator["default"].mark(function _callee3(){var keys,dict,nodesToVisit,i,ii,rawValue;
|
|
742
|
+
return _regenerator["default"].wrap(function(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if(this.xref.stream.allChunksLoaded&&!this.xref.stream.allChunksLoaded()){_context3.next=2;break}return _context3.abrupt("return",void 0);case 2:keys=this.keys;dict=this.dict;this.refSet=new _primitives.RefSet;nodesToVisit=[];i=0;for(ii=keys.length;i<ii;i++)rawValue=dict.getRaw(keys[i]),void 0!==rawValue&&nodesToVisit.push(rawValue);return _context3.abrupt("return",this._walk(nodesToVisit));
|
|
743
|
+
case 7:case "end":return _context3.stop()}},_callee3,this)}));return function(){return _load.apply(this,arguments)}}(),_walk:function(){var _walk2=_asyncToGenerator(_regenerator["default"].mark(function _callee4(nodesToVisit$jscomp$0){var nodesToRevisit,pendingRequests,currentNode,baseStreams,foundMissingData,i$jscomp$0,ii$jscomp$0,stream,_i5,_ii3,node$jscomp$0;return _regenerator["default"].wrap(function(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:nodesToRevisit=[],pendingRequests=
|
|
744
|
+
[];case 2:if(!nodesToVisit$jscomp$0.length){_context4.next=22;break}currentNode=nodesToVisit$jscomp$0.pop();if(!(currentNode instanceof _primitives.Ref)){_context4.next=18;break}if(!this.refSet.has(currentNode)){_context4.next=7;break}return _context4.abrupt("continue",2);case 7:_context4.prev=7;this.refSet.put(currentNode);currentNode=this.xref.fetch(currentNode);_context4.next=18;break;case 12:_context4.prev=12;_context4.t0=_context4["catch"](7);if(_context4.t0 instanceof _core_utils.MissingDataException){_context4.next=
|
|
745
|
+
16;break}throw _context4.t0;case 16:nodesToRevisit.push(currentNode),pendingRequests.push({begin:_context4.t0.begin,end:_context4.t0.end});case 18:if(currentNode&¤tNode.getBaseStreams){baseStreams=currentNode.getBaseStreams();foundMissingData=!1;i$jscomp$0=0;for(ii$jscomp$0=baseStreams.length;i$jscomp$0<ii$jscomp$0;i$jscomp$0++)stream=baseStreams[i$jscomp$0],stream.allChunksLoaded&&!stream.allChunksLoaded()&&(foundMissingData=!0,pendingRequests.push({begin:stream.start,end:stream.end}));foundMissingData&&
|
|
746
|
+
nodesToRevisit.push(currentNode)}var node=currentNode,nodesToVisit=nodesToVisit$jscomp$0;if(node instanceof _primitives.Dict||(0,_primitives.isStream)(node)){node=node instanceof _primitives.Dict?node:node.dict;for(var dictKeys=node.getKeys(),i=0,ii=dictKeys.length;i<ii;i++){var rawValue=node.getRaw(dictKeys[i]);mayHaveChildren(rawValue)&&nodesToVisit.push(rawValue)}}else if(Array.isArray(node))for(dictKeys=0,i=node.length;dictKeys<i;dictKeys++)ii=node[dictKeys],mayHaveChildren(ii)&&nodesToVisit.push(ii);
|
|
747
|
+
_context4.next=2;break;case 22:if(!pendingRequests.length){_context4.next=27;break}_context4.next=25;return this.xref.stream.manager.requestRanges(pendingRequests);case 25:_i5=0;for(_ii3=nodesToRevisit.length;_i5<_ii3;_i5++)node$jscomp$0=nodesToRevisit[_i5],node$jscomp$0 instanceof _primitives.Ref&&this.refSet.remove(node$jscomp$0);return _context4.abrupt("return",this._walk(nodesToRevisit));case 27:return this.refSet=null,_context4.abrupt("return",void 0);case 29:case "end":return _context4.stop()}},
|
|
748
|
+
_callee4,this,[[7,12]])}));return function(_x5){return _walk2.apply(this,arguments)}}()};return ObjectLoader}();exports.ObjectLoader=module},function(module,exports,__w_pdfjs_require__){function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;
|
|
749
|
+
"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}function computeAdler32(bytes){for(var bytesLength=bytes.length,a=1,b=0,i=0;i<bytesLength;++i)a+=bytes[i]&255,b+=a;return b%65521<<16|a%65521}function toHexDigit(ch){return 48<=ch&&57>=ch?ch&15:65<=ch&&
|
|
750
|
+
70>=ch||97<=ch&&102>=ch?(ch&15)+9:-1}Object.defineProperty(exports,"__esModule",{value:!0});exports.Parser=exports.Linearization=exports.Lexer=void 0;var _stream=__w_pdfjs_require__(195),_util=__w_pdfjs_require__(5),_primitives=__w_pdfjs_require__(188),_ccitt_stream=__w_pdfjs_require__(196),_jbig2_stream=__w_pdfjs_require__(198),_jpeg_stream=__w_pdfjs_require__(201),_jpx_stream=__w_pdfjs_require__(203),_core_utils=__w_pdfjs_require__(191),Parser=function(){function Parser(_ref){var lexer=_ref.lexer,
|
|
751
|
+
xref=_ref.xref,_ref$allowStreams=_ref.allowStreams;_ref$allowStreams=void 0===_ref$allowStreams?!1:_ref$allowStreams;_ref=_ref.recoveryMode;_ref=void 0===_ref?!1:_ref;_classCallCheck(this,Parser);this.lexer=lexer;this.xref=xref;this.allowStreams=_ref$allowStreams;this.recoveryMode=_ref;this.imageCache=Object.create(null);this.refill()}_createClass(Parser,[{key:"refill",value:function(){this.buf1=this.lexer.getObj();this.buf2=this.lexer.getObj()}},{key:"shift",value:function(){this.buf2 instanceof
|
|
752
|
+
_primitives.Cmd&&"ID"===this.buf2.cmd?(this.buf1=this.buf2,this.buf2=null):(this.buf1=this.buf2,this.buf2=this.lexer.getObj())}},{key:"tryShift",value:function(){try{return this.shift(),!0}catch(e){if(e instanceof _core_utils.MissingDataException)throw e;return!1}}},{key:"getObj",value:function(){var cipherTransform=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,buf1=this.buf1;this.shift();if(buf1 instanceof _primitives.Cmd)switch(buf1.cmd){case "BI":return this.makeInlineImage(cipherTransform);
|
|
751
753
|
case "[":for(buf1=[];!(0,_primitives.isCmd)(this.buf1,"]")&&!(0,_primitives.isEOF)(this.buf1);)buf1.push(this.getObj(cipherTransform));if((0,_primitives.isEOF)(this.buf1)){if(!this.recoveryMode)throw new _util.FormatError("End of file inside array");return buf1}this.shift();return buf1;case "<<":for(buf1=new _primitives.Dict(this.xref);!(0,_primitives.isCmd)(this.buf1,">>")&&!(0,_primitives.isEOF)(this.buf1);)if((0,_primitives.isName)(this.buf1)){var key=this.buf1.name;this.shift();if((0,_primitives.isEOF)(this.buf1))break;
|
|
752
754
|
buf1.set(key,this.getObj(cipherTransform))}else(0,_util.info)("Malformed dictionary: key must be a name object"),this.shift();if((0,_primitives.isEOF)(this.buf1)){if(!this.recoveryMode)throw new _util.FormatError("End of file inside dictionary");return buf1}if((0,_primitives.isCmd)(this.buf2,"stream"))return this.allowStreams?this.makeStream(buf1,cipherTransform):buf1;this.shift();return buf1;default:return buf1}return Number.isInteger(buf1)?Number.isInteger(this.buf1)&&(0,_primitives.isCmd)(this.buf2,
|
|
753
755
|
"R")?(cipherTransform=_primitives.Ref.get(buf1,this.buf1),this.shift(),this.shift(),cipherTransform):buf1:"string"===typeof buf1&&cipherTransform?cipherTransform.decryptString(buf1):buf1}},{key:"findDefaultInlineStreamEnd",value:function(stream){for(var startPos=stream.pos,state=0,ch,maybeEIPos;-1!==(ch=stream.getByte());)if(0===state)state=69===ch?1:0;else if(1===state)state=73===ch?2:0;else if((0,_util.assert)(2===state),32===ch||10===ch||13===ch){maybeEIPos=stream.pos;for(var followingBytes=stream.peekBytes(10),
|
|
@@ -945,279 +947,280 @@ tableDeltaT:referredSegments}}data=new DecodingContext(data,start,end);region=de
|
|
|
945
947
|
arguments)},onPatternDictionary:function(dictionary,currentSegment,data,start,end){var patterns=this.patterns;patterns||(this.patterns=patterns={});var decodingContext=new DecodingContext(data,start,end),mmr=dictionary.mmr;data=dictionary.patternWidth;start=dictionary.patternHeight;end=dictionary.maxPatternIndex;dictionary=dictionary.template;var at=[];mmr||(at.push({x:-data,y:0}),0===dictionary&&(at.push({x:-3,y:-1}),at.push({x:2,y:-2}),at.push({x:-2,y:-2})));dictionary=decodeBitmap(mmr,(end+1)*
|
|
946
948
|
data,start,dictionary,!1,null,at,decodingContext);decodingContext=[];mmr=0;for(var xMin,xMax,y;mmr<=end;){at=[];xMin=data*mmr;xMax=xMin+data;for(y=0;y<start;y++)at.push(dictionary[y].subarray(xMin,xMax));decodingContext.push(at);mmr++}patterns[currentSegment]=decodingContext},onImmediateHalftoneRegion:function(region,referredSegments,data,start,end){referredSegments=this.patterns[referredSegments[0]];var regionInfo=region.info,decodingContext=new DecodingContext(data,start,end),mmr=region.mmr,template=
|
|
947
949
|
region.template;data=regionInfo.width;start=regionInfo.height;var defaultPixelValue=region.defaultPixelValue,combinationOperator=region.combinationOperator;end=region.gridWidth;var gridHeight=region.gridHeight,gridOffsetX=region.gridOffsetX,gridOffsetY=region.gridOffsetY,gridVectorX=region.gridVectorX,gridVectorY=region.gridVectorY;if(region.enableSkip)throw new Jbig2Error("skip is not supported");if(0!==combinationOperator)throw new Jbig2Error("operator "+combinationOperator+" is not supported in halftone region");
|
|
948
|
-
region=[];var
|
|
949
|
-
|
|
950
|
-
mmr|=
|
|
951
|
-
region[j],patternRow=mmr[
|
|
952
|
-
1)&4294967295,highestValue=(0,_util.readUint32)(data,start+5)&4294967295;data=new Reader(data,start+9,end);start=(JSCompiler_inline_result>>1&7)+1;end=(JSCompiler_inline_result>>4&7)+1;var lines=[],currentRangeLow=lowestValue;do{var prefixLength=data.readBits(start);var rangeLength=
|
|
953
|
-
1,prefixLength,32,0,"lower"]));prefixLength=data.readBits(start);lines.push(new HuffmanLine([highestValue,prefixLength,32,0]));JSCompiler_inline_result&1&&(prefixLength=data.readBits(start),lines.push(new HuffmanLine([prefixLength,0])));JSCompiler_inline_result=new HuffmanTable(lines
|
|
954
|
-
this.children[bit];node||(this.children[bit]=node=new HuffmanTreeNode(null));node.buildTree(line,shift-1)}},decodeNode:function(reader){if(this.isLeaf){if(this.isOOB)return null;reader=reader.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-reader:reader)}var node=
|
|
955
|
-
lines.length,prefixLengthMax=0,i;for(i=0;i<linesLength;i++)prefixLengthMax=Math.max(prefixLengthMax,lines[i].prefixLength);var histogram=new Uint32Array(prefixLengthMax+1);for(i=0;i<linesLength;i++)histogram[lines[i].prefixLength]++;i=1;var firstCode=
|
|
956
|
-
var standardTablesCache={};Reader.prototype={readBit:function(){if(0>this.shift){if(this.position>=this.end)throw new Jbig2Error("end of data while reading bit");this.currentByte=this.data[this.position++];this.shift=7}var bit=this.currentByte>>
|
|
957
|
-
Jbig2Image.prototype={parseChunks:function(chunks){for(var visitor=new SimpleSegmentVisitor,i=0,ii=chunks.length;i<ii;i++){var chunk=chunks[i];chunk=readSegments({},chunk.data,chunk.start,chunk.end);processSegments(chunk,visitor)}return visitor.buffer},
|
|
958
|
-
var header=Object.create(null);position+=8;var flags=data[position++];header.randomAccess=!(flags&1);flags&2||(header.numberOfPages=(0,_util.readUint32)(data,position),position+=4);data=readSegments(header,data,
|
|
959
|
-
128,buffer=end[k++]),header[flags++]=buffer&mask?0:255,mask>>=1;this.width=data;this.height=position;return header}};return Jbig2Image}();exports.Jbig2Image=module},function(module,exports,__w_pdfjs_require__){function _defineProperties(target,
|
|
960
|
-
protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.ArithmeticDecoder=
|
|
961
|
-
nmps:
|
|
962
|
-
{qe:
|
|
963
|
-
|
|
964
|
-
nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];module=function(){function ArithmeticDecoder(data,start,end){if(!(this instanceof ArithmeticDecoder))throw new TypeError("Cannot call a class as a function");this.data=data;this.bp=
|
|
965
|
-
this.bp;255===data[bp]?143<data[bp+1]?(this.clow+=65280,this.ct=8):(bp++,this.clow+=data[bp]<<9,this.ct=7,this.bp=bp):(bp++,this.clow+=bp<this.dataEnd?data[bp]<<8:65280,this.ct=8,this.bp=bp);65535<this.clow&&(this.chigh+=this.clow>>16,this.clow&=
|
|
966
|
-
1^cx_mps,1===cx_index.switchFlag&&(cx_mps=qeIcx),cx_index=cx_index.nlps);else{this.chigh-=qeIcx;if(0!==(a&32768))return this.a=a,cx_mps;a<qeIcx?(qeIcx=1^cx_mps,1===cx_index.switchFlag&&(cx_mps=qeIcx),cx_index=cx_index.nlps):(qeIcx=cx_mps,cx_index=
|
|
967
|
-
module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.JpegStream=void 0;var _util=__w_pdfjs_require__(5),_stream=__w_pdfjs_require__(195),_primitives=__w_pdfjs_require__(188),
|
|
968
|
-
maybeLength)}JpegStream.prototype=Object.create(_stream.DecodeStream.prototype);Object.defineProperty(JpegStream.prototype,"bytes",{get:function(){return(0,_util.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},
|
|
969
|
-
this.dict.get("BitsPerComponent")||8,decodeArrLength=decodeArr.length,transform=new Int32Array(decodeArrLength),transformNeeded=!1;bitsPerComponent=(1<<bitsPerComponent)-1;for(var i=0;i<decodeArrLength;i+=
|
|
970
|
-
Number.isInteger(decodeArr)&&(jpegOptions.colorTransform=decodeArr));jpegOptions=new _jpg.JpegImage(jpegOptions);jpegOptions.parse(this.bytes);this.buffer=jpegOptions=jpegOptions.getData({width:this.drawWidth,
|
|
971
|
-
return JpegStream}();exports.JpegStream=module},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:
|
|
972
|
-
}function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"===typeof call))return call;if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
973
|
-
null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&
|
|
974
|
-
void 0;var _util=__w_pdfjs_require__(5),JpegError=function(_BaseException){function JpegError(msg){_classCallCheck(this,JpegError);return _possibleConstructorReturn(this,_getPrototypeOf(JpegError).call(this,"JPEG error: ".concat(msg)))}
|
|
975
|
-
|
|
976
|
-
arguments[0]:{},_ref$decodeTransform=_ref.decodeTransform;_ref=_ref.colorTransform;this._decodeTransform=void 0===_ref$decodeTransform?null:_ref$decodeTransform;this._colorTransform=void 0===_ref?-1:_ref}function buildHuffmanTable(codeLengths,
|
|
977
|
-
for(code.push(p);code.length<=i;)code.push(q={children:[],index:0}),p.children[p.index]=q.children,p=q;k++}i+1<length&&(code.push(q={children:[],index:0}),p.children[p.index]=q.children,p=q)}return code[0].children}function decodeScan(data,
|
|
978
|
-
if(nextByte){if(220===nextByte&&parseDNLMarker){offset$jscomp$0+=2;var scanLines=data[offset$jscomp$0++]<<8|data[offset$jscomp$0++];if(0<scanLines&&scanLines!==frame.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",
|
|
979
|
-
tree[readBit()];if("number"===typeof tree)return tree;if("object"!==_typeof(tree))throw new JpegError("invalid huffman sequence");}}function receive(length){for(var n=0;0<length;)n=n<<1|readBit(),length--;return n}function receiveAndExtend(length){if(1===
|
|
980
|
-
t;for(t=1;64>t;){var rs=decodeHuffman(component.huffmanTableAC),s=rs&15;rs>>=4;if(0===s){if(15>rs)break;t+=16}else t+=rs,component.blockData[offset+dctZigZag[t]]=receiveAndExtend(s),t++}}function decodeDCFirst(component,offset){var t=decodeHuffman(component.huffmanTableDC);
|
|
981
|
-
eobrun)eobrun--;else for(var k=spectralStart;k<=spectralEnd;){var rs=decodeHuffman(component.huffmanTableAC),s=rs&15;rs>>=4;if(0===s){if(15>rs){eobrun=receive(rs)+(1<<rs)-1;break}k+=16}else k+=rs,component.blockData[offset+dctZigZag[k]]=receiveAndExtend(s)*(1<<successive),
|
|
982
|
-
s=r&15;r>>=4;if(0===s)15>r?(eobrun=receive(r)+(1<<r),successiveACState=4):(r=16,successiveACState=1);else{if(1!==s)throw new JpegError("invalid ACn encoding");successiveACNextValue=receiveAndExtend(s);successiveACState=r?2:3}continue;case 1:case 2:component.blockData[s]?
|
|
983
|
-
successive,successiveACState=0);break;case 4:component.blockData[s]&&(component.blockData[s]+=sign*(readBit()<<successive))}k++}4===successiveACState&&(eobrun--,0===eobrun&&(successiveACState=0))}var parseDNLMarker=9<arguments.length&&void 0!==arguments[9]?
|
|
984
|
-
spectralStart?0===successivePrev?decodeDCFirst:decodeDCSuccessive:0===successivePrev?decodeACFirst:decodeACSuccessive:decodeBaseline;var mcu=0;var mcuExpected=1===componentsLength?components[0].blocksPerLine*components[0].blocksPerColumn:mcusPerLine*frame.mcusPerColumn;
|
|
985
|
-
for(n$jscomp$0=0;n$jscomp$0<mcuToRead;n$jscomp$0++)decodeFn(component$jscomp$0,64*((component$jscomp$0.blocksPerLine+1)*(mcu/component$jscomp$0.blocksPerLine|0)+mcu%component$jscomp$0.blocksPerLine)),mcu++}else for(n$jscomp$0=0;n$jscomp$0<mcuToRead;n$jscomp$0++){for(i=
|
|
986
|
-
((mcu/mcusPerLine|0)*component$jscomp$0.v+j)+(mcu%mcusPerLine*component$jscomp$0.h+k$jscomp$0)));mcu++}bitsCount=0;component$jscomp$0=findNextFileMarker(data,offset$jscomp$0);if(component$jscomp$0)component$jscomp$0.invalid&&((0,_util.warn)("decodeScan - unexpected MCU data, current marker is: "+
|
|
987
|
-
if(65488<=component$jscomp$0&&65495>=component$jscomp$0)offset$jscomp$0+=2;else break}(component$jscomp$0=findNextFileMarker(data,offset$jscomp$0))&&component$jscomp$0.invalid&&((0,_util.warn)("decodeScan - unexpected Scan data, current marker is: "+
|
|
988
|
-
blockRow=0;blockRow<blocksPerColumn;blockRow++)for(var blockCol=0;blockCol<frame;blockCol++){var blockBufferOffset=64*((component.blocksPerLine+1)*blockRow+blockCol),p=computationBuffer,qt=component.quantizationTable,blockData=component.blockData;
|
|
989
|
-
row+3];var p4=blockData[blockBufferOffset+row+4];var p5=blockData[blockBufferOffset+row+5];var p6=blockData[blockBufferOffset+row+6];var p7=blockData[blockBufferOffset+row+7];t*=qt[row];if(0===(p1|p2|p3|p4|p5|p6|p7))t=5793*t+512>>10,p[row]=t,p[row+
|
|
990
|
-
128>>8;p7=2896*(p1+p7)+128>>8;p3<<=4;p5<<=4;v0=v0+v1+1>>1;v1=v0-v1;t=3784*v2+1567*v3+128>>8;v2=1567*v2-3784*v3+128>>8;v3=t;p4=p4+p5+1>>1;p5=p4-p5;p7=p7+p3+1>>1;p3=p7-p3;v0=v0+v3+1>>1;v3=v0-v3;v1=v1+v2+1>>1;v2=v1-v2;t=2276*p4+3406*p7+2048>>12;p4=3406*
|
|
991
|
-
p3=p[qt+24],p4=p[qt+32],p5=p[qt+40],p6=p[qt+48],p7=p[qt+56],0===(p1|p2|p3|p4|p5|p6|p7)?(t=5793*t+8192>>14,t=-2040>t?0:2024<=t?255:t+2056>>4,blockData[blockBufferOffset+qt]=t,blockData[blockBufferOffset+qt+8]=t,blockData[blockBufferOffset+qt+16]=t,blockData[blockBufferOffset+
|
|
992
|
-
2048>>12,p7=2896*(p1+p7)+2048>>12,v0=(v0+v1+1>>1)+4112,v1=v0-v1,t=3784*v2+1567*v3+2048>>12,v2=1567*v2-3784*v3+2048>>12,v3=t,p4=p4+p5+1>>1,p5=p4-p5,p7=p7+p3+1>>1,p3=p7-p3,v0=v0+v3+1>>1,v3=v0-v3,v1=v1+v2+1>>1,v2=v1-v2,t=2276*p4+3406*p7+2048>>12,p4=3406*p4-2276*p7+2048>>12,p7=t,
|
|
993
|
-
4080<=p3?255:p3>>4,p4=16>p4?0:4080<=p4?255:p4>>4,p5=16>p5?0:4080<=p5?255:p5>>4,p6=16>p6?0:4080<=p6?255:p6>>4,p7=16>p7?0:4080<=p7?255:p7>>4,blockData[blockBufferOffset+qt]=t,blockData[blockBufferOffset+qt+8]=p1,blockData[blockBufferOffset+qt+16]=p2,blockData[blockBufferOffset+
|
|
994
|
-
2<arguments.length&&void 0!==arguments[2]?arguments[2]:currentPos,maxPos=data.length-1;startPos=startPos<currentPos?startPos:currentPos;if(currentPos>=maxPos)return null;var currentMarker=data[currentPos]<<8|data[currentPos+1];if(65472<=currentMarker&&65534>=
|
|
995
|
-
1]}return{invalid:currentMarker.toString(16),marker:newMarker,offset:startPos}}var dctZigZag=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,
|
|
996
|
-
findNextFileMarker(data,length,offset);fileMarker&&fileMarker.invalid&&((0,_util.warn)("readDataBlock - incorrect length, current marker is: "+fileMarker.invalid),length=fileMarker.offset);length=data.subarray(offset,length);offset+=length.length;return length}
|
|
997
|
-
8)*component.h/frame.maxH),blocksPerColumn=Math.ceil(Math.ceil(frame.scanLines/8)*component.v/frame.maxV);component.blockData=new Int16Array(64*mcusPerColumn*component.v*(mcusPerLine*component.h+1));component.blocksPerLine=blocksPerLine;
|
|
998
|
-
offset=0,jfif=null,adobe=null,numSOSMarkers=0;_ref2$dnlScanLines=[];var huffmanTablesAC=[],huffmanTablesDC=[],fileMarker$jscomp$0=readUint16();if(65496!==fileMarker$jscomp$0)throw new JpegError("SOI not found");fileMarker$jscomp$0=readUint16();
|
|
999
|
-
readDataBlock();65504===fileMarker$jscomp$0&&74===j[0]&&70===j[1]&&73===j[2]&&70===j[3]&&0===j[4]&&(jfif={version:{major:j[5],minor:j[6]},densityUnits:j[7],xDensity:j[8]<<8|j[9],yDensity:j[10]<<8|j[11],thumbWidth:j[12],thumbHeight:j[13],thumbData:j.subarray(14,
|
|
1000
|
-
offset-2;for(var z;offset<fileMarker$jscomp$0;){var quantizationTableSpec=data[offset++],tableData=new Uint16Array(64);if(0===quantizationTableSpec>>4)for(j=0;64>j;j++)z=dctZigZag[j],tableData[z]=data[offset++];else if(1===quantizationTableSpec>>4)for(j=
|
|
1001
|
-
readUint16();var frame$jscomp$0={};frame$jscomp$0.extended=65473===fileMarker$jscomp$0;frame$jscomp$0.progressive=65474===fileMarker$jscomp$0;frame$jscomp$0.precision=data[offset++];fileMarker$jscomp$0=readUint16();frame$jscomp$0.scanLines=
|
|
1002
|
-
var l=data[offset+1]>>4;var v=data[offset+1]&15;quantizationTableSpec<l&&(quantizationTableSpec=l);tableData<v&&(tableData=v);l=frame$jscomp$0.components.push({h:l,v:v,quantizationId:data[offset+2],quantizationTable:null});frame$jscomp$0.componentIds[z]=
|
|
1003
|
-
new Uint8Array(16);for(j=l=0;16>j;j++,offset++)l+=tableData[j]=data[offset];v=new Uint8Array(l);for(j=0;j<l;j++,offset++)v[j]=data[offset];fileMarker$jscomp$0+=17+l;(0===quantizationTableSpec>>4?huffmanTablesDC:huffmanTablesAC)[quantizationTableSpec&15]=
|
|
1004
|
-
quantizationTableSpec;fileMarker$jscomp$0++){tableData=frame$jscomp$0.componentIds[data[offset++]];var component=frame$jscomp$0.components[tableData];tableData=data[offset++];component.huffmanTableDC=huffmanTablesDC[tableData>>4];component.huffmanTableAC=
|
|
1005
|
-
tableData>>4,tableData&15,j);offset+=processed}catch(ex){if(ex instanceof DNLMarkerError)return(0,_util.warn)("".concat(ex.message," -- attempting to re-parse the JPEG image.")),this.parse(data,{dnlScanLines:ex.scanLines});if(ex instanceof EOIMarkerError){(0,_util.warn)("".concat(ex.message,
|
|
1006
|
-
2])offset-=3;else if((j=findNextFileMarker(data,offset-2))&&j.invalid)(0,_util.warn)("JpegImage.parse - unexpected data, current marker is: "+j.invalid),offset=j.offset;else{if(offset>data.length-2){(0,_util.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");
|
|
1007
|
-
this.jfif=jfif;this.adobe=adobe;this.components=[];for(fileMarker$jscomp$0=0;fileMarker$jscomp$0<frame$jscomp$0.components.length;fileMarker$jscomp$0++){component=frame$jscomp$0.components[fileMarker$jscomp$0];if(resetInterval=_ref2$dnlScanLines[component.quantizationId])component.quantizationTable=
|
|
1008
|
-
blocksPerColumn:component.blocksPerColumn})}this.numComponents=this.components.length},_getLinearizedBlockData:function(width,height){var isSourcePDF=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!1,scaleX=this.width/width,scaleY=this.height/height,x,i,numComponents=this.components.length,
|
|
1009
|
-
scaleX;var componentScaleY=component.scaleY*scaleY;var offset=i;var output=component.output;var blocksPerScanline=component.blocksPerLine+1<<3;for(x=0;x<width;x++)component=0|x*componentScaleX,xScaleBlockOffset[x]=(component&4294967288)<<3|component&7;for(componentScaleX=0;componentScaleX<
|
|
1010
|
-
numComponents}scaleX=this._decodeTransform;isSourcePDF||4!==numComponents||scaleX||(scaleX=new Int32Array([-256,255,-256,255,-256,255,-256,255]));if(scaleX)for(i=0;i<dataLength;)for(isSourcePDF=component=0;component<numComponents;component++,i++,isSourcePDF+=2)data[i]=(data[i]*scaleX[isSourcePDF]>>
|
|
1011
|
-
Cb,Cr,i=0,length=data.length;i<length;i+=3)Y=data[i],Cb=data[i+1],Cr=data[i+2],data[i]=Y-179.456+1.402*Cr,data[i+1]=Y+135.459-.344*Cb-.714*Cr,data[i+2]=Y-226.816+1.772*Cb;return data},_convertYcckToRgb:function(data){for(var Y,Cb,Cr,k,offset=0,i=0,length=data.length;i<
|
|
1012
|
-
Y
|
|
1013
|
-
-20.810012546947+Cb*(-5.70115196973677E-4*Cb-2.63409051004589E-5*Cr+.0020741088115012*Y-.00288260236853442*k+.814272968359295)+Cr*(-1.53496057440975E-5*Cr-1.32689043961446E-4*Y+5.60833691242812E-4*k-.195152027534049)+Y*(.00174418132927582*Y-.00255243321439347*
|
|
1014
|
-
Cr,data[i+1]=119.541-Y+.344*Cb+.714*Cr,data[i+2]=481.816-Y-1.772*Cb;return data},_convertCmykToRgb:function(data){for(var c,m,y,k,offset=0,scale=1/255,i=0,length=data.length;i<length;i+=4)c=data[i]*scale,m=data[i+1]*scale,y=data[i+2]*scale,k=data[i+3]*scale,data[offset++]=
|
|
1015
|
-
|
|
1016
|
-
m+63.02378494754052*y+50.606957656360734*k-112.23884253719248)+y*(.03296041114873217*y+115.60384449646641*k-193.58209356861505)-k*(22.33816807309886*k+180.12613974708367);return data.subarray(0,offset)},getData:function(_ref3){var width=_ref3.width,height=
|
|
1017
|
-
height,_ref3);if(1===this.numComponents&&_ref3$forceRGB){height=width.length;_ref3$forceRGB=new Uint8ClampedArray(3*height);for(var i=_ref3=0;i<height;i++){var grayColor=width[i];_ref3$forceRGB[_ref3++]=grayColor;_ref3$forceRGB[_ref3++]=
|
|
1018
|
-
this._convertYcckToCmyk(width);if(_ref3$forceRGB)return this._convertCmykToRgb(width)}return width}};return JpegImage}();exports.JpegImage=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",
|
|
1019
|
-
params;_stream.DecodeStream.call(this,maybeLength)}JpxStream.prototype=Object.create(_stream.DecodeStream.prototype);Object.defineProperty(JpxStream.prototype,"bytes",{get:function(){return(0,_util.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},
|
|
1020
|
-
jpxImage.componentsCount,tileCount=jpxImage.tiles.length;if(1===tileCount)this.buffer=jpxImage.tiles[0].items;else{height=new Uint8ClampedArray(width*height*componentsCount);for(var k=0;k<tileCount;k++){var tileComponents=jpxImage.tiles[k],tileHeight=
|
|
1021
|
-
src.subarray(srcPosition,srcPosition+tileComponents);height.set(rowBytes,dataPosition);srcPosition+=tileComponents;dataPosition+=imgRowSize}}this.buffer=height}this.bufferLength=this.buffer.length;this.eof=!0}};return JpxStream}();exports.JpxStream=
|
|
1022
|
-
Symbol&&obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};
|
|
1023
|
-
{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};
|
|
1024
|
-
JpxError))throw new TypeError("Cannot call a class as a function");msg=_getPrototypeOf(JpxError).call(this,"JPX error: ".concat(msg));if(!msg||"object"!==_typeof(msg)&&"function"!==typeof msg){if(void 0===this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1025
|
-
dimensions.xcb_;dimensions=dimensions.ycb_;var codeblockWidth=1<<context,codeblockHeight=1<<dimensions,cbx0=subband.tbx0>>context,cby0=subband.tby0>>dimensions,cbx1=subband.tbx1+codeblockWidth-1>>context,cby1=subband.tby1+codeblockHeight-1>>dimensions,precinctParameters=subband.resolution.precinctParameters,
|
|
1026
|
-
(j+1)};codeblock.tbx0_=Math.max(subband.tbx0,codeblock.tbx0);codeblock.tby0_=Math.max(subband.tby0,codeblock.tby0);codeblock.tbx1_=Math.min(subband.tbx1,codeblock.tbx1);codeblock.tby1_=Math.min(subband.tby1,codeblock.tby1);var precinctNumber=Math.floor((codeblock.tbx0_-subband.tbx0)/precinctParameters.precinctWidthInSubband)+
|
|
1027
|
-
subband.type;codeblock.Lblock=3;if(!(codeblock.tbx1_<=codeblock.tbx0_||codeblock.tby1_<=codeblock.tby0_)){codeblocks.push(codeblock);var precinct=precincts[precinctNumber];void 0!==precinct?(i<precinct.cbxMin?precinct.cbxMin=i:i>precinct.cbxMax&&(precinct.cbxMax=i),j<precinct.cbyMin?precinct.cbxMin=j:j>precinct.cbyMax&&
|
|
1028
|
-
numcodeblockwide:cbx1-cbx0+1,numcodeblockhigh:cby1-cby0+1};subband.codeblocks=codeblocks;subband.precincts=precincts}function createPacket(resolution,precinctNumber,layerNumber){var precinctCodeblocks=[];resolution=resolution.subbands;for(var i=0,ii=resolution.length;i<ii;i++)for(var codeblocks=resolution[i].codeblocks,
|
|
1029
|
-
function LayerResolutionComponentPositionIterator(context){var tile=context.tiles[context.currentTile.index],layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,maxDecompositionLevelsCount=0;for(context=0;context<componentsCount;context++)maxDecompositionLevelsCount=
|
|
1030
|
-
componentsCount;i++){var component=tile.components[i];if(!(r>component.codingStyleParameters.decompositionLevelsCount)){component=component.resolutions[r];for(var numprecincts=component.precinctParameters.numprecincts;k<numprecincts;)return component=createPacket(component,
|
|
1031
|
-
componentsCount=context.SIZ.Csiz,maxDecompositionLevelsCount=0;for(context=0;context<componentsCount;context++)maxDecompositionLevelsCount=Math.max(maxDecompositionLevelsCount,tile.components[context].codingStyleParameters.decompositionLevelsCount);var r=0,l=0,i=
|
|
1032
|
-
for(var numprecincts=component.precinctParameters.numprecincts;k<numprecincts;)return component=createPacket(component,k,l),k++,component;k=0}}i=0}l=0}throw new JpxError("Out of packets");}}function ResolutionPositionComponentLayerIterator(context){var tile=
|
|
1033
|
-
tile.components[c].codingStyleParameters.decompositionLevelsCount);var maxNumPrecinctsInLevel=new Int32Array(maxDecompositionLevelsCount+1);for(r=0;r<=maxDecompositionLevelsCount;++r){for(c=context=0;c<componentsCount;++c){var resolutions=
|
|
1034
|
-
componentsCount;c++){var component=tile.components[c];if(!(r>component.codingStyleParameters.decompositionLevelsCount||(component=component.resolutions[r],p>=component.precinctParameters.numprecincts))){for(;l<layersCount;)return component=
|
|
1035
|
-
componentsCount=context.SIZ.Csiz,precinctsSizes=getPrecinctSizesInImageScale(tile),l=0,r=0,c=0,px=0,py=0;this.nextPacket=function(){for(;py<precinctsSizes.maxNumHigh;py++){for(;px<precinctsSizes.maxNumWide;px++){for(;c<componentsCount;c++){for(var component=
|
|
1036
|
-
precinctsSizes,resolution);if(null!==k){for(;l<layersCount;)return component=createPacket(resolution,k,l),l++,component;l=0}}r=0}c=0}px=0}throw new JpxError("Out of packets");}}function ComponentPositionResolutionLayerIterator(context){var tile=context.tiles[context.currentTile.index],
|
|
1037
|
-
tile.components[c],precinctsIterationSizes=precinctsSizes.components[c],decompositionLevelsCount=component.codingStyleParameters.decompositionLevelsCount;py<precinctsIterationSizes.maxNumHigh;py++){for(;px<precinctsIterationSizes.maxNumWide;px++){for(;r<=decompositionLevelsCount;r++){var resolution=
|
|
1038
|
-
k,l),l++,component;l=0}}r=0}px=0}py=0}throw new JpxError("Out of packets");}}function getPrecinctIndexIfExist(pxIndex,pyIndex,sizeInImageScale,precinctIterationSizes,resolution){pxIndex*=precinctIterationSizes.minWidth;pyIndex*=precinctIterationSizes.minHeight;return 0!==pxIndex%sizeInImageScale.width||
|
|
1039
|
-
tile.components.length,minWidth=Number.MAX_VALUE,minHeight=Number.MAX_VALUE,maxNumWide=0,maxNumHigh=0,sizePerComponent=Array(componentsCount),c=0;c<componentsCount;c++){for(var component=tile.components[c],decompositionLevelsCount=component.codingStyleParameters.decompositionLevelsCount,
|
|
1040
|
-
component.resolutions[decompositionLevelsCount],widthCurrentResolution=scale*resolution.precinctParameters.precinctWidth,heightCurrentResolution=scale*resolution.precinctParameters.precinctHeight;minWidthCurrentComponent=Math.min(minWidthCurrentComponent,
|
|
1041
|
-
Math.max(maxNumHighCurrentComponent,resolution.precinctParameters.numprecinctshigh);sizePerResolution[decompositionLevelsCount]={width:widthCurrentResolution,height:heightCurrentResolution};scale<<=1}minWidth=Math.min(minWidth,minWidthCurrentComponent);
|
|
1042
|
-
minHeight:minHeightCurrentComponent,maxNumWide:maxNumWideCurrentComponent,maxNumHigh:maxNumHighCurrentComponent}}return{components:sizePerComponent,minWidth:minWidth,minHeight:minHeight,maxNumWide:maxNumWide,maxNumHigh:maxNumHigh}}function parseTilePackets(context,
|
|
1043
|
-
count;return buffer>>>bufferSize&(1<<count)-1}function skipMarkerIfEqual(value){return 255===data[offset+position-1]&&data[offset+position]===value?(position+=1,!0):255===data[offset+position]&&data[offset+position+1]===value?(position+=2,!0):!1}function readCodingpasses(){if(0===
|
|
1044
|
-
|
|
1045
|
-
codeblock.cbx-precinct.cbxMin,codeblockRow=codeblock.cby-precinct.cbyMin,codeblockIncluded=!1,firstTimeInclusion=!1;if(void 0!==codeblock.included)codeblockIncluded=!!readBits(1);else{precinct=codeblock.precinct;if(void 0!==precinct.inclusionTree)var inclusionTree=precinct.inclusionTree;
|
|
1046
|
-
zeroBitPlanesTree);precinct.inclusionTree=inclusionTree;precinct.zeroBitPlanesTree=zeroBitPlanesTree}if(inclusionTree.reset(codeblockColumn,codeblockRow,layerNumber))for(;;)if(readBits(1)){if(valueReady=!inclusionTree.nextLevel()){codeblockIncluded=firstTimeInclusion=codeblock.included
|
|
1047
|
-
!zeroBitPlanesTree.nextLevel())break}else zeroBitPlanesTree.incrementValue();codeblock.zeroBitPlanes=zeroBitPlanesTree.value}for(precinct=readCodingpasses();readBits(1);)codeblock.Lblock++;codeblockColumn=(0,_util.log2)(precinct);codeblockColumn=readBits((precinct<
|
|
1048
|
-
queue.length;)packet=queue.shift(),codeblock=packet.codeblock,void 0===codeblock.data&&(codeblock.data=[]),codeblock.data.push({data:data,start:offset+position,end:offset+position+packet.dataLength,codingpasses:packet.codingpasses}),position+=packet.dataLength}}return position}
|
|
1049
|
-
8,lbox=(0,_util.readUint32)(data,position),tbox=(0,_util.readUint32)(data,position+4);position+=headerSize;1===lbox&&(lbox=4294967296*(0,_util.readUint32)(data,position)+(0,_util.readUint32)(data,position+4),position+=8,headerSize+=8);0===lbox&&(lbox=length-position+
|
|
1050
|
-
position+3),tbox){case 16:case 17:case 18:break;default:(0,_util.warn)("Unknown colorspace "+tbox)}else 2===tbox&&(0,_util.info)("ICC profile not supported");break;case 1785737827:this.parseCodestream(data,position,position+headerSize);break;case 1783636E3:218793738!==
|
|
1051
|
-
255,tbox>>8&255,tbox&255);(0,_util.warn)("Unsupported header type "+tbox+" ("+headerType+")")}lbox&&(position+=headerSize)}},parseImageProperties:function(stream){for(var newByte=stream.getByte();0<=newByte;){var oldByte=newByte;newByte=stream.getByte();if(65361===(oldByte<<
|
|
1052
|
-
oldByte-YOsiz;this.componentsCount=stream;this.bitsPerComponent=8;return}}throw new JpxError("No size marker found in JPX stream");},parseCodestream:function(data$jscomp$0,start,end){var context={},doNotRecover=!1;try{for(var position=start;position+1<end;){var code=(0,_util.readUint16)(data$jscomp$0,
|
|
1053
|
-
position
|
|
1054
|
-
var components=[];var j=position+38;for(var i=0;i<componentsCount;i++){var component={precision:(data$jscomp$0[j]&127)+1,isSigned:!!(data$jscomp$0[j]&128),XRsiz:data$jscomp$0[j+1],YRsiz:data$jscomp$0[j+2]};j+=3;var component$jscomp$0=component,siz$jscomp$0=siz;component$jscomp$0.x0=
|
|
1055
|
-
Math.ceil(siz$jscomp$0.
|
|
1056
|
-
|
|
1057
|
-
tile$jscomp$0.tx0,tile$jscomp$0.height=tile$jscomp$0.ty1-tile$jscomp$0.ty0,tile$jscomp$0.components=[],tiles.push(tile$jscomp$0);context$jscomp$0.tiles=tiles;for(var i$jscomp$0=0,ii=siz$jscomp$1.Csiz;i$jscomp$0<ii;i$jscomp$0++)for(var component$jscomp$1=components$jscomp$0[i$jscomp$0],
|
|
1058
|
-
component$jscomp$1.YRsiz);tileComponent.tcx1=Math.ceil(tile$jscomp$0.tx1/component$jscomp$1.XRsiz);tileComponent.tcy1=Math.ceil(tile$jscomp$0.ty1/component$jscomp$1.YRsiz);tileComponent.width=tileComponent.tcx1-tileComponent.tcx0;tileComponent.height=tileComponent.tcy1-tileComponent.tcy0;
|
|
1059
|
-
31){case 0:var spqcdSize=8;var scalarExpounded=!0;break;case 1:spqcdSize=16;scalarExpounded=!1;break;case 2:spqcdSize=16;scalarExpounded=!0;break;default:throw Error("Invalid SQcd value "+sqcd);}qcd.noQuantization=8===spqcdSize;qcd.scalarExpounded=scalarExpounded;qcd.guardBits=sqcd>>5;for(spqcds=
|
|
1060
|
-
spqcds;context.mainHeader?context.QCD=qcd:(context.currentTile.QCD=qcd,context.currentTile.QCC=[]);break;case 65373:length=(0,_util.readUint16)(data$jscomp$0,position);var qcc={};j=position+2;if(257>context.SIZ.Csiz)var cqcc=data$jscomp$0[j++];else cqcc=(0,_util.readUint16)(data$jscomp$0,
|
|
1061
|
-
sqcd);}qcc.noQuantization=8===spqcdSize;qcc.scalarExpounded=scalarExpounded;qcc.guardBits=sqcd>>5;for(spqcds=[];j<length+position;)spqcd={},8===spqcdSize?(spqcd.epsilon=data$jscomp$0[j++]>>3,spqcd.mu=0):(spqcd.epsilon=data$jscomp$0[j]>>3,spqcd.mu=(data$jscomp$0[j]&7)<<8|data$jscomp$0[j+
|
|
1062
|
-
var scod=data$jscomp$0[j++];cod.entropyCoderWithCustomPrecincts=!!(scod&1);cod.sopMarkerUsed=!!(scod&2);cod.ephMarkerUsed=!!(scod&4);cod.progressionOrder=data$jscomp$0[j++];cod.layersCount=(0,_util.readUint16)(data$jscomp$0,j);j+=2;cod.multipleComponentTransform=data$jscomp$0[j++];cod.decompositionLevelsCount=
|
|
1063
|
-
|
|
1064
|
-
unsupported.push("selectiveArithmeticCodingBypass");cod.resetContextProbabilities&&unsupported.push("resetContextProbabilities");cod.terminationOnEachCodingPass&&unsupported.push("terminationOnEachCodingPass");cod.verticallyStripe&&unsupported.push("verticallyStripe");cod.predictableTermination&&
|
|
1065
|
-
cod,context.currentTile.COC=[]);break;case 65424:length=(0,_util.readUint16)(data$jscomp$0,position);var tile={};tile.index=(0,_util.readUint16)(data$jscomp$0,position+2);tile.length=(0,_util.readUint32)(data$jscomp$0,position+4);tile.dataEnd=tile.length+position-2;tile.partIndex=data$jscomp$0[position+
|
|
1066
|
-
tile;break;case 65427:tile=context.currentTile;if(0===tile.partIndex){for(var context$jscomp$1=context,componentsCount$jscomp$0=context$jscomp$1.SIZ.Csiz,tile$jscomp$1=context$jscomp$1.tiles[tile.index],c=0;c<componentsCount$jscomp$0;c++){var component$jscomp$2=tile$jscomp$1.components[c];
|
|
1067
|
-
context$jscomp$1.currentTile.
|
|
1068
|
-
resolutions=[],subbands=[],r=0;r<=decompositionLevelsCount;r++){var r$jscomp$0=r,codOrCoc=component$jscomp$3.codingStyleParameters,result={};codOrCoc.entropyCoderWithCustomPrecincts?(result.PPx=codOrCoc.precinctsSizes[r$jscomp$0].PPx,result.PPy=codOrCoc.precinctsSizes[r$jscomp$0].PPy):
|
|
1069
|
-
var blocksDimensions=result;var resolution={},scale=1<<decompositionLevelsCount-r;resolution.trx0=Math.ceil(component$jscomp$3.tcx0/scale);resolution.try0=Math.ceil(component$jscomp$3.tcy0/scale);resolution.trx1=Math.ceil(component$jscomp$3.tcx1/scale);resolution.try1=Math.ceil(component$jscomp$3.tcy1/
|
|
1070
|
-
precinctWidth)-Math.floor(resolution.trx0/precinctWidth):0,numprecinctshigh=resolution.try1>resolution.try0?Math.ceil(resolution.try1/precinctHeight)-Math.floor(resolution.try0/precinctHeight):0;resolution.precinctParameters={precinctWidth:precinctWidth,precinctHeight:precinctHeight,
|
|
1071
|
-
(isZeroRes?0:-1)};resolutions.push(resolution);if(0===r){var subband={type:"LL"};subband.tbx0=Math.ceil(component$jscomp$3.tcx0/scale);subband.tby0=Math.ceil(component$jscomp$3.tcy0/scale);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/scale);subband.tby1=Math.ceil(component$jscomp$3.tcy1/
|
|
1072
|
-
[];subband={type:"HL"};subband.tbx0=Math.ceil(component$jscomp$3.tcx0/bscale-.5);subband.tby0=Math.ceil(component$jscomp$3.tcy0/bscale);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/bscale-.5);subband.tby1=Math.ceil(component$jscomp$3.tcy1/bscale);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,
|
|
1073
|
-
|
|
1074
|
-
bscale-.5);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,subband,blocksDimensions);subbands.push(subband);resolutionSubbands.push(subband);resolution.subbands=resolutionSubbands}}component$jscomp$3.resolutions=resolutions;component$jscomp$3.subbands=subbands}var progressionOrder=
|
|
1075
|
-
|
|
1076
|
-
parseTilePackets(context,data$jscomp$0,position,length);break;case 65365:case 65367:case 65368:case 65380:length=(0,_util.readUint16)(data$jscomp$0,position);break;case 65363:throw Error("Codestream code 0xFF53 (COC) is not implemented");default:throw Error("Unknown codestream code: "+
|
|
1077
|
-
componentsCount$jscomp$2=context.SIZ.Csiz,resultImages=[],i$jscomp$1=0,ii$jscomp$0=context.tiles.length;i$jscomp$1<ii$jscomp$0;i$jscomp$1++){var tile$jscomp$3=context.tiles[i$jscomp$1],transformedTiles=[],c$jscomp$1;for(c$jscomp$1=0;c$jscomp$1<componentsCount$jscomp$2;c$jscomp$1++){for(var JSCompiler_temp_const=
|
|
1078
|
-
component$jscomp$4.quantizationParameters,decompositionLevelsCount$jscomp$0=codingStyleParameters.decompositionLevelsCount,spqcds$jscomp$0=quantizationParameters.SPqcds,scalarExpounded$jscomp$0=quantizationParameters.scalarExpounded,guardBits=quantizationParameters.guardBits,segmentationSymbolUsed=codingStyleParameters.segmentationSymbolUsed,
|
|
1079
|
-
subbandCoefficients=[],b=0,i$jscomp$2=0;i$jscomp$2<=decompositionLevelsCount$jscomp$0;i$jscomp$2++){for(var resolution$jscomp$0=component$jscomp$4.resolutions[i$jscomp$2],width=resolution$jscomp$0.trx1-resolution$jscomp$0.trx0,height=resolution$jscomp$0.try1-resolution$jscomp$0.try0,coefficients=new Float32Array(width*height),
|
|
1080
|
-
b++}else mu=spqcds$jscomp$0[0].mu,epsilon=spqcds$jscomp$0[0].epsilon+(0<i$jscomp$2?1-i$jscomp$2:0);for(var subband$jscomp$0=resolution$jscomp$0.subbands[j$jscomp$1],gainLog2=SubbandsGainLog2[subband$jscomp$0.type],coefficients$jscomp$0=coefficients,levelWidth=width,subband$jscomp$1=subband$jscomp$0,delta=
|
|
1081
|
-
y0=subband$jscomp$1.tby0,width$jscomp$0=subband$jscomp$1.tbx1-subband$jscomp$1.tbx0,codeblocks=subband$jscomp$1.codeblocks,right="H"===subband$jscomp$1.type.charAt(0)?1:0,bottom="H"===subband$jscomp$1.type.charAt(1)?levelWidth:0,i$jscomp$3=0,ii$jscomp$1=codeblocks.length;i$jscomp$3<ii$jscomp$1;++i$jscomp$3){var codeblock=
|
|
1082
|
-
new BitModel(blockWidth,blockHeight,codeblock.subbandType,codeblock.zeroBitPlanes,mb);var currentCodingpassType=2;var data=codeblock.data,totalLength=0,codingpasses=0,jj$jscomp$1;var j$jscomp$2=0;for(jj$jscomp$1=data.length;j$jscomp$2<jj$jscomp$1;j$jscomp$2++){var dataItem=data[j$jscomp$2];totalLength+=dataItem.end-
|
|
1083
|
-
data[j$jscomp$2];var chunk=dataItem.data.subarray(dataItem.start,dataItem.end);encodedData.set(chunk,position$jscomp$0);position$jscomp$0+=chunk.length}var decoder=new _arithmetic_decoder.ArithmeticDecoder(encodedData,0,totalLength);bitModel.setDecoder(decoder);for(j$jscomp$2=0;j$jscomp$2<codingpasses;j$jscomp$2++){switch(currentCodingpassType){case 0:bitModel.runSignificancePropagationPass();
|
|
1084
|
-
bitModel.checkSegmentationSymbol()}currentCodingpassType=(currentCodingpassType+1)%3}var offset=codeblock.tbx0_-x0+(codeblock.tby0_-y0)*width$jscomp$0,sign=bitModel.coefficentsSign,magnitude=bitModel.coefficentsMagnitude,bitsDecoded=bitModel.bitsDecoded,magnitudeCorrection=reversible$jscomp$0?0:.5,k;position$jscomp$0=0;var interleave="LL"!==subband$jscomp$1.type;for(j$jscomp$2=
|
|
1085
|
-
for(k=0;k<blockWidth;k++){var n=magnitude[position$jscomp$0];if(0!==n){n=(n+magnitudeCorrection)*delta;0!==sign[position$jscomp$0]&&(n=-n);var nb=bitsDecoded[position$jscomp$0];coefficients$jscomp$0[interleave?levelOffset+(offset<<1):offset]=reversible$jscomp$0&&nb>=mb?n:n*(1<<mb-nb)}offset++;position$jscomp$0++}offset+=width$jscomp$0-blockWidth}}}}subbandCoefficients.push({width:width,
|
|
1086
|
-
component$jscomp$4.tcy0);JSCompiler_temp_const[JSCompiler_temp_const$jscomp$0]={left:component$jscomp$4.tcx0,top:component$jscomp$4.tcy0,width:result$jscomp$0.width,height:result$jscomp$0.height,items:result$jscomp$0.items}}var tile0=transformedTiles[0],out=new Uint8ClampedArray(tile0.items.length*componentsCount$jscomp$2),result$jscomp$1={left:tile0.left,top:tile0.top,width:tile0.width,
|
|
1087
|
-
4===componentsCount$jscomp$2,y0items=transformedTiles[0].items,y1items=transformedTiles[1].items,y2items=transformedTiles[2].items,y3items=fourComponents?transformedTiles[3].items:null;var shift=components$jscomp$1[0].precision-8;var offset$jscomp$0=(128<<shift)+.5;var component0=tile$jscomp$3.components[0],alpha01=componentsCount$jscomp$2-3;var jj$jscomp$2=
|
|
1088
|
-
y0items[j$jscomp$3]+offset$jscomp$0;var y1=y1items[j$jscomp$3];var y2=y2items[j$jscomp$3];var g=y0$jscomp$0-(y2+y1>>2);out[pos++]=g+y2>>shift;out[pos++]=g>>shift;out[pos++]=g+y1>>shift}else for(j$jscomp$3=0;j$jscomp$3<jj$jscomp$2;j$jscomp$3++,pos+=alpha01)y0$jscomp$0=y0items[j$jscomp$3]+offset$jscomp$0,y1=y1items[j$jscomp$3],y2=y2items[j$jscomp$3],
|
|
1089
|
-
0,pos=3;j$jscomp$3<jj$jscomp$2;j$jscomp$3++,pos+=4)out[pos]=y3items[j$jscomp$3]+offset$jscomp$0>>shift}else for(c$jscomp$1=0;c$jscomp$1<componentsCount$jscomp$2;c$jscomp$1++){var items=transformedTiles[c$jscomp$1].items;shift=components$jscomp$1[c$jscomp$1].precision-8;offset$jscomp$0=(128<<shift)+.5;pos=c$jscomp$1;j$jscomp$3=0;for(jj$jscomp$2=
|
|
1090
|
-
resultImages;this.width=context.SIZ.Xsiz-context.SIZ.XOsiz;this.height=context.SIZ.Ysiz-context.SIZ.YOsiz;this.componentsCount=context.SIZ.Csiz}};var TagTree=function(){function TagTree(width,height){var levelsLength=(0,_util.log2)(Math.max(width,height))+1;this.levels=[];for(var i=0;i<levelsLength;i++)this.levels.push({width:width,
|
|
1091
|
-
this.levels[currentLevel];var index=i+j*level.width;if(void 0!==level.items[index]){value=level.items[index];break}level.index=index;i>>=1;j>>=1;currentLevel++}currentLevel--;level=this.levels[currentLevel];level.items[level.index]=value;this.currentLevel=currentLevel;delete this.value},incrementValue:function(){var level=
|
|
1092
|
-
currentLevel--;if(0>currentLevel)return this.value=value,!1;this.currentLevel=currentLevel;level=this.levels[currentLevel];level.items[level.index]=value;return!0}};return TagTree}(),InclusionTree=function(){function InclusionTree(width,height,defaultValue){var levelsLength=(0,_util.log2)(Math.max(width,height))+1;this.levels=
|
|
1093
|
-
items:items});width=Math.ceil(width/2);height=Math.ceil(height/2)}}InclusionTree.prototype={reset:function(i,j,stopValue){for(var currentLevel=0;currentLevel<this.levels.length;){var level=this.levels[currentLevel],index=i+j*level.width;level.index=index;level=level.items[index];if(255===level)break;if(level>stopValue)return this.currentLevel=
|
|
1094
|
-
level.items[level.index]=stopValue+1;this.propagateValues()},propagateValues:function(){for(var levelIndex=this.currentLevel,level=this.levels[levelIndex],currentValue=level.items[level.index];0<=--levelIndex;)level=this.levels[levelIndex],level.items[level.index]=currentValue},nextLevel:function(){var currentLevel=
|
|
1095
|
-
this.levels[currentLevel];level.items[level.index]=value;return!0}};return InclusionTree}(),BitModel=function(){function BitModel(width,height,subband,zeroBitPlanes,mb){this.width=width;this.height=height;this.contextLabelTable="HH"===subband?HHContextLabel:"HL"===subband?HLContextLabel:LLAndLHContextsLabel;width*=
|
|
1096
|
-
this.processingFlags=new Uint8Array(width);mb=new Uint8Array(width);if(0!==zeroBitPlanes)for(height=0;height<width;height++)mb[height]=zeroBitPlanes;this.bitsDecoded=mb;this.reset()}var LLAndLHContextsLabel=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,
|
|
1097
|
-
2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),HHContextLabel=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);BitModel.prototype={setDecoder:function(decoder){this.decoder=
|
|
1098
|
-
width=this.width,height=this.height,left=0<column;column=column+1<width;if(0<row){var i=index-width;left&&(neighborsSignificance[i-1]+=16);column&&(neighborsSignificance[i+1]+=16);neighborsSignificance[i]+=4}row+1<height&&(i=index+width,left&&(neighborsSignificance[i-1]+=16),column&&
|
|
1099
|
-
this.decoder,width=this.width,height=this.height,coefficentsMagnitude=this.coefficentsMagnitude,coefficentsSign=this.coefficentsSign,neighborsSignificance=this.neighborsSignificance,processingFlags=this.processingFlags,contexts=this.contexts,labels=this.contextLabelTable,
|
|
1100
|
-
labels[neighborsSignificance[index]])){var sign=this.decodeSignBit(i,j,index);coefficentsSign[index]=sign;coefficentsMagnitude[index]=1;this.setNeighborsSignificance(i,j,index);processingFlags[index]|=2}bitsDecoded[index]++;
|
|
1101
|
-
|
|
1102
|
-
sign0?(sign0=coefficentsSign[index-width],column=1-sign0-sign0+horizontalContribution):column=horizontalContribution;return 0<=column?this.decoder.readBit(this.contexts,9+column):this.decoder.readBit(this.contexts,9-column)^
|
|
1103
|
-
width*this.height,width4=4*width,index0=0,indexNext;index0<length;index0=indexNext){indexNext=Math.min(length,index0+width4);for(var j=0;j<width;j++)for(var index=index0+j;index<indexNext;index+=width)if(coefficentsMagnitude[index]&&
|
|
1104
|
-
1|contextLabel;bitsDecoded[index]++;processingFlags[index]|=1}}},runCleanupPass:function(){for(var decoder=this.decoder,width=this.width,height=this.height,neighborsSignificance=this.neighborsSignificance,coefficentsMagnitude=
|
|
1105
|
-
height);for(var indexBase=i0*width,checkAllEmpty=i0+3<height,j=0;j<width;j++){var index0=indexBase+j,i1=0,index=index0,i=i0;if(checkAllEmpty&&0===processingFlags[index0]&&0===processingFlags[index0+width]&&0===processingFlags[index0+
|
|
1106
|
-
bitsDecoded[index0+width]++;bitsDecoded[index0+twoRowsDown]++;bitsDecoded[index0+threeRowsDown]++;continue}i1=decoder.readBit(contexts,17)<<1|decoder.readBit(contexts,17);0!==i1&&(i=i0+i1,index+=i1*width);var sign=this.decodeSignBit(i,
|
|
1107
|
-
0!==(processingFlags[index]&1)||(1===decoder.readBit(contexts,labels[neighborsSignificance[index]])&&(sign=this.decodeSignBit(i,j,index),coefficentsSign[index]=sign,coefficentsMagnitude[index]=1,this.setNeighborsSignificance(i,
|
|
1108
|
-
17)))throw new JpxError("Invalid segmentation symbol");}};return BitModel}(),Transform=function(){function Transform(){}Transform.prototype.calculate=function(subbands,u0,v0){for(var ll=subbands[0],i=1,ii=subbands.length;i<ii;i++)ll=
|
|
1109
|
-
buffer[i1--]=buffer[j1++];buffer[offset++]=buffer[i2--];buffer[i1]=buffer[j1];buffer[offset]=buffer[i2]};Transform.prototype.iterate=function(ll,hl_lh_hh,u0,v0){var llWidth=ll.width,llHeight=ll.height,llItems=ll.items,width=hl_lh_hh.width,
|
|
1110
|
-
.5}else for(k=l=0;l<height;l++,k+=width)ll.set(hl_lh_hh.subarray(k,k+width),4),this.extend(ll,4,width),this.filter(ll,4,width),hl_lh_hh.set(ll.subarray(4,4+width),k);u0=16;llWidth=[];for(i=0;i<u0;i++)llWidth.push(new Float32Array(height+
|
|
1111
|
-
i=u0}i--;k=llWidth[i];this.extend(k,4,height);this.filter(k,4,height);if(0===i)for(k=v0-u0+1,l=4;l<ll;k+=width,l++)for(llHeight=0;llHeight<u0;llHeight++)hl_lh_hh[k+llHeight]=llWidth[llHeight][l]}return{width:width,height:height,items:hl_lh_hh}};
|
|
1112
|
-
0;var n;var j=offset-3;for(n=length+4;n--;j+=2)x[j]*=.8128930661159609;j=offset-2;var current=.443506852043971*x[j-1];for(n=length+3;n--;j+=2){var next=.443506852043971*x[j+1];x[j]=1.230174104914001*x[j]-current-next;if(n--)j+=2,current=.443506852043971*
|
|
1113
|
-
j=offset;current
|
|
1114
|
-
ReversibleTransform.prototype=Object.create(Transform.prototype);ReversibleTransform.prototype.filter=function(x,offset,length){length>>=1;offset|=0;var n;var j=offset;for(n=length+1;n--;j+=2)x[j]-=x[j-1]+x[j+1]+2>>2;j=offset+1;for(n=length;n--;j+=
|
|
1115
|
-
function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _possibleConstructorReturn(self,call){if(call&&("object"===
|
|
1116
|
-
Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");
|
|
1117
|
-
p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _defineProperties(target,
|
|
1118
|
-
protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.calculateSHA512=
|
|
1119
|
-
_stream=__w_pdfjs_require__(195),ARCFourCipher=function(){function ARCFourCipher(key){this.b=this.a=0;var s=new Uint8Array(256),i,j=0,keyLength=key.length;for(i=0;256>i;++i)s[i]=i;for(i=0;256>i;++i){var tmp=s[i];j=j+tmp+key[i%keyLength]&
|
|
1120
|
-
tmp2&255]}this.a=a;this.b=b;return output}};ARCFourCipher.prototype.decryptBlock=ARCFourCipher.prototype.encryptBlock;return ARCFourCipher}();exports.ARCFourCipher=ARCFourCipher;var calculateMD5=function(){var r=new Uint8Array([7,12,17,
|
|
1121
|
-
1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,
|
|
1122
|
-
|
|
1123
|
-
255;padded[i++]=0;padded[i++]=0;padded[i++]=0;data=new Int32Array(16);for(i=0;i<paddedLength;){for(length=0;16>length;++length,i+=4)data[length]=padded[i]|padded[i+1]<<8|padded[i+2]<<16|padded[i+3]<<24;var a=h0;offset=h1;var c=h2,d=
|
|
1124
|
-
offset=offset+(a<<f|a>>>32-f)|0;a=tmp}h0=h0+a|0;h1=h1+offset|0;h2=h2+c|0;h3=h3+d|0}return new Uint8Array([h0&255,h0>>8&255,h0>>16&255,h0>>>24&255,h1&255,h1>>8&255,h1>>16&255,h1>>>24&255,h2&255,h2>>8&255,h2>>16&255,h2>>>24&255,h3&255,
|
|
1125
|
-
|
|
1126
|
-
high=this.high
|
|
1127
|
-
24&255;bytes[offset+5]=this.low>>16&255;bytes[offset+6]=this.low>>8&255;bytes[offset+7]=this.low&255},assign:function(word){this.high=word.high;this.low=word.low}};return Word64}(),calculateSHA256=function(){function rotr(x,
|
|
1128
|
-
|
|
1129
|
-
h2=1013904242,h3=2773480762,h4=1359893119,h5=2600822924,h6=528734635,h7=1541459225,paddedLength=64*Math.ceil((length+9)/64),padded=new Uint8Array(paddedLength),i;for(i=0;i<length;++i)padded[i]=data[offset++];padded[i++]=
|
|
1130
|
-
0;16>length;++length)data[length]=padded[i]<<24|padded[i+1]<<16|padded[i+2]<<8|padded[i+3],i+=4;for(length=16;64>length;++length){offset=length;var x=data[length-2];x=(rotr(x,17)^rotr(x,19)^x>>>10)+data[length-7];var JSCompiler_inline_result=
|
|
1131
|
-
h6,h=h7;for(length=0;64>length;++length){var t1=h;h=e;h=rotr(h,6)^rotr(h,11)^rotr(h,25);t1=t1+h+(e&f^~e&g)+k[length]+data[length];h=offset;var t2=(rotr(h,2)^rotr(h,13)^rotr(h,22))+(offset&x^offset&JSCompiler_inline_result^x&JSCompiler_inline_result);
|
|
1132
|
-
h0>>8&255,h0&255,h1>>24&255,h1>>16&255,h1>>8&255,h1&255,h2>>24&255,h2>>16&255,h2>>8&255,h2&255,h3>>24&255,h3>>16&255,h3>>8&255,h3&255,h4>>24&255,h4>>16&255,h4>>8&255,h4&255,h5>>24&255,h5>>16&255,h5>>8&255,h5&255,h6>>24&255,h6>>16&255,h6>>8&255,h6&255,
|
|
1133
|
-
|
|
1134
|
-
new Word64(
|
|
1135
|
-
new Word64(
|
|
1136
|
-
new Word64(
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
4271175723),h3=new Word64(2773480762,1595750129),h4=new Word64(1359893119,2917565137),h5=new Word64(2600822924,725511199),h6=new Word64(528734635,4215389547),h7=new Word64(1541459225,327033209);var paddedLength=128*Math.ceil((length+
|
|
1140
|
-
padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=length>>>29&255;padded[i++]=length>>21&255;padded[i++]=length>>13&255;padded[i++]=length>>5&255;padded[i++]=length<<3&255;data=Array(80);for(i=0;80>i;i++)data[i]=new Word64(0,0);offset=
|
|
1141
|
-
0;16>length;++length)data[length].high=padded[i]<<24|padded[i+1]<<16|padded[i+2]<<8|padded[i+3],data[length].low=padded[i+4]<<24|padded[i+5]<<16|padded[i+6]<<8|padded[i+7],i+=8;for(length=16;80>length;++length){var result=tmp3=data[length],
|
|
1142
|
-
tmp.assign(x);tmp.rotateRight(
|
|
1143
|
-
|
|
1144
|
-
tmp$jscomp$0.assign(x);tmp$jscomp$0.and(tmp);tmp3.xor(tmp$jscomp$0);t2.add(tmp1);tmp3=h;h=g;g=f;f=e;d.add(t1);e=d;d=c;c=b;b=offset;tmp3.assign(t1);tmp3.add(t2);offset=tmp3}h0.add(offset);h1.add(b);h2.add(c);h3.add(d);h4.add(e);h5.add(f);
|
|
1145
|
-
16),h3.copyTo(mode384,24),h4.copyTo(mode384,32),h5.copyTo(mode384,40),h6.copyTo(mode384,48),h7.copyTo(mode384,56));return mode384}}();exports.calculateSHA512=calculateSHA512;var calculateSHA384=function(){return function(data,
|
|
1146
|
-
AESBaseCipher);this.constructor===AESBaseCipher&&(0,_util.unreachable)("Cannot initialize AESBaseCipher.");this._s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,
|
|
1156
|
-
value:function(input,key){var u,state=new Uint8Array(16);state.set(input);input=0;for(u=this._keySize;16>input;++input,++u)state[input]^=key[u];for(input=this._cyclesOfRepetition-1;1<=input;--input){var t=
|
|
1157
|
-
|
|
1158
|
-
state[
|
|
1159
|
-
state
|
|
1160
|
-
v=state[
|
|
1161
|
-
data[i],++bufferLength,!(16>bufferLength)){bufferLength=this._decrypt(buffer,this._key);for(var j=0;16>j;++j)bufferLength[j]^=iv[j];iv=buffer;result.push(bufferLength);
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
sourceLength);return data}}]);return AESBaseCipher}();var AES128Cipher=function(_AESBaseCipher){function AES128Cipher(key){_classCallCheck(this,AES128Cipher);var _this=
|
|
1166
|
-
1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,
|
|
1167
|
-
102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141
|
|
1168
|
-
result[cipherKey-3],t2=result[cipherKey-2],t3=result[cipherKey-1],t4=result[cipherKey-4];t1=s[t1];t2=s[t2];t3=s[t3];t4=s[t4];t1^=rcon[i];for(var n=0;4>n;++n)result[cipherKey]=
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
new Uint8Array(password.length+
|
|
1173
|
-
return
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
hashData=
|
|
1183
|
-
|
|
1184
|
-
dict.get("
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
(0,_util.stringToBytes)(dict.get("
|
|
1188
|
-
null}if(!encryptionKey&&!password$jscomp$0)throw new _util.PasswordException("No password given",_util.PasswordResponses.NEED_PASSWORD);
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
4<=filter&&(filter=dict.get("CF"),(0,_primitives.isDict)(filter)&&(filter.suppressEncryption=!0),this.cf=filter,this.stmf=dict.get("StmF")||
|
|
1192
|
-
(key[i++]=115,key[i++]=65,key[i++]=108,key[i++]=84);return calculateMD5(key,0,i).subarray(0,Math.min(encryptionKey.length+5,16))}function buildCipherConstructor(cf,
|
|
1193
|
-
!
|
|
1194
|
-
this.algorithm||5===this.algorithm)return new CipherTransform(buildCipherConstructor(this.cf,this.stmf,num,gen,this.encryptionKey),buildCipherConstructor(this.cf,this.strf,
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
1
|
|
1204
|
-
actualHeight
|
|
1205
|
-
|
|
1206
|
-
IR
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
(
|
|
1211
|
-
(
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
value:function(src,srcOffset,
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
_getPrototypeOf(
|
|
1219
|
-
|
|
1220
|
-
|
|
950
|
+
region=[];var j;for(combinationOperator=0;combinationOperator<start;combinationOperator++){var row=new Uint8Array(data);if(defaultPixelValue)for(j=0;j<data;j++)row[j]=defaultPixelValue;region.push(row)}combinationOperator=referredSegments[0];defaultPixelValue=combinationOperator[0].length;row=combinationOperator.length;var bitsPerValue=(0,_util.log2)(referredSegments.length);j=[];mmr||(j.push({x:1>=template?3:2,y:-1}),0===template&&(j.push({x:-3,y:-1}),j.push({x:2,y:-2}),j.push({x:-2,y:-2})));var grayScaleBitPlanes=
|
|
951
|
+
[],mmrInput;mmr&&(mmrInput=new Reader(decodingContext.data,decodingContext.start,decodingContext.end));for(combinationOperator=bitsPerValue-1;0<=combinationOperator;combinationOperator--){var bitmap=mmr?decodeMMRBitmap(mmrInput,end,gridHeight,!0):decodeBitmap(!1,end,gridHeight,template,!1,null,j,decodingContext);grayScaleBitPlanes[combinationOperator]=bitmap}for(mmrInput=0;mmrInput<gridHeight;mmrInput++)for(decodingContext=0;decodingContext<end;decodingContext++){mmr=combinationOperator=0;for(j=bitsPerValue-
|
|
952
|
+
1;0<=j;j--)combinationOperator^=grayScaleBitPlanes[j][mmrInput][decodingContext],mmr|=combinationOperator<<j;mmr=referredSegments[mmr];template=gridOffsetX+mmrInput*gridVectorY+decodingContext*gridVectorX>>8;bitmap=gridOffsetY+mmrInput*gridVectorX-decodingContext*gridVectorY>>8;if(0<=template&&template+defaultPixelValue<=data&&0<=bitmap&&bitmap+row<=start)for(combinationOperator=0;combinationOperator<row;combinationOperator++){var regionRow=region[bitmap+combinationOperator];var patternRow=mmr[combinationOperator];
|
|
953
|
+
for(j=0;j<defaultPixelValue;j++)regionRow[template+j]|=patternRow[j]}else for(combinationOperator=0;combinationOperator<row;combinationOperator++)if(j=bitmap+combinationOperator,!(0>j||j>=start))for(regionRow=region[j],patternRow=mmr[combinationOperator],j=0;j<defaultPixelValue;j++){var regionX=template+j;0<=regionX&®ionX<data&&(regionRow[regionX]|=patternRow[j])}}this.drawBitmap(regionInfo,region)},onImmediateLosslessHalftoneRegion:function(){this.onImmediateHalftoneRegion.apply(this,arguments)},
|
|
954
|
+
onTables:function(currentSegment,data,start,end){var customTables=this.customTables;customTables||(this.customTables=customTables={});var JSCompiler_inline_result=data[start];var lowestValue=(0,_util.readUint32)(data,start+1)&4294967295,highestValue=(0,_util.readUint32)(data,start+5)&4294967295;data=new Reader(data,start+9,end);start=(JSCompiler_inline_result>>1&7)+1;end=(JSCompiler_inline_result>>4&7)+1;var lines=[],currentRangeLow=lowestValue;do{var prefixLength=data.readBits(start);var rangeLength=
|
|
955
|
+
data.readBits(end);lines.push(new HuffmanLine([currentRangeLow,prefixLength,rangeLength,0]));currentRangeLow+=1<<rangeLength}while(currentRangeLow<highestValue);prefixLength=data.readBits(start);lines.push(new HuffmanLine([lowestValue-1,prefixLength,32,0,"lower"]));prefixLength=data.readBits(start);lines.push(new HuffmanLine([highestValue,prefixLength,32,0]));JSCompiler_inline_result&1&&(prefixLength=data.readBits(start),lines.push(new HuffmanLine([prefixLength,0])));JSCompiler_inline_result=new HuffmanTable(lines,
|
|
956
|
+
!1);customTables[currentSegment]=JSCompiler_inline_result}};HuffmanTreeNode.prototype={buildTree:function(line,shift){var bit=line.prefixCode>>shift&1;if(0>=shift)this.children[bit]=new HuffmanTreeNode(line);else{var node=this.children[bit];node||(this.children[bit]=node=new HuffmanTreeNode(null));node.buildTree(line,shift-1)}},decodeNode:function(reader){if(this.isLeaf){if(this.isOOB)return null;reader=reader.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-reader:reader)}var node=
|
|
957
|
+
this.children[reader.readBit()];if(!node)throw new Jbig2Error("invalid Huffman data");return node.decodeNode(reader)}};HuffmanTable.prototype={decode:function(reader){return this.rootNode.decodeNode(reader)},assignPrefixCodes:function(lines){var linesLength=lines.length,prefixLengthMax=0,i;for(i=0;i<linesLength;i++)prefixLengthMax=Math.max(prefixLengthMax,lines[i].prefixLength);var histogram=new Uint32Array(prefixLengthMax+1);for(i=0;i<linesLength;i++)histogram[lines[i].prefixLength]++;i=1;var firstCode=
|
|
958
|
+
0,currentTemp;for(histogram[0]=0;i<=prefixLengthMax;){var currentCode=firstCode=firstCode+histogram[i-1]<<1;for(currentTemp=0;currentTemp<linesLength;){var line=lines[currentTemp];line.prefixLength===i&&(line.prefixCode=currentCode,currentCode++);currentTemp++}i++}}};var standardTablesCache={};Reader.prototype={readBit:function(){if(0>this.shift){if(this.position>=this.end)throw new Jbig2Error("end of data while reading bit");this.currentByte=this.data[this.position++];this.shift=7}var bit=this.currentByte>>
|
|
959
|
+
this.shift&1;this.shift--;return bit},readBits:function(numBits){var result=0;for(--numBits;0<=numBits;numBits--)result|=this.readBit()<<numBits;return result},byteAlign:function(){this.shift=-1},next:function(){return this.position>=this.end?-1:this.data[this.position++]}};Jbig2Image.prototype={parseChunks:function(chunks){for(var visitor=new SimpleSegmentVisitor,i=0,ii=chunks.length;i<ii;i++){var chunk=chunks[i];chunk=readSegments({},chunk.data,chunk.start,chunk.end);processSegments(chunk,visitor)}return visitor.buffer},
|
|
960
|
+
parse:function(data){var position=0,end=data.length;if(151!==data[position]||74!==data[position+1]||66!==data[position+2]||50!==data[position+3]||13!==data[position+4]||10!==data[position+5]||26!==data[position+6]||10!==data[position+7])throw new Jbig2Error("parseJbig2 - invalid header.");var header=Object.create(null);position+=8;var flags=data[position++];header.randomAccess=!(flags&1);flags&2||(header.numberOfPages=(0,_util.readUint32)(data,position),position+=4);data=readSegments(header,data,
|
|
961
|
+
position,end);end=new SimpleSegmentVisitor;processSegments(data,end);position=end.currentPageInfo;data=position.width;position=position.height;end=end.buffer;header=new Uint8ClampedArray(data*position);for(var k=flags=0,i=0;i<position;i++)for(var mask=0,buffer=void 0,j=0;j<data;j++)mask||(mask=128,buffer=end[k++]),header[flags++]=buffer&mask?0:255,mask>>=1;this.width=data;this.height=position;return header}};return Jbig2Image}();exports.Jbig2Image=module},function(module,exports,__w_pdfjs_require__){function _defineProperties(target,
|
|
962
|
+
props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.ArithmeticDecoder=
|
|
963
|
+
void 0;var QeTable=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,
|
|
964
|
+
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,
|
|
965
|
+
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,
|
|
966
|
+
nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];module=function(){function ArithmeticDecoder(data,start,end){if(!(this instanceof ArithmeticDecoder))throw new TypeError("Cannot call a class as a function");this.data=data;this.bp=
|
|
967
|
+
start;this.dataEnd=end;this.chigh=data[start];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&65535|this.clow>>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}_createClass(ArithmeticDecoder,[{key:"byteIn",value:function(){var data=this.data,bp=this.bp;255===data[bp]?143<data[bp+1]?(this.clow+=65280,this.ct=8):(bp++,this.clow+=data[bp]<<9,this.ct=7,this.bp=bp):(bp++,this.clow+=bp<this.dataEnd?data[bp]<<8:65280,this.ct=8,this.bp=bp);65535<this.clow&&(this.chigh+=this.clow>>16,this.clow&=
|
|
968
|
+
65535)}},{key:"readBit",value:function(contexts,pos){var cx_index=contexts[pos]>>1,cx_mps=contexts[pos]&1;cx_index=QeTable[cx_index];var qeIcx=cx_index.qe,a=this.a-qeIcx;if(this.chigh<qeIcx)a<qeIcx?(a=qeIcx,qeIcx=cx_mps,cx_index=cx_index.nmps):(a=qeIcx,qeIcx=1^cx_mps,1===cx_index.switchFlag&&(cx_mps=qeIcx),cx_index=cx_index.nlps);else{this.chigh-=qeIcx;if(0!==(a&32768))return this.a=a,cx_mps;a<qeIcx?(qeIcx=1^cx_mps,1===cx_index.switchFlag&&(cx_mps=qeIcx),cx_index=cx_index.nlps):(qeIcx=cx_mps,cx_index=
|
|
969
|
+
cx_index.nmps)}do 0===this.ct&&this.byteIn(),a<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while(0===(a&32768));this.a=a;contexts[pos]=cx_index<<1|cx_mps;return qeIcx}}]);return ArithmeticDecoder}();exports.ArithmeticDecoder=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.JpegStream=void 0;var _util=__w_pdfjs_require__(5),_stream=__w_pdfjs_require__(195),_primitives=__w_pdfjs_require__(188),
|
|
970
|
+
_jpg=__w_pdfjs_require__(202);module=function(){function JpegStream(stream,maybeLength,dict,params){for(var ch;-1!==(ch=stream.getByte());)if(255===ch){stream.skip(-1);break}this.stream=stream;this.maybeLength=maybeLength;this.dict=dict;this.params=params;_stream.DecodeStream.call(this,maybeLength)}JpegStream.prototype=Object.create(_stream.DecodeStream.prototype);Object.defineProperty(JpegStream.prototype,"bytes",{get:function(){return(0,_util.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},
|
|
971
|
+
configurable:!0});JpegStream.prototype.ensureBuffer=function(requested){};JpegStream.prototype.readBlock=function(){if(!this.eof){var jpegOptions={decodeTransform:void 0,colorTransform:void 0},decodeArr=this.dict.getArray("Decode","D");if(this.forceRGB&&Array.isArray(decodeArr)){var bitsPerComponent=this.dict.get("BitsPerComponent")||8,decodeArrLength=decodeArr.length,transform=new Int32Array(decodeArrLength),transformNeeded=!1;bitsPerComponent=(1<<bitsPerComponent)-1;for(var i=0;i<decodeArrLength;i+=
|
|
972
|
+
2)if(transform[i]=256*(decodeArr[i+1]-decodeArr[i])|0,transform[i+1]=decodeArr[i]*bitsPerComponent|0,256!==transform[i]||0!==transform[i+1])transformNeeded=!0;transformNeeded&&(jpegOptions.decodeTransform=transform)}(0,_primitives.isDict)(this.params)&&(decodeArr=this.params.get("ColorTransform"),Number.isInteger(decodeArr)&&(jpegOptions.colorTransform=decodeArr));jpegOptions=new _jpg.JpegImage(jpegOptions);jpegOptions.parse(this.bytes);this.buffer=jpegOptions=jpegOptions.getData({width:this.drawWidth,
|
|
973
|
+
height:this.drawHeight,forceRGB:this.forceRGB,isSourcePDF:!0});this.bufferLength=jpegOptions.length;this.eof=!0}};JpegStream.prototype.getIR=function(){return(0,_util.createObjectURL)(this.bytes,"image/jpeg",0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1)};return JpegStream}();exports.JpegStream=module},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:
|
|
974
|
+
function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"===typeof call))return call;if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
975
|
+
return self}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&
|
|
976
|
+
_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}Object.defineProperty(exports,"__esModule",{value:!0});exports.JpegImage=void 0;var _util=__w_pdfjs_require__(5),JpegError=function(_BaseException){function JpegError(msg){_classCallCheck(this,JpegError);return _possibleConstructorReturn(this,_getPrototypeOf(JpegError).call(this,"JPEG error: ".concat(msg)))}
|
|
977
|
+
_inherits(JpegError,_BaseException);return JpegError}(_util.BaseException),DNLMarkerError=function(_BaseException2){function DNLMarkerError(message,scanLines){_classCallCheck(this,DNLMarkerError);message=_possibleConstructorReturn(this,_getPrototypeOf(DNLMarkerError).call(this,message));message.scanLines=scanLines;return message}_inherits(DNLMarkerError,_BaseException2);return DNLMarkerError}(_util.BaseException),EOIMarkerError=function(_BaseException3){function EOIMarkerError(){_classCallCheck(this,
|
|
978
|
+
EOIMarkerError);return _possibleConstructorReturn(this,_getPrototypeOf(EOIMarkerError).apply(this,arguments))}_inherits(EOIMarkerError,_BaseException3);return EOIMarkerError}(_util.BaseException);module=function(){function JpegImage(){var _ref=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},_ref$decodeTransform=_ref.decodeTransform;_ref=_ref.colorTransform;this._decodeTransform=void 0===_ref$decodeTransform?null:_ref$decodeTransform;this._colorTransform=void 0===_ref?-1:_ref}function buildHuffmanTable(codeLengths,
|
|
979
|
+
values){for(var k=0,code=[],i,j,length=16;0<length&&!codeLengths[length-1];)length--;code.push({children:[],index:0});var p=code[0],q;for(i=0;i<length;i++){for(j=0;j<codeLengths[i];j++){p=code.pop();for(p.children[p.index]=values[k];0<p.index;)p=code.pop();p.index++;for(code.push(p);code.length<=i;)code.push(q={children:[],index:0}),p.children[p.index]=q.children,p=q;k++}i+1<length&&(code.push(q={children:[],index:0}),p.children[p.index]=q.children,p=q)}return code[0].children}function decodeScan(data,
|
|
980
|
+
offset$jscomp$0,frame,components,resetInterval,spectralStart,spectralEnd,successivePrev,successive){function readBit(){if(0<bitsCount)return bitsCount--,bitsData>>bitsCount&1;bitsData=data[offset$jscomp$0++];if(255===bitsData){var nextByte=data[offset$jscomp$0++];if(nextByte){if(220===nextByte&&parseDNLMarker){offset$jscomp$0+=2;var scanLines=data[offset$jscomp$0++]<<8|data[offset$jscomp$0++];if(0<scanLines&&scanLines!==frame.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",
|
|
981
|
+
scanLines);}else if(217===nextByte)throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data");throw new JpegError("unexpected marker ".concat((bitsData<<8|nextByte).toString(16)));}}bitsCount=7;return bitsData>>>7}function decodeHuffman(tree){for(;;){tree=tree[readBit()];if("number"===typeof tree)return tree;if("object"!==_typeof(tree))throw new JpegError("invalid huffman sequence");}}function receive(length){for(var n=0;0<length;)n=n<<1|readBit(),length--;return n}function receiveAndExtend(length){if(1===
|
|
982
|
+
length)return 1===readBit()?1:-1;var n=receive(length);return n>=1<<length-1?n:n+(-1<<length)+1}function decodeBaseline(component,offset){var t=decodeHuffman(component.huffmanTableDC);t=0===t?0:receiveAndExtend(t);component.blockData[offset]=component.pred+=t;for(t=1;64>t;){var rs=decodeHuffman(component.huffmanTableAC),s=rs&15;rs>>=4;if(0===s){if(15>rs)break;t+=16}else t+=rs,component.blockData[offset+dctZigZag[t]]=receiveAndExtend(s),t++}}function decodeDCFirst(component,offset){var t=decodeHuffman(component.huffmanTableDC);
|
|
983
|
+
t=0===t?0:receiveAndExtend(t)<<successive;component.blockData[offset]=component.pred+=t}function decodeDCSuccessive(component,offset){component.blockData[offset]|=readBit()<<successive}function decodeACFirst(component,offset){if(0<eobrun)eobrun--;else for(var k=spectralStart;k<=spectralEnd;){var rs=decodeHuffman(component.huffmanTableAC),s=rs&15;rs>>=4;if(0===s){if(15>rs){eobrun=receive(rs)+(1<<rs)-1;break}k+=16}else k+=rs,component.blockData[offset+dctZigZag[k]]=receiveAndExtend(s)*(1<<successive),
|
|
984
|
+
k++}}function decodeACSuccessive(component,offset){for(var k=spectralStart,r=0,s;k<=spectralEnd;){s=offset+dctZigZag[k];var sign=0>component.blockData[s]?-1:1;switch(successiveACState){case 0:r=decodeHuffman(component.huffmanTableAC);s=r&15;r>>=4;if(0===s)15>r?(eobrun=receive(r)+(1<<r),successiveACState=4):(r=16,successiveACState=1);else{if(1!==s)throw new JpegError("invalid ACn encoding");successiveACNextValue=receiveAndExtend(s);successiveACState=r?2:3}continue;case 1:case 2:component.blockData[s]?
|
|
985
|
+
component.blockData[s]+=sign*(readBit()<<successive):(r--,0===r&&(successiveACState=2===successiveACState?3:0));break;case 3:component.blockData[s]?component.blockData[s]+=sign*(readBit()<<successive):(component.blockData[s]=successiveACNextValue<<successive,successiveACState=0);break;case 4:component.blockData[s]&&(component.blockData[s]+=sign*(readBit()<<successive))}k++}4===successiveACState&&(eobrun--,0===eobrun&&(successiveACState=0))}var parseDNLMarker=9<arguments.length&&void 0!==arguments[9]?
|
|
986
|
+
arguments[9]:!1,mcusPerLine=frame.mcusPerLine,startOffset=offset$jscomp$0,bitsData=0,bitsCount=0,eobrun=0,successiveACState=0,successiveACNextValue,componentsLength=components.length,i,j,k$jscomp$0,n$jscomp$0;var decodeFn=frame.progressive?0===spectralStart?0===successivePrev?decodeDCFirst:decodeDCSuccessive:0===successivePrev?decodeACFirst:decodeACSuccessive:decodeBaseline;var mcu=0;var mcuExpected=1===componentsLength?components[0].blocksPerLine*components[0].blocksPerColumn:mcusPerLine*frame.mcusPerColumn;
|
|
987
|
+
for(var h,v;mcu<mcuExpected;){var mcuToRead=resetInterval?Math.min(mcuExpected-mcu,resetInterval):mcuExpected;for(i=0;i<componentsLength;i++)components[i].pred=0;eobrun=0;if(1===componentsLength){var component$jscomp$0=components[0];for(n$jscomp$0=0;n$jscomp$0<mcuToRead;n$jscomp$0++)decodeFn(component$jscomp$0,64*((component$jscomp$0.blocksPerLine+1)*(mcu/component$jscomp$0.blocksPerLine|0)+mcu%component$jscomp$0.blocksPerLine)),mcu++}else for(n$jscomp$0=0;n$jscomp$0<mcuToRead;n$jscomp$0++){for(i=
|
|
988
|
+
0;i<componentsLength;i++)for(component$jscomp$0=components[i],h=component$jscomp$0.h,v=component$jscomp$0.v,j=0;j<v;j++)for(k$jscomp$0=0;k$jscomp$0<h;k$jscomp$0++)decodeFn(component$jscomp$0,64*((component$jscomp$0.blocksPerLine+1)*((mcu/mcusPerLine|0)*component$jscomp$0.v+j)+(mcu%mcusPerLine*component$jscomp$0.h+k$jscomp$0)));mcu++}bitsCount=0;component$jscomp$0=findNextFileMarker(data,offset$jscomp$0);if(component$jscomp$0)component$jscomp$0.invalid&&((0,_util.warn)("decodeScan - unexpected MCU data, current marker is: "+
|
|
989
|
+
component$jscomp$0.invalid),offset$jscomp$0=component$jscomp$0.offset);else break;component$jscomp$0=component$jscomp$0&&component$jscomp$0.marker;if(!component$jscomp$0||65280>=component$jscomp$0)throw new JpegError("decodeScan - a valid marker was not found.");if(65488<=component$jscomp$0&&65495>=component$jscomp$0)offset$jscomp$0+=2;else break}(component$jscomp$0=findNextFileMarker(data,offset$jscomp$0))&&component$jscomp$0.invalid&&((0,_util.warn)("decodeScan - unexpected Scan data, current marker is: "+
|
|
990
|
+
component$jscomp$0.invalid),offset$jscomp$0=component$jscomp$0.offset);return offset$jscomp$0-startOffset}function buildComponentData(frame,component){frame=component.blocksPerLine;for(var blocksPerColumn=component.blocksPerColumn,computationBuffer=new Int16Array(64),blockRow=0;blockRow<blocksPerColumn;blockRow++)for(var blockCol=0;blockCol<frame;blockCol++){var blockBufferOffset=64*((component.blocksPerLine+1)*blockRow+blockCol),p=computationBuffer,qt=component.quantizationTable,blockData=component.blockData;
|
|
991
|
+
if(!qt)throw new JpegError("missing required Quantization Table.");for(var row=0;64>row;row+=8){var t=blockData[blockBufferOffset+row];var p1=blockData[blockBufferOffset+row+1];var p2=blockData[blockBufferOffset+row+2];var p3=blockData[blockBufferOffset+row+3];var p4=blockData[blockBufferOffset+row+4];var p5=blockData[blockBufferOffset+row+5];var p6=blockData[blockBufferOffset+row+6];var p7=blockData[blockBufferOffset+row+7];t*=qt[row];if(0===(p1|p2|p3|p4|p5|p6|p7))t=5793*t+512>>10,p[row]=t,p[row+
|
|
992
|
+
1]=t,p[row+2]=t,p[row+3]=t,p[row+4]=t,p[row+5]=t,p[row+6]=t,p[row+7]=t;else{p1*=qt[row+1];p2*=qt[row+2];p3*=qt[row+3];p4*=qt[row+4];p5*=qt[row+5];p6*=qt[row+6];p7*=qt[row+7];var v0=5793*t+128>>8;var v1=5793*p4+128>>8;var v2=p2;var v3=p6;p4=2896*(p1-p7)+128>>8;p7=2896*(p1+p7)+128>>8;p3<<=4;p5<<=4;v0=v0+v1+1>>1;v1=v0-v1;t=3784*v2+1567*v3+128>>8;v2=1567*v2-3784*v3+128>>8;v3=t;p4=p4+p5+1>>1;p5=p4-p5;p7=p7+p3+1>>1;p3=p7-p3;v0=v0+v3+1>>1;v3=v0-v3;v1=v1+v2+1>>1;v2=v1-v2;t=2276*p4+3406*p7+2048>>12;p4=3406*
|
|
993
|
+
p4-2276*p7+2048>>12;p7=t;t=799*p3+4017*p5+2048>>12;p3=4017*p3-799*p5+2048>>12;p5=t;p[row]=v0+p7;p[row+7]=v0-p7;p[row+1]=v1+p5;p[row+6]=v1-p5;p[row+2]=v2+p3;p[row+5]=v2-p3;p[row+3]=v3+p4;p[row+4]=v3-p4}}for(qt=0;8>qt;++qt)t=p[qt],p1=p[qt+8],p2=p[qt+16],p3=p[qt+24],p4=p[qt+32],p5=p[qt+40],p6=p[qt+48],p7=p[qt+56],0===(p1|p2|p3|p4|p5|p6|p7)?(t=5793*t+8192>>14,t=-2040>t?0:2024<=t?255:t+2056>>4,blockData[blockBufferOffset+qt]=t,blockData[blockBufferOffset+qt+8]=t,blockData[blockBufferOffset+qt+16]=t,blockData[blockBufferOffset+
|
|
994
|
+
qt+24]=t,blockData[blockBufferOffset+qt+32]=t,blockData[blockBufferOffset+qt+40]=t,blockData[blockBufferOffset+qt+48]=t,blockData[blockBufferOffset+qt+56]=t):(v0=5793*t+2048>>12,v1=5793*p4+2048>>12,v2=p2,v3=p6,p4=2896*(p1-p7)+2048>>12,p7=2896*(p1+p7)+2048>>12,v0=(v0+v1+1>>1)+4112,v1=v0-v1,t=3784*v2+1567*v3+2048>>12,v2=1567*v2-3784*v3+2048>>12,v3=t,p4=p4+p5+1>>1,p5=p4-p5,p7=p7+p3+1>>1,p3=p7-p3,v0=v0+v3+1>>1,v3=v0-v3,v1=v1+v2+1>>1,v2=v1-v2,t=2276*p4+3406*p7+2048>>12,p4=3406*p4-2276*p7+2048>>12,p7=t,
|
|
995
|
+
t=799*p3+4017*p5+2048>>12,p3=4017*p3-799*p5+2048>>12,p5=t,t=v0+p7,p7=v0-p7,p1=v1+p5,p6=v1-p5,p2=v2+p3,p5=v2-p3,p3=v3+p4,p4=v3-p4,t=16>t?0:4080<=t?255:t>>4,p1=16>p1?0:4080<=p1?255:p1>>4,p2=16>p2?0:4080<=p2?255:p2>>4,p3=16>p3?0:4080<=p3?255:p3>>4,p4=16>p4?0:4080<=p4?255:p4>>4,p5=16>p5?0:4080<=p5?255:p5>>4,p6=16>p6?0:4080<=p6?255:p6>>4,p7=16>p7?0:4080<=p7?255:p7>>4,blockData[blockBufferOffset+qt]=t,blockData[blockBufferOffset+qt+8]=p1,blockData[blockBufferOffset+qt+16]=p2,blockData[blockBufferOffset+
|
|
996
|
+
qt+24]=p3,blockData[blockBufferOffset+qt+32]=p4,blockData[blockBufferOffset+qt+40]=p5,blockData[blockBufferOffset+qt+48]=p6,blockData[blockBufferOffset+qt+56]=p7)}return component.blockData}function findNextFileMarker(data,currentPos){var startPos=2<arguments.length&&void 0!==arguments[2]?arguments[2]:currentPos,maxPos=data.length-1;startPos=startPos<currentPos?startPos:currentPos;if(currentPos>=maxPos)return null;var currentMarker=data[currentPos]<<8|data[currentPos+1];if(65472<=currentMarker&&65534>=
|
|
997
|
+
currentMarker)return{invalid:null,marker:currentMarker,offset:currentPos};for(var newMarker=data[startPos]<<8|data[startPos+1];!(65472<=newMarker&&65534>=newMarker);){if(++startPos>=maxPos)return null;newMarker=data[startPos]<<8|data[startPos+1]}return{invalid:currentMarker.toString(16),marker:newMarker,offset:startPos}}var dctZigZag=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,
|
|
998
|
+
31,39,46,53,60,61,54,47,55,62,63]);JpegImage.prototype={parse:function(data){function readUint16(){var value=data[offset]<<8|data[offset+1];offset+=2;return value}function readDataBlock(){var length=readUint16();length=offset+length-2;var fileMarker=findNextFileMarker(data,length,offset);fileMarker&&fileMarker.invalid&&((0,_util.warn)("readDataBlock - incorrect length, current marker is: "+fileMarker.invalid),length=fileMarker.offset);length=data.subarray(offset,length);offset+=length.length;return length}
|
|
999
|
+
function prepareComponents(frame){for(var mcusPerLine=Math.ceil(frame.samplesPerLine/8/frame.maxH),mcusPerColumn=Math.ceil(frame.scanLines/8/frame.maxV),i=0;i<frame.components.length;i++){component=frame.components[i];var blocksPerLine=Math.ceil(Math.ceil(frame.samplesPerLine/8)*component.h/frame.maxH),blocksPerColumn=Math.ceil(Math.ceil(frame.scanLines/8)*component.v/frame.maxV);component.blockData=new Int16Array(64*mcusPerColumn*component.v*(mcusPerLine*component.h+1));component.blocksPerLine=blocksPerLine;
|
|
1000
|
+
component.blocksPerColumn=blocksPerColumn}frame.mcusPerLine=mcusPerLine;frame.mcusPerColumn=mcusPerColumn}var _ref2$dnlScanLines=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).dnlScanLines,dnlScanLines=void 0===_ref2$dnlScanLines?null:_ref2$dnlScanLines,offset=0,jfif=null,adobe=null,numSOSMarkers=0;_ref2$dnlScanLines=[];var huffmanTablesAC=[],huffmanTablesDC=[],fileMarker$jscomp$0=readUint16();if(65496!==fileMarker$jscomp$0)throw new JpegError("SOI not found");fileMarker$jscomp$0=readUint16();
|
|
1001
|
+
a:for(;65497!==fileMarker$jscomp$0;){switch(fileMarker$jscomp$0){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var j=readDataBlock();65504===fileMarker$jscomp$0&&74===j[0]&&70===j[1]&&73===j[2]&&70===j[3]&&0===j[4]&&(jfif={version:{major:j[5],minor:j[6]},densityUnits:j[7],xDensity:j[8]<<8|j[9],yDensity:j[10]<<8|j[11],thumbWidth:j[12],thumbHeight:j[13],thumbData:j.subarray(14,
|
|
1002
|
+
14+3*j[12]*j[13])});65518===fileMarker$jscomp$0&&65===j[0]&&100===j[1]&&111===j[2]&&98===j[3]&&101===j[4]&&(adobe={version:j[5]<<8|j[6],flags0:j[7]<<8|j[8],flags1:j[9]<<8|j[10],transformCode:j[11]});break;case 65499:fileMarker$jscomp$0=readUint16()+offset-2;for(var z;offset<fileMarker$jscomp$0;){var quantizationTableSpec=data[offset++],tableData=new Uint16Array(64);if(0===quantizationTableSpec>>4)for(j=0;64>j;j++)z=dctZigZag[j],tableData[z]=data[offset++];else if(1===quantizationTableSpec>>4)for(j=
|
|
1003
|
+
0;64>j;j++)z=dctZigZag[j],tableData[z]=readUint16();else throw new JpegError("DQT - invalid table spec");_ref2$dnlScanLines[quantizationTableSpec&15]=tableData}break;case 65472:case 65473:case 65474:if(frame$jscomp$0)throw new JpegError("Only single frame JPEGs supported");readUint16();var frame$jscomp$0={};frame$jscomp$0.extended=65473===fileMarker$jscomp$0;frame$jscomp$0.progressive=65474===fileMarker$jscomp$0;frame$jscomp$0.precision=data[offset++];fileMarker$jscomp$0=readUint16();frame$jscomp$0.scanLines=
|
|
1004
|
+
dnlScanLines||fileMarker$jscomp$0;frame$jscomp$0.samplesPerLine=readUint16();frame$jscomp$0.components=[];frame$jscomp$0.componentIds={};j=data[offset++];for(fileMarker$jscomp$0=tableData=quantizationTableSpec=0;fileMarker$jscomp$0<j;fileMarker$jscomp$0++){z=data[offset];var l=data[offset+1]>>4;var v=data[offset+1]&15;quantizationTableSpec<l&&(quantizationTableSpec=l);tableData<v&&(tableData=v);l=frame$jscomp$0.components.push({h:l,v:v,quantizationId:data[offset+2],quantizationTable:null});frame$jscomp$0.componentIds[z]=
|
|
1005
|
+
l-1;offset+=3}frame$jscomp$0.maxH=quantizationTableSpec;frame$jscomp$0.maxV=tableData;prepareComponents(frame$jscomp$0);break;case 65476:z=readUint16();for(fileMarker$jscomp$0=2;fileMarker$jscomp$0<z;){quantizationTableSpec=data[offset++];tableData=new Uint8Array(16);for(j=l=0;16>j;j++,offset++)l+=tableData[j]=data[offset];v=new Uint8Array(l);for(j=0;j<l;j++,offset++)v[j]=data[offset];fileMarker$jscomp$0+=17+l;(0===quantizationTableSpec>>4?huffmanTablesDC:huffmanTablesAC)[quantizationTableSpec&15]=
|
|
1006
|
+
buildHuffmanTable(tableData,v)}break;case 65501:readUint16();var resetInterval=readUint16();break;case 65498:j=1===++numSOSMarkers&&!dnlScanLines;readUint16();quantizationTableSpec=data[offset++];z=[];for(fileMarker$jscomp$0=0;fileMarker$jscomp$0<quantizationTableSpec;fileMarker$jscomp$0++){tableData=frame$jscomp$0.componentIds[data[offset++]];var component=frame$jscomp$0.components[tableData];tableData=data[offset++];component.huffmanTableDC=huffmanTablesDC[tableData>>4];component.huffmanTableAC=
|
|
1007
|
+
huffmanTablesAC[tableData&15];z.push(component)}fileMarker$jscomp$0=data[offset++];quantizationTableSpec=data[offset++];tableData=data[offset++];try{var processed=decodeScan(data,offset,frame$jscomp$0,z,resetInterval,fileMarker$jscomp$0,quantizationTableSpec,tableData>>4,tableData&15,j);offset+=processed}catch(ex){if(ex instanceof DNLMarkerError)return(0,_util.warn)("".concat(ex.message," -- attempting to re-parse the JPEG image.")),this.parse(data,{dnlScanLines:ex.scanLines});if(ex instanceof EOIMarkerError){(0,_util.warn)("".concat(ex.message,
|
|
1008
|
+
" -- ignoring the rest of the image data."));break a}throw ex;}break;case 65500:offset+=4;break;case 65535:255!==data[offset]&&offset--;break;default:if(255===data[offset-3]&&192<=data[offset-2]&&254>=data[offset-2])offset-=3;else if((j=findNextFileMarker(data,offset-2))&&j.invalid)(0,_util.warn)("JpegImage.parse - unexpected data, current marker is: "+j.invalid),offset=j.offset;else{if(offset>data.length-2){(0,_util.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");
|
|
1009
|
+
break a}throw new JpegError("JpegImage.parse - unknown marker: "+fileMarker$jscomp$0.toString(16));}}fileMarker$jscomp$0=readUint16()}this.width=frame$jscomp$0.samplesPerLine;this.height=frame$jscomp$0.scanLines;this.jfif=jfif;this.adobe=adobe;this.components=[];for(fileMarker$jscomp$0=0;fileMarker$jscomp$0<frame$jscomp$0.components.length;fileMarker$jscomp$0++){component=frame$jscomp$0.components[fileMarker$jscomp$0];if(resetInterval=_ref2$dnlScanLines[component.quantizationId])component.quantizationTable=
|
|
1010
|
+
resetInterval;this.components.push({output:buildComponentData(frame$jscomp$0,component),scaleX:component.h/frame$jscomp$0.maxH,scaleY:component.v/frame$jscomp$0.maxV,blocksPerLine:component.blocksPerLine,blocksPerColumn:component.blocksPerColumn})}this.numComponents=this.components.length},_getLinearizedBlockData:function(width,height){var isSourcePDF=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!1,scaleX=this.width/width,scaleY=this.height/height,x,i,numComponents=this.components.length,
|
|
1011
|
+
dataLength=width*height*numComponents,data=new Uint8ClampedArray(dataLength),xScaleBlockOffset=new Uint32Array(width);for(i=0;i<numComponents;i++){var component=this.components[i];var componentScaleX=component.scaleX*scaleX;var componentScaleY=component.scaleY*scaleY;var offset=i;var output=component.output;var blocksPerScanline=component.blocksPerLine+1<<3;for(x=0;x<width;x++)component=0|x*componentScaleX,xScaleBlockOffset[x]=(component&4294967288)<<3|component&7;for(componentScaleX=0;componentScaleX<
|
|
1012
|
+
height;componentScaleX++)for(component=0|componentScaleX*componentScaleY,component=blocksPerScanline*(component&4294967288)|(component&7)<<3,x=0;x<width;x++)data[offset]=output[component+xScaleBlockOffset[x]],offset+=numComponents}scaleX=this._decodeTransform;isSourcePDF||4!==numComponents||scaleX||(scaleX=new Int32Array([-256,255,-256,255,-256,255,-256,255]));if(scaleX)for(i=0;i<dataLength;)for(isSourcePDF=component=0;component<numComponents;component++,i++,isSourcePDF+=2)data[i]=(data[i]*scaleX[isSourcePDF]>>
|
|
1013
|
+
8)+scaleX[isSourcePDF+1];return data},get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0===this._colorTransform?!1:!0:1===this._colorTransform?!0:!1},_convertYccToRgb:function(data){for(var Y,Cb,Cr,i=0,length=data.length;i<length;i+=3)Y=data[i],Cb=data[i+1],Cr=data[i+2],data[i]=Y-179.456+1.402*Cr,data[i+1]=Y+135.459-.344*Cb-.714*Cr,data[i+2]=Y-226.816+1.772*Cb;return data},_convertYcckToRgb:function(data){for(var Y,Cb,Cr,k,offset=0,i=0,length=data.length;i<
|
|
1014
|
+
length;i+=4)Y=data[i],Cb=data[i+1],Cr=data[i+2],k=data[i+3],data[offset++]=-122.67195406894+Cb*(-6.60635669420364E-5*Cb+4.37130475926232E-4*Cr-5.4080610064599E-5*Y+4.8449797120281E-4*k-.154362151871126)+Cr*(-9.57964378445773E-4*Cr+8.17076911346625E-4*Y-.00477271405408747*k+1.53380253221734)+Y*(9.61250184130688E-4*Y-.00266257332283933*k+.48357088451265)+k*(-3.36197177618394E-4*k+.484791561490776),data[offset++]=107.268039397724+Cb*(2.19927104525741E-5*Cb-6.40992018297945E-4*Cr+6.59397001245577E-4*
|
|
1015
|
+
Y+4.26105652938837E-4*k-.176491792462875)+Cr*(-7.78269941513683E-4*Cr+.00130872261408275*Y+7.70482631801132E-4*k-.151051492775562)+Y*(.00126935368114843*Y-.00265090189010898*k+.25802910206845)+k*(-3.18913117588328E-4*k-.213742400323665),data[offset++]=-20.810012546947+Cb*(-5.70115196973677E-4*Cb-2.63409051004589E-5*Cr+.0020741088115012*Y-.00288260236853442*k+.814272968359295)+Cr*(-1.53496057440975E-5*Cr-1.32689043961446E-4*Y+5.60833691242812E-4*k-.195152027534049)+Y*(.00174418132927582*Y-.00255243321439347*
|
|
1016
|
+
k+.116935020465145)+k*(-3.43531996510555E-4*k+.24165260232407);return data.subarray(0,offset)},_convertYcckToCmyk:function(data){for(var Y,Cb,Cr,i=0,length=data.length;i<length;i+=4)Y=data[i],Cb=data[i+1],Cr=data[i+2],data[i]=434.456-Y-1.402*Cr,data[i+1]=119.541-Y+.344*Cb+.714*Cr,data[i+2]=481.816-Y-1.772*Cb;return data},_convertCmykToRgb:function(data){for(var c,m,y,k,offset=0,scale=1/255,i=0,length=data.length;i<length;i+=4)c=data[i]*scale,m=data[i+1]*scale,y=data[i+2]*scale,k=data[i+3]*scale,data[offset++]=
|
|
1017
|
+
255+c*(-4.387332384609988*c+54.48615194189176*m+18.82290502165302*y+212.25662451639585*k-285.2331026137004)+m*(1.7149763477362134*m-5.6096736904047315*y-17.873870861415444*k-5.497006427196366)+y*(-2.5217340131683033*y-21.248923337353073*k+17.5119270841813)-k*(21.86122147463605*k+189.48180835922747),data[offset++]=255+c*(8.841041422036149*c+60.118027045597366*m+6.871425592049007*y+31.159100130055922*k-79.2970844816548)+m*(-15.310361306967817*m+17.575251261109482*y+131.35250912493976*k-190.9453302588951)+
|
|
1018
|
+
y*(4.444339102852739*y+9.8632861493405*k-24.86741582555878)-k*(20.737325471181034*k+187.80453709719578),data[offset++]=255+c*(.8842522430003296*c+8.078677503112928*m+30.89978309703729*y-.23883238689178934*k-14.183576799673286)+m*(10.49593273432072*m+63.02378494754052*y+50.606957656360734*k-112.23884253719248)+y*(.03296041114873217*y+115.60384449646641*k-193.58209356861505)-k*(22.33816807309886*k+180.12613974708367);return data.subarray(0,offset)},getData:function(_ref3){var width=_ref3.width,height=
|
|
1019
|
+
_ref3.height,_ref3$forceRGB=_ref3.forceRGB;_ref3$forceRGB=void 0===_ref3$forceRGB?!1:_ref3$forceRGB;_ref3=_ref3.isSourcePDF;_ref3=void 0===_ref3?!1:_ref3;if(4<this.numComponents)throw new JpegError("Unsupported color mode");width=this._getLinearizedBlockData(width,height,_ref3);if(1===this.numComponents&&_ref3$forceRGB){height=width.length;_ref3$forceRGB=new Uint8ClampedArray(3*height);for(var i=_ref3=0;i<height;i++){var grayColor=width[i];_ref3$forceRGB[_ref3++]=grayColor;_ref3$forceRGB[_ref3++]=
|
|
1020
|
+
grayColor;_ref3$forceRGB[_ref3++]=grayColor}return _ref3$forceRGB}if(3===this.numComponents&&this._isColorConversionNeeded)return this._convertYccToRgb(width);if(4===this.numComponents){if(this._isColorConversionNeeded)return _ref3$forceRGB?this._convertYcckToRgb(width):this._convertYcckToCmyk(width);if(_ref3$forceRGB)return this._convertCmykToRgb(width)}return width}};return JpegImage}();exports.JpegImage=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",
|
|
1021
|
+
{value:!0});exports.JpxStream=void 0;var _stream=__w_pdfjs_require__(195),_jpx=__w_pdfjs_require__(204),_util=__w_pdfjs_require__(5);module=function(){function JpxStream(stream,maybeLength,dict,params){this.stream=stream;this.maybeLength=maybeLength;this.dict=dict;this.params=params;_stream.DecodeStream.call(this,maybeLength)}JpxStream.prototype=Object.create(_stream.DecodeStream.prototype);Object.defineProperty(JpxStream.prototype,"bytes",{get:function(){return(0,_util.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},
|
|
1022
|
+
configurable:!0});JpxStream.prototype.ensureBuffer=function(requested){};JpxStream.prototype.readBlock=function(){if(!this.eof){var jpxImage=new _jpx.JpxImage;jpxImage.parse(this.bytes);var width=jpxImage.width,height=jpxImage.height,componentsCount=jpxImage.componentsCount,tileCount=jpxImage.tiles.length;if(1===tileCount)this.buffer=jpxImage.tiles[0].items;else{height=new Uint8ClampedArray(width*height*componentsCount);for(var k=0;k<tileCount;k++){var tileComponents=jpxImage.tiles[k],tileHeight=
|
|
1023
|
+
tileComponents.height,src=tileComponents.items,srcPosition=0,dataPosition=(width*tileComponents.top+tileComponents.left)*componentsCount,imgRowSize=width*componentsCount;tileComponents=tileComponents.width*componentsCount;for(var j=0;j<tileHeight;j++){var rowBytes=src.subarray(srcPosition,srcPosition+tileComponents);height.set(rowBytes,dataPosition);srcPosition+=tileComponents;dataPosition+=imgRowSize}}this.buffer=height}this.bufferLength=this.buffer.length;this.eof=!0}};return JpxStream}();exports.JpxStream=
|
|
1024
|
+
module},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};
|
|
1025
|
+
return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};
|
|
1026
|
+
return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}Object.defineProperty(exports,"__esModule",{value:!0});exports.JpxImage=void 0;var _util=__w_pdfjs_require__(5),_arithmetic_decoder=__w_pdfjs_require__(200),JpxError=function(_BaseException){function JpxError(msg){if(!(this instanceof JpxError))throw new TypeError("Cannot call a class as a function");msg=_getPrototypeOf(JpxError).call(this,"JPX error: ".concat(msg));if(!msg||"object"!==_typeof(msg)&&"function"!==typeof msg){if(void 0===this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1027
|
+
msg=this}return msg}_inherits(JpxError,_BaseException);return JpxError}(_util.BaseException);module=function(){function JpxImage(){this.failOnCorruptedImage=!1}function buildCodeblocks(context,subband,dimensions){context=dimensions.xcb_;dimensions=dimensions.ycb_;var codeblockWidth=1<<context,codeblockHeight=1<<dimensions,cbx0=subband.tbx0>>context,cby0=subband.tby0>>dimensions,cbx1=subband.tbx1+codeblockWidth-1>>context,cby1=subband.tby1+codeblockHeight-1>>dimensions,precinctParameters=subband.resolution.precinctParameters,
|
|
1028
|
+
codeblocks=[],precincts=[],i,j;for(j=cby0;j<cby1;j++)for(i=cbx0;i<cbx1;i++){var codeblock={cbx:i,cby:j,tbx0:codeblockWidth*i,tby0:codeblockHeight*j,tbx1:codeblockWidth*(i+1),tby1:codeblockHeight*(j+1)};codeblock.tbx0_=Math.max(subband.tbx0,codeblock.tbx0);codeblock.tby0_=Math.max(subband.tby0,codeblock.tby0);codeblock.tbx1_=Math.min(subband.tbx1,codeblock.tbx1);codeblock.tby1_=Math.min(subband.tby1,codeblock.tby1);var precinctNumber=Math.floor((codeblock.tbx0_-subband.tbx0)/precinctParameters.precinctWidthInSubband)+
|
|
1029
|
+
Math.floor((codeblock.tby0_-subband.tby0)/precinctParameters.precinctHeightInSubband)*precinctParameters.numprecinctswide;codeblock.precinctNumber=precinctNumber;codeblock.subbandType=subband.type;codeblock.Lblock=3;if(!(codeblock.tbx1_<=codeblock.tbx0_||codeblock.tby1_<=codeblock.tby0_)){codeblocks.push(codeblock);var precinct=precincts[precinctNumber];void 0!==precinct?(i<precinct.cbxMin?precinct.cbxMin=i:i>precinct.cbxMax&&(precinct.cbxMax=i),j<precinct.cbyMin?precinct.cbxMin=j:j>precinct.cbyMax&&
|
|
1030
|
+
(precinct.cbyMax=j)):precincts[precinctNumber]=precinct={cbxMin:i,cbyMin:j,cbxMax:i,cbyMax:j};codeblock.precinct=precinct}}subband.codeblockParameters={codeblockWidth:context,codeblockHeight:dimensions,numcodeblockwide:cbx1-cbx0+1,numcodeblockhigh:cby1-cby0+1};subband.codeblocks=codeblocks;subband.precincts=precincts}function createPacket(resolution,precinctNumber,layerNumber){var precinctCodeblocks=[];resolution=resolution.subbands;for(var i=0,ii=resolution.length;i<ii;i++)for(var codeblocks=resolution[i].codeblocks,
|
|
1031
|
+
j=0,jj=codeblocks.length;j<jj;j++){var codeblock=codeblocks[j];codeblock.precinctNumber===precinctNumber&&precinctCodeblocks.push(codeblock)}return{layerNumber:layerNumber,codeblocks:precinctCodeblocks}}function LayerResolutionComponentPositionIterator(context){var tile=context.tiles[context.currentTile.index],layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,maxDecompositionLevelsCount=0;for(context=0;context<componentsCount;context++)maxDecompositionLevelsCount=
|
|
1032
|
+
Math.max(maxDecompositionLevelsCount,tile.components[context].codingStyleParameters.decompositionLevelsCount);var l=0,r=0,i=0,k=0;this.nextPacket=function(){for(;l<layersCount;l++){for(;r<=maxDecompositionLevelsCount;r++){for(;i<componentsCount;i++){var component=tile.components[i];if(!(r>component.codingStyleParameters.decompositionLevelsCount)){component=component.resolutions[r];for(var numprecincts=component.precinctParameters.numprecincts;k<numprecincts;)return component=createPacket(component,
|
|
1033
|
+
k,l),k++,component;k=0}}i=0}r=0}throw new JpxError("Out of packets");}}function ResolutionLayerComponentPositionIterator(context){var tile=context.tiles[context.currentTile.index],layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,maxDecompositionLevelsCount=0;for(context=0;context<componentsCount;context++)maxDecompositionLevelsCount=Math.max(maxDecompositionLevelsCount,tile.components[context].codingStyleParameters.decompositionLevelsCount);var r=0,l=0,i=
|
|
1034
|
+
0,k=0;this.nextPacket=function(){for(;r<=maxDecompositionLevelsCount;r++){for(;l<layersCount;l++){for(;i<componentsCount;i++){var component=tile.components[i];if(!(r>component.codingStyleParameters.decompositionLevelsCount)){component=component.resolutions[r];for(var numprecincts=component.precinctParameters.numprecincts;k<numprecincts;)return component=createPacket(component,k,l),k++,component;k=0}}i=0}l=0}throw new JpxError("Out of packets");}}function ResolutionPositionComponentLayerIterator(context){var tile=
|
|
1035
|
+
context.tiles[context.currentTile.index],layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,l,r,c,maxDecompositionLevelsCount=0;for(c=0;c<componentsCount;c++)maxDecompositionLevelsCount=Math.max(maxDecompositionLevelsCount,tile.components[c].codingStyleParameters.decompositionLevelsCount);var maxNumPrecinctsInLevel=new Int32Array(maxDecompositionLevelsCount+1);for(r=0;r<=maxDecompositionLevelsCount;++r){for(c=context=0;c<componentsCount;++c){var resolutions=
|
|
1036
|
+
tile.components[c].resolutions;r<resolutions.length&&(context=Math.max(context,resolutions[r].precinctParameters.numprecincts))}maxNumPrecinctsInLevel[r]=context}var p=c=r=l=0;this.nextPacket=function(){for(;r<=maxDecompositionLevelsCount;r++){for(;p<maxNumPrecinctsInLevel[r];p++){for(;c<componentsCount;c++){var component=tile.components[c];if(!(r>component.codingStyleParameters.decompositionLevelsCount||(component=component.resolutions[r],p>=component.precinctParameters.numprecincts))){for(;l<layersCount;)return component=
|
|
1037
|
+
createPacket(component,p,l),l++,component;l=0}}c=0}p=0}throw new JpxError("Out of packets");}}function PositionComponentResolutionLayerIterator(context){var tile=context.tiles[context.currentTile.index],layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,precinctsSizes=getPrecinctSizesInImageScale(tile),l=0,r=0,c=0,px=0,py=0;this.nextPacket=function(){for(;py<precinctsSizes.maxNumHigh;py++){for(;px<precinctsSizes.maxNumWide;px++){for(;c<componentsCount;c++){for(var component=
|
|
1038
|
+
tile.components[c],decompositionLevelsCount=component.codingStyleParameters.decompositionLevelsCount;r<=decompositionLevelsCount;r++){var resolution=component.resolutions[r],k=getPrecinctIndexIfExist(px,py,precinctsSizes.components[c].resolutions[r],precinctsSizes,resolution);if(null!==k){for(;l<layersCount;)return component=createPacket(resolution,k,l),l++,component;l=0}}r=0}c=0}px=0}throw new JpxError("Out of packets");}}function ComponentPositionResolutionLayerIterator(context){var tile=context.tiles[context.currentTile.index],
|
|
1039
|
+
layersCount=tile.codingStyleDefaultParameters.layersCount,componentsCount=context.SIZ.Csiz,precinctsSizes=getPrecinctSizesInImageScale(tile),l=0,r=0,c=0,px=0,py=0;this.nextPacket=function(){for(;c<componentsCount;++c){for(var component=tile.components[c],precinctsIterationSizes=precinctsSizes.components[c],decompositionLevelsCount=component.codingStyleParameters.decompositionLevelsCount;py<precinctsIterationSizes.maxNumHigh;py++){for(;px<precinctsIterationSizes.maxNumWide;px++){for(;r<=decompositionLevelsCount;r++){var resolution=
|
|
1040
|
+
component.resolutions[r],k=getPrecinctIndexIfExist(px,py,precinctsIterationSizes.resolutions[r],precinctsIterationSizes,resolution);if(null!==k){for(;l<layersCount;)return component=createPacket(resolution,k,l),l++,component;l=0}}r=0}px=0}py=0}throw new JpxError("Out of packets");}}function getPrecinctIndexIfExist(pxIndex,pyIndex,sizeInImageScale,precinctIterationSizes,resolution){pxIndex*=precinctIterationSizes.minWidth;pyIndex*=precinctIterationSizes.minHeight;return 0!==pxIndex%sizeInImageScale.width||
|
|
1041
|
+
0!==pyIndex%sizeInImageScale.height?null:pxIndex/sizeInImageScale.height+pyIndex/sizeInImageScale.width*resolution.precinctParameters.numprecinctswide}function getPrecinctSizesInImageScale(tile){for(var componentsCount=tile.components.length,minWidth=Number.MAX_VALUE,minHeight=Number.MAX_VALUE,maxNumWide=0,maxNumHigh=0,sizePerComponent=Array(componentsCount),c=0;c<componentsCount;c++){for(var component=tile.components[c],decompositionLevelsCount=component.codingStyleParameters.decompositionLevelsCount,
|
|
1042
|
+
sizePerResolution=Array(decompositionLevelsCount+1),minWidthCurrentComponent=Number.MAX_VALUE,minHeightCurrentComponent=Number.MAX_VALUE,maxNumWideCurrentComponent=0,maxNumHighCurrentComponent=0,scale=1;0<=decompositionLevelsCount;--decompositionLevelsCount){var resolution=component.resolutions[decompositionLevelsCount],widthCurrentResolution=scale*resolution.precinctParameters.precinctWidth,heightCurrentResolution=scale*resolution.precinctParameters.precinctHeight;minWidthCurrentComponent=Math.min(minWidthCurrentComponent,
|
|
1043
|
+
widthCurrentResolution);minHeightCurrentComponent=Math.min(minHeightCurrentComponent,heightCurrentResolution);maxNumWideCurrentComponent=Math.max(maxNumWideCurrentComponent,resolution.precinctParameters.numprecinctswide);maxNumHighCurrentComponent=Math.max(maxNumHighCurrentComponent,resolution.precinctParameters.numprecinctshigh);sizePerResolution[decompositionLevelsCount]={width:widthCurrentResolution,height:heightCurrentResolution};scale<<=1}minWidth=Math.min(minWidth,minWidthCurrentComponent);
|
|
1044
|
+
minHeight=Math.min(minHeight,minHeightCurrentComponent);maxNumWide=Math.max(maxNumWide,maxNumWideCurrentComponent);maxNumHigh=Math.max(maxNumHigh,maxNumHighCurrentComponent);sizePerComponent[c]={resolutions:sizePerResolution,minWidth:minWidthCurrentComponent,minHeight:minHeightCurrentComponent,maxNumWide:maxNumWideCurrentComponent,maxNumHigh:maxNumHighCurrentComponent}}return{components:sizePerComponent,minWidth:minWidth,minHeight:minHeight,maxNumWide:maxNumWide,maxNumHigh:maxNumHigh}}function parseTilePackets(context,
|
|
1045
|
+
data,offset,dataLength){function readBits(count){for(;bufferSize<count;){var b=data[offset+position];position++;skipNextBit?(buffer=buffer<<7|b,bufferSize+=7,skipNextBit=!1):(buffer=buffer<<8|b,bufferSize+=8);255===b&&(skipNextBit=!0)}bufferSize-=count;return buffer>>>bufferSize&(1<<count)-1}function skipMarkerIfEqual(value){return 255===data[offset+position-1]&&data[offset+position]===value?(position+=1,!0):255===data[offset+position]&&data[offset+position+1]===value?(position+=2,!0):!1}function readCodingpasses(){if(0===
|
|
1046
|
+
readBits(1))return 1;if(0===readBits(1))return 2;var value=readBits(2);if(3>value)return value+3;value=readBits(5);if(31>value)return value+6;value=readBits(7);return value+37}var position=0,buffer,bufferSize=0,skipNextBit=!1,sopMarkerUsed=context.COD.sopMarkerUsed,ephMarkerUsed=context.COD.ephMarkerUsed;for(context=context.tiles[context.currentTile.index].packetsIterator;position<dataLength;){bufferSize=0;skipNextBit&&(position++,skipNextBit=!1);sopMarkerUsed&&skipMarkerIfEqual(145)&&(position+=
|
|
1047
|
+
4);var packet=context.nextPacket();if(readBits(1)){for(var layerNumber=packet.layerNumber,queue=[],codeblock,i=0,ii=packet.codeblocks.length;i<ii;i++){codeblock=packet.codeblocks[i];var precinct=codeblock.precinct,codeblockColumn=codeblock.cbx-precinct.cbxMin,codeblockRow=codeblock.cby-precinct.cbyMin,codeblockIncluded=!1,firstTimeInclusion=!1;if(void 0!==codeblock.included)codeblockIncluded=!!readBits(1);else{precinct=codeblock.precinct;if(void 0!==precinct.inclusionTree)var inclusionTree=precinct.inclusionTree;
|
|
1048
|
+
else{var valueReady=precinct.cbxMax-precinct.cbxMin+1;var zeroBitPlanesTree=precinct.cbyMax-precinct.cbyMin+1;inclusionTree=new InclusionTree(valueReady,zeroBitPlanesTree,layerNumber);zeroBitPlanesTree=new TagTree(valueReady,zeroBitPlanesTree);precinct.inclusionTree=inclusionTree;precinct.zeroBitPlanesTree=zeroBitPlanesTree}if(inclusionTree.reset(codeblockColumn,codeblockRow,layerNumber))for(;;)if(readBits(1)){if(valueReady=!inclusionTree.nextLevel()){codeblockIncluded=firstTimeInclusion=codeblock.included=
|
|
1049
|
+
!0;break}}else{inclusionTree.incrementValue(layerNumber);break}}if(codeblockIncluded){if(firstTimeInclusion){zeroBitPlanesTree=precinct.zeroBitPlanesTree;for(zeroBitPlanesTree.reset(codeblockColumn,codeblockRow);;)if(readBits(1)){if(valueReady=!zeroBitPlanesTree.nextLevel())break}else zeroBitPlanesTree.incrementValue();codeblock.zeroBitPlanes=zeroBitPlanesTree.value}for(precinct=readCodingpasses();readBits(1);)codeblock.Lblock++;codeblockColumn=(0,_util.log2)(precinct);codeblockColumn=readBits((precinct<
|
|
1050
|
+
1<<codeblockColumn?codeblockColumn-1:codeblockColumn)+codeblock.Lblock);queue.push({codeblock:codeblock,codingpasses:precinct,dataLength:codeblockColumn})}}bufferSize=0;skipNextBit&&(position++,skipNextBit=!1);for(ephMarkerUsed&&skipMarkerIfEqual(146);0<queue.length;)packet=queue.shift(),codeblock=packet.codeblock,void 0===codeblock.data&&(codeblock.data=[]),codeblock.data.push({data:data,start:offset+position,end:offset+position+packet.dataLength,codingpasses:packet.codingpasses}),position+=packet.dataLength}}return position}
|
|
1051
|
+
var SubbandsGainLog2={LL:0,LH:1,HL:1,HH:2};JpxImage.prototype={parse:function(data){if(65359===(0,_util.readUint16)(data,0))this.parseCodestream(data,0,data.length);else for(var position=0,length=data.length;position<length;){var headerSize=8,lbox=(0,_util.readUint32)(data,position),tbox=(0,_util.readUint32)(data,position+4);position+=headerSize;1===lbox&&(lbox=4294967296*(0,_util.readUint32)(data,position)+(0,_util.readUint32)(data,position+4),position+=8,headerSize+=8);0===lbox&&(lbox=length-position+
|
|
1052
|
+
headerSize);if(lbox<headerSize)throw new JpxError("Invalid box field size");headerSize=lbox-headerSize;lbox=!0;switch(tbox){case 1785737832:lbox=!1;break;case 1668246642:tbox=data[position];if(1===tbox)switch(tbox=(0,_util.readUint32)(data,position+3),tbox){case 16:case 17:case 18:break;default:(0,_util.warn)("Unknown colorspace "+tbox)}else 2===tbox&&(0,_util.info)("ICC profile not supported");break;case 1785737827:this.parseCodestream(data,position,position+headerSize);break;case 1783636E3:218793738!==
|
|
1053
|
+
(0,_util.readUint32)(data,position)&&(0,_util.warn)("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var headerType=String.fromCharCode(tbox>>24&255,tbox>>16&255,tbox>>8&255,tbox&255);(0,_util.warn)("Unsupported header type "+tbox+" ("+headerType+")")}lbox&&(position+=headerSize)}},parseImageProperties:function(stream){for(var newByte=stream.getByte();0<=newByte;){var oldByte=newByte;newByte=stream.getByte();if(65361===(oldByte<<
|
|
1054
|
+
8|newByte)){stream.skip(4);newByte=stream.getInt32()>>>0;oldByte=stream.getInt32()>>>0;var XOsiz=stream.getInt32()>>>0,YOsiz=stream.getInt32()>>>0;stream.skip(16);stream=stream.getUint16();this.width=newByte-XOsiz;this.height=oldByte-YOsiz;this.componentsCount=stream;this.bitsPerComponent=8;return}}throw new JpxError("No size marker found in JPX stream");},parseCodestream:function(data$jscomp$0,start,end){var context={},doNotRecover=!1;try{for(var position=start;position+1<end;){var code=(0,_util.readUint16)(data$jscomp$0,
|
|
1055
|
+
position);position+=2;var length=0,spqcds;switch(code){case 65359:context.mainHeader=!0;break;case 65497:break;case 65361:length=(0,_util.readUint16)(data$jscomp$0,position);var siz={};siz.Xsiz=(0,_util.readUint32)(data$jscomp$0,position+4);siz.Ysiz=(0,_util.readUint32)(data$jscomp$0,position+8);siz.XOsiz=(0,_util.readUint32)(data$jscomp$0,position+12);siz.YOsiz=(0,_util.readUint32)(data$jscomp$0,position+16);siz.XTsiz=(0,_util.readUint32)(data$jscomp$0,position+20);siz.YTsiz=(0,_util.readUint32)(data$jscomp$0,
|
|
1056
|
+
position+24);siz.XTOsiz=(0,_util.readUint32)(data$jscomp$0,position+28);siz.YTOsiz=(0,_util.readUint32)(data$jscomp$0,position+32);var componentsCount=(0,_util.readUint16)(data$jscomp$0,position+36);siz.Csiz=componentsCount;var components=[];var j=position+38;for(var i=0;i<componentsCount;i++){var component={precision:(data$jscomp$0[j]&127)+1,isSigned:!!(data$jscomp$0[j]&128),XRsiz:data$jscomp$0[j+1],YRsiz:data$jscomp$0[j+2]};j+=3;var component$jscomp$0=component,siz$jscomp$0=siz;component$jscomp$0.x0=
|
|
1057
|
+
Math.ceil(siz$jscomp$0.XOsiz/component$jscomp$0.XRsiz);component$jscomp$0.x1=Math.ceil(siz$jscomp$0.Xsiz/component$jscomp$0.XRsiz);component$jscomp$0.y0=Math.ceil(siz$jscomp$0.YOsiz/component$jscomp$0.YRsiz);component$jscomp$0.y1=Math.ceil(siz$jscomp$0.Ysiz/component$jscomp$0.YRsiz);component$jscomp$0.width=component$jscomp$0.x1-component$jscomp$0.x0;component$jscomp$0.height=component$jscomp$0.y1-component$jscomp$0.y0;components.push(component)}context.SIZ=siz;context.components=components;for(var tile$jscomp$0=
|
|
1058
|
+
void 0,context$jscomp$0=context,components$jscomp$0=components,siz$jscomp$1=context$jscomp$0.SIZ,tiles=[],numXtiles=Math.ceil((siz$jscomp$1.Xsiz-siz$jscomp$1.XTOsiz)/siz$jscomp$1.XTsiz),numYtiles=Math.ceil((siz$jscomp$1.Ysiz-siz$jscomp$1.YTOsiz)/siz$jscomp$1.YTsiz),q=0;q<numYtiles;q++)for(var p=0;p<numXtiles;p++)tile$jscomp$0={},tile$jscomp$0.tx0=Math.max(siz$jscomp$1.XTOsiz+p*siz$jscomp$1.XTsiz,siz$jscomp$1.XOsiz),tile$jscomp$0.ty0=Math.max(siz$jscomp$1.YTOsiz+q*siz$jscomp$1.YTsiz,siz$jscomp$1.YOsiz),
|
|
1059
|
+
tile$jscomp$0.tx1=Math.min(siz$jscomp$1.XTOsiz+(p+1)*siz$jscomp$1.XTsiz,siz$jscomp$1.Xsiz),tile$jscomp$0.ty1=Math.min(siz$jscomp$1.YTOsiz+(q+1)*siz$jscomp$1.YTsiz,siz$jscomp$1.Ysiz),tile$jscomp$0.width=tile$jscomp$0.tx1-tile$jscomp$0.tx0,tile$jscomp$0.height=tile$jscomp$0.ty1-tile$jscomp$0.ty0,tile$jscomp$0.components=[],tiles.push(tile$jscomp$0);context$jscomp$0.tiles=tiles;for(var i$jscomp$0=0,ii=siz$jscomp$1.Csiz;i$jscomp$0<ii;i$jscomp$0++)for(var component$jscomp$1=components$jscomp$0[i$jscomp$0],
|
|
1060
|
+
j$jscomp$0=0,jj=tiles.length;j$jscomp$0<jj;j$jscomp$0++){var tileComponent={};tile$jscomp$0=tiles[j$jscomp$0];tileComponent.tcx0=Math.ceil(tile$jscomp$0.tx0/component$jscomp$1.XRsiz);tileComponent.tcy0=Math.ceil(tile$jscomp$0.ty0/component$jscomp$1.YRsiz);tileComponent.tcx1=Math.ceil(tile$jscomp$0.tx1/component$jscomp$1.XRsiz);tileComponent.tcy1=Math.ceil(tile$jscomp$0.ty1/component$jscomp$1.YRsiz);tileComponent.width=tileComponent.tcx1-tileComponent.tcx0;tileComponent.height=tileComponent.tcy1-tileComponent.tcy0;
|
|
1061
|
+
tile$jscomp$0.components[i$jscomp$0]=tileComponent}context.QCC=[];context.COC=[];break;case 65372:length=(0,_util.readUint16)(data$jscomp$0,position);var qcd={};j=position+2;var sqcd=data$jscomp$0[j++];switch(sqcd&31){case 0:var spqcdSize=8;var scalarExpounded=!0;break;case 1:spqcdSize=16;scalarExpounded=!1;break;case 2:spqcdSize=16;scalarExpounded=!0;break;default:throw Error("Invalid SQcd value "+sqcd);}qcd.noQuantization=8===spqcdSize;qcd.scalarExpounded=scalarExpounded;qcd.guardBits=sqcd>>5;for(spqcds=
|
|
1062
|
+
[];j<length+position;){var spqcd={};8===spqcdSize?(spqcd.epsilon=data$jscomp$0[j++]>>3,spqcd.mu=0):(spqcd.epsilon=data$jscomp$0[j]>>3,spqcd.mu=(data$jscomp$0[j]&7)<<8|data$jscomp$0[j+1],j+=2);spqcds.push(spqcd)}qcd.SPqcds=spqcds;context.mainHeader?context.QCD=qcd:(context.currentTile.QCD=qcd,context.currentTile.QCC=[]);break;case 65373:length=(0,_util.readUint16)(data$jscomp$0,position);var qcc={};j=position+2;if(257>context.SIZ.Csiz)var cqcc=data$jscomp$0[j++];else cqcc=(0,_util.readUint16)(data$jscomp$0,
|
|
1063
|
+
j),j+=2;sqcd=data$jscomp$0[j++];switch(sqcd&31){case 0:spqcdSize=8;scalarExpounded=!0;break;case 1:spqcdSize=16;scalarExpounded=!1;break;case 2:spqcdSize=16;scalarExpounded=!0;break;default:throw Error("Invalid SQcd value "+sqcd);}qcc.noQuantization=8===spqcdSize;qcc.scalarExpounded=scalarExpounded;qcc.guardBits=sqcd>>5;for(spqcds=[];j<length+position;)spqcd={},8===spqcdSize?(spqcd.epsilon=data$jscomp$0[j++]>>3,spqcd.mu=0):(spqcd.epsilon=data$jscomp$0[j]>>3,spqcd.mu=(data$jscomp$0[j]&7)<<8|data$jscomp$0[j+
|
|
1064
|
+
1],j+=2),spqcds.push(spqcd);qcc.SPqcds=spqcds;context.mainHeader?context.QCC[cqcc]=qcc:context.currentTile.QCC[cqcc]=qcc;break;case 65362:length=(0,_util.readUint16)(data$jscomp$0,position);var cod={};j=position+2;var scod=data$jscomp$0[j++];cod.entropyCoderWithCustomPrecincts=!!(scod&1);cod.sopMarkerUsed=!!(scod&2);cod.ephMarkerUsed=!!(scod&4);cod.progressionOrder=data$jscomp$0[j++];cod.layersCount=(0,_util.readUint16)(data$jscomp$0,j);j+=2;cod.multipleComponentTransform=data$jscomp$0[j++];cod.decompositionLevelsCount=
|
|
1065
|
+
data$jscomp$0[j++];cod.xcb=(data$jscomp$0[j++]&15)+2;cod.ycb=(data$jscomp$0[j++]&15)+2;var blockStyle=data$jscomp$0[j++];cod.selectiveArithmeticCodingBypass=!!(blockStyle&1);cod.resetContextProbabilities=!!(blockStyle&2);cod.terminationOnEachCodingPass=!!(blockStyle&4);cod.verticallyStripe=!!(blockStyle&8);cod.predictableTermination=!!(blockStyle&16);cod.segmentationSymbolUsed=!!(blockStyle&32);cod.reversibleTransformation=data$jscomp$0[j++];if(cod.entropyCoderWithCustomPrecincts){for(var precinctsSizes=
|
|
1066
|
+
[];j<length+position;){var precinctsSize=data$jscomp$0[j++];precinctsSizes.push({PPx:precinctsSize&15,PPy:precinctsSize>>4})}cod.precinctsSizes=precinctsSizes}var unsupported=[];cod.selectiveArithmeticCodingBypass&&unsupported.push("selectiveArithmeticCodingBypass");cod.resetContextProbabilities&&unsupported.push("resetContextProbabilities");cod.terminationOnEachCodingPass&&unsupported.push("terminationOnEachCodingPass");cod.verticallyStripe&&unsupported.push("verticallyStripe");cod.predictableTermination&&
|
|
1067
|
+
unsupported.push("predictableTermination");if(0<unsupported.length)throw doNotRecover=!0,Error("Unsupported COD options ("+unsupported.join(", ")+")");context.mainHeader?context.COD=cod:(context.currentTile.COD=cod,context.currentTile.COC=[]);break;case 65424:length=(0,_util.readUint16)(data$jscomp$0,position);var tile={};tile.index=(0,_util.readUint16)(data$jscomp$0,position+2);tile.length=(0,_util.readUint32)(data$jscomp$0,position+4);tile.dataEnd=tile.length+position-2;tile.partIndex=data$jscomp$0[position+
|
|
1068
|
+
8];tile.partsCount=data$jscomp$0[position+9];context.mainHeader=!1;0===tile.partIndex&&(tile.COD=context.COD,tile.COC=context.COC.slice(0),tile.QCD=context.QCD,tile.QCC=context.QCC.slice(0));context.currentTile=tile;break;case 65427:tile=context.currentTile;if(0===tile.partIndex){for(var context$jscomp$1=context,componentsCount$jscomp$0=context$jscomp$1.SIZ.Csiz,tile$jscomp$1=context$jscomp$1.tiles[tile.index],c=0;c<componentsCount$jscomp$0;c++){var component$jscomp$2=tile$jscomp$1.components[c];
|
|
1069
|
+
component$jscomp$2.quantizationParameters=void 0!==context$jscomp$1.currentTile.QCC[c]?context$jscomp$1.currentTile.QCC[c]:context$jscomp$1.currentTile.QCD;component$jscomp$2.codingStyleParameters=void 0!==context$jscomp$1.currentTile.COC[c]?context$jscomp$1.currentTile.COC[c]:context$jscomp$1.currentTile.COD}tile$jscomp$1.codingStyleDefaultParameters=context$jscomp$1.currentTile.COD;for(var context$jscomp$2=context,tile$jscomp$2=context$jscomp$2.tiles[context$jscomp$2.currentTile.index],componentsCount$jscomp$1=
|
|
1070
|
+
context$jscomp$2.SIZ.Csiz,c$jscomp$0=0;c$jscomp$0<componentsCount$jscomp$1;c$jscomp$0++){for(var component$jscomp$3=tile$jscomp$2.components[c$jscomp$0],decompositionLevelsCount=component$jscomp$3.codingStyleParameters.decompositionLevelsCount,resolutions=[],subbands=[],r=0;r<=decompositionLevelsCount;r++){var r$jscomp$0=r,codOrCoc=component$jscomp$3.codingStyleParameters,result={};codOrCoc.entropyCoderWithCustomPrecincts?(result.PPx=codOrCoc.precinctsSizes[r$jscomp$0].PPx,result.PPy=codOrCoc.precinctsSizes[r$jscomp$0].PPy):
|
|
1071
|
+
(result.PPx=15,result.PPy=15);result.xcb_=0<r$jscomp$0?Math.min(codOrCoc.xcb,result.PPx-1):Math.min(codOrCoc.xcb,result.PPx);result.ycb_=0<r$jscomp$0?Math.min(codOrCoc.ycb,result.PPy-1):Math.min(codOrCoc.ycb,result.PPy);var blocksDimensions=result;var resolution={},scale=1<<decompositionLevelsCount-r;resolution.trx0=Math.ceil(component$jscomp$3.tcx0/scale);resolution.try0=Math.ceil(component$jscomp$3.tcy0/scale);resolution.trx1=Math.ceil(component$jscomp$3.tcx1/scale);resolution.try1=Math.ceil(component$jscomp$3.tcy1/
|
|
1072
|
+
scale);resolution.resLevel=r;var precinctWidth=1<<blocksDimensions.PPx,precinctHeight=1<<blocksDimensions.PPy,isZeroRes=0===resolution.resLevel,numprecinctswide=resolution.trx1>resolution.trx0?Math.ceil(resolution.trx1/precinctWidth)-Math.floor(resolution.trx0/precinctWidth):0,numprecinctshigh=resolution.try1>resolution.try0?Math.ceil(resolution.try1/precinctHeight)-Math.floor(resolution.try0/precinctHeight):0;resolution.precinctParameters={precinctWidth:precinctWidth,precinctHeight:precinctHeight,
|
|
1073
|
+
numprecinctswide:numprecinctswide,numprecinctshigh:numprecinctshigh,numprecincts:numprecinctswide*numprecinctshigh,precinctWidthInSubband:1<<blocksDimensions.PPx+(isZeroRes?0:-1),precinctHeightInSubband:1<<blocksDimensions.PPy+(isZeroRes?0:-1)};resolutions.push(resolution);if(0===r){var subband={type:"LL"};subband.tbx0=Math.ceil(component$jscomp$3.tcx0/scale);subband.tby0=Math.ceil(component$jscomp$3.tcy0/scale);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/scale);subband.tby1=Math.ceil(component$jscomp$3.tcy1/
|
|
1074
|
+
scale);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,subband,blocksDimensions);subbands.push(subband);resolution.subbands=[subband]}else{var bscale=1<<decompositionLevelsCount-r+1,resolutionSubbands=[];subband={type:"HL"};subband.tbx0=Math.ceil(component$jscomp$3.tcx0/bscale-.5);subband.tby0=Math.ceil(component$jscomp$3.tcy0/bscale);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/bscale-.5);subband.tby1=Math.ceil(component$jscomp$3.tcy1/bscale);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,
|
|
1075
|
+
subband,blocksDimensions);subbands.push(subband);resolutionSubbands.push(subband);subband={type:"LH"};subband.tbx0=Math.ceil(component$jscomp$3.tcx0/bscale);subband.tby0=Math.ceil(component$jscomp$3.tcy0/bscale-.5);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/bscale);subband.tby1=Math.ceil(component$jscomp$3.tcy1/bscale-.5);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,subband,blocksDimensions);subbands.push(subband);resolutionSubbands.push(subband);subband={type:"HH"};subband.tbx0=
|
|
1076
|
+
Math.ceil(component$jscomp$3.tcx0/bscale-.5);subband.tby0=Math.ceil(component$jscomp$3.tcy0/bscale-.5);subband.tbx1=Math.ceil(component$jscomp$3.tcx1/bscale-.5);subband.tby1=Math.ceil(component$jscomp$3.tcy1/bscale-.5);subband.resolution=resolution;buildCodeblocks(context$jscomp$2,subband,blocksDimensions);subbands.push(subband);resolutionSubbands.push(subband);resolution.subbands=resolutionSubbands}}component$jscomp$3.resolutions=resolutions;component$jscomp$3.subbands=subbands}var progressionOrder=
|
|
1077
|
+
tile$jscomp$2.codingStyleDefaultParameters.progressionOrder;switch(progressionOrder){case 0:tile$jscomp$2.packetsIterator=new LayerResolutionComponentPositionIterator(context$jscomp$2);break;case 1:tile$jscomp$2.packetsIterator=new ResolutionLayerComponentPositionIterator(context$jscomp$2);break;case 2:tile$jscomp$2.packetsIterator=new ResolutionPositionComponentLayerIterator(context$jscomp$2);break;case 3:tile$jscomp$2.packetsIterator=new PositionComponentResolutionLayerIterator(context$jscomp$2);
|
|
1078
|
+
break;case 4:tile$jscomp$2.packetsIterator=new ComponentPositionResolutionLayerIterator(context$jscomp$2);break;default:throw new JpxError("Unsupported progression order ".concat(progressionOrder));}}length=tile.dataEnd-position;parseTilePackets(context,data$jscomp$0,position,length);break;case 65365:case 65367:case 65368:case 65380:length=(0,_util.readUint16)(data$jscomp$0,position);break;case 65363:throw Error("Codestream code 0xFF53 (COC) is not implemented");default:throw Error("Unknown codestream code: "+
|
|
1079
|
+
code.toString(16));}position+=length}}catch(e){if(doNotRecover||this.failOnCorruptedImage)throw new JpxError(e.message);(0,_util.warn)("JPX: Trying to recover from: "+e.message)}for(var components$jscomp$1=context.components,componentsCount$jscomp$2=context.SIZ.Csiz,resultImages=[],i$jscomp$1=0,ii$jscomp$0=context.tiles.length;i$jscomp$1<ii$jscomp$0;i$jscomp$1++){var tile$jscomp$3=context.tiles[i$jscomp$1],transformedTiles=[],c$jscomp$1;for(c$jscomp$1=0;c$jscomp$1<componentsCount$jscomp$2;c$jscomp$1++){for(var JSCompiler_temp_const=
|
|
1080
|
+
transformedTiles,JSCompiler_temp_const$jscomp$0=c$jscomp$1,component$jscomp$4=tile$jscomp$3.components[c$jscomp$1],codingStyleParameters=component$jscomp$4.codingStyleParameters,quantizationParameters=component$jscomp$4.quantizationParameters,decompositionLevelsCount$jscomp$0=codingStyleParameters.decompositionLevelsCount,spqcds$jscomp$0=quantizationParameters.SPqcds,scalarExpounded$jscomp$0=quantizationParameters.scalarExpounded,guardBits=quantizationParameters.guardBits,segmentationSymbolUsed=codingStyleParameters.segmentationSymbolUsed,
|
|
1081
|
+
precision=context.components[c$jscomp$1].precision,reversible=codingStyleParameters.reversibleTransformation,transform=reversible?new ReversibleTransform:new IrreversibleTransform,subbandCoefficients=[],b=0,i$jscomp$2=0;i$jscomp$2<=decompositionLevelsCount$jscomp$0;i$jscomp$2++){for(var resolution$jscomp$0=component$jscomp$4.resolutions[i$jscomp$2],width=resolution$jscomp$0.trx1-resolution$jscomp$0.trx0,height=resolution$jscomp$0.try1-resolution$jscomp$0.try0,coefficients=new Float32Array(width*height),
|
|
1082
|
+
j$jscomp$1=0,jj$jscomp$0=resolution$jscomp$0.subbands.length;j$jscomp$1<jj$jscomp$0;j$jscomp$1++){if(scalarExpounded$jscomp$0){var mu=spqcds$jscomp$0[b].mu;var epsilon=spqcds$jscomp$0[b].epsilon;b++}else mu=spqcds$jscomp$0[0].mu,epsilon=spqcds$jscomp$0[0].epsilon+(0<i$jscomp$2?1-i$jscomp$2:0);for(var subband$jscomp$0=resolution$jscomp$0.subbands[j$jscomp$1],gainLog2=SubbandsGainLog2[subband$jscomp$0.type],coefficients$jscomp$0=coefficients,levelWidth=width,subband$jscomp$1=subband$jscomp$0,delta=
|
|
1083
|
+
reversible?1:Math.pow(2,precision+gainLog2-epsilon)*(1+mu/2048),mb=guardBits+epsilon-1,reversible$jscomp$0=reversible,segmentationSymbolUsed$jscomp$0=segmentationSymbolUsed,x0=subband$jscomp$1.tbx0,y0=subband$jscomp$1.tby0,width$jscomp$0=subband$jscomp$1.tbx1-subband$jscomp$1.tbx0,codeblocks=subband$jscomp$1.codeblocks,right="H"===subband$jscomp$1.type.charAt(0)?1:0,bottom="H"===subband$jscomp$1.type.charAt(1)?levelWidth:0,i$jscomp$3=0,ii$jscomp$1=codeblocks.length;i$jscomp$3<ii$jscomp$1;++i$jscomp$3){var codeblock=
|
|
1084
|
+
codeblocks[i$jscomp$3],blockWidth=codeblock.tbx1_-codeblock.tbx0_,blockHeight=codeblock.tby1_-codeblock.tby0_;if(0!==blockWidth&&0!==blockHeight&&void 0!==codeblock.data){var bitModel=new BitModel(blockWidth,blockHeight,codeblock.subbandType,codeblock.zeroBitPlanes,mb);var currentCodingpassType=2;var data=codeblock.data,totalLength=0,codingpasses=0,jj$jscomp$1;var j$jscomp$2=0;for(jj$jscomp$1=data.length;j$jscomp$2<jj$jscomp$1;j$jscomp$2++){var dataItem=data[j$jscomp$2];totalLength+=dataItem.end-
|
|
1085
|
+
dataItem.start;codingpasses+=dataItem.codingpasses}var encodedData=new Uint8Array(totalLength),position$jscomp$0=0;j$jscomp$2=0;for(jj$jscomp$1=data.length;j$jscomp$2<jj$jscomp$1;j$jscomp$2++){dataItem=data[j$jscomp$2];var chunk=dataItem.data.subarray(dataItem.start,dataItem.end);encodedData.set(chunk,position$jscomp$0);position$jscomp$0+=chunk.length}var decoder=new _arithmetic_decoder.ArithmeticDecoder(encodedData,0,totalLength);bitModel.setDecoder(decoder);for(j$jscomp$2=0;j$jscomp$2<codingpasses;j$jscomp$2++){switch(currentCodingpassType){case 0:bitModel.runSignificancePropagationPass();
|
|
1086
|
+
break;case 1:bitModel.runMagnitudeRefinementPass();break;case 2:bitModel.runCleanupPass(),segmentationSymbolUsed$jscomp$0&&bitModel.checkSegmentationSymbol()}currentCodingpassType=(currentCodingpassType+1)%3}var offset=codeblock.tbx0_-x0+(codeblock.tby0_-y0)*width$jscomp$0,sign=bitModel.coefficentsSign,magnitude=bitModel.coefficentsMagnitude,bitsDecoded=bitModel.bitsDecoded,magnitudeCorrection=reversible$jscomp$0?0:.5,k;position$jscomp$0=0;var interleave="LL"!==subband$jscomp$1.type;for(j$jscomp$2=
|
|
1087
|
+
0;j$jscomp$2<blockHeight;j$jscomp$2++){var levelOffset=2*(offset/width$jscomp$0|0)*(levelWidth-width$jscomp$0)+right+bottom;for(k=0;k<blockWidth;k++){var n=magnitude[position$jscomp$0];if(0!==n){n=(n+magnitudeCorrection)*delta;0!==sign[position$jscomp$0]&&(n=-n);var nb=bitsDecoded[position$jscomp$0];coefficients$jscomp$0[interleave?levelOffset+(offset<<1):offset]=reversible$jscomp$0&&nb>=mb?n:n*(1<<mb-nb)}offset++;position$jscomp$0++}offset+=width$jscomp$0-blockWidth}}}}subbandCoefficients.push({width:width,
|
|
1088
|
+
height:height,items:coefficients})}var result$jscomp$0=transform.calculate(subbandCoefficients,component$jscomp$4.tcx0,component$jscomp$4.tcy0);JSCompiler_temp_const[JSCompiler_temp_const$jscomp$0]={left:component$jscomp$4.tcx0,top:component$jscomp$4.tcy0,width:result$jscomp$0.width,height:result$jscomp$0.height,items:result$jscomp$0.items}}var tile0=transformedTiles[0],out=new Uint8ClampedArray(tile0.items.length*componentsCount$jscomp$2),result$jscomp$1={left:tile0.left,top:tile0.top,width:tile0.width,
|
|
1089
|
+
height:tile0.height,items:out},pos=0,j$jscomp$3;if(tile$jscomp$3.codingStyleDefaultParameters.multipleComponentTransform){var fourComponents=4===componentsCount$jscomp$2,y0items=transformedTiles[0].items,y1items=transformedTiles[1].items,y2items=transformedTiles[2].items,y3items=fourComponents?transformedTiles[3].items:null;var shift=components$jscomp$1[0].precision-8;var offset$jscomp$0=(128<<shift)+.5;var component0=tile$jscomp$3.components[0],alpha01=componentsCount$jscomp$2-3;var jj$jscomp$2=
|
|
1090
|
+
y0items.length;if(component0.codingStyleParameters.reversibleTransformation)for(j$jscomp$3=0;j$jscomp$3<jj$jscomp$2;j$jscomp$3++,pos+=alpha01){var y0$jscomp$0=y0items[j$jscomp$3]+offset$jscomp$0;var y1=y1items[j$jscomp$3];var y2=y2items[j$jscomp$3];var g=y0$jscomp$0-(y2+y1>>2);out[pos++]=g+y2>>shift;out[pos++]=g>>shift;out[pos++]=g+y1>>shift}else for(j$jscomp$3=0;j$jscomp$3<jj$jscomp$2;j$jscomp$3++,pos+=alpha01)y0$jscomp$0=y0items[j$jscomp$3]+offset$jscomp$0,y1=y1items[j$jscomp$3],y2=y2items[j$jscomp$3],
|
|
1091
|
+
out[pos++]=y0$jscomp$0+1.402*y2>>shift,out[pos++]=y0$jscomp$0-.34413*y1-.71414*y2>>shift,out[pos++]=y0$jscomp$0+1.772*y1>>shift;if(fourComponents)for(j$jscomp$3=0,pos=3;j$jscomp$3<jj$jscomp$2;j$jscomp$3++,pos+=4)out[pos]=y3items[j$jscomp$3]+offset$jscomp$0>>shift}else for(c$jscomp$1=0;c$jscomp$1<componentsCount$jscomp$2;c$jscomp$1++){var items=transformedTiles[c$jscomp$1].items;shift=components$jscomp$1[c$jscomp$1].precision-8;offset$jscomp$0=(128<<shift)+.5;pos=c$jscomp$1;j$jscomp$3=0;for(jj$jscomp$2=
|
|
1092
|
+
items.length;j$jscomp$3<jj$jscomp$2;j$jscomp$3++)out[pos]=items[j$jscomp$3]+offset$jscomp$0>>shift,pos+=componentsCount$jscomp$2}resultImages.push(result$jscomp$1)}this.tiles=resultImages;this.width=context.SIZ.Xsiz-context.SIZ.XOsiz;this.height=context.SIZ.Ysiz-context.SIZ.YOsiz;this.componentsCount=context.SIZ.Csiz}};var TagTree=function(){function TagTree(width,height){var levelsLength=(0,_util.log2)(Math.max(width,height))+1;this.levels=[];for(var i=0;i<levelsLength;i++)this.levels.push({width:width,
|
|
1093
|
+
height:height,items:[]}),width=Math.ceil(width/2),height=Math.ceil(height/2)}TagTree.prototype={reset:function(i,j){for(var currentLevel=0,value=0,level;currentLevel<this.levels.length;){level=this.levels[currentLevel];var index=i+j*level.width;if(void 0!==level.items[index]){value=level.items[index];break}level.index=index;i>>=1;j>>=1;currentLevel++}currentLevel--;level=this.levels[currentLevel];level.items[level.index]=value;this.currentLevel=currentLevel;delete this.value},incrementValue:function(){var level=
|
|
1094
|
+
this.levels[this.currentLevel];level.items[level.index]++},nextLevel:function(){var currentLevel=this.currentLevel,level=this.levels[currentLevel],value=level.items[level.index];currentLevel--;if(0>currentLevel)return this.value=value,!1;this.currentLevel=currentLevel;level=this.levels[currentLevel];level.items[level.index]=value;return!0}};return TagTree}(),InclusionTree=function(){function InclusionTree(width,height,defaultValue){var levelsLength=(0,_util.log2)(Math.max(width,height))+1;this.levels=
|
|
1095
|
+
[];for(var i=0;i<levelsLength;i++){for(var items=new Uint8Array(width*height),j=0,jj=items.length;j<jj;j++)items[j]=defaultValue;this.levels.push({width:width,height:height,items:items});width=Math.ceil(width/2);height=Math.ceil(height/2)}}InclusionTree.prototype={reset:function(i,j,stopValue){for(var currentLevel=0;currentLevel<this.levels.length;){var level=this.levels[currentLevel],index=i+j*level.width;level.index=index;level=level.items[index];if(255===level)break;if(level>stopValue)return this.currentLevel=
|
|
1096
|
+
currentLevel,this.propagateValues(),!1;i>>=1;j>>=1;currentLevel++}this.currentLevel=currentLevel-1;return!0},incrementValue:function(stopValue){var level=this.levels[this.currentLevel];level.items[level.index]=stopValue+1;this.propagateValues()},propagateValues:function(){for(var levelIndex=this.currentLevel,level=this.levels[levelIndex],currentValue=level.items[level.index];0<=--levelIndex;)level=this.levels[levelIndex],level.items[level.index]=currentValue},nextLevel:function(){var currentLevel=
|
|
1097
|
+
this.currentLevel,level=this.levels[currentLevel],value=level.items[level.index];level.items[level.index]=255;currentLevel--;if(0>currentLevel)return!1;this.currentLevel=currentLevel;level=this.levels[currentLevel];level.items[level.index]=value;return!0}};return InclusionTree}(),BitModel=function(){function BitModel(width,height,subband,zeroBitPlanes,mb){this.width=width;this.height=height;this.contextLabelTable="HH"===subband?HHContextLabel:"HL"===subband?HLContextLabel:LLAndLHContextsLabel;width*=
|
|
1098
|
+
height;this.neighborsSignificance=new Uint8Array(width);this.coefficentsSign=new Uint8Array(width);this.coefficentsMagnitude=14<mb?new Uint32Array(width):6<mb?new Uint16Array(width):new Uint8Array(width);this.processingFlags=new Uint8Array(width);mb=new Uint8Array(width);if(0!==zeroBitPlanes)for(height=0;height<width;height++)mb[height]=zeroBitPlanes;this.bitsDecoded=mb;this.reset()}var LLAndLHContextsLabel=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,
|
|
1099
|
+
7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),HLContextLabel=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),HHContextLabel=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);BitModel.prototype={setDecoder:function(decoder){this.decoder=
|
|
1100
|
+
decoder},reset:function(){this.contexts=new Int8Array(19);this.contexts[0]=8;this.contexts[17]=92;this.contexts[18]=6},setNeighborsSignificance:function(row,column,index){var neighborsSignificance=this.neighborsSignificance,width=this.width,height=this.height,left=0<column;column=column+1<width;if(0<row){var i=index-width;left&&(neighborsSignificance[i-1]+=16);column&&(neighborsSignificance[i+1]+=16);neighborsSignificance[i]+=4}row+1<height&&(i=index+width,left&&(neighborsSignificance[i-1]+=16),column&&
|
|
1101
|
+
(neighborsSignificance[i+1]+=16),neighborsSignificance[i]+=4);left&&(neighborsSignificance[index-1]+=1);column&&(neighborsSignificance[index+1]+=1);neighborsSignificance[index]|=128},runSignificancePropagationPass:function(){for(var decoder=this.decoder,width=this.width,height=this.height,coefficentsMagnitude=this.coefficentsMagnitude,coefficentsSign=this.coefficentsSign,neighborsSignificance=this.neighborsSignificance,processingFlags=this.processingFlags,contexts=this.contexts,labels=this.contextLabelTable,
|
|
1102
|
+
bitsDecoded=this.bitsDecoded,i0=0;i0<height;i0+=4)for(var j=0;j<width;j++)for(var index=i0*width+j,i1=0;4>i1;i1++,index+=width){var i=i0+i1;if(i>=height)break;processingFlags[index]&=-2;if(!coefficentsMagnitude[index]&&neighborsSignificance[index]){if(decoder.readBit(contexts,labels[neighborsSignificance[index]])){var sign=this.decodeSignBit(i,j,index);coefficentsSign[index]=sign;coefficentsMagnitude[index]=1;this.setNeighborsSignificance(i,j,index);processingFlags[index]|=2}bitsDecoded[index]++;
|
|
1103
|
+
processingFlags[index]|=1}}},decodeSignBit:function(row,column,index){var width=this.width,height=this.height,coefficentsMagnitude=this.coefficentsMagnitude,coefficentsSign=this.coefficentsSign;var sign0=0<column&&0!==coefficentsMagnitude[index-1];column+1<width&&0!==coefficentsMagnitude[index+1]?(column=coefficentsSign[index+1],sign0?(sign0=coefficentsSign[index-1],column=1-column-sign0):column=1-column-column):sign0?(sign0=coefficentsSign[index-1],column=1-sign0-sign0):column=0;var horizontalContribution=
|
|
1104
|
+
3*column;sign0=0<row&&0!==coefficentsMagnitude[index-width];row+1<height&&0!==coefficentsMagnitude[index+width]?(column=coefficentsSign[index+width],sign0?(sign0=coefficentsSign[index-width],column=1-column-sign0+horizontalContribution):column=1-column-column+horizontalContribution):sign0?(sign0=coefficentsSign[index-width],column=1-sign0-sign0+horizontalContribution):column=horizontalContribution;return 0<=column?this.decoder.readBit(this.contexts,9+column):this.decoder.readBit(this.contexts,9-column)^
|
|
1105
|
+
1},runMagnitudeRefinementPass:function(){for(var decoder=this.decoder,width=this.width,coefficentsMagnitude=this.coefficentsMagnitude,neighborsSignificance=this.neighborsSignificance,contexts=this.contexts,bitsDecoded=this.bitsDecoded,processingFlags=this.processingFlags,length=width*this.height,width4=4*width,index0=0,indexNext;index0<length;index0=indexNext){indexNext=Math.min(length,index0+width4);for(var j=0;j<width;j++)for(var index=index0+j;index<indexNext;index+=width)if(coefficentsMagnitude[index]&&
|
|
1106
|
+
0===(processingFlags[index]&1)){var contextLabel=16;0!==(processingFlags[index]&2)&&(processingFlags[index]^=2,contextLabel=0===(neighborsSignificance[index]&127)?15:14);contextLabel=decoder.readBit(contexts,contextLabel);coefficentsMagnitude[index]=coefficentsMagnitude[index]<<1|contextLabel;bitsDecoded[index]++;processingFlags[index]|=1}}},runCleanupPass:function(){for(var decoder=this.decoder,width=this.width,height=this.height,neighborsSignificance=this.neighborsSignificance,coefficentsMagnitude=
|
|
1107
|
+
this.coefficentsMagnitude,coefficentsSign=this.coefficentsSign,contexts=this.contexts,labels=this.contextLabelTable,bitsDecoded=this.bitsDecoded,processingFlags=this.processingFlags,twoRowsDown=2*width,threeRowsDown=3*width,iNext,i0=0;i0<height;i0=iNext){iNext=Math.min(i0+4,height);for(var indexBase=i0*width,checkAllEmpty=i0+3<height,j=0;j<width;j++){var index0=indexBase+j,i1=0,index=index0,i=i0;if(checkAllEmpty&&0===processingFlags[index0]&&0===processingFlags[index0+width]&&0===processingFlags[index0+
|
|
1108
|
+
twoRowsDown]&&0===processingFlags[index0+threeRowsDown]&&0===neighborsSignificance[index0]&&0===neighborsSignificance[index0+width]&&0===neighborsSignificance[index0+twoRowsDown]&&0===neighborsSignificance[index0+threeRowsDown]){if(!decoder.readBit(contexts,18)){bitsDecoded[index0]++;bitsDecoded[index0+width]++;bitsDecoded[index0+twoRowsDown]++;bitsDecoded[index0+threeRowsDown]++;continue}i1=decoder.readBit(contexts,17)<<1|decoder.readBit(contexts,17);0!==i1&&(i=i0+i1,index+=i1*width);var sign=this.decodeSignBit(i,
|
|
1109
|
+
j,index);coefficentsSign[index]=sign;coefficentsMagnitude[index]=1;this.setNeighborsSignificance(i,j,index);processingFlags[index]|=2;index=index0;for(index0=i0;index0<=i;index0++,index+=width)bitsDecoded[index]++;i1++}for(i=i0+i1;i<iNext;i++,index+=width)coefficentsMagnitude[index]||0!==(processingFlags[index]&1)||(1===decoder.readBit(contexts,labels[neighborsSignificance[index]])&&(sign=this.decodeSignBit(i,j,index),coefficentsSign[index]=sign,coefficentsMagnitude[index]=1,this.setNeighborsSignificance(i,
|
|
1110
|
+
j,index),processingFlags[index]|=2),bitsDecoded[index]++)}}},checkSegmentationSymbol:function(){var decoder=this.decoder,contexts=this.contexts;if(10!==(decoder.readBit(contexts,17)<<3|decoder.readBit(contexts,17)<<2|decoder.readBit(contexts,17)<<1|decoder.readBit(contexts,17)))throw new JpxError("Invalid segmentation symbol");}};return BitModel}(),Transform=function(){function Transform(){}Transform.prototype.calculate=function(subbands,u0,v0){for(var ll=subbands[0],i=1,ii=subbands.length;i<ii;i++)ll=
|
|
1111
|
+
this.iterate(ll,subbands[i],u0,v0);return ll};Transform.prototype.extend=function(buffer,offset,size){var i1=offset-1,j1=offset+1,i2=offset+size-2;offset+=size;buffer[i1--]=buffer[j1++];buffer[offset++]=buffer[i2--];buffer[i1--]=buffer[j1++];buffer[offset++]=buffer[i2--];buffer[i1--]=buffer[j1++];buffer[offset++]=buffer[i2--];buffer[i1]=buffer[j1];buffer[offset]=buffer[i2]};Transform.prototype.iterate=function(ll,hl_lh_hh,u0,v0){var llWidth=ll.width,llHeight=ll.height,llItems=ll.items,width=hl_lh_hh.width,
|
|
1112
|
+
height=hl_lh_hh.height;hl_lh_hh=hl_lh_hh.items;var i,j,k;for(i=k=0;i<llHeight;i++){var l=2*i*width;for(j=0;j<llWidth;j++,k++,l+=2)hl_lh_hh[l]=llItems[k]}ll.items=null;ll=new Float32Array(width+8);if(1===width){if(0!==(u0&1))for(k=l=0;l<height;l++,k+=width)hl_lh_hh[k]*=.5}else for(k=l=0;l<height;l++,k+=width)ll.set(hl_lh_hh.subarray(k,k+width),4),this.extend(ll,4,width),this.filter(ll,4,width),hl_lh_hh.set(ll.subarray(4,4+width),k);u0=16;llWidth=[];for(i=0;i<u0;i++)llWidth.push(new Float32Array(height+
|
|
1113
|
+
8));i=0;ll=4+height;if(1===height){if(0!==(v0&1))for(v0=0;v0<width;v0++)hl_lh_hh[v0]*=.5}else for(v0=0;v0<width;v0++){if(0===i){u0=Math.min(width-v0,u0);k=v0;for(l=4;l<ll;k+=width,l++)for(llHeight=0;llHeight<u0;llHeight++)llWidth[llHeight][l]=hl_lh_hh[k+llHeight];i=u0}i--;k=llWidth[i];this.extend(k,4,height);this.filter(k,4,height);if(0===i)for(k=v0-u0+1,l=4;l<ll;k+=width,l++)for(llHeight=0;llHeight<u0;llHeight++)hl_lh_hh[k+llHeight]=llWidth[llHeight][l]}return{width:width,height:height,items:hl_lh_hh}};
|
|
1114
|
+
return Transform}(),IrreversibleTransform=function(){function IrreversibleTransform(){Transform.call(this)}IrreversibleTransform.prototype=Object.create(Transform.prototype);IrreversibleTransform.prototype.filter=function(x,offset,length){length>>=1;offset|=0;var n;var j=offset-3;for(n=length+4;n--;j+=2)x[j]*=.8128930661159609;j=offset-2;var current=.443506852043971*x[j-1];for(n=length+3;n--;j+=2){var next=.443506852043971*x[j+1];x[j]=1.230174104914001*x[j]-current-next;if(n--)j+=2,current=.443506852043971*
|
|
1115
|
+
x[j+1],x[j]=1.230174104914001*x[j]-current-next;else break}j=offset-1;current=.882911075530934*x[j-1];for(n=length+2;n--;j+=2)if(next=.882911075530934*x[j+1],x[j]-=current+next,n--)j+=2,current=.882911075530934*x[j+1],x[j]-=current+next;else break;j=offset;current=-.052980118572961*x[j-1];for(n=length+1;n--;j+=2)if(next=-.052980118572961*x[j+1],x[j]-=current+next,n--)j+=2,current=-.052980118572961*x[j+1],x[j]-=current+next;else break;if(0!==length)for(j=offset+1,current=-1.586134342059924*x[j-1],
|
|
1116
|
+
n=length;n--;j+=2)if(next=-1.586134342059924*x[j+1],x[j]-=current+next,n--)j+=2,current=-1.586134342059924*x[j+1],x[j]-=current+next;else break};return IrreversibleTransform}(),ReversibleTransform=function(){function ReversibleTransform(){Transform.call(this)}ReversibleTransform.prototype=Object.create(Transform.prototype);ReversibleTransform.prototype.filter=function(x,offset,length){length>>=1;offset|=0;var n;var j=offset;for(n=length+1;n--;j+=2)x[j]-=x[j-1]+x[j+1]+2>>2;j=offset+1;for(n=length;n--;j+=
|
|
1117
|
+
2)x[j]+=x[j-1]+x[j+1]>>1};return ReversibleTransform}();return JpxImage}();exports.JpxImage=module},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _possibleConstructorReturn(self,call){if(call&&("object"===
|
|
1118
|
+
_typeof(call)||"function"===typeof call))return call;if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");
|
|
1119
|
+
subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _defineProperties(target,
|
|
1120
|
+
props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.calculateSHA512=
|
|
1121
|
+
exports.calculateSHA384=exports.calculateSHA256=exports.calculateMD5=exports.PDF20=exports.PDF17=exports.CipherTransformFactory=exports.ARCFourCipher=exports.AES256Cipher=exports.AES128Cipher=void 0;var _util=__w_pdfjs_require__(5),_primitives=__w_pdfjs_require__(188),_stream=__w_pdfjs_require__(195),ARCFourCipher=function(){function ARCFourCipher(key){this.b=this.a=0;var s=new Uint8Array(256),i,j=0,keyLength=key.length;for(i=0;256>i;++i)s[i]=i;for(i=0;256>i;++i){var tmp=s[i];j=j+tmp+key[i%keyLength]&
|
|
1122
|
+
255;s[i]=s[j];s[j]=tmp}this.s=s}ARCFourCipher.prototype={encryptBlock:function(data){var i,n=data.length,a=this.a,b=this.b,s=this.s,output=new Uint8Array(n);for(i=0;i<n;++i){a=a+1&255;var tmp=s[a];b=b+tmp&255;var tmp2=s[b];s[a]=tmp2;s[b]=tmp;output[i]=data[i]^s[tmp+tmp2&255]}this.a=a;this.b=b;return output}};ARCFourCipher.prototype.decryptBlock=ARCFourCipher.prototype.encryptBlock;return ARCFourCipher}();exports.ARCFourCipher=ARCFourCipher;var calculateMD5=function(){var r=new Uint8Array([7,12,17,
|
|
1123
|
+
22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]),k=new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,
|
|
1124
|
+
1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]);return function(data,offset,length){var h0=1732584193,h1=-271733879,h2=-1732584194,h3=271733878,paddedLength=length+72&-64,padded=
|
|
1125
|
+
new Uint8Array(paddedLength),i;for(i=0;i<length;++i)padded[i]=data[offset++];padded[i++]=128;for(data=paddedLength-8;i<data;)padded[i++]=0;padded[i++]=length<<3&255;padded[i++]=length>>5&255;padded[i++]=length>>13&255;padded[i++]=length>>21&255;padded[i++]=length>>>29&255;padded[i++]=0;padded[i++]=0;padded[i++]=0;data=new Int32Array(16);for(i=0;i<paddedLength;){for(length=0;16>length;++length,i+=4)data[length]=padded[i]|padded[i+1]<<8|padded[i+2]<<16|padded[i+3]<<24;var a=h0;offset=h1;var c=h2,d=
|
|
1126
|
+
h3;for(length=0;64>length;++length){if(16>length){var f=offset&c|~offset&d;var g=length}else 32>length?(f=d&offset|~d&c,g=5*length+1&15):48>length?(f=offset^c^d,g=3*length+5&15):(f=c^(offset|~d),g=7*length&15);var tmp=d;a=a+f+k[length]+data[g]|0;f=r[length];d=c;c=offset;offset=offset+(a<<f|a>>>32-f)|0;a=tmp}h0=h0+a|0;h1=h1+offset|0;h2=h2+c|0;h3=h3+d|0}return new Uint8Array([h0&255,h0>>8&255,h0>>16&255,h0>>>24&255,h1&255,h1>>8&255,h1>>16&255,h1>>>24&255,h2&255,h2>>8&255,h2>>16&255,h2>>>24&255,h3&255,
|
|
1127
|
+
h3>>8&255,h3>>16&255,h3>>>24&255])}}();exports.calculateMD5=calculateMD5;var Word64=function(){function Word64(highInteger,lowInteger){this.high=highInteger|0;this.low=lowInteger|0}Word64.prototype={and:function(word){this.high&=word.high;this.low&=word.low},xor:function(word){this.high^=word.high;this.low^=word.low},or:function(word){this.high|=word.high;this.low|=word.low},shiftRight:function(places){32<=places?(this.low=this.high>>>places-32|0,this.high=0):(this.low=this.low>>>places|this.high<<
|
|
1128
|
+
32-places,this.high=this.high>>>places|0)},shiftLeft:function(places){32<=places?(this.high=this.low<<places-32,this.low=0):(this.high=this.high<<places|this.low>>>32-places,this.low<<=places)},rotateRight:function(places){if(places&32){var high=this.low;var low=this.high}else low=this.low,high=this.high;places&=31;this.low=low>>>places|high<<32-places;this.high=high>>>places|low<<32-places},not:function(){this.high=~this.high;this.low=~this.low},add:function(word){var lowAdd=(this.low>>>0)+(word.low>>>
|
|
1129
|
+
0);word=(this.high>>>0)+(word.high>>>0);4294967295<lowAdd&&(word+=1);this.low=lowAdd|0;this.high=word|0},copyTo:function(bytes,offset){bytes[offset]=this.high>>>24&255;bytes[offset+1]=this.high>>16&255;bytes[offset+2]=this.high>>8&255;bytes[offset+3]=this.high&255;bytes[offset+4]=this.low>>>24&255;bytes[offset+5]=this.low>>16&255;bytes[offset+6]=this.low>>8&255;bytes[offset+7]=this.low&255},assign:function(word){this.high=word.high;this.low=word.low}};return Word64}(),calculateSHA256=function(){function rotr(x,
|
|
1130
|
+
n){return x>>>n|x<<32-n}var k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,
|
|
1131
|
+
3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];return function(data,offset,length){var h0=1779033703,h1=3144134277,h2=1013904242,h3=2773480762,h4=1359893119,h5=2600822924,h6=528734635,h7=1541459225,paddedLength=64*Math.ceil((length+9)/64),padded=new Uint8Array(paddedLength),i;for(i=0;i<length;++i)padded[i]=data[offset++];padded[i++]=
|
|
1132
|
+
128;for(data=paddedLength-8;i<data;)padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=length>>>29&255;padded[i++]=length>>21&255;padded[i++]=length>>13&255;padded[i++]=length>>5&255;padded[i++]=length<<3&255;data=new Uint32Array(64);for(i=0;i<paddedLength;){for(length=0;16>length;++length)data[length]=padded[i]<<24|padded[i+1]<<16|padded[i+2]<<8|padded[i+3],i+=4;for(length=16;64>length;++length){offset=length;var x=data[length-2];x=(rotr(x,17)^rotr(x,19)^x>>>10)+data[length-7];var JSCompiler_inline_result=
|
|
1133
|
+
data[length-15];JSCompiler_inline_result=rotr(JSCompiler_inline_result,7)^rotr(JSCompiler_inline_result,18)^JSCompiler_inline_result>>>3;data[offset]=x+JSCompiler_inline_result+data[length-16]|0}offset=h0;x=h1;JSCompiler_inline_result=h2;var d=h3,e=h4,f=h5,g=h6,h=h7;for(length=0;64>length;++length){var t1=h;h=e;h=rotr(h,6)^rotr(h,11)^rotr(h,25);t1=t1+h+(e&f^~e&g)+k[length]+data[length];h=offset;var t2=(rotr(h,2)^rotr(h,13)^rotr(h,22))+(offset&x^offset&JSCompiler_inline_result^x&JSCompiler_inline_result);
|
|
1134
|
+
h=g;g=f;f=e;e=d+t1|0;d=JSCompiler_inline_result;JSCompiler_inline_result=x;x=offset;offset=t1+t2|0}h0=h0+offset|0;h1=h1+x|0;h2=h2+JSCompiler_inline_result|0;h3=h3+d|0;h4=h4+e|0;h5=h5+f|0;h6=h6+g|0;h7=h7+h|0}return new Uint8Array([h0>>24&255,h0>>16&255,h0>>8&255,h0&255,h1>>24&255,h1>>16&255,h1>>8&255,h1&255,h2>>24&255,h2>>16&255,h2>>8&255,h2&255,h3>>24&255,h3>>16&255,h3>>8&255,h3&255,h4>>24&255,h4>>16&255,h4>>8&255,h4&255,h5>>24&255,h5>>16&255,h5>>8&255,h5&255,h6>>24&255,h6>>16&255,h6>>8&255,h6&255,
|
|
1135
|
+
h7>>24&255,h7>>16&255,h7>>8&255,h7&255])}}();exports.calculateSHA256=calculateSHA256;var calculateSHA512=function(){var k=[new Word64(1116352408,3609767458),new Word64(1899447441,602891725),new Word64(3049323471,3964484399),new Word64(3921009573,2173295548),new Word64(961987163,4081628472),new Word64(1508970993,3053834265),new Word64(2453635748,2937671579),new Word64(2870763221,3664609560),new Word64(3624381080,2734883394),new Word64(310598401,1164996542),new Word64(607225278,1323610764),new Word64(1426881987,
|
|
1136
|
+
3590304994),new Word64(1925078388,4068182383),new Word64(2162078206,991336113),new Word64(2614888103,633803317),new Word64(3248222580,3479774868),new Word64(3835390401,2666613458),new Word64(4022224774,944711139),new Word64(264347078,2341262773),new Word64(604807628,2007800933),new Word64(770255983,1495990901),new Word64(1249150122,1856431235),new Word64(1555081692,3175218132),new Word64(1996064986,2198950837),new Word64(2554220882,3999719339),new Word64(2821834349,766784016),new Word64(2952996808,
|
|
1137
|
+
2566594879),new Word64(3210313671,3203337956),new Word64(3336571891,1034457026),new Word64(3584528711,2466948901),new Word64(113926993,3758326383),new Word64(338241895,168717936),new Word64(666307205,1188179964),new Word64(773529912,1546045734),new Word64(1294757372,1522805485),new Word64(1396182291,2643833823),new Word64(1695183700,2343527390),new Word64(1986661051,1014477480),new Word64(2177026350,1206759142),new Word64(2456956037,344077627),new Word64(2730485921,1290863460),new Word64(2820302411,
|
|
1138
|
+
3158454273),new Word64(3259730800,3505952657),new Word64(3345764771,106217008),new Word64(3516065817,3606008344),new Word64(3600352804,1432725776),new Word64(4094571909,1467031594),new Word64(275423344,851169720),new Word64(430227734,3100823752),new Word64(506948616,1363258195),new Word64(659060556,3750685593),new Word64(883997877,3785050280),new Word64(958139571,3318307427),new Word64(1322822218,3812723403),new Word64(1537002063,2003034995),new Word64(1747873779,3602036899),new Word64(1955562222,
|
|
1139
|
+
1575990012),new Word64(2024104815,1125592928),new Word64(2227730452,2716904306),new Word64(2361852424,442776044),new Word64(2428436474,593698344),new Word64(2756734187,3733110249),new Word64(3204031479,2999351573),new Word64(3329325298,3815920427),new Word64(3391569614,3928383900),new Word64(3515267271,566280711),new Word64(3940187606,3454069534),new Word64(4118630271,4000239992),new Word64(116418474,1914138554),new Word64(174292421,2731055270),new Word64(289380356,3203993006),new Word64(460393269,
|
|
1140
|
+
320620315),new Word64(685471733,587496836),new Word64(852142971,1086792851),new Word64(1017036298,365543100),new Word64(1126000580,2618297676),new Word64(1288033470,3409855158),new Word64(1501505948,4234509866),new Word64(1607167915,987167468),new Word64(1816402316,1246189591)];return function(data,offset,length,mode384){mode384=!!mode384;if(mode384){var h0=new Word64(3418070365,3238371032);var h1=new Word64(1654270250,914150663);var h2=new Word64(2438529370,812702999);var h3=new Word64(355462360,
|
|
1141
|
+
4144912697);var h4=new Word64(1731405415,4290775857);var h5=new Word64(2394180231,1750603025);var h6=new Word64(3675008525,1694076839);var h7=new Word64(1203062813,3204075428)}else h0=new Word64(1779033703,4089235720),h1=new Word64(3144134277,2227873595),h2=new Word64(1013904242,4271175723),h3=new Word64(2773480762,1595750129),h4=new Word64(1359893119,2917565137),h5=new Word64(2600822924,725511199),h6=new Word64(528734635,4215389547),h7=new Word64(1541459225,327033209);var paddedLength=128*Math.ceil((length+
|
|
1142
|
+
17)/128),padded=new Uint8Array(paddedLength),i;for(i=0;i<length;++i)padded[i]=data[offset++];padded[i++]=128;for(data=paddedLength-16;i<data;)padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=0;padded[i++]=length>>>29&255;padded[i++]=length>>21&255;padded[i++]=length>>13&255;padded[i++]=length>>5&255;padded[i++]=length<<3&255;data=Array(80);for(i=0;80>i;i++)data[i]=new Word64(0,0);offset=
|
|
1143
|
+
new Word64(0,0);var b=new Word64(0,0),c=new Word64(0,0),d=new Word64(0,0),e=new Word64(0,0),f=new Word64(0,0),g=new Word64(0,0),h=new Word64(0,0),t1=new Word64(0,0),t2=new Word64(0,0),tmp1=new Word64(0,0),tmp2=new Word64(0,0),tmp3;for(i=0;i<paddedLength;){for(length=0;16>length;++length)data[length].high=padded[i]<<24|padded[i+1]<<16|padded[i+2]<<8|padded[i+3],data[length].low=padded[i+4]<<24|padded[i+5]<<16|padded[i+6]<<8|padded[i+7],i+=8;for(length=16;80>length;++length){var result=tmp3=data[length],
|
|
1144
|
+
x=data[length-2],tmp=tmp2;result.assign(x);result.rotateRight(19);tmp.assign(x);tmp.rotateRight(61);result.xor(tmp);tmp.assign(x);tmp.shiftRight(6);result.xor(tmp);tmp3.add(data[length-7]);result=tmp1;x=data[length-15];tmp=tmp2;result.assign(x);result.rotateRight(1);tmp.assign(x);tmp.rotateRight(8);result.xor(tmp);tmp.assign(x);tmp.shiftRight(7);result.xor(tmp);tmp3.add(tmp1);tmp3.add(data[length-16])}offset.assign(h0);b.assign(h1);c.assign(h2);d.assign(h3);e.assign(h4);f.assign(h5);g.assign(h6);
|
|
1145
|
+
h.assign(h7);for(length=0;80>length;++length){t1.assign(h);tmp3=tmp1;result=e;x=tmp2;tmp3.assign(result);tmp3.rotateRight(14);x.assign(result);x.rotateRight(18);tmp3.xor(x);x.assign(result);x.rotateRight(41);tmp3.xor(x);t1.add(tmp1);tmp3=tmp1;result=e;x=f;tmp=g;var tmp$jscomp$0=tmp2;tmp3.assign(result);tmp3.and(x);tmp$jscomp$0.assign(result);tmp$jscomp$0.not();tmp$jscomp$0.and(tmp);tmp3.xor(tmp$jscomp$0);t1.add(tmp1);t1.add(k[length]);t1.add(data[length]);tmp3=t2;result=offset;x=tmp2;tmp3.assign(result);
|
|
1146
|
+
tmp3.rotateRight(28);x.assign(result);x.rotateRight(34);tmp3.xor(x);x.assign(result);x.rotateRight(39);tmp3.xor(x);tmp3=tmp1;result=offset;x=b;tmp=c;tmp$jscomp$0=tmp2;tmp3.assign(result);tmp3.and(x);tmp$jscomp$0.assign(result);tmp$jscomp$0.and(tmp);tmp3.xor(tmp$jscomp$0);tmp$jscomp$0.assign(x);tmp$jscomp$0.and(tmp);tmp3.xor(tmp$jscomp$0);t2.add(tmp1);tmp3=h;h=g;g=f;f=e;d.add(t1);e=d;d=c;c=b;b=offset;tmp3.assign(t1);tmp3.add(t2);offset=tmp3}h0.add(offset);h1.add(b);h2.add(c);h3.add(d);h4.add(e);h5.add(f);
|
|
1147
|
+
h6.add(g);h7.add(h)}mode384?(mode384=new Uint8Array(48),h0.copyTo(mode384,0),h1.copyTo(mode384,8),h2.copyTo(mode384,16),h3.copyTo(mode384,24),h4.copyTo(mode384,32),h5.copyTo(mode384,40)):(mode384=new Uint8Array(64),h0.copyTo(mode384,0),h1.copyTo(mode384,8),h2.copyTo(mode384,16),h3.copyTo(mode384,24),h4.copyTo(mode384,32),h5.copyTo(mode384,40),h6.copyTo(mode384,48),h7.copyTo(mode384,56));return mode384}}();exports.calculateSHA512=calculateSHA512;var calculateSHA384=function(){return function(data,
|
|
1148
|
+
offset,length){return calculateSHA512(data,offset,length,!0)}}();exports.calculateSHA384=calculateSHA384;var NullCipher=function(){function NullCipher(){}NullCipher.prototype={decryptBlock:function(data){return data}};return NullCipher}();module=function(){function AESBaseCipher(){_classCallCheck(this,AESBaseCipher);this.constructor===AESBaseCipher&&(0,_util.unreachable)("Cannot initialize AESBaseCipher.");this._s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,
|
|
1149
|
+
201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,
|
|
1150
|
+
224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);this._inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,
|
|
1151
|
+
50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,
|
|
1152
|
+
27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);this._mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,
|
|
1153
|
+
4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,
|
|
1154
|
+
2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,
|
|
1155
|
+
2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,
|
|
1156
|
+
2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,
|
|
1157
|
+
3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,
|
|
1158
|
+
2370213795]);this._mixCol=new Uint8Array(256);for(var i=0;256>i;i++)this._mixCol[i]=128>i?i<<1:i<<1^27;this.buffer=new Uint8Array(16);this.bufferPosition=0}_createClass(AESBaseCipher,[{key:"_expandKey",value:function(cipherKey){(0,_util.unreachable)("Cannot call `_expandKey` on the base class")}},{key:"_decrypt",value:function(input,key){var u,state=new Uint8Array(16);state.set(input);input=0;for(u=this._keySize;16>input;++input,++u)state[input]^=key[u];for(input=this._cyclesOfRepetition-1;1<=input;--input){var t=
|
|
1159
|
+
state[13];state[13]=state[9];state[9]=state[5];state[5]=state[1];state[1]=t;t=state[14];u=state[10];state[14]=state[6];state[10]=state[2];state[6]=t;state[2]=u;t=state[15];u=state[11];var v=state[7];state[15]=state[3];state[11]=t;state[7]=u;state[3]=v;for(u=0;16>u;++u)state[u]=this._inv_s[state[u]];u=0;for(t=16*input;16>u;++u,++t)state[u]^=key[t];for(u=0;16>u;u+=4){t=this._mix[state[u+1]];v=this._mix[state[u+2]];var s3=this._mix[state[u+3]];t=this._mix[state[u]]^t>>>8^t<<24^v>>>16^v<<16^s3>>>24^s3<<
|
|
1160
|
+
8;state[u]=t>>>24&255;state[u+1]=t>>16&255;state[u+2]=t>>8&255;state[u+3]=t&255}}t=state[13];state[13]=state[9];state[9]=state[5];state[5]=state[1];state[1]=t;t=state[14];u=state[10];state[14]=state[6];state[10]=state[2];state[6]=t;state[2]=u;t=state[15];u=state[11];v=state[7];state[15]=state[3];state[11]=t;state[7]=u;state[3]=v;for(input=0;16>input;++input)state[input]=this._inv_s[state[input]],state[input]^=key[input];return state}},{key:"_encrypt",value:function(input,key){var s=this._s,t,state=
|
|
1161
|
+
new Uint8Array(16);state.set(input);for(input=0;16>input;++input)state[input]^=key[input];for(input=1;input<this._cyclesOfRepetition;input++){for(t=0;16>t;++t)state[t]=s[state[t]];var v=state[1];state[1]=state[5];state[5]=state[9];state[9]=state[13];state[13]=v;v=state[2];var u=state[6];state[2]=state[10];state[6]=state[14];state[10]=v;state[14]=u;v=state[3];u=state[7];t=state[11];state[3]=state[15];state[7]=v;state[11]=u;state[15]=t;for(u=0;16>u;u+=4){v=state[u+0];var s1=state[u+1],s2=state[u+2],
|
|
1162
|
+
s3=state[u+3];t=v^s1^s2^s3;state[u+0]=state[u+0]^t^this._mixCol[v^s1];state[u+1]=state[u+1]^t^this._mixCol[s1^s2];state[u+2]=state[u+2]^t^this._mixCol[s2^s3];state[u+3]=state[u+3]^t^this._mixCol[s3^v]}t=0;for(u=16*input;16>t;++t,++u)state[t]^=key[u]}for(input=0;16>input;++input)state[input]=s[state[input]];v=state[1];state[1]=state[5];state[5]=state[9];state[9]=state[13];state[13]=v;v=state[2];u=state[6];state[2]=state[10];state[6]=state[14];state[10]=v;state[14]=u;v=state[3];u=state[7];t=state[11];
|
|
1163
|
+
state[3]=state[15];state[7]=v;state[11]=u;state[15]=t;s=0;for(input=this._keySize;16>s;++s,++input)state[s]^=key[input];return state}},{key:"_decryptBlock2",value:function(data,finalize){for(var sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition,result=[],iv=this.iv,i=0;i<sourceLength;++i)if(buffer[bufferLength]=data[i],++bufferLength,!(16>bufferLength)){bufferLength=this._decrypt(buffer,this._key);for(var j=0;16>j;++j)bufferLength[j]^=iv[j];iv=buffer;result.push(bufferLength);
|
|
1164
|
+
buffer=new Uint8Array(16);bufferLength=0}this.buffer=buffer;this.bufferLength=bufferLength;this.iv=iv;if(0===result.length)return new Uint8Array(0);data=16*result.length;if(finalize&&(finalize=result[result.length-1],sourceLength=finalize[15],16>=sourceLength)){buffer=15;for(iv=16-sourceLength;buffer>=iv;--buffer)if(finalize[buffer]!==sourceLength){sourceLength=0;break}data-=sourceLength;result[result.length-1]=finalize.subarray(0,16-sourceLength)}finalize=new Uint8Array(data);sourceLength=data=0;
|
|
1165
|
+
for(buffer=result.length;data<buffer;++data,sourceLength+=16)finalize.set(result[data],sourceLength);return finalize}},{key:"decryptBlock",value:function(data,finalize){var iv=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition;if(iv)this.iv=iv;else{for(iv=0;16>bufferLength&&iv<sourceLength;++iv,++bufferLength)buffer[bufferLength]=data[iv];if(16>bufferLength)return this.bufferLength=bufferLength,new Uint8Array(0);
|
|
1166
|
+
this.iv=buffer;data=data.subarray(16)}this.buffer=new Uint8Array(16);this.bufferLength=0;this.decryptBlock=this._decryptBlock2;return this.decryptBlock(data,finalize)}},{key:"encrypt",value:function(data,iv){var sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition,result=[];iv||(iv=new Uint8Array(16));for(var i=0;i<sourceLength;++i)if(buffer[bufferLength]=data[i],++bufferLength,!(16>bufferLength)){for(bufferLength=0;16>bufferLength;++bufferLength)buffer[bufferLength]^=iv[bufferLength];
|
|
1167
|
+
iv=buffer=this._encrypt(buffer,this._key);result.push(buffer);buffer=new Uint8Array(16);bufferLength=0}this.buffer=buffer;this.bufferLength=bufferLength;this.iv=iv;if(0===result.length)return new Uint8Array(0);data=new Uint8Array(16*result.length);sourceLength=iv=0;for(i=result.length;iv<i;++iv,sourceLength+=16)data.set(result[iv],sourceLength);return data}}]);return AESBaseCipher}();var AES128Cipher=function(_AESBaseCipher){function AES128Cipher(key){_classCallCheck(this,AES128Cipher);var _this=
|
|
1168
|
+
_possibleConstructorReturn(this,_getPrototypeOf(AES128Cipher).call(this));_this._cyclesOfRepetition=10;_this._keySize=160;_this._rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,
|
|
1169
|
+
203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,
|
|
1170
|
+
74,148,51,102,204,131,29,58,116,232,203,141]);_this._key=_this._expandKey(key);return _this}_inherits(AES128Cipher,_AESBaseCipher);_createClass(AES128Cipher,[{key:"_expandKey",value:function(cipherKey){var s=this._s,rcon=this._rcon,result=new Uint8Array(176);result.set(cipherKey);cipherKey=16;for(var i=1;176>cipherKey;++i){var t1=result[cipherKey-3],t2=result[cipherKey-2],t3=result[cipherKey-1],t4=result[cipherKey-4];t1=s[t1];t2=s[t2];t3=s[t3];t4=s[t4];t1^=rcon[i];for(var n=0;4>n;++n)result[cipherKey]=
|
|
1171
|
+
t1^=result[cipherKey-16],cipherKey++,result[cipherKey]=t2^=result[cipherKey-16],cipherKey++,result[cipherKey]=t3^=result[cipherKey-16],cipherKey++,result[cipherKey]=t4^=result[cipherKey-16],cipherKey++}return result}}]);return AES128Cipher}(module);exports.AES128Cipher=AES128Cipher;var AES256Cipher=function(_AESBaseCipher2){function AES256Cipher(key){_classCallCheck(this,AES256Cipher);var _this2=_possibleConstructorReturn(this,_getPrototypeOf(AES256Cipher).call(this));_this2._cyclesOfRepetition=14;
|
|
1172
|
+
_this2._keySize=224;_this2._key=_this2._expandKey(key);return _this2}_inherits(AES256Cipher,_AESBaseCipher2);_createClass(AES256Cipher,[{key:"_expandKey",value:function(cipherKey){var s=this._s,result=new Uint8Array(240);result.set(cipherKey);cipherKey=1;for(var t1,t2,t3,t4,j=32,i=1;240>j;++i){16===j%32?(t1=s[t1],t2=s[t2],t3=s[t3],t4=s[t4]):0===j%32&&(t1=result[j-3],t2=result[j-2],t3=result[j-1],t4=result[j-4],t1=s[t1],t2=s[t2],t3=s[t3],t4=s[t4],t1^=cipherKey,256<=(cipherKey<<=1)&&(cipherKey=(cipherKey^
|
|
1173
|
+
27)&255));for(var n=0;4>n;++n)result[j]=t1^=result[j-32],j++,result[j]=t2^=result[j-32],j++,result[j]=t3^=result[j-32],j++,result[j]=t4^=result[j-32],j++}return result}}]);return AES256Cipher}(module);exports.AES256Cipher=AES256Cipher;var PDF17=function(){function compareByteArrays(array1,array2){if(array1.length!==array2.length)return!1;for(var i=0;i<array1.length;i++)if(array1[i]!==array2[i])return!1;return!0}function PDF17(){}PDF17.prototype={checkOwnerPassword:function(password,ownerValidationSalt,
|
|
1174
|
+
userBytes,ownerPassword){var hashData=new Uint8Array(password.length+56);hashData.set(password,0);hashData.set(ownerValidationSalt,password.length);hashData.set(userBytes,password.length+ownerValidationSalt.length);password=calculateSHA256(hashData,0,hashData.length);return compareByteArrays(password,ownerPassword)},checkUserPassword:function(password,userValidationSalt,userPassword){var hashData=new Uint8Array(password.length+8);hashData.set(password,0);hashData.set(userValidationSalt,password.length);
|
|
1175
|
+
password=calculateSHA256(hashData,0,hashData.length);return compareByteArrays(password,userPassword)},getOwnerKey:function(password,ownerKeySalt,userBytes,ownerEncryption){var hashData=new Uint8Array(password.length+56);hashData.set(password,0);hashData.set(ownerKeySalt,password.length);hashData.set(userBytes,password.length+ownerKeySalt.length);password=calculateSHA256(hashData,0,hashData.length);return(new AES256Cipher(password)).decryptBlock(ownerEncryption,!1,new Uint8Array(16))},getUserKey:function(password,
|
|
1176
|
+
userKeySalt,userEncryption){var hashData=new Uint8Array(password.length+8);hashData.set(password,0);hashData.set(userKeySalt,password.length);password=calculateSHA256(hashData,0,hashData.length);return(new AES256Cipher(password)).decryptBlock(userEncryption,!1,new Uint8Array(16))}};return PDF17}();exports.PDF17=PDF17;var PDF20=function(){function concatArrays(array1,array2){var t=new Uint8Array(array1.length+array2.length);t.set(array1,0);t.set(array2,array1.length);return t}function calculatePDF20Hash(password,
|
|
1177
|
+
input,userBytes){input=calculateSHA256(input,0,input.length).subarray(0,32);for(var e=[0],i=0;64>i||e[e.length-1]>i-32;){e=password.length+input.length+userBytes.length;var k1=new Uint8Array(64*e),array=concatArrays(password,input);array=concatArrays(array,userBytes);for(var j=0,pos=0;64>j;j++,pos+=e)k1.set(array,pos);e=(new AES128Cipher(input.subarray(0,16))).encrypt(k1,input.subarray(16,32));for(array=k1=0;16>array;array++)k1*=1,k1%=3,k1+=(e[array]>>>0)%3,k1%=3;0===k1?input=calculateSHA256(e,0,
|
|
1178
|
+
e.length):1===k1?input=calculateSHA384(e,0,e.length):2===k1&&(input=calculateSHA512(e,0,e.length));i++}return input.subarray(0,32)}function PDF20(){}function compareByteArrays(array1,array2){if(array1.length!==array2.length)return!1;for(var i=0;i<array1.length;i++)if(array1[i]!==array2[i])return!1;return!0}PDF20.prototype={hash:function(password,concatBytes,userBytes){return calculatePDF20Hash(password,concatBytes,userBytes)},checkOwnerPassword:function(password,ownerValidationSalt,userBytes,ownerPassword){var hashData=
|
|
1179
|
+
new Uint8Array(password.length+56);hashData.set(password,0);hashData.set(ownerValidationSalt,password.length);hashData.set(userBytes,password.length+ownerValidationSalt.length);password=calculatePDF20Hash(password,hashData,userBytes);return compareByteArrays(password,ownerPassword)},checkUserPassword:function(password,userValidationSalt,userPassword){var hashData=new Uint8Array(password.length+8);hashData.set(password,0);hashData.set(userValidationSalt,password.length);password=calculatePDF20Hash(password,
|
|
1180
|
+
hashData,[]);return compareByteArrays(password,userPassword)},getOwnerKey:function(password,ownerKeySalt,userBytes,ownerEncryption){var hashData=new Uint8Array(password.length+56);hashData.set(password,0);hashData.set(ownerKeySalt,password.length);hashData.set(userBytes,password.length+ownerKeySalt.length);password=calculatePDF20Hash(password,hashData,userBytes);return(new AES256Cipher(password)).decryptBlock(ownerEncryption,!1,new Uint8Array(16))},getUserKey:function(password,userKeySalt,userEncryption){var hashData=
|
|
1181
|
+
new Uint8Array(password.length+8);hashData.set(password,0);hashData.set(userKeySalt,password.length);password=calculatePDF20Hash(password,hashData,[]);return(new AES256Cipher(password)).decryptBlock(userEncryption,!1,new Uint8Array(16))}};return PDF20}();exports.PDF20=PDF20;var CipherTransform=function(){function CipherTransform(stringCipherConstructor,streamCipherConstructor){this.StringCipherConstructor=stringCipherConstructor;this.StreamCipherConstructor=streamCipherConstructor}CipherTransform.prototype=
|
|
1182
|
+
{createStream:function(stream,length){var cipher=new this.StreamCipherConstructor;return new _stream.DecryptStream(stream,length,function(data,finalize){return cipher.decryptBlock(data,finalize)})},decryptString:function(s){var cipher=new this.StringCipherConstructor;s=(0,_util.stringToBytes)(s);s=cipher.decryptBlock(s,!0);return(0,_util.bytesToString)(s)}};return CipherTransform}();module=function(){function prepareKeyData(fileId,password,ownerPassword,userPassword,flags,revision,keyLength,encryptMetadata){var hashData=
|
|
1183
|
+
new Uint8Array(40+ownerPassword.length+fileId.length),i=0,n;if(password)for(n=Math.min(32,password.length);i<n;++i)hashData[i]=password[i];for(password=0;32>i;)hashData[i++]=defaultPasswordBytes[password++];password=0;for(n=ownerPassword.length;password<n;++password)hashData[i++]=ownerPassword[password];hashData[i++]=flags&255;hashData[i++]=flags>>8&255;hashData[i++]=flags>>16&255;hashData[i++]=flags>>>24&255;password=0;for(n=fileId.length;password<n;++password)hashData[i++]=fileId[password];4<=revision&&
|
|
1184
|
+
!encryptMetadata&&(hashData[i++]=255,hashData[i++]=255,hashData[i++]=255,hashData[i++]=255);n=calculateMD5(hashData,0,i);i=keyLength>>3;if(3<=revision)for(password=0;50>password;++password)n=calculateMD5(n,0,i);keyLength=n.subarray(0,i);if(3<=revision){for(i=0;32>i;++i)hashData[i]=defaultPasswordBytes[i];password=0;for(n=fileId.length;password<n;++password)hashData[i++]=fileId[password];fileId=new ARCFourCipher(keyLength);hashData=fileId.encryptBlock(calculateMD5(hashData,0,i));n=keyLength.length;
|
|
1185
|
+
revision=new Uint8Array(n);for(password=1;19>=password;++password){for(fileId=0;fileId<n;++fileId)revision[fileId]=keyLength[fileId]^password;fileId=new ARCFourCipher(revision);hashData=fileId.encryptBlock(hashData)}}else fileId=new ARCFourCipher(keyLength),hashData=fileId.encryptBlock(defaultPasswordBytes);password=0;for(n=hashData.length;password<n;++password)if(userPassword[password]!==hashData[password])return null;return keyLength}function CipherTransformFactory(dict,fileId,password$jscomp$0){var filter=
|
|
1186
|
+
dict.get("Filter");if(!(0,_primitives.isName)(filter,"Standard"))throw new _util.FormatError("unknown encryption method");this.dict=dict;filter=dict.get("V");if(!Number.isInteger(filter)||1!==filter&&2!==filter&&4!==filter&&5!==filter)throw new _util.FormatError("unsupported encryption algorithm");this.algorithm=filter;var keyLength=dict.get("Length");if(!keyLength)if(3>=filter)keyLength=40;else{var cfDict=dict.get("CF"),streamCryptoName=dict.get("StmF");(0,_primitives.isDict)(cfDict)&&(0,_primitives.isName)(streamCryptoName)&&
|
|
1187
|
+
(cfDict.suppressEncryption=!0,keyLength=(keyLength=cfDict.get(streamCryptoName.name))&&keyLength.get("Length")||128,40>keyLength&&(keyLength<<=3))}if(!Number.isInteger(keyLength)||40>keyLength||0!==keyLength%8)throw new _util.FormatError("invalid key length");cfDict=(0,_util.stringToBytes)(dict.get("O")).subarray(0,32);streamCryptoName=(0,_util.stringToBytes)(dict.get("U")).subarray(0,32);var flags=dict.get("P"),revision=dict.get("R"),encryptMetadata=(4===filter||5===filter)&&!1!==dict.get("EncryptMetadata");
|
|
1188
|
+
this.encryptMetadata=encryptMetadata;fileId=(0,_util.stringToBytes)(fileId);if(password$jscomp$0){if(6===revision)try{password$jscomp$0=(0,_util.utf8StringToString)(password$jscomp$0)}catch(ex){(0,_util.warn)("CipherTransformFactory: Unable to convert UTF8 encoded password.")}var passwordBytes=(0,_util.stringToBytes)(password$jscomp$0)}if(5!==filter)var encryptionKey=prepareKeyData(fileId,passwordBytes,cfDict,streamCryptoName,flags,revision,keyLength,encryptMetadata);else{encryptionKey=(0,_util.stringToBytes)(dict.get("O")).subarray(32,
|
|
1189
|
+
40);var ownerKeySalt=(0,_util.stringToBytes)(dict.get("O")).subarray(40,48),uBytes=(0,_util.stringToBytes)(dict.get("U")).subarray(0,48),userValidationSalt=(0,_util.stringToBytes)(dict.get("U")).subarray(32,40),userKeySalt=(0,_util.stringToBytes)(dict.get("U")).subarray(40,48),ownerEncryption=(0,_util.stringToBytes)(dict.get("OE")),userEncryption=(0,_util.stringToBytes)(dict.get("UE"));(0,_util.stringToBytes)(dict.get("Perms"));var password=passwordBytes;password=password?password.subarray(0,Math.min(127,
|
|
1190
|
+
password.length)):[];var pdfAlgorithm=6===revision?new PDF20:new PDF17;encryptionKey=pdfAlgorithm.checkUserPassword(password,userValidationSalt,streamCryptoName)?pdfAlgorithm.getUserKey(password,userKeySalt,userEncryption):password.length&&pdfAlgorithm.checkOwnerPassword(password,encryptionKey,uBytes,cfDict)?pdfAlgorithm.getOwnerKey(password,ownerKeySalt,uBytes,ownerEncryption):null}if(!encryptionKey&&!password$jscomp$0)throw new _util.PasswordException("No password given",_util.PasswordResponses.NEED_PASSWORD);
|
|
1191
|
+
if(!encryptionKey&&password$jscomp$0){password$jscomp$0=passwordBytes;encryptionKey=keyLength;passwordBytes=new Uint8Array(32);ownerKeySalt=0;for(uBytes=Math.min(32,password$jscomp$0.length);ownerKeySalt<uBytes;++ownerKeySalt)passwordBytes[ownerKeySalt]=password$jscomp$0[ownerKeySalt];for(password$jscomp$0=0;32>ownerKeySalt;)passwordBytes[ownerKeySalt++]=defaultPasswordBytes[password$jscomp$0++];passwordBytes=calculateMD5(passwordBytes,0,ownerKeySalt);encryptionKey>>=3;if(3<=revision)for(password$jscomp$0=
|
|
1192
|
+
0;50>password$jscomp$0;++password$jscomp$0)passwordBytes=calculateMD5(passwordBytes,0,passwordBytes.length);if(3<=revision)for(ownerKeySalt=cfDict,uBytes=new Uint8Array(encryptionKey),password$jscomp$0=19;0<=password$jscomp$0;password$jscomp$0--){for(userValidationSalt=0;userValidationSalt<encryptionKey;++userValidationSalt)uBytes[userValidationSalt]=passwordBytes[userValidationSalt]^password$jscomp$0;userValidationSalt=new ARCFourCipher(uBytes);ownerKeySalt=userValidationSalt.encryptBlock(ownerKeySalt)}else userValidationSalt=
|
|
1193
|
+
new ARCFourCipher(passwordBytes.subarray(0,encryptionKey)),ownerKeySalt=userValidationSalt.encryptBlock(cfDict);encryptionKey=prepareKeyData(fileId,ownerKeySalt,cfDict,streamCryptoName,flags,revision,keyLength,encryptMetadata)}if(!encryptionKey)throw new _util.PasswordException("Incorrect Password",_util.PasswordResponses.INCORRECT_PASSWORD);this.encryptionKey=encryptionKey;4<=filter&&(filter=dict.get("CF"),(0,_primitives.isDict)(filter)&&(filter.suppressEncryption=!0),this.cf=filter,this.stmf=dict.get("StmF")||
|
|
1194
|
+
identityName,this.strf=dict.get("StrF")||identityName,this.eff=dict.get("EFF")||this.stmf)}function buildObjectKey(num,gen,encryptionKey,isAes){var key=new Uint8Array(encryptionKey.length+9),n;var i=0;for(n=encryptionKey.length;i<n;++i)key[i]=encryptionKey[i];key[i++]=num&255;key[i++]=num>>8&255;key[i++]=num>>16&255;key[i++]=gen&255;key[i++]=gen>>8&255;isAes&&(key[i++]=115,key[i++]=65,key[i++]=108,key[i++]=84);return calculateMD5(key,0,i).subarray(0,Math.min(encryptionKey.length+5,16))}function buildCipherConstructor(cf,
|
|
1195
|
+
name,num,gen,key){if(!(0,_primitives.isName)(name))throw new _util.FormatError("Invalid crypt filter name.");cf=cf.get(name.name);var cfm;null!==cf&&void 0!==cf&&(cfm=cf.get("CFM"));if(!cfm||"None"===cfm.name)return function(){return new NullCipher};if("V2"===cfm.name)return function(){return new ARCFourCipher(buildObjectKey(num,gen,key,!1))};if("AESV2"===cfm.name)return function(){return new AES128Cipher(buildObjectKey(num,gen,key,!0))};if("AESV3"===cfm.name)return function(){return new AES256Cipher(key)};
|
|
1196
|
+
throw new _util.FormatError("Unknown crypto method");}var defaultPasswordBytes=new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]),identityName=_primitives.Name.get("Identity");CipherTransformFactory.prototype={createCipherTransform:function(num,gen){if(4===this.algorithm||5===this.algorithm)return new CipherTransform(buildCipherConstructor(this.cf,this.stmf,num,gen,this.encryptionKey),buildCipherConstructor(this.cf,this.strf,
|
|
1197
|
+
num,gen,this.encryptionKey));var key=buildObjectKey(num,gen,this.encryptionKey,!1);num=function(){return new ARCFourCipher(key)};return new CipherTransform(num,num)}};return CipherTransformFactory}();exports.CipherTransformFactory=module},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&
|
|
1198
|
+
obj!==Symbol.prototype?"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"===typeof call))return call;if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}
|
|
1199
|
+
function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,
|
|
1200
|
+
p$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1;descriptor.configurable=!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&
|
|
1201
|
+
_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.ColorSpace=void 0;var _util=__w_pdfjs_require__(5),_primitives=__w_pdfjs_require__(188),ColorSpace=function(){function ColorSpace(name,numComps){_classCallCheck(this,ColorSpace);this.constructor===ColorSpace&&(0,_util.unreachable)("Cannot initialize ColorSpace.");this.name=name;this.numComps=numComps}_createClass(ColorSpace,
|
|
1202
|
+
[{key:"getRgb",value:function(src,srcOffset){var rgb=new Uint8ClampedArray(3);this.getRgbItem(src,srcOffset,rgb,0);return rgb}},{key:"getRgbItem",value:function(src,srcOffset,dest,destOffset){(0,_util.unreachable)("Should not call ColorSpace.getRgbItem")}},{key:"getRgbBuffer",value:function(src,srcOffset,count,dest,destOffset,bits,alpha01){(0,_util.unreachable)("Should not call ColorSpace.getRgbBuffer")}},{key:"getOutputLength",value:function(inputLength,alpha01){(0,_util.unreachable)("Should not call ColorSpace.getOutputLength")}},
|
|
1203
|
+
{key:"isPassthrough",value:function(bits){return!1}},{key:"isDefaultDecode",value:function(decodeMap,bpc){return ColorSpace.isDefaultDecode(decodeMap,this.numComps)}},{key:"fillRgb",value:function(dest,originalWidth,originalHeight,width,height,actualHeight,bpc,comps,alpha01){var count=originalWidth*originalHeight,rgbBuf=null,numComponentColors=1<<bpc,needsResizing=originalHeight!==height||originalWidth!==width;if(this.isPassthrough(bpc))rgbBuf=comps;else if(1===this.numComps&&count>numComponentColors&&
|
|
1204
|
+
"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){for(var allColors=8>=bpc?new Uint8Array(numComponentColors):new Uint16Array(numComponentColors),i=0;i<numComponentColors;i++)allColors[i]=i;i=new Uint8ClampedArray(3*numComponentColors);this.getRgbBuffer(allColors,0,numComponentColors,i,0,bpc,0);if(needsResizing)for(rgbBuf=new Uint8Array(3*count),numComponentColors=bpc=0;numComponentColors<count;++numComponentColors)allColors=3*comps[numComponentColors],rgbBuf[bpc++]=i[allColors],rgbBuf[bpc++]=i[allColors+
|
|
1205
|
+
1],rgbBuf[bpc++]=i[allColors+2];else for(numComponentColors=bpc=0;numComponentColors<count;++numComponentColors)allColors=3*comps[numComponentColors],dest[bpc++]=i[allColors],dest[bpc++]=i[allColors+1],dest[bpc++]=i[allColors+2],bpc+=alpha01}else needsResizing?(rgbBuf=new Uint8ClampedArray(3*count),this.getRgbBuffer(comps,0,count,rgbBuf,0,bpc,0)):this.getRgbBuffer(comps,0,width*actualHeight,dest,0,bpc,alpha01);if(rgbBuf)if(needsResizing){alpha01=1!==alpha01?0:alpha01;count=originalWidth/width;originalHeight/=
|
|
1206
|
+
height;actualHeight=0;comps=new Uint16Array(width);originalWidth*=3;for(needsResizing=0;needsResizing<width;needsResizing++)comps[needsResizing]=3*Math.floor(needsResizing*count);for(needsResizing=0;needsResizing<height;needsResizing++)for(i=Math.floor(needsResizing*originalHeight)*originalWidth,bpc=0;bpc<width;bpc++)count=i+comps[bpc],dest[actualHeight++]=rgbBuf[count++],dest[actualHeight++]=rgbBuf[count++],dest[actualHeight++]=rgbBuf[count++],actualHeight+=alpha01}else for(originalHeight=originalWidth=
|
|
1207
|
+
height=0,width*=actualHeight;originalHeight<width;originalHeight++)dest[height++]=rgbBuf[originalWidth++],dest[height++]=rgbBuf[originalWidth++],dest[height++]=rgbBuf[originalWidth++],height+=alpha01}},{key:"usesZeroToOneRange",get:function(){return(0,_util.shadow)(this,"usesZeroToOneRange",!0)}}],[{key:"parse",value:function(cs,xref,res,pdfFunctionFactory){cs=this.parseToIR(cs,xref,res,pdfFunctionFactory);return this.fromIR(cs)}},{key:"fromIR",value:function(IR){var name=Array.isArray(IR)?IR[0]:
|
|
1208
|
+
IR;switch(name){case "DeviceGrayCS":return this.singletons.gray;case "DeviceRgbCS":return this.singletons.rgb;case "DeviceCmykCS":return this.singletons.cmyk;case "CalGrayCS":name=IR[1];var blackPoint=IR[2];var gamma=IR[3];return new CalGrayCS(name,blackPoint,gamma);case "CalRGBCS":return name=IR[1],blackPoint=IR[2],gamma=IR[3],new CalRGBCS(name,blackPoint,gamma,IR[4]);case "PatternCS":return(IR=IR[1])&&(IR=this.fromIR(IR)),new PatternCS(IR);case "IndexedCS":return name=IR[2],blackPoint=IR[3],new IndexedCS(this.fromIR(IR[1]),
|
|
1209
|
+
name,blackPoint);case "AlternateCS":return name=IR[3],new AlternateCS(IR[1],this.fromIR(IR[2]),name);case "LabCS":return name=IR[1],blackPoint=IR[2],new LabCS(name,blackPoint,IR[3]);default:throw new _util.FormatError("Unknown colorspace name: ".concat(name));}}},{key:"parseToIR",value:function(cs,xref){var res=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,pdfFunctionFactory=3<arguments.length?arguments[3]:void 0;cs=xref.fetchIfRef(cs);if((0,_primitives.isName)(cs))switch(cs.name){case "DeviceGray":case "G":return"DeviceGrayCS";
|
|
1210
|
+
case "DeviceRGB":case "RGB":return"DeviceRgbCS";case "DeviceCMYK":case "CMYK":return"DeviceCmykCS";case "Pattern":return["PatternCS",null];default:if((0,_primitives.isDict)(res)){var colorSpaces=res.get("ColorSpace");if((0,_primitives.isDict)(colorSpaces)&&(colorSpaces=colorSpaces.get(cs.name))){if((0,_primitives.isName)(colorSpaces))return this.parseToIR(colorSpaces,xref,res,pdfFunctionFactory);cs=colorSpaces;break}}throw new _util.FormatError("unrecognized colorspace ".concat(cs.name));}if(Array.isArray(cs))switch(colorSpaces=
|
|
1211
|
+
xref.fetchIfRef(cs[0]).name,colorSpaces){case "DeviceGray":case "G":return"DeviceGrayCS";case "DeviceRGB":case "RGB":return"DeviceRgbCS";case "DeviceCMYK":case "CMYK":return"DeviceCmykCS";case "CalGray":var params=xref.fetchIfRef(cs[1]);pdfFunctionFactory=params.getArray("WhitePoint");res=params.getArray("BlackPoint");colorSpaces=params.get("Gamma");return["CalGrayCS",pdfFunctionFactory,res,colorSpaces];case "CalRGB":return params=xref.fetchIfRef(cs[1]),pdfFunctionFactory=params.getArray("WhitePoint"),
|
|
1212
|
+
res=params.getArray("BlackPoint"),colorSpaces=params.getArray("Gamma"),params=params.getArray("Matrix"),["CalRGBCS",pdfFunctionFactory,res,colorSpaces,params];case "ICCBased":params=xref.fetchIfRef(cs[1]).dict;colorSpaces=params.get("N");if(params=params.get("Alternate")){res=this.parseToIR(params,xref,res,pdfFunctionFactory);if(this.fromIR(res,pdfFunctionFactory).numComps===colorSpaces)return res;(0,_util.warn)("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===colorSpaces)return"DeviceGrayCS";
|
|
1213
|
+
if(3===colorSpaces)return"DeviceRgbCS";if(4===colorSpaces)return"DeviceCmykCS";break;case "Pattern":return(colorSpaces=cs[1]||null)&&(colorSpaces=this.parseToIR(colorSpaces,xref,res,pdfFunctionFactory)),["PatternCS",colorSpaces];case "Indexed":case "I":return pdfFunctionFactory=this.parseToIR(cs[1],xref,res,pdfFunctionFactory),res=xref.fetchIfRef(cs[2])+1,colorSpaces=xref.fetchIfRef(cs[3]),(0,_primitives.isStream)(colorSpaces)&&(colorSpaces=colorSpaces.getBytes()),["IndexedCS",pdfFunctionFactory,
|
|
1214
|
+
res,colorSpaces];case "Separation":case "DeviceN":return colorSpaces=xref.fetchIfRef(cs[1]),colorSpaces=Array.isArray(colorSpaces)?colorSpaces.length:1,params=this.parseToIR(cs[2],xref,res,pdfFunctionFactory),pdfFunctionFactory=pdfFunctionFactory.create(xref.fetchIfRef(cs[3])),["AlternateCS",colorSpaces,params,pdfFunctionFactory];case "Lab":return params=xref.fetchIfRef(cs[1]),pdfFunctionFactory=params.getArray("WhitePoint"),res=params.getArray("BlackPoint"),colorSpaces=params.getArray("Range"),["LabCS",
|
|
1215
|
+
pdfFunctionFactory,res,colorSpaces];default:throw new _util.FormatError('unimplemented color space object "'.concat(colorSpaces,'"'));}throw new _util.FormatError('unrecognized color space object: "'.concat(cs,'"'));}},{key:"isDefaultDecode",value:function(decode,numComps){if(!Array.isArray(decode))return!0;if(2*numComps!==decode.length)return(0,_util.warn)("The decode map is not the correct length"),!0;numComps=0;for(var ii=decode.length;numComps<ii;numComps+=2)if(0!==decode[numComps]||1!==decode[numComps+
|
|
1216
|
+
1])return!1;return!0}},{key:"singletons",get:function(){return(0,_util.shadow)(this,"singletons",{get gray(){return(0,_util.shadow)(this,"gray",new DeviceGrayCS)},get rgb(){return(0,_util.shadow)(this,"rgb",new DeviceRgbCS)},get cmyk(){return(0,_util.shadow)(this,"cmyk",new DeviceCmykCS)}})}}]);return ColorSpace}();exports.ColorSpace=ColorSpace;var AlternateCS=function(_ColorSpace){function AlternateCS(numComps,base,tintFn){_classCallCheck(this,AlternateCS);numComps=_possibleConstructorReturn(this,
|
|
1217
|
+
_getPrototypeOf(AlternateCS).call(this,"Alternate",numComps));numComps.base=base;numComps.tintFn=tintFn;numComps.tmpBuf=new Float32Array(base.numComps);return numComps}_inherits(AlternateCS,_ColorSpace);_createClass(AlternateCS,[{key:"getRgbItem",value:function(src,srcOffset,dest,destOffset){var tmpBuf=this.tmpBuf;this.tintFn(src,srcOffset,tmpBuf,0);this.base.getRgbItem(tmpBuf,0,dest,destOffset)}},{key:"getRgbBuffer",value:function(src,srcOffset,count,dest,destOffset,bits,alpha01){var tintFn=this.tintFn,
|
|
1218
|
+
base=this.base;bits=1/((1<<bits)-1);var baseNumComps=base.numComps,usesZeroToOneRange=base.usesZeroToOneRange,isPassthrough=(base.isPassthrough(8)||!usesZeroToOneRange)&&0===alpha01,pos=isPassthrough?destOffset:0,baseBuf=isPassthrough?dest:new Uint8ClampedArray(baseNumComps*count),numComps=this.numComps,scaled=new Float32Array(numComps),tinted=new Float32Array(baseNumComps),i,j;for(i=0;i<count;i++){for(j=0;j<numComps;j++)scaled[j]=src[srcOffset++]*bits;tintFn(scaled,0,tinted,0);if(usesZeroToOneRange)for(j=
|
|
1219
|
+
0;j<baseNumComps;j++)baseBuf[pos++]=255*tinted[j];else base.getRgbItem(tinted,0,baseBuf,pos),pos+=baseNumComps}isPassthrough||base.getRgbBuffer(baseBuf,0,count,dest,destOffset,8,alpha01)}},{key:"getOutputLength",value:function(inputLength,alpha01){return this.base.getOutputLength(inputLength*this.base.numComps/this.numComps,alpha01)}}]);return AlternateCS}(ColorSpace),PatternCS=function(_ColorSpace2){function PatternCS(baseCS){_classCallCheck(this,PatternCS);var _this2=_possibleConstructorReturn(this,
|
|
1220
|
+
_getPrototypeOf(PatternCS).call(this,"Pattern",null));_this2.base=baseCS;return _this2}_inherits(PatternCS,_ColorSpace2);_createClass(PatternCS,[{key:"isDefaultDecode",value:function(decodeMap,bpc){(0,_util.unreachable)("Should not call PatternCS.isDefaultDecode")}}]);return PatternCS}(ColorSpace),IndexedCS=function(_ColorSpace3){function IndexedCS(base,highVal,lookup){_classCallCheck(this,IndexedCS);var _this3=_possibleConstructorReturn(this,_getPrototypeOf(IndexedCS).call(this,"Indexed",1));_this3.base=
|
|
1221
|
+
base;_this3.highVal=highVal;base=base.numComps*highVal;if((0,_primitives.isStream)(lookup))_this3.lookup=new Uint8Array(base),lookup=lookup.getBytes(base),_this3.lookup.set(lookup);else if((0,_util.isString)(lookup))for(_this3.lookup=new Uint8Array(base),highVal=0;highVal<base;++highVal)_this3.lookup[highVal]=lookup.charCodeAt(highVal);else if(lookup instanceof Uint8Array)_this3.lookup=lookup;else throw new _util.FormatError("Unrecognized lookup table: ".concat(lookup));return _this3}_inherits(IndexedCS,
|
|
1222
|
+
_ColorSpace3);_createClass(IndexedCS,[{key:"getRgbItem",value:function(src,srcOffset,dest,destOffset){this.base.getRgbBuffer(this.lookup,src[srcOffset]*this.base.numComps,1,dest,destOffset,8,0)}},{key:"getRgbBuffer",value:function(src,srcOffset,count,dest,destOffset,bits,alpha01){bits=this.base;for(var numComps=bits.numComps,outputDelta=bits.getOutputLength(numComps,alpha01),lookup=this.lookup,i=0;i<count;++i){var lookupPos=src[srcOffset++]*numComps;bits.getRgbBuffer(lookup,lookupPos,1,dest,destOffset,
|
|
1223
|
+
8,alpha01);destOffset+=outputDelta}}},{key:"getOutputLength",value:function(inputLength,alpha01){return this.base.getOutputLength(inputLength*this.base.numComps,alpha01)}},{key:"isDefaultDecode",value:function(decodeMap,bpc){return Array.isArray(decodeMap)?2!==decodeMap.length?((0,_util.warn)("Decode map length is not correct"),!0):!Number.isInteger(bpc)||1>bpc?((0,_util.warn)("Bits per component is not correct"),!0):0===decodeMap[0]&&decodeMap[1]===(1<<bpc)-1:!0}}]);return IndexedCS}(ColorSpace),
|
|
1221
1224
|
DeviceGrayCS=function(_ColorSpace4){function DeviceGrayCS(){_classCallCheck(this,DeviceGrayCS);return _possibleConstructorReturn(this,_getPrototypeOf(DeviceGrayCS).call(this,"DeviceGray",1))}_inherits(DeviceGrayCS,_ColorSpace4);_createClass(DeviceGrayCS,[{key:"getRgbItem",value:function(src,srcOffset,dest,destOffset){dest[destOffset]=dest[destOffset+1]=dest[destOffset+2]=255*src[srcOffset]}},{key:"getRgbBuffer",value:function(src,srcOffset,count,dest,destOffset,bits,alpha01){bits=255/((1<<bits)-1);
|
|
1222
1225
|
for(var i=0;i<count;++i){var c=bits*src[srcOffset++];dest[destOffset++]=c;dest[destOffset++]=c;dest[destOffset++]=c;destOffset+=alpha01}}},{key:"getOutputLength",value:function(inputLength,alpha01){return inputLength*(3+alpha01)}}]);return DeviceGrayCS}(ColorSpace),DeviceRgbCS=function(_ColorSpace5){function DeviceRgbCS(){_classCallCheck(this,DeviceRgbCS);return _possibleConstructorReturn(this,_getPrototypeOf(DeviceRgbCS).call(this,"DeviceRGB",3))}_inherits(DeviceRgbCS,_ColorSpace5);_createClass(DeviceRgbCS,
|
|
1223
1226
|
[{key:"getRgbItem",value:function(src,srcOffset,dest,destOffset){dest[destOffset]=255*src[srcOffset];dest[destOffset+1]=255*src[srcOffset+1];dest[destOffset+2]=255*src[srcOffset+2]}},{key:"getRgbBuffer",value:function(src,srcOffset,count,dest,destOffset,bits,alpha01){if(8===bits&&0===alpha01)dest.set(src.subarray(srcOffset,srcOffset+3*count),destOffset);else{bits=255/((1<<bits)-1);for(var i=0;i<count;++i)dest[destOffset++]=bits*src[srcOffset++],dest[destOffset++]=bits*src[srcOffset++],dest[destOffset++]=
|
|
@@ -1252,20 +1255,20 @@ _setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscom
|
|
|
1252
1255
|
bbox[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(matrix.push(_s.value),4!==matrix.length);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i["return"])_i["return"]()}finally{if(_d)throw _e;}}}else matrix=void 0;if(!matrix)throw new TypeError("Invalid attempt to destructure non-iterable instance");_i=matrix[0];_s=matrix[1];bbox=matrix[2];matrix=matrix[3];if(_i===bbox||_s===matrix)return[1,0,0,1,rect[0],rect[1]];bbox=(rect[2]-rect[0])/(bbox-_i);matrix=(rect[3]-rect[1])/(matrix-_s);return[bbox,
|
|
1253
1256
|
0,0,matrix,rect[0]-_i*bbox,rect[1]-_s*matrix]}Object.defineProperty(exports,"__esModule",{value:!0});exports.getQuadPoints=getQuadPoints;exports.MarkupAnnotation=exports.AnnotationFactory=exports.AnnotationBorderStyle=exports.Annotation=void 0;var _util=__w_pdfjs_require__(5),_obj=__w_pdfjs_require__(193),_primitives=__w_pdfjs_require__(188),_colorspace=__w_pdfjs_require__(206),_core_utils=__w_pdfjs_require__(191),_operator_list=__w_pdfjs_require__(208),_stream=__w_pdfjs_require__(195);module=function(){function AnnotationFactory(){_classCallCheck(this,
|
|
1254
1257
|
AnnotationFactory)}_createClass(AnnotationFactory,null,[{key:"create",value:function(xref,ref,pdfManager,idFactory){return pdfManager.ensure(this,"_create",[xref,ref,pdfManager,idFactory])}},{key:"_create",value:function(xref,ref,pdfManager,idFactory){var dict=xref.fetchIfRef(ref);if((0,_primitives.isDict)(dict))switch(idFactory=(0,_primitives.isRef)(ref)?ref.toString():"annot_".concat(idFactory.createObjId()),ref=dict.get("Subtype"),ref=(0,_primitives.isName)(ref)?ref.name:null,xref={xref:xref,dict:dict,
|
|
1255
|
-
subtype:ref,id:idFactory,pdfManager:pdfManager},ref){case "Link":return new LinkAnnotation(xref);case "Text":return new TextAnnotation(xref);case "Widget":dict=(0,_core_utils.getInheritableProperty)({dict:dict,key:"FT"});dict=(0,_primitives.isName)(dict)?dict.name:null;switch(dict){case "Tx":return new TextWidgetAnnotation(xref);case "Btn":return new ButtonWidgetAnnotation(xref);case "Ch":return new ChoiceWidgetAnnotation(xref)}(
|
|
1256
|
-
return new
|
|
1257
|
-
case "
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
{key:"getOperatorList",value:function(evaluator,task,renderForms){var _this=this;if(!this.appearance)return Promise.resolve(new _operator_list.OperatorList);renderForms=this.data.pushButton;
|
|
1266
|
-
bbox=renderForms.getArray("BBox")||[0,0,1,1],matrix=renderForms.getArray("Matrix")||[1,0,0,1,0,0],transform=getTransformMatrix(data.rect,bbox,matrix);return
|
|
1267
|
-
return opList})})}},{key:"viewable",get:function(){return 0===this.flags?!0:this._isViewable(this.flags)}},{key:"printable",get:function(){return 0===this.flags?!1:this._isPrintable(this.flags)}}]);return Annotation}();exports.Annotation=Annotation;var AnnotationBorderStyle=function(){function AnnotationBorderStyle(){_classCallCheck(this,AnnotationBorderStyle);this.width=1;this.style=_util.AnnotationBorderStyleType.SOLID;this.dashArray=[3];this.verticalCornerRadius=this.horizontalCornerRadius=
|
|
1268
|
-
[{key:"setWidth",value:function(width){var rect=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[0,0,0,0];if((0,_primitives.isName)(width))this.width=0;else if(Number.isInteger(width)){if(0<width){var maxWidth=(rect[2]-rect[0])/2;rect=(rect[3]-rect[1])/2;0<maxWidth&&0<rect&&(width>maxWidth||width>rect)&&((0,_util.warn)("AnnotationBorderStyle.setWidth - ignoring width: ".concat(width)),width=1)}this.width=width}}},{key:"setStyle",value:function(style){if((0,_primitives.isName)(style))switch(style.name){case "S":this.style=
|
|
1258
|
+
subtype:ref,id:idFactory,pdfManager:pdfManager},ref){case "Link":return new LinkAnnotation(xref);case "Text":return new TextAnnotation(xref);case "Widget":dict=(0,_core_utils.getInheritableProperty)({dict:dict,key:"FT"});dict=(0,_primitives.isName)(dict)?dict.name:null;switch(dict){case "Tx":return new TextWidgetAnnotation(xref);case "Btn":return new ButtonWidgetAnnotation(xref);case "Ch":return new ChoiceWidgetAnnotation(xref)}return new WidgetAnnotation(xref);case "Popup":return new PopupAnnotation(xref);
|
|
1259
|
+
case "FreeText":return new FreeTextAnnotation(xref);case "Line":return new LineAnnotation(xref);case "Square":return new SquareAnnotation(xref);case "Circle":return new CircleAnnotation(xref);case "PolyLine":return new PolylineAnnotation(xref);case "Polygon":return new PolygonAnnotation(xref);case "Caret":return new CaretAnnotation(xref);case "Ink":return new InkAnnotation(xref);case "Highlight":return new HighlightAnnotation(xref);case "Underline":return new UnderlineAnnotation(xref);case "Squiggly":return new SquigglyAnnotation(xref);
|
|
1260
|
+
case "StrikeOut":return new StrikeOutAnnotation(xref);case "Stamp":return new StampAnnotation(xref);case "FileAttachment":return new FileAttachmentAnnotation(xref);default:return ref?(0,_util.warn)('Unimplemented annotation type "'+ref+'", falling back to base annotation.'):(0,_util.warn)("Annotation is missing the required /Subtype."),new Annotation(xref)}}}]);return AnnotationFactory}();exports.AnnotationFactory=module;var Annotation=function(){function Annotation(params){_classCallCheck(this,Annotation);
|
|
1261
|
+
var dict=params.dict;this.setContents(dict.get("Contents"));this.setModificationDate(dict.get("M"));this.setFlags(dict.get("F"));this.setRectangle(dict.getArray("Rect"));this.setColor(dict.getArray("C"));this.setBorderStyle(dict);this.setAppearance(dict);this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,contents:this.contents,hasAppearance:!!this.appearance,id:params.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:params.subtype}}_createClass(Annotation,
|
|
1262
|
+
[{key:"_hasFlag",value:function(flags,flag){return!!(flags&flag)}},{key:"_isViewable",value:function(flags){return!this._hasFlag(flags,_util.AnnotationFlag.INVISIBLE)&&!this._hasFlag(flags,_util.AnnotationFlag.HIDDEN)&&!this._hasFlag(flags,_util.AnnotationFlag.NOVIEW)}},{key:"_isPrintable",value:function(flags){return this._hasFlag(flags,_util.AnnotationFlag.PRINT)&&!this._hasFlag(flags,_util.AnnotationFlag.INVISIBLE)&&!this._hasFlag(flags,_util.AnnotationFlag.HIDDEN)}},{key:"setContents",value:function(contents){this.contents=
|
|
1263
|
+
(0,_util.stringToPDFString)(contents||"")}},{key:"setModificationDate",value:function(modificationDate){this.modificationDate=(0,_util.isString)(modificationDate)?modificationDate:null}},{key:"setFlags",value:function(flags){this.flags=Number.isInteger(flags)&&0<flags?flags:0}},{key:"hasFlag",value:function(flag){return this._hasFlag(this.flags,flag)}},{key:"setRectangle",value:function(rectangle){Array.isArray(rectangle)&&4===rectangle.length?this.rectangle=_util.Util.normalizeRect(rectangle):this.rectangle=
|
|
1264
|
+
[0,0,0,0]}},{key:"setColor",value:function(color){var rgbColor=new Uint8ClampedArray(3);if(Array.isArray(color))switch(color.length){case 0:this.color=null;break;case 1:_colorspace.ColorSpace.singletons.gray.getRgbItem(color,0,rgbColor,0);this.color=rgbColor;break;case 3:_colorspace.ColorSpace.singletons.rgb.getRgbItem(color,0,rgbColor,0);this.color=rgbColor;break;case 4:_colorspace.ColorSpace.singletons.cmyk.getRgbItem(color,0,rgbColor,0);this.color=rgbColor;break;default:this.color=rgbColor}else this.color=
|
|
1265
|
+
rgbColor}},{key:"setBorderStyle",value:function(borderStyle){this.borderStyle=new AnnotationBorderStyle;if((0,_primitives.isDict)(borderStyle))if(borderStyle.has("BS")){borderStyle=borderStyle.get("BS");var dictType=borderStyle.get("Type");if(!dictType||(0,_primitives.isName)(dictType,"Border"))this.borderStyle.setWidth(borderStyle.get("W"),this.rectangle),this.borderStyle.setStyle(borderStyle.get("S")),this.borderStyle.setDashArray(borderStyle.getArray("D"))}else borderStyle.has("Border")?(borderStyle=
|
|
1266
|
+
borderStyle.getArray("Border"),Array.isArray(borderStyle)&&3<=borderStyle.length&&(this.borderStyle.setHorizontalCornerRadius(borderStyle[0]),this.borderStyle.setVerticalCornerRadius(borderStyle[1]),this.borderStyle.setWidth(borderStyle[2],this.rectangle),4===borderStyle.length&&this.borderStyle.setDashArray(borderStyle[3]))):this.borderStyle.setWidth(0)}},{key:"setAppearance",value:function(dict){this.appearance=null;var appearanceStates=dict.get("AP");(0,_primitives.isDict)(appearanceStates)&&(appearanceStates=
|
|
1267
|
+
appearanceStates.get("N"),(0,_primitives.isStream)(appearanceStates)?this.appearance=appearanceStates:(0,_primitives.isDict)(appearanceStates)&&(dict=dict.get("AS"),(0,_primitives.isName)(dict)&&appearanceStates.has(dict.name)&&(this.appearance=appearanceStates.get(dict.name))))}},{key:"loadResources",value:function(keys){return this.appearance.dict.getAsync("Resources").then(function(resources){if(resources)return(new _obj.ObjectLoader(resources,keys,resources.xref)).load().then(function(){return resources})})}},
|
|
1268
|
+
{key:"getOperatorList",value:function(evaluator,task,renderForms){var _this=this;if(!this.appearance)return Promise.resolve(new _operator_list.OperatorList);renderForms=this.data.pushButton;var forceRender=global$jscomp$0.renderFormFields;if(!(this.data.forceRender||forceRender||renderForms||"Widget"!==this.data.subtype&&"Link"!==this.data.subtype))return Promise.resolve(new _operator_list.OperatorList);this.data.forceRender&&(this.data.blockRender=!0);var data=this.data;renderForms=this.appearance.dict;
|
|
1269
|
+
forceRender=this.loadResources("ExtGState ColorSpace Pattern Shading XObject Font".split(" "));var bbox=renderForms.getArray("BBox")||[0,0,1,1],matrix=renderForms.getArray("Matrix")||[1,0,0,1,0,0],transform=getTransformMatrix(data.rect,bbox,matrix);return forceRender.then(function(resources){var opList=new _operator_list.OperatorList;opList.addOp(_util.OPS.beginAnnotation,[data.rect,transform,matrix]);return evaluator.getOperatorList({stream:_this.appearance,task:task,resources:resources,operatorList:opList}).then(function(){opList.addOp(_util.OPS.endAnnotation,
|
|
1270
|
+
[]);_this.appearance.reset();return opList})})}},{key:"viewable",get:function(){return 0===this.flags?!0:this._isViewable(this.flags)}},{key:"printable",get:function(){return 0===this.flags?!1:this._isPrintable(this.flags)}}]);return Annotation}();exports.Annotation=Annotation;var AnnotationBorderStyle=function(){function AnnotationBorderStyle(){_classCallCheck(this,AnnotationBorderStyle);this.width=1;this.style=_util.AnnotationBorderStyleType.SOLID;this.dashArray=[3];this.verticalCornerRadius=this.horizontalCornerRadius=
|
|
1271
|
+
0}_createClass(AnnotationBorderStyle,[{key:"setWidth",value:function(width){var rect=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[0,0,0,0];if((0,_primitives.isName)(width))this.width=0;else if(Number.isInteger(width)){if(0<width){var maxWidth=(rect[2]-rect[0])/2;rect=(rect[3]-rect[1])/2;0<maxWidth&&0<rect&&(width>maxWidth||width>rect)&&((0,_util.warn)("AnnotationBorderStyle.setWidth - ignoring width: ".concat(width)),width=1)}this.width=width}}},{key:"setStyle",value:function(style){if((0,_primitives.isName)(style))switch(style.name){case "S":this.style=
|
|
1269
1272
|
_util.AnnotationBorderStyleType.SOLID;break;case "D":this.style=_util.AnnotationBorderStyleType.DASHED;break;case "B":this.style=_util.AnnotationBorderStyleType.BEVELED;break;case "I":this.style=_util.AnnotationBorderStyleType.INSET;break;case "U":this.style=_util.AnnotationBorderStyleType.UNDERLINE}}},{key:"setDashArray",value:function(dashArray){if(Array.isArray(dashArray)&&0<dashArray.length){var isValid=!0,allZeros=!0,_iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _iterator=
|
|
1270
1273
|
dashArray[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var element=_step.value;if(0<=+element)0<element&&(allZeros=!1);else{isValid=!1;break}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&null!=_iterator["return"])_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}isValid&&!allZeros?this.dashArray=dashArray:this.width=0}else dashArray&&(this.width=0)}},{key:"setHorizontalCornerRadius",
|
|
1271
1274
|
value:function(radius){Number.isInteger(radius)&&(this.horizontalCornerRadius=radius)}},{key:"setVerticalCornerRadius",value:function(radius){Number.isInteger(radius)&&(this.verticalCornerRadius=radius)}}]);return AnnotationBorderStyle}();exports.AnnotationBorderStyle=AnnotationBorderStyle;module=function(_Annotation){function MarkupAnnotation(parameters){_classCallCheck(this,MarkupAnnotation);var _this2=_possibleConstructorReturn(this,_getPrototypeOf(MarkupAnnotation).call(this,parameters));parameters=
|
|
@@ -1298,32 +1301,32 @@ _util.Util.normalizeRect(parameters.dict.getArray("L"));return _this11}_inherits
|
|
|
1298
1301
|
CircleAnnotation=function(_MarkupAnnotation5){function CircleAnnotation(parameters){_classCallCheck(this,CircleAnnotation);parameters=_possibleConstructorReturn(this,_getPrototypeOf(CircleAnnotation).call(this,parameters));parameters.data.annotationType=_util.AnnotationType.CIRCLE;return parameters}_inherits(CircleAnnotation,_MarkupAnnotation5);return CircleAnnotation}(module),PolylineAnnotation=function(_MarkupAnnotation6){function PolylineAnnotation(parameters){_classCallCheck(this,PolylineAnnotation);
|
|
1299
1302
|
var _this14=_possibleConstructorReturn(this,_getPrototypeOf(PolylineAnnotation).call(this,parameters));_this14.data.annotationType=_util.AnnotationType.POLYLINE;parameters=parameters.dict.getArray("Vertices");_this14.data.vertices=[];for(var i=0,ii=parameters.length;i<ii;i+=2)_this14.data.vertices.push({x:parameters[i],y:parameters[i+1]});return _this14}_inherits(PolylineAnnotation,_MarkupAnnotation6);return PolylineAnnotation}(module),PolygonAnnotation=function(_PolylineAnnotation){function PolygonAnnotation(parameters){_classCallCheck(this,
|
|
1300
1303
|
PolygonAnnotation);parameters=_possibleConstructorReturn(this,_getPrototypeOf(PolygonAnnotation).call(this,parameters));parameters.data.annotationType=_util.AnnotationType.POLYGON;return parameters}_inherits(PolygonAnnotation,_PolylineAnnotation);return PolygonAnnotation}(PolylineAnnotation),CaretAnnotation=function(_MarkupAnnotation7){function CaretAnnotation(parameters){_classCallCheck(this,CaretAnnotation);parameters=_possibleConstructorReturn(this,_getPrototypeOf(CaretAnnotation).call(this,parameters));
|
|
1301
|
-
parameters.data.annotationType=_util.AnnotationType.CARET;return parameters}_inherits(CaretAnnotation,_MarkupAnnotation7);return CaretAnnotation}(module),InkAnnotation=function(_MarkupAnnotation8){function InkAnnotation(parameters){_classCallCheck(this,InkAnnotation);var _this17=_possibleConstructorReturn(this,_getPrototypeOf(InkAnnotation).call(this,parameters));_this17.data.annotationType=_util.AnnotationType.INK;var xref=parameters.xref;parameters=parameters.dict.getArray("InkList");
|
|
1302
|
-
[];for(var i=0,ii=parameters.length;i<ii;++i){_this17.data.inkLists.push([]);for(var j=0,jj=parameters[i].length;j<jj;j+=2)_this17.data.inkLists[i].push({x:xref.fetchIfRef(parameters[i][j]),y:xref.fetchIfRef(parameters[i][j+1])})}return _this17}_inherits(InkAnnotation,_MarkupAnnotation8);return InkAnnotation}(module),HighlightAnnotation=function(_MarkupAnnotation9){function HighlightAnnotation(parameters){_classCallCheck(this,HighlightAnnotation);var _this18=_possibleConstructorReturn(this,
|
|
1303
|
-
parameters));_this18.data.annotationType=_util.AnnotationType.HIGHLIGHT;if(parameters=getQuadPoints(parameters.dict,_this18.rectangle))_this18.data.quadPoints=parameters;return _this18}_inherits(HighlightAnnotation,_MarkupAnnotation9);return HighlightAnnotation}(module),UnderlineAnnotation=function(_MarkupAnnotation10){function UnderlineAnnotation(parameters){_classCallCheck(this,UnderlineAnnotation);var _this19=_possibleConstructorReturn(this,_getPrototypeOf(UnderlineAnnotation).call(this,
|
|
1304
|
-
_this19.data.annotationType=_util.AnnotationType.UNDERLINE;if(parameters=getQuadPoints(parameters.dict,_this19.rectangle))_this19.data.quadPoints=parameters;return _this19}_inherits(UnderlineAnnotation,_MarkupAnnotation10);return UnderlineAnnotation}(module),SquigglyAnnotation=function(_MarkupAnnotation11){function SquigglyAnnotation(parameters){_classCallCheck(this,SquigglyAnnotation);var _this20=_possibleConstructorReturn(this,_getPrototypeOf(SquigglyAnnotation).call(this,parameters));
|
|
1305
|
-
_util.AnnotationType.SQUIGGLY;if(parameters=getQuadPoints(parameters.dict,_this20.rectangle))_this20.data.quadPoints=parameters;return _this20}_inherits(SquigglyAnnotation,_MarkupAnnotation11);return SquigglyAnnotation}(module),StrikeOutAnnotation=function(_MarkupAnnotation12){function StrikeOutAnnotation(parameters){_classCallCheck(this,StrikeOutAnnotation);var _this21=_possibleConstructorReturn(this,_getPrototypeOf(StrikeOutAnnotation).call(this,parameters));_this21.data.annotationType=
|
|
1306
|
-
if(parameters=getQuadPoints(parameters.dict,_this21.rectangle))_this21.data.quadPoints=parameters;return _this21}_inherits(StrikeOutAnnotation,_MarkupAnnotation12);return StrikeOutAnnotation}(module),StampAnnotation=function(_MarkupAnnotation13){function StampAnnotation(parameters){_classCallCheck(this,StampAnnotation);parameters=_possibleConstructorReturn(this,_getPrototypeOf(StampAnnotation).call(this,parameters));parameters.data.annotationType=_util.AnnotationType.STAMP;
|
|
1307
|
-
_MarkupAnnotation13);return StampAnnotation}(module),FileAttachmentAnnotation=function(_MarkupAnnotation14){function FileAttachmentAnnotation(parameters){_classCallCheck(this,FileAttachmentAnnotation);var _this23=_possibleConstructorReturn(this,_getPrototypeOf(FileAttachmentAnnotation).call(this,parameters));parameters=new _obj.FileSpec(parameters.dict.get("FS"),parameters.xref);_this23.data.annotationType=_util.AnnotationType.FILEATTACHMENT;_this23.data.file=
|
|
1308
|
-
_inherits(FileAttachmentAnnotation,_MarkupAnnotation14);return FileAttachmentAnnotation}(module)},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.OperatorList=void 0;var _util=__w_pdfjs_require__(5),QueueOptimizer=function(){function addState(parentState,pattern,checkFn,iterateFn,processFn){for(var i=0,ii=pattern.length-1;i<ii;i++){var item=pattern[i];parentState=parentState[item]||(parentState[item]=
|
|
1309
|
-
1]]={checkFn:checkFn,iterateFn:iterateFn,processFn:processFn}}function QueueOptimizer(queue){this.queue=queue;this.state=null;this.context={iCurr:0,fnArray:queue.fnArray,argsArray:queue.argsArray};this.match=null;this.lastProcessed=0}var InitialState=[];addState(InitialState,[_util.OPS.save,_util.OPS.transform,_util.OPS.paintInlineImageXObject,_util.OPS.restore],null,function(context,i){var fnArray=context.fnArray;context=(i-(context.iCurr-3))%4;switch(context){case 0:return fnArray[i]===
|
|
1310
|
-
case 1:return fnArray[i]===_util.OPS.transform;case 2:return fnArray[i]===_util.OPS.paintInlineImageXObject;case 3:return fnArray[i]===_util.OPS.restore}throw Error("iterateInlineImageGroup - invalid pos: ".concat(context));},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,curr=context.iCurr;context=curr-3;var iFirstTransform=curr-2;--curr;var count=Math.min(Math.floor((i-context)/4),200);if(10>count)return i-(i-context)%4;var maxX=0;i=[];var maxLineHeight=
|
|
1311
|
-
currentY=1,q;for(q=0;q<count;q++){var transform=argsArray[iFirstTransform+(q<<2)],img=argsArray[curr+(q<<2)][0];1E3<currentX+img.width&&(maxX=Math.max(maxX,currentX),currentY+=maxLineHeight+2,maxLineHeight=currentX=0);i.push({transform:transform,x:currentX,y:currentY,w:img.width,h:img.height});currentX+=img.width+2;maxLineHeight=Math.max(maxLineHeight,img.height)}iFirstTransform=Math.max(maxX,currentX)+1;maxLineHeight=currentY+maxLineHeight+1;currentY=new Uint8ClampedArray(iFirstTransform*
|
|
1312
|
-
4);maxX=iFirstTransform<<2;for(q=0;q<count;q++){currentX=argsArray[curr+(q<<2)][0].data;transform=i[q].w<<2;img=0;var offset=i[q].x+i[q].y*iFirstTransform<<2;currentY.set(currentX.subarray(0,transform),offset-maxX);for(var k=0,kk=i[q].h;k<kk;k++)currentY.set(currentX.subarray(img,img+transform),offset),img+=transform,offset+=maxX;for(currentY.set(currentX.subarray(img-transform,img),offset);0<=offset;)currentX[offset-4]=currentX[offset],currentX[offset-3]=currentX[offset+1],currentX[offset-
|
|
1313
|
-
2],currentX[offset-1]=currentX[offset+3],currentX[offset+transform]=currentX[offset+transform-4],currentX[offset+transform+1]=currentX[offset+transform-3],currentX[offset+transform+2]=currentX[offset+transform-2],currentX[offset+transform+3]=currentX[offset+transform-1],offset-=maxX}fnArray.splice(context,4*count,_util.OPS.paintInlineImageXObjectGroup);argsArray.splice(context,4*count,[{width:iFirstTransform,height:maxLineHeight,kind:_util.ImageKind.RGBA_32BPP,data:currentY},i]);
|
|
1314
|
-
addState(InitialState,[_util.OPS.save,_util.OPS.transform,_util.OPS.paintImageMaskXObject,_util.OPS.restore],null,function(context,i){var fnArray=context.fnArray;context=(i-(context.iCurr-3))%4;switch(context){case 0:return fnArray[i]===_util.OPS.save;case 1:return fnArray[i]===_util.OPS.transform;case 2:return fnArray[i]===_util.OPS.paintImageMaskXObject;case 3:return fnArray[i]===_util.OPS.restore}throw Error("iterateImageMaskGroup - invalid pos: ".concat(context));},function(context,
|
|
1315
|
-
context.fnArray,argsArray=context.argsArray,curr=context.iCurr;context=curr-3;var iFirstTransform=curr-2;--curr;for(var count=Math.floor((i$jscomp$0-context)/4),iFirstPIMXO=context+2,i=0;i<count;i++){var arg=argsArray[iFirstPIMXO+4*i];if((arg=1===arg.length&&arg[0])&&1===arg.width&&1===arg.height&&(!arg.data.length||1===arg.data.length&&0===arg.data[0]))fnArray[iFirstPIMXO+4*i]=_util.OPS.paintSolidColorImageMask;else break}count-=i;if(10>count)return i$jscomp$0-(i$jscomp$0-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
count;i$jscomp$0++)iFirstPIMXO=argsArray[iFirstTransform+(i$jscomp$0<<2)],firstTransformArg3=argsArray[curr+(i$jscomp$0<<2)][0],firstTransformArg0.push({data:firstTransformArg3.data,width:firstTransformArg3.width,height:firstTransformArg3.height,transform:iFirstPIMXO});fnArray.splice(context,4*count,_util.OPS.paintImageMaskXObjectGroup);argsArray.splice(context,4*count,[firstTransformArg0])}return context+1});addState(InitialState,[_util.OPS.save,_util.OPS.transform,_util.OPS.paintImageXObject,
|
|
1319
|
-
function(context){var argsArray=context.argsArray;context=context.iCurr-2;return 0===argsArray[context][1]&&0===argsArray[context][2]},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,pos=(i-(context.iCurr-3))%4;switch(pos){case 0:return fnArray[i]===_util.OPS.save;case 1:if(fnArray[i]!==_util.OPS.transform)return!1;context=context.iCurr-2;fnArray=argsArray[context][3];return argsArray[i][0]!==argsArray[context][0]||0!==argsArray[i][1]||0!==argsArray[i][2]||
|
|
1320
|
-
fnArray?!1:!0;case 2:return fnArray[i]!==_util.OPS.paintImageXObject||argsArray[i][0]!==argsArray[context.iCurr-1][0]?!1:!0;case 3:return fnArray[i]===_util.OPS.restore}throw Error("iterateImageGroup - invalid pos: ".concat(pos));},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,curr=context.iCurr;context=curr-3;var iFirstTransform=curr-2,firstPIXOArg0=argsArray[curr-1][0],firstTransformArg0=argsArray[iFirstTransform][0],firstTransformArg3=argsArray[iFirstTransform][3];
|
|
1304
|
+
parameters.data.annotationType=_util.AnnotationType.CARET;return parameters}_inherits(CaretAnnotation,_MarkupAnnotation7);return CaretAnnotation}(module),InkAnnotation=function(_MarkupAnnotation8){function InkAnnotation(parameters){_classCallCheck(this,InkAnnotation);var _this17=_possibleConstructorReturn(this,_getPrototypeOf(InkAnnotation).call(this,parameters));_this17.data.annotationType=_util.AnnotationType.INK;_this17.type="InkAnnotation";var xref=parameters.xref;parameters=parameters.dict.getArray("InkList");
|
|
1305
|
+
_this17.data.inkLists=[];for(var i=0,ii=parameters.length;i<ii;++i){_this17.data.inkLists.push([]);for(var j=0,jj=parameters[i].length;j<jj;j+=2)_this17.data.inkLists[i].push({x:xref.fetchIfRef(parameters[i][j]),y:xref.fetchIfRef(parameters[i][j+1])})}return _this17}_inherits(InkAnnotation,_MarkupAnnotation8);return InkAnnotation}(module),HighlightAnnotation=function(_MarkupAnnotation9){function HighlightAnnotation(parameters){_classCallCheck(this,HighlightAnnotation);var _this18=_possibleConstructorReturn(this,
|
|
1306
|
+
_getPrototypeOf(HighlightAnnotation).call(this,parameters));_this18.data.annotationType=_util.AnnotationType.HIGHLIGHT;if(parameters=getQuadPoints(parameters.dict,_this18.rectangle))_this18.data.quadPoints=parameters;return _this18}_inherits(HighlightAnnotation,_MarkupAnnotation9);return HighlightAnnotation}(module),UnderlineAnnotation=function(_MarkupAnnotation10){function UnderlineAnnotation(parameters){_classCallCheck(this,UnderlineAnnotation);var _this19=_possibleConstructorReturn(this,_getPrototypeOf(UnderlineAnnotation).call(this,
|
|
1307
|
+
parameters));_this19.data.annotationType=_util.AnnotationType.UNDERLINE;if(parameters=getQuadPoints(parameters.dict,_this19.rectangle))_this19.data.quadPoints=parameters;return _this19}_inherits(UnderlineAnnotation,_MarkupAnnotation10);return UnderlineAnnotation}(module),SquigglyAnnotation=function(_MarkupAnnotation11){function SquigglyAnnotation(parameters){_classCallCheck(this,SquigglyAnnotation);var _this20=_possibleConstructorReturn(this,_getPrototypeOf(SquigglyAnnotation).call(this,parameters));
|
|
1308
|
+
_this20.data.annotationType=_util.AnnotationType.SQUIGGLY;if(parameters=getQuadPoints(parameters.dict,_this20.rectangle))_this20.data.quadPoints=parameters;return _this20}_inherits(SquigglyAnnotation,_MarkupAnnotation11);return SquigglyAnnotation}(module),StrikeOutAnnotation=function(_MarkupAnnotation12){function StrikeOutAnnotation(parameters){_classCallCheck(this,StrikeOutAnnotation);var _this21=_possibleConstructorReturn(this,_getPrototypeOf(StrikeOutAnnotation).call(this,parameters));_this21.data.annotationType=
|
|
1309
|
+
_util.AnnotationType.STRIKEOUT;if(parameters=getQuadPoints(parameters.dict,_this21.rectangle))_this21.data.quadPoints=parameters;return _this21}_inherits(StrikeOutAnnotation,_MarkupAnnotation12);return StrikeOutAnnotation}(module),StampAnnotation=function(_MarkupAnnotation13){function StampAnnotation(parameters){_classCallCheck(this,StampAnnotation);parameters=_possibleConstructorReturn(this,_getPrototypeOf(StampAnnotation).call(this,parameters));parameters.data.annotationType=_util.AnnotationType.STAMP;
|
|
1310
|
+
return parameters}_inherits(StampAnnotation,_MarkupAnnotation13);return StampAnnotation}(module),FileAttachmentAnnotation=function(_MarkupAnnotation14){function FileAttachmentAnnotation(parameters){_classCallCheck(this,FileAttachmentAnnotation);var _this23=_possibleConstructorReturn(this,_getPrototypeOf(FileAttachmentAnnotation).call(this,parameters));parameters=new _obj.FileSpec(parameters.dict.get("FS"),parameters.xref);_this23.data.annotationType=_util.AnnotationType.FILEATTACHMENT;_this23.data.file=
|
|
1311
|
+
parameters.serializable;return _this23}_inherits(FileAttachmentAnnotation,_MarkupAnnotation14);return FileAttachmentAnnotation}(module)},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.OperatorList=void 0;var _util=__w_pdfjs_require__(5),QueueOptimizer=function(){function addState(parentState,pattern,checkFn,iterateFn,processFn){for(var i=0,ii=pattern.length-1;i<ii;i++){var item=pattern[i];parentState=parentState[item]||(parentState[item]=
|
|
1312
|
+
[])}parentState[pattern[pattern.length-1]]={checkFn:checkFn,iterateFn:iterateFn,processFn:processFn}}function QueueOptimizer(queue){this.queue=queue;this.state=null;this.context={iCurr:0,fnArray:queue.fnArray,argsArray:queue.argsArray};this.match=null;this.lastProcessed=0}var InitialState=[];addState(InitialState,[_util.OPS.save,_util.OPS.transform,_util.OPS.paintInlineImageXObject,_util.OPS.restore],null,function(context,i){var fnArray=context.fnArray;context=(i-(context.iCurr-3))%4;switch(context){case 0:return fnArray[i]===
|
|
1313
|
+
_util.OPS.save;case 1:return fnArray[i]===_util.OPS.transform;case 2:return fnArray[i]===_util.OPS.paintInlineImageXObject;case 3:return fnArray[i]===_util.OPS.restore}throw Error("iterateInlineImageGroup - invalid pos: ".concat(context));},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,curr=context.iCurr;context=curr-3;var iFirstTransform=curr-2;--curr;var count=Math.min(Math.floor((i-context)/4),200);if(10>count)return i-(i-context)%4;var maxX=0;i=[];var maxLineHeight=
|
|
1314
|
+
0,currentX=1,currentY=1,q;for(q=0;q<count;q++){var transform=argsArray[iFirstTransform+(q<<2)],img=argsArray[curr+(q<<2)][0];1E3<currentX+img.width&&(maxX=Math.max(maxX,currentX),currentY+=maxLineHeight+2,maxLineHeight=currentX=0);i.push({transform:transform,x:currentX,y:currentY,w:img.width,h:img.height});currentX+=img.width+2;maxLineHeight=Math.max(maxLineHeight,img.height)}iFirstTransform=Math.max(maxX,currentX)+1;maxLineHeight=currentY+maxLineHeight+1;currentY=new Uint8ClampedArray(iFirstTransform*
|
|
1315
|
+
maxLineHeight*4);maxX=iFirstTransform<<2;for(q=0;q<count;q++){currentX=argsArray[curr+(q<<2)][0].data;transform=i[q].w<<2;img=0;var offset=i[q].x+i[q].y*iFirstTransform<<2;currentY.set(currentX.subarray(0,transform),offset-maxX);for(var k=0,kk=i[q].h;k<kk;k++)currentY.set(currentX.subarray(img,img+transform),offset),img+=transform,offset+=maxX;for(currentY.set(currentX.subarray(img-transform,img),offset);0<=offset;)currentX[offset-4]=currentX[offset],currentX[offset-3]=currentX[offset+1],currentX[offset-
|
|
1316
|
+
2]=currentX[offset+2],currentX[offset-1]=currentX[offset+3],currentX[offset+transform]=currentX[offset+transform-4],currentX[offset+transform+1]=currentX[offset+transform-3],currentX[offset+transform+2]=currentX[offset+transform-2],currentX[offset+transform+3]=currentX[offset+transform-1],offset-=maxX}fnArray.splice(context,4*count,_util.OPS.paintInlineImageXObjectGroup);argsArray.splice(context,4*count,[{width:iFirstTransform,height:maxLineHeight,kind:_util.ImageKind.RGBA_32BPP,data:currentY},i]);
|
|
1317
|
+
return context+1});addState(InitialState,[_util.OPS.save,_util.OPS.transform,_util.OPS.paintImageMaskXObject,_util.OPS.restore],null,function(context,i){var fnArray=context.fnArray;context=(i-(context.iCurr-3))%4;switch(context){case 0:return fnArray[i]===_util.OPS.save;case 1:return fnArray[i]===_util.OPS.transform;case 2:return fnArray[i]===_util.OPS.paintImageMaskXObject;case 3:return fnArray[i]===_util.OPS.restore}throw Error("iterateImageMaskGroup - invalid pos: ".concat(context));},function(context,
|
|
1318
|
+
i$jscomp$0){var fnArray=context.fnArray,argsArray=context.argsArray,curr=context.iCurr;context=curr-3;var iFirstTransform=curr-2;--curr;for(var count=Math.floor((i$jscomp$0-context)/4),iFirstPIMXO=context+2,i=0;i<count;i++){var arg=argsArray[iFirstPIMXO+4*i];if((arg=1===arg.length&&arg[0])&&1===arg.width&&1===arg.height&&(!arg.data.length||1===arg.data.length&&0===arg.data[0]))fnArray[iFirstPIMXO+4*i]=_util.OPS.paintSolidColorImageMask;else break}count-=i;if(10>count)return i$jscomp$0-(i$jscomp$0-
|
|
1319
|
+
context)%4;var isSameImage=!1;arg=argsArray[curr][0];if(0===argsArray[iFirstTransform][1]&&0===argsArray[iFirstTransform][2]){isSameImage=!0;var firstTransformArg0=argsArray[iFirstTransform][0],firstTransformArg3=argsArray[iFirstTransform][3];i=iFirstTransform+4;var iPIMXO=curr+4;for(i$jscomp$0=1;i$jscomp$0<count;i$jscomp$0++,i+=4,iPIMXO+=4)if(iFirstPIMXO=argsArray[i],argsArray[iPIMXO][0]!==arg||iFirstPIMXO[0]!==firstTransformArg0||0!==iFirstPIMXO[1]||0!==iFirstPIMXO[2]||iFirstPIMXO[3]!==firstTransformArg3){10>
|
|
1320
|
+
i$jscomp$0?isSameImage=!1:count=i$jscomp$0;break}}if(isSameImage){count=Math.min(count,1E3);curr=new Float32Array(2*count);i=iFirstTransform;for(i$jscomp$0=0;i$jscomp$0<count;i$jscomp$0++,i+=4)iFirstPIMXO=argsArray[i],curr[i$jscomp$0<<1]=iFirstPIMXO[4],curr[(i$jscomp$0<<1)+1]=iFirstPIMXO[5];fnArray.splice(context,4*count,_util.OPS.paintImageMaskXObjectRepeat);argsArray.splice(context,4*count,[arg,firstTransformArg0,firstTransformArg3,curr])}else{count=Math.min(count,100);firstTransformArg0=[];for(i$jscomp$0=
|
|
1321
|
+
0;i$jscomp$0<count;i$jscomp$0++)iFirstPIMXO=argsArray[iFirstTransform+(i$jscomp$0<<2)],firstTransformArg3=argsArray[curr+(i$jscomp$0<<2)][0],firstTransformArg0.push({data:firstTransformArg3.data,width:firstTransformArg3.width,height:firstTransformArg3.height,transform:iFirstPIMXO});fnArray.splice(context,4*count,_util.OPS.paintImageMaskXObjectGroup);argsArray.splice(context,4*count,[firstTransformArg0])}return context+1});addState(InitialState,[_util.OPS.save,_util.OPS.transform,_util.OPS.paintImageXObject,
|
|
1322
|
+
_util.OPS.restore],function(context){var argsArray=context.argsArray;context=context.iCurr-2;return 0===argsArray[context][1]&&0===argsArray[context][2]},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,pos=(i-(context.iCurr-3))%4;switch(pos){case 0:return fnArray[i]===_util.OPS.save;case 1:if(fnArray[i]!==_util.OPS.transform)return!1;context=context.iCurr-2;fnArray=argsArray[context][3];return argsArray[i][0]!==argsArray[context][0]||0!==argsArray[i][1]||0!==argsArray[i][2]||
|
|
1323
|
+
argsArray[i][3]!==fnArray?!1:!0;case 2:return fnArray[i]!==_util.OPS.paintImageXObject||argsArray[i][0]!==argsArray[context.iCurr-1][0]?!1:!0;case 3:return fnArray[i]===_util.OPS.restore}throw Error("iterateImageGroup - invalid pos: ".concat(pos));},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,curr=context.iCurr;context=curr-3;var iFirstTransform=curr-2,firstPIXOArg0=argsArray[curr-1][0],firstTransformArg0=argsArray[iFirstTransform][0],firstTransformArg3=argsArray[iFirstTransform][3];
|
|
1321
1324
|
curr=Math.min(Math.floor((i-context)/4),1E3);if(3>curr)return i-(i-context)%4;i=new Float32Array(2*curr);for(var q=0;q<curr;q++,iFirstTransform+=4){var transformArgs=argsArray[iFirstTransform];i[q<<1]=transformArgs[4];i[(q<<1)+1]=transformArgs[5]}firstPIXOArg0=[firstPIXOArg0,firstTransformArg0,firstTransformArg3,i];fnArray.splice(context,4*curr,_util.OPS.paintImageXObjectRepeat);argsArray.splice(context,4*curr,firstPIXOArg0);return context+1});addState(InitialState,[_util.OPS.beginText,_util.OPS.setFont,
|
|
1322
1325
|
_util.OPS.setTextMatrix,_util.OPS.showText,_util.OPS.endText],null,function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,pos=(i-(context.iCurr-4))%5;switch(pos){case 0:return fnArray[i]===_util.OPS.beginText;case 1:return fnArray[i]===_util.OPS.setFont;case 2:return fnArray[i]===_util.OPS.setTextMatrix;case 3:if(fnArray[i]!==_util.OPS.showText)return!1;context=context.iCurr-3;fnArray=argsArray[context][1];return argsArray[i][0]!==argsArray[context][0]||argsArray[i][1]!==fnArray?
|
|
1323
1326
|
!1:!0;case 4:return fnArray[i]===_util.OPS.endText}throw Error("iterateShowTextGroup - invalid pos: ".concat(pos));},function(context,i){var fnArray=context.fnArray,argsArray=context.argsArray,curr=context.iCurr,iFirstBeginText=curr-4,iFirstSetFont=curr-3,firstSetFontArg0=argsArray[iFirstSetFont][0],firstSetFontArg1=argsArray[iFirstSetFont][1];context=Math.min(Math.floor((i-iFirstBeginText)/5),1E3);if(3>context)return i-(i-iFirstBeginText)%5;i=iFirstBeginText;4<=iFirstBeginText&&fnArray[iFirstBeginText-
|
|
1324
1327
|
4]===fnArray[iFirstSetFont]&&fnArray[iFirstBeginText-3]===fnArray[curr-2]&&fnArray[iFirstBeginText-2]===fnArray[curr-1]&&fnArray[iFirstBeginText-1]===fnArray[curr]&&argsArray[iFirstBeginText-4][0]===firstSetFontArg0&&argsArray[iFirstBeginText-4][1]===firstSetFontArg1&&(context++,i-=5);i+=4;for(curr=1;curr<context;curr++)fnArray.splice(i,3),argsArray.splice(i,3),i+=2;return i+1});QueueOptimizer.prototype={_optimize:function(){var fnArray=this.queue.fnArray,i=this.lastProcessed,ii=fnArray.length,state=
|
|
1325
1328
|
this.state,match=this.match;if(state||match||i+1!==ii||InitialState[fnArray[i]]){for(var context=this.context;i<ii;){if(match){if((0,match.iterateFn)(context,i)){i++;continue}i=(0,match.processFn)(context,i+1);ii=fnArray.length;state=match=null;if(i>=ii)break}state=(state||InitialState)[fnArray[i]];if(!state||Array.isArray(state))i++;else{context.iCurr=i;i++;if(!state.checkFn||(0,state.checkFn)(context))match=state;state=null}}this.state=state;this.match=match;this.lastProcessed=i}else this.lastProcessed=
|
|
1326
|
-
ii},push:function(fn,args){this.queue.fnArray.push(fn);this.queue.argsArray.push(args);this._optimize()},flush:function(){for(;this.match;)
|
|
1329
|
+
ii},push:function(fn,args){this.queue.fnArray.push(fn);this.queue.argsArray.push(args);this._optimize()},flush:function(){for(;this.match;)this.lastProcessed=(0,this.match.processFn)(this.context,this.queue.fnArray.length),this.state=this.match=null,this._optimize()},reset:function(){this.match=this.state=null;this.lastProcessed=0}};return QueueOptimizer}(),NullOptimizer=function(){function NullOptimizer(queue){this.queue=queue}NullOptimizer.prototype={push:function(fn,args){this.queue.fnArray.push(fn);
|
|
1327
1330
|
this.queue.argsArray.push(args)},flush:function(){},reset:function(){}};return NullOptimizer}();module=function(){function OperatorList(intent,streamSink,pageIndex){this._streamSink=streamSink;this.fnArray=[];this.argsArray=[];this.optimizer=streamSink&&"oplist"!==intent?new QueueOptimizer(this):new NullOptimizer(this);this.dependencies=Object.create(null);this._totalLength=0;this.pageIndex=pageIndex;this.intent=intent;this.weight=0;this._resolved=streamSink?null:Promise.resolve()}OperatorList.prototype=
|
|
1328
1331
|
{get length(){return this.argsArray.length},get ready(){return this._resolved||this._streamSink.ready},get totalLength(){return this._totalLength+this.length},addOp:function(fn,args){this.optimizer.push(fn,args);this.weight++;this._streamSink&&(1E3<=this.weight?this.flush():995<=this.weight&&(fn===_util.OPS.restore||fn===_util.OPS.endText)&&this.flush())},addDependency:function(dependency){dependency in this.dependencies||(this.dependencies[dependency]=!0,this.addOp(_util.OPS.dependency,[dependency]))},
|
|
1329
1332
|
addDependencies:function(dependencies){for(var key in dependencies)this.addDependency(key)},addOpList:function(opList){Object.assign(this.dependencies,opList.dependencies);for(var i=0,ii=opList.length;i<ii;i++)this.addOp(opList.fnArray[i],opList.argsArray[i])},getIR:function(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}},get _transfers(){for(var transfers=[],fnArray=this.fnArray,argsArray=this.argsArray,length=this.length,i=0;i<length;i++)switch(fnArray[i]){case _util.OPS.paintInlineImageXObject:case _util.OPS.paintInlineImageXObjectGroup:case _util.OPS.paintImageMaskXObject:var arg=
|
|
@@ -1424,52 +1427,52 @@ differences),-1!==codeStr&&(code=codeStr)}if(code){if(baseEncodingName&&code===+
|
|
|
1424
1427
|
0<properties.toUnicode.length;if(properties.hasIncludedToUnicodeMap)return!properties.composite&&properties.hasEncoding&&(properties.fallbackToUnicode=this._buildSimpleFontToUnicode(properties)),Promise.resolve(properties.toUnicode);if(!properties.composite)return Promise.resolve(this._buildSimpleFontToUnicode(properties));if(properties.composite&&(properties.cMap.builtInCMap&&!(properties.cMap instanceof _cmap.IdentityCMap)||"Adobe"===properties.cidSystemInfo.registry&&("GB1"===properties.cidSystemInfo.ordering||
|
|
1425
1428
|
"CNS1"===properties.cidSystemInfo.ordering||"Japan1"===properties.cidSystemInfo.ordering||"Korea1"===properties.cidSystemInfo.ordering))){var ordering=properties.cidSystemInfo.ordering;ordering=_primitives.Name.get("".concat(properties.cidSystemInfo.registry,"-").concat(ordering,"-UCS2"));return _cmap.CMapFactory.create({encoding:ordering,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(ucs2CMap){var toUnicode=[];properties.cMap.forEach(function(charcode,cid){if(65535<cid)throw new _util.FormatError("Max size of CID is 65,535");
|
|
1426
1429
|
(cid=ucs2CMap.lookup(cid))&&(toUnicode[charcode]=String.fromCharCode((cid.charCodeAt(0)<<8)+cid.charCodeAt(1)))});return new _fonts.ToUnicodeMap(toUnicode)})}return Promise.resolve(new _fonts.IdentityToUnicodeMap(properties.firstChar,properties.lastChar))},readToUnicode:function(toUnicode){return(0,_primitives.isName)(toUnicode)?_cmap.CMapFactory.create({encoding:toUnicode,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(cmap){return cmap instanceof _cmap.IdentityCMap?new _fonts.IdentityToUnicodeMap(0,
|
|
1427
|
-
65535):new _fonts.ToUnicodeMap(cmap.getMap())}):(0,_primitives.isStream)(toUnicode)?_cmap.CMapFactory.create({encoding:toUnicode,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(cmap){if(cmap instanceof _cmap.IdentityCMap)return new _fonts.IdentityToUnicodeMap(0,65535);var map=Array(cmap.length);cmap.forEach(function(charCode,token){for(var str=[],k=0;k<token.length;k+=2){var w1=token.charCodeAt(k)<<8|token.charCodeAt(k+
|
|
1428
|
-
8|token.charCodeAt(k+1);str.push(((w1&1023)<<10)+(w2&1023)+65536)}}map[charCode]=String.fromCodePoint.apply(String,str)});return new _fonts.ToUnicodeMap(map)}):Promise.resolve(null)},readCidToGidMap:function(glyphsData,toUnicode){for(var result=[],j=0,jj=glyphsData.length;j<jj;j++){var glyphID=glyphsData[j++]<<8|glyphsData[j],code=j>>1;if(0!==glyphID||toUnicode.has(code))result[code]=glyphID}return result},extractWidths:function(dict,
|
|
1429
|
-
0,glyphsVMetrics=[],ii,jj,widths;if(properties.composite){defaultWidth=dict.has("DW")?dict.get("DW"):1E3;if(widths=dict.get("W")){var i=0;for(ii=widths.length;i<ii;i++){descriptor=xref.fetchIfRef(widths[i++]);var code=xref.fetchIfRef(widths[i]);if(Array.isArray(code)){var j=0;for(jj=code.length;j<jj;j++)glyphsWidths[descriptor++]=xref.fetchIfRef(code[j])}else for(jj=xref.fetchIfRef(widths[++i]),j=descriptor;j<=code;j++)glyphsWidths[j]=
|
|
1430
|
-
|
|
1431
|
-
dict}}else if(i=properties.firstChar,widths=dict.get("Widths")){j=i;i=0;for(ii=widths.length;i<ii;i++)glyphsWidths[j++]=xref.fetchIfRef(widths[i]);defaultWidth=parseFloat(descriptor.get("MissingWidth"))||0}else xref=dict.get("BaseFont"),(0,_primitives.isName)(xref)&&(defaultWidth=this.getBaseFontMetrics(xref.name),glyphsWidths=this.buildCharCodeToWidth(defaultWidth.widths,properties),defaultWidth=defaultWidth.defaultWidth);xref=!0;dict=defaultWidth;for(var glyph in glyphsWidths)if(i=
|
|
1432
|
-
i;else if(dict!==i){xref=!1;break}xref&&(properties.flags|=_fonts.FontFlags.FixedPitch);properties.defaultWidth=defaultWidth;properties.widths=glyphsWidths;properties.defaultVMetrics=defaultVMetrics;properties.vmetrics=glyphsVMetrics},isSerifFont:function(baseFontName){baseFontName=baseFontName.split("-")[0];return baseFontName in(0,_standard_fonts.getSerifFonts)()||-1!==baseFontName.search(/serif/gi)},getBaseFontMetrics:function(name){var defaultWidth=0,widths=Object.create(null),
|
|
1433
|
-
(0,_standard_fonts.getStdFontMap)()[name]||name,Metrics=(0,_metrics.getMetrics)();lookupName in Metrics||(lookupName=this.isSerifFont(name)?"Times-Roman":"Helvetica");name=Metrics[lookupName];(0,_util.isNum)(name)?(defaultWidth=name,monospace=!0):widths=name();return{defaultWidth:defaultWidth,monospace:monospace,widths:widths}},buildCharCodeToWidth:function(widthsByGlyphName,properties){var widths=Object.create(null),differences=properties.differences;properties=properties.defaultEncoding;
|
|
1434
|
-
0;256>charCode;charCode++)charCode in differences&&widthsByGlyphName[differences[charCode]]?widths[charCode]=widthsByGlyphName[differences[charCode]]:charCode in properties&&widthsByGlyphName[properties[charCode]]&&(widths[charCode]=widthsByGlyphName[properties[charCode]]);return widths},preEvaluateFont:function(dict){var baseDict=dict,type=dict.get("Subtype");if(!(0,_primitives.isName)(type))throw new _util.FormatError("invalid font Subtype");var composite=!1;if("Type0"===type.name){dict=
|
|
1435
|
-
if(!dict)throw new _util.FormatError("Descendant fonts are not specified");dict=Array.isArray(dict)?this.xref.fetchIfRef(dict[0]):dict;type=dict.get("Subtype");if(!(0,_primitives.isName)(type))throw new _util.FormatError("invalid font Subtype");composite=!0}var descriptor=dict.get("FontDescriptor");if(descriptor){var hash=new _murmurhash.MurmurHash3_64;var uint8array=baseDict.getRaw("Encoding");if((0,_primitives.isName)(uint8array))hash.update(uint8array.name);else if((0,_primitives.isRef)(uint8array))hash.update(uint8array.toString());
|
|
1436
|
-
else if((0,_primitives.isDict)(uint8array))for(var keys=uint8array.getKeys(),i=0,ii=keys.length;i<ii;i++){var entry=uint8array.getRaw(keys[i]);if((0,_primitives.isName)(entry))hash.update(entry.name);else if((0,_primitives.isRef)(entry))hash.update(entry.toString());else if(Array.isArray(entry)){for(var diffLength=entry.length,diffBuf=Array(diffLength),j=0;j<diffLength;j++){var diffEntry=entry[j];if((0,_primitives.isName)(diffEntry))diffBuf[j]=diffEntry.name;else if((0,_util.isNum)(diffEntry)||(0,
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
numArgs:
|
|
1458
|
-
numArgs:
|
|
1459
|
-
t.
|
|
1460
|
-
t.
|
|
1461
|
-
|
|
1462
|
-
t.
|
|
1463
|
-
t.
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1430
|
+
65535):new _fonts.ToUnicodeMap(cmap.getMap())}):(0,_primitives.isStream)(toUnicode)?_cmap.CMapFactory.create({encoding:toUnicode,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(cmap){if(cmap instanceof _cmap.IdentityCMap)return new _fonts.IdentityToUnicodeMap(0,65535);var map=Array(cmap.length);cmap.forEach(function(charCode,token){if("number"===typeof token)map[charCode]=String.fromCodePoint(token);else{for(var str=[],k=0;k<token.length;k+=2){var w1=token.charCodeAt(k)<<8|token.charCodeAt(k+
|
|
1431
|
+
1);if(55296!==(w1&63488))str.push(w1);else{k+=2;var w2=token.charCodeAt(k)<<8|token.charCodeAt(k+1);str.push(((w1&1023)<<10)+(w2&1023)+65536)}}map[charCode]=String.fromCodePoint.apply(String,str)}});return new _fonts.ToUnicodeMap(map)}):Promise.resolve(null)},readCidToGidMap:function(glyphsData,toUnicode){for(var result=[],j=0,jj=glyphsData.length;j<jj;j++){var glyphID=glyphsData[j++]<<8|glyphsData[j],code=j>>1;if(0!==glyphID||toUnicode.has(code))result[code]=glyphID}return result},extractWidths:function(dict,
|
|
1432
|
+
descriptor,properties){var xref=this.xref,glyphsWidths=[],defaultWidth=0,glyphsVMetrics=[],ii,jj,widths;if(properties.composite){defaultWidth=dict.has("DW")?dict.get("DW"):1E3;if(widths=dict.get("W")){var i=0;for(ii=widths.length;i<ii;i++){descriptor=xref.fetchIfRef(widths[i++]);var code=xref.fetchIfRef(widths[i]);if(Array.isArray(code)){var j=0;for(jj=code.length;j<jj;j++)glyphsWidths[descriptor++]=xref.fetchIfRef(code[j])}else for(jj=xref.fetchIfRef(widths[++i]),j=descriptor;j<=code;j++)glyphsWidths[j]=
|
|
1433
|
+
jj}}if(properties.vertical){widths=dict.getArray("DW2")||[880,-1E3];var defaultVMetrics=[widths[1],.5*defaultWidth,widths[0]];if(widths=dict.get("W2"))for(i=0,ii=widths.length;i<ii;i++)if(descriptor=xref.fetchIfRef(widths[i++]),code=xref.fetchIfRef(widths[i]),Array.isArray(code))for(j=0,jj=code.length;j<jj;j++)glyphsVMetrics[descriptor++]=[xref.fetchIfRef(code[j++]),xref.fetchIfRef(code[j++]),xref.fetchIfRef(code[j])];else for(dict=[xref.fetchIfRef(widths[++i]),xref.fetchIfRef(widths[++i]),xref.fetchIfRef(widths[++i])],
|
|
1434
|
+
j=descriptor;j<=code;j++)glyphsVMetrics[j]=dict}}else if(i=properties.firstChar,widths=dict.get("Widths")){j=i;i=0;for(ii=widths.length;i<ii;i++)glyphsWidths[j++]=xref.fetchIfRef(widths[i]);defaultWidth=parseFloat(descriptor.get("MissingWidth"))||0}else xref=dict.get("BaseFont"),(0,_primitives.isName)(xref)&&(defaultWidth=this.getBaseFontMetrics(xref.name),glyphsWidths=this.buildCharCodeToWidth(defaultWidth.widths,properties),defaultWidth=defaultWidth.defaultWidth);xref=!0;dict=defaultWidth;for(var glyph in glyphsWidths)if(i=
|
|
1435
|
+
glyphsWidths[glyph])if(!dict)dict=i;else if(dict!==i){xref=!1;break}xref&&(properties.flags|=_fonts.FontFlags.FixedPitch);properties.defaultWidth=defaultWidth;properties.widths=glyphsWidths;properties.defaultVMetrics=defaultVMetrics;properties.vmetrics=glyphsVMetrics},isSerifFont:function(baseFontName){baseFontName=baseFontName.split("-")[0];return baseFontName in(0,_standard_fonts.getSerifFonts)()||-1!==baseFontName.search(/serif/gi)},getBaseFontMetrics:function(name){var defaultWidth=0,widths=Object.create(null),
|
|
1436
|
+
monospace=!1,lookupName=(0,_standard_fonts.getStdFontMap)()[name]||name,Metrics=(0,_metrics.getMetrics)();lookupName in Metrics||(lookupName=this.isSerifFont(name)?"Times-Roman":"Helvetica");name=Metrics[lookupName];(0,_util.isNum)(name)?(defaultWidth=name,monospace=!0):widths=name();return{defaultWidth:defaultWidth,monospace:monospace,widths:widths}},buildCharCodeToWidth:function(widthsByGlyphName,properties){var widths=Object.create(null),differences=properties.differences;properties=properties.defaultEncoding;
|
|
1437
|
+
for(var charCode=0;256>charCode;charCode++)charCode in differences&&widthsByGlyphName[differences[charCode]]?widths[charCode]=widthsByGlyphName[differences[charCode]]:charCode in properties&&widthsByGlyphName[properties[charCode]]&&(widths[charCode]=widthsByGlyphName[properties[charCode]]);return widths},preEvaluateFont:function(dict){var baseDict=dict,type=dict.get("Subtype");if(!(0,_primitives.isName)(type))throw new _util.FormatError("invalid font Subtype");var composite=!1;if("Type0"===type.name){dict=
|
|
1438
|
+
dict.get("DescendantFonts");if(!dict)throw new _util.FormatError("Descendant fonts are not specified");dict=Array.isArray(dict)?this.xref.fetchIfRef(dict[0]):dict;type=dict.get("Subtype");if(!(0,_primitives.isName)(type))throw new _util.FormatError("invalid font Subtype");composite=!0}var descriptor=dict.get("FontDescriptor");if(descriptor){var hash=new _murmurhash.MurmurHash3_64;var uint8array=baseDict.getRaw("Encoding");if((0,_primitives.isName)(uint8array))hash.update(uint8array.name);else if((0,_primitives.isRef)(uint8array))hash.update(uint8array.toString());
|
|
1439
|
+
else if((0,_primitives.isDict)(uint8array))for(var keys=uint8array.getKeys(),i=0,ii=keys.length;i<ii;i++){var entry=uint8array.getRaw(keys[i]);if((0,_primitives.isName)(entry))hash.update(entry.name);else if((0,_primitives.isRef)(entry))hash.update(entry.toString());else if(Array.isArray(entry)){for(var diffLength=entry.length,diffBuf=Array(diffLength),j=0;j<diffLength;j++){var diffEntry=entry[j];if((0,_primitives.isName)(diffEntry))diffBuf[j]=diffEntry.name;else if((0,_util.isNum)(diffEntry)||(0,_primitives.isRef)(diffEntry))diffBuf[j]=
|
|
1440
|
+
diffEntry.toString()}hash.update(diffBuf.join())}}uint8array=dict.get("FirstChar")||0;keys=dict.get("LastChar")||(composite?65535:255);hash.update("".concat(uint8array,"-").concat(keys));uint8array=dict.get("ToUnicode")||baseDict.get("ToUnicode");(0,_primitives.isStream)(uint8array)?(uint8array=uint8array.str||uint8array,uint8array=uint8array.buffer?new Uint8Array(uint8array.buffer.buffer,0,uint8array.bufferLength):new Uint8Array(uint8array.bytes.buffer,uint8array.start,uint8array.end-uint8array.start),
|
|
1441
|
+
hash.update(uint8array)):(0,_primitives.isName)(uint8array)&&hash.update(uint8array.name);if(uint8array=dict.get("Widths")||baseDict.get("Widths"))uint8array=new Uint8Array((new Uint32Array(uint8array)).buffer),hash.update(uint8array)}return{descriptor:descriptor,dict:dict,baseDict:baseDict,composite:composite,type:type.name,hash:hash?hash.hexdigest():""}},translateFont:function(preEvaluatedFont){var _this11=this,baseDict=preEvaluatedFont.baseDict,dict=preEvaluatedFont.dict,composite=preEvaluatedFont.composite,
|
|
1442
|
+
descriptor=preEvaluatedFont.descriptor,type=preEvaluatedFont.type;preEvaluatedFont=composite?65535:255;if(!descriptor)if("Type3"===type)descriptor=new _primitives.Dict(null),descriptor.set("FontName",_primitives.Name.get(type)),descriptor.set("FontBBox",dict.getArray("FontBBox"));else{var baseFontName=dict.get("BaseFont");if(!(0,_primitives.isName)(baseFontName))throw new _util.FormatError("Base font is not specified");baseFontName=baseFontName.name.replace(/[,_]/g,"-");var metrics=this.getBaseFontMetrics(baseFontName);
|
|
1443
|
+
composite=baseFontName.split("-")[0];composite=(this.isSerifFont(composite)?_fonts.FontFlags.Serif:0)|(metrics.monospace?_fonts.FontFlags.FixedPitch:0)|((0,_standard_fonts.getSymbolsFonts)()[composite]?_fonts.FontFlags.Symbolic:_fonts.FontFlags.Nonsymbolic);var properties$jscomp$0={type:type,name:baseFontName,widths:metrics.widths,defaultWidth:metrics.defaultWidth,flags:composite,firstChar:0,lastChar:preEvaluatedFont};return this.extractDataStructures(dict,dict,properties$jscomp$0).then(function(properties){properties.widths=
|
|
1444
|
+
_this11.buildCharCodeToWidth(metrics.widths,properties);return new _fonts.Font(baseFontName,null,properties)})}var firstChar=dict.get("FirstChar")||0,lastChar=dict.get("LastChar")||preEvaluatedFont,fontName=descriptor.get("FontName"),baseFont=dict.get("BaseFont");(0,_util.isString)(fontName)&&(fontName=_primitives.Name.get(fontName));(0,_util.isString)(baseFont)&&(baseFont=_primitives.Name.get(baseFont));if("Type3"!==type){var fontNameStr=fontName&&fontName.name,baseFontStr=baseFont&&baseFont.name;
|
|
1445
|
+
fontNameStr!==baseFontStr&&((0,_util.info)("The FontDescriptor's FontName is \"".concat(fontNameStr,'" but ')+"should be the same as the Font's BaseFont \"".concat(baseFontStr,'".')),fontNameStr&&baseFontStr&&baseFontStr.startsWith(fontNameStr)&&(fontName=baseFont))}fontName=fontName||baseFont;if(!(0,_primitives.isName)(fontName))throw new _util.FormatError("invalid font name");var fontFile=descriptor.get("FontFile","FontFile2","FontFile3");if(fontFile&&fontFile.dict){var subtype=fontFile.dict.get("Subtype");
|
|
1446
|
+
subtype&&(subtype=subtype.name);var length1=fontFile.dict.get("Length1"),length2=fontFile.dict.get("Length2"),length3=fontFile.dict.get("Length3")}properties$jscomp$0={type:type,name:fontName.name,subtype:subtype,file:fontFile,length1:length1,length2:length2,length3:length3,loadedName:baseDict.loadedName,composite:composite,wideChars:composite,fixedPitch:!1,fontMatrix:dict.getArray("FontMatrix")||_util.FONT_IDENTITY_MATRIX,firstChar:firstChar||0,lastChar:lastChar||preEvaluatedFont,bbox:descriptor.getArray("FontBBox"),
|
|
1447
|
+
ascent:descriptor.get("Ascent"),descent:descriptor.get("Descent"),xHeight:descriptor.get("XHeight"),capHeight:descriptor.get("CapHeight"),flags:descriptor.get("Flags"),italicAngle:descriptor.get("ItalicAngle"),isType3Font:!1};composite?(preEvaluatedFont=baseDict.get("Encoding"),(0,_primitives.isName)(preEvaluatedFont)&&(properties$jscomp$0.cidEncoding=preEvaluatedFont.name),preEvaluatedFont=_cmap.CMapFactory.create({encoding:preEvaluatedFont,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then(function(cMap){properties$jscomp$0.cMap=
|
|
1448
|
+
cMap;properties$jscomp$0.vertical=properties$jscomp$0.cMap.vertical})):preEvaluatedFont=Promise.resolve(void 0);return preEvaluatedFont.then(function(){return _this11.extractDataStructures(dict,baseDict,properties$jscomp$0)}).then(function(properties){_this11.extractWidths(dict,descriptor,properties);"Type3"===type&&(properties.isType3Font=!0);return new _fonts.Font(fontName.name,fontFile,properties)})}};PartialEvaluator.buildFontPaths=function(font,glyphs,handler){function buildPath(fontChar){font.renderer.hasBuiltPath(fontChar)||
|
|
1449
|
+
handler.send("commonobj",["".concat(font.loadedName,"_path_").concat(fontChar),"FontPath",font.renderer.getPathJs(fontChar)])}var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _iterator=glyphs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var glyph=_step.value;buildPath(glyph.fontChar);var accent=glyph.accent;accent&&accent.fontChar&&buildPath(accent.fontChar)}}catch(err){_didIteratorError=!0,
|
|
1450
|
+
_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&null!=_iterator["return"])_iterator["return"]()}finally{if(_didIteratorError)throw _iteratorError;}}};return PartialEvaluator}();exports.PartialEvaluator=PartialEvaluator;var TranslatedFont=function(){function TranslatedFont(loadedName,font,dict){this.loadedName=loadedName;this.font=font;this.dict=dict;this.type3Loaded=null;this.sent=!1}TranslatedFont.prototype={send:function(handler){this.sent||(this.sent=!0,handler.send("commonobj",[this.loadedName,
|
|
1451
|
+
"Font",this.font.exportData()]))},fallback:function(handler){this.font.data&&(this.font.disableFontFace=!0,PartialEvaluator.buildFontPaths(this.font,this.font.glyphCacheValues,handler))},loadType3Data:function(evaluator,resources,parentOperatorList,task){if(!this.font.isType3Font)throw Error("Must be a Type3 font.");if(this.type3Loaded)return this.type3Loaded;var type3Options=Object.create(evaluator.options);type3Options.ignoreErrors=!1;type3Options.nativeImageDecoderSupport=_util.NativeImageDecoding.NONE;
|
|
1452
|
+
var type3Evaluator=evaluator.clone(type3Options);type3Evaluator.parsingType3Font=!0;var translatedFont=this.font,loadCharProcsPromise=Promise.resolve(),charProcs=this.dict.get("CharProcs"),fontResources=this.dict.get("Resources")||resources,charProcKeys=charProcs.getKeys(),charProcOperatorList=Object.create(null);evaluator=function(){var key=charProcKeys[i];loadCharProcsPromise=loadCharProcsPromise.then(function(){var glyphStream=charProcs.get(key),operatorList=new _operator_list.OperatorList;return type3Evaluator.getOperatorList({stream:glyphStream,
|
|
1453
|
+
task:task,resources:fontResources,operatorList:operatorList}).then(function(){charProcOperatorList[key]=operatorList.getIR();parentOperatorList.addDependencies(operatorList.dependencies)})["catch"](function(reason){(0,_util.warn)('Type3 font resource "'.concat(key,'" is not available.'));reason=new _operator_list.OperatorList;charProcOperatorList[key]=reason.getIR()})})};var i=0;for(resources=charProcKeys.length;i<resources;++i)evaluator();return this.type3Loaded=loadCharProcsPromise.then(function(){translatedFont.charProcOperatorList=
|
|
1454
|
+
charProcOperatorList})}};return TranslatedFont}(),StateManager=function(){function StateManager(initialState){this.state=initialState;this.stateStack=[]}StateManager.prototype={save:function(){var old=this.state;this.stateStack.push(this.state);this.state=old.clone()},restore:function(){var prev=this.stateStack.pop();prev&&(this.state=prev)},transform:function(args){this.state.ctm=_util.Util.transform(this.state.ctm,args)}};return StateManager}(),TextState=function(){function TextState(){this.ctm=
|
|
1455
|
+
new Float32Array(_util.IDENTITY_MATRIX);this.fontName=null;this.fontSize=0;this.font=null;this.fontMatrix=_util.FONT_IDENTITY_MATRIX;this.textMatrix=_util.IDENTITY_MATRIX.slice();this.textLineMatrix=_util.IDENTITY_MATRIX.slice();this.leading=this.wordSpacing=this.charSpacing=0;this.textHScale=1;this.textRise=0}TextState.prototype={setTextMatrix:function(a,b,c,d,e,f){var m=this.textMatrix;m[0]=a;m[1]=b;m[2]=c;m[3]=d;m[4]=e;m[5]=f},setTextLineMatrix:function(a,b,c,d,e,f){var m=this.textLineMatrix;m[0]=
|
|
1456
|
+
a;m[1]=b;m[2]=c;m[3]=d;m[4]=e;m[5]=f},translateTextMatrix:function(x,y){var m=this.textMatrix;m[4]=m[0]*x+m[2]*y+m[4];m[5]=m[1]*x+m[3]*y+m[5]},translateTextLineMatrix:function(x,y){var m=this.textLineMatrix;m[4]=m[0]*x+m[2]*y+m[4];m[5]=m[1]*x+m[3]*y+m[5]},calcTextLineMatrixAdvance:function(a,b,c,d,e,f){var font=this.font;if(!font)return null;var m=this.textLineMatrix;if(a!==m[0]||b!==m[1]||c!==m[2]||d!==m[3])return null;e-=m[4];f-=m[5];if(font.vertical&&0!==e||!font.vertical&&0!==f)return null;m=
|
|
1457
|
+
a*d-b*c;font.vertical?(c=-f*c/m,a=f*a/m):(c=e*d/m,a=-e*b/m);return{width:c,height:a,value:font.vertical?a:c}},calcRenderMatrix:function(ctm){return _util.Util.transform(ctm,_util.Util.transform(this.textMatrix,[this.fontSize*this.textHScale,0,0,this.fontSize,0,this.textRise]))},carriageReturn:function(){this.translateTextLineMatrix(0,-this.leading);this.textMatrix=this.textLineMatrix.slice()},clone:function(){var clone=Object.create(this);clone.textMatrix=this.textMatrix.slice();clone.textLineMatrix=
|
|
1458
|
+
this.textLineMatrix.slice();clone.fontMatrix=this.fontMatrix.slice();return clone}};return TextState}(),EvalState=function(){function EvalState(){this.ctm=new Float32Array(_util.IDENTITY_MATRIX);this.font=null;this.textRenderingMode=_util.TextRenderingMode.FILL;this.strokeColorSpace=this.fillColorSpace=_colorspace.ColorSpace.singletons.gray}EvalState.prototype={clone:function(){return Object.create(this)}};return EvalState}(),EvaluatorPreprocessor=function(){function EvaluatorPreprocessor(stream,
|
|
1459
|
+
xref,stateManager){this.opMap=getOPMap();this.parser=new _parser.Parser({lexer:new _parser.Lexer(stream,this.opMap),xref:xref});this.stateManager=stateManager;this.nonProcessedArgs=[];this._numInvalidPathOPS=0}var getOPMap=(0,_core_utils.getLookupTableFactory)(function(t){t.w={id:_util.OPS.setLineWidth,numArgs:1,variableArgs:!1};t.J={id:_util.OPS.setLineCap,numArgs:1,variableArgs:!1};t.j={id:_util.OPS.setLineJoin,numArgs:1,variableArgs:!1};t.M={id:_util.OPS.setMiterLimit,numArgs:1,variableArgs:!1};
|
|
1460
|
+
t.d={id:_util.OPS.setDash,numArgs:2,variableArgs:!1};t.ri={id:_util.OPS.setRenderingIntent,numArgs:1,variableArgs:!1};t.i={id:_util.OPS.setFlatness,numArgs:1,variableArgs:!1};t.gs={id:_util.OPS.setGState,numArgs:1,variableArgs:!1};t.q={id:_util.OPS.save,numArgs:0,variableArgs:!1};t.Q={id:_util.OPS.restore,numArgs:0,variableArgs:!1};t.cm={id:_util.OPS.transform,numArgs:6,variableArgs:!1};t.m={id:_util.OPS.moveTo,numArgs:2,variableArgs:!1};t.l={id:_util.OPS.lineTo,numArgs:2,variableArgs:!1};t.c={id:_util.OPS.curveTo,
|
|
1461
|
+
numArgs:6,variableArgs:!1};t.v={id:_util.OPS.curveTo2,numArgs:4,variableArgs:!1};t.y={id:_util.OPS.curveTo3,numArgs:4,variableArgs:!1};t.h={id:_util.OPS.closePath,numArgs:0,variableArgs:!1};t.re={id:_util.OPS.rectangle,numArgs:4,variableArgs:!1};t.S={id:_util.OPS.stroke,numArgs:0,variableArgs:!1};t.s={id:_util.OPS.closeStroke,numArgs:0,variableArgs:!1};t.f={id:_util.OPS.fill,numArgs:0,variableArgs:!1};t.F={id:_util.OPS.fill,numArgs:0,variableArgs:!1};t["f*"]={id:_util.OPS.eoFill,numArgs:0,variableArgs:!1};
|
|
1462
|
+
t.B={id:_util.OPS.fillStroke,numArgs:0,variableArgs:!1};t["B*"]={id:_util.OPS.eoFillStroke,numArgs:0,variableArgs:!1};t.b={id:_util.OPS.closeFillStroke,numArgs:0,variableArgs:!1};t["b*"]={id:_util.OPS.closeEOFillStroke,numArgs:0,variableArgs:!1};t.n={id:_util.OPS.endPath,numArgs:0,variableArgs:!1};t.W={id:_util.OPS.clip,numArgs:0,variableArgs:!1};t["W*"]={id:_util.OPS.eoClip,numArgs:0,variableArgs:!1};t.BT={id:_util.OPS.beginText,numArgs:0,variableArgs:!1};t.ET={id:_util.OPS.endText,numArgs:0,variableArgs:!1};
|
|
1463
|
+
t.Tc={id:_util.OPS.setCharSpacing,numArgs:1,variableArgs:!1};t.Tw={id:_util.OPS.setWordSpacing,numArgs:1,variableArgs:!1};t.Tz={id:_util.OPS.setHScale,numArgs:1,variableArgs:!1};t.TL={id:_util.OPS.setLeading,numArgs:1,variableArgs:!1};t.Tf={id:_util.OPS.setFont,numArgs:2,variableArgs:!1};t.Tr={id:_util.OPS.setTextRenderingMode,numArgs:1,variableArgs:!1};t.Ts={id:_util.OPS.setTextRise,numArgs:1,variableArgs:!1};t.Td={id:_util.OPS.moveText,numArgs:2,variableArgs:!1};t.TD={id:_util.OPS.setLeadingMoveText,
|
|
1464
|
+
numArgs:2,variableArgs:!1};t.Tm={id:_util.OPS.setTextMatrix,numArgs:6,variableArgs:!1};t["T*"]={id:_util.OPS.nextLine,numArgs:0,variableArgs:!1};t.Tj={id:_util.OPS.showText,numArgs:1,variableArgs:!1};t.TJ={id:_util.OPS.showSpacedText,numArgs:1,variableArgs:!1};t["'"]={id:_util.OPS.nextLineShowText,numArgs:1,variableArgs:!1};t['"']={id:_util.OPS.nextLineSetSpacingShowText,numArgs:3,variableArgs:!1};t.d0={id:_util.OPS.setCharWidth,numArgs:2,variableArgs:!1};t.d1={id:_util.OPS.setCharWidthAndBounds,
|
|
1465
|
+
numArgs:6,variableArgs:!1};t.CS={id:_util.OPS.setStrokeColorSpace,numArgs:1,variableArgs:!1};t.cs={id:_util.OPS.setFillColorSpace,numArgs:1,variableArgs:!1};t.SC={id:_util.OPS.setStrokeColor,numArgs:4,variableArgs:!0};t.SCN={id:_util.OPS.setStrokeColorN,numArgs:33,variableArgs:!0};t.sc={id:_util.OPS.setFillColor,numArgs:4,variableArgs:!0};t.scn={id:_util.OPS.setFillColorN,numArgs:33,variableArgs:!0};t.G={id:_util.OPS.setStrokeGray,numArgs:1,variableArgs:!1};t.g={id:_util.OPS.setFillGray,numArgs:1,
|
|
1466
|
+
variableArgs:!1};t.RG={id:_util.OPS.setStrokeRGBColor,numArgs:3,variableArgs:!1};t.rg={id:_util.OPS.setFillRGBColor,numArgs:3,variableArgs:!1};t.K={id:_util.OPS.setStrokeCMYKColor,numArgs:4,variableArgs:!1};t.k={id:_util.OPS.setFillCMYKColor,numArgs:4,variableArgs:!1};t.sh={id:_util.OPS.shadingFill,numArgs:1,variableArgs:!1};t.BI={id:_util.OPS.beginInlineImage,numArgs:0,variableArgs:!1};t.ID={id:_util.OPS.beginImageData,numArgs:0,variableArgs:!1};t.EI={id:_util.OPS.endInlineImage,numArgs:1,variableArgs:!1};
|
|
1467
|
+
t.Do={id:_util.OPS.paintXObject,numArgs:1,variableArgs:!1};t.MP={id:_util.OPS.markPoint,numArgs:1,variableArgs:!1};t.DP={id:_util.OPS.markPointProps,numArgs:2,variableArgs:!1};t.BMC={id:_util.OPS.beginMarkedContent,numArgs:1,variableArgs:!1};t.BDC={id:_util.OPS.beginMarkedContentProps,numArgs:2,variableArgs:!1};t.EMC={id:_util.OPS.endMarkedContent,numArgs:0,variableArgs:!1};t.BX={id:_util.OPS.beginCompat,numArgs:0,variableArgs:!1};t.EX={id:_util.OPS.endCompat,numArgs:0,variableArgs:!1};t.BM=null;
|
|
1468
|
+
t.BD=null;t["true"]=null;t.fa=null;t.fal=null;t.fals=null;t["false"]=null;t.nu=null;t.nul=null;t["null"]=null});EvaluatorPreprocessor.prototype={get savedStatesDepth(){return this.stateManager.stateStack.length},read:function(operation){for(var args=operation.args;;){var obj=this.parser.getObj();if(obj instanceof _primitives.Cmd){var cmd=obj.cmd,opSpec=this.opMap[cmd];if(!opSpec){(0,_util.warn)('Unknown command "'.concat(cmd,'".'));continue}obj=opSpec.id;var numArgs=opSpec.numArgs,argsLength=null!==
|
|
1469
|
+
args?args.length:0;if(opSpec.variableArgs)argsLength>numArgs&&(0,_util.info)("Command ".concat(cmd,": expected [0, ").concat(numArgs,"] args, ")+"but received ".concat(argsLength," args."));else{if(argsLength!==numArgs){for(opSpec=this.nonProcessedArgs;argsLength>numArgs;)opSpec.push(args.shift()),argsLength--;for(;argsLength<numArgs&&0!==opSpec.length;)null===args&&(args=[]),args.unshift(opSpec.pop()),argsLength++}if(argsLength<numArgs){cmd="command ".concat(cmd,": expected ").concat(numArgs," args, ")+
|
|
1470
|
+
"but received ".concat(argsLength," args.");if(obj>=_util.OPS.moveTo&&obj<=_util.OPS.endPath&&20<++this._numInvalidPathOPS)throw new _util.FormatError("Invalid ".concat(cmd));(0,_util.warn)("Skipping ".concat(cmd));null!==args&&(args.length=0);continue}}this.preprocessCommand(obj,args);operation.fn=obj;operation.args=args;return!0}if(obj===_primitives.EOF)return!1;if(null!==obj&&(null===args&&(args=[]),args.push(obj),33<args.length))throw new _util.FormatError("Too many arguments");}},preprocessCommand:function(fn,
|
|
1471
|
+
args){switch(fn|0){case _util.OPS.save:this.stateManager.save();break;case _util.OPS.restore:this.stateManager.restore();break;case _util.OPS.transform:this.stateManager.transform(args)}}};return EvaluatorPreprocessor}()},function(module,exports,__w_pdfjs_require__){function _typeof(obj$jscomp$0){_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(obj){return _typeof2(obj)}:function(obj){return obj&&"function"===typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?
|
|
1472
|
+
"symbol":_typeof2(obj)};return _typeof(obj$jscomp$0)}function _getPrototypeOf(o$jscomp$0){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o$jscomp$0)}function _inherits(subClass,superClass){if("function"!==typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,
|
|
1473
|
+
writable:!0,configurable:!0}});superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o$jscomp$0,p$jscomp$0){_setPrototypeOf=Object.setPrototypeOf||function(o,p){o.__proto__=p;return o};return _setPrototypeOf(o$jscomp$0,p$jscomp$0)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=
|
|
1474
|
+
descriptor.enumerable||!1;descriptor.configurable=!0;"value"in descriptor&&(descriptor.writable=!0);Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){protoProps&&_defineProperties(Constructor.prototype,protoProps);staticProps&&_defineProperties(Constructor,staticProps);return Constructor}Object.defineProperty(exports,"__esModule",{value:!0});exports.CMapFactory=exports.IdentityCMap=exports.CMap=void 0;var _util=__w_pdfjs_require__(5),
|
|
1475
|
+
_primitives=__w_pdfjs_require__(188),_parser=__w_pdfjs_require__(194),_core_utils=__w_pdfjs_require__(191),_stream=__w_pdfjs_require__(195),BUILT_IN_CMAPS="Adobe-GB1-UCS2 Adobe-CNS1-UCS2 Adobe-Japan1-UCS2 Adobe-Korea1-UCS2 78-EUC-H 78-EUC-V 78-H 78-RKSJ-H 78-RKSJ-V 78-V 78ms-RKSJ-H 78ms-RKSJ-V 83pv-RKSJ-H 90ms-RKSJ-H 90ms-RKSJ-V 90msp-RKSJ-H 90msp-RKSJ-V 90pv-RKSJ-H 90pv-RKSJ-V Add-H Add-RKSJ-H Add-RKSJ-V Add-V Adobe-CNS1-0 Adobe-CNS1-1 Adobe-CNS1-2 Adobe-CNS1-3 Adobe-CNS1-4 Adobe-CNS1-5 Adobe-CNS1-6 Adobe-GB1-0 Adobe-GB1-1 Adobe-GB1-2 Adobe-GB1-3 Adobe-GB1-4 Adobe-GB1-5 Adobe-Japan1-0 Adobe-Japan1-1 Adobe-Japan1-2 Adobe-Japan1-3 Adobe-Japan1-4 Adobe-Japan1-5 Adobe-Japan1-6 Adobe-Korea1-0 Adobe-Korea1-1 Adobe-Korea1-2 B5-H B5-V B5pc-H B5pc-V CNS-EUC-H CNS-EUC-V CNS1-H CNS1-V CNS2-H CNS2-V ETHK-B5-H ETHK-B5-V ETen-B5-H ETen-B5-V ETenms-B5-H ETenms-B5-V EUC-H EUC-V Ext-H Ext-RKSJ-H Ext-RKSJ-V Ext-V GB-EUC-H GB-EUC-V GB-H GB-V GBK-EUC-H GBK-EUC-V GBK2K-H GBK2K-V GBKp-EUC-H GBKp-EUC-V GBT-EUC-H GBT-EUC-V GBT-H GBT-V GBTpc-EUC-H GBTpc-EUC-V GBpc-EUC-H GBpc-EUC-V H HKdla-B5-H HKdla-B5-V HKdlb-B5-H HKdlb-B5-V HKgccs-B5-H HKgccs-B5-V HKm314-B5-H HKm314-B5-V HKm471-B5-H HKm471-B5-V HKscs-B5-H HKscs-B5-V Hankaku Hiragana KSC-EUC-H KSC-EUC-V KSC-H KSC-Johab-H KSC-Johab-V KSC-V KSCms-UHC-H KSCms-UHC-HW-H KSCms-UHC-HW-V KSCms-UHC-V KSCpc-EUC-H KSCpc-EUC-V Katakana NWP-H NWP-V RKSJ-H RKSJ-V Roman UniCNS-UCS2-H UniCNS-UCS2-V UniCNS-UTF16-H UniCNS-UTF16-V UniCNS-UTF32-H UniCNS-UTF32-V UniCNS-UTF8-H UniCNS-UTF8-V UniGB-UCS2-H UniGB-UCS2-V UniGB-UTF16-H UniGB-UTF16-V UniGB-UTF32-H UniGB-UTF32-V UniGB-UTF8-H UniGB-UTF8-V UniJIS-UCS2-H UniJIS-UCS2-HW-H UniJIS-UCS2-HW-V UniJIS-UCS2-V UniJIS-UTF16-H UniJIS-UTF16-V UniJIS-UTF32-H UniJIS-UTF32-V UniJIS-UTF8-H UniJIS-UTF8-V UniJIS2004-UTF16-H UniJIS2004-UTF16-V UniJIS2004-UTF32-H UniJIS2004-UTF32-V UniJIS2004-UTF8-H UniJIS2004-UTF8-V UniJISPro-UCS2-HW-V UniJISPro-UCS2-V UniJISPro-UTF8-V UniJISX0213-UTF32-H UniJISX0213-UTF32-V UniJISX02132004-UTF32-H UniJISX02132004-UTF32-V UniKS-UCS2-H UniKS-UCS2-V UniKS-UTF16-H UniKS-UTF16-V UniKS-UTF32-H UniKS-UTF32-V UniKS-UTF8-H UniKS-UTF8-V V WP-Symbol".split(" "),
|
|
1473
1476
|
CMap=function(){function CMap(){var builtInCMap=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1;_classCallCheck(this,CMap);this.codespaceRanges=[[],[],[],[]];this.numCodespaceRanges=0;this._map=[];this.name="";this.vertical=!1;this.useCMap=null;this.builtInCMap=builtInCMap}_createClass(CMap,[{key:"addCodespaceRange",value:function(n,low,high){this.codespaceRanges[n-1].push(low,high);this.numCodespaceRanges++}},{key:"mapCidRange",value:function(low,high,dstLow){for(;low<=high;)this._map[low++]=
|
|
1474
1477
|
dstLow++}},{key:"mapBfRange",value:function(low,high,dstLow){for(var lastByte=dstLow.length-1;low<=high;)this._map[low++]=dstLow,dstLow=dstLow.substring(0,lastByte)+String.fromCharCode(dstLow.charCodeAt(lastByte)+1)}},{key:"mapBfRangeToArray",value:function(low,high,array){for(var i=0,ii=array.length;low<=high&&i<ii;)this._map[low]=array[i++],++low}},{key:"mapOne",value:function(src,dst){this._map[src]=dst}},{key:"lookup",value:function(code){return this._map[code]}},{key:"contains",value:function(code){return void 0!==
|
|
1475
1478
|
this._map[code]}},{key:"forEach",value:function(callback){var map=this._map,length=map.length;if(65536>=length)for(var i=0;i<length;i++)void 0!==map[i]&&callback(i,map[i]);else for(i in map)callback(i,map[i])}},{key:"charCodeOf",value:function(value){var map=this._map;if(65536>=map.length)return map.indexOf(value);for(var charCode in map)if(map[charCode]===value)return charCode|0;return-1}},{key:"getMap",value:function(){return this._map}},{key:"readCharCode",value:function(str,offset,out){for(var c=
|
|
@@ -1480,15 +1483,15 @@ _inherits(IdentityCMap,_CMap);_createClass(IdentityCMap,[{key:"mapCidRange",valu
|
|
|
1480
1483
|
return IdentityCMap}(CMap);exports.IdentityCMap=IdentityCMap;var BinaryCMapReader=function(){function hexToInt(a,size){for(var n=0,i=0;i<=size;i++)n=n<<8|a[i];return n>>>0}function hexToStr(a,size){return 1===size?String.fromCharCode(a[0],a[1]):3===size?String.fromCharCode(a[0],a[1],a[2],a[3]):String.fromCharCode.apply(null,a.subarray(0,size+1))}function addHex(a,b,size){for(var c=0;0<=size;size--)c+=a[size]+b[size],a[size]=c&255,c>>=8}function incHex(a,size){for(var c=1;0<=size&&0<c;size--)c+=a[size],
|
|
1481
1484
|
a[size]=c&255,c>>=8}function BinaryCMapStream(data){this.buffer=data;this.pos=0;this.end=data.length;this.tmpBuf=new Uint8Array(19)}function BinaryCMapReader(){}BinaryCMapStream.prototype={readByte:function(){return this.pos>=this.end?-1:this.buffer[this.pos++]},readNumber:function(){var n=0;do{var b=this.readByte();if(0>b)throw new _util.FormatError("unexpected EOF in bcmap");var last=!(b&128);n=n<<7|b&127}while(!last);return n},readSigned:function(){var n=this.readNumber();return n&1?~(n>>>1):n>>>
|
|
1482
1485
|
1},readHex:function(num,size){num.set(this.buffer.subarray(this.pos,this.pos+size+1));this.pos+=size+1},readHexNumber:function(num,size){var stack=this.tmpBuf,sp=0;do{var b=this.readByte();if(0>b)throw new _util.FormatError("unexpected EOF in bcmap");var last=!(b&128);stack[sp++]=b&127}while(!last);for(b=last=0;0<=size;){for(;8>b&&0<stack.length;)last|=stack[--sp]<<b,b+=7;num[size]=last&255;size--;last>>=8;b-=8}},readHexSigned:function(num,size){this.readHexNumber(num,size);for(var sign=num[size]&
|
|
1483
|
-
1?255:0,c=0,i=0;i<=size;i++)c=(c&1)<<8|num[i],num[i]=c>>1^sign},readString:function(){for(var len=this.readNumber(),s="",i=0;i<len;i++)s+=String.fromCharCode(this.readNumber());return s}};BinaryCMapReader.prototype={process:function(data,cMap,extend){return new Promise(function(resolve,reject){var stream=new BinaryCMapStream(data),header=stream.readByte();cMap.vertical=!!(header&1);header=null;for(var start=new Uint8Array(16),end=new Uint8Array(16),
|
|
1486
|
+
1?255:0,c=0,i=0;i<=size;i++)c=(c&1)<<8|num[i],num[i]=c>>1^sign},readString:function(){for(var len=this.readNumber(),s="",i=0;i<len;i++)s+=String.fromCharCode(this.readNumber());return s}};BinaryCMapReader.prototype={process:function(data,cMap,extend){return new Promise(function(resolve,reject){var stream=new BinaryCMapStream(data),header=stream.readByte();cMap.vertical=!!(header&1);header=null;for(var start=new Uint8Array(16),end=new Uint8Array(16),_char4=new Uint8Array(16),charCode=new Uint8Array(16),
|
|
1484
1487
|
tmp=new Uint8Array(16),code,b;0<=(b=stream.readByte());)if(code=b>>5,7===code)switch(b&31){case 0:stream.readString();break;case 1:header=stream.readString()}else{var sequence=!!(b&16);b&=15;if(16<b+1)throw Error("processBinaryCMap: Invalid dataSize.");var subitemsCount=stream.readNumber(),i;switch(code){case 0:stream.readHex(start,b);stream.readHexNumber(end,b);addHex(end,start,b);cMap.addCodespaceRange(b+1,hexToInt(start,b),hexToInt(end,b));for(i=1;i<subitemsCount;i++)incHex(end,b),stream.readHexNumber(start,
|
|
1485
|
-
b),addHex(start,end,b),stream.readHexNumber(end,b),addHex(end,start,b),cMap.addCodespaceRange(b+1,hexToInt(start,b),hexToInt(end,b));break;case 1:stream.readHex(start,b);stream.readHexNumber(end,b);addHex(end,start,b);stream.readNumber();for(i=1;i<subitemsCount;i++)incHex(end,b),stream.readHexNumber(start,b),addHex(start,end,b),stream.readHexNumber(end,b),addHex(end,start,b),stream.readNumber();break;case 2:stream.readHex(
|
|
1486
|
-
1;i<subitemsCount;i++)incHex(
|
|
1487
|
-
code=stream.readNumber(),cMap.mapCidRange(hexToInt(start,b),hexToInt(end,b),code);break;case 4:stream.readHex(
|
|
1488
|
-
1);stream.readHex(charCode,b);cMap.mapBfRange(hexToInt(start,1),hexToInt(end,1),hexToStr(charCode,b));for(i=1;i<subitemsCount;i++)incHex(end,1),sequence?start.set(end):(stream.readHexNumber(start,1),addHex(start,end,1)),stream.readHexNumber(end,1),addHex(end,start,1),stream.readHex(charCode,b),cMap.mapBfRange(hexToInt(start,1),hexToInt(end,1),hexToStr(charCode,b));break;default:reject(Error("processBinaryCMap: Unknown type: "+code));return}}header?resolve(extend(header)):resolve(cMap)})}};return BinaryCMapReader}();
|
|
1489
|
-
module=function(){function strToInt(str){for(var a=0,i=0;i<str.length;i++)a=a<<8|str.charCodeAt(i);return a>>>0}function expectString(obj){if(!(0,_util.isString)(obj))throw new _util.FormatError("Malformed CMap: expected string.");}function expectInt(obj){if(!Number.isInteger(obj))throw new _util.FormatError("Malformed CMap: expected int.");}function parseCMap(cMap$jscomp$0,lexer$jscomp$0,fetchBuiltInCMap,useCMap){a:for(;;)try{var obj=lexer$jscomp$0.getObj();if((0,_primitives.isEOF)(obj))break;else if((0,
|
|
1490
|
-
|
|
1491
|
-
|
|
1488
|
+
b),addHex(start,end,b),stream.readHexNumber(end,b),addHex(end,start,b),cMap.addCodespaceRange(b+1,hexToInt(start,b),hexToInt(end,b));break;case 1:stream.readHex(start,b);stream.readHexNumber(end,b);addHex(end,start,b);stream.readNumber();for(i=1;i<subitemsCount;i++)incHex(end,b),stream.readHexNumber(start,b),addHex(start,end,b),stream.readHexNumber(end,b),addHex(end,start,b),stream.readNumber();break;case 2:stream.readHex(_char4,b);code=stream.readNumber();cMap.mapOne(hexToInt(_char4,b),code);for(i=
|
|
1489
|
+
1;i<subitemsCount;i++)incHex(_char4,b),sequence||(stream.readHexNumber(tmp,b),addHex(_char4,tmp,b)),code=stream.readSigned()+(code+1),cMap.mapOne(hexToInt(_char4,b),code);break;case 3:stream.readHex(start,b);stream.readHexNumber(end,b);addHex(end,start,b);code=stream.readNumber();cMap.mapCidRange(hexToInt(start,b),hexToInt(end,b),code);for(i=1;i<subitemsCount;i++)incHex(end,b),sequence?start.set(end):(stream.readHexNumber(start,b),addHex(start,end,b)),stream.readHexNumber(end,b),addHex(end,start,
|
|
1490
|
+
b),code=stream.readNumber(),cMap.mapCidRange(hexToInt(start,b),hexToInt(end,b),code);break;case 4:stream.readHex(_char4,1);stream.readHex(charCode,b);cMap.mapOne(hexToInt(_char4,1),hexToStr(charCode,b));for(i=1;i<subitemsCount;i++)incHex(_char4,1),sequence||(stream.readHexNumber(tmp,1),addHex(_char4,tmp,1)),incHex(charCode,b),stream.readHexSigned(tmp,b),addHex(charCode,tmp,b),cMap.mapOne(hexToInt(_char4,1),hexToStr(charCode,b));break;case 5:stream.readHex(start,1);stream.readHexNumber(end,1);addHex(end,
|
|
1491
|
+
start,1);stream.readHex(charCode,b);cMap.mapBfRange(hexToInt(start,1),hexToInt(end,1),hexToStr(charCode,b));for(i=1;i<subitemsCount;i++)incHex(end,1),sequence?start.set(end):(stream.readHexNumber(start,1),addHex(start,end,1)),stream.readHexNumber(end,1),addHex(end,start,1),stream.readHex(charCode,b),cMap.mapBfRange(hexToInt(start,1),hexToInt(end,1),hexToStr(charCode,b));break;default:reject(Error("processBinaryCMap: Unknown type: "+code));return}}header?resolve(extend(header)):resolve(cMap)})}};return BinaryCMapReader}();
|
|
1492
|
+
module=function(){function strToInt(str){for(var a=0,i=0;i<str.length;i++)a=a<<8|str.charCodeAt(i);return a>>>0}function expectString(obj){if(!(0,_util.isString)(obj))throw new _util.FormatError("Malformed CMap: expected string.");}function expectInt(obj){if(!Number.isInteger(obj))throw new _util.FormatError("Malformed CMap: expected int.");}function parseCMap(cMap$jscomp$0,lexer$jscomp$0,fetchBuiltInCMap,useCMap){a:for(;;)try{var obj=lexer$jscomp$0.getObj();if((0,_primitives.isEOF)(obj))break;else if((0,_primitives.isName)(obj)){if("WMode"===
|
|
1493
|
+
obj.name){var cMap=cMap$jscomp$0,obj$jscomp$0=lexer$jscomp$0.getObj();Number.isInteger(obj$jscomp$0)&&(cMap.vertical=!!obj$jscomp$0)}else if("CMapName"===obj.name){cMap=cMap$jscomp$0;var obj$jscomp$1=lexer$jscomp$0.getObj();(0,_primitives.isName)(obj$jscomp$1)&&(0,_util.isString)(obj$jscomp$1.name)&&(cMap.name=obj$jscomp$1.name)}var previous=obj}else if((0,_primitives.isCmd)(obj))switch(obj.cmd){case "endcmap":break a;case "usecmap":if((0,_primitives.isName)(previous))var embeddedUseCMap=previous.name;
|
|
1494
|
+
break;case "begincodespacerange":b:{cMap=cMap$jscomp$0;for(var lexer=lexer$jscomp$0;;){var obj$jscomp$2=lexer.getObj();if((0,_primitives.isEOF)(obj$jscomp$2))break;if((0,_primitives.isCmd)(obj$jscomp$2,"endcodespacerange"))break b;if(!(0,_util.isString)(obj$jscomp$2))break;var low=strToInt(obj$jscomp$2);obj$jscomp$2=lexer.getObj();if(!(0,_util.isString)(obj$jscomp$2))break;var high=strToInt(obj$jscomp$2);cMap.addCodespaceRange(obj$jscomp$2.length,low,high)}throw new _util.FormatError("Invalid codespace range.");
|
|
1492
1495
|
}break;case "beginbfchar":b:for(cMap=cMap$jscomp$0,lexer=lexer$jscomp$0;;){var obj$jscomp$3=lexer.getObj();if((0,_primitives.isEOF)(obj$jscomp$3))break;if((0,_primitives.isCmd)(obj$jscomp$3,"endbfchar"))break b;expectString(obj$jscomp$3);var src=strToInt(obj$jscomp$3);obj$jscomp$3=lexer.getObj();expectString(obj$jscomp$3);cMap.mapOne(src,obj$jscomp$3)}break;case "begincidchar":b:for(cMap=cMap$jscomp$0,lexer=lexer$jscomp$0;;){var obj$jscomp$4=lexer.getObj();if((0,_primitives.isEOF)(obj$jscomp$4))break;
|
|
1493
1496
|
if((0,_primitives.isCmd)(obj$jscomp$4,"endcidchar"))break b;expectString(obj$jscomp$4);var src$jscomp$0=strToInt(obj$jscomp$4);obj$jscomp$4=lexer.getObj();expectInt(obj$jscomp$4);cMap.mapOne(src$jscomp$0,obj$jscomp$4)}break;case "beginbfrange":b:{cMap=cMap$jscomp$0;for(lexer=lexer$jscomp$0;;){var obj$jscomp$5=lexer.getObj();if((0,_primitives.isEOF)(obj$jscomp$5))break;if((0,_primitives.isCmd)(obj$jscomp$5,"endbfrange"))break b;expectString(obj$jscomp$5);var low$jscomp$0=strToInt(obj$jscomp$5);obj$jscomp$5=
|
|
1494
1497
|
lexer.getObj();expectString(obj$jscomp$5);var high$jscomp$0=strToInt(obj$jscomp$5);obj$jscomp$5=lexer.getObj();if(Number.isInteger(obj$jscomp$5)||(0,_util.isString)(obj$jscomp$5)){var dstLow=Number.isInteger(obj$jscomp$5)?String.fromCharCode(obj$jscomp$5):obj$jscomp$5;cMap.mapBfRange(low$jscomp$0,high$jscomp$0,dstLow)}else if((0,_primitives.isCmd)(obj$jscomp$5,"[")){obj$jscomp$5=lexer.getObj();for(var array=[];!(0,_primitives.isCmd)(obj$jscomp$5,"]")&&!(0,_primitives.isEOF)(obj$jscomp$5);)array.push(obj$jscomp$5),
|
|
@@ -1498,14 +1501,13 @@ newCMap;if(0===cMap.numCodespaceRanges){newCMap=cMap.useCMap.codespaceRanges;for
|
|
|
1498
1501
|
BUILT_IN_CMAPS.includes(name)?fetchBuiltInCMap?fetchBuiltInCMap(name).then(function(data){var cMapData=data.cMapData;data=data.compressionType;var cMap=new CMap(!0);return data===_util.CMapCompressionType.BINARY?(new BinaryCMapReader).process(cMapData,cMap,function(useCMap){return extendCMap(cMap,fetchBuiltInCMap,useCMap)}):data===_util.CMapCompressionType.NONE?(cMapData=new _parser.Lexer(new _stream.Stream(cMapData)),parseCMap(cMap,cMapData,fetchBuiltInCMap,null)):Promise.reject(Error("TODO: Only BINARY/NONE CMap compression is currently supported."))}):
|
|
1499
1502
|
Promise.reject(Error("Built-in CMap parameters are not provided.")):Promise.reject(Error("Unknown CMap name: "+name))}return{create:function(params){var encoding=params.encoding,fetchBuiltInCMap=params.fetchBuiltInCMap;params=params.useCMap;if((0,_primitives.isName)(encoding))return createBuiltInCMap(encoding.name,fetchBuiltInCMap);if((0,_primitives.isStream)(encoding)){var cMap=new CMap;encoding=new _parser.Lexer(encoding);return parseCMap(cMap,encoding,fetchBuiltInCMap,params).then(function(parsedCMap){return parsedCMap.isIdentityCMap?
|
|
1500
1503
|
createBuiltInCMap(parsedCMap.name,fetchBuiltInCMap):parsedCMap})}return Promise.reject(Error("Encoding required."))}}}();exports.CMapFactory=module},function(module,exports,__w_pdfjs_require__){function adjustWidths(properties){if(properties.fontMatrix&&properties.fontMatrix[0]!==_util.FONT_IDENTITY_MATRIX[0]){var scale=.001/properties.fontMatrix[0],glyphsWidths=properties.widths,glyph;for(glyph in glyphsWidths)glyphsWidths[glyph]*=scale;properties.defaultWidth*=scale}}function adjustToUnicode(properties,
|
|
1501
|
-
builtInEncoding){if(!(properties.hasIncludedToUnicodeMap||properties.hasEncoding||builtInEncoding===properties.defaultEncoding||properties.toUnicode instanceof IdentityToUnicodeMap)){var toUnicode=[],glyphsUnicodeMap=(0,_glyphlist.getGlyphsUnicode)(),charCode;for(charCode in builtInEncoding){var
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
".notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat".split(" "),
|
|
1504
|
+
builtInEncoding){if(!(properties.hasIncludedToUnicodeMap||properties.hasEncoding||builtInEncoding===properties.defaultEncoding||properties.toUnicode instanceof IdentityToUnicodeMap)){var toUnicode=[],glyphsUnicodeMap=(0,_glyphlist.getGlyphsUnicode)(),charCode;for(charCode in builtInEncoding){var unicode=(0,_unicode.getUnicodeForGlyph)(builtInEncoding[charCode],glyphsUnicodeMap);-1!==unicode&&(toUnicode[charCode]=String.fromCharCode(unicode))}properties.toUnicode.amend(toUnicode)}}function getFontType(type,
|
|
1505
|
+
subtype){switch(type){case "Type1":return"Type1C"===subtype?_util.FontType.TYPE1C:_util.FontType.TYPE1;case "CIDFontType0":return"CIDFontType0C"===subtype?_util.FontType.CIDFONTTYPE0C:_util.FontType.CIDFONTTYPE0;case "OpenType":return _util.FontType.OPENTYPE;case "TrueType":return _util.FontType.TRUETYPE;case "CIDFontType2":return _util.FontType.CIDFONTTYPE2;case "MMType1":return _util.FontType.MMTYPE1;case "Type0":return _util.FontType.TYPE0;default:return _util.FontType.UNKNOWN}}function recoverGlyphName(name,
|
|
1506
|
+
glyphsUnicodeMap){if(void 0!==glyphsUnicodeMap[name])return name;var unicode=(0,_unicode.getUnicodeForGlyph)(name,glyphsUnicodeMap);if(-1!==unicode)for(var key in glyphsUnicodeMap)if(glyphsUnicodeMap[key]===unicode)return key;(0,_util.info)("Unable to recover a standard glyph name for: "+name);return name}function type1FontGlyphMapping(properties,builtInEncoding,glyphNames){var charCodeToGlyphId=Object.create(null),charCode;var baseEncoding=!!(properties.flags&FontFlags.Symbolic);if(properties.baseEncodingName)for(baseEncoding=
|
|
1507
|
+
(0,_encodings.getEncoding)(properties.baseEncodingName),charCode=0;charCode<baseEncoding.length;charCode++)builtInEncoding=glyphNames.indexOf(baseEncoding[charCode]),charCodeToGlyphId[charCode]=0<=builtInEncoding?builtInEncoding:0;else if(baseEncoding)for(charCode in builtInEncoding)charCodeToGlyphId[charCode]=builtInEncoding[charCode];else for(baseEncoding=_encodings.StandardEncoding,charCode=0;charCode<baseEncoding.length;charCode++)builtInEncoding=glyphNames.indexOf(baseEncoding[charCode]),charCodeToGlyphId[charCode]=
|
|
1508
|
+
0<=builtInEncoding?builtInEncoding:0;properties=properties.differences;var glyphsUnicodeMap;if(properties)for(charCode in properties){baseEncoding=properties[charCode];builtInEncoding=glyphNames.indexOf(baseEncoding);if(-1===builtInEncoding){glyphsUnicodeMap||(glyphsUnicodeMap=(0,_glyphlist.getGlyphsUnicode)());var standardGlyphName=recoverGlyphName(baseEncoding,glyphsUnicodeMap);standardGlyphName!==baseEncoding&&(builtInEncoding=glyphNames.indexOf(standardGlyphName))}charCodeToGlyphId[charCode]=
|
|
1509
|
+
0<=builtInEncoding?builtInEncoding:0}return charCodeToGlyphId}Object.defineProperty(exports,"__esModule",{value:!0});exports.getFontType=getFontType;exports.IdentityToUnicodeMap=exports.ToUnicodeMap=exports.FontFlags=exports.Font=exports.ErrorFont=exports.SEAC_ANALYSIS_ENABLED=void 0;var _util=__w_pdfjs_require__(5),_cff_parser=__w_pdfjs_require__(212),_glyphlist=__w_pdfjs_require__(215),_encodings=__w_pdfjs_require__(214),_standard_fonts=__w_pdfjs_require__(216),_unicode=__w_pdfjs_require__(217),
|
|
1510
|
+
_font_renderer=__w_pdfjs_require__(218),_cmap=__w_pdfjs_require__(210),_core_utils=__w_pdfjs_require__(191),_stream=__w_pdfjs_require__(195),_type1_parser=__w_pdfjs_require__(219),PRIVATE_USE_AREAS=[[57344,63743],[1048576,1114109]];exports.SEAC_ANALYSIS_ENABLED=!0;var FontFlags={FixedPitch:1,Serif:2,Symbolic:4,Script:8,Nonsymbolic:32,Italic:64,AllCap:65536,SmallCap:131072,ForceBold:262144};exports.FontFlags=FontFlags;var MacStandardGlyphOrdering=".notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat".split(" "),
|
|
1509
1511
|
Glyph=function(){function Glyph(fontChar,unicode,accent,width,vmetric,operatorListId,isSpace,isInFont){this.fontChar=fontChar;this.unicode=unicode;this.accent=accent;this.width=width;this.vmetric=vmetric;this.operatorListId=operatorListId;this.isSpace=isSpace;this.isInFont=isInFont}Glyph.prototype.matchesForCache=function(fontChar,unicode,accent,width,vmetric,operatorListId,isSpace,isInFont){return this.fontChar===fontChar&&this.unicode===unicode&&this.accent===accent&&this.width===width&&this.vmetric===
|
|
1510
1512
|
vmetric&&this.operatorListId===operatorListId&&this.isSpace===isSpace&&this.isInFont===isInFont};return Glyph}(),ToUnicodeMap=function(){function ToUnicodeMap(){this._map=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]}ToUnicodeMap.prototype={get length(){return this._map.length},forEach:function(callback){for(var charCode in this._map)callback(charCode,this._map[charCode].charCodeAt(0))},has:function(i){return void 0!==this._map[i]},get:function(i){return this._map[i]},charCodeOf:function(value){var map=
|
|
1511
1513
|
this._map;if(65536>=map.length)return map.indexOf(value);for(var charCode in map)if(map[charCode]===value)return charCode|0;return-1},amend:function(map){for(var charCode in map)this._map[charCode]=map[charCode]}};return ToUnicodeMap}();exports.ToUnicodeMap=ToUnicodeMap;var IdentityToUnicodeMap=function(){function IdentityToUnicodeMap(firstChar,lastChar){this.firstChar=firstChar;this.lastChar=lastChar}IdentityToUnicodeMap.prototype={get length(){return this.lastChar+1-this.firstChar},forEach:function(callback){for(var i=
|
|
@@ -1517,110 +1519,111 @@ Uint8Array)offset.set(data,jj);else if("string"===typeof data){var i$jscomp$0=0;
|
|
|
1517
1519
|
8,tableOffsets[i]);writeInt32(file,offset+12,tables[table].length);offset+=16}return file},addTable:function(tag,data){if(tag in this.tables)throw Error("Table "+tag+" already exists");this.tables[tag]=data}};return OpenTypeFileBuilder}();module=function(){function Font(name,file,properties){this.name=name;this.loadedName=properties.loadedName;this.isType3Font=properties.isType3Font;this.sizes=[];this.missingFile=!1;this.glyphCache=Object.create(null);this.isSerifFont=!!(properties.flags&FontFlags.Serif);
|
|
1518
1520
|
this.isSymbolicFont=!!(properties.flags&FontFlags.Symbolic);this.isMonospace=!!(properties.flags&FontFlags.FixedPitch);var type=properties.type,subtype=properties.subtype;this.type=type;this.subtype=subtype;this.fallbackName=this.isMonospace?"monospace":this.isSerifFont?"serif":"sans-serif";this.differences=properties.differences;this.widths=properties.widths;this.defaultWidth=properties.defaultWidth;this.composite=properties.composite;this.wideChars=properties.wideChars;this.cMap=properties.cMap;
|
|
1519
1521
|
this.ascent=properties.ascent/1E3;this.descent=properties.descent/1E3;this.fontMatrix=properties.fontMatrix;this.bbox=properties.bbox;this.defaultEncoding=properties.defaultEncoding;this.toUnicode=properties.toUnicode;this.fallbackToUnicode=properties.fallbackToUnicode||new ToUnicodeMap;this.toFontChar=[];if("Type3"===properties.type){for(name=0;256>name;name++)this.toFontChar[name]=this.differences[name]||properties.defaultEncoding[name];this.fontType=_util.FontType.TYPE3}else{this.cidEncoding=properties.cidEncoding;
|
|
1520
|
-
if(this.vertical=properties.vertical)this.vmetrics=properties.vmetrics,this.defaultVMetrics=properties.defaultVMetrics;if(!file||file.isEmpty)file&&(0,_util.warn)('Font file is empty in "'+name+'" ('+this.loadedName+")"),this.fallbackToSystemFont();else{subtype=properties.type;type=properties.subtype;var composite=properties.composite,header=file.peekBytes(4);if(65536===(0,_util.readUint32)(header,0)||"true"===(0,_util.bytesToString)(header)||isTrueTypeCollectionFile(file))subtype=composite?
|
|
1521
|
-
"TrueType";else if(header=file.peekBytes(4),"OTTO"===(0,_util.bytesToString)(header))subtype=composite?"CIDFontType2":"OpenType";else if(header=file.peekBytes(2),37===header[0]&&33===header[1]||128===header[0]&&1===header[1])subtype=composite?"CIDFontType0":"MMType1"===subtype?"MMType1":"Type1";else{var _getFontFileType=file.peekBytes(4);1<=_getFontFileType[0]&&1<=_getFontFileType[3]&&4>=_getFontFileType[3]?composite?(subtype="CIDFontType0",_getFontFileType="CIDFontType0C"):(subtype=
|
|
1522
|
-
"MMType1":"Type1",_getFontFileType="Type1C"):((0,_util.warn)("getFontFileType: Unable to detect correct font file Type/Subtype."),_getFontFileType=type)}_getFontFileType=[subtype,_getFontFileType];type=Array.isArray(_getFontFileType)?_getFontFileType:void 0;if(!type)if(Symbol.iterator in Object(_getFontFileType)||"[object Arguments]"===Object.prototype.toString.call(_getFontFileType)){type=[];subtype=!0;composite=!1;header=void 0;try{var JSCompiler_temp=_getFontFileType[Symbol.iterator]();
|
|
1523
|
-
(_s=JSCompiler_temp.next()).done)&&(type.push(_s.value),2!==type.length);subtype=!0);}catch(err){composite=!0,header=err}finally{try{if(!subtype&&null!=JSCompiler_temp["return"])JSCompiler_temp["return"]()}finally{if(composite)throw header;}}}else type=void 0;if(!(JSCompiler_temp=type))throw new TypeError("Invalid attempt to destructure non-iterable instance");type=JSCompiler_temp[0];subtype=JSCompiler_temp[1];type===this.type&&subtype===this.subtype||(0,_util.info)("Inconsistent font file Type/SubType, expected: "+
|
|
1522
|
+
if(this.vertical=properties.vertical)this.vmetrics=properties.vmetrics,this.defaultVMetrics=properties.defaultVMetrics;if(!file||file.isEmpty)file&&(0,_util.warn)('Font file is empty in "'+name+'" ('+this.loadedName+")"),this.fallbackToSystemFont(properties);else{subtype=properties.type;type=properties.subtype;var composite=properties.composite,header=file.peekBytes(4);if(65536===(0,_util.readUint32)(header,0)||"true"===(0,_util.bytesToString)(header)||isTrueTypeCollectionFile(file))subtype=composite?
|
|
1523
|
+
"CIDFontType2":"TrueType";else if(header=file.peekBytes(4),"OTTO"===(0,_util.bytesToString)(header))subtype=composite?"CIDFontType2":"OpenType";else if(header=file.peekBytes(2),37===header[0]&&33===header[1]||128===header[0]&&1===header[1])subtype=composite?"CIDFontType0":"MMType1"===subtype?"MMType1":"Type1";else{var _getFontFileType=file.peekBytes(4);1<=_getFontFileType[0]&&1<=_getFontFileType[3]&&4>=_getFontFileType[3]?composite?(subtype="CIDFontType0",_getFontFileType="CIDFontType0C"):(subtype=
|
|
1524
|
+
"MMType1"===subtype?"MMType1":"Type1",_getFontFileType="Type1C"):((0,_util.warn)("getFontFileType: Unable to detect correct font file Type/Subtype."),_getFontFileType=type)}_getFontFileType=[subtype,_getFontFileType];type=Array.isArray(_getFontFileType)?_getFontFileType:void 0;if(!type)if(Symbol.iterator in Object(_getFontFileType)||"[object Arguments]"===Object.prototype.toString.call(_getFontFileType)){type=[];subtype=!0;composite=!1;header=void 0;try{var JSCompiler_temp=_getFontFileType[Symbol.iterator]();
|
|
1525
|
+
for(var _s;!(subtype=(_s=JSCompiler_temp.next()).done)&&(type.push(_s.value),2!==type.length);subtype=!0);}catch(err){composite=!0,header=err}finally{try{if(!subtype&&null!=JSCompiler_temp["return"])JSCompiler_temp["return"]()}finally{if(composite)throw header;}}}else type=void 0;if(!(JSCompiler_temp=type))throw new TypeError("Invalid attempt to destructure non-iterable instance");type=JSCompiler_temp[0];subtype=JSCompiler_temp[1];type===this.type&&subtype===this.subtype||(0,_util.info)("Inconsistent font file Type/SubType, expected: "+
|
|
1524
1526
|
"".concat(this.type,"/").concat(this.subtype," but found: ").concat(type,"/").concat(subtype,"."));try{switch(type){case "MMType1":(0,_util.info)("MMType1 font ("+name+"), falling back to Type1.");case "Type1":case "CIDFontType0":this.mimetype="font/opentype";var cff="Type1C"===subtype||"CIDFontType0C"===subtype?new CFFFont(file,properties):new Type1Font(name,file,properties);adjustWidths(properties);var data=this.convert(name,cff,properties);break;case "OpenType":case "TrueType":case "CIDFontType2":this.mimetype=
|
|
1525
|
-
"font/opentype";data=this.checkAndRepair(name,file,properties);this.isOpenType&&(adjustWidths(properties),type="OpenType");break;default:throw new _util.FormatError("Font ".concat(type," is not supported"));}}catch(e){(0,_util.warn)(e);this.fallbackToSystemFont();return}this.data=data;this.fontType=getFontType(type,subtype);this.fontMatrix=properties.fontMatrix;this.widths=properties.widths;this.defaultWidth=properties.defaultWidth;this.toUnicode=properties.toUnicode;this.encoding=properties.baseEncoding;
|
|
1526
|
-
this.seacMap=properties.seacMap}}}function signedInt16(b0,b1){b0=(b0<<8)+b1;return b0&32768?b0-65536:b0}function string16(value){return String.fromCharCode(value>>8&255,value&255)}function safeString16(value){value=32767<value?32767:-32768>value?-32768:value;return String.fromCharCode(value>>8&255,value&255)}function isTrueTypeCollectionFile(file){file=file.peekBytes(4);return"ttcf"===(0,_util.bytesToString)(file)}function
|
|
1527
|
-
[],unicode,i=0,ii=encoding.length;i<ii;i++)unicode=(0,_unicode.getUnicodeForGlyph)(encoding[i],glyphsUnicodeMap),-1!==unicode&&(toFontChar[i]=unicode);for(var charCode in differences)unicode=(0,_unicode.getUnicodeForGlyph)(differences[charCode],glyphsUnicodeMap),-1!==unicode&&(toFontChar[+charCode]=unicode);return toFontChar}function adjustMapping(charCodeToGlyphId,hasGlyph,newGlyphZeroId){var newMap=
|
|
1528
|
-
privateUseOffetEnd=PRIVATE_USE_AREAS[privateUseAreaIndex][1],originalCharCode;for(originalCharCode in charCodeToGlyphId){originalCharCode|=0;var glyphId=charCodeToGlyphId[originalCharCode];if(hasGlyph(glyphId)){if(nextAvailableFontCharCode>privateUseOffetEnd){privateUseAreaIndex++;if(privateUseAreaIndex>=PRIVATE_USE_AREAS.length){(0,_util.warn)("Ran out of space in font private use area.");
|
|
1529
|
-
nextAvailableFontCharCode++;0===glyphId&&(glyphId=newGlyphZeroId);newMap[fontCharCode]=glyphId;toFontChar[originalCharCode]=fontCharCode}}return{toFontChar:toFontChar,charCodeToGlyphId:newMap,nextAvailableFontCharCode:nextAvailableFontCharCode}}function getRanges(glyphs,numGlyphs){var codes=[],charCode;for(charCode in glyphs)glyphs[charCode]>=numGlyphs||
|
|
1530
|
-
b.fontCharCode});glyphs=[];numGlyphs=codes.length;for(charCode=0;charCode<numGlyphs;){var start=codes[charCode].fontCharCode,codeIndices=[codes[charCode].glyphId];++charCode;for(var end=start;charCode<numGlyphs&&end+1===codes[charCode].fontCharCode&&(codeIndices.push(codes[charCode].glyphId),++end,++charCode,65535!==end););glyphs.push([start,
|
|
1531
|
-
2:1;numGlyphs="\x00\x00"+string16(numTables)+"\x00\u0003\x00\u0001"+(0,_util.string32)(4+8*numTables);var i,jj;for(i=glyphs.length-1;0<=i&&!(65535>=glyphs[i][0]);--i);var ii=i+1;65535>glyphs[i][0]&&65535===glyphs[i][1]&&(glyphs[i][1]=65534);var trailingRangesCount=65535>glyphs[i][1]?1:0,segCount=ii+trailingRangesCount,searchParams=OpenTypeFileBuilder.getSearchParams(segCount,
|
|
1532
|
-
range[0];var end=range[1];startCount+=string16(start);endCount+=string16(end);var codes=range[2];range=!0;var j=1;for(jj=codes.length;j<jj;++j)if(codes[j]!==codes[j-1]+1){range=!1;break}if(range)idDeltas+=string16(codes[0]-start&65535),idRangeOffsets+=string16(0);else for(j=2*(segCount-i)+2*bias,bias+=end-start+1,idDeltas+=string16(0),idRangeOffsets+=string16(j),j=0,jj=codes.length;j<
|
|
1533
|
-
"\x00\u0001",idRangeOffsets+="\x00\x00");trailingRangesCount="\x00\x00"+string16(2*segCount)+string16(searchParams.range)+string16(searchParams.entry)+string16(searchParams.rangeShift)+endCount+"\x00\x00"+startCount+idDeltas+idRangeOffsets+glyphsIds;i=segCount="";if(1<numTables){numGlyphs+="\x00\u0003\x00\n"+(0,_util.string32)(8*numTables+8+trailingRangesCount.length);segCount=
|
|
1534
|
-
jj;++j)codes[j]!==codes[j-1]+1&&(end=range[0]+j-1,segCount+=(0,_util.string32)(start)+(0,_util.string32)(end)+(0,_util.string32)(numTables),start=end+1,numTables=codes[j]);segCount+=(0,_util.string32)(start)+(0,_util.string32)(range[1])+(0,_util.string32)(numTables)}i="\x00\f\x00\x00"+(0,_util.string32)(segCount.length+16)+"\x00\x00\x00\x00"+(0,_util.string32)(segCount.length/
|
|
1535
|
-
new _stream.Stream(os2.data),version=stream.getUint16();stream.getBytes(60);var selection=stream.getUint16();if(4>version&&selection&768)return!1;version=stream.getUint16();selection=stream.getUint16();if(version>selection)return!1;stream.getBytes(6);if(0===stream.getUint16())return!1;os2.data[8]=os2.data[9]=0;return!0}function createOS2Table(properties,
|
|
1536
|
-
0,ulUnicodeRange4=0,firstCharIndex=null,lastCharIndex=0;if(charstrings){for(var code in charstrings){code|=0;if(firstCharIndex>code||!firstCharIndex)firstCharIndex=code;lastCharIndex<code&&(lastCharIndex=code);charstrings=(0,_unicode.getUnicodeRangeFor)(code);if(32>charstrings)ulUnicodeRange1|=1<<charstrings;else if(64>charstrings)ulUnicodeRange2|=1<<charstrings-
|
|
1537
|
-
}65535<lastCharIndex&&(lastCharIndex=65535)}else firstCharIndex=0,lastCharIndex=255;charstrings=properties.bbox||[0,0,0,0];code=override.unitsPerEm||1/(properties.fontMatrix||_util.FONT_IDENTITY_MATRIX)[0];var scale=properties.ascentScaled?1:code/1E3;code=override.ascent||Math.round(scale*
|
|
1538
|
-
override=-override.yMin||-scale;return"\x00\u0003\u0002$\u0001\u00f4\x00\u0005\x00\x00\u0002\u008a\u0002\u00bb\x00\x00\x00\u008c\u0002\u008a\u0002\u00bb\x00\x00\u0001\u00df\x001\u0001\u0002\x00\x00\x00\x00\u0006"+String.fromCharCode(properties.fixedPitch?9:0)+"\x00\x00\x00\x00\x00\x00"+(0,_util.string32)(ulUnicodeRange1)+
|
|
1539
|
-
string16(lastCharIndex||properties.lastChar)+string16(code)+string16(scale)+"\x00d"+string16(charstrings)+string16(override)+"\x00\x00\x00\x00\x00\x00\x00\x00"+string16(properties.xHeight)+string16(properties.capHeight)+string16(0)+string16(firstCharIndex||properties.firstChar)+"\x00\u0003"}function createPostTable(properties){
|
|
1540
|
-
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}function createNameTable(name,proto){proto||(proto=[[],[]]);name=[proto[0][0]||"Original licence",proto[0][1]||name,proto[0][2]||"Unknown",proto[0][3]||"uniqueID",proto[0][4]||name,proto[0][5]||"Version 0.11",proto[0][6]||"",proto[0][7]||"Unknown",proto[0][8]||"Unknown",proto[0][9]||"Unknown"];var stringsUnicode=
|
|
1541
|
-
jj;j++)strBufUnicode.push(string16(str.charCodeAt(j)));stringsUnicode.push(strBufUnicode.join(""))}proto=[name,stringsUnicode];strBufUnicode=["\x00\u0001","\x00\u0003"];var encodings=["\x00\x00","\x00\u0001"],languages=["\x00\x00","\u0004\t"];i=name.length*strBufUnicode.length;var nameTable="\x00\x00"+string16(i)+string16(12*i+6),strOffset=0;i=0;for(ii=strBufUnicode.length;i<
|
|
1542
|
-
string16(j)+string16(str.length)+string16(strOffset);nameTable+=nameRecord;strOffset+=str.length}}return nameTable+=name.join("")+stringsUnicode.join("")}Font.getFontID=function(){var ID=1;return function(){return String(ID++)}}();Font.prototype={name:null,font:null,mimetype:null,encoding:null,disableFontFace:!1,get renderer(){var renderer=_font_renderer.FontRendererFactory.create(this
|
|
1543
|
-
(data[i]=this[i]);return data},fallbackToSystemFont:function(){var _this=this;this.missingFile=!0;var
|
|
1544
|
-
this.italic=-1!==fontName.search(/oblique/gi)||-1!==fontName.search(/italic/gi);this.black=-1!==name.search(/Black/g);this.remeasure=0<Object.keys(this.widths).length;if(isStandardFont&&"CIDFontType2"===type&&this.cidEncoding.startsWith("Identity-")){
|
|
1545
|
-
name)map
|
|
1546
|
-
(0,_glyphlist.getGlyphsUnicode)(),this.differences);else if(/Dingbats/i.test(fontName))/Wingdings/i.test(name)&&(0,_util.warn)("Non-embedded Wingdings font, falling back to ZapfDingbats."),
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
0,offset=table.getInt32()>>>0,length=table.getInt32()>>>0,previousPosition=table.pos;table.pos=table.start?table.start:0;table.skip(offset);var data=table.getBytes(length);table.pos=previousPosition;"head"===tag&&(data[8]=data[9]=data[10]=data[11]=0,data[17]|=32);table={tag:tag,
|
|
1550
|
-
numTables:ttf.getUint16(),searchRange:ttf.getUint16(),entrySelector:ttf.getUint16(),rangeShift:ttf.getUint16()}}function readTrueTypeCollectionData(ttc,fontName){a:{var _readTrueTypeCollecti=(0,_util.bytesToString)(ttc.getBytes(4));(0,_util.assert)("ttcf"===_readTrueTypeCollecti,
|
|
1551
|
-
{ttcTag:_readTrueTypeCollecti,majorVersion:majorVersion,minorVersion:minorVersion,numFonts:numFonts,offsetTable:offsetTable};switch(majorVersion){case 1:break a;case 2:_readTrueTypeCollecti.dsigTag=ttc.getInt32()>>>0;_readTrueTypeCollecti.dsigLength=ttc.getInt32()>>>0;_readTrueTypeCollecti.dsigOffset=
|
|
1552
|
-
for(minorVersion=0;minorVersion<majorVersion;minorVersion++){ttc.pos=(ttc.start||0)+_readTrueTypeCollecti[minorVersion];numFonts=readOpenTypeHeader(ttc);offsetTable=readTables(ttc,numFonts.numTables);if(!offsetTable.name)throw new _util.FormatError('TrueType Collection font must contain a "name" table.');
|
|
1553
|
-
tables:offsetTable}}}throw new _util.FormatError('TrueType Collection does not contain "'.concat(fontName,'" font.'));}function readCmapTable(cmap,font,isSymbolicFont,hasEncoding){if(!cmap)return(0,_util.warn)("No cmap table available."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};var segment;
|
|
1554
|
-
encodingId=font.getUint16(),offset=font.getInt32()>>>0,useTable=!1;if(!potentialTable||potentialTable.platformId!==platformId||potentialTable.encodingId!==encodingId)if(0===platformId&&0===encodingId?useTable=!0:1===platformId&&0===encodingId?useTable=!0:3!==platformId||1!==encodingId||!hasEncoding&&
|
|
1555
|
-
offset:offset}),canBreak)break}potentialTable&&(font.pos=cmap+potentialTable.offset);if(!potentialTable||-1===font.peekByte())return(0,_util.warn)("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};cmap=font.getUint16();font.getUint16();font.getUint16();
|
|
1556
|
-
font.getUint16()>>1;font.getBytes(6);platformId=[];for(canBreak=0;canBreak<numTables;canBreak++)platformId.push({end:font.getUint16()});font.getUint16();for(canBreak=0;canBreak<numTables;canBreak++)platformId[canBreak].start=font.getUint16();for(canBreak=0;canBreak<numTables;canBreak++)platformId[canBreak].delta=
|
|
1557
|
-
offset,cmap=Math.max(cmap,offset+segment.end-segment.start+1)):segment.offsetIndex=-1;useTable=[];for(segment=0;segment<cmap;segment++)useTable.push(font.getUint16());for(canBreak=0;canBreak<numTables;canBreak++){segment=platformId[canBreak];cmap=segment.start;font=segment.end;var delta=segment.delta;offset=segment.offsetIndex;
|
|
1558
|
-
glyphId:encodingId}))}}else if(6===cmap)for(cmap=font.getUint16(),numTables=font.getUint16(),segment=0;segment<numTables;segment++)encodingId=font.getUint16(),isSymbolicFont.push({charCode:cmap+segment,glyphId:encodingId});else return(0,_util.warn)("cmap table has unsupported format: "+cmap),{platformId:-1,encodingId:-1,
|
|
1559
|
-
isSymbolicFont[segment].charCode&&(isSymbolicFont.splice(segment,1),segment--);return{platformId:potentialTable.platformId,encodingId:potentialTable.encodingId,mappings:isSymbolicFont,hasShortCmap:hasEncoding}}function sanitizeGlyph(source,sourceStart,sourceEnd,dest,destStart,hintsValid){var glyphProfile={length:0,
|
|
1560
|
-
-1,source[0]=16777215,dest.set(source,destStart),glyphProfile.length=source.length,glyphProfile;sourceEnd=10;var flagsCount=0;for(sourceStart=0;sourceStart<contoursCount;sourceStart++)flagsCount=(source[sourceEnd]<<8|source[sourceEnd+1])+1,sourceEnd+=2;contoursCount=sourceEnd;var instructionsLength=
|
|
1561
|
-
source[sourceEnd++];flag&192&&(source[sourceEnd-1]=flag&63);var xyLength=(flag&2?1:flag&16?0:2)+(flag&4?1:flag&32?0:2);coordinatesLength+=xyLength;flag&8&&(flag=source[sourceEnd++],sourceStart+=flag,coordinatesLength+=flag*xyLength)}if(0===coordinatesLength)return glyphProfile;
|
|
1562
|
-
dest.set(source.subarray(instructionsEnd,sourceStart),destStart+contoursCount+2),sourceStart-=instructionsLength,3<source.length-sourceStart&&(sourceStart=sourceStart+3&-4),glyphProfile.length=sourceStart,glyphProfile;if(3<source.length-sourceStart)return sourceStart=sourceStart+
|
|
1563
|
-
numGlyphs,isGlyphLocationsLong,hintsValid,dupFirstEntry,maxSizeOfInstructions){if(isGlyphLocationsLong){isGlyphLocationsLong=4;var itemDecode=function(data,offset){return data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3]};var itemEncode=function(data,offset,
|
|
1564
|
-
function(data,offset,value){data[offset]=value>>9&255;data[offset+1]=value>>1&255};var numGlyphsOut=dupFirstEntry?numGlyphs+1:numGlyphs,locaDataSize=isGlyphLocationsLong*(1+numGlyphsOut),locaData=new Uint8Array(locaDataSize);locaData.set(loca.data.subarray(0,locaDataSize));
|
|
1565
|
-
0,writeOffset);var j;var i=0;for(j=isGlyphLocationsLong;i<numGlyphs;i++,j+=isGlyphLocationsLong){var endOffset=itemDecode(locaData,j);0===endOffset&&(endOffset=startOffset);endOffset>oldGlyfDataLength&&(oldGlyfDataLength+3&-4)===endOffset&&(endOffset=oldGlyfDataLength);endOffset>
|
|
1566
|
-
maxSizeOfInstructions&&(maxSizeOfInstructions=startOffset.sizeOfInstructions);writeOffset+=newLength;itemEncode(locaData,j,writeOffset);startOffset=endOffset}if(0===writeOffset){loca=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);i=0;for(j=isGlyphLocationsLong;i<
|
|
1567
|
-
numGlyphs+writeOffset):(glyf.data=new Uint8Array(numGlyphs+writeOffset),glyf.data.set(newGlyfData.subarray(0,writeOffset))),glyf.data.set(newGlyfData.subarray(0,numGlyphs),writeOffset),itemEncode(loca.data,locaData.length-isGlyphLocationsLong,writeOffset+numGlyphs)):
|
|
1568
|
-
0)+post.offset;font$jscomp$0.pos=start;start+=post.length;var version=font$jscomp$0.getInt32();font$jscomp$0.getBytes(28);post=!0;switch(version){case 65536:var glyphNames=MacStandardGlyphOrdering;break;case 131072:version=font$jscomp$0.getUint16();if(version!==maxpNumGlyphs){post
|
|
1569
|
-
[];font$jscomp$0.pos<start;){var stringLength=font$jscomp$0.getByte();glyphNames.length=stringLength;for(maxpNumGlyphs=0;maxpNumGlyphs<stringLength;++maxpNumGlyphs)glyphNames[maxpNumGlyphs]=String.fromCharCode(font$jscomp$0.getByte());index.push(glyphNames.join(""))}glyphNames=
|
|
1570
|
-
_util.warn)("Unknown/unsupported post table version "+version),post=!1,properties.defaultEncoding&&(glyphNames=properties.defaultEncoding)}properties.glyphNames=glyphNames;return post}function readNameTable(nameTable){var start=(font$jscomp$0.start?font$jscomp$0.start:0)+nameTable.offset;
|
|
1571
|
-
var records=[],i;for(i=0;i<numRecords&&font$jscomp$0.pos+12<=nameTable;i++){var r={platform:font$jscomp$0.getUint16(),encoding:font$jscomp$0.getUint16(),language:font$jscomp$0.getUint16(),name:font$jscomp$0.getUint16(),length:font$jscomp$0.getUint16(),offset:font$jscomp$0.getUint16()};
|
|
1572
|
-
r.offset;if(!(pos+r.length>nameTable))if(font$jscomp$0.pos=pos,pos=r.name,r.encoding){var str="",j=0;for(r=r.length;j<r;j+=2)str+=String.fromCharCode(font$jscomp$0.getUint16());names[1][pos]=str}else names[0][pos]=(0,_util.bytesToString)(font$jscomp$0.getBytes(r.length))}return names}
|
|
1573
|
-
ifLevel=0,inELSE=0,ii=data.length;i<ii;){var op=data[i++];if(64===op)if(n=data[i++],inFDEF||inELSE)i+=n;else for(j=0;j<n;j++)stack.push(data[i++]);else if(65===op)if(n=data[i++],inFDEF||inELSE)i+=2*n;else for(j=0;j<n;j++)b=data[i++],stack.push(b<<8|data[i++]);else if(176===(op&248))if(n=
|
|
1574
|
-
op||tooComplexToFollowFunctions)if(45===op)if(inFDEF)inFDEF=!1,lastEndf=i;else{j=callstack.pop();if(!j){(0,_util.warn)("TT: ENDF bad stack");ttContext.hintsValid=!1;return}n=functionsCalled.pop();data=j.data;i=j.i;ttContext.functionsStackDeltas[n]=stack.length-
|
|
1575
|
-
28!==op||inFDEF||inELSE||(n=stack[stack.length-1],0<n&&(i+=n-1));else{if(inFDEF||inELSE)(0,_util.warn)("TT: nested FDEFs not allowed"),tooComplexToFollowFunctions=!0;inFDEF=!0;lastDeff=i;n=stack.pop();ttContext.functionsDefined[n]={data:data,i:i}}else if(!inFDEF
|
|
1576
|
-
_util.warn)("TT: CALL invalid functions stack delta.");ttContext.hintsValid=!1;return}stack.length=n}else if(n in ttContext.functionsDefined&&!functionsCalled.includes(n)){callstack.push({data:data,i:i,stackTop:stack.length-1});functionsCalled.push(n);j=ttContext.functionsDefined[n];
|
|
1577
|
-
isNaN(n)||(j=2*-n));for(;0>j&&0<stack.length;)stack.pop(),j++;for(;0<j;)stack.push(NaN),j--}}ttContext.tooComplexToFollowFunctions=tooComplexToFollowFunctions;ttContext=[data];i>data.length&&ttContext.push(new Uint8Array(i-data.length));lastDeff>lastEndf&&((0,_util.warn)("TT: complementing a missing function tail"),
|
|
1578
|
-
i=stack=0;for(lastEndf=ttContext.length;i<lastEndf;i++)lastDeff.set(ttContext[i],stack),stack+=ttContext[i].length;table.data=lastDeff;table.length=data}}var VALID_TABLES="OS/2;cmap;head;hhea;hmtx;maxp;name;post;loca;glyf;fpgm;prep;cvt ;CFF ".split(";"),TTOpsStackDeltas=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1
|
|
1579
|
-
-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];font$jscomp$0=new _stream.Stream(new Uint8Array(font$jscomp$0.getBytes()));if(isTrueTypeCollectionFile(font$jscomp$0)){var tables=readTrueTypeCollectionData(font$jscomp$0,
|
|
1580
|
-
var isTrueType=!tables["CFF "];if(isTrueType){if(!tables.loca)throw new _util.FormatError('Required "loca" table is not found');tables.glyf||((0,_util.warn)('Required "glyf" table is not found -- trying to recover.'),tables.glyf={tag:"glyf",data:new Uint8Array(0)});this.isOpenType=!1}else{var isComposite=properties$jscomp$0.composite&&
|
|
1581
|
-
|
|
1582
|
-
font$jscomp$0.getInt32(),numGlyphs$jscomp$0=font$jscomp$0.getUint16();isComposite=numGlyphs$jscomp$0+1;var dupFirstEntry=!0;65535<isComposite&&(dupFirstEntry=!1,isComposite=numGlyphs$jscomp$0,(0,_util.warn)("Not enough space in glyfs to duplicate first glyph."));var maxFunctionDefs=0,maxSizeOfInstructions=0;65536<=version$jscomp$0&&
|
|
1583
|
-
font$jscomp$0.pos+=4,maxSizeOfInstructions=font$jscomp$0.getUint16());tables.maxp.data[4]=isComposite>>8;tables.maxp.data[5]=isComposite&255;maxFunctionDefs=function(fpgm,prep,cvt,maxFunctionDefs){var ttContext={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};
|
|
1584
|
-
_util.warn)("TT: more functions defined than expected"),ttContext.hintsValid=!1;else for(fpgm=0,prep=ttContext.functionsUsed.length;fpgm<prep;fpgm++){if(fpgm>maxFunctionDefs){(0,_util.warn)("TT: invalid function id: "+fpgm);ttContext.hintsValid=!1;break}if(ttContext.functionsUsed[fpgm]&&!ttContext.functionsDefined[fpgm]){(0,_util.warn)("TT: undefined function: "+
|
|
1585
|
-
maxFunctionDefs);return ttContext.hintsValid}(tables.fpgm,tables.prep,tables["cvt "],maxFunctionDefs);maxFunctionDefs||(delete tables.fpgm,delete tables.prep,delete tables["cvt "]);(function(font,header,metrics,numGlyphs,dupFirstEntry){header?(font.pos=(font.start?font.start:0)+header.offset,font.pos+=4,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=
|
|
1586
|
-
font+") should not be greater than the numGlyphs ("+numGlyphs+")"),font=numGlyphs,header.data[34]=(font&65280)>>8,header.data[35]=font&255),header=numGlyphs-font-(metrics.length-4*font>>1),0<header&&(header=new Uint8Array(metrics.length+2*header),header.set(metrics.data),dupFirstEntry&&(header[metrics.length]=metrics.data[2],header[metrics.length+
|
|
1587
|
-
(function(head,numGlyphs,locaLength){head=head.data;var version=(head[0]<<24)+(head[1]<<16)+(head[2]<<8)+head[3];1!==version>>16&&((0,_util.info)("Attempting to fix invalid version in head table: "+version),head[0]=0,head[1]=1,head[2]=0,head[3]=0);version=(head[50]<<8)+head[51];if(0>
|
|
1588
|
-
1;else throw new _util.FormatError("Could not fix indexToLocFormat: "+version);})(tables.head,numGlyphs$jscomp$0,isTrueType?tables.loca.length:0);var missingGlyphs=Object.create(null);isTrueType&&(maxSizeOfInstructions=sanitizeGlyphLocations(tables.loca,tables.glyf,numGlyphs$jscomp$0,
|
|
1589
|
-
maxSizeOfInstructions.maxSizeOfInstructions>>8,tables.maxp.data[27]=maxSizeOfInstructions.maxSizeOfInstructions&255));if(!tables.hhea)throw new _util.FormatError('Required "hhea" table is not found');0===tables.hhea.data[10]&&0===tables.hhea.data[11]&&(tables.hhea.data[10]=255,tables.hhea.data[11]=
|
|
1590
|
-
8)+tables.hhea.data[5],descent:signedInt16(tables.hhea.data[6],tables.hhea.data[7])};this.ascent=version$jscomp$0.ascent/version$jscomp$0.unitsPerEm;this.descent=version$jscomp$0.descent/version$jscomp$0.unitsPerEm;tables.post&&readPostScriptTable(tables.post,properties$jscomp$0,
|
|
1591
|
-
0===cidToGidMap.length;properties$jscomp$0.cMap.forEach(function(charCode,cid){if(65535<cid)throw new _util.FormatError("Max size of CID is 65,535");var glyphId=-1;isCidToGidMapEmpty?glyphId=cid:void 0!==cidToGidMap[cid]&&(glyphId=cidToGidMap[cid]);0<=glyphId&&glyphId<
|
|
1592
|
-
var cmapEncodingId=maxFunctionDefs.encodingId;maxFunctionDefs=maxFunctionDefs.mappings;var cmapMappingsLength=maxFunctionDefs.length;if(properties$jscomp$0.hasEncoding&&(3===maxSizeOfInstructions&&1===cmapEncodingId||1===maxSizeOfInstructions&&0===cmapEncodingId)
|
|
1593
|
-
(0,_encodings.getEncoding)(properties$jscomp$0.baseEncodingName);var glyphsUnicodeMap=(0,_glyphlist.getGlyphsUnicode)();for(charCode$jscomp$0=0;256>charCode$jscomp$0;charCode$jscomp$0++){var glyphName;if(glyphName=this.differences&&charCode$jscomp$0 in
|
|
1594
|
-
glyphsUnicodeMap);var unicodeOrCharCode;3===maxSizeOfInstructions&&1===cmapEncodingId?unicodeOrCharCode=glyphsUnicodeMap[standardGlyphName]:1===maxSizeOfInstructions&&0===cmapEncodingId&&(unicodeOrCharCode=_encodings.MacRomanEncoding.indexOf(standardGlyphName));
|
|
1595
|
-
(found=properties$jscomp$0.glyphNames.indexOf(glyphName),-1===found&&standardGlyphName!==glyphName&&(found=properties$jscomp$0.glyphNames.indexOf(standardGlyphName)),0<found&&!missingGlyphs[found]&&(charCodeToGlyphId[charCode$jscomp$0]=found))}}}else if(0===
|
|
1596
|
-
0;unicodeOrCharCode<cmapMappingsLength;++unicodeOrCharCode)charCode$jscomp$0=maxFunctionDefs[unicodeOrCharCode].charCode,3===maxSizeOfInstructions&&61440<=charCode$jscomp$0&&61695>=charCode$jscomp$0&&(charCode$jscomp$0&=255),charCodeToGlyphId[charCode$jscomp$0]=
|
|
1597
|
-
unicodeOrCharCode);this.toFontChar=dupFirstEntry.toFontChar;tables.cmap={tag:"cmap",data:createCmapTable(dupFirstEntry.charCodeToGlyphId,isComposite)};tables["OS/2"]&&validateOS2Table(tables["OS/2"])||(tables["OS/2"]={tag:"OS/2",data:createOS2Table(properties$jscomp$0,
|
|
1598
|
-
tables["CFF "].data=compiler.compile()}catch(e){(0,_util.warn)("Failed to compile font "+properties$jscomp$0.loadedName)}tables.name?(properties$jscomp$0=readNameTable(tables.name),tables.name.data=createNameTable(name,properties$jscomp$0)):
|
|
1599
|
-
glyphId){var charCodes=null,charCode;for(charCode in charCodeToGlyphId)glyphId===charCodeToGlyphId[charCode]&&(charCodes||(charCodes=[]),charCodes.push(charCode|0));return charCodes}function createCharCode(charCodeToGlyphId,
|
|
1600
|
-
adjustToUnicode(properties,properties.builtInEncoding);var glyphZeroId=1;font instanceof CFFFont&&(glyphZeroId=font.numGlyphs-1);var mapping=font.getGlyphMapping(properties),newMapping=adjustMapping(mapping,font.hasGlyphId.bind(font),
|
|
1601
|
-
0;var seac=glyphZeroId[glyphId$jscomp$0],accentGlyphName=_encodings.StandardEncoding[seac[3]],baseGlyphId=charset.indexOf(_encodings.StandardEncoding[seac[2]]);accentGlyphName=charset.indexOf(accentGlyphName);
|
|
1602
|
-
charCodes
|
|
1603
|
-
glyphId$jscomp$0.addTable("CFF ",font.data);glyphId$jscomp$0.addTable("OS/2",createOS2Table(properties,newMapping.charCodeToGlyphId));glyphId$jscomp$0.addTable("cmap",createCmapTable(newMapping.charCodeToGlyphId,
|
|
1604
|
-
|
|
1605
|
-
font.cff?font.cff.widths:null,hmtx="\x00\x00\x00\x00",i=1;i<numGlyphs;i++){var width=0;charstrings?(width=charstrings[i-1],width="width"in width?width.width:0):cffWidths&&(width=Math.ceil(cffWidths[i]||0));hmtx+=string16(width)+string16(0)}return hmtx}());
|
|
1606
|
-
this)return this._shadowWidth;for(var possibleSpaceReplacements=["space","minus","one","i","I"],width,i=0,ii=possibleSpaceReplacements.length;i<ii;i++){width=possibleSpaceReplacements[i];if(width in this.widths){width=this.widths[width];
|
|
1607
|
-
width=
|
|
1608
|
-
this.
|
|
1609
|
-
"";var glyph=this.glyphCache[charcode];glyph&&glyph.matchesForCache(fontCharCode,unicode,accent,width,widthCode,operatorListId,isSpace,isInFont)||(glyph=new Glyph(fontCharCode,unicode,accent,width,
|
|
1610
|
-
Object.create(null);i<chars.length;){this.cMap.readCharCode(chars,i,ii);var glyph=ii.charcode;var length=ii.length;i+=length;length=1===length&&32===chars.charCodeAt(i-1);glyph=this.charToGlyph(glyph,
|
|
1611
|
-
error;this.loadedName="g_font_error";this.missingFile=!0}ErrorFont.prototype={charsToGlyphs:function(){return[]},exportData:function(){return{error:this.error}}};return ErrorFont}();
|
|
1612
|
-
if(j>=signatureLength){for(startIndex+=j;startIndex<streamBytesLength&&(0,_util.isSpace)(streamBytes[startIndex]);)startIndex++;found=!0;break}startIndex++}return{found:found,
|
|
1613
|
-
99];var streamStartPos=file.pos;try{var headerBytes=file.getBytes(headerBlockLength);var headerBytesLength=headerBytes.length}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
this.charstrings,
|
|
1618
|
-
0<this.charstrings[id-1].charstring.length},getSeacs:function(charstrings){var ii,seacMap=[];var i=0;for(ii=charstrings.length;i<ii;i++){var charstring=
|
|
1619
|
-
count?107:33769>count?1131:32768;var type2Subrs=[],i;for(i=0;i<bias;i++)type2Subrs.push([11]);for(i=0;i<count;i++)type2Subrs.push(type1Subrs[i]);return type2Subrs},
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1527
|
+
"font/opentype";data=this.checkAndRepair(name,file,properties);this.isOpenType&&(adjustWidths(properties),type="OpenType");break;default:throw new _util.FormatError("Font ".concat(type," is not supported"));}}catch(e){(0,_util.warn)(e);this.fallbackToSystemFont(properties);return}this.data=data;this.fontType=getFontType(type,subtype);this.fontMatrix=properties.fontMatrix;this.widths=properties.widths;this.defaultWidth=properties.defaultWidth;this.toUnicode=properties.toUnicode;this.encoding=properties.baseEncoding;
|
|
1528
|
+
this.seacMap=properties.seacMap}}}function signedInt16(b0,b1){b0=(b0<<8)+b1;return b0&32768?b0-65536:b0}function string16(value){return String.fromCharCode(value>>8&255,value&255)}function safeString16(value){value=32767<value?32767:-32768>value?-32768:value;return String.fromCharCode(value>>8&255,value&255)}function isTrueTypeCollectionFile(file){file=file.peekBytes(4);return"ttcf"===(0,_util.bytesToString)(file)}function applyStandardFontGlyphMap(map,glyphMap){for(var charCode in glyphMap)map[+charCode]=
|
|
1529
|
+
glyphMap[charCode]}function buildToFontChar(encoding,glyphsUnicodeMap,differences){for(var toFontChar=[],unicode,i=0,ii=encoding.length;i<ii;i++)unicode=(0,_unicode.getUnicodeForGlyph)(encoding[i],glyphsUnicodeMap),-1!==unicode&&(toFontChar[i]=unicode);for(var charCode in differences)unicode=(0,_unicode.getUnicodeForGlyph)(differences[charCode],glyphsUnicodeMap),-1!==unicode&&(toFontChar[+charCode]=unicode);return toFontChar}function adjustMapping(charCodeToGlyphId,hasGlyph,newGlyphZeroId){var newMap=
|
|
1530
|
+
Object.create(null),toFontChar=[],privateUseAreaIndex=0,nextAvailableFontCharCode=PRIVATE_USE_AREAS[privateUseAreaIndex][0],privateUseOffetEnd=PRIVATE_USE_AREAS[privateUseAreaIndex][1],originalCharCode;for(originalCharCode in charCodeToGlyphId){originalCharCode|=0;var glyphId=charCodeToGlyphId[originalCharCode];if(hasGlyph(glyphId)){if(nextAvailableFontCharCode>privateUseOffetEnd){privateUseAreaIndex++;if(privateUseAreaIndex>=PRIVATE_USE_AREAS.length){(0,_util.warn)("Ran out of space in font private use area.");
|
|
1531
|
+
break}nextAvailableFontCharCode=PRIVATE_USE_AREAS[privateUseAreaIndex][0];privateUseOffetEnd=PRIVATE_USE_AREAS[privateUseAreaIndex][1]}var fontCharCode=nextAvailableFontCharCode++;0===glyphId&&(glyphId=newGlyphZeroId);newMap[fontCharCode]=glyphId;toFontChar[originalCharCode]=fontCharCode}}return{toFontChar:toFontChar,charCodeToGlyphId:newMap,nextAvailableFontCharCode:nextAvailableFontCharCode}}function getRanges(glyphs,numGlyphs){var codes=[],charCode;for(charCode in glyphs)glyphs[charCode]>=numGlyphs||
|
|
1532
|
+
codes.push({fontCharCode:charCode|0,glyphId:glyphs[charCode]});0===codes.length&&codes.push({fontCharCode:0,glyphId:0});codes.sort(function(a,b){return a.fontCharCode-b.fontCharCode});glyphs=[];numGlyphs=codes.length;for(charCode=0;charCode<numGlyphs;){var start=codes[charCode].fontCharCode,codeIndices=[codes[charCode].glyphId];++charCode;for(var end=start;charCode<numGlyphs&&end+1===codes[charCode].fontCharCode&&(codeIndices.push(codes[charCode].glyphId),++end,++charCode,65535!==end););glyphs.push([start,
|
|
1533
|
+
end,codeIndices])}return glyphs}function createCmapTable(glyphs,numGlyphs){glyphs=getRanges(glyphs,numGlyphs);var numTables=65535<glyphs[glyphs.length-1][1]?2:1;numGlyphs="\x00\x00"+string16(numTables)+"\x00\u0003\x00\u0001"+(0,_util.string32)(4+8*numTables);var i,jj;for(i=glyphs.length-1;0<=i&&!(65535>=glyphs[i][0]);--i);var ii=i+1;65535>glyphs[i][0]&&65535===glyphs[i][1]&&(glyphs[i][1]=65534);var trailingRangesCount=65535>glyphs[i][1]?1:0,segCount=ii+trailingRangesCount,searchParams=OpenTypeFileBuilder.getSearchParams(segCount,
|
|
1534
|
+
2),startCount="",endCount="",idDeltas="",idRangeOffsets="",glyphsIds="",bias=0;for(i=0;i<ii;i++){var range=glyphs[i];var start=range[0];var end=range[1];startCount+=string16(start);endCount+=string16(end);var codes=range[2];range=!0;var j=1;for(jj=codes.length;j<jj;++j)if(codes[j]!==codes[j-1]+1){range=!1;break}if(range)idDeltas+=string16(codes[0]-start&65535),idRangeOffsets+=string16(0);else for(j=2*(segCount-i)+2*bias,bias+=end-start+1,idDeltas+=string16(0),idRangeOffsets+=string16(j),j=0,jj=codes.length;j<
|
|
1535
|
+
jj;++j)glyphsIds+=string16(codes[j])}0<trailingRangesCount&&(endCount+="\u00ff\u00ff",startCount+="\u00ff\u00ff",idDeltas+="\x00\u0001",idRangeOffsets+="\x00\x00");trailingRangesCount="\x00\x00"+string16(2*segCount)+string16(searchParams.range)+string16(searchParams.entry)+string16(searchParams.rangeShift)+endCount+"\x00\x00"+startCount+idDeltas+idRangeOffsets+glyphsIds;i=segCount="";if(1<numTables){numGlyphs+="\x00\u0003\x00\n"+(0,_util.string32)(8*numTables+8+trailingRangesCount.length);segCount=
|
|
1536
|
+
"";i=0;for(ii=glyphs.length;i<ii;i++){range=glyphs[i];start=range[0];codes=range[2];numTables=codes[0];j=1;for(jj=codes.length;j<jj;++j)codes[j]!==codes[j-1]+1&&(end=range[0]+j-1,segCount+=(0,_util.string32)(start)+(0,_util.string32)(end)+(0,_util.string32)(numTables),start=end+1,numTables=codes[j]);segCount+=(0,_util.string32)(start)+(0,_util.string32)(range[1])+(0,_util.string32)(numTables)}i="\x00\f\x00\x00"+(0,_util.string32)(segCount.length+16)+"\x00\x00\x00\x00"+(0,_util.string32)(segCount.length/
|
|
1537
|
+
12)}return numGlyphs+"\x00\u0004"+string16(trailingRangesCount.length+4)+trailingRangesCount+i+segCount}function validateOS2Table(os2){var stream=new _stream.Stream(os2.data),version=stream.getUint16();stream.getBytes(60);var selection=stream.getUint16();if(4>version&&selection&768)return!1;version=stream.getUint16();selection=stream.getUint16();if(version>selection)return!1;stream.getBytes(6);if(0===stream.getUint16())return!1;os2.data[8]=os2.data[9]=0;return!0}function createOS2Table(properties,
|
|
1538
|
+
charstrings,override){override=override||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};var ulUnicodeRange1=0,ulUnicodeRange2=0,ulUnicodeRange3=0,ulUnicodeRange4=0,firstCharIndex=null,lastCharIndex=0;if(charstrings){for(var code in charstrings){code|=0;if(firstCharIndex>code||!firstCharIndex)firstCharIndex=code;lastCharIndex<code&&(lastCharIndex=code);charstrings=(0,_unicode.getUnicodeRangeFor)(code);if(32>charstrings)ulUnicodeRange1|=1<<charstrings;else if(64>charstrings)ulUnicodeRange2|=1<<charstrings-
|
|
1539
|
+
32;else if(96>charstrings)ulUnicodeRange3|=1<<charstrings-64;else if(123>charstrings)ulUnicodeRange4|=1<<charstrings-96;else throw new _util.FormatError("Unicode ranges Bits > 123 are reserved for internal usage");}65535<lastCharIndex&&(lastCharIndex=65535)}else firstCharIndex=0,lastCharIndex=255;charstrings=properties.bbox||[0,0,0,0];code=override.unitsPerEm||1/(properties.fontMatrix||_util.FONT_IDENTITY_MATRIX)[0];var scale=properties.ascentScaled?1:code/1E3;code=override.ascent||Math.round(scale*
|
|
1540
|
+
(properties.ascent||charstrings[3]));scale=override.descent||Math.round(scale*(properties.descent||charstrings[1]));0<scale&&0<properties.descent&&0>charstrings[1]&&(scale=-scale);charstrings=override.yMax||code;override=-override.yMin||-scale;return"\x00\u0003\u0002$\u0001\u00f4\x00\u0005\x00\x00\u0002\u008a\u0002\u00bb\x00\x00\x00\u008c\u0002\u008a\u0002\u00bb\x00\x00\u0001\u00df\x001\u0001\u0002\x00\x00\x00\x00\u0006"+String.fromCharCode(properties.fixedPitch?9:0)+"\x00\x00\x00\x00\x00\x00"+(0,_util.string32)(ulUnicodeRange1)+
|
|
1541
|
+
(0,_util.string32)(ulUnicodeRange2)+(0,_util.string32)(ulUnicodeRange3)+(0,_util.string32)(ulUnicodeRange4)+"*21*"+string16(properties.italicAngle?1:0)+string16(firstCharIndex||properties.firstChar)+string16(lastCharIndex||properties.lastChar)+string16(code)+string16(scale)+"\x00d"+string16(charstrings)+string16(override)+"\x00\x00\x00\x00\x00\x00\x00\x00"+string16(properties.xHeight)+string16(properties.capHeight)+string16(0)+string16(firstCharIndex||properties.firstChar)+"\x00\u0003"}function createPostTable(properties){return"\x00\u0003\x00\x00"+
|
|
1542
|
+
(0,_util.string32)(Math.floor(properties.italicAngle*Math.pow(2,16)))+"\x00\x00\x00\x00"+(0,_util.string32)(properties.fixedPitch)+"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}function createNameTable(name,proto){proto||(proto=[[],[]]);name=[proto[0][0]||"Original licence",proto[0][1]||name,proto[0][2]||"Unknown",proto[0][3]||"uniqueID",proto[0][4]||name,proto[0][5]||"Version 0.11",proto[0][6]||"",proto[0][7]||"Unknown",proto[0][8]||"Unknown",proto[0][9]||"Unknown"];var stringsUnicode=
|
|
1543
|
+
[],ii,jj;var i=0;for(ii=name.length;i<ii;i++){var str=proto[1][i]||name[i];var strBufUnicode=[];var j=0;for(jj=str.length;j<jj;j++)strBufUnicode.push(string16(str.charCodeAt(j)));stringsUnicode.push(strBufUnicode.join(""))}proto=[name,stringsUnicode];strBufUnicode=["\x00\u0001","\x00\u0003"];var encodings=["\x00\x00","\x00\u0001"],languages=["\x00\x00","\u0004\t"];i=name.length*strBufUnicode.length;var nameTable="\x00\x00"+string16(i)+string16(12*i+6),strOffset=0;i=0;for(ii=strBufUnicode.length;i<
|
|
1544
|
+
ii;i++){var strs=proto[i];j=0;for(jj=strs.length;j<jj;j++){str=strs[j];var nameRecord=strBufUnicode[i]+encodings[i]+languages[i]+string16(j)+string16(str.length)+string16(strOffset);nameTable+=nameRecord;strOffset+=str.length}}return nameTable+=name.join("")+stringsUnicode.join("")}Font.getFontID=function(){var ID=1;return function(){return String(ID++)}}();Font.prototype={name:null,font:null,mimetype:null,encoding:null,disableFontFace:!1,get renderer(){var renderer=_font_renderer.FontRendererFactory.create(this,
|
|
1545
|
+
!0);return(0,_util.shadow)(this,"renderer",renderer)},exportData:function(){var data={},i;for(i in this)this.hasOwnProperty(i)&&(data[i]=this[i]);return data},fallbackToSystemFont:function(properties){var _this=this;this.missingFile=!0;var unicode,name=this.name,type=this.type,subtype=this.subtype,fontName=name.replace(/[,_]/g,"-"),stdFontMap=(0,_standard_fonts.getStdFontMap)(),nonStdFontMap=(0,_standard_fonts.getNonStdFontMap)(),isStandardFont=!!stdFontMap[fontName]||!(!nonStdFontMap[fontName]||
|
|
1546
|
+
!stdFontMap[nonStdFontMap[fontName]]);fontName=stdFontMap[fontName]||nonStdFontMap[fontName]||fontName;this.bold=-1!==fontName.search(/bold/gi);this.italic=-1!==fontName.search(/oblique/gi)||-1!==fontName.search(/italic/gi);this.black=-1!==name.search(/Black/g);this.remeasure=0<Object.keys(this.widths).length;if(isStandardFont&&"CIDFontType2"===type&&this.cidEncoding.startsWith("Identity-")){var cidToGidMap=properties.cidToGidMap,map=[];applyStandardFontGlyphMap(map,(0,_standard_fonts.getGlyphMapForStandardFonts)());
|
|
1547
|
+
/Arial-?Black/i.test(name)?applyStandardFontGlyphMap(map,(0,_standard_fonts.getSupplementalGlyphMapForArialBlack)()):/Calibri/i.test(name)&&applyStandardFontGlyphMap(map,(0,_standard_fonts.getSupplementalGlyphMapForCalibri)());if(cidToGidMap){for(var _charCode in map)name=map[_charCode],void 0!==cidToGidMap[name]&&(map[+_charCode]=cidToGidMap[name]);cidToGidMap.length!==this.toUnicode.length&&properties.hasIncludedToUnicodeMap&&this.toUnicode instanceof IdentityToUnicodeMap&&this.toUnicode.forEach(function(charCode,
|
|
1548
|
+
unicodeCharCode){void 0===cidToGidMap[map[charCode]]&&(map[+charCode]=unicodeCharCode)})}this.toUnicode instanceof IdentityToUnicodeMap||this.toUnicode.forEach(function(charCode,unicodeCharCode){map[+charCode]=unicodeCharCode});this.toFontChar=map;this.toUnicode=new ToUnicodeMap(map)}else if(/Symbol/i.test(fontName))this.toFontChar=buildToFontChar(_encodings.SymbolSetEncoding,(0,_glyphlist.getGlyphsUnicode)(),this.differences);else if(/Dingbats/i.test(fontName))/Wingdings/i.test(name)&&(0,_util.warn)("Non-embedded Wingdings font, falling back to ZapfDingbats."),
|
|
1549
|
+
this.toFontChar=buildToFontChar(_encodings.ZapfDingbatsEncoding,(0,_glyphlist.getDingbatsGlyphsUnicode)(),this.differences);else if(isStandardFont)this.toFontChar=buildToFontChar(this.defaultEncoding,(0,_glyphlist.getGlyphsUnicode)(),this.differences);else{var glyphsUnicodeMap=(0,_glyphlist.getGlyphsUnicode)(),_map=[];this.toUnicode.forEach(function(charCode,unicodeCharCode){_this.composite||(unicode=(0,_unicode.getUnicodeForGlyph)(_this.differences[charCode]||_this.defaultEncoding[charCode],glyphsUnicodeMap),
|
|
1550
|
+
-1!==unicode&&(unicodeCharCode=unicode));_map[+charCode]=unicodeCharCode});this.composite&&this.toUnicode instanceof IdentityToUnicodeMap&&/Verdana/i.test(name)&&applyStandardFontGlyphMap(_map,(0,_standard_fonts.getGlyphMapForStandardFonts)());this.toFontChar=_map}this.loadedName=fontName.split("-")[0];this.fontType=getFontType(type,subtype)},checkAndRepair:function(name,font$jscomp$0,properties$jscomp$0){function readTables(file,numTables){file=Object.create(null);file["OS/2"]=null;file.cmap=null;
|
|
1551
|
+
file.head=null;file.hhea=null;file.hmtx=null;file.maxp=null;file.name=null;file.post=null;for(var i=0;i<numTables;i++){var table=font$jscomp$0;var tag=(0,_util.bytesToString)(table.getBytes(4)),checksum=table.getInt32()>>>0,offset=table.getInt32()>>>0,length=table.getInt32()>>>0,previousPosition=table.pos;table.pos=table.start?table.start:0;table.skip(offset);var data=table.getBytes(length);table.pos=previousPosition;"head"===tag&&(data[8]=data[9]=data[10]=data[11]=0,data[17]|=32);table={tag:tag,
|
|
1552
|
+
checksum:checksum,length:length,offset:offset,data:data};VALID_TABLES.includes(table.tag)&&0!==table.length&&(file[table.tag]=table)}return file}function readOpenTypeHeader(ttf){return{version:(0,_util.bytesToString)(ttf.getBytes(4)),numTables:ttf.getUint16(),searchRange:ttf.getUint16(),entrySelector:ttf.getUint16(),rangeShift:ttf.getUint16()}}function readTrueTypeCollectionData(ttc,fontName){a:{var _readTrueTypeCollecti=(0,_util.bytesToString)(ttc.getBytes(4));(0,_util.assert)("ttcf"===_readTrueTypeCollecti,
|
|
1553
|
+
"Must be a TrueType Collection font.");for(var majorVersion=ttc.getUint16(),minorVersion=ttc.getUint16(),numFonts=ttc.getInt32()>>>0,offsetTable=[],i=0;i<numFonts;i++)offsetTable.push(ttc.getInt32()>>>0);_readTrueTypeCollecti={ttcTag:_readTrueTypeCollecti,majorVersion:majorVersion,minorVersion:minorVersion,numFonts:numFonts,offsetTable:offsetTable};switch(majorVersion){case 1:break a;case 2:_readTrueTypeCollecti.dsigTag=ttc.getInt32()>>>0;_readTrueTypeCollecti.dsigLength=ttc.getInt32()>>>0;_readTrueTypeCollecti.dsigOffset=
|
|
1554
|
+
ttc.getInt32()>>>0;break a}throw new _util.FormatError("Invalid TrueType Collection majorVersion: ".concat(majorVersion,"."));}majorVersion=_readTrueTypeCollecti.numFonts;_readTrueTypeCollecti=_readTrueTypeCollecti.offsetTable;for(minorVersion=0;minorVersion<majorVersion;minorVersion++){ttc.pos=(ttc.start||0)+_readTrueTypeCollecti[minorVersion];numFonts=readOpenTypeHeader(ttc);offsetTable=readTables(ttc,numFonts.numTables);if(!offsetTable.name)throw new _util.FormatError('TrueType Collection font must contain a "name" table.');
|
|
1555
|
+
i=readNameTable(offsetTable.name);for(var j=0,jj=i.length;j<jj;j++)for(var k=0,kk=i[j].length;k<kk;k++){var nameEntry=i[j][k];if(nameEntry&&nameEntry.replace(/\s/g,"")===fontName)return{header:numFonts,tables:offsetTable}}}throw new _util.FormatError('TrueType Collection does not contain "'.concat(fontName,'" font.'));}function readCmapTable(cmap,font,isSymbolicFont,hasEncoding){if(!cmap)return(0,_util.warn)("No cmap table available."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};var segment;
|
|
1556
|
+
cmap=(font.start?font.start:0)+cmap.offset;font.pos=cmap;font.getUint16();var numTables=font.getUint16(),potentialTable,canBreak=!1;for(segment=0;segment<numTables;segment++){var platformId=font.getUint16(),encodingId=font.getUint16(),offset=font.getInt32()>>>0,useTable=!1;if(!potentialTable||potentialTable.platformId!==platformId||potentialTable.encodingId!==encodingId)if(0===platformId&&0===encodingId?useTable=!0:1===platformId&&0===encodingId?useTable=!0:3!==platformId||1!==encodingId||!hasEncoding&&
|
|
1557
|
+
potentialTable?isSymbolicFont&&3===platformId&&0===encodingId&&(canBreak=useTable=!0):(useTable=!0,isSymbolicFont||(canBreak=!0)),useTable&&(potentialTable={platformId:platformId,encodingId:encodingId,offset:offset}),canBreak)break}potentialTable&&(font.pos=cmap+potentialTable.offset);if(!potentialTable||-1===font.peekByte())return(0,_util.warn)("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};cmap=font.getUint16();font.getUint16();font.getUint16();
|
|
1558
|
+
hasEncoding=!1;isSymbolicFont=[];if(0===cmap){for(segment=0;256>segment;segment++)(cmap=font.getByte())&&isSymbolicFont.push({charCode:segment,glyphId:cmap});hasEncoding=!0}else if(4===cmap){numTables=font.getUint16()>>1;font.getBytes(6);platformId=[];for(canBreak=0;canBreak<numTables;canBreak++)platformId.push({end:font.getUint16()});font.getUint16();for(canBreak=0;canBreak<numTables;canBreak++)platformId[canBreak].start=font.getUint16();for(canBreak=0;canBreak<numTables;canBreak++)platformId[canBreak].delta=
|
|
1559
|
+
font.getUint16();for(canBreak=cmap=0;canBreak<numTables;canBreak++)segment=platformId[canBreak],(encodingId=font.getUint16())?(offset=(encodingId>>1)-(numTables-canBreak),segment.offsetIndex=offset,cmap=Math.max(cmap,offset+segment.end-segment.start+1)):segment.offsetIndex=-1;useTable=[];for(segment=0;segment<cmap;segment++)useTable.push(font.getUint16());for(canBreak=0;canBreak<numTables;canBreak++){segment=platformId[canBreak];cmap=segment.start;font=segment.end;var delta=segment.delta;offset=segment.offsetIndex;
|
|
1560
|
+
for(segment=cmap;segment<=font;segment++)65535!==segment&&(encodingId=0>offset?segment:useTable[offset+segment-cmap],encodingId=encodingId+delta&65535,isSymbolicFont.push({charCode:segment,glyphId:encodingId}))}}else if(6===cmap)for(cmap=font.getUint16(),numTables=font.getUint16(),segment=0;segment<numTables;segment++)encodingId=font.getUint16(),isSymbolicFont.push({charCode:cmap+segment,glyphId:encodingId});else return(0,_util.warn)("cmap table has unsupported format: "+cmap),{platformId:-1,encodingId:-1,
|
|
1561
|
+
mappings:[],hasShortCmap:!1};isSymbolicFont.sort(function(a,b){return a.charCode-b.charCode});for(segment=1;segment<isSymbolicFont.length;segment++)isSymbolicFont[segment-1].charCode===isSymbolicFont[segment].charCode&&(isSymbolicFont.splice(segment,1),segment--);return{platformId:potentialTable.platformId,encodingId:potentialTable.encodingId,mappings:isSymbolicFont,hasShortCmap:hasEncoding}}function sanitizeGlyph(source,sourceStart,sourceEnd,dest,destStart,hintsValid){var glyphProfile={length:0,
|
|
1562
|
+
sizeOfInstructions:0};if(12>=sourceEnd-sourceStart)return glyphProfile;source=source.subarray(sourceStart,sourceEnd);var contoursCount=signedInt16(source[0],source[1]);if(0>contoursCount)return source[1]=-1,source[0]=16777215,dest.set(source,destStart),glyphProfile.length=source.length,glyphProfile;sourceEnd=10;var flagsCount=0;for(sourceStart=0;sourceStart<contoursCount;sourceStart++)flagsCount=(source[sourceEnd]<<8|source[sourceEnd+1])+1,sourceEnd+=2;contoursCount=sourceEnd;var instructionsLength=
|
|
1563
|
+
source[sourceEnd]<<8|source[sourceEnd+1];glyphProfile.sizeOfInstructions=instructionsLength;var instructionsEnd=sourceEnd+=2+instructionsLength,coordinatesLength=0;for(sourceStart=0;sourceStart<flagsCount;sourceStart++){var flag=source[sourceEnd++];flag&192&&(source[sourceEnd-1]=flag&63);var xyLength=(flag&2?1:flag&16?0:2)+(flag&4?1:flag&32?0:2);coordinatesLength+=xyLength;flag&8&&(flag=source[sourceEnd++],sourceStart+=flag,coordinatesLength+=flag*xyLength)}if(0===coordinatesLength)return glyphProfile;
|
|
1564
|
+
sourceStart=sourceEnd+coordinatesLength;if(sourceStart>source.length)return glyphProfile;if(!hintsValid&&0<instructionsLength)return dest.set(source.subarray(0,contoursCount),destStart),dest.set([0,0],destStart+contoursCount),dest.set(source.subarray(instructionsEnd,sourceStart),destStart+contoursCount+2),sourceStart-=instructionsLength,3<source.length-sourceStart&&(sourceStart=sourceStart+3&-4),glyphProfile.length=sourceStart,glyphProfile;if(3<source.length-sourceStart)return sourceStart=sourceStart+
|
|
1565
|
+
3&-4,dest.set(source.subarray(0,sourceStart),destStart),glyphProfile.length=sourceStart,glyphProfile;dest.set(source,destStart);glyphProfile.length=source.length;return glyphProfile}function sanitizeGlyphLocations(loca,glyf,numGlyphs,isGlyphLocationsLong,hintsValid,dupFirstEntry,maxSizeOfInstructions){if(isGlyphLocationsLong){isGlyphLocationsLong=4;var itemDecode=function(data,offset){return data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3]};var itemEncode=function(data,offset,
|
|
1566
|
+
value){data[offset]=value>>>24&255;data[offset+1]=value>>16&255;data[offset+2]=value>>8&255;data[offset+3]=value&255}}else isGlyphLocationsLong=2,itemDecode=function(data,offset){return data[offset]<<9|data[offset+1]<<1},itemEncode=function(data,offset,value){data[offset]=value>>9&255;data[offset+1]=value>>1&255};var numGlyphsOut=dupFirstEntry?numGlyphs+1:numGlyphs,locaDataSize=isGlyphLocationsLong*(1+numGlyphsOut),locaData=new Uint8Array(locaDataSize);locaData.set(loca.data.subarray(0,locaDataSize));
|
|
1567
|
+
loca.data=locaData;var oldGlyfData=glyf.data,oldGlyfDataLength=oldGlyfData.length,newGlyfData=new Uint8Array(oldGlyfDataLength),startOffset=itemDecode(locaData,0),writeOffset=0;locaDataSize=Object.create(null);itemEncode(locaData,0,writeOffset);var j;var i=0;for(j=isGlyphLocationsLong;i<numGlyphs;i++,j+=isGlyphLocationsLong){var endOffset=itemDecode(locaData,j);0===endOffset&&(endOffset=startOffset);endOffset>oldGlyfDataLength&&(oldGlyfDataLength+3&-4)===endOffset&&(endOffset=oldGlyfDataLength);endOffset>
|
|
1568
|
+
oldGlyfDataLength&&(startOffset=endOffset);startOffset=sanitizeGlyph(oldGlyfData,startOffset,endOffset,newGlyfData,writeOffset,hintsValid);var newLength=startOffset.length;0===newLength&&(locaDataSize[i]=!0);startOffset.sizeOfInstructions>maxSizeOfInstructions&&(maxSizeOfInstructions=startOffset.sizeOfInstructions);writeOffset+=newLength;itemEncode(locaData,j,writeOffset);startOffset=endOffset}if(0===writeOffset){loca=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);i=0;for(j=isGlyphLocationsLong;i<
|
|
1569
|
+
numGlyphsOut;i++,j+=isGlyphLocationsLong)itemEncode(locaData,j,loca.length);glyf.data=loca}else dupFirstEntry?(numGlyphs=itemDecode(locaData,isGlyphLocationsLong),newGlyfData.length>numGlyphs+writeOffset?glyf.data=newGlyfData.subarray(0,numGlyphs+writeOffset):(glyf.data=new Uint8Array(numGlyphs+writeOffset),glyf.data.set(newGlyfData.subarray(0,writeOffset))),glyf.data.set(newGlyfData.subarray(0,numGlyphs),writeOffset),itemEncode(loca.data,locaData.length-isGlyphLocationsLong,writeOffset+numGlyphs)):
|
|
1570
|
+
glyf.data=newGlyfData.subarray(0,writeOffset);return{missingGlyphs:locaDataSize,maxSizeOfInstructions:maxSizeOfInstructions}}function readPostScriptTable(post,properties,maxpNumGlyphs){var start=(font$jscomp$0.start?font$jscomp$0.start:0)+post.offset;font$jscomp$0.pos=start;start+=post.length;var version=font$jscomp$0.getInt32();font$jscomp$0.getBytes(28);post=!0;switch(version){case 65536:var glyphNames=MacStandardGlyphOrdering;break;case 131072:version=font$jscomp$0.getUint16();if(version!==maxpNumGlyphs){post=
|
|
1571
|
+
!1;break}var glyphNameIndexes=[];for(maxpNumGlyphs=0;maxpNumGlyphs<version;++maxpNumGlyphs){var index=font$jscomp$0.getUint16();if(32768<=index){post=!1;break}glyphNameIndexes.push(index)}if(!post)break;index=[];for(glyphNames=[];font$jscomp$0.pos<start;){var stringLength=font$jscomp$0.getByte();glyphNames.length=stringLength;for(maxpNumGlyphs=0;maxpNumGlyphs<stringLength;++maxpNumGlyphs)glyphNames[maxpNumGlyphs]=String.fromCharCode(font$jscomp$0.getByte());index.push(glyphNames.join(""))}glyphNames=
|
|
1572
|
+
[];for(maxpNumGlyphs=0;maxpNumGlyphs<version;++maxpNumGlyphs)start=glyphNameIndexes[maxpNumGlyphs],258>start?glyphNames.push(MacStandardGlyphOrdering[start]):glyphNames.push(index[start-258]);break;case 196608:break;default:(0,_util.warn)("Unknown/unsupported post table version "+version),post=!1,properties.defaultEncoding&&(glyphNames=properties.defaultEncoding)}properties.glyphNames=glyphNames;return post}function readNameTable(nameTable){var start=(font$jscomp$0.start?font$jscomp$0.start:0)+nameTable.offset;
|
|
1573
|
+
font$jscomp$0.pos=start;var names=[[],[]],length=nameTable.length;nameTable=start+length;if(0!==font$jscomp$0.getUint16()||6>length)return names;var numRecords=font$jscomp$0.getUint16();length=font$jscomp$0.getUint16();var records=[],i;for(i=0;i<numRecords&&font$jscomp$0.pos+12<=nameTable;i++){var r={platform:font$jscomp$0.getUint16(),encoding:font$jscomp$0.getUint16(),language:font$jscomp$0.getUint16(),name:font$jscomp$0.getUint16(),length:font$jscomp$0.getUint16(),offset:font$jscomp$0.getUint16()};
|
|
1574
|
+
(1===r.platform&&0===r.encoding&&0===r.language||3===r.platform&&1===r.encoding&&1033===r.language)&&records.push(r)}i=0;for(numRecords=records.length;i<numRecords;i++)if(r=records[i],!(0>=r.length)){var pos=start+length+r.offset;if(!(pos+r.length>nameTable))if(font$jscomp$0.pos=pos,pos=r.name,r.encoding){var str="",j=0;for(r=r.length;j<r;j+=2)str+=String.fromCharCode(font$jscomp$0.getUint16());names[1][pos]=str}else names[0][pos]=(0,_util.bytesToString)(font$jscomp$0.getBytes(r.length))}return names}
|
|
1575
|
+
function sanitizeTTProgram(table,ttContext){for(var data=table.data,i=0,j,n,b,lastEndf=0,lastDeff=0,stack=[],callstack=[],functionsCalled=[],tooComplexToFollowFunctions=ttContext.tooComplexToFollowFunctions,inFDEF=!1,ifLevel=0,inELSE=0,ii=data.length;i<ii;){var op=data[i++];if(64===op)if(n=data[i++],inFDEF||inELSE)i+=n;else for(j=0;j<n;j++)stack.push(data[i++]);else if(65===op)if(n=data[i++],inFDEF||inELSE)i+=2*n;else for(j=0;j<n;j++)b=data[i++],stack.push(b<<8|data[i++]);else if(176===(op&248))if(n=
|
|
1576
|
+
op-176+1,inFDEF||inELSE)i+=n;else for(j=0;j<n;j++)stack.push(data[i++]);else if(184===(op&248))if(n=op-184+1,inFDEF||inELSE)i+=2*n;else for(j=0;j<n;j++)b=data[i++],stack.push(b<<8|data[i++]);else if(43!==op||tooComplexToFollowFunctions)if(44!==op||tooComplexToFollowFunctions)if(45===op)if(inFDEF)inFDEF=!1,lastEndf=i;else{j=callstack.pop();if(!j){(0,_util.warn)("TT: ENDF bad stack");ttContext.hintsValid=!1;return}n=functionsCalled.pop();data=j.data;i=j.i;ttContext.functionsStackDeltas[n]=stack.length-
|
|
1577
|
+
j.stackTop}else if(137===op){if(inFDEF||inELSE)(0,_util.warn)("TT: nested IDEFs not allowed"),tooComplexToFollowFunctions=!0;inFDEF=!0;lastDeff=i}else 88===op?++ifLevel:27===op?inELSE=ifLevel:89===op?(inELSE===ifLevel&&(inELSE=0),--ifLevel):28!==op||inFDEF||inELSE||(n=stack[stack.length-1],0<n&&(i+=n-1));else{if(inFDEF||inELSE)(0,_util.warn)("TT: nested FDEFs not allowed"),tooComplexToFollowFunctions=!0;inFDEF=!0;lastDeff=i;n=stack.pop();ttContext.functionsDefined[n]={data:data,i:i}}else if(!inFDEF&&
|
|
1578
|
+
!inELSE)if(n=stack[stack.length-1],isNaN(n))(0,_util.info)("TT: CALL empty stack (or invalid entry).");else if(ttContext.functionsUsed[n]=!0,n in ttContext.functionsStackDeltas){n=stack.length+ttContext.functionsStackDeltas[n];if(0>n){(0,_util.warn)("TT: CALL invalid functions stack delta.");ttContext.hintsValid=!1;return}stack.length=n}else if(n in ttContext.functionsDefined&&!functionsCalled.includes(n)){callstack.push({data:data,i:i,stackTop:stack.length-1});functionsCalled.push(n);j=ttContext.functionsDefined[n];
|
|
1579
|
+
if(!j){(0,_util.warn)("TT: CALL non-existent function");ttContext.hintsValid=!1;return}data=j.data;i=j.i}if(!inFDEF&&!inELSE){j=142>=op?TTOpsStackDeltas[op]:192<=op&&223>=op?-1:224<=op?-2:0;113<=op&&117>=op&&(n=stack.pop(),isNaN(n)||(j=2*-n));for(;0>j&&0<stack.length;)stack.pop(),j++;for(;0<j;)stack.push(NaN),j--}}ttContext.tooComplexToFollowFunctions=tooComplexToFollowFunctions;ttContext=[data];i>data.length&&ttContext.push(new Uint8Array(i-data.length));lastDeff>lastEndf&&((0,_util.warn)("TT: complementing a missing function tail"),
|
|
1580
|
+
ttContext.push(new Uint8Array([34,45])));if(1<ttContext.length){i=data=0;for(lastEndf=ttContext.length;i<lastEndf;i++)data+=ttContext[i].length;data=data+3&-4;lastDeff=new Uint8Array(data);i=stack=0;for(lastEndf=ttContext.length;i<lastEndf;i++)lastDeff.set(ttContext[i],stack),stack+=ttContext[i].length;table.data=lastDeff;table.length=data}}var VALID_TABLES="OS/2;cmap;head;hhea;hmtx;maxp;name;post;loca;glyf;fpgm;prep;cvt ;CFF ".split(";"),TTOpsStackDeltas=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,
|
|
1581
|
+
-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];font$jscomp$0=new _stream.Stream(new Uint8Array(font$jscomp$0.getBytes()));if(isTrueTypeCollectionFile(font$jscomp$0)){var tables=readTrueTypeCollectionData(font$jscomp$0,
|
|
1582
|
+
this.name);var header$jscomp$0=tables.header;tables=tables.tables}else header$jscomp$0=readOpenTypeHeader(font$jscomp$0),tables=readTables(font$jscomp$0,header$jscomp$0.numTables);var isTrueType=!tables["CFF "];if(isTrueType){if(!tables.loca)throw new _util.FormatError('Required "loca" table is not found');tables.glyf||((0,_util.warn)('Required "glyf" table is not found -- trying to recover.'),tables.glyf={tag:"glyf",data:new Uint8Array(0)});this.isOpenType=!1}else{var isComposite=properties$jscomp$0.composite&&
|
|
1583
|
+
(0<(properties$jscomp$0.cidToGidMap||[]).length||!(properties$jscomp$0.cMap instanceof _cmap.IdentityCMap));if("OTTO"===header$jscomp$0.version&&!isComposite||!tables.head||!tables.hhea||!tables.maxp||!tables.post){var cffFile=new _stream.Stream(tables["CFF "].data);var cff=new CFFFont(cffFile,properties$jscomp$0);adjustWidths(properties$jscomp$0);return this.convert(name,cff,properties$jscomp$0)}delete tables.glyf;delete tables.loca;delete tables.fpgm;delete tables.prep;delete tables["cvt "];this.isOpenType=
|
|
1584
|
+
!0}if(!tables.maxp)throw new _util.FormatError('Required "maxp" table is not found');font$jscomp$0.pos=(font$jscomp$0.start||0)+tables.maxp.offset;var version$jscomp$0=font$jscomp$0.getInt32(),numGlyphs$jscomp$0=font$jscomp$0.getUint16();isComposite=numGlyphs$jscomp$0+1;var dupFirstEntry=!0;65535<isComposite&&(dupFirstEntry=!1,isComposite=numGlyphs$jscomp$0,(0,_util.warn)("Not enough space in glyfs to duplicate first glyph."));var maxFunctionDefs=0,maxSizeOfInstructions=0;65536<=version$jscomp$0&&
|
|
1585
|
+
22<=tables.maxp.length&&(font$jscomp$0.pos+=8,2<font$jscomp$0.getUint16()&&(tables.maxp.data[14]=0,tables.maxp.data[15]=2),font$jscomp$0.pos+=4,maxFunctionDefs=font$jscomp$0.getUint16(),font$jscomp$0.pos+=4,maxSizeOfInstructions=font$jscomp$0.getUint16());tables.maxp.data[4]=isComposite>>8;tables.maxp.data[5]=isComposite&255;maxFunctionDefs=function(fpgm,prep,cvt,maxFunctionDefs){var ttContext={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};
|
|
1586
|
+
fpgm&&sanitizeTTProgram(fpgm,ttContext);prep&&sanitizeTTProgram(prep,ttContext);if(fpgm&&!ttContext.tooComplexToFollowFunctions)if(ttContext.functionsDefined.length>maxFunctionDefs)(0,_util.warn)("TT: more functions defined than expected"),ttContext.hintsValid=!1;else for(fpgm=0,prep=ttContext.functionsUsed.length;fpgm<prep;fpgm++){if(fpgm>maxFunctionDefs){(0,_util.warn)("TT: invalid function id: "+fpgm);ttContext.hintsValid=!1;break}if(ttContext.functionsUsed[fpgm]&&!ttContext.functionsDefined[fpgm]){(0,_util.warn)("TT: undefined function: "+
|
|
1587
|
+
fpgm);ttContext.hintsValid=!1;break}}cvt&&cvt.length&1&&(maxFunctionDefs=new Uint8Array(cvt.length+1),maxFunctionDefs.set(cvt.data),cvt.data=maxFunctionDefs);return ttContext.hintsValid}(tables.fpgm,tables.prep,tables["cvt "],maxFunctionDefs);maxFunctionDefs||(delete tables.fpgm,delete tables.prep,delete tables["cvt "]);(function(font,header,metrics,numGlyphs,dupFirstEntry){header?(font.pos=(font.start?font.start:0)+header.offset,font.pos+=4,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=
|
|
1588
|
+
2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=2,font.pos+=8,font.pos+=2,font=font.getUint16(),font>numGlyphs&&((0,_util.info)("The numOfMetrics ("+font+") should not be greater than the numGlyphs ("+numGlyphs+")"),font=numGlyphs,header.data[34]=(font&65280)>>8,header.data[35]=font&255),header=numGlyphs-font-(metrics.length-4*font>>1),0<header&&(header=new Uint8Array(metrics.length+2*header),header.set(metrics.data),dupFirstEntry&&(header[metrics.length]=metrics.data[2],header[metrics.length+
|
|
1589
|
+
1]=metrics.data[3]),metrics.data=header)):metrics&&(metrics.data=null)})(font$jscomp$0,tables.hhea,tables.hmtx,isComposite,dupFirstEntry);if(!tables.head)throw new _util.FormatError('Required "head" table is not found');(function(head,numGlyphs,locaLength){head=head.data;var version=(head[0]<<24)+(head[1]<<16)+(head[2]<<8)+head[3];1!==version>>16&&((0,_util.info)("Attempting to fix invalid version in head table: "+version),head[0]=0,head[1]=1,head[2]=0,head[3]=0);version=(head[50]<<8)+head[51];if(0>
|
|
1590
|
+
version||1<version)if((0,_util.info)("Attempting to fix invalid indexToLocFormat in head table: "+version),numGlyphs+=1,locaLength===numGlyphs<<1)head[50]=0,head[51]=0;else if(locaLength===numGlyphs<<2)head[50]=0,head[51]=1;else throw new _util.FormatError("Could not fix indexToLocFormat: "+version);})(tables.head,numGlyphs$jscomp$0,isTrueType?tables.loca.length:0);var missingGlyphs=Object.create(null);isTrueType&&(maxSizeOfInstructions=sanitizeGlyphLocations(tables.loca,tables.glyf,numGlyphs$jscomp$0,
|
|
1591
|
+
(tables.head.data[50]<<8)+tables.head.data[51],maxFunctionDefs,dupFirstEntry,maxSizeOfInstructions),missingGlyphs=maxSizeOfInstructions.missingGlyphs,65536<=version$jscomp$0&&22<=tables.maxp.length&&(tables.maxp.data[26]=maxSizeOfInstructions.maxSizeOfInstructions>>8,tables.maxp.data[27]=maxSizeOfInstructions.maxSizeOfInstructions&255));if(!tables.hhea)throw new _util.FormatError('Required "hhea" table is not found');0===tables.hhea.data[10]&&0===tables.hhea.data[11]&&(tables.hhea.data[10]=255,tables.hhea.data[11]=
|
|
1592
|
+
255);version$jscomp$0={unitsPerEm:(tables.head.data[18]<<8)+tables.head.data[19],yMax:(tables.head.data[42]<<8)+tables.head.data[43],yMin:signedInt16(tables.head.data[38],tables.head.data[39]),ascent:(tables.hhea.data[4]<<8)+tables.hhea.data[5],descent:signedInt16(tables.hhea.data[6],tables.hhea.data[7])};this.ascent=version$jscomp$0.ascent/version$jscomp$0.unitsPerEm;this.descent=version$jscomp$0.descent/version$jscomp$0.unitsPerEm;tables.post&&readPostScriptTable(tables.post,properties$jscomp$0,
|
|
1593
|
+
numGlyphs$jscomp$0);tables.post={tag:"post",data:createPostTable(properties$jscomp$0)};var charCodeToGlyphId=[],charCode$jscomp$0;if(properties$jscomp$0.composite){var cidToGidMap=properties$jscomp$0.cidToGidMap||[],isCidToGidMapEmpty=0===cidToGidMap.length;properties$jscomp$0.cMap.forEach(function(charCode,cid){if(65535<cid)throw new _util.FormatError("Max size of CID is 65,535");var glyphId=-1;isCidToGidMapEmpty?glyphId=cid:void 0!==cidToGidMap[cid]&&(glyphId=cidToGidMap[cid]);0<=glyphId&&glyphId<
|
|
1594
|
+
numGlyphs$jscomp$0&&!missingGlyphs[glyphId]&&(charCodeToGlyphId[charCode]=glyphId)})}else{maxFunctionDefs=readCmapTable(tables.cmap,font$jscomp$0,this.isSymbolicFont,properties$jscomp$0.hasEncoding);maxSizeOfInstructions=maxFunctionDefs.platformId;var cmapEncodingId=maxFunctionDefs.encodingId;maxFunctionDefs=maxFunctionDefs.mappings;var cmapMappingsLength=maxFunctionDefs.length;if(properties$jscomp$0.hasEncoding&&(3===maxSizeOfInstructions&&1===cmapEncodingId||1===maxSizeOfInstructions&&0===cmapEncodingId)||
|
|
1595
|
+
-1===maxSizeOfInstructions&&-1===cmapEncodingId&&(0,_encodings.getEncoding)(properties$jscomp$0.baseEncodingName)){var baseEncoding=[];if("MacRomanEncoding"===properties$jscomp$0.baseEncodingName||"WinAnsiEncoding"===properties$jscomp$0.baseEncodingName)baseEncoding=(0,_encodings.getEncoding)(properties$jscomp$0.baseEncodingName);var glyphsUnicodeMap=(0,_glyphlist.getGlyphsUnicode)();for(charCode$jscomp$0=0;256>charCode$jscomp$0;charCode$jscomp$0++){var glyphName;if(glyphName=this.differences&&charCode$jscomp$0 in
|
|
1596
|
+
this.differences?this.differences[charCode$jscomp$0]:charCode$jscomp$0 in baseEncoding&&""!==baseEncoding[charCode$jscomp$0]?baseEncoding[charCode$jscomp$0]:_encodings.StandardEncoding[charCode$jscomp$0]){var standardGlyphName=recoverGlyphName(glyphName,glyphsUnicodeMap);var unicodeOrCharCode;3===maxSizeOfInstructions&&1===cmapEncodingId?unicodeOrCharCode=glyphsUnicodeMap[standardGlyphName]:1===maxSizeOfInstructions&&0===cmapEncodingId&&(unicodeOrCharCode=_encodings.MacRomanEncoding.indexOf(standardGlyphName));
|
|
1597
|
+
for(var found=!1,i$jscomp$0=0;i$jscomp$0<cmapMappingsLength;++i$jscomp$0)if(maxFunctionDefs[i$jscomp$0].charCode===unicodeOrCharCode){charCodeToGlyphId[charCode$jscomp$0]=maxFunctionDefs[i$jscomp$0].glyphId;found=!0;break}!found&&properties$jscomp$0.glyphNames&&(found=properties$jscomp$0.glyphNames.indexOf(glyphName),-1===found&&standardGlyphName!==glyphName&&(found=properties$jscomp$0.glyphNames.indexOf(standardGlyphName)),0<found&&!missingGlyphs[found]&&(charCodeToGlyphId[charCode$jscomp$0]=found))}}}else if(0===
|
|
1598
|
+
maxSizeOfInstructions&&0===cmapEncodingId)for(unicodeOrCharCode=0;unicodeOrCharCode<cmapMappingsLength;++unicodeOrCharCode)charCodeToGlyphId[maxFunctionDefs[unicodeOrCharCode].charCode]=maxFunctionDefs[unicodeOrCharCode].glyphId;else for(unicodeOrCharCode=0;unicodeOrCharCode<cmapMappingsLength;++unicodeOrCharCode)charCode$jscomp$0=maxFunctionDefs[unicodeOrCharCode].charCode,3===maxSizeOfInstructions&&61440<=charCode$jscomp$0&&61695>=charCode$jscomp$0&&(charCode$jscomp$0&=255),charCodeToGlyphId[charCode$jscomp$0]=
|
|
1599
|
+
maxFunctionDefs[unicodeOrCharCode].glyphId}0===charCodeToGlyphId.length&&(charCodeToGlyphId[0]=0);unicodeOrCharCode=isComposite-1;dupFirstEntry||(unicodeOrCharCode=0);dupFirstEntry=adjustMapping(charCodeToGlyphId,function(glyphId){return!missingGlyphs[glyphId]},unicodeOrCharCode);this.toFontChar=dupFirstEntry.toFontChar;tables.cmap={tag:"cmap",data:createCmapTable(dupFirstEntry.charCodeToGlyphId,isComposite)};tables["OS/2"]&&validateOS2Table(tables["OS/2"])||(tables["OS/2"]={tag:"OS/2",data:createOS2Table(properties$jscomp$0,
|
|
1600
|
+
dupFirstEntry.charCodeToGlyphId,version$jscomp$0)});if(!isTrueType)try{cffFile=new _stream.Stream(tables["CFF "].data);cff=(new _cff_parser.CFFParser(cffFile,properties$jscomp$0,!0)).parse();cff.duplicateFirstGlyph();var compiler=new _cff_parser.CFFCompiler(cff);tables["CFF "].data=compiler.compile()}catch(e){(0,_util.warn)("Failed to compile font "+properties$jscomp$0.loadedName)}tables.name?(properties$jscomp$0=readNameTable(tables.name),tables.name.data=createNameTable(name,properties$jscomp$0)):
|
|
1601
|
+
tables.name={tag:"name",data:createNameTable(this.name)};name=new OpenTypeFileBuilder(header$jscomp$0.version);for(var tableTag in tables)name.addTable(tableTag,tables[tableTag].data);return name.toArray()},convert:function(fontName,font,properties){function getCharCodes(charCodeToGlyphId,glyphId){var charCodes=null,charCode;for(charCode in charCodeToGlyphId)glyphId===charCodeToGlyphId[charCode]&&(charCodes||(charCodes=[]),charCodes.push(charCode|0));return charCodes}function createCharCode(charCodeToGlyphId,
|
|
1602
|
+
glyphId){for(var charCode in charCodeToGlyphId)if(glyphId===charCodeToGlyphId[charCode])return charCode|0;newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode]=glyphId;return newMapping.nextAvailableFontCharCode++}properties.fixedPitch=!1;properties.builtInEncoding&&adjustToUnicode(properties,properties.builtInEncoding);var glyphZeroId=1;font instanceof CFFFont&&(glyphZeroId=font.numGlyphs-1);var mapping=font.getGlyphMapping(properties),newMapping=adjustMapping(mapping,font.hasGlyphId.bind(font),
|
|
1603
|
+
glyphZeroId);this.toFontChar=newMapping.toFontChar;var numGlyphs=font.numGlyphs;if((glyphZeroId=font.seacs)&&glyphZeroId.length){var matrix=properties.fontMatrix||_util.FONT_IDENTITY_MATRIX,charset=font.getCharset(),seacMap=Object.create(null);for(glyphId$jscomp$0 in glyphZeroId){glyphId$jscomp$0|=0;var seac=glyphZeroId[glyphId$jscomp$0],accentGlyphName=_encodings.StandardEncoding[seac[3]],baseGlyphId=charset.indexOf(_encodings.StandardEncoding[seac[2]]);accentGlyphName=charset.indexOf(accentGlyphName);
|
|
1604
|
+
if(!(0>baseGlyphId||0>accentGlyphName)){seac={x:seac[0]*matrix[0]+seac[1]*matrix[2]+matrix[4],y:seac[0]*matrix[1]+seac[1]*matrix[3]+matrix[5]};var charCodes=getCharCodes(mapping,glyphId$jscomp$0);if(charCodes)for(var i$jscomp$0=0,ii=charCodes.length;i$jscomp$0<ii;i$jscomp$0++){var charCode$jscomp$0=charCodes[i$jscomp$0],charCodeToGlyphId$jscomp$0=newMapping.charCodeToGlyphId,baseFontCharCode=createCharCode(charCodeToGlyphId$jscomp$0,baseGlyphId);charCodeToGlyphId$jscomp$0=createCharCode(charCodeToGlyphId$jscomp$0,
|
|
1605
|
+
accentGlyphName);seacMap[charCode$jscomp$0]={baseFontCharCode:baseFontCharCode,accentFontCharCode:charCodeToGlyphId$jscomp$0,accentOffset:seac}}}}properties.seacMap=seacMap}mapping=1/(properties.fontMatrix||_util.FONT_IDENTITY_MATRIX)[0];var glyphId$jscomp$0=new OpenTypeFileBuilder("OTTO");glyphId$jscomp$0.addTable("CFF ",font.data);glyphId$jscomp$0.addTable("OS/2",createOS2Table(properties,newMapping.charCodeToGlyphId));glyphId$jscomp$0.addTable("cmap",createCmapTable(newMapping.charCodeToGlyphId,
|
|
1606
|
+
numGlyphs));glyphId$jscomp$0.addTable("head","\x00\u0001\x00\x00\x00\x00\u0010\x00\x00\x00\x00\x00_\u000f<\u00f5\x00\x00"+safeString16(mapping)+"\x00\x00\x00\x00\u009e\v~'\x00\x00\x00\x00\u009e\v~'\x00\x00"+safeString16(properties.descent)+"\u000f\u00ff"+safeString16(properties.ascent)+string16(properties.italicAngle?2:0)+"\x00\u0011\x00\x00\x00\x00\x00\x00");glyphId$jscomp$0.addTable("hhea","\x00\u0001\x00\x00"+safeString16(properties.ascent)+safeString16(properties.descent)+"\x00\x00\u00ff\u00ff\x00\x00\x00\x00\x00\x00"+
|
|
1607
|
+
safeString16(properties.capHeight)+safeString16(Math.tan(properties.italicAngle)*properties.xHeight)+"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"+string16(numGlyphs));glyphId$jscomp$0.addTable("hmtx",function(){for(var charstrings=font.charstrings,cffWidths=font.cff?font.cff.widths:null,hmtx="\x00\x00\x00\x00",i=1;i<numGlyphs;i++){var width=0;charstrings?(width=charstrings[i-1],width="width"in width?width.width:0):cffWidths&&(width=Math.ceil(cffWidths[i]||0));hmtx+=string16(width)+string16(0)}return hmtx}());
|
|
1608
|
+
glyphId$jscomp$0.addTable("maxp","\x00\x00P\x00"+string16(numGlyphs));glyphId$jscomp$0.addTable("name",createNameTable(fontName));glyphId$jscomp$0.addTable("post",createPostTable(properties));return glyphId$jscomp$0.toArray()},get spaceWidth(){if("_shadowWidth"in this)return this._shadowWidth;for(var possibleSpaceReplacements=["space","minus","one","i","I"],width,i=0,ii=possibleSpaceReplacements.length;i<ii;i++){width=possibleSpaceReplacements[i];if(width in this.widths){width=this.widths[width];
|
|
1609
|
+
break}width=(0,_glyphlist.getGlyphsUnicode)()[width];var charcode=0;this.composite&&this.cMap.contains(width)&&(charcode=this.cMap.lookup(width));!charcode&&this.toUnicode&&(charcode=this.toUnicode.charCodeOf(width));0>=charcode&&(charcode=width);if(width=this.widths[charcode])break}return this._shadowWidth=width=width||this.defaultWidth},charToGlyph:function(charcode,isSpace){var operatorListId,widthCode=charcode;this.cMap&&this.cMap.contains(charcode)&&(widthCode=this.cMap.lookup(charcode));var width=
|
|
1610
|
+
this.widths[widthCode];width=(0,_util.isNum)(width)?width:this.defaultWidth;widthCode=this.vmetrics&&this.vmetrics[widthCode];var unicode=this.toUnicode.get(charcode)||this.fallbackToUnicode.get(charcode)||charcode;"number"===typeof unicode&&(unicode=String.fromCharCode(unicode));var isInFont=charcode in this.toFontChar;var fontCharCode=this.toFontChar[charcode]||charcode;this.missingFile&&(fontCharCode=(0,_unicode.mapSpecialUnicodeValues)(fontCharCode));this.isType3Font&&(operatorListId=fontCharCode);
|
|
1611
|
+
var accent=null;this.seacMap&&this.seacMap[charcode]&&(isInFont=!0,accent=this.seacMap[charcode],fontCharCode=accent.baseFontCharCode,accent={fontChar:String.fromCodePoint(accent.accentFontCharCode),offset:accent.accentOffset});fontCharCode="number"===typeof fontCharCode?String.fromCodePoint(fontCharCode):"";var glyph=this.glyphCache[charcode];glyph&&glyph.matchesForCache(fontCharCode,unicode,accent,width,widthCode,operatorListId,isSpace,isInFont)||(glyph=new Glyph(fontCharCode,unicode,accent,width,
|
|
1612
|
+
widthCode,operatorListId,isSpace,isInFont),this.glyphCache[charcode]=glyph);return glyph},charsToGlyphs:function(chars){var charsCache=this.charsCache,glyphs;if(charsCache&&(glyphs=charsCache[chars]))return glyphs;charsCache||(charsCache=this.charsCache=Object.create(null));glyphs=[];var i=0,ii;if(this.cMap)for(ii=Object.create(null);i<chars.length;){this.cMap.readCharCode(chars,i,ii);var glyph=ii.charcode;var length=ii.length;i+=length;length=1===length&&32===chars.charCodeAt(i-1);glyph=this.charToGlyph(glyph,
|
|
1613
|
+
length);glyphs.push(glyph)}else for(i=0,ii=chars.length;i<ii;++i)glyph=chars.charCodeAt(i),glyph=this.charToGlyph(glyph,32===glyph),glyphs.push(glyph);return charsCache[chars]=glyphs},get glyphCacheValues(){return Object.values(this.glyphCache)}};return Font}();exports.Font=module;module=function(){function ErrorFont(error){this.error=error;this.loadedName="g_font_error";this.missingFile=!0}ErrorFont.prototype={charsToGlyphs:function(){return[]},exportData:function(){return{error:this.error}}};return ErrorFont}();
|
|
1614
|
+
exports.ErrorFont=module;var Type1Font=function(){function findBlock(streamBytes,signature,startIndex){for(var streamBytesLength=streamBytes.length,signatureLength=signature.length,scanLength=streamBytesLength-signatureLength,j,found=!1;startIndex<scanLength;){for(j=0;j<signatureLength&&streamBytes[startIndex+j]===signature[j];)j++;if(j>=signatureLength){for(startIndex+=j;startIndex<streamBytesLength&&(0,_util.isSpace)(streamBytes[startIndex]);)startIndex++;found=!0;break}startIndex++}return{found:found,
|
|
1615
|
+
length:startIndex}}function Type1Font(name,file,properties){var headerBlockLength=properties.length1,pfbHeader=file.peekBytes(6),pfbHeaderPresent=128===pfbHeader[0]&&1===pfbHeader[1];pfbHeaderPresent&&(file.skip(6),headerBlockLength=pfbHeader[5]<<24|pfbHeader[4]<<16|pfbHeader[3]<<8|pfbHeader[2]);a:{pfbHeader=[101,101,120,101,99];var streamStartPos=file.pos;try{var headerBytes=file.getBytes(headerBlockLength);var headerBytesLength=headerBytes.length}catch(ex){if(ex instanceof _core_utils.MissingDataException)throw ex;
|
|
1616
|
+
}if(headerBytesLength===headerBlockLength&&(headerBytesLength=findBlock(headerBytes,pfbHeader,headerBlockLength-2*pfbHeader.length),headerBytesLength.found&&headerBytesLength.length===headerBlockLength)){var JSCompiler_object_inline_stream_1331=new _stream.Stream(headerBytes);break a}(0,_util.warn)('Invalid "Length1" property in Type1 font -- trying to recover.');for(file.pos=streamStartPos;;){headerBytes=file.peekBytes(2048);headerBytesLength=findBlock(headerBytes,pfbHeader,0);if(0===headerBytesLength.length)break;
|
|
1617
|
+
file.pos+=headerBytesLength.length;if(headerBytesLength.found){JSCompiler_object_inline_stream_1331=file.pos-streamStartPos;break}}file.pos=streamStartPos;JSCompiler_object_inline_stream_1331?JSCompiler_object_inline_stream_1331=new _stream.Stream(file.getBytes(JSCompiler_object_inline_stream_1331)):((0,_util.warn)('Unable to recover "Length1" property in Type1 font -- using as is.'),JSCompiler_object_inline_stream_1331=new _stream.Stream(file.getBytes(headerBlockLength)))}(new _type1_parser.Type1Parser(JSCompiler_object_inline_stream_1331,
|
|
1618
|
+
!1,!0)).extractFontHeader(properties);pfbHeaderPresent&&file.getBytes(6);file=file.getBytes();file=new _stream.Stream(file);file=(new _type1_parser.Type1Parser(file,!0,!0)).extractFontProgram(properties);for(var info in file.properties)properties[info]=file.properties[info];info=file.charstrings;pfbHeaderPresent=this.getType2Charstrings(info);JSCompiler_object_inline_stream_1331=this.getType2Subrs(file.subrs);this.charstrings=info;this.data=this.wrap(name,pfbHeaderPresent,this.charstrings,JSCompiler_object_inline_stream_1331,
|
|
1619
|
+
properties);this.seacs=this.getSeacs(file.charstrings)}Type1Font.prototype={get numGlyphs(){return this.charstrings.length+1},getCharset:function(){for(var charset=[".notdef"],charstrings=this.charstrings,glyphId=0;glyphId<charstrings.length;glyphId++)charset.push(charstrings[glyphId].glyphName);return charset},getGlyphMapping:function(properties){var charstrings=this.charstrings,glyphNames=[".notdef"],glyphId;for(glyphId=0;glyphId<charstrings.length;glyphId++)glyphNames.push(charstrings[glyphId].glyphName);
|
|
1620
|
+
if(charstrings=properties.builtInEncoding){var builtInEncoding=Object.create(null),charCode;for(charCode in charstrings)glyphId=glyphNames.indexOf(charstrings[charCode]),0<=glyphId&&(builtInEncoding[charCode]=glyphId)}return type1FontGlyphMapping(properties,builtInEncoding,glyphNames)},hasGlyphId:function(id){return 0>id||id>=this.numGlyphs?!1:0===id?!0:0<this.charstrings[id-1].charstring.length},getSeacs:function(charstrings){var ii,seacMap=[];var i=0;for(ii=charstrings.length;i<ii;i++){var charstring=
|
|
1621
|
+
charstrings[i];charstring.seac&&(seacMap[i+1]=charstring.seac)}return seacMap},getType2Charstrings:function(type1Charstrings){for(var type2Charstrings=[],i=0,ii=type1Charstrings.length;i<ii;i++)type2Charstrings.push(type1Charstrings[i].charstring);return type2Charstrings},getType2Subrs:function(type1Subrs){var count=type1Subrs.length;var bias=1133>count?107:33769>count?1131:32768;var type2Subrs=[],i;for(i=0;i<bias;i++)type2Subrs.push([11]);for(i=0;i<count;i++)type2Subrs.push(type1Subrs[i]);return type2Subrs},
|
|
1622
|
+
wrap:function(name,glyphs,charstrings,subrs,properties){var cff=new _cff_parser.CFF;cff.header=new _cff_parser.CFFHeader(1,0,4,4);cff.names=[name];var topDict=new _cff_parser.CFFTopDict;topDict.setByName("version",391);topDict.setByName("Notice",392);topDict.setByName("FullName",393);topDict.setByName("FamilyName",394);topDict.setByName("Weight",395);topDict.setByName("Encoding",null);topDict.setByName("FontMatrix",properties.fontMatrix);topDict.setByName("FontBBox",properties.bbox);topDict.setByName("charset",
|
|
1623
|
+
null);topDict.setByName("CharStrings",null);topDict.setByName("Private",null);cff.topDict=topDict;topDict=new _cff_parser.CFFStrings;topDict.add("Version 0.11");topDict.add("See original notice");topDict.add(name);topDict.add(name);topDict.add("Medium");cff.strings=topDict;cff.globalSubrIndex=new _cff_parser.CFFIndex;var count=glyphs.length,charsetArray=[".notdef"];for(name=0;name<count;name++){var glyphName=charstrings[name].glyphName;-1===_cff_parser.CFFStandardStrings.indexOf(glyphName)&&topDict.add(glyphName);
|
|
1624
|
+
charsetArray.push(glyphName)}cff.charset=new _cff_parser.CFFCharset(!1,0,charsetArray);charstrings=new _cff_parser.CFFIndex;charstrings.add([139,14]);for(name=0;name<count;name++)charstrings.add(glyphs[name]);cff.charStrings=charstrings;charstrings=new _cff_parser.CFFPrivateDict;charstrings.setByName("Subrs",null);topDict="BlueValues OtherBlues FamilyBlues FamilyOtherBlues StemSnapH StemSnapV BlueShift BlueFuzz BlueScale LanguageGroup ExpansionFactor ForceBold StdHW StdVW".split(" ");name=0;for(glyphs=
|
|
1625
|
+
topDict.length;name<glyphs;name++)if(count=topDict[name],count in properties.privateData){charsetArray=properties.privateData[count];if(Array.isArray(charsetArray))for(glyphName=charsetArray.length-1;0<glyphName;glyphName--)charsetArray[glyphName]-=charsetArray[glyphName-1];charstrings.setByName(count,charsetArray)}cff.topDict.privateDict=charstrings;properties=new _cff_parser.CFFIndex;name=0;for(glyphs=subrs.length;name<glyphs;name++)properties.add(subrs[name]);charstrings.subrsIndex=properties;
|
|
1626
|
+
return(new _cff_parser.CFFCompiler(cff)).compile()}};return Type1Font}(),CFFFont=function(){function CFFFont(file,properties){this.properties=properties;this.cff=(new _cff_parser.CFFParser(file,properties,!0)).parse();this.cff.duplicateFirstGlyph();var compiler=new _cff_parser.CFFCompiler(this.cff);this.seacs=this.cff.seacs;try{this.data=compiler.compile()}catch(e){(0,_util.warn)("Failed to compile font "+properties.loadedName),this.data=file}}CFFFont.prototype={get numGlyphs(){return this.cff.charStrings.count},
|
|
1624
1627
|
getCharset:function(){return this.cff.charset.charset},getGlyphMapping:function(){var cff=this.cff,properties=this.properties,charsets=cff.charset.charset,glyphId;if(properties.composite){var charCodeToGlyphId=Object.create(null);if(cff.isCIDFont)for(glyphId=0;glyphId<charsets.length;glyphId++){var charCode=properties.cMap.charCodeOf(charsets[glyphId]);charCodeToGlyphId[charCode]=glyphId}else for(glyphId=0;glyphId<cff.charStrings.count;glyphId++)charCode=properties.cMap.charCodeOf(glyphId),charCodeToGlyphId[charCode]=
|
|
1625
1628
|
glyphId;return charCodeToGlyphId}return charCodeToGlyphId=type1FontGlyphMapping(properties,cff.encoding?cff.encoding.encoding:null,charsets)},hasGlyphId:function(id){return this.cff.hasGlyphId(id)}};return CFFFont}()},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.CFFFDSelect=exports.CFFCompiler=exports.CFFPrivateDict=exports.CFFTopDict=exports.CFFCharset=exports.CFFIndex=exports.CFFStrings=exports.CFFHeader=exports.CFF=exports.CFFParser=
|
|
1626
1629
|
exports.CFFStandardStrings=void 0;var _util=__w_pdfjs_require__(5),_charsets=__w_pdfjs_require__(213),_encodings=__w_pdfjs_require__(214),CFFStandardStrings=".notdef space exclam quotedbl numbersign dollar percent ampersand quoteright parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore quoteleft a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde exclamdown cent sterling fraction yen florin section currency quotesingle quotedblleft guillemotleft guilsinglleft guilsinglright fi fl endash dagger daggerdbl periodcentered paragraph bullet quotesinglbase quotedblbase quotedblright guillemotright ellipsis perthousand questiondown grave acute circumflex tilde macron breve dotaccent dieresis ring cedilla hungarumlaut ogonek caron emdash AE ordfeminine Lslash Oslash OE ordmasculine ae dotlessi lslash oslash oe germandbls onesuperior logicalnot mu trademark Eth onehalf plusminus Thorn onequarter divide brokenbar degree thorn threequarters twosuperior registered minus eth multiply threesuperior copyright Aacute Acircumflex Adieresis Agrave Aring Atilde Ccedilla Eacute Ecircumflex Edieresis Egrave Iacute Icircumflex Idieresis Igrave Ntilde Oacute Ocircumflex Odieresis Ograve Otilde Scaron Uacute Ucircumflex Udieresis Ugrave Yacute Ydieresis Zcaron aacute acircumflex adieresis agrave aring atilde ccedilla eacute ecircumflex edieresis egrave iacute icircumflex idieresis igrave ntilde oacute ocircumflex odieresis ograve otilde scaron uacute ucircumflex udieresis ugrave yacute ydieresis zcaron exclamsmall Hungarumlautsmall dollaroldstyle dollarsuperior ampersandsmall Acutesmall parenleftsuperior parenrightsuperior twodotenleader onedotenleader zerooldstyle oneoldstyle twooldstyle threeoldstyle fouroldstyle fiveoldstyle sixoldstyle sevenoldstyle eightoldstyle nineoldstyle commasuperior threequartersemdash periodsuperior questionsmall asuperior bsuperior centsuperior dsuperior esuperior isuperior lsuperior msuperior nsuperior osuperior rsuperior ssuperior tsuperior ff ffi ffl parenleftinferior parenrightinferior Circumflexsmall hyphensuperior Gravesmall Asmall Bsmall Csmall Dsmall Esmall Fsmall Gsmall Hsmall Ismall Jsmall Ksmall Lsmall Msmall Nsmall Osmall Psmall Qsmall Rsmall Ssmall Tsmall Usmall Vsmall Wsmall Xsmall Ysmall Zsmall colonmonetary onefitted rupiah Tildesmall exclamdownsmall centoldstyle Lslashsmall Scaronsmall Zcaronsmall Dieresissmall Brevesmall Caronsmall Dotaccentsmall Macronsmall figuredash hypheninferior Ogoneksmall Ringsmall Cedillasmall questiondownsmall oneeighth threeeighths fiveeighths seveneighths onethird twothirds zerosuperior foursuperior fivesuperior sixsuperior sevensuperior eightsuperior ninesuperior zeroinferior oneinferior twoinferior threeinferior fourinferior fiveinferior sixinferior seveninferior eightinferior nineinferior centinferior dollarinferior periodinferior commainferior Agravesmall Aacutesmall Acircumflexsmall Atildesmall Adieresissmall Aringsmall AEsmall Ccedillasmall Egravesmall Eacutesmall Ecircumflexsmall Edieresissmall Igravesmall Iacutesmall Icircumflexsmall Idieresissmall Ethsmall Ntildesmall Ogravesmall Oacutesmall Ocircumflexsmall Otildesmall Odieresissmall OEsmall Oslashsmall Ugravesmall Uacutesmall Ucircumflexsmall Udieresissmall Yacutesmall Thornsmall Ydieresissmall 001.000 001.001 001.002 001.003 Black Bold Book Light Medium Regular Roman Semibold".split(" ");
|
|
@@ -1674,18 +1677,18 @@ i=this.compileStringIndex(cff.strings.strings);output.add(i);i=this.compileIndex
|
|
|
1674
1677
|
output.add(i);i=this.compileCharStrings(cff.charStrings);header.setEntryLocation("CharStrings",[output.length],output);output.add(i);cff.isCIDFont&&(header.setEntryLocation("FDSelect",[output.length],output),i=this.compileFDSelect(cff.fdSelect),output.add(i),i=this.compileTopDicts(cff.fdArray,output.length,!0),header.setEntryLocation("FDArray",[output.length],output),output.add(i.output),this.compilePrivateDicts(cff.fdArray,i.trackers,output));this.compilePrivateDicts([cff.topDict],[header],output);
|
|
1675
1678
|
output.add([0]);return output.data},encodeNumber:function(value){return parseFloat(value)!==parseInt(value,10)||isNaN(value)?this.encodeFloat(value):this.encodeInteger(value)},encodeFloat:function(num){var value=num.toString(),m=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value);m&&(value=parseFloat("1e"+((m[2]?+m[2]:0)+m[1].length)),value=(Math.round(num*value)/value).toString());num="";var ii;m=0;for(ii=value.length;m<ii;++m){var a=value[m];num="e"===a?num+("-"===value[++m]?"c":"b"):"."===
|
|
1676
1679
|
a?num+"a":"-"===a?num+"e":num+a}num+=num.length&1?"f":"ff";value=[30];m=0;for(ii=num.length;m<ii;m+=2)value.push(parseInt(num.substring(m,m+2),16));return value},encodeInteger:function(value){-107<=value&&107>=value?value=[value+139]:108<=value&&1131>=value?(value-=108,value=[(value>>8)+247,value&255]):-1131<=value&&-108>=value?(value=-value-108,value=[(value>>8)+251,value&255]):value=-32768<=value&&32767>=value?[28,value>>8&255,value&255]:[29,value>>24&255,value>>16&255,value>>8&255,value&255];return value},
|
|
1677
|
-
compileHeader:function(header){return[header.major,header.minor,header.hdrSize,header.offSize]},compileNameIndex:function(names){for(var nameIndex=new CFFIndex,i=0,ii=names.length;i<ii;++i){for(var name=names[i],length=Math.min(name.length,127),sanitizedName=Array(length),j=0;j<length;j++){var
|
|
1678
|
-
sanitizedName.join("");""===sanitizedName&&(sanitizedName="Bad_Font_Name");nameIndex.add((0,_util.stringToBytes)(sanitizedName))}return this.compileIndex(nameIndex)},compileTopDicts:function(dicts,length,removeCidKeys){for(var fontDictTrackers=[],fdArrayIndex=new CFFIndex,i=0,ii=dicts.length;i<ii;++i){var fontDict=dicts[i];removeCidKeys&&(fontDict.removeByName("CIDFontVersion"),fontDict.removeByName("CIDFontRevision"),fontDict.removeByName("CIDFontType"),fontDict.removeByName("CIDCount"),
|
|
1679
|
-
var fontDictTracker=new CFFOffsetTracker;fontDict=this.compileDict(fontDict,fontDictTracker);fontDictTrackers.push(fontDictTracker);fdArrayIndex.add(fontDict);fontDictTracker.offset(length)}fdArrayIndex=this.compileIndex(fdArrayIndex,fontDictTrackers);return{trackers:fontDictTrackers,output:fdArrayIndex}},compilePrivateDicts:function(dicts,trackers,output){for(var i=0,ii=dicts.length;i<ii;++i){var fontDict=dicts[i],privateDict=fontDict.privateDict;if(!privateDict
|
|
1680
|
-
fontDict=new CFFOffsetTracker;var privateDictData=this.compileDict(privateDict,fontDict),outputLength=output.length;fontDict.offset(outputLength);privateDictData.length||(outputLength=0);trackers[i].setEntryLocation("Private",[privateDictData.length,outputLength],output);output.add(privateDictData);privateDict.subrsIndex&&privateDict.hasName("Subrs")&&(privateDict=this.compileIndex(privateDict.subrsIndex),
|
|
1681
|
-
compileDict:function(dict,offsetTracker){for(var out=[],order=dict.order,i=0;i<order.length;++i){var key=order[i];if(key in dict.values){var values=dict.values[key],types=dict.types[key];Array.isArray(types)||(types=[types]);Array.isArray(values)||(values=[values]);if(0!==values.length){for(var j=0,jj=types.length;j<jj;++j){var type=types[j],value=values[j];switch(type){case "num":case "sid":out=out.concat(this.encodeNumber(value));
|
|
1682
|
-
offsetTracker.track(type,out.length);out=out.concat([29,0,0,0,0]);break;case "array":case "delta":out=out.concat(this.encodeNumber(value));type=1;for(value=values.length;type<value;++type)out=out.concat(this.encodeNumber(values[type]));break;default:throw new _util.FormatError("Unknown data type of ".concat(type));}}out=out.concat(dict.opcodes[key])}}}return out},compileStringIndex:function(strings){for(var stringIndex=
|
|
1683
|
-
return this.compileIndex(stringIndex)},compileGlobalSubrIndex:function(){this.out.writeByteArray(this.compileIndex(this.cff.globalSubrIndex))},compileCharStrings:function(charStrings){for(var charStringsIndex=new CFFIndex,i=0;i<charStrings.count;i++){var glyph=charStrings.get(i);0===glyph.length?charStringsIndex.add(new Uint8Array([139,14])):charStringsIndex.add(glyph)}return this.compileIndex(charStringsIndex)},
|
|
1684
|
-
new Uint8Array([2,0,0,numGlyphs>>8&255,numGlyphs&255]);else{isCIDFont=new Uint8Array(1+2*numGlyphs);numGlyphs=isCIDFont[0]=0;for(var numCharsets=charset.charset.length,warned=!1,i=1;i<isCIDFont.length;i+=2){var sid=0;if(numGlyphs<numCharsets){var name=charset.charset[numGlyphs++];sid=strings.getSID(name);-1===sid&&(sid=0,warned||(warned=!0,(0,_util.warn)("Couldn't find ".concat(name," in CFF strings"))))}isCIDFont[i]=
|
|
1685
|
-
compileFDSelect:function(fdSelect){var format=fdSelect.format;switch(format){case 0:var out=new Uint8Array(1+fdSelect.fdSelect.length);out[0]=format;for(format=0;format<fdSelect.fdSelect.length;format++)out[format+1]=fdSelect.fdSelect[format];break;case 3:out=fdSelect.fdSelect[0];var ranges=[format,0,0,0,0,out];for(format=1;format<fdSelect.fdSelect.length;format++){var currentFD=
|
|
1686
|
-
3)/3;ranges[1]=fdSelect>>8&255;ranges[2]=fdSelect&255;ranges.push(format>>8&255,format&255);out=new Uint8Array(ranges)}return this.compileTypedArray(out)},compileTypedArray:function(data){for(var out=[],i=0,ii=data.length;i<ii;++i)out[i]=data[i];return out},compileIndex:function(index,trackers){trackers=trackers||[];index=index.objects;var count=index.length;if(0===count)return[0,
|
|
1687
|
-
1:65536>lastOffset?2:16777216>lastOffset?3:4;data.push(lastOffset);var relativeOffset=1;for(i=0;i<count+1;i++)1===lastOffset?data.push(relativeOffset&255):2===lastOffset?data.push(relativeOffset>>8&255,relativeOffset&255):3===lastOffset?data.push(relativeOffset>>16&255,relativeOffset>>8&255,relativeOffset&255):data.push(relativeOffset>>>24&255,relativeOffset>>16&255,relativeOffset>>
|
|
1688
|
-
lastOffset=0,relativeOffset=index[i].length;lastOffset<relativeOffset;lastOffset++)data.push(index[i][lastOffset]);return data}};return CFFCompiler}();exports.CFFCompiler=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.ISOAdobeCharset=".notdef space exclam quotedbl numbersign dollar percent ampersand quoteright parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore quoteleft a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde exclamdown cent sterling fraction yen florin section currency quotesingle quotedblleft guillemotleft guilsinglleft guilsinglright fi fl endash dagger daggerdbl periodcentered paragraph bullet quotesinglbase quotedblbase quotedblright guillemotright ellipsis perthousand questiondown grave acute circumflex tilde macron breve dotaccent dieresis ring cedilla hungarumlaut ogonek caron emdash AE ordfeminine Lslash Oslash OE ordmasculine ae dotlessi lslash oslash oe germandbls onesuperior logicalnot mu trademark Eth onehalf plusminus Thorn onequarter divide brokenbar degree thorn threequarters twosuperior registered minus eth multiply threesuperior copyright Aacute Acircumflex Adieresis Agrave Aring Atilde Ccedilla Eacute Ecircumflex Edieresis Egrave Iacute Icircumflex Idieresis Igrave Ntilde Oacute Ocircumflex Odieresis Ograve Otilde Scaron Uacute Ucircumflex Udieresis Ugrave Yacute Ydieresis Zcaron aacute acircumflex adieresis agrave aring atilde ccedilla eacute ecircumflex edieresis egrave iacute icircumflex idieresis igrave ntilde oacute ocircumflex odieresis ograve otilde scaron uacute ucircumflex udieresis ugrave yacute ydieresis zcaron".split(" ");
|
|
1680
|
+
compileHeader:function(header){return[header.major,header.minor,header.hdrSize,header.offSize]},compileNameIndex:function(names){for(var nameIndex=new CFFIndex,i=0,ii=names.length;i<ii;++i){for(var name=names[i],length=Math.min(name.length,127),sanitizedName=Array(length),j=0;j<length;j++){var _char5=name[j];if("!">_char5||"~"<_char5||"["===_char5||"]"===_char5||"("===_char5||")"===_char5||"{"===_char5||"}"===_char5||"<"===_char5||">"===_char5||"/"===_char5||"%"===_char5)_char5="_";sanitizedName[j]=
|
|
1681
|
+
_char5}sanitizedName=sanitizedName.join("");""===sanitizedName&&(sanitizedName="Bad_Font_Name");nameIndex.add((0,_util.stringToBytes)(sanitizedName))}return this.compileIndex(nameIndex)},compileTopDicts:function(dicts,length,removeCidKeys){for(var fontDictTrackers=[],fdArrayIndex=new CFFIndex,i=0,ii=dicts.length;i<ii;++i){var fontDict=dicts[i];removeCidKeys&&(fontDict.removeByName("CIDFontVersion"),fontDict.removeByName("CIDFontRevision"),fontDict.removeByName("CIDFontType"),fontDict.removeByName("CIDCount"),
|
|
1682
|
+
fontDict.removeByName("UIDBase"));var fontDictTracker=new CFFOffsetTracker;fontDict=this.compileDict(fontDict,fontDictTracker);fontDictTrackers.push(fontDictTracker);fdArrayIndex.add(fontDict);fontDictTracker.offset(length)}fdArrayIndex=this.compileIndex(fdArrayIndex,fontDictTrackers);return{trackers:fontDictTrackers,output:fdArrayIndex}},compilePrivateDicts:function(dicts,trackers,output){for(var i=0,ii=dicts.length;i<ii;++i){var fontDict=dicts[i],privateDict=fontDict.privateDict;if(!privateDict||
|
|
1683
|
+
!fontDict.hasName("Private"))throw new _util.FormatError("There must be a private dictionary.");fontDict=new CFFOffsetTracker;var privateDictData=this.compileDict(privateDict,fontDict),outputLength=output.length;fontDict.offset(outputLength);privateDictData.length||(outputLength=0);trackers[i].setEntryLocation("Private",[privateDictData.length,outputLength],output);output.add(privateDictData);privateDict.subrsIndex&&privateDict.hasName("Subrs")&&(privateDict=this.compileIndex(privateDict.subrsIndex),
|
|
1684
|
+
fontDict.setEntryLocation("Subrs",[privateDictData.length],output),output.add(privateDict))}},compileDict:function(dict,offsetTracker){for(var out=[],order=dict.order,i=0;i<order.length;++i){var key=order[i];if(key in dict.values){var values=dict.values[key],types=dict.types[key];Array.isArray(types)||(types=[types]);Array.isArray(values)||(values=[values]);if(0!==values.length){for(var j=0,jj=types.length;j<jj;++j){var type=types[j],value=values[j];switch(type){case "num":case "sid":out=out.concat(this.encodeNumber(value));
|
|
1685
|
+
break;case "offset":type=dict.keyToNameMap[key];offsetTracker.isTracking(type)||offsetTracker.track(type,out.length);out=out.concat([29,0,0,0,0]);break;case "array":case "delta":out=out.concat(this.encodeNumber(value));type=1;for(value=values.length;type<value;++type)out=out.concat(this.encodeNumber(values[type]));break;default:throw new _util.FormatError("Unknown data type of ".concat(type));}}out=out.concat(dict.opcodes[key])}}}return out},compileStringIndex:function(strings){for(var stringIndex=
|
|
1686
|
+
new CFFIndex,i=0,ii=strings.length;i<ii;++i)stringIndex.add((0,_util.stringToBytes)(strings[i]));return this.compileIndex(stringIndex)},compileGlobalSubrIndex:function(){this.out.writeByteArray(this.compileIndex(this.cff.globalSubrIndex))},compileCharStrings:function(charStrings){for(var charStringsIndex=new CFFIndex,i=0;i<charStrings.count;i++){var glyph=charStrings.get(i);0===glyph.length?charStringsIndex.add(new Uint8Array([139,14])):charStringsIndex.add(glyph)}return this.compileIndex(charStringsIndex)},
|
|
1687
|
+
compileCharset:function(charset,numGlyphs,strings,isCIDFont){--numGlyphs;if(isCIDFont)isCIDFont=new Uint8Array([2,0,0,numGlyphs>>8&255,numGlyphs&255]);else{isCIDFont=new Uint8Array(1+2*numGlyphs);numGlyphs=isCIDFont[0]=0;for(var numCharsets=charset.charset.length,warned=!1,i=1;i<isCIDFont.length;i+=2){var sid=0;if(numGlyphs<numCharsets){var name=charset.charset[numGlyphs++];sid=strings.getSID(name);-1===sid&&(sid=0,warned||(warned=!0,(0,_util.warn)("Couldn't find ".concat(name," in CFF strings"))))}isCIDFont[i]=
|
|
1688
|
+
sid>>8&255;isCIDFont[i+1]=sid&255}}return this.compileTypedArray(isCIDFont)},compileEncoding:function(encoding){return this.compileTypedArray(encoding.raw)},compileFDSelect:function(fdSelect){var format=fdSelect.format;switch(format){case 0:var out=new Uint8Array(1+fdSelect.fdSelect.length);out[0]=format;for(format=0;format<fdSelect.fdSelect.length;format++)out[format+1]=fdSelect.fdSelect[format];break;case 3:out=fdSelect.fdSelect[0];var ranges=[format,0,0,0,0,out];for(format=1;format<fdSelect.fdSelect.length;format++){var currentFD=
|
|
1689
|
+
fdSelect.fdSelect[format];currentFD!==out&&(ranges.push(format>>8&255,format&255,currentFD),out=currentFD)}fdSelect=(ranges.length-3)/3;ranges[1]=fdSelect>>8&255;ranges[2]=fdSelect&255;ranges.push(format>>8&255,format&255);out=new Uint8Array(ranges)}return this.compileTypedArray(out)},compileTypedArray:function(data){for(var out=[],i=0,ii=data.length;i<ii;++i)out[i]=data[i];return out},compileIndex:function(index,trackers){trackers=trackers||[];index=index.objects;var count=index.length;if(0===count)return[0,
|
|
1690
|
+
0,0];var data=[count>>8&255,count&255],lastOffset=1,i;for(i=0;i<count;++i)lastOffset+=index[i].length;lastOffset=256>lastOffset?1:65536>lastOffset?2:16777216>lastOffset?3:4;data.push(lastOffset);var relativeOffset=1;for(i=0;i<count+1;i++)1===lastOffset?data.push(relativeOffset&255):2===lastOffset?data.push(relativeOffset>>8&255,relativeOffset&255):3===lastOffset?data.push(relativeOffset>>16&255,relativeOffset>>8&255,relativeOffset&255):data.push(relativeOffset>>>24&255,relativeOffset>>16&255,relativeOffset>>
|
|
1691
|
+
8&255,relativeOffset&255),index[i]&&(relativeOffset+=index[i].length);for(i=0;i<count;i++)for(trackers[i]&&trackers[i].offset(data.length),lastOffset=0,relativeOffset=index[i].length;lastOffset<relativeOffset;lastOffset++)data.push(index[i][lastOffset]);return data}};return CFFCompiler}();exports.CFFCompiler=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.ISOAdobeCharset=".notdef space exclam quotedbl numbersign dollar percent ampersand quoteright parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore quoteleft a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde exclamdown cent sterling fraction yen florin section currency quotesingle quotedblleft guillemotleft guilsinglleft guilsinglright fi fl endash dagger daggerdbl periodcentered paragraph bullet quotesinglbase quotedblbase quotedblright guillemotright ellipsis perthousand questiondown grave acute circumflex tilde macron breve dotaccent dieresis ring cedilla hungarumlaut ogonek caron emdash AE ordfeminine Lslash Oslash OE ordmasculine ae dotlessi lslash oslash oe germandbls onesuperior logicalnot mu trademark Eth onehalf plusminus Thorn onequarter divide brokenbar degree thorn threequarters twosuperior registered minus eth multiply threesuperior copyright Aacute Acircumflex Adieresis Agrave Aring Atilde Ccedilla Eacute Ecircumflex Edieresis Egrave Iacute Icircumflex Idieresis Igrave Ntilde Oacute Ocircumflex Odieresis Ograve Otilde Scaron Uacute Ucircumflex Udieresis Ugrave Yacute Ydieresis Zcaron aacute acircumflex adieresis agrave aring atilde ccedilla eacute ecircumflex edieresis egrave iacute icircumflex idieresis igrave ntilde oacute ocircumflex odieresis ograve otilde scaron uacute ucircumflex udieresis ugrave yacute ydieresis zcaron".split(" ");
|
|
1689
1692
|
exports.ExpertCharset=".notdef space exclamsmall Hungarumlautsmall dollaroldstyle dollarsuperior ampersandsmall Acutesmall parenleftsuperior parenrightsuperior twodotenleader onedotenleader comma hyphen period fraction zerooldstyle oneoldstyle twooldstyle threeoldstyle fouroldstyle fiveoldstyle sixoldstyle sevenoldstyle eightoldstyle nineoldstyle colon semicolon commasuperior threequartersemdash periodsuperior questionsmall asuperior bsuperior centsuperior dsuperior esuperior isuperior lsuperior msuperior nsuperior osuperior rsuperior ssuperior tsuperior ff fi fl ffi ffl parenleftinferior parenrightinferior Circumflexsmall hyphensuperior Gravesmall Asmall Bsmall Csmall Dsmall Esmall Fsmall Gsmall Hsmall Ismall Jsmall Ksmall Lsmall Msmall Nsmall Osmall Psmall Qsmall Rsmall Ssmall Tsmall Usmall Vsmall Wsmall Xsmall Ysmall Zsmall colonmonetary onefitted rupiah Tildesmall exclamdownsmall centoldstyle Lslashsmall Scaronsmall Zcaronsmall Dieresissmall Brevesmall Caronsmall Dotaccentsmall Macronsmall figuredash hypheninferior Ogoneksmall Ringsmall Cedillasmall onequarter onehalf threequarters questiondownsmall oneeighth threeeighths fiveeighths seveneighths onethird twothirds zerosuperior onesuperior twosuperior threesuperior foursuperior fivesuperior sixsuperior sevensuperior eightsuperior ninesuperior zeroinferior oneinferior twoinferior threeinferior fourinferior fiveinferior sixinferior seveninferior eightinferior nineinferior centinferior dollarinferior periodinferior commainferior Agravesmall Aacutesmall Acircumflexsmall Atildesmall Adieresissmall Aringsmall AEsmall Ccedillasmall Egravesmall Eacutesmall Ecircumflexsmall Edieresissmall Igravesmall Iacutesmall Icircumflexsmall Idieresissmall Ethsmall Ntildesmall Ogravesmall Oacutesmall Ocircumflexsmall Otildesmall Odieresissmall OEsmall Oslashsmall Ugravesmall Uacutesmall Ucircumflexsmall Udieresissmall Yacutesmall Thornsmall Ydieresissmall".split(" ");
|
|
1690
1693
|
exports.ExpertSubsetCharset=".notdef space dollaroldstyle dollarsuperior parenleftsuperior parenrightsuperior twodotenleader onedotenleader comma hyphen period fraction zerooldstyle oneoldstyle twooldstyle threeoldstyle fouroldstyle fiveoldstyle sixoldstyle sevenoldstyle eightoldstyle nineoldstyle colon semicolon commasuperior threequartersemdash periodsuperior asuperior bsuperior centsuperior dsuperior esuperior isuperior lsuperior msuperior nsuperior osuperior rsuperior ssuperior tsuperior ff fi fl ffi ffl parenleftinferior parenrightinferior hyphensuperior colonmonetary onefitted rupiah centoldstyle figuredash hypheninferior onequarter onehalf threequarters oneeighth threeeighths fiveeighths seveneighths onethird twothirds zerosuperior onesuperior twosuperior threesuperior foursuperior fivesuperior sixsuperior sevensuperior eightsuperior ninesuperior zeroinferior oneinferior twoinferior threeinferior fourinferior fiveinferior sixinferior seveninferior eightinferior nineinferior centinferior dollarinferior periodinferior commainferior".split(" ")},
|
|
1691
1694
|
function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.getEncoding=function(encodingName){switch(encodingName){case "WinAnsiEncoding":return WinAnsiEncoding;case "StandardEncoding":return StandardEncoding;case "MacRomanEncoding":return MacRomanEncoding;case "SymbolSetEncoding":return SymbolSetEncoding;case "ZapfDingbatsEncoding":return ZapfDingbatsEncoding;case "ExpertEncoding":return ExpertEncoding;case "MacExpertEncoding":return MacExpertEncoding;
|
|
@@ -2003,13 +2006,13 @@ length+tag);if(4===offset){getUshort(cmap,length+tag+2);offset=getUshort(cmap,le
|
|
|
2003
2006
|
[];for(var j=0,jj=ranges[length].end-ranges[length].start+1;j<jj;j++)ranges[length].ids[j]=getUshort(cmap,tag+idOffset),idOffset+=2}}cmap=ranges}else if(12===offset){getLong(cmap,length+tag+4);offset=getLong(cmap,length+tag+12);tag=length+tag+16;ranges=[];for(length=0;length<offset;length++)ranges.push({start:getLong(cmap,tag),end:getLong(cmap,tag+4),idDelta:getLong(cmap,tag+8)-getLong(cmap,tag)}),tag+=12;cmap=ranges}else throw new _util.FormatError("unsupported cmap: ".concat(offset));break;case "glyf":glyf=
|
|
2004
2007
|
data.subarray(offset,offset+length);break;case "loca":loca=data.subarray(offset,offset+length);break;case "head":unitsPerEm=getUshort(data,offset+18);indexToLocFormat=getUshort(data,offset+50);break;case "CFF ":cff=seacAnalysisEnabled,cff=(new _cff_parser.CFFParser(new _stream.Stream(data,offset,offset+length-offset),{},cff)).parse(),cff={glyphs:cff.charStrings.objects,subrs:cff.topDict.privateDict&&cff.topDict.privateDict.subrsIndex&&cff.topDict.privateDict.subrsIndex.objects,gsubrs:cff.globalSubrIndex&&
|
|
2005
2008
|
cff.globalSubrIndex.objects,isCFFCIDFont:cff.isCIDFont,fdSelect:cff.fdSelect,fdArray:cff.fdArray}}}return glyf?(font=unitsPerEm?[1/unitsPerEm,0,0,1/unitsPerEm,0,0]:font.fontMatrix,new TrueTypeCompiled(parseGlyfTable(glyf,loca,indexToLocFormat),cmap,font)):new Type2Compiled(cff,cmap,font.fontMatrix,font.glyphNameMap)}}}();exports.FontRendererFactory=module},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0});exports.Type1Parser=void 0;var _util=__w_pdfjs_require__(5),
|
|
2006
|
-
_encodings=__w_pdfjs_require__(214),_stream=__w_pdfjs_require__(195),Type1CharString=function(){function Type1CharString(){this.lsb=this.width=0;this.flexing=!1;this.output=[];this.stack=[]}var
|
|
2007
|
-
[21],
|
|
2008
|
-
sbx);break}error=this.executeCommand(1,
|
|
2009
|
-
if(!subrs[sbx]){error=!0;break}error=this.convert(subrs[sbx],subrs,seacAnalysisEnabled);break;case 11:return error;case 13:if(2>this.stack.length){error=!0;break}error=this.stack.pop();this.lsb=sbx=this.stack.pop();this.width=error;this.stack.push(error,sbx);error=this.executeCommand(2,
|
|
2010
|
-
break;case 22:if(this.flexing){this.stack.push(0);break}error=this.executeCommand(1,
|
|
2011
|
-
error=this.executeCommand(4,
|
|
2012
|
-
break}sbx=this.stack.pop();sby=this.stack.pop();0===sbx&&3===sby?(sbx=this.stack.splice(this.stack.length-17,17),this.stack.push(sbx[2]+sbx[0],sbx[3]+sbx[1],sbx[4],sbx[5],sbx[6],sbx[7],sbx[8],sbx[9],sbx[10],sbx[11],sbx[12],sbx[13],sbx[14]),error=this.executeCommand(13,
|
|
2009
|
+
_encodings=__w_pdfjs_require__(214),_stream=__w_pdfjs_require__(195),Type1CharString=function(){function Type1CharString(){this.lsb=this.width=0;this.flexing=!1;this.output=[];this.stack=[]}var JSCompiler_object_inline_vmoveto_1337=[4],JSCompiler_object_inline_rlineto_1338=[5],JSCompiler_object_inline_hlineto_1339=[6],JSCompiler_object_inline_vlineto_1340=[7],JSCompiler_object_inline_rrcurveto_1341=[8],JSCompiler_object_inline_flex_1343=[12,35],JSCompiler_object_inline_endchar_1345=[14],JSCompiler_object_inline_rmoveto_1346=
|
|
2010
|
+
[21],JSCompiler_object_inline_hmoveto_1347=[22],JSCompiler_object_inline_vhcurveto_1348=[30],JSCompiler_object_inline_hvcurveto_1349=[31];Type1CharString.prototype={convert:function(encoded,subrs,seacAnalysisEnabled){for(var count=encoded.length,error=!1,sbx,i=0;i<count;i++)if(sbx=encoded[i],32>sbx){12===sbx&&(sbx=(sbx<<8)+encoded[++i]);switch(sbx){case 1:this.stack=[];break;case 3:this.stack=[];break;case 4:if(this.flexing){if(1>this.stack.length){error=!0;break}sbx=this.stack.pop();this.stack.push(0,
|
|
2011
|
+
sbx);break}error=this.executeCommand(1,JSCompiler_object_inline_vmoveto_1337);break;case 5:error=this.executeCommand(2,JSCompiler_object_inline_rlineto_1338);break;case 6:error=this.executeCommand(1,JSCompiler_object_inline_hlineto_1339);break;case 7:error=this.executeCommand(1,JSCompiler_object_inline_vlineto_1340);break;case 8:error=this.executeCommand(6,JSCompiler_object_inline_rrcurveto_1341);break;case 9:this.stack=[];break;case 10:if(1>this.stack.length){error=!0;break}sbx=this.stack.pop();
|
|
2012
|
+
if(!subrs[sbx]){error=!0;break}error=this.convert(subrs[sbx],subrs,seacAnalysisEnabled);break;case 11:return error;case 13:if(2>this.stack.length){error=!0;break}error=this.stack.pop();this.lsb=sbx=this.stack.pop();this.width=error;this.stack.push(error,sbx);error=this.executeCommand(2,JSCompiler_object_inline_hmoveto_1347);break;case 14:this.output.push(JSCompiler_object_inline_endchar_1345[0]);break;case 21:if(this.flexing)break;error=this.executeCommand(2,JSCompiler_object_inline_rmoveto_1346);
|
|
2013
|
+
break;case 22:if(this.flexing){this.stack.push(0);break}error=this.executeCommand(1,JSCompiler_object_inline_hmoveto_1347);break;case 30:error=this.executeCommand(4,JSCompiler_object_inline_vhcurveto_1348);break;case 31:error=this.executeCommand(4,JSCompiler_object_inline_hvcurveto_1349);break;case 3072:this.stack=[];break;case 3073:this.stack=[];break;case 3074:this.stack=[];break;case 3078:seacAnalysisEnabled?(this.seac=this.stack.splice(-4,4),error=this.executeCommand(0,JSCompiler_object_inline_endchar_1345)):
|
|
2014
|
+
error=this.executeCommand(4,JSCompiler_object_inline_endchar_1345);break;case 3079:if(4>this.stack.length){error=!0;break}this.stack.pop();error=this.stack.pop();var sby=this.stack.pop();this.lsb=sbx=this.stack.pop();this.width=error;this.stack.push(error,sbx,sby);error=this.executeCommand(3,JSCompiler_object_inline_rmoveto_1346);break;case 3084:if(2>this.stack.length){error=!0;break}sbx=this.stack.pop();sby=this.stack.pop();this.stack.push(sby/sbx);break;case 3088:if(2>this.stack.length){error=!0;
|
|
2015
|
+
break}sbx=this.stack.pop();sby=this.stack.pop();0===sbx&&3===sby?(sbx=this.stack.splice(this.stack.length-17,17),this.stack.push(sbx[2]+sbx[0],sbx[3]+sbx[1],sbx[4],sbx[5],sbx[6],sbx[7],sbx[8],sbx[9],sbx[10],sbx[11],sbx[12],sbx[13],sbx[14]),error=this.executeCommand(13,JSCompiler_object_inline_flex_1343,!0),this.flexing=!1,this.stack.push(sbx[15],sbx[16])):1===sbx&&0===sby&&(this.flexing=!0);break;case 3089:break;case 3105:this.stack=[];break;default:(0,_util.warn)('Unknown type 1 charstring command of "'+
|
|
2013
2016
|
sbx+'"')}if(error)break}else sbx=246>=sbx?sbx-139:250>=sbx?256*(sbx-247)+encoded[++i]+108:254>=sbx?-(256*(sbx-251))-encoded[++i]-108:(encoded[++i]&255)<<24|(encoded[++i]&255)<<16|(encoded[++i]&255)<<8|(encoded[++i]&255)<<0,this.stack.push(sbx);return error},executeCommand:function(howManyArgs,command,keepStack){var stackLength=this.stack.length;if(howManyArgs>stackLength)return!0;for(var start=stackLength-howManyArgs,i=start;i<stackLength;i++){var value=this.stack[i];Number.isInteger(value)?this.output.push(28,
|
|
2014
2017
|
value>>8&255,value&255):(value=65536*value|0,this.output.push(255,value>>24&255,value>>16&255,value>>8&255,value&255))}this.output.push.apply(this.output,command);keepStack?this.stack.splice(start,howManyArgs):this.stack.length=0;return!1}};return Type1CharString}();module=function(){function isHexDigit(code){return 48<=code&&57>=code||65<=code&&70>=code||97<=code&&102>=code}function decrypt(data,key,discardNumber){if(discardNumber>=data.length)return new Uint8Array(0);key|=0;var i;for(i=0;i<discardNumber;i++)key=
|
|
2015
2018
|
52845*(data[i]+key)+22719&65535;var count=data.length-discardNumber,decrypted=new Uint8Array(count);i=discardNumber;for(discardNumber=0;discardNumber<count;i++,discardNumber++){var value=data[i];decrypted[discardNumber]=value^key>>8;key=52845*(value+key)+22719&65535}return decrypted}function isSpecial(c){return 47===c||91===c||93===c||123===c||125===c||40===c||41===c}function Type1Parser(stream,encrypted,seacAnalysisEnabled){if(encrypted){encrypted=stream.getBytes();var isBinary=!(isHexDigit(encrypted[0])&&
|
|
@@ -2343,9 +2346,9 @@ typeof Uint8Array?Uint8Array:Array;for(module=0;64>module;++module)lookup[module
|
|
|
2343
2346
|
nBytes+=d;isLE=s&(1<<-nBits)-1;s>>=-nBits;for(nBits+=m;0<nBits;isLE=256*isLE+buffer[offset+nBytes],nBytes+=d,nBits-=8);m=isLE&(1<<-nBits)-1;isLE>>=-nBits;for(nBits+=mLen;0<nBits;m=256*m+buffer[offset+nBytes],nBytes+=d,nBits-=8);if(0===isLE)isLE=1-eBias;else{if(isLE===eMax)return m?NaN:Infinity*(s?-1:1);m+=Math.pow(2,mLen);isLE-=eBias}return(s?-1:1)*m*Math.pow(2,isLE-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var c,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=23===
|
|
2344
2347
|
mLen?Math.pow(2,-24)-Math.pow(2,-77):0;nBytes=isLE?0:nBytes-1;var d=isLE?1:-1,s=0>value||0===value&&0>1/value?1:0;value=Math.abs(value);isNaN(value)||Infinity===value?(value=isNaN(value)?1:0,isLE=eMax):(isLE=Math.floor(Math.log(value)/Math.LN2),1>value*(c=Math.pow(2,-isLE))&&(isLE--,c*=2),value=1<=isLE+eBias?value+rt/c:value+rt*Math.pow(2,1-eBias),2<=value*c&&(isLE++,c/=2),isLE+eBias>=eMax?(value=0,isLE=eMax):1<=isLE+eBias?(value=(value*c-1)*Math.pow(2,mLen),isLE+=eBias):(value=value*Math.pow(2,eBias-
|
|
2345
2348
|
1)*Math.pow(2,mLen),isLE=0));for(;8<=mLen;buffer[offset+nBytes]=value&255,nBytes+=d,value/=256,mLen-=8);isLE=isLE<<mLen|value;for(eLen+=mLen;0<eLen;buffer[offset+nBytes]=isLE&255,nBytes+=d,isLE/=256,eLen-=8);buffer[offset+nBytes-d]|=128*s}},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){function defaultSetTimout(){throw Error("setTimeout has not been defined");}function defaultClearTimeout(){throw Error("clearTimeout has not been defined");
|
|
2346
|
-
}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e$
|
|
2347
|
-
clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e$
|
|
2348
|
-
queue;for(queue=[];++queueIndex<len;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1;len=queue.length}currentQueue=null;draining=!1;runClearTimeout(timeout)}}function Item(fun,array){this.fun=fun;this.array=array}function noop(){}module=module.exports={};try{var cachedSetTimeout="function"===typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{var cachedClearTimeout="function"===typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e$
|
|
2349
|
+
}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e$13){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&
|
|
2350
|
+
clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e$14){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){currentQueue=
|
|
2351
|
+
queue;for(queue=[];++queueIndex<len;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1;len=queue.length}currentQueue=null;draining=!1;runClearTimeout(timeout)}}function Item(fun,array){this.fun=fun;this.array=array}function noop(){}module=module.exports={};try{var cachedSetTimeout="function"===typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{var cachedClearTimeout="function"===typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e$12){cachedClearTimeout=
|
|
2349
2352
|
defaultClearTimeout}var queue=[],draining=!1,currentQueue,queueIndex=-1;module.nextTick=function(fun){var args=Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args));1!==queue.length||draining||runTimeout(drainQueue)};Item.prototype.run=function(){this.fun.apply(null,this.array)};module.title="browser";module.browser=!0;module.env={};module.argv=[];module.version="";module.versions={};module.on=noop;module.addListener=
|
|
2350
2353
|
noop;module.once=noop;module.off=noop;module.removeListener=noop;module.removeAllListeners=noop;module.emit=noop;module.prependListener=noop;module.prependOnceListener=noop;module.listeners=function(name){return[]};module.binding=function(name){throw Error("process.binding is not supported");};module.cwd=function(){return"/"};module.chdir=function(dir){throw Error("process.chdir is not supported");};module.umask=function(){return 0}},function(module$jscomp$0,exports){module$jscomp$0.exports=function(module){module.webpackPolyfill||
|
|
2351
2354
|
(module.deprecate=function(){},module.paths=[],module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),module.webpackPolyfill=1);return module}}]);}).call(this || window)
|