{"version":3,"file":"pdf-lib.esm.min.js","sources":["../node_modules/tslib/tslib.es6.js","../es/utils/base64.js","../es/utils/unicode.js","../es/utils/strings.js","../es/utils/arrays.js","../es/utils/async.js","../es/utils/numbers.js","../es/utils/errors.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/utils/common.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/trees.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/adler32.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/crc32.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/deflate.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/messages.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/utils/strings.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/zstream.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/deflate.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/inffast.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/inftrees.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/inflate.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/constants.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/gzheader.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/inflate.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/index.js","../node_modules/@pdf-lib/standard-fonts/es/utils.js","../node_modules/@pdf-lib/standard-fonts/es/Font.js","../es/utils/pdfDocEncoding.js","../node_modules/@pdf-lib/standard-fonts/es/Encoding.js","../es/utils/objects.js","../es/utils/validators.js","../es/core/syntax/CharCodes.js","../es/utils/Cache.js","../es/core/errors.js","../node_modules/pako/lib/utils/common.js","../node_modules/pako/lib/zlib/trees.js","../node_modules/pako/lib/zlib/adler32.js","../node_modules/pako/lib/zlib/crc32.js","../node_modules/pako/lib/zlib/deflate.js","../node_modules/pako/lib/zlib/messages.js","../node_modules/pako/lib/utils/strings.js","../node_modules/pako/lib/zlib/zstream.js","../node_modules/pako/lib/deflate.js","../node_modules/pako/lib/zlib/inffast.js","../node_modules/pako/lib/zlib/inftrees.js","../node_modules/pako/lib/zlib/inflate.js","../node_modules/pako/lib/zlib/constants.js","../node_modules/pako/lib/zlib/gzheader.js","../node_modules/pako/lib/inflate.js","../node_modules/pako/index.js","../es/core/document/PDFHeader.js","../es/core/objects/PDFObject.js","../es/core/objects/PDFNumber.js","../es/core/objects/PDFArray.js","../es/core/objects/PDFBool.js","../es/core/objects/PDFNull.js","../es/core/objects/PDFDict.js","../es/core/syntax/Delimiters.js","../es/core/syntax/Whitespace.js","../es/core/syntax/Irregular.js","../es/core/objects/PDFName.js","../es/core/operators/PDFOperatorNames.js","../es/core/objects/PDFStream.js","../es/core/objects/PDFRawStream.js","../es/core/objects/PDFRef.js","../es/core/operators/PDFOperator.js","../es/core/structures/PDFCrossRefStream.js","../es/core/structures/PDFFlateStream.js","../es/core/structures/PDFContentStream.js","../es/core/PDFContext.js","../es/core/structures/PDFPageLeaf.js","../es/core/PDFObjectCopier.js","../es/core/document/PDFCrossRefSection.js","../es/core/document/PDFTrailer.js","../es/core/document/PDFTrailerDict.js","../es/core/structures/PDFObjectStream.js","../es/core/writers/PDFWriter.js","../es/core/objects/PDFInvalidObject.js","../es/core/embedders/JpegEmbedder.js","../es/core/writers/PDFStreamWriter.js","../es/core/objects/PDFHexString.js","../es/core/embedders/StandardFontEmbedder.js","../es/core/embedders/CMap.js","../es/core/objects/PDFString.js","../es/core/embedders/CustomFontEmbedder.js","../es/core/embedders/FontFlags.js","../es/core/embedders/CustomFontSubsetEmbedder.js","../es/core/embedders/FileEmbedder.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/utils/common.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/trees.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/adler32.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/crc32.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/deflate.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/messages.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/utils/strings.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/zstream.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/deflate.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/inffast.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/inftrees.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/inflate.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/constants.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/gzheader.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/inflate.js","../node_modules/@pdf-lib/upng/node_modules/pako/index.js","../node_modules/@pdf-lib/upng/UPNG.js","../es/utils/png.js","../es/core/acroform/flags.js","../es/core/embedders/PngEmbedder.js","../es/core/streams/Stream.js","../es/core/streams/DecodeStream.js","../es/core/streams/Ascii85Stream.js","../es/core/streams/AsciiHexStream.js","../es/core/streams/FlateStream.js","../es/core/streams/LZWStream.js","../es/core/streams/RunLengthStream.js","../es/core/streams/decode.js","../es/core/embedders/PDFPageEmbedder.js","../es/core/acroform/PDFAcroField.js","../es/core/annotation/BorderStyle.js","../es/core/annotation/PDFAnnotation.js","../es/core/annotation/AppearanceCharacteristics.js","../es/core/annotation/PDFWidgetAnnotation.js","../es/core/acroform/PDFAcroTerminal.js","../es/core/acroform/PDFAcroButton.js","../es/core/acroform/PDFAcroCheckBox.js","../es/core/acroform/PDFAcroChoice.js","../es/core/acroform/PDFAcroComboBox.js","../es/core/acroform/PDFAcroNonTerminal.js","../es/core/acroform/PDFAcroSignature.js","../es/core/acroform/PDFAcroText.js","../es/core/acroform/PDFAcroPushButton.js","../es/core/acroform/PDFAcroRadioButton.js","../es/core/acroform/PDFAcroListBox.js","../es/core/acroform/utils.js","../es/core/acroform/PDFAcroForm.js","../es/core/structures/PDFCatalog.js","../es/core/structures/PDFPageTree.js","../es/core/syntax/Numeric.js","../es/core/parser/BaseParser.js","../es/api/rotations.js","../es/core/parser/ByteStream.js","../es/core/syntax/Keywords.js","../es/core/parser/PDFObjectParser.js","../es/core/parser/PDFObjectStreamParser.js","../es/core/parser/PDFXRefStreamParser.js","../es/core/parser/PDFParser.js","../es/api/objects.js","../es/api/operators.js","../es/api/colors.js","../es/api/text/alignment.js","../es/api/svgPath.js","../es/api/operations.js","../es/api/errors.js","../es/api/text/layout.js","../es/api/StandardFonts.js","../es/api/form/appearances.js","../es/api/PDFEmbeddedPage.js","../es/api/PDFFont.js","../es/api/PDFImage.js","../es/api/form/PDFField.js","../es/api/form/PDFCheckBox.js","../es/api/form/PDFDropdown.js","../es/api/form/PDFOptionList.js","../es/api/form/PDFRadioGroup.js","../es/api/form/PDFSignature.js","../es/api/form/PDFTextField.js","../es/api/form/PDFForm.js","../es/api/PDFDocumentOptions.js","../es/api/sizes.js","../es/api/PDFEmbeddedFile.js","../es/api/PDFPageOptions.js","../es/api/PDFDocument.js","../es/api/PDFPage.js","../es/api/form/PDFButton.js"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/*\n * The `chars`, `lookup`, `encode`, and `decode` members of this file are\n * licensed under the following:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n *\n */\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport var encodeToBase64 = function (bytes) {\n var base64 = '';\n var len = bytes.length;\n for (var i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport var decodeFromBase64 = function (base64) {\n var bufferLength = base64.length * 0.75;\n var len = base64.length;\n var i;\n var p = 0;\n var encoded1;\n var encoded2;\n var encoded3;\n var encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n var bytes = new Uint8Array(bufferLength);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return bytes;\n};\n// This regex is designed to be as flexible as possible. It will parse certain\n// invalid data URIs.\nvar DATA_URI_PREFIX_REGEX = /^(data)?:?([\\w\\/\\+]+)?;?(charset=[\\w-]+|base64)?.*,/i;\n/**\n * If the `dataUri` input is a data URI, then the data URI prefix must not be\n * longer than 100 characters, or this function will fail to decode it.\n *\n * @param dataUri a base64 data URI or plain base64 string\n * @returns a Uint8Array containing the decoded input\n */\nexport var decodeFromBase64DataUri = function (dataUri) {\n var trimmedUri = dataUri.trim();\n var prefix = trimmedUri.substring(0, 100);\n var res = prefix.match(DATA_URI_PREFIX_REGEX);\n // Assume it's not a data URI - just a plain base64 string\n if (!res)\n return decodeFromBase64(trimmedUri);\n // Remove the data URI prefix and parse the remainder as a base64 string\n var fullMatch = res[0];\n var data = trimmedUri.substring(fullMatch.length);\n return decodeFromBase64(data);\n};\n//# sourceMappingURL=base64.js.map","import { toHexString } from \"./strings\";\n/**\n * Encodes a string to UTF-8.\n *\n * @param input The string to be encoded.\n * @param byteOrderMark Whether or not a byte order marker (BOM) should be added\n * to the start of the encoding. (default `true`)\n * @returns A Uint8Array containing the UTF-8 encoding of the input string.\n *\n * -----------------------------------------------------------------------------\n *\n * JavaScript strings are composed of Unicode code points. Code points are\n * integers in the range 0 to 1,114,111 (0x10FFFF). When serializing a string,\n * it must be encoded as a sequence of words. A word is typically 8, 16, or 32\n * bytes in size. As such, Unicode defines three encoding forms: UTF-8, UTF-16,\n * and UTF-32. These encoding forms are described in the Unicode standard [1].\n * This function implements the UTF-8 encoding form.\n *\n * -----------------------------------------------------------------------------\n *\n * In UTF-8, each code point is mapped to a sequence of 1, 2, 3, or 4 bytes.\n * Note that the logic which defines this mapping is slightly convoluted, and\n * not as straightforward as the mapping logic for UTF-16 or UTF-32. The UTF-8\n * mapping logic is as follows [2]:\n *\n * • If a code point is in the range U+0000..U+007F, then view it as a 7-bit\n * integer: 0bxxxxxxx. Map the code point to 1 byte with the first high order\n * bit set to 0:\n *\n * b1=0b0xxxxxxx\n *\n * • If a code point is in the range U+0080..U+07FF, then view it as an 11-bit\n * integer: 0byyyyyxxxxxx. Map the code point to 2 bytes with the first 5 bits\n * of the code point stored in the first byte, and the last 6 bits stored in\n * the second byte:\n *\n * b1=0b110yyyyy b2=0b10xxxxxx\n *\n * • If a code point is in the range U+0800..U+FFFF, then view it as a 16-bit\n * integer, 0bzzzzyyyyyyxxxxxx. Map the code point to 3 bytes with the first\n * 4 bits stored in the first byte, the next 6 bits stored in the second byte,\n * and the last 6 bits in the third byte:\n *\n * b1=0b1110zzzz b2=0b10yyyyyy b3=0b10xxxxxx\n *\n * • If a code point is in the range U+10000...U+10FFFF, then view it as a\n * 21-bit integer, 0bvvvzzzzzzyyyyyyxxxxxx. Map the code point to 4 bytes with\n * the first 3 bits stored in the first byte, the next 6 bits stored in the\n * second byte, the next 6 bits stored in the third byte, and the last 6 bits\n * stored in the fourth byte:\n *\n * b1=0b11110xxx b2=0b10zzzzzz b3=0b10yyyyyy b4=0b10xxxxxx\n *\n * -----------------------------------------------------------------------------\n *\n * It is important to note, when iterating through the code points of a string\n * in JavaScript, that if a character is encoded as a surrogate pair it will\n * increase the string's length by 2 instead of 1 [4]. For example:\n *\n * ```\n * > 'a'.length\n * 1\n * > '💩'.length\n * 2\n * > '語'.length\n * 1\n * > 'a💩語'.length\n * 4\n * ```\n *\n * The results of the above example are explained by the fact that the\n * characters 'a' and '語' are not represented by surrogate pairs, but '💩' is.\n *\n * Because of this idiosyncrasy in JavaScript's string implementation and APIs,\n * we must \"jump\" an extra index after encoding a character as a surrogate\n * pair. In practice, this means we must increment the index of our for loop by\n * 2 if we encode a surrogate pair, and 1 in all other cases.\n *\n * -----------------------------------------------------------------------------\n *\n * References:\n * - [1] https://www.unicode.org/versions/Unicode12.0.0/UnicodeStandard-12.0.pdf\n * 3.9 Unicode Encoding Forms - UTF-8\n * - [2] http://www.herongyang.com/Unicode/UTF-8-UTF-8-Encoding.html\n * - [3] http://www.herongyang.com/Unicode/UTF-8-UTF-8-Encoding-Algorithm.html\n * - [4] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length#Description\n *\n */\nexport var utf8Encode = function (input, byteOrderMark) {\n if (byteOrderMark === void 0) { byteOrderMark = true; }\n var encoded = [];\n if (byteOrderMark)\n encoded.push(0xef, 0xbb, 0xbf);\n for (var idx = 0, len = input.length; idx < len;) {\n var codePoint = input.codePointAt(idx);\n // One byte encoding\n if (codePoint < 0x80) {\n var byte1 = codePoint & 0x7f;\n encoded.push(byte1);\n idx += 1;\n }\n // Two byte encoding\n else if (codePoint < 0x0800) {\n var byte1 = ((codePoint >> 6) & 0x1f) | 0xc0;\n var byte2 = (codePoint & 0x3f) | 0x80;\n encoded.push(byte1, byte2);\n idx += 1;\n }\n // Three byte encoding\n else if (codePoint < 0x010000) {\n var byte1 = ((codePoint >> 12) & 0x0f) | 0xe0;\n var byte2 = ((codePoint >> 6) & 0x3f) | 0x80;\n var byte3 = (codePoint & 0x3f) | 0x80;\n encoded.push(byte1, byte2, byte3);\n idx += 1;\n }\n // Four byte encoding (surrogate pair)\n else if (codePoint < 0x110000) {\n var byte1 = ((codePoint >> 18) & 0x07) | 0xf0;\n var byte2 = ((codePoint >> 12) & 0x3f) | 0x80;\n var byte3 = ((codePoint >> 6) & 0x3f) | 0x80;\n var byte4 = ((codePoint >> 0) & 0x3f) | 0x80;\n encoded.push(byte1, byte2, byte3, byte4);\n idx += 2;\n }\n // Should never reach this case\n else\n throw new Error(\"Invalid code point: 0x\" + toHexString(codePoint));\n }\n return new Uint8Array(encoded);\n};\n/**\n * Encodes a string to UTF-16.\n *\n * @param input The string to be encoded.\n * @param byteOrderMark Whether or not a byte order marker (BOM) should be added\n * to the start of the encoding. (default `true`)\n * @returns A Uint16Array containing the UTF-16 encoding of the input string.\n *\n * -----------------------------------------------------------------------------\n *\n * JavaScript strings are composed of Unicode code points. Code points are\n * integers in the range 0 to 1,114,111 (0x10FFFF). When serializing a string,\n * it must be encoded as a sequence of words. A word is typically 8, 16, or 32\n * bytes in size. As such, Unicode defines three encoding forms: UTF-8, UTF-16,\n * and UTF-32. These encoding forms are described in the Unicode standard [1].\n * This function implements the UTF-16 encoding form.\n *\n * -----------------------------------------------------------------------------\n *\n * In UTF-16, each code point is mapped to one or two 16-bit integers. The\n * UTF-16 mapping logic is as follows [2]:\n *\n * • If a code point is in the range U+0000..U+FFFF, then map the code point to\n * a 16-bit integer with the most significant byte first.\n *\n * • If a code point is in the range U+10000..U+10000, then map the code point\n * to two 16-bit integers. The first integer should contain the high surrogate\n * and the second integer should contain the low surrogate. Both surrogates\n * should be written with the most significant byte first.\n *\n * -----------------------------------------------------------------------------\n *\n * It is important to note, when iterating through the code points of a string\n * in JavaScript, that if a character is encoded as a surrogate pair it will\n * increase the string's length by 2 instead of 1 [4]. For example:\n *\n * ```\n * > 'a'.length\n * 1\n * > '💩'.length\n * 2\n * > '語'.length\n * 1\n * > 'a💩語'.length\n * 4\n * ```\n *\n * The results of the above example are explained by the fact that the\n * characters 'a' and '語' are not represented by surrogate pairs, but '💩' is.\n *\n * Because of this idiosyncrasy in JavaScript's string implementation and APIs,\n * we must \"jump\" an extra index after encoding a character as a surrogate\n * pair. In practice, this means we must increment the index of our for loop by\n * 2 if we encode a surrogate pair, and 1 in all other cases.\n *\n * -----------------------------------------------------------------------------\n *\n * References:\n * - [1] https://www.unicode.org/versions/Unicode12.0.0/UnicodeStandard-12.0.pdf\n * 3.9 Unicode Encoding Forms - UTF-8\n * - [2] http://www.herongyang.com/Unicode/UTF-16-UTF-16-Encoding.html\n * - [3] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length#Description\n *\n */\nexport var utf16Encode = function (input, byteOrderMark) {\n if (byteOrderMark === void 0) { byteOrderMark = true; }\n var encoded = [];\n if (byteOrderMark)\n encoded.push(0xfeff);\n for (var idx = 0, len = input.length; idx < len;) {\n var codePoint = input.codePointAt(idx);\n // Two byte encoding\n if (codePoint < 0x010000) {\n encoded.push(codePoint);\n idx += 1;\n }\n // Four byte encoding (surrogate pair)\n else if (codePoint < 0x110000) {\n encoded.push(highSurrogate(codePoint), lowSurrogate(codePoint));\n idx += 2;\n }\n // Should never reach this case\n else\n throw new Error(\"Invalid code point: 0x\" + toHexString(codePoint));\n }\n return new Uint16Array(encoded);\n};\n/**\n * Returns `true` if the `codePoint` is within the\n * Basic Multilingual Plane (BMP). Code points inside the BMP are not encoded\n * with surrogate pairs.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nexport var isWithinBMP = function (codePoint) {\n return codePoint >= 0 && codePoint <= 0xffff;\n};\n/**\n * Returns `true` if the given `codePoint` is valid and must be represented\n * with a surrogate pair when encoded.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nexport var hasSurrogates = function (codePoint) {\n return codePoint >= 0x010000 && codePoint <= 0x10ffff;\n};\n// From Unicode 3.0 spec, section 3.7:\n// http://unicode.org/versions/Unicode3.0.0/ch03.pdf\nexport var highSurrogate = function (codePoint) {\n return Math.floor((codePoint - 0x10000) / 0x400) + 0xd800;\n};\n// From Unicode 3.0 spec, section 3.7:\n// http://unicode.org/versions/Unicode3.0.0/ch03.pdf\nexport var lowSurrogate = function (codePoint) {\n return ((codePoint - 0x10000) % 0x400) + 0xdc00;\n};\nvar ByteOrder;\n(function (ByteOrder) {\n ByteOrder[\"BigEndian\"] = \"BigEndian\";\n ByteOrder[\"LittleEndian\"] = \"LittleEndian\";\n})(ByteOrder || (ByteOrder = {}));\nvar REPLACEMENT = '�'.codePointAt(0);\n/**\n * Decodes a Uint8Array of data to a string using UTF-16.\n *\n * Note that this function attempts to recover from erronous input by\n * inserting the replacement character (�) to mark invalid code points\n * and surrogate pairs.\n *\n * @param input A Uint8Array containing UTF-16 encoded data\n * @param byteOrderMark Whether or not a byte order marker (BOM) should be read\n * at the start of the encoding. (default `true`)\n * @returns The decoded string.\n */\nexport var utf16Decode = function (input, byteOrderMark) {\n if (byteOrderMark === void 0) { byteOrderMark = true; }\n // Need at least 2 bytes of data in UTF-16 encodings\n if (input.length <= 1)\n return String.fromCodePoint(REPLACEMENT);\n var byteOrder = byteOrderMark ? readBOM(input) : ByteOrder.BigEndian;\n // Skip byte order mark if needed\n var idx = byteOrderMark ? 2 : 0;\n var codePoints = [];\n while (input.length - idx >= 2) {\n var first = decodeValues(input[idx++], input[idx++], byteOrder);\n if (isHighSurrogate(first)) {\n if (input.length - idx < 2) {\n // Need at least 2 bytes left for the low surrogate that is required\n codePoints.push(REPLACEMENT);\n }\n else {\n var second = decodeValues(input[idx++], input[idx++], byteOrder);\n if (isLowSurrogate(second)) {\n codePoints.push(first, second);\n }\n else {\n // Low surrogates should always follow high surrogates\n codePoints.push(REPLACEMENT);\n }\n }\n }\n else if (isLowSurrogate(first)) {\n // High surrogates should always come first since `decodeValues()`\n // accounts for the byte ordering\n idx += 2;\n codePoints.push(REPLACEMENT);\n }\n else {\n codePoints.push(first);\n }\n }\n // There shouldn't be extra byte(s) left over\n if (idx < input.length)\n codePoints.push(REPLACEMENT);\n return String.fromCodePoint.apply(String, codePoints);\n};\n/**\n * Returns `true` if the given `codePoint` is a high surrogate.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nvar isHighSurrogate = function (codePoint) {\n return codePoint >= 0xd800 && codePoint <= 0xdbff;\n};\n/**\n * Returns `true` if the given `codePoint` is a low surrogate.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nvar isLowSurrogate = function (codePoint) {\n return codePoint >= 0xdc00 && codePoint <= 0xdfff;\n};\n/**\n * Decodes the given utf-16 values first and second using the specified\n * byte order.\n * @param first The first byte of the encoding.\n * @param second The second byte of the encoding.\n * @param byteOrder The byte order of the encoding.\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Examples\n */\nvar decodeValues = function (first, second, byteOrder) {\n // Append the binary representation of the preceding byte by shifting the\n // first one 8 to the left and than applying a bitwise or-operator to append\n // the second one.\n if (byteOrder === ByteOrder.LittleEndian)\n return (second << 8) | first;\n if (byteOrder === ByteOrder.BigEndian)\n return (first << 8) | second;\n throw new Error(\"Invalid byteOrder: \" + byteOrder);\n};\n/**\n * Returns whether the given array contains a byte order mark for the\n * UTF-16BE or UTF-16LE encoding. If it has neither, BigEndian is assumed.\n *\n * Reference: https://en.wikipedia.org/wiki/Byte_order_mark#UTF-16\n *\n * @param bytes The byte array to be evaluated.\n */\n// prettier-ignore\nvar readBOM = function (bytes) { return (hasUtf16BigEndianBOM(bytes) ? ByteOrder.BigEndian\n : hasUtf16LittleEndianBOM(bytes) ? ByteOrder.LittleEndian\n : ByteOrder.BigEndian); };\nvar hasUtf16BigEndianBOM = function (bytes) {\n return bytes[0] === 0xfe && bytes[1] === 0xff;\n};\nvar hasUtf16LittleEndianBOM = function (bytes) {\n return bytes[0] === 0xff && bytes[1] === 0xfe;\n};\nexport var hasUtf16BOM = function (bytes) {\n return hasUtf16BigEndianBOM(bytes) || hasUtf16LittleEndianBOM(bytes);\n};\n//# sourceMappingURL=unicode.js.map","export var toCharCode = function (character) { return character.charCodeAt(0); };\nexport var toCodePoint = function (character) { return character.codePointAt(0); };\nexport var toHexStringOfMinLength = function (num, minLength) {\n return padStart(num.toString(16), minLength, '0').toUpperCase();\n};\nexport var toHexString = function (num) { return toHexStringOfMinLength(num, 2); };\nexport var charFromCode = function (code) { return String.fromCharCode(code); };\nexport var charFromHexCode = function (hex) { return charFromCode(parseInt(hex, 16)); };\nexport var padStart = function (value, length, padChar) {\n var padding = '';\n for (var idx = 0, len = length - value.length; idx < len; idx++) {\n padding += padChar;\n }\n return padding + value;\n};\nexport var copyStringIntoBuffer = function (str, buffer, offset) {\n var length = str.length;\n for (var idx = 0; idx < length; idx++) {\n buffer[offset++] = str.charCodeAt(idx);\n }\n return length;\n};\nexport var addRandomSuffix = function (prefix, suffixLength) {\n if (suffixLength === void 0) { suffixLength = 4; }\n return prefix + \"-\" + Math.floor(Math.random() * Math.pow(10, suffixLength));\n};\nexport var escapeRegExp = function (str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n};\nexport var cleanText = function (text) {\n return text.replace(/\\t|\\u0085|\\u2028|\\u2029/g, ' ').replace(/[\\b\\v]/g, '');\n};\nexport var escapedNewlineChars = ['\\\\n', '\\\\f', '\\\\r', '\\\\u000B'];\nexport var newlineChars = ['\\n', '\\f', '\\r', '\\u000B'];\nexport var isNewlineChar = function (text) { return /^[\\n\\f\\r\\u000B]$/.test(text); };\nexport var lineSplit = function (text) { return text.split(/[\\n\\f\\r\\u000B]/); };\nexport var mergeLines = function (text) {\n return text.replace(/[\\n\\f\\r\\u000B]/g, ' ');\n};\n// JavaScript's String.charAt() method doesn work on strings containing UTF-16\n// characters (with high and low surrogate pairs), such as 💩 (poo emoji). This\n// `charAtIndex()` function does.\n//\n// Credit: https://github.com/mathiasbynens/String.prototype.at/blob/master/at.js#L14-L48\nexport var charAtIndex = function (text, index) {\n // Get the first code unit and code unit value\n var cuFirst = text.charCodeAt(index);\n var cuSecond;\n var nextIndex = index + 1;\n var length = 1;\n if (\n // Check if it's the start of a surrogate pair.\n cuFirst >= 0xd800 &&\n cuFirst <= 0xdbff && // high surrogate\n text.length > nextIndex // there is a next code unit\n ) {\n cuSecond = text.charCodeAt(nextIndex);\n if (cuSecond >= 0xdc00 && cuSecond <= 0xdfff)\n length = 2; // low surrogate\n }\n return [text.slice(index, index + length), length];\n};\nexport var charSplit = function (text) {\n var chars = [];\n for (var idx = 0, len = text.length; idx < len;) {\n var _a = charAtIndex(text, idx), c = _a[0], cLen = _a[1];\n chars.push(c);\n idx += cLen;\n }\n return chars;\n};\nvar buildWordBreakRegex = function (wordBreaks) {\n var newlineCharUnion = escapedNewlineChars.join('|');\n var escapedRules = ['$'];\n for (var idx = 0, len = wordBreaks.length; idx < len; idx++) {\n var wordBreak = wordBreaks[idx];\n if (isNewlineChar(wordBreak)) {\n throw new TypeError(\"`wordBreak` must not include \" + newlineCharUnion);\n }\n escapedRules.push(wordBreak === '' ? '.' : escapeRegExp(wordBreak));\n }\n var breakRules = escapedRules.join('|');\n return new RegExp(\"(\" + newlineCharUnion + \")|((.*?)(\" + breakRules + \"))\", 'gm');\n};\nexport var breakTextIntoLines = function (text, wordBreaks, maxWidth, computeWidthOfText) {\n var regex = buildWordBreakRegex(wordBreaks);\n var words = cleanText(text).match(regex);\n var currLine = '';\n var currWidth = 0;\n var lines = [];\n var pushCurrLine = function () {\n if (currLine !== '')\n lines.push(currLine);\n currLine = '';\n currWidth = 0;\n };\n for (var idx = 0, len = words.length; idx < len; idx++) {\n var word = words[idx];\n if (isNewlineChar(word)) {\n pushCurrLine();\n }\n else {\n var width = computeWidthOfText(word);\n if (currWidth + width > maxWidth)\n pushCurrLine();\n currLine += word;\n currWidth += width;\n }\n }\n pushCurrLine();\n return lines;\n};\n// See section \"7.9.4 Dates\" of the PDF specification\nvar dateRegex = /^D:(\\d\\d\\d\\d)(\\d\\d)?(\\d\\d)?(\\d\\d)?(\\d\\d)?(\\d\\d)?([+\\-Z])?(\\d\\d)?'?(\\d\\d)?'?$/;\nexport var parseDate = function (dateStr) {\n var match = dateStr.match(dateRegex);\n if (!match)\n return undefined;\n var year = match[1], _a = match[2], month = _a === void 0 ? '01' : _a, _b = match[3], day = _b === void 0 ? '01' : _b, _c = match[4], hours = _c === void 0 ? '00' : _c, _d = match[5], mins = _d === void 0 ? '00' : _d, _e = match[6], secs = _e === void 0 ? '00' : _e, _f = match[7], offsetSign = _f === void 0 ? 'Z' : _f, _g = match[8], offsetHours = _g === void 0 ? '00' : _g, _h = match[9], offsetMins = _h === void 0 ? '00' : _h;\n // http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15\n var tzOffset = offsetSign === 'Z' ? 'Z' : \"\" + offsetSign + offsetHours + \":\" + offsetMins;\n var date = new Date(year + \"-\" + month + \"-\" + day + \"T\" + hours + \":\" + mins + \":\" + secs + tzOffset);\n return date;\n};\n//# sourceMappingURL=strings.js.map","import { decodeFromBase64DataUri } from \"./base64\";\nimport { charFromCode } from \"./strings\";\nexport var last = function (array) { return array[array.length - 1]; };\n// export const dropLast = (array: T[]): T[] =>\n// array.slice(0, array.length - 1);\nexport var typedArrayFor = function (value) {\n if (value instanceof Uint8Array)\n return value;\n var length = value.length;\n var typedArray = new Uint8Array(length);\n for (var idx = 0; idx < length; idx++) {\n typedArray[idx] = value.charCodeAt(idx);\n }\n return typedArray;\n};\nexport var mergeIntoTypedArray = function () {\n var arrays = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n arrays[_i] = arguments[_i];\n }\n var arrayCount = arrays.length;\n var typedArrays = [];\n for (var idx = 0; idx < arrayCount; idx++) {\n var element = arrays[idx];\n typedArrays[idx] =\n element instanceof Uint8Array ? element : typedArrayFor(element);\n }\n var totalSize = 0;\n for (var idx = 0; idx < arrayCount; idx++) {\n totalSize += arrays[idx].length;\n }\n var merged = new Uint8Array(totalSize);\n var offset = 0;\n for (var arrIdx = 0; arrIdx < arrayCount; arrIdx++) {\n var arr = typedArrays[arrIdx];\n for (var byteIdx = 0, arrLen = arr.length; byteIdx < arrLen; byteIdx++) {\n merged[offset++] = arr[byteIdx];\n }\n }\n return merged;\n};\nexport var mergeUint8Arrays = function (arrays) {\n var totalSize = 0;\n for (var idx = 0, len = arrays.length; idx < len; idx++) {\n totalSize += arrays[idx].length;\n }\n var mergedBuffer = new Uint8Array(totalSize);\n var offset = 0;\n for (var idx = 0, len = arrays.length; idx < len; idx++) {\n var array = arrays[idx];\n mergedBuffer.set(array, offset);\n offset += array.length;\n }\n return mergedBuffer;\n};\nexport var arrayAsString = function (array) {\n var str = '';\n for (var idx = 0, len = array.length; idx < len; idx++) {\n str += charFromCode(array[idx]);\n }\n return str;\n};\nexport var byAscendingId = function (a, b) { return a.id - b.id; };\nexport var sortedUniq = function (array, indexer) {\n var uniq = [];\n for (var idx = 0, len = array.length; idx < len; idx++) {\n var curr = array[idx];\n var prev = array[idx - 1];\n if (idx === 0 || indexer(curr) !== indexer(prev)) {\n uniq.push(curr);\n }\n }\n return uniq;\n};\n// Arrays and TypedArrays in JS both have .reverse() methods, which would seem\n// to negate the need for this function. However, not all runtimes support this\n// method (e.g. React Native). This function compensates for that fact.\nexport var reverseArray = function (array) {\n var arrayLen = array.length;\n for (var idx = 0, len = Math.floor(arrayLen / 2); idx < len; idx++) {\n var leftIdx = idx;\n var rightIdx = arrayLen - idx - 1;\n var temp = array[idx];\n array[leftIdx] = array[rightIdx];\n array[rightIdx] = temp;\n }\n return array;\n};\nexport var sum = function (array) {\n var total = 0;\n for (var idx = 0, len = array.length; idx < len; idx++) {\n total += array[idx];\n }\n return total;\n};\nexport var range = function (start, end) {\n var arr = new Array(end - start);\n for (var idx = 0, len = arr.length; idx < len; idx++) {\n arr[idx] = start + idx;\n }\n return arr;\n};\nexport var pluckIndices = function (arr, indices) {\n var plucked = new Array(indices.length);\n for (var idx = 0, len = indices.length; idx < len; idx++) {\n plucked[idx] = arr[indices[idx]];\n }\n return plucked;\n};\nexport var canBeConvertedToUint8Array = function (input) {\n return input instanceof Uint8Array ||\n input instanceof ArrayBuffer ||\n typeof input === 'string';\n};\nexport var toUint8Array = function (input) {\n if (typeof input === 'string') {\n return decodeFromBase64DataUri(input);\n }\n else if (input instanceof ArrayBuffer) {\n return new Uint8Array(input);\n }\n else if (input instanceof Uint8Array) {\n return input;\n }\n else {\n throw new TypeError('`input` must be one of `string | ArrayBuffer | Uint8Array`');\n }\n};\n//# sourceMappingURL=arrays.js.map","/**\n * Returns a Promise that resolves after at least one tick of the\n * Macro Task Queue occurs.\n */\nexport var waitForTick = function () {\n return new Promise(function (resolve) {\n setTimeout(function () { return resolve(); }, 0);\n });\n};\n//# sourceMappingURL=async.js.map","// tslint:disable radix\n/**\n * Converts a number to its string representation in decimal. This function\n * differs from simply converting a number to a string with `.toString()`\n * because this function's output string will **not** contain exponential\n * notation.\n *\n * Credit: https://stackoverflow.com/a/46545519\n */\nexport var numberToString = function (num) {\n var numStr = String(num);\n if (Math.abs(num) < 1.0) {\n var e = parseInt(num.toString().split('e-')[1]);\n if (e) {\n var negative = num < 0;\n if (negative)\n num *= -1;\n num *= Math.pow(10, e - 1);\n numStr = '0.' + new Array(e).join('0') + num.toString().substring(2);\n if (negative)\n numStr = '-' + numStr;\n }\n }\n else {\n var e = parseInt(num.toString().split('+')[1]);\n if (e > 20) {\n e -= 20;\n num /= Math.pow(10, e);\n numStr = num.toString() + new Array(e + 1).join('0');\n }\n }\n return numStr;\n};\nexport var sizeInBytes = function (n) { return Math.ceil(n.toString(2).length / 8); };\n/**\n * Converts a number into its constituent bytes and returns them as\n * a number[].\n *\n * Returns most significant byte as first element in array. It may be necessary\n * to call .reverse() to get the bits in the desired order.\n *\n * Example:\n * bytesFor(0x02A41E) => [ 0b10, 0b10100100, 0b11110 ]\n *\n * Credit for algorithm: https://stackoverflow.com/a/1936865\n */\nexport var bytesFor = function (n) {\n var bytes = new Uint8Array(sizeInBytes(n));\n for (var i = 1; i <= bytes.length; i++) {\n bytes[i - 1] = n >> ((bytes.length - i) * 8);\n }\n return bytes;\n};\n//# sourceMappingURL=numbers.js.map","export var error = function (msg) {\n throw new Error(msg);\n};\n//# sourceMappingURL=errors.js.map","'use strict';\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\nvar utils = require('../utils/common');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nvar extra_dbits = /* extra bits for each distance code */\n [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n var dist; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n}\n\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar trees = require('./trees');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\n//var Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\n//var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\n//var Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\n\n\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\n\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n// s.block_start >= s.w_size)) {\n// throw new Error(\"slide too late\");\n// }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0; /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n }\n else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n }\n else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n }\n else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n }\n else {\n s.status = BUSY_STATE;\n }\n }\n//#endif\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n status = strm.state.status;\n if (status !== INIT_STATE &&\n status !== EXTRA_STATE &&\n status !== NAME_STATE &&\n status !== COMMENT_STATE &&\n status !== HCRC_STATE &&\n status !== BUSY_STATE &&\n status !== FINISH_STATE\n ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\n\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","// String encode/decode helpers\n'use strict';\n\n\nvar utils = require('./common');\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new utils.Buf8(256);\nfor (var q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new utils.Buf8(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n\n var result = '';\n for (var i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n return buf2binstring(buf, buf.length);\n};\n\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n var buf = new utils.Buf8(str.length);\n for (var i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n};\n\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n var i, out, c, c_len;\n var len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","'use strict';\n\n\nvar zlib_deflate = require('./zlib/deflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\n\nvar toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nvar Z_NO_FLUSH = 0;\nvar Z_FINISH = 4;\n\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_SYNC_FLUSH = 2;\n\nvar Z_DEFAULT_COMPRESSION = -1;\n\nvar Z_DEFAULT_STRATEGY = 0;\n\nvar Z_DEFLATED = 8;\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n if (!(this instanceof Deflate)) return new Deflate(options);\n\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n var dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var status, _mode;\n\n if (this.ended) { return false; }\n\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_deflate.deflate(strm, _mode); /* no bad return value */\n\n if (status !== Z_STREAM_END && status !== Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n if (this.options.to === 'string') {\n this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n // Finalize on the last chunk.\n if (_mode === Z_FINISH) {\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === Z_SYNC_FLUSH) {\n this.onEnd(Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nexports.Deflate = Deflate;\nexports.deflate = deflate;\nexports.deflateRaw = deflateRaw;\nexports.gzip = gzip;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar inflate_fast = require('./inffast');\nvar inflate_table = require('./inftrees');\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n //Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar c = require('./zlib/constants');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar GZheader = require('./zlib/gzheader');\n\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n if (!(this instanceof Inflate)) return new Inflate(options);\n\n this.options = utils.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var dictionary = this.options.dictionary;\n var status, _mode;\n var next_out_utf8, tail, utf8str;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n var allowBufError = false;\n\n if (this.ended) { return false; }\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);\n }\n\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\n if (this.options.to === 'string') {\n\n next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n tail = strm.next_out - next_out_utf8;\n utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\n this.onData(utf8str);\n\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === c.Z_OK) {\n if (this.options.to === 'string') {\n // Glue & convert here, until we teach pako to send\n // utf8 aligned strings to onData\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n var inflator = new Inflate(options);\n\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip = inflate;\n","// Top level file is just a mixin of submodules & constants\n'use strict';\n\nvar assign = require('./lib/utils/common').assign;\n\nvar deflate = require('./lib/deflate');\nvar inflate = require('./lib/inflate');\nvar constants = require('./lib/zlib/constants');\n\nvar pako = {};\n\nassign(pako, deflate, inflate, constants);\n\nmodule.exports = pako;\n","/*\n * The `chars`, `lookup`, and `decodeFromBase64` members of this file are\n * licensed under the following:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n *\n */\nimport pako from 'pako';\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport var decodeFromBase64 = function (base64) {\n var bufferLength = base64.length * 0.75;\n var len = base64.length;\n var i;\n var p = 0;\n var encoded1;\n var encoded2;\n var encoded3;\n var encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n var bytes = new Uint8Array(bufferLength);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return bytes;\n};\nvar arrayToString = function (array) {\n var str = '';\n for (var i = 0; i < array.length; i++) {\n str += String.fromCharCode(array[i]);\n }\n return str;\n};\nexport var decompressJson = function (compressedJson) {\n return arrayToString(pako.inflate(decodeFromBase64(compressedJson)));\n};\nexport var padStart = function (value, length, padChar) {\n var padding = '';\n for (var idx = 0, len = length - value.length; idx < len; idx++) {\n padding += padChar;\n }\n return padding + value;\n};\n","import { decompressJson } from './utils';\nimport CourierBoldCompressed from './Courier-Bold.compressed.json';\nimport CourierBoldObliqueCompressed from './Courier-BoldOblique.compressed.json';\nimport CourierObliqueCompressed from './Courier-Oblique.compressed.json';\nimport CourierCompressed from './Courier.compressed.json';\nimport HelveticaBoldCompressed from './Helvetica-Bold.compressed.json';\nimport HelveticaBoldObliqueCompressed from './Helvetica-BoldOblique.compressed.json';\nimport HelveticaObliqueCompressed from './Helvetica-Oblique.compressed.json';\nimport HelveticaCompressed from './Helvetica.compressed.json';\nimport TimesBoldCompressed from './Times-Bold.compressed.json';\nimport TimesBoldItalicCompressed from './Times-BoldItalic.compressed.json';\nimport TimesItalicCompressed from './Times-Italic.compressed.json';\nimport TimesRomanCompressed from './Times-Roman.compressed.json';\nimport SymbolCompressed from './Symbol.compressed.json';\nimport ZapfDingbatsCompressed from './ZapfDingbats.compressed.json';\n// prettier-ignore\nvar compressedJsonForFontName = {\n 'Courier': CourierCompressed,\n 'Courier-Bold': CourierBoldCompressed,\n 'Courier-Oblique': CourierObliqueCompressed,\n 'Courier-BoldOblique': CourierBoldObliqueCompressed,\n 'Helvetica': HelveticaCompressed,\n 'Helvetica-Bold': HelveticaBoldCompressed,\n 'Helvetica-Oblique': HelveticaObliqueCompressed,\n 'Helvetica-BoldOblique': HelveticaBoldObliqueCompressed,\n 'Times-Roman': TimesRomanCompressed,\n 'Times-Bold': TimesBoldCompressed,\n 'Times-Italic': TimesItalicCompressed,\n 'Times-BoldItalic': TimesBoldItalicCompressed,\n 'Symbol': SymbolCompressed,\n 'ZapfDingbats': ZapfDingbatsCompressed,\n};\nexport var FontNames;\n(function (FontNames) {\n FontNames[\"Courier\"] = \"Courier\";\n FontNames[\"CourierBold\"] = \"Courier-Bold\";\n FontNames[\"CourierOblique\"] = \"Courier-Oblique\";\n FontNames[\"CourierBoldOblique\"] = \"Courier-BoldOblique\";\n FontNames[\"Helvetica\"] = \"Helvetica\";\n FontNames[\"HelveticaBold\"] = \"Helvetica-Bold\";\n FontNames[\"HelveticaOblique\"] = \"Helvetica-Oblique\";\n FontNames[\"HelveticaBoldOblique\"] = \"Helvetica-BoldOblique\";\n FontNames[\"TimesRoman\"] = \"Times-Roman\";\n FontNames[\"TimesRomanBold\"] = \"Times-Bold\";\n FontNames[\"TimesRomanItalic\"] = \"Times-Italic\";\n FontNames[\"TimesRomanBoldItalic\"] = \"Times-BoldItalic\";\n FontNames[\"Symbol\"] = \"Symbol\";\n FontNames[\"ZapfDingbats\"] = \"ZapfDingbats\";\n})(FontNames || (FontNames = {}));\nvar fontCache = {};\nvar Font = /** @class */ (function () {\n function Font() {\n var _this = this;\n this.getWidthOfGlyph = function (glyphName) {\n return _this.CharWidths[glyphName];\n };\n this.getXAxisKerningForPair = function (leftGlyphName, rightGlyphName) {\n return (_this.KernPairXAmounts[leftGlyphName] || {})[rightGlyphName];\n };\n }\n Font.load = function (fontName) {\n var cachedFont = fontCache[fontName];\n if (cachedFont)\n return cachedFont;\n var json = decompressJson(compressedJsonForFontName[fontName]);\n var font = Object.assign(new Font(), JSON.parse(json));\n font.CharWidths = font.CharMetrics.reduce(function (acc, metric) {\n acc[metric.N] = metric.WX;\n return acc;\n }, {});\n font.KernPairXAmounts = font.KernPairs.reduce(function (acc, _a) {\n var name1 = _a[0], name2 = _a[1], width = _a[2];\n if (!acc[name1])\n acc[name1] = {};\n acc[name1][name2] = width;\n return acc;\n }, {});\n fontCache[fontName] = font;\n return font;\n };\n return Font;\n}());\nexport { Font };\n","import { toCharCode } from \"./strings\";\n// Mapping from PDFDocEncoding to Unicode code point\nvar pdfDocEncodingToUnicode = new Uint16Array(256);\n// Initialize the code points which are the same\nfor (var idx = 0; idx < 256; idx++) {\n pdfDocEncodingToUnicode[idx] = idx;\n}\n// Set differences (see \"Table D.2 – PDFDocEncoding Character Set\" of the PDF spec)\npdfDocEncodingToUnicode[0x16] = toCharCode('\\u0017'); // SYNCRONOUS IDLE\npdfDocEncodingToUnicode[0x18] = toCharCode('\\u02D8'); // BREVE\npdfDocEncodingToUnicode[0x19] = toCharCode('\\u02C7'); // CARON\npdfDocEncodingToUnicode[0x1a] = toCharCode('\\u02C6'); // MODIFIER LETTER CIRCUMFLEX ACCENT\npdfDocEncodingToUnicode[0x1b] = toCharCode('\\u02D9'); // DOT ABOVE\npdfDocEncodingToUnicode[0x1c] = toCharCode('\\u02DD'); // DOUBLE ACUTE ACCENT\npdfDocEncodingToUnicode[0x1d] = toCharCode('\\u02DB'); // OGONEK\npdfDocEncodingToUnicode[0x1e] = toCharCode('\\u02DA'); // RING ABOVE\npdfDocEncodingToUnicode[0x1f] = toCharCode('\\u02DC'); // SMALL TILDE\npdfDocEncodingToUnicode[0x7f] = toCharCode('\\uFFFD'); // REPLACEMENT CHARACTER (box with questionmark)\npdfDocEncodingToUnicode[0x80] = toCharCode('\\u2022'); // BULLET\npdfDocEncodingToUnicode[0x81] = toCharCode('\\u2020'); // DAGGER\npdfDocEncodingToUnicode[0x82] = toCharCode('\\u2021'); // DOUBLE DAGGER\npdfDocEncodingToUnicode[0x83] = toCharCode('\\u2026'); // HORIZONTAL ELLIPSIS\npdfDocEncodingToUnicode[0x84] = toCharCode('\\u2014'); // EM DASH\npdfDocEncodingToUnicode[0x85] = toCharCode('\\u2013'); // EN DASH\npdfDocEncodingToUnicode[0x86] = toCharCode('\\u0192'); // LATIN SMALL LETTER SCRIPT F\npdfDocEncodingToUnicode[0x87] = toCharCode('\\u2044'); // FRACTION SLASH (solidus)\npdfDocEncodingToUnicode[0x88] = toCharCode('\\u2039'); // SINGLE LEFT-POINTING ANGLE QUOTATION MARK\npdfDocEncodingToUnicode[0x89] = toCharCode('\\u203A'); // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK\npdfDocEncodingToUnicode[0x8a] = toCharCode('\\u2212'); // MINUS SIGN\npdfDocEncodingToUnicode[0x8b] = toCharCode('\\u2030'); // PER MILLE SIGN\npdfDocEncodingToUnicode[0x8c] = toCharCode('\\u201E'); // DOUBLE LOW-9 QUOTATION MARK (quotedblbase)\npdfDocEncodingToUnicode[0x8d] = toCharCode('\\u201C'); // LEFT DOUBLE QUOTATION MARK (quotedblleft)\npdfDocEncodingToUnicode[0x8e] = toCharCode('\\u201D'); // RIGHT DOUBLE QUOTATION MARK (quotedblright)\npdfDocEncodingToUnicode[0x8f] = toCharCode('\\u2018'); // LEFT SINGLE QUOTATION MARK (quoteleft)\npdfDocEncodingToUnicode[0x90] = toCharCode('\\u2019'); // RIGHT SINGLE QUOTATION MARK (quoteright)\npdfDocEncodingToUnicode[0x91] = toCharCode('\\u201A'); // SINGLE LOW-9 QUOTATION MARK (quotesinglbase)\npdfDocEncodingToUnicode[0x92] = toCharCode('\\u2122'); // TRADE MARK SIGN\npdfDocEncodingToUnicode[0x93] = toCharCode('\\uFB01'); // LATIN SMALL LIGATURE FI\npdfDocEncodingToUnicode[0x94] = toCharCode('\\uFB02'); // LATIN SMALL LIGATURE FL\npdfDocEncodingToUnicode[0x95] = toCharCode('\\u0141'); // LATIN CAPITAL LETTER L WITH STROKE\npdfDocEncodingToUnicode[0x96] = toCharCode('\\u0152'); // LATIN CAPITAL LIGATURE OE\npdfDocEncodingToUnicode[0x97] = toCharCode('\\u0160'); // LATIN CAPITAL LETTER S WITH CARON\npdfDocEncodingToUnicode[0x98] = toCharCode('\\u0178'); // LATIN CAPITAL LETTER Y WITH DIAERESIS\npdfDocEncodingToUnicode[0x99] = toCharCode('\\u017D'); // LATIN CAPITAL LETTER Z WITH CARON\npdfDocEncodingToUnicode[0x9a] = toCharCode('\\u0131'); // LATIN SMALL LETTER DOTLESS I\npdfDocEncodingToUnicode[0x9b] = toCharCode('\\u0142'); // LATIN SMALL LETTER L WITH STROKE\npdfDocEncodingToUnicode[0x9c] = toCharCode('\\u0153'); // LATIN SMALL LIGATURE OE\npdfDocEncodingToUnicode[0x9d] = toCharCode('\\u0161'); // LATIN SMALL LETTER S WITH CARON\npdfDocEncodingToUnicode[0x9e] = toCharCode('\\u017E'); // LATIN SMALL LETTER Z WITH CARON\npdfDocEncodingToUnicode[0x9f] = toCharCode('\\uFFFD'); // REPLACEMENT CHARACTER (box with questionmark)\npdfDocEncodingToUnicode[0xa0] = toCharCode('\\u20AC'); // EURO SIGN\npdfDocEncodingToUnicode[0xad] = toCharCode('\\uFFFD'); // REPLACEMENT CHARACTER (box with questionmark)\n/**\n * Decode a byte array into a string using PDFDocEncoding.\n *\n * @param bytes a byte array (decimal representation) containing a string\n * encoded with PDFDocEncoding.\n */\nexport var pdfDocEncodingDecode = function (bytes) {\n var codePoints = new Array(bytes.length);\n for (var idx = 0, len = bytes.length; idx < len; idx++) {\n codePoints[idx] = pdfDocEncodingToUnicode[bytes[idx]];\n }\n return String.fromCodePoint.apply(String, codePoints);\n};\n//# sourceMappingURL=pdfDocEncoding.js.map","/* tslint:disable max-classes-per-file */\nimport { decompressJson, padStart } from './utils';\nimport AllEncodingsCompressed from './all-encodings.compressed.json';\nvar decompressedEncodings = decompressJson(AllEncodingsCompressed);\nvar allUnicodeMappings = JSON.parse(decompressedEncodings);\nvar Encoding = /** @class */ (function () {\n function Encoding(name, unicodeMappings) {\n var _this = this;\n this.canEncodeUnicodeCodePoint = function (codePoint) {\n return codePoint in _this.unicodeMappings;\n };\n this.encodeUnicodeCodePoint = function (codePoint) {\n var mapped = _this.unicodeMappings[codePoint];\n if (!mapped) {\n var str = String.fromCharCode(codePoint);\n var hexCode = \"0x\" + padStart(codePoint.toString(16), 4, '0');\n var msg = _this.name + \" cannot encode \\\"\" + str + \"\\\" (\" + hexCode + \")\";\n throw new Error(msg);\n }\n return { code: mapped[0], name: mapped[1] };\n };\n this.name = name;\n this.supportedCodePoints = Object.keys(unicodeMappings)\n .map(Number)\n .sort(function (a, b) { return a - b; });\n this.unicodeMappings = unicodeMappings;\n }\n return Encoding;\n}());\nexport var Encodings = {\n Symbol: new Encoding('Symbol', allUnicodeMappings.symbol),\n ZapfDingbats: new Encoding('ZapfDingbats', allUnicodeMappings.zapfdingbats),\n WinAnsi: new Encoding('WinAnsi', allUnicodeMappings.win1252),\n};\n","import { FontNames } from '@pdf-lib/standard-fonts';\nexport var values = function (obj) { return Object.keys(obj).map(function (k) { return obj[k]; }); };\nexport var StandardFontValues = values(FontNames);\nexport var isStandardFont = function (input) {\n return StandardFontValues.includes(input);\n};\nexport var rectanglesAreEqual = function (a, b) { return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; };\n//# sourceMappingURL=objects.js.map","/* tslint:disable:ban-types */\nimport { values as objectValues } from \"./objects\";\nexport var backtick = function (val) { return \"`\" + val + \"`\"; };\nexport var singleQuote = function (val) { return \"'\" + val + \"'\"; };\n// prettier-ignore\nvar formatValue = function (value) {\n var type = typeof value;\n if (type === 'string')\n return singleQuote(value);\n else if (type === 'undefined')\n return backtick(value);\n else\n return value;\n};\nexport var createValueErrorMsg = function (value, valueName, values) {\n var allowedValues = new Array(values.length);\n for (var idx = 0, len = values.length; idx < len; idx++) {\n var v = values[idx];\n allowedValues[idx] = formatValue(v);\n }\n var joinedValues = allowedValues.join(' or ');\n // prettier-ignore\n return backtick(valueName) + \" must be one of \" + joinedValues + \", but was actually \" + formatValue(value);\n};\nexport var assertIsOneOf = function (value, valueName, allowedValues) {\n if (!Array.isArray(allowedValues)) {\n allowedValues = objectValues(allowedValues);\n }\n for (var idx = 0, len = allowedValues.length; idx < len; idx++) {\n if (value === allowedValues[idx])\n return;\n }\n throw new TypeError(createValueErrorMsg(value, valueName, allowedValues));\n};\nexport var assertIsOneOfOrUndefined = function (value, valueName, allowedValues) {\n if (!Array.isArray(allowedValues)) {\n allowedValues = objectValues(allowedValues);\n }\n assertIsOneOf(value, valueName, allowedValues.concat(undefined));\n};\nexport var assertIsSubset = function (values, valueName, allowedValues) {\n if (!Array.isArray(allowedValues)) {\n allowedValues = objectValues(allowedValues);\n }\n for (var idx = 0, len = values.length; idx < len; idx++) {\n assertIsOneOf(values[idx], valueName, allowedValues);\n }\n};\nexport var getType = function (val) {\n if (val === null)\n return 'null';\n if (val === undefined)\n return 'undefined';\n if (typeof val === 'string')\n return 'string';\n if (isNaN(val))\n return 'NaN';\n if (typeof val === 'number')\n return 'number';\n if (typeof val === 'boolean')\n return 'boolean';\n if (typeof val === 'symbol')\n return 'symbol';\n if (typeof val === 'bigint')\n return 'bigint';\n if (val.constructor && val.constructor.name)\n return val.constructor.name;\n if (val.name)\n return val.name;\n if (val.constructor)\n return String(val.constructor);\n return String(val);\n};\nexport var isType = function (value, type) {\n if (type === 'null')\n return value === null;\n if (type === 'undefined')\n return value === undefined;\n if (type === 'string')\n return typeof value === 'string';\n if (type === 'number')\n return typeof value === 'number' && !isNaN(value);\n if (type === 'boolean')\n return typeof value === 'boolean';\n if (type === 'symbol')\n return typeof value === 'symbol';\n if (type === 'bigint')\n return typeof value === 'bigint';\n if (type === Date)\n return value instanceof Date;\n if (type === Array)\n return value instanceof Array;\n if (type === Uint8Array)\n return value instanceof Uint8Array;\n if (type === ArrayBuffer)\n return value instanceof ArrayBuffer;\n if (type === Function)\n return value instanceof Function;\n return value instanceof type[0];\n};\nexport var createTypeErrorMsg = function (value, valueName, types) {\n var allowedTypes = new Array(types.length);\n for (var idx = 0, len = types.length; idx < len; idx++) {\n var type = types[idx];\n if (type === 'null')\n allowedTypes[idx] = backtick('null');\n if (type === 'undefined')\n allowedTypes[idx] = backtick('undefined');\n if (type === 'string')\n allowedTypes[idx] = backtick('string');\n else if (type === 'number')\n allowedTypes[idx] = backtick('number');\n else if (type === 'boolean')\n allowedTypes[idx] = backtick('boolean');\n else if (type === 'symbol')\n allowedTypes[idx] = backtick('symbol');\n else if (type === 'bigint')\n allowedTypes[idx] = backtick('bigint');\n else if (type === Array)\n allowedTypes[idx] = backtick('Array');\n else if (type === Uint8Array)\n allowedTypes[idx] = backtick('Uint8Array');\n else if (type === ArrayBuffer)\n allowedTypes[idx] = backtick('ArrayBuffer');\n else\n allowedTypes[idx] = backtick(type[1]);\n }\n var joinedTypes = allowedTypes.join(' or ');\n // prettier-ignore\n return backtick(valueName) + \" must be of type \" + joinedTypes + \", but was actually of type \" + backtick(getType(value));\n};\nexport var assertIs = function (value, valueName, types) {\n for (var idx = 0, len = types.length; idx < len; idx++) {\n if (isType(value, types[idx]))\n return;\n }\n throw new TypeError(createTypeErrorMsg(value, valueName, types));\n};\nexport var assertOrUndefined = function (value, valueName, types) {\n assertIs(value, valueName, types.concat('undefined'));\n};\nexport var assertEachIs = function (values, valueName, types) {\n for (var idx = 0, len = values.length; idx < len; idx++) {\n assertIs(values[idx], valueName, types);\n }\n};\nexport var assertRange = function (value, valueName, min, max) {\n assertIs(value, valueName, ['number']);\n assertIs(min, 'min', ['number']);\n assertIs(max, 'max', ['number']);\n max = Math.max(min, max);\n if (value < min || value > max) {\n // prettier-ignore\n throw new Error(backtick(valueName) + \" must be at least \" + min + \" and at most \" + max + \", but was actually \" + value);\n }\n};\nexport var assertRangeOrUndefined = function (value, valueName, min, max) {\n assertIs(value, valueName, ['number', 'undefined']);\n if (typeof value === 'number')\n assertRange(value, valueName, min, max);\n};\nexport var assertMultiple = function (value, valueName, multiplier) {\n assertIs(value, valueName, ['number']);\n if (value % multiplier !== 0) {\n // prettier-ignore\n throw new Error(backtick(valueName) + \" must be a multiple of \" + multiplier + \", but was actually \" + value);\n }\n};\n//# sourceMappingURL=validators.js.map","var CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"Null\"] = 0] = \"Null\";\n CharCodes[CharCodes[\"Backspace\"] = 8] = \"Backspace\";\n CharCodes[CharCodes[\"Tab\"] = 9] = \"Tab\";\n CharCodes[CharCodes[\"Newline\"] = 10] = \"Newline\";\n CharCodes[CharCodes[\"FormFeed\"] = 12] = \"FormFeed\";\n CharCodes[CharCodes[\"CarriageReturn\"] = 13] = \"CarriageReturn\";\n CharCodes[CharCodes[\"Space\"] = 32] = \"Space\";\n CharCodes[CharCodes[\"ExclamationPoint\"] = 33] = \"ExclamationPoint\";\n CharCodes[CharCodes[\"Hash\"] = 35] = \"Hash\";\n CharCodes[CharCodes[\"Percent\"] = 37] = \"Percent\";\n CharCodes[CharCodes[\"LeftParen\"] = 40] = \"LeftParen\";\n CharCodes[CharCodes[\"RightParen\"] = 41] = \"RightParen\";\n CharCodes[CharCodes[\"Plus\"] = 43] = \"Plus\";\n CharCodes[CharCodes[\"Minus\"] = 45] = \"Minus\";\n CharCodes[CharCodes[\"Dash\"] = 45] = \"Dash\";\n CharCodes[CharCodes[\"Period\"] = 46] = \"Period\";\n CharCodes[CharCodes[\"ForwardSlash\"] = 47] = \"ForwardSlash\";\n CharCodes[CharCodes[\"Zero\"] = 48] = \"Zero\";\n CharCodes[CharCodes[\"One\"] = 49] = \"One\";\n CharCodes[CharCodes[\"Two\"] = 50] = \"Two\";\n CharCodes[CharCodes[\"Three\"] = 51] = \"Three\";\n CharCodes[CharCodes[\"Four\"] = 52] = \"Four\";\n CharCodes[CharCodes[\"Five\"] = 53] = \"Five\";\n CharCodes[CharCodes[\"Six\"] = 54] = \"Six\";\n CharCodes[CharCodes[\"Seven\"] = 55] = \"Seven\";\n CharCodes[CharCodes[\"Eight\"] = 56] = \"Eight\";\n CharCodes[CharCodes[\"Nine\"] = 57] = \"Nine\";\n CharCodes[CharCodes[\"LessThan\"] = 60] = \"LessThan\";\n CharCodes[CharCodes[\"GreaterThan\"] = 62] = \"GreaterThan\";\n CharCodes[CharCodes[\"A\"] = 65] = \"A\";\n CharCodes[CharCodes[\"D\"] = 68] = \"D\";\n CharCodes[CharCodes[\"E\"] = 69] = \"E\";\n CharCodes[CharCodes[\"F\"] = 70] = \"F\";\n CharCodes[CharCodes[\"O\"] = 79] = \"O\";\n CharCodes[CharCodes[\"P\"] = 80] = \"P\";\n CharCodes[CharCodes[\"R\"] = 82] = \"R\";\n CharCodes[CharCodes[\"LeftSquareBracket\"] = 91] = \"LeftSquareBracket\";\n CharCodes[CharCodes[\"BackSlash\"] = 92] = \"BackSlash\";\n CharCodes[CharCodes[\"RightSquareBracket\"] = 93] = \"RightSquareBracket\";\n CharCodes[CharCodes[\"a\"] = 97] = \"a\";\n CharCodes[CharCodes[\"b\"] = 98] = \"b\";\n CharCodes[CharCodes[\"d\"] = 100] = \"d\";\n CharCodes[CharCodes[\"e\"] = 101] = \"e\";\n CharCodes[CharCodes[\"f\"] = 102] = \"f\";\n CharCodes[CharCodes[\"i\"] = 105] = \"i\";\n CharCodes[CharCodes[\"j\"] = 106] = \"j\";\n CharCodes[CharCodes[\"l\"] = 108] = \"l\";\n CharCodes[CharCodes[\"m\"] = 109] = \"m\";\n CharCodes[CharCodes[\"n\"] = 110] = \"n\";\n CharCodes[CharCodes[\"o\"] = 111] = \"o\";\n CharCodes[CharCodes[\"r\"] = 114] = \"r\";\n CharCodes[CharCodes[\"s\"] = 115] = \"s\";\n CharCodes[CharCodes[\"t\"] = 116] = \"t\";\n CharCodes[CharCodes[\"u\"] = 117] = \"u\";\n CharCodes[CharCodes[\"x\"] = 120] = \"x\";\n CharCodes[CharCodes[\"LeftCurly\"] = 123] = \"LeftCurly\";\n CharCodes[CharCodes[\"RightCurly\"] = 125] = \"RightCurly\";\n CharCodes[CharCodes[\"Tilde\"] = 126] = \"Tilde\";\n})(CharCodes || (CharCodes = {}));\nexport default CharCodes;\n//# sourceMappingURL=CharCodes.js.map","var Cache = /** @class */ (function () {\n function Cache(populate) {\n this.populate = populate;\n this.value = undefined;\n }\n Cache.prototype.getValue = function () {\n return this.value;\n };\n Cache.prototype.access = function () {\n if (!this.value)\n this.value = this.populate();\n return this.value;\n };\n Cache.prototype.invalidate = function () {\n this.value = undefined;\n };\n Cache.populatedBy = function (populate) { return new Cache(populate); };\n return Cache;\n}());\nexport default Cache;\n//# sourceMappingURL=Cache.js.map","import { __extends } from \"tslib\";\nimport { arrayAsString } from \"../utils\";\nvar MethodNotImplementedError = /** @class */ (function (_super) {\n __extends(MethodNotImplementedError, _super);\n function MethodNotImplementedError(className, methodName) {\n var _this = this;\n var msg = \"Method \" + className + \".\" + methodName + \"() not implemented\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MethodNotImplementedError;\n}(Error));\nexport { MethodNotImplementedError };\nvar PrivateConstructorError = /** @class */ (function (_super) {\n __extends(PrivateConstructorError, _super);\n function PrivateConstructorError(className) {\n var _this = this;\n var msg = \"Cannot construct \" + className + \" - it has a private constructor\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PrivateConstructorError;\n}(Error));\nexport { PrivateConstructorError };\nvar UnexpectedObjectTypeError = /** @class */ (function (_super) {\n __extends(UnexpectedObjectTypeError, _super);\n function UnexpectedObjectTypeError(expected, actual) {\n var _this = this;\n var expectedTypes = Array.isArray(expected)\n ? expected.map(function (_a) {\n var name = _a.name;\n return name;\n })\n : [expected.name];\n var msg = \"Expected instance of \" + expectedTypes.join(' or ') + \", \" +\n (\"but got instance of \" + (actual ? actual.constructor.name : actual));\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return UnexpectedObjectTypeError;\n}(Error));\nexport { UnexpectedObjectTypeError };\nvar UnsupportedEncodingError = /** @class */ (function (_super) {\n __extends(UnsupportedEncodingError, _super);\n function UnsupportedEncodingError(encoding) {\n var _this = this;\n var msg = encoding + \" stream encoding not supported\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return UnsupportedEncodingError;\n}(Error));\nexport { UnsupportedEncodingError };\nvar ReparseError = /** @class */ (function (_super) {\n __extends(ReparseError, _super);\n function ReparseError(className, methodName) {\n var _this = this;\n var msg = \"Cannot call \" + className + \".\" + methodName + \"() more than once\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return ReparseError;\n}(Error));\nexport { ReparseError };\nvar MissingCatalogError = /** @class */ (function (_super) {\n __extends(MissingCatalogError, _super);\n function MissingCatalogError(ref) {\n var _this = this;\n var msg = \"Missing catalog (ref=\" + ref + \")\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MissingCatalogError;\n}(Error));\nexport { MissingCatalogError };\nvar MissingPageContentsEmbeddingError = /** @class */ (function (_super) {\n __extends(MissingPageContentsEmbeddingError, _super);\n function MissingPageContentsEmbeddingError() {\n var _this = this;\n var msg = \"Can't embed page with missing Contents\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MissingPageContentsEmbeddingError;\n}(Error));\nexport { MissingPageContentsEmbeddingError };\nvar UnrecognizedStreamTypeError = /** @class */ (function (_super) {\n __extends(UnrecognizedStreamTypeError, _super);\n function UnrecognizedStreamTypeError(stream) {\n var _a, _b, _c;\n var _this = this;\n var streamType = (_c = (_b = (_a = stream === null || stream === void 0 ? void 0 : stream.contructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : stream === null || stream === void 0 ? void 0 : stream.name) !== null && _c !== void 0 ? _c : stream;\n var msg = \"Unrecognized stream type: \" + streamType;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return UnrecognizedStreamTypeError;\n}(Error));\nexport { UnrecognizedStreamTypeError };\nvar PageEmbeddingMismatchedContextError = /** @class */ (function (_super) {\n __extends(PageEmbeddingMismatchedContextError, _super);\n function PageEmbeddingMismatchedContextError() {\n var _this = this;\n var msg = \"Found mismatched contexts while embedding pages. All pages in the array passed to `PDFDocument.embedPages()` must be from the same document.\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PageEmbeddingMismatchedContextError;\n}(Error));\nexport { PageEmbeddingMismatchedContextError };\nvar PDFArrayIsNotRectangleError = /** @class */ (function (_super) {\n __extends(PDFArrayIsNotRectangleError, _super);\n function PDFArrayIsNotRectangleError(size) {\n var _this = this;\n var msg = \"Attempted to convert PDFArray with \" + size + \" elements to rectangle, but must have exactly 4 elements.\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PDFArrayIsNotRectangleError;\n}(Error));\nexport { PDFArrayIsNotRectangleError };\nvar InvalidPDFDateStringError = /** @class */ (function (_super) {\n __extends(InvalidPDFDateStringError, _super);\n function InvalidPDFDateStringError(value) {\n var _this = this;\n var msg = \"Attempted to convert \\\"\" + value + \"\\\" to a date, but it does not match the PDF date string format.\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return InvalidPDFDateStringError;\n}(Error));\nexport { InvalidPDFDateStringError };\nvar InvalidTargetIndexError = /** @class */ (function (_super) {\n __extends(InvalidTargetIndexError, _super);\n function InvalidTargetIndexError(targetIndex, Count) {\n var _this = this;\n var msg = \"Invalid targetIndex specified: targetIndex=\" + targetIndex + \" must be less than Count=\" + Count;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return InvalidTargetIndexError;\n}(Error));\nexport { InvalidTargetIndexError };\nvar CorruptPageTreeError = /** @class */ (function (_super) {\n __extends(CorruptPageTreeError, _super);\n function CorruptPageTreeError(targetIndex, operation) {\n var _this = this;\n var msg = \"Failed to \" + operation + \" at targetIndex=\" + targetIndex + \" due to corrupt page tree: It is likely that one or more 'Count' entries are invalid\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return CorruptPageTreeError;\n}(Error));\nexport { CorruptPageTreeError };\nvar IndexOutOfBoundsError = /** @class */ (function (_super) {\n __extends(IndexOutOfBoundsError, _super);\n function IndexOutOfBoundsError(index, min, max) {\n var _this = this;\n var msg = \"index should be at least \" + min + \" and at most \" + max + \", but was actually \" + index;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return IndexOutOfBoundsError;\n}(Error));\nexport { IndexOutOfBoundsError };\nvar InvalidAcroFieldValueError = /** @class */ (function (_super) {\n __extends(InvalidAcroFieldValueError, _super);\n function InvalidAcroFieldValueError() {\n var _this = this;\n var msg = \"Attempted to set invalid field value\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return InvalidAcroFieldValueError;\n}(Error));\nexport { InvalidAcroFieldValueError };\nvar MultiSelectValueError = /** @class */ (function (_super) {\n __extends(MultiSelectValueError, _super);\n function MultiSelectValueError() {\n var _this = this;\n var msg = \"Attempted to select multiple values for single-select field\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MultiSelectValueError;\n}(Error));\nexport { MultiSelectValueError };\nvar NumberParsingError = /** @class */ (function (_super) {\n __extends(NumberParsingError, _super);\n function NumberParsingError(pos, value) {\n var _this = this;\n var msg = \"Failed to parse number \" +\n (\"(line:\" + pos.line + \" col:\" + pos.column + \" offset=\" + pos.offset + \"): \\\"\" + value + \"\\\"\");\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return NumberParsingError;\n}(Error));\nexport { NumberParsingError };\nvar PDFParsingError = /** @class */ (function (_super) {\n __extends(PDFParsingError, _super);\n function PDFParsingError(pos, details) {\n var _this = this;\n var msg = \"Failed to parse PDF document \" +\n (\"(line:\" + pos.line + \" col:\" + pos.column + \" offset=\" + pos.offset + \"): \" + details);\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PDFParsingError;\n}(Error));\nexport { PDFParsingError };\nvar NextByteAssertionError = /** @class */ (function (_super) {\n __extends(NextByteAssertionError, _super);\n function NextByteAssertionError(pos, expectedByte, actualByte) {\n var _this = this;\n var msg = \"Expected next byte to be \" + expectedByte + \" but it was actually \" + actualByte;\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return NextByteAssertionError;\n}(PDFParsingError));\nexport { NextByteAssertionError };\nvar PDFObjectParsingError = /** @class */ (function (_super) {\n __extends(PDFObjectParsingError, _super);\n function PDFObjectParsingError(pos, byte) {\n var _this = this;\n var msg = \"Failed to parse PDF object starting with the following byte: \" + byte;\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return PDFObjectParsingError;\n}(PDFParsingError));\nexport { PDFObjectParsingError };\nvar PDFInvalidObjectParsingError = /** @class */ (function (_super) {\n __extends(PDFInvalidObjectParsingError, _super);\n function PDFInvalidObjectParsingError(pos) {\n var _this = this;\n var msg = \"Failed to parse invalid PDF object\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return PDFInvalidObjectParsingError;\n}(PDFParsingError));\nexport { PDFInvalidObjectParsingError };\nvar PDFStreamParsingError = /** @class */ (function (_super) {\n __extends(PDFStreamParsingError, _super);\n function PDFStreamParsingError(pos) {\n var _this = this;\n var msg = \"Failed to parse PDF stream\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return PDFStreamParsingError;\n}(PDFParsingError));\nexport { PDFStreamParsingError };\nvar UnbalancedParenthesisError = /** @class */ (function (_super) {\n __extends(UnbalancedParenthesisError, _super);\n function UnbalancedParenthesisError(pos) {\n var _this = this;\n var msg = \"Failed to parse PDF literal string due to unbalanced parenthesis\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return UnbalancedParenthesisError;\n}(PDFParsingError));\nexport { UnbalancedParenthesisError };\nvar StalledParserError = /** @class */ (function (_super) {\n __extends(StalledParserError, _super);\n function StalledParserError(pos) {\n var _this = this;\n var msg = \"Parser stalled\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return StalledParserError;\n}(PDFParsingError));\nexport { StalledParserError };\nvar MissingPDFHeaderError = /** @class */ (function (_super) {\n __extends(MissingPDFHeaderError, _super);\n function MissingPDFHeaderError(pos) {\n var _this = this;\n var msg = \"No PDF header found\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return MissingPDFHeaderError;\n}(PDFParsingError));\nexport { MissingPDFHeaderError };\nvar MissingKeywordError = /** @class */ (function (_super) {\n __extends(MissingKeywordError, _super);\n function MissingKeywordError(pos, keyword) {\n var _this = this;\n var msg = \"Did not find expected keyword '\" + arrayAsString(keyword) + \"'\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return MissingKeywordError;\n}(PDFParsingError));\nexport { MissingKeywordError };\n//# sourceMappingURL=errors.js.map","'use strict';\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\nvar utils = require('../utils/common');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nvar extra_dbits = /* extra bits for each distance code */\n [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n var dist; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n}\n\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar trees = require('./trees');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\n//var Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\n//var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\n//var Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\n\n\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\n\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n// s.block_start >= s.w_size)) {\n// throw new Error(\"slide too late\");\n// }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0; /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n }\n else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n }\n else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n }\n else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n }\n else {\n s.status = BUSY_STATE;\n }\n }\n//#endif\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n status = strm.state.status;\n if (status !== INIT_STATE &&\n status !== EXTRA_STATE &&\n status !== NAME_STATE &&\n status !== COMMENT_STATE &&\n status !== HCRC_STATE &&\n status !== BUSY_STATE &&\n status !== FINISH_STATE\n ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\n\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","// String encode/decode helpers\n'use strict';\n\n\nvar utils = require('./common');\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new utils.Buf8(256);\nfor (var q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new utils.Buf8(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n\n var result = '';\n for (var i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n return buf2binstring(buf, buf.length);\n};\n\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n var buf = new utils.Buf8(str.length);\n for (var i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n};\n\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n var i, out, c, c_len;\n var len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","'use strict';\n\n\nvar zlib_deflate = require('./zlib/deflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\n\nvar toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nvar Z_NO_FLUSH = 0;\nvar Z_FINISH = 4;\n\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_SYNC_FLUSH = 2;\n\nvar Z_DEFAULT_COMPRESSION = -1;\n\nvar Z_DEFAULT_STRATEGY = 0;\n\nvar Z_DEFLATED = 8;\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n if (!(this instanceof Deflate)) return new Deflate(options);\n\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n var dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var status, _mode;\n\n if (this.ended) { return false; }\n\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_deflate.deflate(strm, _mode); /* no bad return value */\n\n if (status !== Z_STREAM_END && status !== Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n if (this.options.to === 'string') {\n this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n // Finalize on the last chunk.\n if (_mode === Z_FINISH) {\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === Z_SYNC_FLUSH) {\n this.onEnd(Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nexports.Deflate = Deflate;\nexports.deflate = deflate;\nexports.deflateRaw = deflateRaw;\nexports.gzip = gzip;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar inflate_fast = require('./inffast');\nvar inflate_table = require('./inftrees');\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n //Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar c = require('./zlib/constants');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar GZheader = require('./zlib/gzheader');\n\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n if (!(this instanceof Inflate)) return new Inflate(options);\n\n this.options = utils.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var dictionary = this.options.dictionary;\n var status, _mode;\n var next_out_utf8, tail, utf8str;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n var allowBufError = false;\n\n if (this.ended) { return false; }\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);\n }\n\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\n if (this.options.to === 'string') {\n\n next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n tail = strm.next_out - next_out_utf8;\n utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\n this.onData(utf8str);\n\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === c.Z_OK) {\n if (this.options.to === 'string') {\n // Glue & convert here, until we teach pako to send\n // utf8 aligned strings to onData\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n var inflator = new Inflate(options);\n\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip = inflate;\n","// Top level file is just a mixin of submodules & constants\n'use strict';\n\nvar assign = require('./lib/utils/common').assign;\n\nvar deflate = require('./lib/deflate');\nvar inflate = require('./lib/inflate');\nvar constants = require('./lib/zlib/constants');\n\nvar pako = {};\n\nassign(pako, deflate, inflate, constants);\n\nmodule.exports = pako;\n","import CharCodes from \"../syntax/CharCodes\";\nimport { charFromCode, copyStringIntoBuffer } from \"../../utils\";\nvar PDFHeader = /** @class */ (function () {\n function PDFHeader(major, minor) {\n this.major = String(major);\n this.minor = String(minor);\n }\n PDFHeader.prototype.toString = function () {\n var bc = charFromCode(129);\n return \"%PDF-\" + this.major + \".\" + this.minor + \"\\n%\" + bc + bc + bc + bc;\n };\n PDFHeader.prototype.sizeInBytes = function () {\n return 12 + this.major.length + this.minor.length;\n };\n PDFHeader.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = CharCodes.P;\n buffer[offset++] = CharCodes.D;\n buffer[offset++] = CharCodes.F;\n buffer[offset++] = CharCodes.Dash;\n offset += copyStringIntoBuffer(this.major, buffer, offset);\n buffer[offset++] = CharCodes.Period;\n offset += copyStringIntoBuffer(this.minor, buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = 129;\n buffer[offset++] = 129;\n buffer[offset++] = 129;\n buffer[offset++] = 129;\n return offset - initialOffset;\n };\n PDFHeader.forVersion = function (major, minor) {\n return new PDFHeader(major, minor);\n };\n return PDFHeader;\n}());\nexport default PDFHeader;\n//# sourceMappingURL=PDFHeader.js.map","import { MethodNotImplementedError } from \"../errors\";\nvar PDFObject = /** @class */ (function () {\n function PDFObject() {\n }\n PDFObject.prototype.clone = function (_context) {\n throw new MethodNotImplementedError(this.constructor.name, 'clone');\n };\n PDFObject.prototype.toString = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'toString');\n };\n PDFObject.prototype.sizeInBytes = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'sizeInBytes');\n };\n PDFObject.prototype.copyBytesInto = function (_buffer, _offset) {\n throw new MethodNotImplementedError(this.constructor.name, 'copyBytesInto');\n };\n return PDFObject;\n}());\nexport default PDFObject;\n//# sourceMappingURL=PDFObject.js.map","import { __extends } from \"tslib\";\nimport { copyStringIntoBuffer, numberToString } from \"../../utils/index\";\nimport PDFObject from \"./PDFObject\";\nvar PDFNumber = /** @class */ (function (_super) {\n __extends(PDFNumber, _super);\n function PDFNumber(value) {\n var _this = _super.call(this) || this;\n _this.numberValue = value;\n _this.stringValue = numberToString(value);\n return _this;\n }\n PDFNumber.prototype.asNumber = function () {\n return this.numberValue;\n };\n /** @deprecated in favor of [[PDFNumber.asNumber]] */\n PDFNumber.prototype.value = function () {\n return this.numberValue;\n };\n PDFNumber.prototype.clone = function () {\n return PDFNumber.of(this.numberValue);\n };\n PDFNumber.prototype.toString = function () {\n return this.stringValue;\n };\n PDFNumber.prototype.sizeInBytes = function () {\n return this.stringValue.length;\n };\n PDFNumber.prototype.copyBytesInto = function (buffer, offset) {\n offset += copyStringIntoBuffer(this.stringValue, buffer, offset);\n return this.stringValue.length;\n };\n PDFNumber.of = function (value) { return new PDFNumber(value); };\n return PDFNumber;\n}(PDFObject));\nexport default PDFNumber;\n//# sourceMappingURL=PDFNumber.js.map","import { __extends, __spreadArrays } from \"tslib\";\nimport PDFNumber from \"./PDFNumber\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { PDFArrayIsNotRectangleError } from \"../errors\";\nvar PDFArray = /** @class */ (function (_super) {\n __extends(PDFArray, _super);\n function PDFArray(context) {\n var _this = _super.call(this) || this;\n _this.array = [];\n _this.context = context;\n return _this;\n }\n PDFArray.prototype.size = function () {\n return this.array.length;\n };\n PDFArray.prototype.push = function (object) {\n this.array.push(object);\n };\n PDFArray.prototype.insert = function (index, object) {\n this.array.splice(index, 0, object);\n };\n PDFArray.prototype.remove = function (index) {\n this.array.splice(index, 1);\n };\n PDFArray.prototype.set = function (idx, object) {\n this.array[idx] = object;\n };\n PDFArray.prototype.get = function (index) {\n return this.array[index];\n };\n PDFArray.prototype.lookupMaybe = function (index) {\n var _a;\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n return (_a = this.context).lookupMaybe.apply(_a, __spreadArrays([this.get(index)], types));\n };\n PDFArray.prototype.lookup = function (index) {\n var _a;\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n return (_a = this.context).lookup.apply(_a, __spreadArrays([this.get(index)], types));\n };\n PDFArray.prototype.asRectangle = function () {\n if (this.size() !== 4)\n throw new PDFArrayIsNotRectangleError(this.size());\n var lowerLeftX = this.lookup(0, PDFNumber).asNumber();\n var lowerLeftY = this.lookup(1, PDFNumber).asNumber();\n var upperRightX = this.lookup(2, PDFNumber).asNumber();\n var upperRightY = this.lookup(3, PDFNumber).asNumber();\n var x = lowerLeftX;\n var y = lowerLeftY;\n var width = upperRightX - lowerLeftX;\n var height = upperRightY - lowerLeftY;\n return { x: x, y: y, width: width, height: height };\n };\n PDFArray.prototype.asArray = function () {\n return this.array.slice();\n };\n PDFArray.prototype.clone = function (context) {\n var clone = PDFArray.withContext(context || this.context);\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n clone.push(this.array[idx]);\n }\n return clone;\n };\n PDFArray.prototype.toString = function () {\n var arrayString = '[ ';\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n arrayString += this.get(idx).toString();\n arrayString += ' ';\n }\n arrayString += ']';\n return arrayString;\n };\n PDFArray.prototype.sizeInBytes = function () {\n var size = 3;\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n size += this.get(idx).sizeInBytes() + 1;\n }\n return size;\n };\n PDFArray.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.LeftSquareBracket;\n buffer[offset++] = CharCodes.Space;\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n offset += this.get(idx).copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Space;\n }\n buffer[offset++] = CharCodes.RightSquareBracket;\n return offset - initialOffset;\n };\n PDFArray.withContext = function (context) { return new PDFArray(context); };\n return PDFArray;\n}(PDFObject));\nexport default PDFArray;\n//# sourceMappingURL=PDFArray.js.map","import { __extends } from \"tslib\";\nimport { PrivateConstructorError } from \"../errors\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar ENFORCER = {};\nvar PDFBool = /** @class */ (function (_super) {\n __extends(PDFBool, _super);\n function PDFBool(enforcer, value) {\n var _this = this;\n if (enforcer !== ENFORCER)\n throw new PrivateConstructorError('PDFBool');\n _this = _super.call(this) || this;\n _this.value = value;\n return _this;\n }\n PDFBool.prototype.asBoolean = function () {\n return this.value;\n };\n PDFBool.prototype.clone = function () {\n return this;\n };\n PDFBool.prototype.toString = function () {\n return String(this.value);\n };\n PDFBool.prototype.sizeInBytes = function () {\n return this.value ? 4 : 5;\n };\n PDFBool.prototype.copyBytesInto = function (buffer, offset) {\n if (this.value) {\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.u;\n buffer[offset++] = CharCodes.e;\n return 4;\n }\n else {\n buffer[offset++] = CharCodes.f;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.l;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.e;\n return 5;\n }\n };\n PDFBool.True = new PDFBool(ENFORCER, true);\n PDFBool.False = new PDFBool(ENFORCER, false);\n return PDFBool;\n}(PDFObject));\nexport default PDFBool;\n//# sourceMappingURL=PDFBool.js.map","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFNull = /** @class */ (function (_super) {\n __extends(PDFNull, _super);\n function PDFNull() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFNull.prototype.asNull = function () {\n return null;\n };\n PDFNull.prototype.clone = function () {\n return this;\n };\n PDFNull.prototype.toString = function () {\n return 'null';\n };\n PDFNull.prototype.sizeInBytes = function () {\n return 4;\n };\n PDFNull.prototype.copyBytesInto = function (buffer, offset) {\n buffer[offset++] = CharCodes.n;\n buffer[offset++] = CharCodes.u;\n buffer[offset++] = CharCodes.l;\n buffer[offset++] = CharCodes.l;\n return 4;\n };\n return PDFNull;\n}(PDFObject));\nexport default new PDFNull();\n//# sourceMappingURL=PDFNull.js.map","import { __extends, __spreadArrays } from \"tslib\";\nimport PDFNull from \"./PDFNull\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFDict = /** @class */ (function (_super) {\n __extends(PDFDict, _super);\n function PDFDict(map, context) {\n var _this = _super.call(this) || this;\n _this.dict = map;\n _this.context = context;\n return _this;\n }\n PDFDict.prototype.keys = function () {\n return Array.from(this.dict.keys());\n };\n PDFDict.prototype.values = function () {\n return Array.from(this.dict.values());\n };\n PDFDict.prototype.entries = function () {\n return Array.from(this.dict.entries());\n };\n PDFDict.prototype.set = function (key, value) {\n this.dict.set(key, value);\n };\n PDFDict.prototype.get = function (key) {\n return this.dict.get(key);\n };\n PDFDict.prototype.has = function (key) {\n // NOTE: This might be a bit inconsistent with `PDFDict.get()` - should\n // calls to `PDFDict.get()` return `undefined` if the underlying\n // value is `PDFNull`? This would be a breaking change.\n var value = this.dict.get(key);\n return value !== undefined && value !== PDFNull;\n };\n PDFDict.prototype.lookupMaybe = function (key) {\n var _a;\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n return (_a = this.context).lookupMaybe.apply(_a, __spreadArrays([this.get(key)], types));\n };\n PDFDict.prototype.lookup = function (key) {\n var _a;\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n return (_a = this.context).lookup.apply(_a, __spreadArrays([this.get(key)], types));\n };\n PDFDict.prototype.delete = function (key) {\n return this.dict.delete(key);\n };\n PDFDict.prototype.asMap = function () {\n return new Map(this.dict);\n };\n PDFDict.prototype.clone = function (context) {\n var clone = PDFDict.withContext(context || this.context);\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n clone.set(key, value);\n }\n return clone;\n };\n PDFDict.prototype.toString = function () {\n var dictString = '<<\\n';\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n dictString += key.toString() + ' ' + value.toString() + '\\n';\n }\n dictString += '>>';\n return dictString;\n };\n PDFDict.prototype.sizeInBytes = function () {\n var size = 5;\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n size += key.sizeInBytes() + value.sizeInBytes() + 2;\n }\n return size;\n };\n PDFDict.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.LessThan;\n buffer[offset++] = CharCodes.LessThan;\n buffer[offset++] = CharCodes.Newline;\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n offset += key.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Space;\n offset += value.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n buffer[offset++] = CharCodes.GreaterThan;\n buffer[offset++] = CharCodes.GreaterThan;\n return offset - initialOffset;\n };\n PDFDict.withContext = function (context) { return new PDFDict(new Map(), context); };\n PDFDict.fromMapWithContext = function (map, context) {\n return new PDFDict(map, context);\n };\n return PDFDict;\n}(PDFObject));\nexport default PDFDict;\n//# sourceMappingURL=PDFDict.js.map","import CharCodes from \"./CharCodes\";\nexport var IsDelimiter = new Uint8Array(256);\nIsDelimiter[CharCodes.LeftParen] = 1;\nIsDelimiter[CharCodes.RightParen] = 1;\nIsDelimiter[CharCodes.LessThan] = 1;\nIsDelimiter[CharCodes.GreaterThan] = 1;\nIsDelimiter[CharCodes.LeftSquareBracket] = 1;\nIsDelimiter[CharCodes.RightSquareBracket] = 1;\nIsDelimiter[CharCodes.LeftCurly] = 1;\nIsDelimiter[CharCodes.RightCurly] = 1;\nIsDelimiter[CharCodes.ForwardSlash] = 1;\nIsDelimiter[CharCodes.Percent] = 1;\n//# sourceMappingURL=Delimiters.js.map","import CharCodes from \"./CharCodes\";\nexport var IsWhitespace = new Uint8Array(256);\nIsWhitespace[CharCodes.Null] = 1;\nIsWhitespace[CharCodes.Tab] = 1;\nIsWhitespace[CharCodes.Newline] = 1;\nIsWhitespace[CharCodes.FormFeed] = 1;\nIsWhitespace[CharCodes.CarriageReturn] = 1;\nIsWhitespace[CharCodes.Space] = 1;\n//# sourceMappingURL=Whitespace.js.map","import CharCodes from \"./CharCodes\";\nimport { IsDelimiter } from \"./Delimiters\";\nimport { IsWhitespace } from \"./Whitespace\";\nexport var IsIrregular = new Uint8Array(256);\nfor (var idx = 0, len = 256; idx < len; idx++) {\n IsIrregular[idx] = IsWhitespace[idx] || IsDelimiter[idx] ? 1 : 0;\n}\nIsIrregular[CharCodes.Hash] = 1;\n//# sourceMappingURL=Irregular.js.map","import { __extends } from \"tslib\";\nimport { PrivateConstructorError } from \"../errors\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { IsIrregular } from \"../syntax/Irregular\";\nimport { charFromHexCode, copyStringIntoBuffer, toCharCode, toHexString, } from \"../../utils\";\nvar decodeName = function (name) {\n return name.replace(/#([\\dABCDEF]{2})/g, function (_, hex) { return charFromHexCode(hex); });\n};\nvar isRegularChar = function (charCode) {\n return charCode >= CharCodes.ExclamationPoint &&\n charCode <= CharCodes.Tilde &&\n !IsIrregular[charCode];\n};\nvar ENFORCER = {};\nvar pool = new Map();\nvar PDFName = /** @class */ (function (_super) {\n __extends(PDFName, _super);\n function PDFName(enforcer, name) {\n var _this = this;\n if (enforcer !== ENFORCER)\n throw new PrivateConstructorError('PDFName');\n _this = _super.call(this) || this;\n var encodedName = '/';\n for (var idx = 0, len = name.length; idx < len; idx++) {\n var character = name[idx];\n var code = toCharCode(character);\n encodedName += isRegularChar(code) ? character : \"#\" + toHexString(code);\n }\n _this.encodedName = encodedName;\n return _this;\n }\n PDFName.prototype.asBytes = function () {\n var bytes = [];\n var hex = '';\n var escaped = false;\n var pushByte = function (byte) {\n if (byte !== undefined)\n bytes.push(byte);\n escaped = false;\n };\n for (var idx = 1, len = this.encodedName.length; idx < len; idx++) {\n var char = this.encodedName[idx];\n var byte = toCharCode(char);\n var nextChar = this.encodedName[idx + 1];\n if (!escaped) {\n if (byte === CharCodes.Hash)\n escaped = true;\n else\n pushByte(byte);\n }\n else {\n if ((byte >= CharCodes.Zero && byte <= CharCodes.Nine) ||\n (byte >= CharCodes.a && byte <= CharCodes.f) ||\n (byte >= CharCodes.A && byte <= CharCodes.F)) {\n hex += char;\n if (hex.length === 2 ||\n !((nextChar >= '0' && nextChar <= '9') ||\n (nextChar >= 'a' && nextChar <= 'f') ||\n (nextChar >= 'A' && nextChar <= 'F'))) {\n pushByte(parseInt(hex, 16));\n hex = '';\n }\n }\n else {\n pushByte(byte);\n }\n }\n }\n return new Uint8Array(bytes);\n };\n // TODO: This should probably use `utf8Decode()`\n // TODO: Polyfill Array.from?\n PDFName.prototype.decodeText = function () {\n var bytes = this.asBytes();\n return String.fromCharCode.apply(String, Array.from(bytes));\n };\n PDFName.prototype.asString = function () {\n return this.encodedName;\n };\n /** @deprecated in favor of [[PDFName.asString]] */\n PDFName.prototype.value = function () {\n return this.encodedName;\n };\n PDFName.prototype.clone = function () {\n return this;\n };\n PDFName.prototype.toString = function () {\n return this.encodedName;\n };\n PDFName.prototype.sizeInBytes = function () {\n return this.encodedName.length;\n };\n PDFName.prototype.copyBytesInto = function (buffer, offset) {\n offset += copyStringIntoBuffer(this.encodedName, buffer, offset);\n return this.encodedName.length;\n };\n PDFName.of = function (name) {\n var decodedValue = decodeName(name);\n var instance = pool.get(decodedValue);\n if (!instance) {\n instance = new PDFName(ENFORCER, decodedValue);\n pool.set(decodedValue, instance);\n }\n return instance;\n };\n /* tslint:disable member-ordering */\n PDFName.Length = PDFName.of('Length');\n PDFName.FlateDecode = PDFName.of('FlateDecode');\n PDFName.Resources = PDFName.of('Resources');\n PDFName.Font = PDFName.of('Font');\n PDFName.XObject = PDFName.of('XObject');\n PDFName.ExtGState = PDFName.of('ExtGState');\n PDFName.Contents = PDFName.of('Contents');\n PDFName.Type = PDFName.of('Type');\n PDFName.Parent = PDFName.of('Parent');\n PDFName.MediaBox = PDFName.of('MediaBox');\n PDFName.Page = PDFName.of('Page');\n PDFName.Annots = PDFName.of('Annots');\n PDFName.TrimBox = PDFName.of('TrimBox');\n PDFName.ArtBox = PDFName.of('ArtBox');\n PDFName.BleedBox = PDFName.of('BleedBox');\n PDFName.CropBox = PDFName.of('CropBox');\n PDFName.Rotate = PDFName.of('Rotate');\n PDFName.Title = PDFName.of('Title');\n PDFName.Author = PDFName.of('Author');\n PDFName.Subject = PDFName.of('Subject');\n PDFName.Creator = PDFName.of('Creator');\n PDFName.Keywords = PDFName.of('Keywords');\n PDFName.Producer = PDFName.of('Producer');\n PDFName.CreationDate = PDFName.of('CreationDate');\n PDFName.ModDate = PDFName.of('ModDate');\n return PDFName;\n}(PDFObject));\nexport default PDFName;\n//# sourceMappingURL=PDFName.js.map","var PDFOperatorNames;\n(function (PDFOperatorNames) {\n // Non Stroking Color Operators\n PDFOperatorNames[\"NonStrokingColor\"] = \"sc\";\n PDFOperatorNames[\"NonStrokingColorN\"] = \"scn\";\n PDFOperatorNames[\"NonStrokingColorRgb\"] = \"rg\";\n PDFOperatorNames[\"NonStrokingColorGray\"] = \"g\";\n PDFOperatorNames[\"NonStrokingColorCmyk\"] = \"k\";\n PDFOperatorNames[\"NonStrokingColorspace\"] = \"cs\";\n // Stroking Color Operators\n PDFOperatorNames[\"StrokingColor\"] = \"SC\";\n PDFOperatorNames[\"StrokingColorN\"] = \"SCN\";\n PDFOperatorNames[\"StrokingColorRgb\"] = \"RG\";\n PDFOperatorNames[\"StrokingColorGray\"] = \"G\";\n PDFOperatorNames[\"StrokingColorCmyk\"] = \"K\";\n PDFOperatorNames[\"StrokingColorspace\"] = \"CS\";\n // Marked Content Operators\n PDFOperatorNames[\"BeginMarkedContentSequence\"] = \"BDC\";\n PDFOperatorNames[\"BeginMarkedContent\"] = \"BMC\";\n PDFOperatorNames[\"EndMarkedContent\"] = \"EMC\";\n PDFOperatorNames[\"MarkedContentPointWithProps\"] = \"DP\";\n PDFOperatorNames[\"MarkedContentPoint\"] = \"MP\";\n PDFOperatorNames[\"DrawObject\"] = \"Do\";\n // Graphics State Operators\n PDFOperatorNames[\"ConcatTransformationMatrix\"] = \"cm\";\n PDFOperatorNames[\"PopGraphicsState\"] = \"Q\";\n PDFOperatorNames[\"PushGraphicsState\"] = \"q\";\n PDFOperatorNames[\"SetFlatness\"] = \"i\";\n PDFOperatorNames[\"SetGraphicsStateParams\"] = \"gs\";\n PDFOperatorNames[\"SetLineCapStyle\"] = \"J\";\n PDFOperatorNames[\"SetLineDashPattern\"] = \"d\";\n PDFOperatorNames[\"SetLineJoinStyle\"] = \"j\";\n PDFOperatorNames[\"SetLineMiterLimit\"] = \"M\";\n PDFOperatorNames[\"SetLineWidth\"] = \"w\";\n PDFOperatorNames[\"SetTextMatrix\"] = \"Tm\";\n PDFOperatorNames[\"SetRenderingIntent\"] = \"ri\";\n // Graphics Operators\n PDFOperatorNames[\"AppendRectangle\"] = \"re\";\n PDFOperatorNames[\"BeginInlineImage\"] = \"BI\";\n PDFOperatorNames[\"BeginInlineImageData\"] = \"ID\";\n PDFOperatorNames[\"EndInlineImage\"] = \"EI\";\n PDFOperatorNames[\"ClipEvenOdd\"] = \"W*\";\n PDFOperatorNames[\"ClipNonZero\"] = \"W\";\n PDFOperatorNames[\"CloseAndStroke\"] = \"s\";\n PDFOperatorNames[\"CloseFillEvenOddAndStroke\"] = \"b*\";\n PDFOperatorNames[\"CloseFillNonZeroAndStroke\"] = \"b\";\n PDFOperatorNames[\"ClosePath\"] = \"h\";\n PDFOperatorNames[\"AppendBezierCurve\"] = \"c\";\n PDFOperatorNames[\"CurveToReplicateFinalPoint\"] = \"y\";\n PDFOperatorNames[\"CurveToReplicateInitialPoint\"] = \"v\";\n PDFOperatorNames[\"EndPath\"] = \"n\";\n PDFOperatorNames[\"FillEvenOddAndStroke\"] = \"B*\";\n PDFOperatorNames[\"FillEvenOdd\"] = \"f*\";\n PDFOperatorNames[\"FillNonZeroAndStroke\"] = \"B\";\n PDFOperatorNames[\"FillNonZero\"] = \"f\";\n PDFOperatorNames[\"LegacyFillNonZero\"] = \"F\";\n PDFOperatorNames[\"LineTo\"] = \"l\";\n PDFOperatorNames[\"MoveTo\"] = \"m\";\n PDFOperatorNames[\"ShadingFill\"] = \"sh\";\n PDFOperatorNames[\"StrokePath\"] = \"S\";\n // Text Operators\n PDFOperatorNames[\"BeginText\"] = \"BT\";\n PDFOperatorNames[\"EndText\"] = \"ET\";\n PDFOperatorNames[\"MoveText\"] = \"Td\";\n PDFOperatorNames[\"MoveTextSetLeading\"] = \"TD\";\n PDFOperatorNames[\"NextLine\"] = \"T*\";\n PDFOperatorNames[\"SetCharacterSpacing\"] = \"Tc\";\n PDFOperatorNames[\"SetFontAndSize\"] = \"Tf\";\n PDFOperatorNames[\"SetTextHorizontalScaling\"] = \"Tz\";\n PDFOperatorNames[\"SetTextLineHeight\"] = \"TL\";\n PDFOperatorNames[\"SetTextRenderingMode\"] = \"Tr\";\n PDFOperatorNames[\"SetTextRise\"] = \"Ts\";\n PDFOperatorNames[\"SetWordSpacing\"] = \"Tw\";\n PDFOperatorNames[\"ShowText\"] = \"Tj\";\n PDFOperatorNames[\"ShowTextAdjusted\"] = \"TJ\";\n PDFOperatorNames[\"ShowTextLine\"] = \"'\";\n PDFOperatorNames[\"ShowTextLineAndSpace\"] = \"\\\"\";\n // Type3 Font Operators\n PDFOperatorNames[\"Type3D0\"] = \"d0\";\n PDFOperatorNames[\"Type3D1\"] = \"d1\";\n // Compatibility Section Operators\n PDFOperatorNames[\"BeginCompatibilitySection\"] = \"BX\";\n PDFOperatorNames[\"EndCompatibilitySection\"] = \"EX\";\n})(PDFOperatorNames || (PDFOperatorNames = {}));\nexport default PDFOperatorNames;\n//# sourceMappingURL=PDFOperatorNames.js.map","import { __extends } from \"tslib\";\nimport { MethodNotImplementedError } from \"../errors\";\nimport PDFName from \"./PDFName\";\nimport PDFNumber from \"./PDFNumber\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFStream = /** @class */ (function (_super) {\n __extends(PDFStream, _super);\n function PDFStream(dict) {\n var _this = _super.call(this) || this;\n _this.dict = dict;\n return _this;\n }\n PDFStream.prototype.clone = function (_context) {\n throw new MethodNotImplementedError(this.constructor.name, 'clone');\n };\n PDFStream.prototype.getContentsString = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getContentsString');\n };\n PDFStream.prototype.getContents = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getContents');\n };\n PDFStream.prototype.getContentsSize = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getContentsSize');\n };\n PDFStream.prototype.updateDict = function () {\n var contentsSize = this.getContentsSize();\n this.dict.set(PDFName.Length, PDFNumber.of(contentsSize));\n };\n PDFStream.prototype.sizeInBytes = function () {\n this.updateDict();\n return this.dict.sizeInBytes() + this.getContentsSize() + 18;\n };\n PDFStream.prototype.toString = function () {\n this.updateDict();\n var streamString = this.dict.toString();\n streamString += '\\nstream\\n';\n streamString += this.getContentsString();\n streamString += '\\nendstream';\n return streamString;\n };\n PDFStream.prototype.copyBytesInto = function (buffer, offset) {\n this.updateDict();\n var initialOffset = offset;\n offset += this.dict.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.m;\n buffer[offset++] = CharCodes.Newline;\n var contents = this.getContents();\n for (var idx = 0, len = contents.length; idx < len; idx++) {\n buffer[offset++] = contents[idx];\n }\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.n;\n buffer[offset++] = CharCodes.d;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.m;\n return offset - initialOffset;\n };\n return PDFStream;\n}(PDFObject));\nexport default PDFStream;\n//# sourceMappingURL=PDFStream.js.map","import { __extends } from \"tslib\";\nimport PDFStream from \"./PDFStream\";\nimport { arrayAsString } from \"../../utils\";\nvar PDFRawStream = /** @class */ (function (_super) {\n __extends(PDFRawStream, _super);\n function PDFRawStream(dict, contents) {\n var _this = _super.call(this, dict) || this;\n _this.contents = contents;\n return _this;\n }\n PDFRawStream.prototype.asUint8Array = function () {\n return this.contents.slice();\n };\n PDFRawStream.prototype.clone = function (context) {\n return PDFRawStream.of(this.dict.clone(context), this.contents.slice());\n };\n PDFRawStream.prototype.getContentsString = function () {\n return arrayAsString(this.contents);\n };\n PDFRawStream.prototype.getContents = function () {\n return this.contents;\n };\n PDFRawStream.prototype.getContentsSize = function () {\n return this.contents.length;\n };\n PDFRawStream.of = function (dict, contents) {\n return new PDFRawStream(dict, contents);\n };\n return PDFRawStream;\n}(PDFStream));\nexport default PDFRawStream;\n//# sourceMappingURL=PDFRawStream.js.map","import { __extends } from \"tslib\";\nimport { PrivateConstructorError } from \"../errors\";\nimport PDFObject from \"./PDFObject\";\nimport { copyStringIntoBuffer } from \"../../utils\";\nvar ENFORCER = {};\nvar pool = new Map();\nvar PDFRef = /** @class */ (function (_super) {\n __extends(PDFRef, _super);\n function PDFRef(enforcer, objectNumber, generationNumber) {\n var _this = this;\n if (enforcer !== ENFORCER)\n throw new PrivateConstructorError('PDFRef');\n _this = _super.call(this) || this;\n _this.objectNumber = objectNumber;\n _this.generationNumber = generationNumber;\n _this.tag = objectNumber + \" \" + generationNumber + \" R\";\n return _this;\n }\n PDFRef.prototype.clone = function () {\n return this;\n };\n PDFRef.prototype.toString = function () {\n return this.tag;\n };\n PDFRef.prototype.sizeInBytes = function () {\n return this.tag.length;\n };\n PDFRef.prototype.copyBytesInto = function (buffer, offset) {\n offset += copyStringIntoBuffer(this.tag, buffer, offset);\n return this.tag.length;\n };\n PDFRef.of = function (objectNumber, generationNumber) {\n if (generationNumber === void 0) { generationNumber = 0; }\n var tag = objectNumber + \" \" + generationNumber + \" R\";\n var instance = pool.get(tag);\n if (!instance) {\n instance = new PDFRef(ENFORCER, objectNumber, generationNumber);\n pool.set(tag, instance);\n }\n return instance;\n };\n return PDFRef;\n}(PDFObject));\nexport default PDFRef;\n//# sourceMappingURL=PDFRef.js.map","import PDFObject from \"../objects/PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer } from \"../../utils\";\nvar PDFOperator = /** @class */ (function () {\n function PDFOperator(name, args) {\n this.name = name;\n this.args = args || [];\n }\n PDFOperator.prototype.clone = function (context) {\n var args = new Array(this.args.length);\n for (var idx = 0, len = args.length; idx < len; idx++) {\n var arg = this.args[idx];\n args[idx] = arg instanceof PDFObject ? arg.clone(context) : arg;\n }\n return PDFOperator.of(this.name, args);\n };\n PDFOperator.prototype.toString = function () {\n var value = '';\n for (var idx = 0, len = this.args.length; idx < len; idx++) {\n value += String(this.args[idx]) + ' ';\n }\n value += this.name;\n return value;\n };\n PDFOperator.prototype.sizeInBytes = function () {\n var size = 0;\n for (var idx = 0, len = this.args.length; idx < len; idx++) {\n var arg = this.args[idx];\n size += (arg instanceof PDFObject ? arg.sizeInBytes() : arg.length) + 1;\n }\n size += this.name.length;\n return size;\n };\n PDFOperator.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n for (var idx = 0, len = this.args.length; idx < len; idx++) {\n var arg = this.args[idx];\n if (arg instanceof PDFObject) {\n offset += arg.copyBytesInto(buffer, offset);\n }\n else {\n offset += copyStringIntoBuffer(arg, buffer, offset);\n }\n buffer[offset++] = CharCodes.Space;\n }\n offset += copyStringIntoBuffer(this.name, buffer, offset);\n return offset - initialOffset;\n };\n PDFOperator.of = function (name, args) {\n return new PDFOperator(name, args);\n };\n return PDFOperator;\n}());\nexport default PDFOperator;\n//# sourceMappingURL=PDFOperator.js.map","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFFlateStream from \"./PDFFlateStream\";\nimport { bytesFor, Cache, reverseArray, sizeInBytes, sum } from \"../../utils\";\nexport var EntryType;\n(function (EntryType) {\n EntryType[EntryType[\"Deleted\"] = 0] = \"Deleted\";\n EntryType[EntryType[\"Uncompressed\"] = 1] = \"Uncompressed\";\n EntryType[EntryType[\"Compressed\"] = 2] = \"Compressed\";\n})(EntryType || (EntryType = {}));\n/**\n * Entries should be added using the [[addDeletedEntry]],\n * [[addUncompressedEntry]], and [[addCompressedEntry]] methods\n * **in order of ascending object number**.\n */\nvar PDFCrossRefStream = /** @class */ (function (_super) {\n __extends(PDFCrossRefStream, _super);\n function PDFCrossRefStream(dict, entries, encode) {\n if (encode === void 0) { encode = true; }\n var _this = _super.call(this, dict, encode) || this;\n // Returns an array of integer pairs for each subsection of the cross ref\n // section, where each integer pair represents:\n // firstObjectNumber(OfSection), length(OfSection)\n _this.computeIndex = function () {\n var subsections = [];\n var subsectionLength = 0;\n for (var idx = 0, len = _this.entries.length; idx < len; idx++) {\n var currEntry = _this.entries[idx];\n var prevEntry = _this.entries[idx - 1];\n if (idx === 0) {\n subsections.push(currEntry.ref.objectNumber);\n }\n else if (currEntry.ref.objectNumber - prevEntry.ref.objectNumber > 1) {\n subsections.push(subsectionLength);\n subsections.push(currEntry.ref.objectNumber);\n subsectionLength = 0;\n }\n subsectionLength += 1;\n }\n subsections.push(subsectionLength);\n return subsections;\n };\n _this.computeEntryTuples = function () {\n var entryTuples = new Array(_this.entries.length);\n for (var idx = 0, len = _this.entries.length; idx < len; idx++) {\n var entry = _this.entries[idx];\n if (entry.type === EntryType.Deleted) {\n var type = entry.type, nextFreeObjectNumber = entry.nextFreeObjectNumber, ref = entry.ref;\n entryTuples[idx] = [type, nextFreeObjectNumber, ref.generationNumber];\n }\n if (entry.type === EntryType.Uncompressed) {\n var type = entry.type, offset = entry.offset, ref = entry.ref;\n entryTuples[idx] = [type, offset, ref.generationNumber];\n }\n if (entry.type === EntryType.Compressed) {\n var type = entry.type, objectStreamRef = entry.objectStreamRef, index = entry.index;\n entryTuples[idx] = [type, objectStreamRef.objectNumber, index];\n }\n }\n return entryTuples;\n };\n _this.computeMaxEntryByteWidths = function () {\n var entryTuples = _this.entryTuplesCache.access();\n var widths = [0, 0, 0];\n for (var idx = 0, len = entryTuples.length; idx < len; idx++) {\n var _a = entryTuples[idx], first = _a[0], second = _a[1], third = _a[2];\n var firstSize = sizeInBytes(first);\n var secondSize = sizeInBytes(second);\n var thirdSize = sizeInBytes(third);\n if (firstSize > widths[0])\n widths[0] = firstSize;\n if (secondSize > widths[1])\n widths[1] = secondSize;\n if (thirdSize > widths[2])\n widths[2] = thirdSize;\n }\n return widths;\n };\n _this.entries = entries || [];\n _this.entryTuplesCache = Cache.populatedBy(_this.computeEntryTuples);\n _this.maxByteWidthsCache = Cache.populatedBy(_this.computeMaxEntryByteWidths);\n _this.indexCache = Cache.populatedBy(_this.computeIndex);\n dict.set(PDFName.of('Type'), PDFName.of('XRef'));\n return _this;\n }\n PDFCrossRefStream.prototype.addDeletedEntry = function (ref, nextFreeObjectNumber) {\n var type = EntryType.Deleted;\n this.entries.push({ type: type, ref: ref, nextFreeObjectNumber: nextFreeObjectNumber });\n this.entryTuplesCache.invalidate();\n this.maxByteWidthsCache.invalidate();\n this.indexCache.invalidate();\n this.contentsCache.invalidate();\n };\n PDFCrossRefStream.prototype.addUncompressedEntry = function (ref, offset) {\n var type = EntryType.Uncompressed;\n this.entries.push({ type: type, ref: ref, offset: offset });\n this.entryTuplesCache.invalidate();\n this.maxByteWidthsCache.invalidate();\n this.indexCache.invalidate();\n this.contentsCache.invalidate();\n };\n PDFCrossRefStream.prototype.addCompressedEntry = function (ref, objectStreamRef, index) {\n var type = EntryType.Compressed;\n this.entries.push({ type: type, ref: ref, objectStreamRef: objectStreamRef, index: index });\n this.entryTuplesCache.invalidate();\n this.maxByteWidthsCache.invalidate();\n this.indexCache.invalidate();\n this.contentsCache.invalidate();\n };\n PDFCrossRefStream.prototype.clone = function (context) {\n var _a = this, dict = _a.dict, entries = _a.entries, encode = _a.encode;\n return PDFCrossRefStream.of(dict.clone(context), entries.slice(), encode);\n };\n PDFCrossRefStream.prototype.getContentsString = function () {\n var entryTuples = this.entryTuplesCache.access();\n var byteWidths = this.maxByteWidthsCache.access();\n var value = '';\n for (var entryIdx = 0, entriesLen = entryTuples.length; entryIdx < entriesLen; entryIdx++) {\n var _a = entryTuples[entryIdx], first = _a[0], second = _a[1], third = _a[2];\n var firstBytes = reverseArray(bytesFor(first));\n var secondBytes = reverseArray(bytesFor(second));\n var thirdBytes = reverseArray(bytesFor(third));\n for (var idx = byteWidths[0] - 1; idx >= 0; idx--) {\n value += (firstBytes[idx] || 0).toString(2);\n }\n for (var idx = byteWidths[1] - 1; idx >= 0; idx--) {\n value += (secondBytes[idx] || 0).toString(2);\n }\n for (var idx = byteWidths[2] - 1; idx >= 0; idx--) {\n value += (thirdBytes[idx] || 0).toString(2);\n }\n }\n return value;\n };\n PDFCrossRefStream.prototype.getUnencodedContents = function () {\n var entryTuples = this.entryTuplesCache.access();\n var byteWidths = this.maxByteWidthsCache.access();\n var buffer = new Uint8Array(this.getUnencodedContentsSize());\n var offset = 0;\n for (var entryIdx = 0, entriesLen = entryTuples.length; entryIdx < entriesLen; entryIdx++) {\n var _a = entryTuples[entryIdx], first = _a[0], second = _a[1], third = _a[2];\n var firstBytes = reverseArray(bytesFor(first));\n var secondBytes = reverseArray(bytesFor(second));\n var thirdBytes = reverseArray(bytesFor(third));\n for (var idx = byteWidths[0] - 1; idx >= 0; idx--) {\n buffer[offset++] = firstBytes[idx] || 0;\n }\n for (var idx = byteWidths[1] - 1; idx >= 0; idx--) {\n buffer[offset++] = secondBytes[idx] || 0;\n }\n for (var idx = byteWidths[2] - 1; idx >= 0; idx--) {\n buffer[offset++] = thirdBytes[idx] || 0;\n }\n }\n return buffer;\n };\n PDFCrossRefStream.prototype.getUnencodedContentsSize = function () {\n var byteWidths = this.maxByteWidthsCache.access();\n var entryWidth = sum(byteWidths);\n return entryWidth * this.entries.length;\n };\n PDFCrossRefStream.prototype.updateDict = function () {\n _super.prototype.updateDict.call(this);\n var byteWidths = this.maxByteWidthsCache.access();\n var index = this.indexCache.access();\n var context = this.dict.context;\n this.dict.set(PDFName.of('W'), context.obj(byteWidths));\n this.dict.set(PDFName.of('Index'), context.obj(index));\n };\n PDFCrossRefStream.create = function (dict, encode) {\n if (encode === void 0) { encode = true; }\n var stream = new PDFCrossRefStream(dict, [], encode);\n stream.addDeletedEntry(PDFRef.of(0, 65535), 0);\n return stream;\n };\n PDFCrossRefStream.of = function (dict, entries, encode) {\n if (encode === void 0) { encode = true; }\n return new PDFCrossRefStream(dict, entries, encode);\n };\n return PDFCrossRefStream;\n}(PDFFlateStream));\nexport default PDFCrossRefStream;\n//# sourceMappingURL=PDFCrossRefStream.js.map","import { __extends } from \"tslib\";\nimport pako from 'pako';\nimport { MethodNotImplementedError } from \"../errors\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFStream from \"../objects/PDFStream\";\nimport { Cache } from \"../../utils\";\nvar PDFFlateStream = /** @class */ (function (_super) {\n __extends(PDFFlateStream, _super);\n function PDFFlateStream(dict, encode) {\n var _this = _super.call(this, dict) || this;\n _this.computeContents = function () {\n var unencodedContents = _this.getUnencodedContents();\n return _this.encode ? pako.deflate(unencodedContents) : unencodedContents;\n };\n _this.encode = encode;\n if (encode)\n dict.set(PDFName.of('Filter'), PDFName.of('FlateDecode'));\n _this.contentsCache = Cache.populatedBy(_this.computeContents);\n return _this;\n }\n PDFFlateStream.prototype.getContents = function () {\n return this.contentsCache.access();\n };\n PDFFlateStream.prototype.getContentsSize = function () {\n return this.contentsCache.access().length;\n };\n PDFFlateStream.prototype.getUnencodedContents = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getUnencodedContents');\n };\n return PDFFlateStream;\n}(PDFStream));\nexport default PDFFlateStream;\n//# sourceMappingURL=PDFFlateStream.js.map","import { __extends } from \"tslib\";\nimport PDFFlateStream from \"./PDFFlateStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFContentStream = /** @class */ (function (_super) {\n __extends(PDFContentStream, _super);\n function PDFContentStream(dict, operators, encode) {\n if (encode === void 0) { encode = true; }\n var _this = _super.call(this, dict, encode) || this;\n _this.operators = operators;\n return _this;\n }\n PDFContentStream.prototype.push = function () {\n var _a;\n var operators = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operators[_i] = arguments[_i];\n }\n (_a = this.operators).push.apply(_a, operators);\n };\n PDFContentStream.prototype.clone = function (context) {\n var operators = new Array(this.operators.length);\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n operators[idx] = this.operators[idx].clone(context);\n }\n var _a = this, dict = _a.dict, encode = _a.encode;\n return PDFContentStream.of(dict.clone(context), operators, encode);\n };\n PDFContentStream.prototype.getContentsString = function () {\n var value = '';\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n value += this.operators[idx] + \"\\n\";\n }\n return value;\n };\n PDFContentStream.prototype.getUnencodedContents = function () {\n var buffer = new Uint8Array(this.getUnencodedContentsSize());\n var offset = 0;\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n offset += this.operators[idx].copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n return buffer;\n };\n PDFContentStream.prototype.getUnencodedContentsSize = function () {\n var size = 0;\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n size += this.operators[idx].sizeInBytes() + 1;\n }\n return size;\n };\n PDFContentStream.of = function (dict, operators, encode) {\n if (encode === void 0) { encode = true; }\n return new PDFContentStream(dict, operators, encode);\n };\n return PDFContentStream;\n}(PDFFlateStream));\nexport default PDFContentStream;\n//# sourceMappingURL=PDFContentStream.js.map","import { __assign } from \"tslib\";\nimport pako from 'pako';\nimport PDFHeader from \"./document/PDFHeader\";\nimport { UnexpectedObjectTypeError } from \"./errors\";\nimport PDFArray from \"./objects/PDFArray\";\nimport PDFBool from \"./objects/PDFBool\";\nimport PDFDict from \"./objects/PDFDict\";\nimport PDFName from \"./objects/PDFName\";\nimport PDFNull from \"./objects/PDFNull\";\nimport PDFNumber from \"./objects/PDFNumber\";\nimport PDFObject from \"./objects/PDFObject\";\nimport PDFRawStream from \"./objects/PDFRawStream\";\nimport PDFRef from \"./objects/PDFRef\";\nimport PDFOperator from \"./operators/PDFOperator\";\nimport Ops from \"./operators/PDFOperatorNames\";\nimport PDFContentStream from \"./structures/PDFContentStream\";\nimport { typedArrayFor } from \"../utils\";\nvar byAscendingObjectNumber = function (_a, _b) {\n var a = _a[0];\n var b = _b[0];\n return a.objectNumber - b.objectNumber;\n};\nvar PDFContext = /** @class */ (function () {\n function PDFContext() {\n this.largestObjectNumber = 0;\n this.header = PDFHeader.forVersion(1, 7);\n this.trailerInfo = {};\n this.indirectObjects = new Map();\n }\n PDFContext.prototype.assign = function (ref, object) {\n this.indirectObjects.set(ref, object);\n if (ref.objectNumber > this.largestObjectNumber) {\n this.largestObjectNumber = ref.objectNumber;\n }\n };\n PDFContext.prototype.nextRef = function () {\n this.largestObjectNumber += 1;\n return PDFRef.of(this.largestObjectNumber);\n };\n PDFContext.prototype.register = function (object) {\n var ref = this.nextRef();\n this.assign(ref, object);\n return ref;\n };\n PDFContext.prototype.delete = function (ref) {\n return this.indirectObjects.delete(ref);\n };\n PDFContext.prototype.lookupMaybe = function (ref) {\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n var result = ref instanceof PDFRef ? this.indirectObjects.get(ref) : ref;\n if (!result)\n return undefined;\n for (var idx = 0, len = types.length; idx < len; idx++) {\n var type = types[idx];\n if (result instanceof type)\n return result;\n }\n throw new UnexpectedObjectTypeError(types, result);\n };\n PDFContext.prototype.lookup = function (ref) {\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n var result = ref instanceof PDFRef ? this.indirectObjects.get(ref) : ref;\n if (types.length === 0)\n return result;\n for (var idx = 0, len = types.length; idx < len; idx++) {\n var type = types[idx];\n if (result instanceof type)\n return result;\n }\n throw new UnexpectedObjectTypeError(types, result);\n };\n PDFContext.prototype.enumerateIndirectObjects = function () {\n return Array.from(this.indirectObjects.entries()).sort(byAscendingObjectNumber);\n };\n PDFContext.prototype.obj = function (literal) {\n if (literal instanceof PDFObject) {\n return literal;\n }\n else if (literal === null || literal === undefined) {\n return PDFNull;\n }\n else if (typeof literal === 'string') {\n return PDFName.of(literal);\n }\n else if (typeof literal === 'number') {\n return PDFNumber.of(literal);\n }\n else if (typeof literal === 'boolean') {\n return literal ? PDFBool.True : PDFBool.False;\n }\n else if (Array.isArray(literal)) {\n var array = PDFArray.withContext(this);\n for (var idx = 0, len = literal.length; idx < len; idx++) {\n array.push(this.obj(literal[idx]));\n }\n return array;\n }\n else {\n var dict = PDFDict.withContext(this);\n var keys = Object.keys(literal);\n for (var idx = 0, len = keys.length; idx < len; idx++) {\n var key = keys[idx];\n var value = literal[key];\n if (value !== undefined)\n dict.set(PDFName.of(key), this.obj(value));\n }\n return dict;\n }\n };\n PDFContext.prototype.stream = function (contents, dict) {\n if (dict === void 0) { dict = {}; }\n return PDFRawStream.of(this.obj(dict), typedArrayFor(contents));\n };\n PDFContext.prototype.flateStream = function (contents, dict) {\n if (dict === void 0) { dict = {}; }\n return this.stream(pako.deflate(typedArrayFor(contents)), __assign(__assign({}, dict), { Filter: 'FlateDecode' }));\n };\n PDFContext.prototype.contentStream = function (operators, dict) {\n if (dict === void 0) { dict = {}; }\n return PDFContentStream.of(this.obj(dict), operators);\n };\n PDFContext.prototype.formXObject = function (operators, dict) {\n if (dict === void 0) { dict = {}; }\n return this.contentStream(operators, __assign(__assign({ BBox: this.obj([0, 0, 0, 0]), Matrix: this.obj([1, 0, 0, 1, 0, 0]) }, dict), { Type: 'XObject', Subtype: 'Form' }));\n };\n /*\n * Reference to PDFContentStream that contains a single PDFOperator: `q`.\n * Used by [[PDFPageLeaf]] instances to ensure that when content streams are\n * added to a modified PDF, they start in the default, unchanged graphics\n * state.\n */\n PDFContext.prototype.getPushGraphicsStateContentStream = function () {\n if (this.pushGraphicsStateContentStreamRef) {\n return this.pushGraphicsStateContentStreamRef;\n }\n var dict = this.obj({});\n var op = PDFOperator.of(Ops.PushGraphicsState);\n var stream = PDFContentStream.of(dict, [op]);\n this.pushGraphicsStateContentStreamRef = this.register(stream);\n return this.pushGraphicsStateContentStreamRef;\n };\n /*\n * Reference to PDFContentStream that contains a single PDFOperator: `Q`.\n * Used by [[PDFPageLeaf]] instances to ensure that when content streams are\n * added to a modified PDF, they start in the default, unchanged graphics\n * state.\n */\n PDFContext.prototype.getPopGraphicsStateContentStream = function () {\n if (this.popGraphicsStateContentStreamRef) {\n return this.popGraphicsStateContentStreamRef;\n }\n var dict = this.obj({});\n var op = PDFOperator.of(Ops.PopGraphicsState);\n var stream = PDFContentStream.of(dict, [op]);\n this.popGraphicsStateContentStreamRef = this.register(stream);\n return this.popGraphicsStateContentStreamRef;\n };\n PDFContext.create = function () { return new PDFContext(); };\n return PDFContext;\n}());\nexport default PDFContext;\n//# sourceMappingURL=PDFContext.js.map","import { __extends } from \"tslib\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFStream from \"../objects/PDFStream\";\nvar PDFPageLeaf = /** @class */ (function (_super) {\n __extends(PDFPageLeaf, _super);\n function PDFPageLeaf(map, context, autoNormalizeCTM) {\n if (autoNormalizeCTM === void 0) { autoNormalizeCTM = true; }\n var _this = _super.call(this, map, context) || this;\n _this.normalized = false;\n _this.autoNormalizeCTM = autoNormalizeCTM;\n return _this;\n }\n PDFPageLeaf.prototype.clone = function (context) {\n var clone = PDFPageLeaf.fromMapWithContext(new Map(), context || this.context, this.autoNormalizeCTM);\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n clone.set(key, value);\n }\n return clone;\n };\n PDFPageLeaf.prototype.Parent = function () {\n return this.lookupMaybe(PDFName.Parent, PDFDict);\n };\n PDFPageLeaf.prototype.Contents = function () {\n return this.lookup(PDFName.of('Contents'));\n };\n PDFPageLeaf.prototype.Annots = function () {\n return this.lookupMaybe(PDFName.Annots, PDFArray);\n };\n PDFPageLeaf.prototype.BleedBox = function () {\n return this.lookupMaybe(PDFName.BleedBox, PDFArray);\n };\n PDFPageLeaf.prototype.TrimBox = function () {\n return this.lookupMaybe(PDFName.TrimBox, PDFArray);\n };\n PDFPageLeaf.prototype.ArtBox = function () {\n return this.lookupMaybe(PDFName.ArtBox, PDFArray);\n };\n PDFPageLeaf.prototype.Resources = function () {\n var dictOrRef = this.getInheritableAttribute(PDFName.Resources);\n return this.context.lookupMaybe(dictOrRef, PDFDict);\n };\n PDFPageLeaf.prototype.MediaBox = function () {\n var arrayOrRef = this.getInheritableAttribute(PDFName.MediaBox);\n return this.context.lookup(arrayOrRef, PDFArray);\n };\n PDFPageLeaf.prototype.CropBox = function () {\n var arrayOrRef = this.getInheritableAttribute(PDFName.CropBox);\n return this.context.lookupMaybe(arrayOrRef, PDFArray);\n };\n PDFPageLeaf.prototype.Rotate = function () {\n var numberOrRef = this.getInheritableAttribute(PDFName.Rotate);\n return this.context.lookupMaybe(numberOrRef, PDFNumber);\n };\n PDFPageLeaf.prototype.getInheritableAttribute = function (name) {\n var attribute;\n this.ascend(function (node) {\n if (!attribute)\n attribute = node.get(name);\n });\n return attribute;\n };\n PDFPageLeaf.prototype.setParent = function (parentRef) {\n this.set(PDFName.Parent, parentRef);\n };\n PDFPageLeaf.prototype.addContentStream = function (contentStreamRef) {\n var Contents = this.normalizedEntries().Contents || this.context.obj([]);\n this.set(PDFName.Contents, Contents);\n Contents.push(contentStreamRef);\n };\n PDFPageLeaf.prototype.wrapContentStreams = function (startStream, endStream) {\n var Contents = this.Contents();\n if (Contents instanceof PDFArray) {\n Contents.insert(0, startStream);\n Contents.push(endStream);\n return true;\n }\n return false;\n };\n PDFPageLeaf.prototype.addAnnot = function (annotRef) {\n var Annots = this.normalizedEntries().Annots;\n Annots.push(annotRef);\n };\n PDFPageLeaf.prototype.setFontDictionary = function (name, fontDictRef) {\n var Font = this.normalizedEntries().Font;\n Font.set(name, fontDictRef);\n };\n PDFPageLeaf.prototype.setXObject = function (name, xObjectRef) {\n var XObject = this.normalizedEntries().XObject;\n XObject.set(name, xObjectRef);\n };\n PDFPageLeaf.prototype.setExtGState = function (name, extGStateRef) {\n var ExtGState = this.normalizedEntries().ExtGState;\n ExtGState.set(name, extGStateRef);\n };\n PDFPageLeaf.prototype.ascend = function (visitor) {\n visitor(this);\n var Parent = this.Parent();\n if (Parent)\n Parent.ascend(visitor);\n };\n PDFPageLeaf.prototype.normalize = function () {\n if (this.normalized)\n return;\n var context = this.context;\n var contentsRef = this.get(PDFName.Contents);\n var contents = this.context.lookup(contentsRef);\n if (contents instanceof PDFStream) {\n this.set(PDFName.Contents, context.obj([contentsRef]));\n }\n if (this.autoNormalizeCTM) {\n this.wrapContentStreams(this.context.getPushGraphicsStateContentStream(), this.context.getPopGraphicsStateContentStream());\n }\n // TODO: Clone `Resources` if it is inherited\n var dictOrRef = this.getInheritableAttribute(PDFName.Resources);\n var Resources = context.lookupMaybe(dictOrRef, PDFDict) || context.obj({});\n this.set(PDFName.Resources, Resources);\n // TODO: Clone `Font` if it is inherited\n var Font = Resources.lookupMaybe(PDFName.Font, PDFDict) || context.obj({});\n Resources.set(PDFName.Font, Font);\n // TODO: Clone `XObject` if it is inherited\n var XObject = Resources.lookupMaybe(PDFName.XObject, PDFDict) || context.obj({});\n Resources.set(PDFName.XObject, XObject);\n // TODO: Clone `ExtGState` if it is inherited\n var ExtGState = Resources.lookupMaybe(PDFName.ExtGState, PDFDict) || context.obj({});\n Resources.set(PDFName.ExtGState, ExtGState);\n var Annots = this.Annots() || context.obj([]);\n this.set(PDFName.Annots, Annots);\n this.normalized = true;\n };\n PDFPageLeaf.prototype.normalizedEntries = function () {\n this.normalize();\n var Annots = this.Annots();\n var Resources = this.Resources();\n var Contents = this.Contents();\n return {\n Annots: Annots,\n Resources: Resources,\n Contents: Contents,\n Font: Resources.lookup(PDFName.Font, PDFDict),\n XObject: Resources.lookup(PDFName.XObject, PDFDict),\n ExtGState: Resources.lookup(PDFName.ExtGState, PDFDict),\n };\n };\n PDFPageLeaf.InheritableEntries = [\n 'Resources',\n 'MediaBox',\n 'CropBox',\n 'Rotate',\n ];\n PDFPageLeaf.withContextAndParent = function (context, parent) {\n var dict = new Map();\n dict.set(PDFName.Type, PDFName.Page);\n dict.set(PDFName.Parent, parent);\n dict.set(PDFName.Resources, context.obj({}));\n dict.set(PDFName.MediaBox, context.obj([0, 0, 612, 792]));\n return new PDFPageLeaf(dict, context, false);\n };\n PDFPageLeaf.fromMapWithContext = function (map, context, autoNormalizeCTM) {\n if (autoNormalizeCTM === void 0) { autoNormalizeCTM = true; }\n return new PDFPageLeaf(map, context, autoNormalizeCTM);\n };\n return PDFPageLeaf;\n}(PDFDict));\nexport default PDFPageLeaf;\n//# sourceMappingURL=PDFPageLeaf.js.map","import PDFArray from \"./objects/PDFArray\";\nimport PDFDict from \"./objects/PDFDict\";\nimport PDFName from \"./objects/PDFName\";\nimport PDFRef from \"./objects/PDFRef\";\nimport PDFStream from \"./objects/PDFStream\";\nimport PDFPageLeaf from \"./structures/PDFPageLeaf\";\n/**\n * PDFObjectCopier copies PDFObjects from a src context to a dest context.\n * The primary use case for this is to copy pages between PDFs.\n *\n * _Copying_ an object with a PDFObjectCopier is different from _cloning_ an\n * object with its [[PDFObject.clone]] method:\n *\n * ```\n * const src: PDFContext = ...\n * const dest: PDFContext = ...\n * const originalObject: PDFObject = ...\n * const copiedObject = PDFObjectCopier.for(src, dest).copy(originalObject);\n * const clonedObject = originalObject.clone();\n * ```\n *\n * Copying an object is equivalent to cloning it and then copying over any other\n * objects that it references. Note that only dictionaries, arrays, and streams\n * (or structures build from them) can contain indirect references to other\n * objects. Copying a PDFObject that is not a dictionary, array, or stream is\n * supported, but is equivalent to cloning it.\n */\nvar PDFObjectCopier = /** @class */ (function () {\n function PDFObjectCopier(src, dest) {\n var _this = this;\n this.traversedObjects = new Map();\n // prettier-ignore\n this.copy = function (object) { return (object instanceof PDFPageLeaf ? _this.copyPDFPage(object)\n : object instanceof PDFDict ? _this.copyPDFDict(object)\n : object instanceof PDFArray ? _this.copyPDFArray(object)\n : object instanceof PDFStream ? _this.copyPDFStream(object)\n : object instanceof PDFRef ? _this.copyPDFIndirectObject(object)\n : object.clone()); };\n this.copyPDFPage = function (originalPage) {\n var clonedPage = originalPage.clone();\n // Move any entries that the originalPage is inheriting from its parent\n // tree nodes directly into originalPage so they are preserved during\n // the copy.\n var InheritableEntries = PDFPageLeaf.InheritableEntries;\n for (var idx = 0, len = InheritableEntries.length; idx < len; idx++) {\n var key = PDFName.of(InheritableEntries[idx]);\n var value = clonedPage.getInheritableAttribute(key);\n if (!clonedPage.get(key) && value)\n clonedPage.set(key, value);\n }\n // Remove the parent reference to prevent the whole donor document's page\n // tree from being copied when we only need a single page.\n clonedPage.delete(PDFName.of('Parent'));\n return _this.copyPDFDict(clonedPage);\n };\n this.copyPDFDict = function (originalDict) {\n if (_this.traversedObjects.has(originalDict)) {\n return _this.traversedObjects.get(originalDict);\n }\n var clonedDict = originalDict.clone(_this.dest);\n _this.traversedObjects.set(originalDict, clonedDict);\n var entries = originalDict.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n clonedDict.set(key, _this.copy(value));\n }\n return clonedDict;\n };\n this.copyPDFArray = function (originalArray) {\n if (_this.traversedObjects.has(originalArray)) {\n return _this.traversedObjects.get(originalArray);\n }\n var clonedArray = originalArray.clone(_this.dest);\n _this.traversedObjects.set(originalArray, clonedArray);\n for (var idx = 0, len = originalArray.size(); idx < len; idx++) {\n var value = originalArray.get(idx);\n clonedArray.set(idx, _this.copy(value));\n }\n return clonedArray;\n };\n this.copyPDFStream = function (originalStream) {\n if (_this.traversedObjects.has(originalStream)) {\n return _this.traversedObjects.get(originalStream);\n }\n var clonedStream = originalStream.clone(_this.dest);\n _this.traversedObjects.set(originalStream, clonedStream);\n var entries = originalStream.dict.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n clonedStream.dict.set(key, _this.copy(value));\n }\n return clonedStream;\n };\n this.copyPDFIndirectObject = function (ref) {\n var alreadyMapped = _this.traversedObjects.has(ref);\n if (!alreadyMapped) {\n var newRef = _this.dest.nextRef();\n _this.traversedObjects.set(ref, newRef);\n var dereferencedValue = _this.src.lookup(ref);\n if (dereferencedValue) {\n var cloned = _this.copy(dereferencedValue);\n _this.dest.assign(newRef, cloned);\n }\n }\n return _this.traversedObjects.get(ref);\n };\n this.src = src;\n this.dest = dest;\n }\n PDFObjectCopier.for = function (src, dest) {\n return new PDFObjectCopier(src, dest);\n };\n return PDFObjectCopier;\n}());\nexport default PDFObjectCopier;\n//# sourceMappingURL=PDFObjectCopier.js.map","import PDFRef from \"../objects/PDFRef\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, padStart } from \"../../utils\";\n/**\n * Entries should be added using the [[addEntry]] and [[addDeletedEntry]]\n * methods **in order of ascending object number**.\n */\nvar PDFCrossRefSection = /** @class */ (function () {\n function PDFCrossRefSection(firstEntry) {\n this.subsections = firstEntry ? [[firstEntry]] : [];\n this.chunkIdx = 0;\n this.chunkLength = firstEntry ? 1 : 0;\n }\n PDFCrossRefSection.prototype.addEntry = function (ref, offset) {\n this.append({ ref: ref, offset: offset, deleted: false });\n };\n PDFCrossRefSection.prototype.addDeletedEntry = function (ref, nextFreeObjectNumber) {\n this.append({ ref: ref, offset: nextFreeObjectNumber, deleted: true });\n };\n PDFCrossRefSection.prototype.toString = function () {\n var section = \"xref\\n\";\n for (var rangeIdx = 0, rangeLen = this.subsections.length; rangeIdx < rangeLen; rangeIdx++) {\n var range = this.subsections[rangeIdx];\n section += range[0].ref.objectNumber + \" \" + range.length + \"\\n\";\n for (var entryIdx = 0, entryLen = range.length; entryIdx < entryLen; entryIdx++) {\n var entry = range[entryIdx];\n section += padStart(String(entry.offset), 10, '0');\n section += ' ';\n section += padStart(String(entry.ref.generationNumber), 5, '0');\n section += ' ';\n section += entry.deleted ? 'f' : 'n';\n section += ' \\n';\n }\n }\n return section;\n };\n PDFCrossRefSection.prototype.sizeInBytes = function () {\n var size = 5;\n for (var idx = 0, len = this.subsections.length; idx < len; idx++) {\n var subsection = this.subsections[idx];\n var subsectionLength = subsection.length;\n var firstEntry = subsection[0];\n size += 2;\n size += String(firstEntry.ref.objectNumber).length;\n size += String(subsectionLength).length;\n size += 20 * subsectionLength;\n }\n return size;\n };\n PDFCrossRefSection.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.x;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.f;\n buffer[offset++] = CharCodes.Newline;\n offset += this.copySubsectionsIntoBuffer(this.subsections, buffer, offset);\n return offset - initialOffset;\n };\n PDFCrossRefSection.prototype.copySubsectionsIntoBuffer = function (subsections, buffer, offset) {\n var initialOffset = offset;\n var length = subsections.length;\n for (var idx = 0; idx < length; idx++) {\n var subsection = this.subsections[idx];\n var firstObjectNumber = String(subsection[0].ref.objectNumber);\n offset += copyStringIntoBuffer(firstObjectNumber, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n var rangeLength = String(subsection.length);\n offset += copyStringIntoBuffer(rangeLength, buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n offset += this.copyEntriesIntoBuffer(subsection, buffer, offset);\n }\n return offset - initialOffset;\n };\n PDFCrossRefSection.prototype.copyEntriesIntoBuffer = function (entries, buffer, offset) {\n var length = entries.length;\n for (var idx = 0; idx < length; idx++) {\n var entry = entries[idx];\n var entryOffset = padStart(String(entry.offset), 10, '0');\n offset += copyStringIntoBuffer(entryOffset, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n var entryGen = padStart(String(entry.ref.generationNumber), 5, '0');\n offset += copyStringIntoBuffer(entryGen, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n buffer[offset++] = entry.deleted ? CharCodes.f : CharCodes.n;\n buffer[offset++] = CharCodes.Space;\n buffer[offset++] = CharCodes.Newline;\n }\n return 20 * length;\n };\n PDFCrossRefSection.prototype.append = function (currEntry) {\n if (this.chunkLength === 0) {\n this.subsections.push([currEntry]);\n this.chunkIdx = 0;\n this.chunkLength = 1;\n return;\n }\n var chunk = this.subsections[this.chunkIdx];\n var prevEntry = chunk[this.chunkLength - 1];\n if (currEntry.ref.objectNumber - prevEntry.ref.objectNumber > 1) {\n this.subsections.push([currEntry]);\n this.chunkIdx += 1;\n this.chunkLength = 1;\n }\n else {\n chunk.push(currEntry);\n this.chunkLength += 1;\n }\n };\n PDFCrossRefSection.create = function () {\n return new PDFCrossRefSection({\n ref: PDFRef.of(0, 65535),\n offset: 0,\n deleted: true,\n });\n };\n PDFCrossRefSection.createEmpty = function () { return new PDFCrossRefSection(); };\n return PDFCrossRefSection;\n}());\nexport default PDFCrossRefSection;\n//# sourceMappingURL=PDFCrossRefSection.js.map","import CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer } from \"../../utils\";\nvar PDFTrailer = /** @class */ (function () {\n function PDFTrailer(lastXRefOffset) {\n this.lastXRefOffset = String(lastXRefOffset);\n }\n PDFTrailer.prototype.toString = function () {\n return \"startxref\\n\" + this.lastXRefOffset + \"\\n%%EOF\";\n };\n PDFTrailer.prototype.sizeInBytes = function () {\n return 16 + this.lastXRefOffset.length;\n };\n PDFTrailer.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.x;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.f;\n buffer[offset++] = CharCodes.Newline;\n offset += copyStringIntoBuffer(this.lastXRefOffset, buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = CharCodes.E;\n buffer[offset++] = CharCodes.O;\n buffer[offset++] = CharCodes.F;\n return offset - initialOffset;\n };\n PDFTrailer.forLastCrossRefSectionOffset = function (offset) {\n return new PDFTrailer(offset);\n };\n return PDFTrailer;\n}());\nexport default PDFTrailer;\n//# sourceMappingURL=PDFTrailer.js.map","import CharCodes from \"../syntax/CharCodes\";\nvar PDFTrailerDict = /** @class */ (function () {\n function PDFTrailerDict(dict) {\n this.dict = dict;\n }\n PDFTrailerDict.prototype.toString = function () {\n return \"trailer\\n\" + this.dict.toString();\n };\n PDFTrailerDict.prototype.sizeInBytes = function () {\n return 8 + this.dict.sizeInBytes();\n };\n PDFTrailerDict.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.i;\n buffer[offset++] = CharCodes.l;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.Newline;\n offset += this.dict.copyBytesInto(buffer, offset);\n return offset - initialOffset;\n };\n PDFTrailerDict.of = function (dict) { return new PDFTrailerDict(dict); };\n return PDFTrailerDict;\n}());\nexport default PDFTrailerDict;\n//# sourceMappingURL=PDFTrailerDict.js.map","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFFlateStream from \"./PDFFlateStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, last } from \"../../utils\";\nvar PDFObjectStream = /** @class */ (function (_super) {\n __extends(PDFObjectStream, _super);\n function PDFObjectStream(context, objects, encode) {\n if (encode === void 0) { encode = true; }\n var _this = _super.call(this, context.obj({}), encode) || this;\n _this.objects = objects;\n _this.offsets = _this.computeObjectOffsets();\n _this.offsetsString = _this.computeOffsetsString();\n _this.dict.set(PDFName.of('Type'), PDFName.of('ObjStm'));\n _this.dict.set(PDFName.of('N'), PDFNumber.of(_this.objects.length));\n _this.dict.set(PDFName.of('First'), PDFNumber.of(_this.offsetsString.length));\n return _this;\n }\n PDFObjectStream.prototype.getObjectsCount = function () {\n return this.objects.length;\n };\n PDFObjectStream.prototype.clone = function (context) {\n return PDFObjectStream.withContextAndObjects(context || this.dict.context, this.objects.slice(), this.encode);\n };\n PDFObjectStream.prototype.getContentsString = function () {\n var value = this.offsetsString;\n for (var idx = 0, len = this.objects.length; idx < len; idx++) {\n var _a = this.objects[idx], object = _a[1];\n value += object + \"\\n\";\n }\n return value;\n };\n PDFObjectStream.prototype.getUnencodedContents = function () {\n var buffer = new Uint8Array(this.getUnencodedContentsSize());\n var offset = copyStringIntoBuffer(this.offsetsString, buffer, 0);\n for (var idx = 0, len = this.objects.length; idx < len; idx++) {\n var _a = this.objects[idx], object = _a[1];\n offset += object.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n return buffer;\n };\n PDFObjectStream.prototype.getUnencodedContentsSize = function () {\n return (this.offsetsString.length +\n last(this.offsets)[1] +\n last(this.objects)[1].sizeInBytes() +\n 1);\n };\n PDFObjectStream.prototype.computeOffsetsString = function () {\n var offsetsString = '';\n for (var idx = 0, len = this.offsets.length; idx < len; idx++) {\n var _a = this.offsets[idx], objectNumber = _a[0], offset = _a[1];\n offsetsString += objectNumber + \" \" + offset + \" \";\n }\n return offsetsString;\n };\n PDFObjectStream.prototype.computeObjectOffsets = function () {\n var offset = 0;\n var offsets = new Array(this.objects.length);\n for (var idx = 0, len = this.objects.length; idx < len; idx++) {\n var _a = this.objects[idx], ref = _a[0], object = _a[1];\n offsets[idx] = [ref.objectNumber, offset];\n offset += object.sizeInBytes() + 1; // '\\n'\n }\n return offsets;\n };\n PDFObjectStream.withContextAndObjects = function (context, objects, encode) {\n if (encode === void 0) { encode = true; }\n return new PDFObjectStream(context, objects, encode);\n };\n return PDFObjectStream;\n}(PDFFlateStream));\nexport default PDFObjectStream;\n//# sourceMappingURL=PDFObjectStream.js.map","import { __awaiter, __generator } from \"tslib\";\nimport PDFCrossRefSection from \"../document/PDFCrossRefSection\";\nimport PDFHeader from \"../document/PDFHeader\";\nimport PDFTrailer from \"../document/PDFTrailer\";\nimport PDFTrailerDict from \"../document/PDFTrailerDict\";\nimport PDFObjectStream from \"../structures/PDFObjectStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, waitForTick } from \"../../utils\";\nvar PDFWriter = /** @class */ (function () {\n function PDFWriter(context, objectsPerTick) {\n var _this = this;\n this.parsedObjects = 0;\n this.shouldWaitForTick = function (n) {\n _this.parsedObjects += n;\n return _this.parsedObjects % _this.objectsPerTick === 0;\n };\n this.context = context;\n this.objectsPerTick = objectsPerTick;\n }\n PDFWriter.prototype.serializeToBuffer = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _a, size, header, indirectObjects, xref, trailerDict, trailer, offset, buffer, idx, len, _b, ref, object, objectNumber, generationNumber, n;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0: return [4 /*yield*/, this.computeBufferSize()];\n case 1:\n _a = _c.sent(), size = _a.size, header = _a.header, indirectObjects = _a.indirectObjects, xref = _a.xref, trailerDict = _a.trailerDict, trailer = _a.trailer;\n offset = 0;\n buffer = new Uint8Array(size);\n offset += header.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Newline;\n idx = 0, len = indirectObjects.length;\n _c.label = 2;\n case 2:\n if (!(idx < len)) return [3 /*break*/, 5];\n _b = indirectObjects[idx], ref = _b[0], object = _b[1];\n objectNumber = String(ref.objectNumber);\n offset += copyStringIntoBuffer(objectNumber, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n generationNumber = String(ref.generationNumber);\n offset += copyStringIntoBuffer(generationNumber, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n buffer[offset++] = CharCodes.o;\n buffer[offset++] = CharCodes.b;\n buffer[offset++] = CharCodes.j;\n buffer[offset++] = CharCodes.Newline;\n offset += object.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.n;\n buffer[offset++] = CharCodes.d;\n buffer[offset++] = CharCodes.o;\n buffer[offset++] = CharCodes.b;\n buffer[offset++] = CharCodes.j;\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Newline;\n n = object instanceof PDFObjectStream ? object.getObjectsCount() : 1;\n if (!this.shouldWaitForTick(n)) return [3 /*break*/, 4];\n return [4 /*yield*/, waitForTick()];\n case 3:\n _c.sent();\n _c.label = 4;\n case 4:\n idx++;\n return [3 /*break*/, 2];\n case 5:\n if (xref) {\n offset += xref.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n if (trailerDict) {\n offset += trailerDict.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Newline;\n }\n offset += trailer.copyBytesInto(buffer, offset);\n return [2 /*return*/, buffer];\n }\n });\n });\n };\n PDFWriter.prototype.computeIndirectObjectSize = function (_a) {\n var ref = _a[0], object = _a[1];\n var refSize = ref.sizeInBytes() + 3; // 'R' -> 'obj\\n'\n var objectSize = object.sizeInBytes() + 9; // '\\nendobj\\n\\n'\n return refSize + objectSize;\n };\n PDFWriter.prototype.createTrailerDict = function () {\n return this.context.obj({\n Size: this.context.largestObjectNumber + 1,\n Root: this.context.trailerInfo.Root,\n Encrypt: this.context.trailerInfo.Encrypt,\n Info: this.context.trailerInfo.Info,\n ID: this.context.trailerInfo.ID,\n });\n };\n PDFWriter.prototype.computeBufferSize = function () {\n return __awaiter(this, void 0, void 0, function () {\n var header, size, xref, indirectObjects, idx, len, indirectObject, ref, xrefOffset, trailerDict, trailer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n header = PDFHeader.forVersion(1, 7);\n size = header.sizeInBytes() + 2;\n xref = PDFCrossRefSection.create();\n indirectObjects = this.context.enumerateIndirectObjects();\n idx = 0, len = indirectObjects.length;\n _a.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n indirectObject = indirectObjects[idx];\n ref = indirectObject[0];\n xref.addEntry(ref, size);\n size += this.computeIndirectObjectSize(indirectObject);\n if (!this.shouldWaitForTick(1)) return [3 /*break*/, 3];\n return [4 /*yield*/, waitForTick()];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4:\n xrefOffset = size;\n size += xref.sizeInBytes() + 1; // '\\n'\n trailerDict = PDFTrailerDict.of(this.createTrailerDict());\n size += trailerDict.sizeInBytes() + 2; // '\\n\\n'\n trailer = PDFTrailer.forLastCrossRefSectionOffset(xrefOffset);\n size += trailer.sizeInBytes();\n return [2 /*return*/, { size: size, header: header, indirectObjects: indirectObjects, xref: xref, trailerDict: trailerDict, trailer: trailer }];\n }\n });\n });\n };\n PDFWriter.forContext = function (context, objectsPerTick) {\n return new PDFWriter(context, objectsPerTick);\n };\n return PDFWriter;\n}());\nexport default PDFWriter;\n//# sourceMappingURL=PDFWriter.js.map","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nvar PDFInvalidObject = /** @class */ (function (_super) {\n __extends(PDFInvalidObject, _super);\n function PDFInvalidObject(data) {\n var _this = _super.call(this) || this;\n _this.data = data;\n return _this;\n }\n PDFInvalidObject.prototype.clone = function () {\n return PDFInvalidObject.of(this.data.slice());\n };\n PDFInvalidObject.prototype.toString = function () {\n return \"PDFInvalidObject(\" + this.data.length + \" bytes)\";\n };\n PDFInvalidObject.prototype.sizeInBytes = function () {\n return this.data.length;\n };\n PDFInvalidObject.prototype.copyBytesInto = function (buffer, offset) {\n var length = this.data.length;\n for (var idx = 0; idx < length; idx++) {\n buffer[offset++] = this.data[idx];\n }\n return length;\n };\n PDFInvalidObject.of = function (data) { return new PDFInvalidObject(data); };\n return PDFInvalidObject;\n}(PDFObject));\nexport default PDFInvalidObject;\n//# sourceMappingURL=PDFInvalidObject.js.map","import { __awaiter, __generator } from \"tslib\";\n// prettier-ignore\nvar MARKERS = [\n 0xffc0, 0xffc1, 0xffc2,\n 0xffc3, 0xffc5, 0xffc6,\n 0xffc7, 0xffc8, 0xffc9,\n 0xffca, 0xffcb, 0xffcc,\n 0xffcd, 0xffce, 0xffcf,\n];\nvar ColorSpace;\n(function (ColorSpace) {\n ColorSpace[\"DeviceGray\"] = \"DeviceGray\";\n ColorSpace[\"DeviceRGB\"] = \"DeviceRGB\";\n ColorSpace[\"DeviceCMYK\"] = \"DeviceCMYK\";\n})(ColorSpace || (ColorSpace = {}));\nvar ChannelToColorSpace = {\n 1: ColorSpace.DeviceGray,\n 3: ColorSpace.DeviceRGB,\n 4: ColorSpace.DeviceCMYK,\n};\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/foliojs/pdfkit/blob/a6af76467ce06bd6a2af4aa7271ccac9ff152a7d/lib/image/jpeg.js\n */\nvar JpegEmbedder = /** @class */ (function () {\n function JpegEmbedder(imageData, bitsPerComponent, width, height, colorSpace) {\n this.imageData = imageData;\n this.bitsPerComponent = bitsPerComponent;\n this.width = width;\n this.height = height;\n this.colorSpace = colorSpace;\n }\n JpegEmbedder.for = function (imageData) {\n return __awaiter(this, void 0, void 0, function () {\n var dataView, soi, pos, marker, bitsPerComponent, height, width, channelByte, channelName, colorSpace;\n return __generator(this, function (_a) {\n dataView = new DataView(imageData.buffer);\n soi = dataView.getUint16(0);\n if (soi !== 0xffd8)\n throw new Error('SOI not found in JPEG');\n pos = 2;\n while (pos < dataView.byteLength) {\n marker = dataView.getUint16(pos);\n pos += 2;\n if (MARKERS.includes(marker))\n break;\n pos += dataView.getUint16(pos);\n }\n if (!MARKERS.includes(marker))\n throw new Error('Invalid JPEG');\n pos += 2;\n bitsPerComponent = dataView.getUint8(pos++);\n height = dataView.getUint16(pos);\n pos += 2;\n width = dataView.getUint16(pos);\n pos += 2;\n channelByte = dataView.getUint8(pos++);\n channelName = ChannelToColorSpace[channelByte];\n if (!channelName)\n throw new Error('Unknown JPEG channel.');\n colorSpace = channelName;\n return [2 /*return*/, new JpegEmbedder(imageData, bitsPerComponent, width, height, colorSpace)];\n });\n });\n };\n JpegEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var xObject;\n return __generator(this, function (_a) {\n xObject = context.stream(this.imageData, {\n Type: 'XObject',\n Subtype: 'Image',\n BitsPerComponent: this.bitsPerComponent,\n Width: this.width,\n Height: this.height,\n ColorSpace: this.colorSpace,\n Filter: 'DCTDecode',\n // CMYK JPEG streams in PDF are typically stored complemented,\n // with 1 as 'off' and 0 as 'on' (PDF 32000-1:2008, 8.6.4.4).\n //\n // Standalone CMYK JPEG (usually exported by Photoshop) are\n // stored inverse, with 0 as 'off' and 1 as 'on', like RGB.\n //\n // Applying a swap here as a hedge that most bytes passing\n // through this method will benefit from it.\n Decode: this.colorSpace === ColorSpace.DeviceCMYK\n ? [1, 0, 1, 0, 1, 0, 1, 0]\n : undefined,\n });\n if (ref) {\n context.assign(ref, xObject);\n return [2 /*return*/, ref];\n }\n else {\n return [2 /*return*/, context.register(xObject)];\n }\n return [2 /*return*/];\n });\n });\n };\n return JpegEmbedder;\n}());\nexport default JpegEmbedder;\n//# sourceMappingURL=JpegEmbedder.js.map","import { __awaiter, __extends, __generator } from \"tslib\";\nimport PDFHeader from \"../document/PDFHeader\";\nimport PDFTrailer from \"../document/PDFTrailer\";\nimport PDFInvalidObject from \"../objects/PDFInvalidObject\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFStream from \"../objects/PDFStream\";\nimport PDFCrossRefStream from \"../structures/PDFCrossRefStream\";\nimport PDFObjectStream from \"../structures/PDFObjectStream\";\nimport PDFWriter from \"./PDFWriter\";\nimport { last, waitForTick } from \"../../utils\";\nvar PDFStreamWriter = /** @class */ (function (_super) {\n __extends(PDFStreamWriter, _super);\n function PDFStreamWriter(context, objectsPerTick, encodeStreams, objectsPerStream) {\n var _this = _super.call(this, context, objectsPerTick) || this;\n _this.encodeStreams = encodeStreams;\n _this.objectsPerStream = objectsPerStream;\n return _this;\n }\n PDFStreamWriter.prototype.computeBufferSize = function () {\n return __awaiter(this, void 0, void 0, function () {\n var objectNumber, header, size, xrefStream, uncompressedObjects, compressedObjects, objectStreamRefs, indirectObjects, idx, len, indirectObject, ref, object, shouldNotCompress, chunk, objectStreamRef, idx, len, chunk, ref, objectStream, xrefStreamRef, xrefOffset, trailer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n objectNumber = this.context.largestObjectNumber + 1;\n header = PDFHeader.forVersion(1, 7);\n size = header.sizeInBytes() + 2;\n xrefStream = PDFCrossRefStream.create(this.createTrailerDict(), this.encodeStreams);\n uncompressedObjects = [];\n compressedObjects = [];\n objectStreamRefs = [];\n indirectObjects = this.context.enumerateIndirectObjects();\n idx = 0, len = indirectObjects.length;\n _a.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 6];\n indirectObject = indirectObjects[idx];\n ref = indirectObject[0], object = indirectObject[1];\n shouldNotCompress = ref === this.context.trailerInfo.Encrypt ||\n object instanceof PDFStream ||\n object instanceof PDFInvalidObject ||\n ref.generationNumber !== 0;\n if (!shouldNotCompress) return [3 /*break*/, 4];\n uncompressedObjects.push(indirectObject);\n xrefStream.addUncompressedEntry(ref, size);\n size += this.computeIndirectObjectSize(indirectObject);\n if (!this.shouldWaitForTick(1)) return [3 /*break*/, 3];\n return [4 /*yield*/, waitForTick()];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3: return [3 /*break*/, 5];\n case 4:\n chunk = last(compressedObjects);\n objectStreamRef = last(objectStreamRefs);\n if (!chunk || chunk.length % this.objectsPerStream === 0) {\n chunk = [];\n compressedObjects.push(chunk);\n objectStreamRef = PDFRef.of(objectNumber++);\n objectStreamRefs.push(objectStreamRef);\n }\n xrefStream.addCompressedEntry(ref, objectStreamRef, chunk.length);\n chunk.push(indirectObject);\n _a.label = 5;\n case 5:\n idx++;\n return [3 /*break*/, 1];\n case 6:\n idx = 0, len = compressedObjects.length;\n _a.label = 7;\n case 7:\n if (!(idx < len)) return [3 /*break*/, 10];\n chunk = compressedObjects[idx];\n ref = objectStreamRefs[idx];\n objectStream = PDFObjectStream.withContextAndObjects(this.context, chunk, this.encodeStreams);\n xrefStream.addUncompressedEntry(ref, size);\n size += this.computeIndirectObjectSize([ref, objectStream]);\n uncompressedObjects.push([ref, objectStream]);\n if (!this.shouldWaitForTick(chunk.length)) return [3 /*break*/, 9];\n return [4 /*yield*/, waitForTick()];\n case 8:\n _a.sent();\n _a.label = 9;\n case 9:\n idx++;\n return [3 /*break*/, 7];\n case 10:\n xrefStreamRef = PDFRef.of(objectNumber++);\n xrefStream.dict.set(PDFName.of('Size'), PDFNumber.of(objectNumber));\n xrefStream.addUncompressedEntry(xrefStreamRef, size);\n xrefOffset = size;\n size += this.computeIndirectObjectSize([xrefStreamRef, xrefStream]);\n uncompressedObjects.push([xrefStreamRef, xrefStream]);\n trailer = PDFTrailer.forLastCrossRefSectionOffset(xrefOffset);\n size += trailer.sizeInBytes();\n return [2 /*return*/, { size: size, header: header, indirectObjects: uncompressedObjects, trailer: trailer }];\n }\n });\n });\n };\n PDFStreamWriter.forContext = function (context, objectsPerTick, encodeStreams, objectsPerStream) {\n if (encodeStreams === void 0) { encodeStreams = true; }\n if (objectsPerStream === void 0) { objectsPerStream = 50; }\n return new PDFStreamWriter(context, objectsPerTick, encodeStreams, objectsPerStream);\n };\n return PDFStreamWriter;\n}(PDFWriter));\nexport default PDFStreamWriter;\n//# sourceMappingURL=PDFStreamWriter.js.map","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, toHexStringOfMinLength, utf16Decode, utf16Encode, pdfDocEncodingDecode, parseDate, hasUtf16BOM, } from \"../../utils\";\nimport { InvalidPDFDateStringError } from \"../errors\";\nvar PDFHexString = /** @class */ (function (_super) {\n __extends(PDFHexString, _super);\n function PDFHexString(value) {\n var _this = _super.call(this) || this;\n _this.value = value;\n return _this;\n }\n PDFHexString.prototype.asBytes = function () {\n // Append a zero if the number of digits is odd. See PDF spec 7.3.4.3\n var hex = this.value + (this.value.length % 2 === 1 ? '0' : '');\n var hexLength = hex.length;\n var bytes = new Uint8Array(hex.length / 2);\n var hexOffset = 0;\n var bytesOffset = 0;\n // Interpret each pair of hex digits as a single byte\n while (hexOffset < hexLength) {\n var byte = parseInt(hex.substring(hexOffset, hexOffset + 2), 16);\n bytes[bytesOffset] = byte;\n hexOffset += 2;\n bytesOffset += 1;\n }\n return bytes;\n };\n PDFHexString.prototype.decodeText = function () {\n var bytes = this.asBytes();\n if (hasUtf16BOM(bytes))\n return utf16Decode(bytes);\n return pdfDocEncodingDecode(bytes);\n };\n PDFHexString.prototype.decodeDate = function () {\n var text = this.decodeText();\n var date = parseDate(text);\n if (!date)\n throw new InvalidPDFDateStringError(text);\n return date;\n };\n PDFHexString.prototype.asString = function () {\n return this.value;\n };\n PDFHexString.prototype.clone = function () {\n return PDFHexString.of(this.value);\n };\n PDFHexString.prototype.toString = function () {\n return \"<\" + this.value + \">\";\n };\n PDFHexString.prototype.sizeInBytes = function () {\n return this.value.length + 2;\n };\n PDFHexString.prototype.copyBytesInto = function (buffer, offset) {\n buffer[offset++] = CharCodes.LessThan;\n offset += copyStringIntoBuffer(this.value, buffer, offset);\n buffer[offset++] = CharCodes.GreaterThan;\n return this.value.length + 2;\n };\n PDFHexString.of = function (value) { return new PDFHexString(value); };\n PDFHexString.fromText = function (value) {\n var encoded = utf16Encode(value);\n var hex = '';\n for (var idx = 0, len = encoded.length; idx < len; idx++) {\n hex += toHexStringOfMinLength(encoded[idx], 4);\n }\n return new PDFHexString(hex);\n };\n return PDFHexString;\n}(PDFObject));\nexport default PDFHexString;\n//# sourceMappingURL=PDFHexString.js.map","import { Encodings, Font, FontNames, } from '@pdf-lib/standard-fonts';\nimport PDFHexString from \"../objects/PDFHexString\";\nimport { toCodePoint, toHexString } from \"../../utils\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/foliojs/pdfkit/blob/f91bdd61c164a72ea06be1a43dc0a412afc3925f/lib/font/afm.coffee\n */\nvar StandardFontEmbedder = /** @class */ (function () {\n function StandardFontEmbedder(fontName, customName) {\n // prettier-ignore\n this.encoding = (fontName === FontNames.ZapfDingbats ? Encodings.ZapfDingbats\n : fontName === FontNames.Symbol ? Encodings.Symbol\n : Encodings.WinAnsi);\n this.font = Font.load(fontName);\n this.fontName = this.font.FontName;\n this.customName = customName;\n }\n /**\n * Encode the JavaScript string into this font. (JavaScript encodes strings in\n * Unicode, but standard fonts use either WinAnsi, ZapfDingbats, or Symbol\n * encodings)\n */\n StandardFontEmbedder.prototype.encodeText = function (text) {\n var glyphs = this.encodeTextAsGlyphs(text);\n var hexCodes = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n hexCodes[idx] = toHexString(glyphs[idx].code);\n }\n return PDFHexString.of(hexCodes.join(''));\n };\n StandardFontEmbedder.prototype.widthOfTextAtSize = function (text, size) {\n var glyphs = this.encodeTextAsGlyphs(text);\n var totalWidth = 0;\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var left = glyphs[idx].name;\n var right = (glyphs[idx + 1] || {}).name;\n var kernAmount = this.font.getXAxisKerningForPair(left, right) || 0;\n totalWidth += this.widthOfGlyph(left) + kernAmount;\n }\n var scale = size / 1000;\n return totalWidth * scale;\n };\n StandardFontEmbedder.prototype.heightOfFontAtSize = function (size, options) {\n if (options === void 0) { options = {}; }\n var _a = options.descender, descender = _a === void 0 ? true : _a;\n var _b = this.font, Ascender = _b.Ascender, Descender = _b.Descender, FontBBox = _b.FontBBox;\n var yTop = Ascender || FontBBox[3];\n var yBottom = Descender || FontBBox[1];\n var height = yTop - yBottom;\n if (!descender)\n height += Descender || 0;\n return (height / 1000) * size;\n };\n StandardFontEmbedder.prototype.sizeOfFontAtHeight = function (height) {\n var _a = this.font, Ascender = _a.Ascender, Descender = _a.Descender, FontBBox = _a.FontBBox;\n var yTop = Ascender || FontBBox[3];\n var yBottom = Descender || FontBBox[1];\n return (1000 * height) / (yTop - yBottom);\n };\n StandardFontEmbedder.prototype.embedIntoContext = function (context, ref) {\n var fontDict = context.obj({\n Type: 'Font',\n Subtype: 'Type1',\n BaseFont: this.customName || this.fontName,\n Encoding: this.encoding === Encodings.WinAnsi ? 'WinAnsiEncoding' : undefined,\n });\n if (ref) {\n context.assign(ref, fontDict);\n return ref;\n }\n else {\n return context.register(fontDict);\n }\n };\n StandardFontEmbedder.prototype.widthOfGlyph = function (glyphName) {\n // Default to 250 if font doesn't specify a width\n return this.font.getWidthOfGlyph(glyphName) || 250;\n };\n StandardFontEmbedder.prototype.encodeTextAsGlyphs = function (text) {\n var codePoints = Array.from(text);\n var glyphs = new Array(codePoints.length);\n for (var idx = 0, len = codePoints.length; idx < len; idx++) {\n var codePoint = toCodePoint(codePoints[idx]);\n glyphs[idx] = this.encoding.encodeUnicodeCodePoint(codePoint);\n }\n return glyphs;\n };\n StandardFontEmbedder.for = function (fontName, customName) {\n return new StandardFontEmbedder(fontName, customName);\n };\n return StandardFontEmbedder;\n}());\nexport default StandardFontEmbedder;\n//# sourceMappingURL=StandardFontEmbedder.js.map","import { toHexString, toHexStringOfMinLength } from \"../../utils\";\nimport { hasSurrogates, highSurrogate, isWithinBMP, lowSurrogate, } from \"../../utils/unicode\";\n/** `glyphs` should be an array of unique glyphs */\nexport var createCmap = function (glyphs, glyphId) {\n var bfChars = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var glyph = glyphs[idx];\n var id = cmapHexFormat(cmapHexString(glyphId(glyph)));\n var unicode = cmapHexFormat.apply(void 0, glyph.codePoints.map(cmapCodePointFormat));\n bfChars[idx] = [id, unicode];\n }\n return fillCmapTemplate(bfChars);\n};\n/* =============================== Templates ================================ */\nvar fillCmapTemplate = function (bfChars) { return \"/CIDInit /ProcSet findresource begin\\n12 dict begin\\nbegincmap\\n/CIDSystemInfo <<\\n /Registry (Adobe)\\n /Ordering (UCS)\\n /Supplement 0\\n>> def\\n/CMapName /Adobe-Identity-UCS def\\n/CMapType 2 def\\n1 begincodespacerange\\n<0000>\\nendcodespacerange\\n\" + bfChars.length + \" beginbfchar\\n\" + bfChars.map(function (_a) {\n var glyphId = _a[0], codePoint = _a[1];\n return glyphId + \" \" + codePoint;\n}).join('\\n') + \"\\nendbfchar\\nendcmap\\nCMapName currentdict /CMap defineresource pop\\nend\\nend\"; };\n/* =============================== Utilities ================================ */\nvar cmapHexFormat = function () {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i] = arguments[_i];\n }\n return \"<\" + values.join('') + \">\";\n};\nvar cmapHexString = function (value) { return toHexStringOfMinLength(value, 4); };\nvar cmapCodePointFormat = function (codePoint) {\n if (isWithinBMP(codePoint))\n return cmapHexString(codePoint);\n if (hasSurrogates(codePoint)) {\n var hs = highSurrogate(codePoint);\n var ls = lowSurrogate(codePoint);\n return \"\" + cmapHexString(hs) + cmapHexString(ls);\n }\n var hex = toHexString(codePoint);\n var msg = \"0x\" + hex + \" is not a valid UTF-8 or UTF-16 codepoint.\";\n throw new Error(msg);\n};\n//# sourceMappingURL=CMap.js.map","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, padStart, utf16Decode, pdfDocEncodingDecode, toCharCode, parseDate, hasUtf16BOM, } from \"../../utils\";\nimport { InvalidPDFDateStringError } from \"../errors\";\nvar PDFString = /** @class */ (function (_super) {\n __extends(PDFString, _super);\n function PDFString(value) {\n var _this = _super.call(this) || this;\n _this.value = value;\n return _this;\n }\n PDFString.prototype.asBytes = function () {\n var bytes = [];\n var octal = '';\n var escaped = false;\n var pushByte = function (byte) {\n if (byte !== undefined)\n bytes.push(byte);\n escaped = false;\n };\n for (var idx = 0, len = this.value.length; idx < len; idx++) {\n var char = this.value[idx];\n var byte = toCharCode(char);\n var nextChar = this.value[idx + 1];\n if (!escaped) {\n if (byte === CharCodes.BackSlash)\n escaped = true;\n else\n pushByte(byte);\n }\n else {\n if (byte === CharCodes.Newline)\n pushByte();\n else if (byte === CharCodes.CarriageReturn)\n pushByte();\n else if (byte === CharCodes.n)\n pushByte(CharCodes.Newline);\n else if (byte === CharCodes.r)\n pushByte(CharCodes.CarriageReturn);\n else if (byte === CharCodes.t)\n pushByte(CharCodes.Tab);\n else if (byte === CharCodes.b)\n pushByte(CharCodes.Backspace);\n else if (byte === CharCodes.f)\n pushByte(CharCodes.FormFeed);\n else if (byte === CharCodes.LeftParen)\n pushByte(CharCodes.LeftParen);\n else if (byte === CharCodes.RightParen)\n pushByte(CharCodes.RightParen);\n else if (byte === CharCodes.Backspace)\n pushByte(CharCodes.BackSlash);\n else if (byte >= CharCodes.Zero && byte <= CharCodes.Seven) {\n octal += char;\n if (octal.length === 3 || !(nextChar >= '0' && nextChar <= '7')) {\n pushByte(parseInt(octal, 8));\n octal = '';\n }\n }\n else {\n pushByte(byte);\n }\n }\n }\n return new Uint8Array(bytes);\n };\n PDFString.prototype.decodeText = function () {\n var bytes = this.asBytes();\n if (hasUtf16BOM(bytes))\n return utf16Decode(bytes);\n return pdfDocEncodingDecode(bytes);\n };\n PDFString.prototype.decodeDate = function () {\n var text = this.decodeText();\n var date = parseDate(text);\n if (!date)\n throw new InvalidPDFDateStringError(text);\n return date;\n };\n PDFString.prototype.asString = function () {\n return this.value;\n };\n PDFString.prototype.clone = function () {\n return PDFString.of(this.value);\n };\n PDFString.prototype.toString = function () {\n return \"(\" + this.value + \")\";\n };\n PDFString.prototype.sizeInBytes = function () {\n return this.value.length + 2;\n };\n PDFString.prototype.copyBytesInto = function (buffer, offset) {\n buffer[offset++] = CharCodes.LeftParen;\n offset += copyStringIntoBuffer(this.value, buffer, offset);\n buffer[offset++] = CharCodes.RightParen;\n return this.value.length + 2;\n };\n // The PDF spec allows newlines and parens to appear directly within a literal\n // string. These character _may_ be escaped. But they do not _have_ to be. So\n // for simplicity, we will not bother escaping them.\n PDFString.of = function (value) { return new PDFString(value); };\n PDFString.fromDate = function (date) {\n var year = padStart(String(date.getUTCFullYear()), 4, '0');\n var month = padStart(String(date.getUTCMonth() + 1), 2, '0');\n var day = padStart(String(date.getUTCDate()), 2, '0');\n var hours = padStart(String(date.getUTCHours()), 2, '0');\n var mins = padStart(String(date.getUTCMinutes()), 2, '0');\n var secs = padStart(String(date.getUTCSeconds()), 2, '0');\n return new PDFString(\"D:\" + year + month + day + hours + mins + secs + \"Z\");\n };\n return PDFString;\n}(PDFObject));\nexport default PDFString;\n//# sourceMappingURL=PDFString.js.map","import { __awaiter, __generator } from \"tslib\";\nimport { createCmap } from \"./CMap\";\nimport { deriveFontFlags } from \"./FontFlags\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFString from \"../objects/PDFString\";\nimport { addRandomSuffix, byAscendingId, Cache, sortedUniq, toHexStringOfMinLength, } from \"../../utils\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/devongovett/pdfkit/blob/e71edab0dd4657b5a767804ba86c94c58d01fbca/lib/image/jpeg.coffee\n */\nvar CustomFontEmbedder = /** @class */ (function () {\n function CustomFontEmbedder(font, fontData, customName) {\n var _this = this;\n this.allGlyphsInFontSortedById = function () {\n var glyphs = new Array(_this.font.characterSet.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var codePoint = _this.font.characterSet[idx];\n glyphs[idx] = _this.font.glyphForCodePoint(codePoint);\n }\n return sortedUniq(glyphs.sort(byAscendingId), function (g) { return g.id; });\n };\n this.font = font;\n this.scale = 1000 / this.font.unitsPerEm;\n this.fontData = fontData;\n this.fontName = this.font.postscriptName || 'Font';\n this.customName = customName;\n this.baseFontName = '';\n this.glyphCache = Cache.populatedBy(this.allGlyphsInFontSortedById);\n }\n CustomFontEmbedder.for = function (fontkit, fontData, customName) {\n return __awaiter(this, void 0, void 0, function () {\n var font;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fontkit.create(fontData)];\n case 1:\n font = _a.sent();\n return [2 /*return*/, new CustomFontEmbedder(font, fontData, customName)];\n }\n });\n });\n };\n /**\n * Encode the JavaScript string into this font. (JavaScript encodes strings in\n * Unicode, but embedded fonts use their own custom encodings)\n */\n CustomFontEmbedder.prototype.encodeText = function (text) {\n var glyphs = this.font.layout(text).glyphs;\n var hexCodes = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n hexCodes[idx] = toHexStringOfMinLength(glyphs[idx].id, 4);\n }\n return PDFHexString.of(hexCodes.join(''));\n };\n // The advanceWidth takes into account kerning automatically, so we don't\n // have to do that manually like we do for the standard fonts.\n CustomFontEmbedder.prototype.widthOfTextAtSize = function (text, size) {\n var glyphs = this.font.layout(text).glyphs;\n var totalWidth = 0;\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n totalWidth += glyphs[idx].advanceWidth * this.scale;\n }\n var scale = size / 1000;\n return totalWidth * scale;\n };\n CustomFontEmbedder.prototype.heightOfFontAtSize = function (size, options) {\n if (options === void 0) { options = {}; }\n var _a = options.descender, descender = _a === void 0 ? true : _a;\n var _b = this.font, ascent = _b.ascent, descent = _b.descent, bbox = _b.bbox;\n var yTop = (ascent || bbox.maxY) * this.scale;\n var yBottom = (descent || bbox.minY) * this.scale;\n var height = yTop - yBottom;\n if (!descender)\n height -= Math.abs(descent) || 0;\n return (height / 1000) * size;\n };\n CustomFontEmbedder.prototype.sizeOfFontAtHeight = function (height) {\n var _a = this.font, ascent = _a.ascent, descent = _a.descent, bbox = _a.bbox;\n var yTop = (ascent || bbox.maxY) * this.scale;\n var yBottom = (descent || bbox.minY) * this.scale;\n return (1000 * height) / (yTop - yBottom);\n };\n CustomFontEmbedder.prototype.embedIntoContext = function (context, ref) {\n this.baseFontName = this.customName || addRandomSuffix(this.fontName);\n return this.embedFontDict(context, ref);\n };\n CustomFontEmbedder.prototype.embedFontDict = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var cidFontDictRef, unicodeCMapRef, fontDict;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.embedCIDFontDict(context)];\n case 1:\n cidFontDictRef = _a.sent();\n unicodeCMapRef = this.embedUnicodeCmap(context);\n fontDict = context.obj({\n Type: 'Font',\n Subtype: 'Type0',\n BaseFont: this.baseFontName,\n Encoding: 'Identity-H',\n DescendantFonts: [cidFontDictRef],\n ToUnicode: unicodeCMapRef,\n });\n if (ref) {\n context.assign(ref, fontDict);\n return [2 /*return*/, ref];\n }\n else {\n return [2 /*return*/, context.register(fontDict)];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.isCFF = function () {\n return this.font.cff;\n };\n CustomFontEmbedder.prototype.embedCIDFontDict = function (context) {\n return __awaiter(this, void 0, void 0, function () {\n var fontDescriptorRef, cidFontDict;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.embedFontDescriptor(context)];\n case 1:\n fontDescriptorRef = _a.sent();\n cidFontDict = context.obj({\n Type: 'Font',\n Subtype: this.isCFF() ? 'CIDFontType0' : 'CIDFontType2',\n BaseFont: this.baseFontName,\n CIDSystemInfo: {\n Registry: PDFString.of('Adobe'),\n Ordering: PDFString.of('Identity'),\n Supplement: 0,\n },\n FontDescriptor: fontDescriptorRef,\n W: this.computeWidths(),\n });\n return [2 /*return*/, context.register(cidFontDict)];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.embedFontDescriptor = function (context) {\n return __awaiter(this, void 0, void 0, function () {\n var fontStreamRef, scale, _a, italicAngle, ascent, descent, capHeight, xHeight, _b, minX, minY, maxX, maxY, fontDescriptor;\n var _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0: return [4 /*yield*/, this.embedFontStream(context)];\n case 1:\n fontStreamRef = _d.sent();\n scale = this.scale;\n _a = this.font, italicAngle = _a.italicAngle, ascent = _a.ascent, descent = _a.descent, capHeight = _a.capHeight, xHeight = _a.xHeight;\n _b = this.font.bbox, minX = _b.minX, minY = _b.minY, maxX = _b.maxX, maxY = _b.maxY;\n fontDescriptor = context.obj((_c = {\n Type: 'FontDescriptor',\n FontName: this.baseFontName,\n Flags: deriveFontFlags(this.font),\n FontBBox: [minX * scale, minY * scale, maxX * scale, maxY * scale],\n ItalicAngle: italicAngle,\n Ascent: ascent * scale,\n Descent: descent * scale,\n CapHeight: (capHeight || ascent) * scale,\n XHeight: (xHeight || 0) * scale,\n // Not sure how to compute/find this, nor is anybody else really:\n // https://stackoverflow.com/questions/35485179/stemv-value-of-the-truetype-font\n StemV: 0\n },\n _c[this.isCFF() ? 'FontFile3' : 'FontFile2'] = fontStreamRef,\n _c));\n return [2 /*return*/, context.register(fontDescriptor)];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.serializeFont = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.fontData];\n });\n });\n };\n CustomFontEmbedder.prototype.embedFontStream = function (context) {\n return __awaiter(this, void 0, void 0, function () {\n var fontStream, _a, _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _b = (_a = context).flateStream;\n return [4 /*yield*/, this.serializeFont()];\n case 1:\n fontStream = _b.apply(_a, [_c.sent(), {\n Subtype: this.isCFF() ? 'CIDFontType0C' : undefined,\n }]);\n return [2 /*return*/, context.register(fontStream)];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.embedUnicodeCmap = function (context) {\n var cmap = createCmap(this.glyphCache.access(), this.glyphId.bind(this));\n var cmapStream = context.flateStream(cmap);\n return context.register(cmapStream);\n };\n CustomFontEmbedder.prototype.glyphId = function (glyph) {\n return glyph ? glyph.id : -1;\n };\n CustomFontEmbedder.prototype.computeWidths = function () {\n var glyphs = this.glyphCache.access();\n var widths = [];\n var currSection = [];\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var currGlyph = glyphs[idx];\n var prevGlyph = glyphs[idx - 1];\n var currGlyphId = this.glyphId(currGlyph);\n var prevGlyphId = this.glyphId(prevGlyph);\n if (idx === 0) {\n widths.push(currGlyphId);\n }\n else if (currGlyphId - prevGlyphId !== 1) {\n widths.push(currSection);\n widths.push(currGlyphId);\n currSection = [];\n }\n currSection.push(currGlyph.advanceWidth * this.scale);\n }\n widths.push(currSection);\n return widths;\n };\n return CustomFontEmbedder;\n}());\nexport default CustomFontEmbedder;\n//# sourceMappingURL=CustomFontEmbedder.js.map","// prettier-ignore\nvar makeFontFlags = function (options) {\n var flags = 0;\n var flipBit = function (bit) { flags |= (1 << (bit - 1)); };\n if (options.fixedPitch)\n flipBit(1);\n if (options.serif)\n flipBit(2);\n if (options.symbolic)\n flipBit(3);\n if (options.script)\n flipBit(4);\n if (options.nonsymbolic)\n flipBit(6);\n if (options.italic)\n flipBit(7);\n if (options.allCap)\n flipBit(17);\n if (options.smallCap)\n flipBit(18);\n if (options.forceBold)\n flipBit(19);\n return flags;\n};\n// From: https://github.com/foliojs/pdfkit/blob/83f5f7243172a017adcf6a7faa5547c55982c57b/lib/font/embedded.js#L123-L129\nexport var deriveFontFlags = function (font) {\n var familyClass = font['OS/2'] ? font['OS/2'].sFamilyClass : 0;\n var flags = makeFontFlags({\n fixedPitch: font.post.isFixedPitch,\n serif: 1 <= familyClass && familyClass <= 7,\n symbolic: true,\n script: familyClass === 10,\n italic: font.head.macStyle.italic,\n });\n return flags;\n};\n//# sourceMappingURL=FontFlags.js.map","import { __awaiter, __extends, __generator } from \"tslib\";\nimport CustomFontEmbedder from \"./CustomFontEmbedder\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport { Cache, mergeUint8Arrays, toHexStringOfMinLength } from \"../../utils\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/devongovett/pdfkit/blob/e71edab0dd4657b5a767804ba86c94c58d01fbca/lib/image/jpeg.coffee\n */\nvar CustomFontSubsetEmbedder = /** @class */ (function (_super) {\n __extends(CustomFontSubsetEmbedder, _super);\n function CustomFontSubsetEmbedder(font, fontData, customFontName) {\n var _this = _super.call(this, font, fontData, customFontName) || this;\n _this.subset = _this.font.createSubset();\n _this.glyphs = [];\n _this.glyphCache = Cache.populatedBy(function () { return _this.glyphs; });\n _this.glyphIdMap = new Map();\n return _this;\n }\n CustomFontSubsetEmbedder.for = function (fontkit, fontData, customFontName) {\n return __awaiter(this, void 0, void 0, function () {\n var font;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fontkit.create(fontData)];\n case 1:\n font = _a.sent();\n return [2 /*return*/, new CustomFontSubsetEmbedder(font, fontData, customFontName)];\n }\n });\n });\n };\n CustomFontSubsetEmbedder.prototype.encodeText = function (text) {\n var glyphs = this.font.layout(text).glyphs;\n var hexCodes = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var glyph = glyphs[idx];\n var subsetGlyphId = this.subset.includeGlyph(glyph);\n this.glyphs[subsetGlyphId - 1] = glyph;\n this.glyphIdMap.set(glyph.id, subsetGlyphId);\n hexCodes[idx] = toHexStringOfMinLength(subsetGlyphId, 4);\n }\n this.glyphCache.invalidate();\n return PDFHexString.of(hexCodes.join(''));\n };\n CustomFontSubsetEmbedder.prototype.isCFF = function () {\n return this.subset.cff;\n };\n CustomFontSubsetEmbedder.prototype.glyphId = function (glyph) {\n return glyph ? this.glyphIdMap.get(glyph.id) : -1;\n };\n CustomFontSubsetEmbedder.prototype.serializeFont = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var parts = [];\n _this.subset\n .encodeStream()\n .on('data', function (bytes) { return parts.push(bytes); })\n .on('end', function () { return resolve(mergeUint8Arrays(parts)); })\n .on('error', function (err) { return reject(err); });\n });\n };\n return CustomFontSubsetEmbedder;\n}(CustomFontEmbedder));\nexport default CustomFontSubsetEmbedder;\n//# sourceMappingURL=CustomFontSubsetEmbedder.js.map","import { __awaiter, __generator } from \"tslib\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFHexString from \"../objects/PDFHexString\";\nvar FileEmbedder = /** @class */ (function () {\n function FileEmbedder(fileData, fileName, options) {\n if (options === void 0) { options = {}; }\n this.fileData = fileData;\n this.fileName = fileName;\n this.options = options;\n }\n FileEmbedder.for = function (bytes, fileName, options) {\n if (options === void 0) { options = {}; }\n return new FileEmbedder(bytes, fileName, options);\n };\n FileEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, mimeType, description, creationDate, modificationDate, embeddedFileStream, embeddedFileStreamRef, fileSpecDict;\n return __generator(this, function (_b) {\n _a = this.options, mimeType = _a.mimeType, description = _a.description, creationDate = _a.creationDate, modificationDate = _a.modificationDate;\n embeddedFileStream = context.flateStream(this.fileData, {\n Type: 'EmbeddedFile',\n Subtype: mimeType !== null && mimeType !== void 0 ? mimeType : undefined,\n Params: {\n Size: this.fileData.length,\n CreationDate: creationDate\n ? PDFString.fromDate(creationDate)\n : undefined,\n ModDate: modificationDate\n ? PDFString.fromDate(modificationDate)\n : undefined,\n },\n });\n embeddedFileStreamRef = context.register(embeddedFileStream);\n fileSpecDict = context.obj({\n Type: 'Filespec',\n F: PDFString.of(this.fileName),\n UF: PDFHexString.fromText(this.fileName),\n EF: { F: embeddedFileStreamRef },\n Desc: description ? PDFHexString.fromText(description) : undefined,\n });\n if (ref) {\n context.assign(ref, fileSpecDict);\n return [2 /*return*/, ref];\n }\n else {\n return [2 /*return*/, context.register(fileSpecDict)];\n }\n return [2 /*return*/];\n });\n });\n };\n return FileEmbedder;\n}());\nexport default FileEmbedder;\n//# sourceMappingURL=FileEmbedder.js.map","'use strict';\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\nvar utils = require('../utils/common');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nvar extra_dbits = /* extra bits for each distance code */\n [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n var dist; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n}\n\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar trees = require('./trees');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\n//var Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\n//var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\n//var Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\n\n\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\n\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n// s.block_start >= s.w_size)) {\n// throw new Error(\"slide too late\");\n// }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0; /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n }\n else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n }\n else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n }\n else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n }\n else {\n s.status = BUSY_STATE;\n }\n }\n//#endif\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n status = strm.state.status;\n if (status !== INIT_STATE &&\n status !== EXTRA_STATE &&\n status !== NAME_STATE &&\n status !== COMMENT_STATE &&\n status !== HCRC_STATE &&\n status !== BUSY_STATE &&\n status !== FINISH_STATE\n ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\n\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","// String encode/decode helpers\n'use strict';\n\n\nvar utils = require('./common');\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new utils.Buf8(256);\nfor (var q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new utils.Buf8(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n\n var result = '';\n for (var i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n return buf2binstring(buf, buf.length);\n};\n\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n var buf = new utils.Buf8(str.length);\n for (var i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n};\n\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n var i, out, c, c_len;\n var len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","'use strict';\n\n\nvar zlib_deflate = require('./zlib/deflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\n\nvar toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nvar Z_NO_FLUSH = 0;\nvar Z_FINISH = 4;\n\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_SYNC_FLUSH = 2;\n\nvar Z_DEFAULT_COMPRESSION = -1;\n\nvar Z_DEFAULT_STRATEGY = 0;\n\nvar Z_DEFLATED = 8;\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n if (!(this instanceof Deflate)) return new Deflate(options);\n\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n var dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var status, _mode;\n\n if (this.ended) { return false; }\n\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_deflate.deflate(strm, _mode); /* no bad return value */\n\n if (status !== Z_STREAM_END && status !== Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n if (this.options.to === 'string') {\n this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n // Finalize on the last chunk.\n if (_mode === Z_FINISH) {\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === Z_SYNC_FLUSH) {\n this.onEnd(Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nexports.Deflate = Deflate;\nexports.deflate = deflate;\nexports.deflateRaw = deflateRaw;\nexports.gzip = gzip;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar inflate_fast = require('./inffast');\nvar inflate_table = require('./inftrees');\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n //Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar c = require('./zlib/constants');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar GZheader = require('./zlib/gzheader');\n\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n if (!(this instanceof Inflate)) return new Inflate(options);\n\n this.options = utils.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var dictionary = this.options.dictionary;\n var status, _mode;\n var next_out_utf8, tail, utf8str;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n var allowBufError = false;\n\n if (this.ended) { return false; }\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);\n }\n\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\n if (this.options.to === 'string') {\n\n next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n tail = strm.next_out - next_out_utf8;\n utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\n this.onData(utf8str);\n\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === c.Z_OK) {\n if (this.options.to === 'string') {\n // Glue & convert here, until we teach pako to send\n // utf8 aligned strings to onData\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n var inflator = new Inflate(options);\n\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip = inflate;\n","// Top level file is just a mixin of submodules & constants\n'use strict';\n\nvar assign = require('./lib/utils/common').assign;\n\nvar deflate = require('./lib/deflate');\nvar inflate = require('./lib/inflate');\nvar constants = require('./lib/zlib/constants');\n\nvar pako = {};\n\nassign(pako, deflate, inflate, constants);\n\nmodule.exports = pako;\n","import pako from 'pako';\n\nvar UPNG = {};\n\n\t\n\nUPNG.toRGBA8 = function(out)\n{\n\tvar w = out.width, h = out.height;\n\tif(out.tabs.acTL==null) return [UPNG.toRGBA8.decodeImage(out.data, w, h, out).buffer];\n\t\n\tvar frms = [];\n\tif(out.frames[0].data==null) out.frames[0].data = out.data;\n\t\n\tvar len = w*h*4, img = new Uint8Array(len), empty = new Uint8Array(len), prev=new Uint8Array(len);\n\tfor(var i=0; i>3)]>>(7-((i&7)<<0)))& 1), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>2)]>>(6-((i&3)<<1)))& 3), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>1)]>>(4-((i&1)<<2)))&15), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>>3)]>>>(7 -((x&7) )))& 1), al=(gr==tr*255)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\n\t\t\telse if(depth== 2) for(var x=0; x>>2)]>>>(6 -((x&3)<<1)))& 3), al=(gr==tr* 85)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\n\t\t\telse if(depth== 4) for(var x=0; x>>1)]>>>(4 -((x&1)<<2)))&15), al=(gr==tr* 17)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\n\t\t\telse if(depth== 8) for(var x=0; x>>2<<3);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\nvar D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\nw+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\nh=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\ncj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\nd=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\nif(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\nd+=Y&15;while(w>>4;\nif(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\nn+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\nwhile(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\nH.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\nH.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\nreturn{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\n(function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\nV=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\nN.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\nN.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\nH.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\nn(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\n\n\nUPNG.decode._readInterlace = function(data, out)\n{\n\tvar w = out.width, h = out.height;\n\tvar bpp = UPNG.decode._getBPP(out), cbpp = bpp>>3, bpl = Math.ceil(w*bpp/8);\n\tvar img = new Uint8Array( h * bpl );\n\tvar di = 0;\n\n\tvar starting_row = [ 0, 0, 4, 0, 2, 0, 1 ];\n\tvar starting_col = [ 0, 4, 0, 2, 0, 1, 0 ];\n\tvar row_increment = [ 8, 8, 8, 4, 4, 2, 2 ];\n\tvar col_increment = [ 8, 8, 4, 4, 2, 2, 1 ];\n\n\tvar pass=0;\n\twhile(pass<7)\n\t{\n\t\tvar ri = row_increment[pass], ci = col_increment[pass];\n\t\tvar sw = 0, sh = 0;\n\t\tvar cr = starting_row[pass]; while(cr>3]; val = (val>>(7-(cdi&7)))&1;\n\t\t\t\t\timg[row*bpl + (col>>3)] |= (val << (7-((col&7)<<0)));\n\t\t\t\t}\n\t\t\t\tif(bpp==2) {\n\t\t\t\t\tvar val = data[cdi>>3]; val = (val>>(6-(cdi&7)))&3;\n\t\t\t\t\timg[row*bpl + (col>>2)] |= (val << (6-((col&3)<<1)));\n\t\t\t\t}\n\t\t\t\tif(bpp==4) {\n\t\t\t\t\tvar val = data[cdi>>3]; val = (val>>(4-(cdi&7)))&15;\n\t\t\t\t\timg[row*bpl + (col>>1)] |= (val << (4-((col&1)<<2)));\n\t\t\t\t}\n\t\t\t\tif(bpp>=8) {\n\t\t\t\t\tvar ii = row*bpl+col*cbpp;\n\t\t\t\t\tfor(var j=0; j>3)+j];\n\t\t\t\t}\n\t\t\t\tcdi+=bpp; col+=ci;\n\t\t\t}\n\t\t\ty++; row += ri;\n\t\t}\n\t\tif(sw*sh!=0) di += sh * (1 + bpll);\n\t\tpass = pass + 1;\n\t}\n\treturn img;\n}\n\nUPNG.decode._getBPP = function(out) {\n\tvar noc = [1,null,3,1,2,null,4][out.ctype];\n\treturn noc * out.depth;\n}\n\nUPNG.decode._filterZero = function(data, out, off, w, h)\n{\n\tvar bpp = UPNG.decode._getBPP(out), bpl = Math.ceil(w*bpp/8), paeth = UPNG.decode._paeth;\n\tbpp = Math.ceil(bpp/8);\n\t\n\tvar i=0, di=1, type=data[off], x=0;\n\t\n\tif(type>1) data[off]=[0,0,1][type-2]; \n\tif(type==3) for(x=bpp; x>>1) )&255;\n\n\tfor(var y=0; y>>1));\n\t\t\t for(; x>>1) ); }\n\t\telse { for(; x>8)&255; buff[p+1] = n&255; },\n\treadUint : function(buff,p) { return (buff[p]*(256*256*256)) + ((buff[p+1]<<16) | (buff[p+2]<< 8) | buff[p+3]); },\n\twriteUint : function(buff,p,n){ buff[p]=(n>>24)&255; buff[p+1]=(n>>16)&255; buff[p+2]=(n>>8)&255; buff[p+3]=n&255; },\n\treadASCII : function(buff,p,l){ var s = \"\"; for(var i=0; i=0 && yoff>=0) { si = (y*sw+x)<<2; ti = (( yoff+y)*tw+xoff+x)<<2; }\n\t\t\telse { si = ((-yoff+y)*sw-xoff+x)<<2; ti = (y*tw+x)<<2; }\n\t\t\t\n\t\t\tif (mode==0) { tb[ti] = sb[si]; tb[ti+1] = sb[si+1]; tb[ti+2] = sb[si+2]; tb[ti+3] = sb[si+3]; }\n\t\t\telse if(mode==1) {\n\t\t\t\tvar fa = sb[si+3]*(1/255), fr=sb[si]*fa, fg=sb[si+1]*fa, fb=sb[si+2]*fa; \n\t\t\t\tvar ba = tb[ti+3]*(1/255), br=tb[ti]*ba, bg=tb[ti+1]*ba, bb=tb[ti+2]*ba; \n\t\t\t\t\n\t\t\t\tvar ifa=1-fa, oa = fa+ba*ifa, ioa = (oa==0?0:1/oa);\n\t\t\t\ttb[ti+3] = 255*oa; \n\t\t\t\ttb[ti+0] = (fr+br*ifa)*ioa; \n\t\t\t\ttb[ti+1] = (fg+bg*ifa)*ioa; \n\t\t\t\ttb[ti+2] = (fb+bb*ifa)*ioa; \n\t\t\t}\n\t\t\telse if(mode==2){\t// copy only differences, otherwise zero\n\t\t\t\tvar fa = sb[si+3], fr=sb[si], fg=sb[si+1], fb=sb[si+2]; \n\t\t\t\tvar ba = tb[ti+3], br=tb[ti], bg=tb[ti+1], bb=tb[ti+2]; \n\t\t\t\tif(fa==ba && fr==br && fg==bg && fb==bb) { tb[ti]=0; tb[ti+1]=0; tb[ti+2]=0; tb[ti+3]=0; }\n\t\t\t\telse { tb[ti]=fr; tb[ti+1]=fg; tb[ti+2]=fb; tb[ti+3]=fa; }\n\t\t\t}\n\t\t\telse if(mode==3){\t// check if can be blended\n\t\t\t\tvar fa = sb[si+3], fr=sb[si], fg=sb[si+1], fb=sb[si+2]; \n\t\t\t\tvar ba = tb[ti+3], br=tb[ti], bg=tb[ti+1], bb=tb[ti+2]; \n\t\t\t\tif(fa==ba && fr==br && fg==bg && fb==bb) continue;\n\t\t\t\t//if(fa!=255 && ba!=0) return false;\n\t\t\t\tif(fa<220 && ba>20) return false;\n\t\t\t}\n\t\t}\n\treturn true;\n}\n\n\n\n\nUPNG.encode = function(bufs, w, h, ps, dels, tabs, forbidPlte)\n{\n\tif(ps==null) ps=0;\n\tif(forbidPlte==null) forbidPlte = false;\n\n\tvar nimg = UPNG.encode.compress(bufs, w, h, ps, [false, false, false, 0, forbidPlte]);\n\tUPNG.encode.compressPNG(nimg, -1);\n\t\n\treturn UPNG.encode._main(nimg, w, h, dels, tabs);\n}\n\nUPNG.encodeLL = function(bufs, w, h, cc, ac, depth, dels, tabs) {\n\tvar nimg = { ctype: 0 + (cc==1 ? 0 : 2) + (ac==0 ? 0 : 4), depth: depth, frames: [] };\n\t\n\tvar time = Date.now();\n\tvar bipp = (cc+ac)*depth, bipl = bipp * w;\n\tfor(var i=0; i1, pltAlpha = false;\n\t\n\tvar leng = 8 + (16+5+4) /*+ (9+4)*/ + (anim ? 20 : 0);\n\tif(tabs[\"sRGB\"]!=null) leng += 8+1+4;\n\tif(tabs[\"pHYs\"]!=null) leng += 8+9+4;\n\tif(nimg.ctype==3) {\n\t\tvar dl = nimg.plte.length;\n\t\tfor(var i=0; i>>24)!=255) pltAlpha = true;\n\t\tleng += (8 + dl*3 + 4) + (pltAlpha ? (8 + dl*1 + 4) : 0);\n\t}\n\tfor(var j=0; j>>8)&255, b=(c>>>16)&255;\n\t\t\tdata[offset+ti+0]=r; data[offset+ti+1]=g; data[offset+ti+2]=b;\n\t\t}\n\t\toffset+=dl*3;\n\t\twUi(data,offset,crc(data,offset-dl*3-4,dl*3+4)); offset+=4; // crc\n\n\t\tif(pltAlpha) {\n\t\t\twUi(data,offset, dl); offset+=4;\n\t\t\twAs(data,offset,\"tRNS\"); offset+=4;\n\t\t\tfor(var i=0; i>>24)&255;\n\t\t\toffset+=dl;\n\t\t\twUi(data,offset,crc(data,offset-dl-4,dl+4)); offset+=4; // crc\n\t\t}\n\t}\n\t\n\tvar fi = 0;\n\tfor(var j=0; j>2, bln>>2));\n\t\t\tfor(var j=0; jnw && c==img32[i-nw]) ind[i]=ind[i-nw];\n\t\t\t\telse {\n\t\t\t\t\tvar cmc = cmap[c];\n\t\t\t\t\tif(cmc==null) { cmap[c]=cmc=plte.length; plte.push(c); if(plte.length>=300) break; }\n\t\t\t\t\tind[i]=cmc;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//console.log(\"make palette\", Date.now()-time); time = Date.now();\n\t}\n\t\n\tvar cc=plte.length; //console.log(\"colors:\",cc);\n\tif(cc<=256 && forbidPlte==false) {\n\t\tif(cc<= 2) depth=1; else if(cc<= 4) depth=2; else if(cc<=16) depth=4; else depth=8;\n\t\tdepth = Math.max(depth, minBits);\n\t}\n\t\n\tfor(var j=0; j>1)] |= (inj[ii+x]<<(4-(x&1)*4));\n\t\t\t\telse if(depth==2) for(var x=0; x>2)] |= (inj[ii+x]<<(6-(x&3)*2));\n\t\t\t\telse if(depth==1) for(var x=0; x>3)] |= (inj[ii+x]<<(7-(x&7)*1));\n\t\t\t}\n\t\t\tcimg=nimg; ctype=3; bpp=1;\n\t\t}\n\t\telse if(gotAlpha==false && frms.length==1) {\t// some next \"reduced\" frames may contain alpha for blending\n\t\t\tvar nimg = new Uint8Array(nw*nh*3), area=nw*nh;\n\t\t\tfor(var i=0; i palette indices\", Date.now()-time); time = Date.now();\n\t\n\treturn {ctype:ctype, depth:depth, plte:plte, frames:frms };\n}\nUPNG.encode.framize = function(bufs,w,h,alwaysBlend,evenCrd,forbidPrev) {\n\t/* DISPOSE\n\t - 0 : no change\n\t\t- 1 : clear to transparent\n\t\t- 2 : retstore to content before rendering (previous frame disposed)\n\t\tBLEND\n\t\t- 0 : replace\n\t\t- 1 : blend\n\t*/\n\tvar frms = [];\n\tfor(var j=0; jmax) max=x;\n\t\t\t\t\t\tif(ymay) may=y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(max==-1) mix=miy=max=may=0;\n\t\t\t\tif(evenCrd) { if((mix&1)==1)mix--; if((miy&1)==1)miy--; }\n\t\t\t\tvar sarea = (max-mix+1)*(may-miy+1);\n\t\t\t\tif(sareamax) max=cx;\n\t\t\tif(cymay) may=cy;\n\t\t}\n\t}\n\tif(max==-1) mix=miy=max=may=0;\n\tif(evenCrd) { if((mix&1)==1)mix--; if((miy&1)==1)miy--; }\n\tr = {x:mix, y:miy, width:max-mix+1, height:may-miy+1};\n\t\n\tvar fr = frms[i]; fr.rect = r; fr.blend = 1; fr.img = new Uint8Array(r.width*r.height*4);\n\tif(frms[i-1].dispose==0) {\n\t\tUPNG._copyTile(pimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 0);\n\t\tUPNG.encode._prepareDiff(cimg,w,h,fr.img,r);\n\t\t//UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 2);\n\t}\n\telse\n\t\tUPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 0);\n}\nUPNG.encode._prepareDiff = function(cimg, w,h, nimg, rec) {\n\tUPNG._copyTile(cimg,w,h, nimg,rec.width,rec.height, -rec.x,-rec.y, 2);\n\t/*\n\tvar n32 = new Uint32Array(nimg.buffer);\n\tvar og = new Uint8Array(rec.width*rec.height*4), o32 = new Uint32Array(og.buffer);\n\tUPNG._copyTile(cimg,w,h, og,rec.width,rec.height, -rec.x,-rec.y, 0);\n\tfor(var i=4; i>>2]==o32[(i>>>2)-1]) {\n\t\t\tn32[i>>>2]=o32[i>>>2];\n\t\t\t//var j = i, c=p32[(i>>>2)-1];\n\t\t\t//while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\n\t\t}\n\t}\n\tfor(var i=nimg.length-8; i>0; i-=4) {\n\t\tif(nimg[i+7]!=0 && nimg[i+3]==0 && o32[i>>>2]==o32[(i>>>2)+1]) {\n\t\t\tn32[i>>>2]=o32[i>>>2];\n\t\t\t//var j = i, c=p32[(i>>>2)-1];\n\t\t\t//while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\n\t\t}\n\t}*/\n}\n\nUPNG.encode._filterZero = function(img,h,bpp,bpl,data, filter, levelZero)\n{\n\tvar fls = [], ftry=[0,1,2,3,4];\n\tif (filter!=-1) ftry=[filter];\n\telse if(h*bpl>500000 || bpp==1) ftry=[0];\n\tvar opts; if(levelZero) opts={level:0};\n\t\n\tvar CMPR = (levelZero && UZIP!=null) ? UZIP : pako;\n\t\n\tfor(var i=0; i>1) +256)&255;\n\t\tif(type==4) for(var x=bpp; x>1))&255;\n\t\t\t\t\t for(var x=bpp; x>1))&255; }\n\t\tif(type==4) { for(var x= 0; x>> 1);\n\t\t\t\telse c = c >>> 1;\n\t\t\t}\n\t\t\ttab[n] = c; }\n\t\treturn tab; })(),\n\tupdate : function(c, buf, off, len) {\n\t\tfor (var i=0; i>> 8);\n\t\treturn c;\n\t},\n\tcrc : function(b,o,l) { return UPNG.crc.update(0xffffffff,b,o,l) ^ 0xffffffff; }\n}\n\n\nUPNG.quantize = function(abuf, ps)\n{\t\n\tvar oimg = new Uint8Array(abuf), nimg = oimg.slice(0), nimg32 = new Uint32Array(nimg.buffer);\n\t\n\tvar KD = UPNG.quantize.getKDtree(nimg, ps);\n\tvar root = KD[0], leafs = KD[1];\n\t\n\tvar planeDst = UPNG.quantize.planeDst;\n\tvar sb = oimg, tb = nimg32, len=sb.length;\n\t\t\n\tvar inds = new Uint8Array(oimg.length>>2);\n\tfor(var i=0; i>2] = nd.ind;\n\t\ttb[i>>2] = nd.est.rgba;\n\t}\n\treturn { abuf:nimg.buffer, inds:inds, plte:leafs };\n}\n\nUPNG.quantize.getKDtree = function(nimg, ps, err) {\n\tif(err==null) err = 0.0001;\n\tvar nimg32 = new Uint32Array(nimg.buffer);\n\t\n\tvar root = {i0:0, i1:nimg.length, bst:null, est:null, tdst:0, left:null, right:null }; // basic statistic, extra statistic\n\troot.bst = UPNG.quantize.stats( nimg,root.i0, root.i1 ); root.est = UPNG.quantize.estats( root.bst );\n\tvar leafs = [root];\n\t\n\twhile(leafs.length maxL) { maxL=leafs[i].est.L; mi=i; }\n\t\tif(maxL=s0 || node.i1<=s0);\n\t\t//console.log(maxL, leafs.length, mi);\n\t\tif(s0wrong) { node.est.L=0; continue; }\n\t\t\n\t\t\n\t\tvar ln = {i0:node.i0, i1:s0, bst:null, est:null, tdst:0, left:null, right:null }; ln.bst = UPNG.quantize.stats( nimg, ln.i0, ln.i1 ); \n\t\tln.est = UPNG.quantize.estats( ln.bst );\n\t\tvar rn = {i0:s0, i1:node.i1, bst:null, est:null, tdst:0, left:null, right:null }; rn.bst = {R:[], m:[], N:node.bst.N-ln.bst.N};\n\t\tfor(var i=0; i<16; i++) rn.bst.R[i] = node.bst.R[i]-ln.bst.R[i];\n\t\tfor(var i=0; i< 4; i++) rn.bst.m[i] = node.bst.m[i]-ln.bst.m[i];\n\t\trn.est = UPNG.quantize.estats( rn.bst );\n\t\t\n\t\tnode.left = ln; node.right = rn;\n\t\tleafs[mi]=ln; leafs.push(rn);\n\t}\n\tleafs.sort(function(a,b) { return b.bst.N-a.bst.N; });\n\tfor(var i=0; i0) { node0=nd.right; node1=nd.left; }\n\t\n\tvar ln = UPNG.quantize.getNearest(node0, r,g,b,a);\n\tif(ln.tdst<=planeDst*planeDst) return ln;\n\tvar rn = UPNG.quantize.getNearest(node1, r,g,b,a);\n\treturn rn.tdst eMq) i1-=4;\n\t\tif(i0>=i1) break;\n\t\t\n\t\tvar t = nimg32[i0>>2]; nimg32[i0>>2] = nimg32[i1>>2]; nimg32[i1>>2]=t;\n\t\t\n\t\ti0+=4; i1-=4;\n\t}\n\twhile(vecDot(nimg, i0, e)>eMq) i0-=4;\n\treturn i0+4;\n}\nUPNG.quantize.vecDot = function(nimg, i, e)\n{\n\treturn nimg[i]*e[0] + nimg[i+1]*e[1] + nimg[i+2]*e[2] + nimg[i+3]*e[3];\n}\nUPNG.quantize.stats = function(nimg, i0, i1){\n\tvar R = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0];\n\tvar m = [0,0,0,0];\n\tvar N = (i1-i0)>>2;\n\tfor(var i=i0; i>>0) };\n}\nUPNG.M4 = {\n\tmultVec : function(m,v) {\n\t\t\treturn [\n\t\t\t\tm[ 0]*v[0] + m[ 1]*v[1] + m[ 2]*v[2] + m[ 3]*v[3],\n\t\t\t\tm[ 4]*v[0] + m[ 5]*v[1] + m[ 6]*v[2] + m[ 7]*v[3],\n\t\t\t\tm[ 8]*v[0] + m[ 9]*v[1] + m[10]*v[2] + m[11]*v[3],\n\t\t\t\tm[12]*v[0] + m[13]*v[1] + m[14]*v[2] + m[15]*v[3]\n\t\t\t];\n\t},\n\tdot : function(x,y) { return x[0]*y[0]+x[1]*y[1]+x[2]*y[2]+x[3]*y[3]; },\n\tsml : function(a,y) { return [a*y[0],a*y[1],a*y[2],a*y[3]]; }\n}\n\nUPNG.encode.concatRGBA = function(bufs) {\n\tvar tlen = 0;\n\tfor(var i=0; i 1)\n throw new Error(\"Animated PNGs are not supported\");\n var frame = new Uint8Array(frames[0]);\n var _a = splitAlphaChannel(frame), rgbChannel = _a.rgbChannel, alphaChannel = _a.alphaChannel;\n this.rgbChannel = rgbChannel;\n var hasAlphaValues = alphaChannel.some(function (a) { return a < 255; });\n if (hasAlphaValues)\n this.alphaChannel = alphaChannel;\n this.type = getImageType(upng.ctype);\n this.width = upng.width;\n this.height = upng.height;\n this.bitsPerComponent = 8;\n }\n PNG.load = function (pngData) { return new PNG(pngData); };\n return PNG;\n}());\nexport { PNG };\n//# sourceMappingURL=png.js.map","var flag = function (bitIndex) { return 1 << bitIndex; };\n/** From PDF spec table 221 */\nexport var AcroFieldFlags;\n(function (AcroFieldFlags) {\n /**\n * If set, the user may not change the value of the field. Any associated\n * widget annotations will not interact with the user; that is, they will not\n * respond to mouse clicks or change their appearance in response to mouse\n * motions. This flag is useful for fields whose values are computed or\n * imported from a database.\n */\n AcroFieldFlags[AcroFieldFlags[\"ReadOnly\"] = flag(1 - 1)] = \"ReadOnly\";\n /**\n * If set, the field shall have a value at the time it is exported by a\n * submit-form action (see 12.7.5.2, \"Submit-Form Action\").\n */\n AcroFieldFlags[AcroFieldFlags[\"Required\"] = flag(2 - 1)] = \"Required\";\n /**\n * If set, the field shall not be exported by a submit-form action\n * (see 12.7.5.2, \"Submit-Form Action\").\n */\n AcroFieldFlags[AcroFieldFlags[\"NoExport\"] = flag(3 - 1)] = \"NoExport\";\n})(AcroFieldFlags || (AcroFieldFlags = {}));\n/** From PDF spec table 226 */\nexport var AcroButtonFlags;\n(function (AcroButtonFlags) {\n /**\n * (Radio buttons only) If set, exactly one radio button shall be selected at\n * all times; selecting the currently selected button has no effect. If clear,\n * clicking the selected button deselects it, leaving no button selected.\n */\n AcroButtonFlags[AcroButtonFlags[\"NoToggleToOff\"] = flag(15 - 1)] = \"NoToggleToOff\";\n /**\n * If set, the field is a set of radio buttons; if clear, the field is a check\n * box. This flag may be set only if the Pushbutton flag is clear.\n */\n AcroButtonFlags[AcroButtonFlags[\"Radio\"] = flag(16 - 1)] = \"Radio\";\n /**\n * If set, the field is a pushbutton that does not retain a permanent value.\n */\n AcroButtonFlags[AcroButtonFlags[\"PushButton\"] = flag(17 - 1)] = \"PushButton\";\n /**\n * If set, a group of radio buttons within a radio button field that use the\n * same value for the on state will turn on and off in unison; that is if one\n * is checked, they are all checked. If clear, the buttons are mutually\n * exclusive (the same behavior as HTML radio buttons).\n */\n AcroButtonFlags[AcroButtonFlags[\"RadiosInUnison\"] = flag(26 - 1)] = \"RadiosInUnison\";\n})(AcroButtonFlags || (AcroButtonFlags = {}));\n/** From PDF spec table 228 */\nexport var AcroTextFlags;\n(function (AcroTextFlags) {\n /**\n * If set, the field may contain multiple lines of text; if clear, the field's\n * text shall be restricted to a single line.\n */\n AcroTextFlags[AcroTextFlags[\"Multiline\"] = flag(13 - 1)] = \"Multiline\";\n /**\n * If set, the field is intended for entering a secure password that should\n * not be echoed visibly to the screen. Characters typed from the keyboard\n * shall instead be echoed in some unreadable form, such as asterisks or\n * bullet characters.\n * > NOTE To protect password confidentiality, readers should never store\n * > the value of the text field in the PDF file if this flag is set.\n */\n AcroTextFlags[AcroTextFlags[\"Password\"] = flag(14 - 1)] = \"Password\";\n /**\n * If set, the text entered in the field represents the pathname of a file\n * whose contents shall be submitted as the value of the field.\n */\n AcroTextFlags[AcroTextFlags[\"FileSelect\"] = flag(21 - 1)] = \"FileSelect\";\n /**\n * If set, text entered in the field shall not be spell-checked.\n */\n AcroTextFlags[AcroTextFlags[\"DoNotSpellCheck\"] = flag(23 - 1)] = \"DoNotSpellCheck\";\n /**\n * If set, the field shall not scroll (horizontally for single-line fields,\n * vertically for multiple-line fields) to accommodate more text than fits\n * within its annotation rectangle. Once the field is full, no further text\n * shall be accepted for interactive form filling; for non-interactive form\n * filling, the filler should take care not to add more character than will\n * visibly fit in the defined area.\n */\n AcroTextFlags[AcroTextFlags[\"DoNotScroll\"] = flag(24 - 1)] = \"DoNotScroll\";\n /**\n * May be set only if the MaxLen entry is present in the text field dictionary\n * (see Table 229) and if the Multiline, Password, and FileSelect flags are\n * clear. If set, the field shall be automatically divided into as many\n * equally spaced positions, or combs, as the value of MaxLen, and the text\n * is laid out into those combs.\n */\n AcroTextFlags[AcroTextFlags[\"Comb\"] = flag(25 - 1)] = \"Comb\";\n /**\n * If set, the value of this field shall be a rich text string\n * (see 12.7.3.4, \"Rich Text Strings\"). If the field has a value, the RV\n * entry of the field dictionary (Table 222) shall specify the rich text\n * string.\n */\n AcroTextFlags[AcroTextFlags[\"RichText\"] = flag(26 - 1)] = \"RichText\";\n})(AcroTextFlags || (AcroTextFlags = {}));\n/** From PDF spec table 230 */\nexport var AcroChoiceFlags;\n(function (AcroChoiceFlags) {\n /**\n * If set, the field is a combo box; if clear, the field is a list box.\n */\n AcroChoiceFlags[AcroChoiceFlags[\"Combo\"] = flag(18 - 1)] = \"Combo\";\n /**\n * If set, the combo box shall include an editable text box as well as a\n * drop-down list; if clear, it shall include only a drop-down list. This\n * flag shall be used only if the Combo flag is set.\n */\n AcroChoiceFlags[AcroChoiceFlags[\"Edit\"] = flag(19 - 1)] = \"Edit\";\n /**\n * If set, the field's option items shall be sorted alphabetically. This flag\n * is intended for use by writers, not by readers. Conforming readers shall\n * display the options in the order in which they occur in the Opt array\n * (see Table 231).\n */\n AcroChoiceFlags[AcroChoiceFlags[\"Sort\"] = flag(20 - 1)] = \"Sort\";\n /**\n * If set, more than one of the field's option items may be selected\n * simultaneously; if clear, at most one item shall be selected.\n */\n AcroChoiceFlags[AcroChoiceFlags[\"MultiSelect\"] = flag(22 - 1)] = \"MultiSelect\";\n /**\n * If set, text entered in the field shall not be spell-checked. This flag\n * shall not be used unless the Combo and Edit flags are both set.\n */\n AcroChoiceFlags[AcroChoiceFlags[\"DoNotSpellCheck\"] = flag(23 - 1)] = \"DoNotSpellCheck\";\n /**\n * If set, the new value shall be committed as soon as a selection is made\n * (commonly with the pointing device). In this case, supplying a value for\n * a field involves three actions: selecting the field for fill-in,\n * selecting a choice for the fill-in value, and leaving that field, which\n * finalizes or \"commits\" the data choice and triggers any actions associated\n * with the entry or changing of this data. If this flag is on, then\n * processing does not wait for leaving the field action to occur, but\n * immediately proceeds to the third step.\n *\n * This option enables applications to perform an action once a selection is\n * made, without requiring the user to exit the field. If clear, the new\n * value is not committed until the user exits the field.\n */\n AcroChoiceFlags[AcroChoiceFlags[\"CommitOnSelChange\"] = flag(27 - 1)] = \"CommitOnSelChange\";\n})(AcroChoiceFlags || (AcroChoiceFlags = {}));\n//# sourceMappingURL=flags.js.map","import { __awaiter, __generator } from \"tslib\";\nimport { PNG } from \"../../utils/png\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/devongovett/pdfkit/blob/e71edab0dd4657b5a767804ba86c94c58d01fbca/lib/image/png.coffee\n */\nvar PngEmbedder = /** @class */ (function () {\n function PngEmbedder(png) {\n this.image = png;\n this.bitsPerComponent = png.bitsPerComponent;\n this.width = png.width;\n this.height = png.height;\n this.colorSpace = 'DeviceRGB';\n }\n PngEmbedder.for = function (imageData) {\n return __awaiter(this, void 0, void 0, function () {\n var png;\n return __generator(this, function (_a) {\n png = PNG.load(imageData);\n return [2 /*return*/, new PngEmbedder(png)];\n });\n });\n };\n PngEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var SMask, xObject;\n return __generator(this, function (_a) {\n SMask = this.embedAlphaChannel(context);\n xObject = context.flateStream(this.image.rgbChannel, {\n Type: 'XObject',\n Subtype: 'Image',\n BitsPerComponent: this.image.bitsPerComponent,\n Width: this.image.width,\n Height: this.image.height,\n ColorSpace: this.colorSpace,\n SMask: SMask,\n });\n if (ref) {\n context.assign(ref, xObject);\n return [2 /*return*/, ref];\n }\n else {\n return [2 /*return*/, context.register(xObject)];\n }\n return [2 /*return*/];\n });\n });\n };\n PngEmbedder.prototype.embedAlphaChannel = function (context) {\n if (!this.image.alphaChannel)\n return undefined;\n var xObject = context.flateStream(this.image.alphaChannel, {\n Type: 'XObject',\n Subtype: 'Image',\n Height: this.image.height,\n Width: this.image.width,\n BitsPerComponent: this.image.bitsPerComponent,\n ColorSpace: 'DeviceGray',\n Decode: [0, 1],\n });\n return context.register(xObject);\n };\n return PngEmbedder;\n}());\nexport default PngEmbedder;\n//# sourceMappingURL=PngEmbedder.js.map","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The Stream class contained in this file is a TypeScript port of the\n * JavaScript Stream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nvar Stream = /** @class */ (function () {\n function Stream(buffer, start, length) {\n this.bytes = buffer;\n this.start = start || 0;\n this.pos = this.start;\n this.end = !!start && !!length ? start + length : this.bytes.length;\n }\n Object.defineProperty(Stream.prototype, \"length\", {\n get: function () {\n return this.end - this.start;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Stream.prototype, \"isEmpty\", {\n get: function () {\n return this.length === 0;\n },\n enumerable: false,\n configurable: true\n });\n Stream.prototype.getByte = function () {\n if (this.pos >= this.end) {\n return -1;\n }\n return this.bytes[this.pos++];\n };\n Stream.prototype.getUint16 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n if (b0 === -1 || b1 === -1) {\n return -1;\n }\n return (b0 << 8) + b1;\n };\n Stream.prototype.getInt32 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n var b2 = this.getByte();\n var b3 = this.getByte();\n return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;\n };\n // Returns subarray of original buffer, should only be read.\n Stream.prototype.getBytes = function (length, forceClamped) {\n if (forceClamped === void 0) { forceClamped = false; }\n var bytes = this.bytes;\n var pos = this.pos;\n var strEnd = this.end;\n if (!length) {\n var subarray = bytes.subarray(pos, strEnd);\n // `this.bytes` is always a `Uint8Array` here.\n return forceClamped ? new Uint8ClampedArray(subarray) : subarray;\n }\n else {\n var end = pos + length;\n if (end > strEnd) {\n end = strEnd;\n }\n this.pos = end;\n var subarray = bytes.subarray(pos, end);\n // `this.bytes` is always a `Uint8Array` here.\n return forceClamped ? new Uint8ClampedArray(subarray) : subarray;\n }\n };\n Stream.prototype.peekByte = function () {\n var peekedByte = this.getByte();\n this.pos--;\n return peekedByte;\n };\n Stream.prototype.peekBytes = function (length, forceClamped) {\n if (forceClamped === void 0) { forceClamped = false; }\n var bytes = this.getBytes(length, forceClamped);\n this.pos -= bytes.length;\n return bytes;\n };\n Stream.prototype.skip = function (n) {\n if (!n) {\n n = 1;\n }\n this.pos += n;\n };\n Stream.prototype.reset = function () {\n this.pos = this.start;\n };\n Stream.prototype.moveStart = function () {\n this.start = this.pos;\n };\n Stream.prototype.makeSubStream = function (start, length) {\n return new Stream(this.bytes, start, length);\n };\n Stream.prototype.decode = function () {\n return this.bytes;\n };\n return Stream;\n}());\nexport default Stream;\n//# sourceMappingURL=Stream.js.map","import { MethodNotImplementedError } from \"../errors\";\nimport Stream from \"./Stream\";\n/*\n * Copyright 2012 Mozilla Foundation\n *\n * The DecodeStream class contained in this file is a TypeScript port of the\n * JavaScript DecodeStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\n// Lots of DecodeStreams are created whose buffers are never used. For these\n// we share a single empty buffer. This is (a) space-efficient and (b) avoids\n// having special cases that would be required if we used |null| for an empty\n// buffer.\nvar emptyBuffer = new Uint8Array(0);\n/**\n * Super class for the decoding streams\n */\nvar DecodeStream = /** @class */ (function () {\n function DecodeStream(maybeMinBufferLength) {\n this.pos = 0;\n this.bufferLength = 0;\n this.eof = false;\n this.buffer = emptyBuffer;\n this.minBufferLength = 512;\n if (maybeMinBufferLength) {\n // Compute the first power of two that is as big as maybeMinBufferLength.\n while (this.minBufferLength < maybeMinBufferLength) {\n this.minBufferLength *= 2;\n }\n }\n }\n Object.defineProperty(DecodeStream.prototype, \"isEmpty\", {\n get: function () {\n while (!this.eof && this.bufferLength === 0) {\n this.readBlock();\n }\n return this.bufferLength === 0;\n },\n enumerable: false,\n configurable: true\n });\n DecodeStream.prototype.getByte = function () {\n var pos = this.pos;\n while (this.bufferLength <= pos) {\n if (this.eof) {\n return -1;\n }\n this.readBlock();\n }\n return this.buffer[this.pos++];\n };\n DecodeStream.prototype.getUint16 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n if (b0 === -1 || b1 === -1) {\n return -1;\n }\n return (b0 << 8) + b1;\n };\n DecodeStream.prototype.getInt32 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n var b2 = this.getByte();\n var b3 = this.getByte();\n return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;\n };\n DecodeStream.prototype.getBytes = function (length, forceClamped) {\n if (forceClamped === void 0) { forceClamped = false; }\n var end;\n var pos = this.pos;\n if (length) {\n this.ensureBuffer(pos + length);\n end = pos + length;\n while (!this.eof && this.bufferLength < end) {\n this.readBlock();\n }\n var bufEnd = this.bufferLength;\n if (end > bufEnd) {\n end = bufEnd;\n }\n }\n else {\n while (!this.eof) {\n this.readBlock();\n }\n end = this.bufferLength;\n }\n this.pos = end;\n var subarray = this.buffer.subarray(pos, end);\n // `this.buffer` is either a `Uint8Array` or `Uint8ClampedArray` here.\n return forceClamped && !(subarray instanceof Uint8ClampedArray)\n ? new Uint8ClampedArray(subarray)\n : subarray;\n };\n DecodeStream.prototype.peekByte = function () {\n var peekedByte = this.getByte();\n this.pos--;\n return peekedByte;\n };\n DecodeStream.prototype.peekBytes = function (length, forceClamped) {\n if (forceClamped === void 0) { forceClamped = false; }\n var bytes = this.getBytes(length, forceClamped);\n this.pos -= bytes.length;\n return bytes;\n };\n DecodeStream.prototype.skip = function (n) {\n if (!n) {\n n = 1;\n }\n this.pos += n;\n };\n DecodeStream.prototype.reset = function () {\n this.pos = 0;\n };\n DecodeStream.prototype.makeSubStream = function (start, length /* dict */) {\n var end = start + length;\n while (this.bufferLength <= end && !this.eof) {\n this.readBlock();\n }\n return new Stream(this.buffer, start, length /* dict */);\n };\n DecodeStream.prototype.decode = function () {\n while (!this.eof)\n this.readBlock();\n return this.buffer.subarray(0, this.bufferLength);\n };\n DecodeStream.prototype.readBlock = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'readBlock');\n };\n DecodeStream.prototype.ensureBuffer = function (requested) {\n var buffer = this.buffer;\n if (requested <= buffer.byteLength) {\n return buffer;\n }\n var size = this.minBufferLength;\n while (size < requested) {\n size *= 2;\n }\n var buffer2 = new Uint8Array(size);\n buffer2.set(buffer);\n return (this.buffer = buffer2);\n };\n return DecodeStream;\n}());\nexport default DecodeStream;\n//# sourceMappingURL=DecodeStream.js.map","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The Ascii85Stream class contained in this file is a TypeScript port of the\n * JavaScript Ascii85Stream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar isSpace = function (ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a;\n};\nvar Ascii85Stream = /** @class */ (function (_super) {\n __extends(Ascii85Stream, _super);\n function Ascii85Stream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n _this.input = new Uint8Array(5);\n // Most streams increase in size when decoded, but Ascii85 streams\n // typically shrink by ~20%.\n if (maybeLength) {\n maybeLength = 0.8 * maybeLength;\n }\n return _this;\n }\n Ascii85Stream.prototype.readBlock = function () {\n var TILDA_CHAR = 0x7e; // '~'\n var Z_LOWER_CHAR = 0x7a; // 'z'\n var EOF = -1;\n var stream = this.stream;\n var c = stream.getByte();\n while (isSpace(c)) {\n c = stream.getByte();\n }\n if (c === EOF || c === TILDA_CHAR) {\n this.eof = true;\n return;\n }\n var bufferLength = this.bufferLength;\n var buffer;\n var i;\n // special code for z\n if (c === Z_LOWER_CHAR) {\n buffer = this.ensureBuffer(bufferLength + 4);\n for (i = 0; i < 4; ++i) {\n buffer[bufferLength + i] = 0;\n }\n this.bufferLength += 4;\n }\n else {\n var input = this.input;\n input[0] = c;\n for (i = 1; i < 5; ++i) {\n c = stream.getByte();\n while (isSpace(c)) {\n c = stream.getByte();\n }\n input[i] = c;\n if (c === EOF || c === TILDA_CHAR) {\n break;\n }\n }\n buffer = this.ensureBuffer(bufferLength + i - 1);\n this.bufferLength += i - 1;\n // partial ending;\n if (i < 5) {\n for (; i < 5; ++i) {\n input[i] = 0x21 + 84;\n }\n this.eof = true;\n }\n var t = 0;\n for (i = 0; i < 5; ++i) {\n t = t * 85 + (input[i] - 0x21);\n }\n for (i = 3; i >= 0; --i) {\n buffer[bufferLength + i] = t & 0xff;\n t >>= 8;\n }\n }\n };\n return Ascii85Stream;\n}(DecodeStream));\nexport default Ascii85Stream;\n//# sourceMappingURL=Ascii85Stream.js.map","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The AsciiHexStream class contained in this file is a TypeScript port of the\n * JavaScript AsciiHexStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar AsciiHexStream = /** @class */ (function (_super) {\n __extends(AsciiHexStream, _super);\n function AsciiHexStream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n _this.firstDigit = -1;\n // Most streams increase in size when decoded, but AsciiHex streams shrink\n // by 50%.\n if (maybeLength) {\n maybeLength = 0.5 * maybeLength;\n }\n return _this;\n }\n AsciiHexStream.prototype.readBlock = function () {\n var UPSTREAM_BLOCK_SIZE = 8000;\n var bytes = this.stream.getBytes(UPSTREAM_BLOCK_SIZE);\n if (!bytes.length) {\n this.eof = true;\n return;\n }\n var maxDecodeLength = (bytes.length + 1) >> 1;\n var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength);\n var bufferLength = this.bufferLength;\n var firstDigit = this.firstDigit;\n for (var i = 0, ii = bytes.length; i < ii; i++) {\n var ch = bytes[i];\n var digit = void 0;\n if (ch >= 0x30 && ch <= 0x39) {\n // '0'-'9'\n digit = ch & 0x0f;\n }\n else if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) {\n // 'A'-'Z', 'a'-'z'\n digit = (ch & 0x0f) + 9;\n }\n else if (ch === 0x3e) {\n // '>'\n this.eof = true;\n break;\n }\n else {\n // probably whitespace\n continue; // ignoring\n }\n if (firstDigit < 0) {\n firstDigit = digit;\n }\n else {\n buffer[bufferLength++] = (firstDigit << 4) | digit;\n firstDigit = -1;\n }\n }\n if (firstDigit >= 0 && this.eof) {\n // incomplete byte\n buffer[bufferLength++] = firstDigit << 4;\n firstDigit = -1;\n }\n this.firstDigit = firstDigit;\n this.bufferLength = bufferLength;\n };\n return AsciiHexStream;\n}(DecodeStream));\nexport default AsciiHexStream;\n//# sourceMappingURL=AsciiHexStream.js.map","/*\n * Copyright 1996-2003 Glyph & Cog, LLC\n *\n * The flate stream implementation contained in this file is a JavaScript port\n * of XPDF's implementation, made available under the Apache 2.0 open source\n * license.\n */\nimport { __extends } from \"tslib\";\n/*\n * Copyright 2012 Mozilla Foundation\n *\n * The FlateStream class contained in this file is a TypeScript port of the\n * JavaScript FlateStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\n/* tslint:disable no-conditional-assignment */\nimport DecodeStream from \"./DecodeStream\";\n// prettier-ignore\nvar codeLenCodeMap = new Int32Array([\n 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15\n]);\n// prettier-ignore\nvar lengthDecode = new Int32Array([\n 0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a,\n 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f,\n 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073,\n 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102\n]);\n// prettier-ignore\nvar distDecode = new Int32Array([\n 0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d,\n 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1,\n 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01,\n 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001\n]);\n// prettier-ignore\nvar fixedLitCodeTab = [new Int32Array([\n 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0,\n 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0,\n 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0,\n 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0,\n 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8,\n 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8,\n 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8,\n 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8,\n 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4,\n 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4,\n 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4,\n 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4,\n 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc,\n 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec,\n 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc,\n 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc,\n 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2,\n 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2,\n 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2,\n 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2,\n 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca,\n 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea,\n 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da,\n 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa,\n 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6,\n 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6,\n 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6,\n 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6,\n 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce,\n 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee,\n 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de,\n 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe,\n 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1,\n 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1,\n 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1,\n 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1,\n 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9,\n 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9,\n 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9,\n 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9,\n 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5,\n 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5,\n 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5,\n 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5,\n 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd,\n 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed,\n 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd,\n 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd,\n 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3,\n 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3,\n 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3,\n 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3,\n 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb,\n 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb,\n 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db,\n 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb,\n 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7,\n 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7,\n 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7,\n 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7,\n 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf,\n 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef,\n 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df,\n 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff\n ]), 9];\n// prettier-ignore\nvar fixedDistCodeTab = [new Int32Array([\n 0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c,\n 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000,\n 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d,\n 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000\n ]), 5];\nvar FlateStream = /** @class */ (function (_super) {\n __extends(FlateStream, _super);\n function FlateStream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n var cmf = stream.getByte();\n var flg = stream.getByte();\n if (cmf === -1 || flg === -1) {\n throw new Error(\"Invalid header in flate stream: \" + cmf + \", \" + flg);\n }\n if ((cmf & 0x0f) !== 0x08) {\n throw new Error(\"Unknown compression method in flate stream: \" + cmf + \", \" + flg);\n }\n if (((cmf << 8) + flg) % 31 !== 0) {\n throw new Error(\"Bad FCHECK in flate stream: \" + cmf + \", \" + flg);\n }\n if (flg & 0x20) {\n throw new Error(\"FDICT bit set in flate stream: \" + cmf + \", \" + flg);\n }\n _this.codeSize = 0;\n _this.codeBuf = 0;\n return _this;\n }\n FlateStream.prototype.readBlock = function () {\n var buffer;\n var len;\n var str = this.stream;\n // read block header\n var hdr = this.getBits(3);\n if (hdr & 1) {\n this.eof = true;\n }\n hdr >>= 1;\n if (hdr === 0) {\n // uncompressed block\n var b = void 0;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n var blockLen = b;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n blockLen |= b << 8;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n var check = b;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n check |= b << 8;\n if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) {\n // Ignoring error for bad \"empty\" block (see issue 1277)\n throw new Error('Bad uncompressed block length in flate stream');\n }\n this.codeBuf = 0;\n this.codeSize = 0;\n var bufferLength = this.bufferLength;\n buffer = this.ensureBuffer(bufferLength + blockLen);\n var end = bufferLength + blockLen;\n this.bufferLength = end;\n if (blockLen === 0) {\n if (str.peekByte() === -1) {\n this.eof = true;\n }\n }\n else {\n for (var n = bufferLength; n < end; ++n) {\n if ((b = str.getByte()) === -1) {\n this.eof = true;\n break;\n }\n buffer[n] = b;\n }\n }\n return;\n }\n var litCodeTable;\n var distCodeTable;\n if (hdr === 1) {\n // compressed block, fixed codes\n litCodeTable = fixedLitCodeTab;\n distCodeTable = fixedDistCodeTab;\n }\n else if (hdr === 2) {\n // compressed block, dynamic codes\n var numLitCodes = this.getBits(5) + 257;\n var numDistCodes = this.getBits(5) + 1;\n var numCodeLenCodes = this.getBits(4) + 4;\n // build the code lengths code table\n var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length);\n var i = void 0;\n for (i = 0; i < numCodeLenCodes; ++i) {\n codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3);\n }\n var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths);\n // build the literal and distance code tables\n len = 0;\n i = 0;\n var codes = numLitCodes + numDistCodes;\n var codeLengths = new Uint8Array(codes);\n var bitsLength = void 0;\n var bitsOffset = void 0;\n var what = void 0;\n while (i < codes) {\n var code = this.getCode(codeLenCodeTab);\n if (code === 16) {\n bitsLength = 2;\n bitsOffset = 3;\n what = len;\n }\n else if (code === 17) {\n bitsLength = 3;\n bitsOffset = 3;\n what = len = 0;\n }\n else if (code === 18) {\n bitsLength = 7;\n bitsOffset = 11;\n what = len = 0;\n }\n else {\n codeLengths[i++] = len = code;\n continue;\n }\n var repeatLength = this.getBits(bitsLength) + bitsOffset;\n while (repeatLength-- > 0) {\n codeLengths[i++] = what;\n }\n }\n litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes));\n distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes));\n }\n else {\n throw new Error('Unknown block type in flate stream');\n }\n buffer = this.buffer;\n var limit = buffer ? buffer.length : 0;\n var pos = this.bufferLength;\n while (true) {\n var code1 = this.getCode(litCodeTable);\n if (code1 < 256) {\n if (pos + 1 >= limit) {\n buffer = this.ensureBuffer(pos + 1);\n limit = buffer.length;\n }\n buffer[pos++] = code1;\n continue;\n }\n if (code1 === 256) {\n this.bufferLength = pos;\n return;\n }\n code1 -= 257;\n code1 = lengthDecode[code1];\n var code2 = code1 >> 16;\n if (code2 > 0) {\n code2 = this.getBits(code2);\n }\n len = (code1 & 0xffff) + code2;\n code1 = this.getCode(distCodeTable);\n code1 = distDecode[code1];\n code2 = code1 >> 16;\n if (code2 > 0) {\n code2 = this.getBits(code2);\n }\n var dist = (code1 & 0xffff) + code2;\n if (pos + len >= limit) {\n buffer = this.ensureBuffer(pos + len);\n limit = buffer.length;\n }\n for (var k = 0; k < len; ++k, ++pos) {\n buffer[pos] = buffer[pos - dist];\n }\n }\n };\n FlateStream.prototype.getBits = function (bits) {\n var str = this.stream;\n var codeSize = this.codeSize;\n var codeBuf = this.codeBuf;\n var b;\n while (codeSize < bits) {\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad encoding in flate stream');\n }\n codeBuf |= b << codeSize;\n codeSize += 8;\n }\n b = codeBuf & ((1 << bits) - 1);\n this.codeBuf = codeBuf >> bits;\n this.codeSize = codeSize -= bits;\n return b;\n };\n FlateStream.prototype.getCode = function (table) {\n var str = this.stream;\n var codes = table[0];\n var maxLen = table[1];\n var codeSize = this.codeSize;\n var codeBuf = this.codeBuf;\n var b;\n while (codeSize < maxLen) {\n if ((b = str.getByte()) === -1) {\n // premature end of stream. code might however still be valid.\n // codeSize < codeLen check below guards against incomplete codeVal.\n break;\n }\n codeBuf |= b << codeSize;\n codeSize += 8;\n }\n var code = codes[codeBuf & ((1 << maxLen) - 1)];\n if (typeof codes === 'number') {\n console.log('FLATE:', code);\n }\n var codeLen = code >> 16;\n var codeVal = code & 0xffff;\n if (codeLen < 1 || codeSize < codeLen) {\n throw new Error('Bad encoding in flate stream');\n }\n this.codeBuf = codeBuf >> codeLen;\n this.codeSize = codeSize - codeLen;\n return codeVal;\n };\n FlateStream.prototype.generateHuffmanTable = function (lengths) {\n var n = lengths.length;\n // find max code length\n var maxLen = 0;\n var i;\n for (i = 0; i < n; ++i) {\n if (lengths[i] > maxLen) {\n maxLen = lengths[i];\n }\n }\n // build the table\n var size = 1 << maxLen;\n var codes = new Int32Array(size);\n for (var len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) {\n for (var val = 0; val < n; ++val) {\n if (lengths[val] === len) {\n // bit-reverse the code\n var code2 = 0;\n var t = code;\n for (i = 0; i < len; ++i) {\n code2 = (code2 << 1) | (t & 1);\n t >>= 1;\n }\n // fill the table entries\n for (i = code2; i < size; i += skip) {\n codes[i] = (len << 16) | val;\n }\n ++code;\n }\n }\n }\n return [codes, maxLen];\n };\n return FlateStream;\n}(DecodeStream));\nexport default FlateStream;\n//# sourceMappingURL=FlateStream.js.map","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The LZWStream class contained in this file is a TypeScript port of the\n * JavaScript LZWStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar LZWStream = /** @class */ (function (_super) {\n __extends(LZWStream, _super);\n function LZWStream(stream, maybeLength, earlyChange) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n _this.cachedData = 0;\n _this.bitsCached = 0;\n var maxLzwDictionarySize = 4096;\n var lzwState = {\n earlyChange: earlyChange,\n codeLength: 9,\n nextCode: 258,\n dictionaryValues: new Uint8Array(maxLzwDictionarySize),\n dictionaryLengths: new Uint16Array(maxLzwDictionarySize),\n dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize),\n currentSequence: new Uint8Array(maxLzwDictionarySize),\n currentSequenceLength: 0,\n };\n for (var i = 0; i < 256; ++i) {\n lzwState.dictionaryValues[i] = i;\n lzwState.dictionaryLengths[i] = 1;\n }\n _this.lzwState = lzwState;\n return _this;\n }\n LZWStream.prototype.readBlock = function () {\n var blockSize = 512;\n var estimatedDecodedSize = blockSize * 2;\n var decodedSizeDelta = blockSize;\n var i;\n var j;\n var q;\n var lzwState = this.lzwState;\n if (!lzwState) {\n return; // eof was found\n }\n var earlyChange = lzwState.earlyChange;\n var nextCode = lzwState.nextCode;\n var dictionaryValues = lzwState.dictionaryValues;\n var dictionaryLengths = lzwState.dictionaryLengths;\n var dictionaryPrevCodes = lzwState.dictionaryPrevCodes;\n var codeLength = lzwState.codeLength;\n var prevCode = lzwState.prevCode;\n var currentSequence = lzwState.currentSequence;\n var currentSequenceLength = lzwState.currentSequenceLength;\n var decodedLength = 0;\n var currentBufferLength = this.bufferLength;\n var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);\n for (i = 0; i < blockSize; i++) {\n var code = this.readBits(codeLength);\n var hasPrev = currentSequenceLength > 0;\n if (!code || code < 256) {\n currentSequence[0] = code;\n currentSequenceLength = 1;\n }\n else if (code >= 258) {\n if (code < nextCode) {\n currentSequenceLength = dictionaryLengths[code];\n for (j = currentSequenceLength - 1, q = code; j >= 0; j--) {\n currentSequence[j] = dictionaryValues[q];\n q = dictionaryPrevCodes[q];\n }\n }\n else {\n currentSequence[currentSequenceLength++] = currentSequence[0];\n }\n }\n else if (code === 256) {\n codeLength = 9;\n nextCode = 258;\n currentSequenceLength = 0;\n continue;\n }\n else {\n this.eof = true;\n delete this.lzwState;\n break;\n }\n if (hasPrev) {\n dictionaryPrevCodes[nextCode] = prevCode;\n dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1;\n dictionaryValues[nextCode] = currentSequence[0];\n nextCode++;\n codeLength =\n (nextCode + earlyChange) & (nextCode + earlyChange - 1)\n ? codeLength\n : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0;\n }\n prevCode = code;\n decodedLength += currentSequenceLength;\n if (estimatedDecodedSize < decodedLength) {\n do {\n estimatedDecodedSize += decodedSizeDelta;\n } while (estimatedDecodedSize < decodedLength);\n buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);\n }\n for (j = 0; j < currentSequenceLength; j++) {\n buffer[currentBufferLength++] = currentSequence[j];\n }\n }\n lzwState.nextCode = nextCode;\n lzwState.codeLength = codeLength;\n lzwState.prevCode = prevCode;\n lzwState.currentSequenceLength = currentSequenceLength;\n this.bufferLength = currentBufferLength;\n };\n LZWStream.prototype.readBits = function (n) {\n var bitsCached = this.bitsCached;\n var cachedData = this.cachedData;\n while (bitsCached < n) {\n var c = this.stream.getByte();\n if (c === -1) {\n this.eof = true;\n return null;\n }\n cachedData = (cachedData << 8) | c;\n bitsCached += 8;\n }\n this.bitsCached = bitsCached -= n;\n this.cachedData = cachedData;\n return (cachedData >>> bitsCached) & ((1 << n) - 1);\n };\n return LZWStream;\n}(DecodeStream));\nexport default LZWStream;\n//# sourceMappingURL=LZWStream.js.map","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The RunLengthStream class contained in this file is a TypeScript port of the\n * JavaScript RunLengthStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar RunLengthStream = /** @class */ (function (_super) {\n __extends(RunLengthStream, _super);\n function RunLengthStream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n return _this;\n }\n RunLengthStream.prototype.readBlock = function () {\n // The repeatHeader has following format. The first byte defines type of run\n // and amount of bytes to repeat/copy: n = 0 through 127 - copy next n bytes\n // (in addition to the second byte from the header), n = 129 through 255 -\n // duplicate the second byte from the header (257 - n) times, n = 128 - end.\n var repeatHeader = this.stream.getBytes(2);\n if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) {\n this.eof = true;\n return;\n }\n var buffer;\n var bufferLength = this.bufferLength;\n var n = repeatHeader[0];\n if (n < 128) {\n // copy n bytes\n buffer = this.ensureBuffer(bufferLength + n + 1);\n buffer[bufferLength++] = repeatHeader[1];\n if (n > 0) {\n var source = this.stream.getBytes(n);\n buffer.set(source, bufferLength);\n bufferLength += n;\n }\n }\n else {\n n = 257 - n;\n var b = repeatHeader[1];\n buffer = this.ensureBuffer(bufferLength + n + 1);\n for (var i = 0; i < n; i++) {\n buffer[bufferLength++] = b;\n }\n }\n this.bufferLength = bufferLength;\n };\n return RunLengthStream;\n}(DecodeStream));\nexport default RunLengthStream;\n//# sourceMappingURL=RunLengthStream.js.map","import { UnexpectedObjectTypeError, UnsupportedEncodingError, } from \"../errors\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport Ascii85Stream from \"./Ascii85Stream\";\nimport AsciiHexStream from \"./AsciiHexStream\";\nimport FlateStream from \"./FlateStream\";\nimport LZWStream from \"./LZWStream\";\nimport RunLengthStream from \"./RunLengthStream\";\nimport Stream from \"./Stream\";\nvar decodeStream = function (stream, encoding, params) {\n if (encoding === PDFName.of('FlateDecode')) {\n return new FlateStream(stream);\n }\n if (encoding === PDFName.of('LZWDecode')) {\n var earlyChange = 1;\n if (params instanceof PDFDict) {\n var EarlyChange = params.lookup(PDFName.of('EarlyChange'));\n if (EarlyChange instanceof PDFNumber) {\n earlyChange = EarlyChange.asNumber();\n }\n }\n return new LZWStream(stream, undefined, earlyChange);\n }\n if (encoding === PDFName.of('ASCII85Decode')) {\n return new Ascii85Stream(stream);\n }\n if (encoding === PDFName.of('ASCIIHexDecode')) {\n return new AsciiHexStream(stream);\n }\n if (encoding === PDFName.of('RunLengthDecode')) {\n return new RunLengthStream(stream);\n }\n throw new UnsupportedEncodingError(encoding.asString());\n};\nexport var decodePDFRawStream = function (_a) {\n var dict = _a.dict, contents = _a.contents;\n var stream = new Stream(contents);\n var Filter = dict.lookup(PDFName.of('Filter'));\n var DecodeParms = dict.lookup(PDFName.of('DecodeParms'));\n if (Filter instanceof PDFName) {\n stream = decodeStream(stream, Filter, DecodeParms);\n }\n else if (Filter instanceof PDFArray) {\n for (var idx = 0, len = Filter.size(); idx < len; idx++) {\n stream = decodeStream(stream, Filter.lookup(idx, PDFName), DecodeParms && DecodeParms.lookupMaybe(idx, PDFDict));\n }\n }\n else if (!!Filter) {\n throw new UnexpectedObjectTypeError([PDFName, PDFArray], Filter);\n }\n return stream;\n};\n//# sourceMappingURL=decode.js.map","import { __awaiter, __generator } from \"tslib\";\nimport { MissingPageContentsEmbeddingError, UnrecognizedStreamTypeError, } from \"../errors\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRawStream from \"../objects/PDFRawStream\";\nimport PDFStream from \"../objects/PDFStream\";\nimport { decodePDFRawStream } from \"../streams/decode\";\nimport PDFContentStream from \"../structures/PDFContentStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { mergeIntoTypedArray } from \"../../utils\";\nvar fullPageBoundingBox = function (page) {\n var mediaBox = page.MediaBox();\n var width = mediaBox.lookup(2, PDFNumber).asNumber() -\n mediaBox.lookup(0, PDFNumber).asNumber();\n var height = mediaBox.lookup(3, PDFNumber).asNumber() -\n mediaBox.lookup(1, PDFNumber).asNumber();\n return { left: 0, bottom: 0, right: width, top: height };\n};\n// Returns the identity matrix, modified to position the content of the given\n// bounding box at (0, 0).\nvar boundingBoxAdjustedMatrix = function (bb) { return [1, 0, 0, 1, -bb.left, -bb.bottom]; };\nvar PDFPageEmbedder = /** @class */ (function () {\n function PDFPageEmbedder(page, boundingBox, transformationMatrix) {\n this.page = page;\n var bb = boundingBox !== null && boundingBox !== void 0 ? boundingBox : fullPageBoundingBox(page);\n this.width = bb.right - bb.left;\n this.height = bb.top - bb.bottom;\n this.boundingBox = bb;\n this.transformationMatrix = transformationMatrix !== null && transformationMatrix !== void 0 ? transformationMatrix : boundingBoxAdjustedMatrix(bb);\n }\n PDFPageEmbedder.for = function (page, boundingBox, transformationMatrix) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new PDFPageEmbedder(page, boundingBox, transformationMatrix)];\n });\n });\n };\n PDFPageEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, Contents, Resources, decodedContents, _b, left, bottom, right, top, xObject;\n return __generator(this, function (_c) {\n _a = this.page.normalizedEntries(), Contents = _a.Contents, Resources = _a.Resources;\n if (!Contents)\n throw new MissingPageContentsEmbeddingError();\n decodedContents = this.decodeContents(Contents);\n _b = this.boundingBox, left = _b.left, bottom = _b.bottom, right = _b.right, top = _b.top;\n xObject = context.stream(decodedContents, {\n Type: 'XObject',\n Subtype: 'Form',\n FormType: 1,\n BBox: [left, bottom, right, top],\n Matrix: this.transformationMatrix,\n Resources: Resources,\n });\n if (ref) {\n context.assign(ref, xObject);\n return [2 /*return*/, ref];\n }\n else {\n return [2 /*return*/, context.register(xObject)];\n }\n return [2 /*return*/];\n });\n });\n };\n // `contents` is an array of streams which are merged to include them in the XObject.\n // This methods extracts each stream and joins them with a newline character.\n PDFPageEmbedder.prototype.decodeContents = function (contents) {\n var newline = Uint8Array.of(CharCodes.Newline);\n var decodedContents = [];\n for (var idx = 0, len = contents.size(); idx < len; idx++) {\n var stream = contents.lookup(idx, PDFStream);\n var content = void 0;\n if (stream instanceof PDFRawStream) {\n content = decodePDFRawStream(stream).decode();\n }\n else if (stream instanceof PDFContentStream) {\n content = stream.getUnencodedContents();\n }\n else {\n throw new UnrecognizedStreamTypeError(stream);\n }\n decodedContents.push(content, newline);\n }\n return mergeIntoTypedArray.apply(void 0, decodedContents);\n };\n return PDFPageEmbedder;\n}());\nexport default PDFPageEmbedder;\n//# sourceMappingURL=PDFPageEmbedder.js.map","import PDFDict from \"../objects/PDFDict\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFRef from \"../objects/PDFRef\";\nvar PDFAcroField = /** @class */ (function () {\n function PDFAcroField(dict, ref) {\n this.dict = dict;\n this.ref = ref;\n }\n PDFAcroField.prototype.T = function () {\n return this.dict.lookupMaybe(PDFName.of('T'), PDFString, PDFHexString);\n };\n PDFAcroField.prototype.Ff = function () {\n var numberOrRef = this.getInheritableAttribute(PDFName.of('Ff'));\n return this.dict.context.lookupMaybe(numberOrRef, PDFNumber);\n };\n PDFAcroField.prototype.V = function () {\n var valueOrRef = this.getInheritableAttribute(PDFName.of('V'));\n return this.dict.context.lookup(valueOrRef);\n };\n PDFAcroField.prototype.Kids = function () {\n return this.dict.lookupMaybe(PDFName.of('Kids'), PDFArray);\n };\n // Parent(): PDFDict | undefined {\n // return this.dict.lookupMaybe(PDFName.of('Parent'), PDFDict);\n // }\n PDFAcroField.prototype.DA = function () {\n var da = this.dict.lookup(PDFName.of('DA'));\n if (da instanceof PDFString || da instanceof PDFHexString)\n return da;\n return undefined;\n };\n PDFAcroField.prototype.setKids = function (kids) {\n this.dict.set(PDFName.of('Kids'), this.dict.context.obj(kids));\n };\n PDFAcroField.prototype.getParent = function () {\n // const parent = this.Parent();\n // if (!parent) return undefined;\n // return new PDFAcroField(parent);\n var parentRef = this.dict.get(PDFName.of('Parent'));\n if (parentRef instanceof PDFRef) {\n var parent_1 = this.dict.lookup(PDFName.of('Parent'), PDFDict);\n return new PDFAcroField(parent_1, parentRef);\n }\n return undefined;\n };\n PDFAcroField.prototype.setParent = function (parent) {\n if (!parent)\n this.dict.delete(PDFName.of('Parent'));\n else\n this.dict.set(PDFName.of('Parent'), parent);\n };\n PDFAcroField.prototype.getFullyQualifiedName = function () {\n var parent = this.getParent();\n if (!parent)\n return this.getPartialName();\n return parent.getFullyQualifiedName() + \".\" + this.getPartialName();\n };\n PDFAcroField.prototype.getPartialName = function () {\n var _a;\n return (_a = this.T()) === null || _a === void 0 ? void 0 : _a.decodeText();\n };\n PDFAcroField.prototype.setPartialName = function (partialName) {\n if (!partialName)\n this.dict.delete(PDFName.of('T'));\n else\n this.dict.set(PDFName.of('T'), PDFHexString.fromText(partialName));\n };\n PDFAcroField.prototype.setDefaultAppearance = function (appearance) {\n this.dict.set(PDFName.of('DA'), PDFString.of(appearance));\n };\n PDFAcroField.prototype.getDefaultAppearance = function () {\n var _a, _b;\n return (_b = (_a = this.DA()) === null || _a === void 0 ? void 0 : _a.asString()) !== null && _b !== void 0 ? _b : '';\n };\n PDFAcroField.prototype.getFlags = function () {\n var _a, _b;\n return (_b = (_a = this.Ff()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 0;\n };\n PDFAcroField.prototype.setFlags = function (flags) {\n this.dict.set(PDFName.of('Ff'), PDFNumber.of(flags));\n };\n PDFAcroField.prototype.hasFlag = function (flag) {\n var flags = this.getFlags();\n return (flags & flag) !== 0;\n };\n PDFAcroField.prototype.setFlag = function (flag) {\n var flags = this.getFlags();\n this.setFlags(flags | flag);\n };\n PDFAcroField.prototype.clearFlag = function (flag) {\n var flags = this.getFlags();\n this.setFlags(flags & ~flag);\n };\n PDFAcroField.prototype.setFlagTo = function (flag, enable) {\n if (enable)\n this.setFlag(flag);\n else\n this.clearFlag(flag);\n };\n PDFAcroField.prototype.getInheritableAttribute = function (name) {\n var attribute;\n this.ascend(function (node) {\n if (!attribute)\n attribute = node.dict.get(name);\n });\n return attribute;\n };\n PDFAcroField.prototype.ascend = function (visitor) {\n visitor(this);\n var parent = this.getParent();\n if (parent)\n parent.ascend(visitor);\n };\n return PDFAcroField;\n}());\nexport default PDFAcroField;\n//# sourceMappingURL=PDFAcroField.js.map","import PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\n// TODO: Also handle the `/S` and `/D` entries\nvar BorderStyle = /** @class */ (function () {\n function BorderStyle(dict) {\n this.dict = dict;\n }\n BorderStyle.prototype.W = function () {\n var W = this.dict.lookup(PDFName.of('W'));\n if (W instanceof PDFNumber)\n return W;\n return undefined;\n };\n BorderStyle.prototype.getWidth = function () {\n var _a, _b;\n return (_b = (_a = this.W()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 1;\n };\n BorderStyle.prototype.setWidth = function (width) {\n var W = this.dict.context.obj(width);\n this.dict.set(PDFName.of('W'), W);\n };\n BorderStyle.fromDict = function (dict) { return new BorderStyle(dict); };\n return BorderStyle;\n}());\nexport default BorderStyle;\n//# sourceMappingURL=BorderStyle.js.map","import PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFStream from \"../objects/PDFStream\";\nimport PDFArray from \"../objects/PDFArray\";\nvar PDFAnnotation = /** @class */ (function () {\n function PDFAnnotation(dict) {\n this.dict = dict;\n }\n // This is technically required by the PDF spec\n PDFAnnotation.prototype.Rect = function () {\n return this.dict.lookup(PDFName.of('Rect'), PDFArray);\n };\n PDFAnnotation.prototype.AP = function () {\n return this.dict.lookupMaybe(PDFName.of('AP'), PDFDict);\n };\n PDFAnnotation.prototype.getRectangle = function () {\n var _a;\n var Rect = this.Rect();\n return (_a = Rect === null || Rect === void 0 ? void 0 : Rect.asRectangle()) !== null && _a !== void 0 ? _a : { x: 0, y: 0, width: 0, height: 0 };\n };\n PDFAnnotation.prototype.setRectangle = function (rect) {\n var x = rect.x, y = rect.y, width = rect.width, height = rect.height;\n var Rect = this.dict.context.obj([x, y, x + width, y + height]);\n this.dict.set(PDFName.of('Rect'), Rect);\n };\n PDFAnnotation.prototype.setAppearanceState = function (state) {\n this.dict.set(PDFName.of('AS'), state);\n };\n PDFAnnotation.prototype.setAppearances = function (appearances) {\n this.dict.set(PDFName.of('AP'), appearances);\n };\n PDFAnnotation.prototype.ensureAP = function () {\n var AP = this.AP();\n if (!AP) {\n AP = this.dict.context.obj({});\n this.dict.set(PDFName.of('AP'), AP);\n }\n return AP;\n };\n /** @param appearance A PDFDict or PDFStream (direct or ref) */\n PDFAnnotation.prototype.setNormalAppearance = function (appearance) {\n var AP = this.ensureAP();\n AP.set(PDFName.of('N'), appearance);\n };\n /** @param appearance A PDFDict or PDFStream (direct or ref) */\n PDFAnnotation.prototype.setRolloverAppearance = function (appearance) {\n var AP = this.ensureAP();\n AP.set(PDFName.of('R'), appearance);\n };\n /** @param appearance A PDFDict or PDFStream (direct or ref) */\n PDFAnnotation.prototype.setDownAppearance = function (appearance) {\n var AP = this.ensureAP();\n AP.set(PDFName.of('D'), appearance);\n };\n PDFAnnotation.prototype.removeRolloverAppearance = function () {\n var AP = this.AP();\n AP === null || AP === void 0 ? void 0 : AP.delete(PDFName.of('R'));\n };\n PDFAnnotation.prototype.removeDownAppearance = function () {\n var AP = this.AP();\n AP === null || AP === void 0 ? void 0 : AP.delete(PDFName.of('D'));\n };\n PDFAnnotation.prototype.getAppearances = function () {\n var AP = this.AP();\n if (!AP)\n return undefined;\n var N = AP.lookup(PDFName.of('N'), PDFDict, PDFStream);\n var R = AP.lookupMaybe(PDFName.of('R'), PDFDict, PDFStream);\n var D = AP.lookupMaybe(PDFName.of('D'), PDFDict, PDFStream);\n return { normal: N, rollover: R, down: D };\n };\n PDFAnnotation.fromDict = function (dict) { return new PDFAnnotation(dict); };\n return PDFAnnotation;\n}());\nexport default PDFAnnotation;\n//# sourceMappingURL=PDFAnnotation.js.map","import PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFString from \"../objects/PDFString\";\nvar AppearanceCharacteristics = /** @class */ (function () {\n function AppearanceCharacteristics(dict) {\n this.dict = dict;\n }\n AppearanceCharacteristics.prototype.R = function () {\n var R = this.dict.lookup(PDFName.of('R'));\n if (R instanceof PDFNumber)\n return R;\n return undefined;\n };\n AppearanceCharacteristics.prototype.BC = function () {\n var BC = this.dict.lookup(PDFName.of('BC'));\n if (BC instanceof PDFArray)\n return BC;\n return undefined;\n };\n AppearanceCharacteristics.prototype.BG = function () {\n var BG = this.dict.lookup(PDFName.of('BG'));\n if (BG instanceof PDFArray)\n return BG;\n return undefined;\n };\n AppearanceCharacteristics.prototype.CA = function () {\n var CA = this.dict.lookup(PDFName.of('CA'));\n if (CA instanceof PDFHexString || CA instanceof PDFString)\n return CA;\n return undefined;\n };\n AppearanceCharacteristics.prototype.RC = function () {\n var RC = this.dict.lookup(PDFName.of('RC'));\n if (RC instanceof PDFHexString || RC instanceof PDFString)\n return RC;\n return undefined;\n };\n AppearanceCharacteristics.prototype.AC = function () {\n var AC = this.dict.lookup(PDFName.of('AC'));\n if (AC instanceof PDFHexString || AC instanceof PDFString)\n return AC;\n return undefined;\n };\n AppearanceCharacteristics.prototype.getRotation = function () {\n var _a;\n return (_a = this.R()) === null || _a === void 0 ? void 0 : _a.asNumber();\n };\n AppearanceCharacteristics.prototype.getBorderColor = function () {\n var BC = this.BC();\n if (!BC)\n return undefined;\n var components = [];\n for (var idx = 0, len = BC === null || BC === void 0 ? void 0 : BC.size(); idx < len; idx++) {\n var component = BC.get(idx);\n if (component instanceof PDFNumber)\n components.push(component.asNumber());\n }\n return components;\n };\n AppearanceCharacteristics.prototype.getBackgroundColor = function () {\n var BG = this.BG();\n if (!BG)\n return undefined;\n var components = [];\n for (var idx = 0, len = BG === null || BG === void 0 ? void 0 : BG.size(); idx < len; idx++) {\n var component = BG.get(idx);\n if (component instanceof PDFNumber)\n components.push(component.asNumber());\n }\n return components;\n };\n AppearanceCharacteristics.prototype.getCaptions = function () {\n var CA = this.CA();\n var RC = this.RC();\n var AC = this.AC();\n return {\n normal: CA === null || CA === void 0 ? void 0 : CA.decodeText(),\n rollover: RC === null || RC === void 0 ? void 0 : RC.decodeText(),\n down: AC === null || AC === void 0 ? void 0 : AC.decodeText(),\n };\n };\n AppearanceCharacteristics.prototype.setRotation = function (rotation) {\n var R = this.dict.context.obj(rotation);\n this.dict.set(PDFName.of('R'), R);\n };\n AppearanceCharacteristics.prototype.setBorderColor = function (color) {\n var BC = this.dict.context.obj(color);\n this.dict.set(PDFName.of('BC'), BC);\n };\n AppearanceCharacteristics.prototype.setBackgroundColor = function (color) {\n var BG = this.dict.context.obj(color);\n this.dict.set(PDFName.of('BG'), BG);\n };\n AppearanceCharacteristics.prototype.setCaptions = function (captions) {\n var CA = PDFHexString.fromText(captions.normal);\n this.dict.set(PDFName.of('CA'), CA);\n if (captions.rollover) {\n var RC = PDFHexString.fromText(captions.rollover);\n this.dict.set(PDFName.of('RC'), RC);\n }\n else {\n this.dict.delete(PDFName.of('RC'));\n }\n if (captions.down) {\n var AC = PDFHexString.fromText(captions.down);\n this.dict.set(PDFName.of('AC'), AC);\n }\n else {\n this.dict.delete(PDFName.of('AC'));\n }\n };\n AppearanceCharacteristics.fromDict = function (dict) {\n return new AppearanceCharacteristics(dict);\n };\n return AppearanceCharacteristics;\n}());\nexport default AppearanceCharacteristics;\n//# sourceMappingURL=AppearanceCharacteristics.js.map","import { __extends } from \"tslib\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport BorderStyle from \"./BorderStyle\";\nimport PDFAnnotation from \"./PDFAnnotation\";\nimport AppearanceCharacteristics from \"./AppearanceCharacteristics\";\nvar PDFWidgetAnnotation = /** @class */ (function (_super) {\n __extends(PDFWidgetAnnotation, _super);\n function PDFWidgetAnnotation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFWidgetAnnotation.prototype.MK = function () {\n var MK = this.dict.lookup(PDFName.of('MK'));\n if (MK instanceof PDFDict)\n return MK;\n return undefined;\n };\n PDFWidgetAnnotation.prototype.BS = function () {\n var BS = this.dict.lookup(PDFName.of('BS'));\n if (BS instanceof PDFDict)\n return BS;\n return undefined;\n };\n PDFWidgetAnnotation.prototype.DA = function () {\n var da = this.dict.lookup(PDFName.of('DA'));\n if (da instanceof PDFString || da instanceof PDFHexString)\n return da;\n return undefined;\n };\n PDFWidgetAnnotation.prototype.setDefaultAppearance = function (appearance) {\n this.dict.set(PDFName.of('DA'), PDFString.of(appearance));\n };\n PDFWidgetAnnotation.prototype.getDefaultAppearance = function () {\n var _a, _b;\n return (_b = (_a = this.DA()) === null || _a === void 0 ? void 0 : _a.asString()) !== null && _b !== void 0 ? _b : '';\n };\n PDFWidgetAnnotation.prototype.getAppearanceCharacteristics = function () {\n var MK = this.MK();\n if (MK)\n return AppearanceCharacteristics.fromDict(MK);\n return undefined;\n };\n PDFWidgetAnnotation.prototype.getOrCreateAppearanceCharacteristics = function () {\n var MK = this.MK();\n if (MK)\n return AppearanceCharacteristics.fromDict(MK);\n var ac = AppearanceCharacteristics.fromDict(this.dict.context.obj({}));\n this.dict.set(PDFName.of('MK'), ac.dict);\n return ac;\n };\n PDFWidgetAnnotation.prototype.getBorderStyle = function () {\n var BS = this.BS();\n if (BS)\n return BorderStyle.fromDict(BS);\n return undefined;\n };\n PDFWidgetAnnotation.prototype.getOrCreateBorderStyle = function () {\n var BS = this.BS();\n if (BS)\n return BorderStyle.fromDict(BS);\n var bs = BorderStyle.fromDict(this.dict.context.obj({}));\n this.dict.set(PDFName.of('BS'), bs.dict);\n return bs;\n };\n PDFWidgetAnnotation.prototype.getOnValue = function () {\n var _a;\n var normal = (_a = this.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal;\n if (normal instanceof PDFDict) {\n var keys = normal.keys();\n for (var idx = 0, len = keys.length; idx < len; idx++) {\n var key = keys[idx];\n if (key !== PDFName.of('Off'))\n return key;\n }\n }\n return undefined;\n };\n PDFWidgetAnnotation.fromDict = function (dict) {\n return new PDFWidgetAnnotation(dict);\n };\n PDFWidgetAnnotation.create = function (context, parent) {\n var dict = context.obj({\n Type: 'Annot',\n Subtype: 'Widget',\n Rect: [0, 0, 0, 0],\n Parent: parent,\n });\n return new PDFWidgetAnnotation(dict);\n };\n return PDFWidgetAnnotation;\n}(PDFAnnotation));\nexport default PDFWidgetAnnotation;\n//# sourceMappingURL=PDFWidgetAnnotation.js.map","import { __extends } from \"tslib\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroField from \"./PDFAcroField\";\nimport PDFWidgetAnnotation from \"../annotation/PDFWidgetAnnotation\";\nimport { IndexOutOfBoundsError } from \"../errors\";\nvar PDFAcroTerminal = /** @class */ (function (_super) {\n __extends(PDFAcroTerminal, _super);\n function PDFAcroTerminal() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroTerminal.prototype.FT = function () {\n var nameOrRef = this.getInheritableAttribute(PDFName.of('FT'));\n return this.dict.context.lookup(nameOrRef, PDFName);\n };\n PDFAcroTerminal.prototype.getWidgets = function () {\n var kidDicts = this.Kids();\n // This field is itself a widget\n if (!kidDicts)\n return [PDFWidgetAnnotation.fromDict(this.dict)];\n // This field's kids are its widgets\n var widgets = new Array(kidDicts.size());\n for (var idx = 0, len = kidDicts.size(); idx < len; idx++) {\n var dict = kidDicts.lookup(idx, PDFDict);\n widgets[idx] = PDFWidgetAnnotation.fromDict(dict);\n }\n return widgets;\n };\n PDFAcroTerminal.prototype.addWidget = function (ref) {\n var Kids = this.normalizedEntries().Kids;\n Kids.push(ref);\n };\n PDFAcroTerminal.prototype.removeWidget = function (idx) {\n var kidDicts = this.Kids();\n if (!kidDicts) {\n // This field is itself a widget\n if (idx !== 0)\n throw new IndexOutOfBoundsError(idx, 0, 0);\n this.setKids([]);\n }\n else {\n // This field's kids are its widgets\n if (idx < 0 || idx > kidDicts.size()) {\n throw new IndexOutOfBoundsError(idx, 0, kidDicts.size());\n }\n kidDicts.remove(idx);\n }\n };\n PDFAcroTerminal.prototype.normalizedEntries = function () {\n var Kids = this.Kids();\n // If this field is itself a widget (because it was only rendered once in\n // the document, so the field and widget properties were merged) then we\n // add itself to the `Kids` array. The alternative would be to try\n // splitting apart the widget properties and creating a separate object\n // for them.\n if (!Kids) {\n Kids = this.dict.context.obj([this.ref]);\n this.dict.set(PDFName.of('Kids'), Kids);\n }\n return { Kids: Kids };\n };\n PDFAcroTerminal.fromDict = function (dict, ref) {\n return new PDFAcroTerminal(dict, ref);\n };\n return PDFAcroTerminal;\n}(PDFAcroField));\nexport default PDFAcroTerminal;\n//# sourceMappingURL=PDFAcroTerminal.js.map","import { __extends } from \"tslib\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroTerminal from \"./PDFAcroTerminal\";\nimport { IndexOutOfBoundsError } from \"../errors\";\nvar PDFAcroButton = /** @class */ (function (_super) {\n __extends(PDFAcroButton, _super);\n function PDFAcroButton() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroButton.prototype.Opt = function () {\n return this.dict.lookupMaybe(PDFName.of('Opt'), PDFString, PDFHexString, PDFArray);\n };\n PDFAcroButton.prototype.setOpt = function (opt) {\n this.dict.set(PDFName.of('Opt'), this.dict.context.obj(opt));\n };\n PDFAcroButton.prototype.getExportValues = function () {\n var opt = this.Opt();\n if (!opt)\n return undefined;\n if (opt instanceof PDFString || opt instanceof PDFHexString) {\n return [opt];\n }\n var values = [];\n for (var idx = 0, len = opt.size(); idx < len; idx++) {\n var value = opt.lookup(idx);\n if (value instanceof PDFString || value instanceof PDFHexString) {\n values.push(value);\n }\n }\n return values;\n };\n PDFAcroButton.prototype.removeExportValue = function (idx) {\n var opt = this.Opt();\n if (!opt)\n return;\n if (opt instanceof PDFString || opt instanceof PDFHexString) {\n if (idx !== 0)\n throw new IndexOutOfBoundsError(idx, 0, 0);\n this.setOpt([]);\n }\n else {\n if (idx < 0 || idx > opt.size()) {\n throw new IndexOutOfBoundsError(idx, 0, opt.size());\n }\n opt.remove(idx);\n }\n };\n // Enforce use use of /Opt even if it isn't strictly necessary\n PDFAcroButton.prototype.normalizeExportValues = function () {\n var _a, _b, _c, _d;\n var exportValues = (_a = this.getExportValues()) !== null && _a !== void 0 ? _a : [];\n var Opt = [];\n var widgets = this.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var exportVal = (_b = exportValues[idx]) !== null && _b !== void 0 ? _b : PDFHexString.fromText((_d = (_c = widget.getOnValue()) === null || _c === void 0 ? void 0 : _c.decodeText()) !== null && _d !== void 0 ? _d : '');\n Opt.push(exportVal);\n }\n this.setOpt(Opt);\n };\n /**\n * Reuses existing opt if one exists with the same value (assuming\n * `useExistingIdx` is `true`). Returns index of existing (or new) opt.\n */\n PDFAcroButton.prototype.addOpt = function (opt, useExistingOptIdx) {\n var _a;\n this.normalizeExportValues();\n var optText = opt.decodeText();\n var existingIdx;\n if (useExistingOptIdx) {\n var exportValues = (_a = this.getExportValues()) !== null && _a !== void 0 ? _a : [];\n for (var idx = 0, len = exportValues.length; idx < len; idx++) {\n var exportVal = exportValues[idx];\n if (exportVal.decodeText() === optText)\n existingIdx = idx;\n }\n }\n var Opt = this.Opt();\n Opt.push(opt);\n return existingIdx !== null && existingIdx !== void 0 ? existingIdx : Opt.size() - 1;\n };\n PDFAcroButton.prototype.addWidgetWithOpt = function (widget, opt, useExistingOptIdx) {\n var optIdx = this.addOpt(opt, useExistingOptIdx);\n var apStateValue = PDFName.of(String(optIdx));\n this.addWidget(widget);\n return apStateValue;\n };\n return PDFAcroButton;\n}(PDFAcroTerminal));\nexport default PDFAcroButton;\n//# sourceMappingURL=PDFAcroButton.js.map","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroButton from \"./PDFAcroButton\";\nimport { InvalidAcroFieldValueError } from \"../errors\";\nvar PDFAcroCheckBox = /** @class */ (function (_super) {\n __extends(PDFAcroCheckBox, _super);\n function PDFAcroCheckBox() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroCheckBox.prototype.setValue = function (value) {\n var _a;\n var onValue = (_a = this.getOnValue()) !== null && _a !== void 0 ? _a : PDFName.of('Yes');\n if (value !== onValue && value !== PDFName.of('Off')) {\n throw new InvalidAcroFieldValueError();\n }\n this.dict.set(PDFName.of('V'), value);\n var widgets = this.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var state = widget.getOnValue() === value ? value : PDFName.of('Off');\n widget.setAppearanceState(state);\n }\n };\n PDFAcroCheckBox.prototype.getValue = function () {\n var v = this.V();\n if (v instanceof PDFName)\n return v;\n return PDFName.of('Off');\n };\n PDFAcroCheckBox.prototype.getOnValue = function () {\n var widget = this.getWidgets()[0];\n return widget === null || widget === void 0 ? void 0 : widget.getOnValue();\n };\n PDFAcroCheckBox.fromDict = function (dict, ref) {\n return new PDFAcroCheckBox(dict, ref);\n };\n PDFAcroCheckBox.create = function (context) {\n var dict = context.obj({\n FT: 'Btn',\n Kids: [],\n });\n var ref = context.register(dict);\n return new PDFAcroCheckBox(dict, ref);\n };\n return PDFAcroCheckBox;\n}(PDFAcroButton));\nexport default PDFAcroCheckBox;\n//# sourceMappingURL=PDFAcroCheckBox.js.map","import { __extends } from \"tslib\";\nimport PDFAcroTerminal from \"./PDFAcroTerminal\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFName from \"../objects/PDFName\";\nimport { AcroChoiceFlags } from \"./flags\";\nimport { InvalidAcroFieldValueError, MultiSelectValueError, } from \"../errors\";\nvar PDFAcroChoice = /** @class */ (function (_super) {\n __extends(PDFAcroChoice, _super);\n function PDFAcroChoice() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroChoice.prototype.setValues = function (values) {\n if (this.hasFlag(AcroChoiceFlags.Combo) &&\n !this.hasFlag(AcroChoiceFlags.Edit) &&\n !this.valuesAreValid(values)) {\n throw new InvalidAcroFieldValueError();\n }\n if (values.length === 0) {\n this.dict.delete(PDFName.of('V'));\n }\n if (values.length === 1) {\n this.dict.set(PDFName.of('V'), values[0]);\n }\n if (values.length > 1) {\n if (!this.hasFlag(AcroChoiceFlags.MultiSelect)) {\n throw new MultiSelectValueError();\n }\n this.dict.set(PDFName.of('V'), this.dict.context.obj(values));\n }\n this.updateSelectedIndices(values);\n };\n PDFAcroChoice.prototype.valuesAreValid = function (values) {\n var options = this.getOptions();\n var _loop_1 = function (idx, len) {\n var val = values[idx].decodeText();\n if (!options.find(function (o) { return val === (o.display || o.value).decodeText(); })) {\n return { value: false };\n }\n };\n for (var idx = 0, len = values.length; idx < len; idx++) {\n var state_1 = _loop_1(idx, len);\n if (typeof state_1 === \"object\")\n return state_1.value;\n }\n return true;\n };\n PDFAcroChoice.prototype.updateSelectedIndices = function (values) {\n if (values.length > 1) {\n var indices = new Array(values.length);\n var options = this.getOptions();\n var _loop_2 = function (idx, len) {\n var val = values[idx].decodeText();\n indices[idx] = options.findIndex(function (o) { return val === (o.display || o.value).decodeText(); });\n };\n for (var idx = 0, len = values.length; idx < len; idx++) {\n _loop_2(idx, len);\n }\n this.dict.set(PDFName.of('I'), this.dict.context.obj(indices.sort()));\n }\n else {\n this.dict.delete(PDFName.of('I'));\n }\n };\n PDFAcroChoice.prototype.getValues = function () {\n var v = this.V();\n if (v instanceof PDFString || v instanceof PDFHexString)\n return [v];\n if (v instanceof PDFArray) {\n var values = [];\n for (var idx = 0, len = v.size(); idx < len; idx++) {\n var value = v.lookup(idx);\n if (value instanceof PDFString || value instanceof PDFHexString) {\n values.push(value);\n }\n }\n return values;\n }\n return [];\n };\n PDFAcroChoice.prototype.Opt = function () {\n return this.dict.lookupMaybe(PDFName.of('Opt'), PDFString, PDFHexString, PDFArray);\n };\n PDFAcroChoice.prototype.setOptions = function (options) {\n var newOpt = new Array(options.length);\n for (var idx = 0, len = options.length; idx < len; idx++) {\n var _a = options[idx], value = _a.value, display = _a.display;\n newOpt[idx] = this.dict.context.obj([value, display || value]);\n }\n this.dict.set(PDFName.of('Opt'), this.dict.context.obj(newOpt));\n };\n PDFAcroChoice.prototype.getOptions = function () {\n var Opt = this.Opt();\n // Not supposed to happen - Opt _should_ always be `PDFArray | undefined`\n if (Opt instanceof PDFString || Opt instanceof PDFHexString) {\n return [{ value: Opt, display: Opt }];\n }\n if (Opt instanceof PDFArray) {\n var res = [];\n for (var idx = 0, len = Opt.size(); idx < len; idx++) {\n var item = Opt.lookup(idx);\n // If `item` is a string, use that as both the export and text value\n if (item instanceof PDFString || item instanceof PDFHexString) {\n res.push({ value: item, display: item });\n }\n // If `item` is an array of one, treat it the same as just a string,\n // if it's an array of two then `item[0]` is the export value and\n // `item[1]` is the text value\n if (item instanceof PDFArray) {\n if (item.size() > 0) {\n var first = item.lookup(0, PDFString, PDFHexString);\n var second = item.lookupMaybe(1, PDFString, PDFHexString);\n res.push({ value: first, display: second || first });\n }\n }\n }\n return res;\n }\n return [];\n };\n return PDFAcroChoice;\n}(PDFAcroTerminal));\nexport default PDFAcroChoice;\n//# sourceMappingURL=PDFAcroChoice.js.map","import { __extends } from \"tslib\";\nimport PDFAcroChoice from \"./PDFAcroChoice\";\nimport { AcroChoiceFlags } from \"./flags\";\nvar PDFAcroComboBox = /** @class */ (function (_super) {\n __extends(PDFAcroComboBox, _super);\n function PDFAcroComboBox() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroComboBox.fromDict = function (dict, ref) {\n return new PDFAcroComboBox(dict, ref);\n };\n PDFAcroComboBox.create = function (context) {\n var dict = context.obj({\n FT: 'Ch',\n Ff: AcroChoiceFlags.Combo,\n Kids: [],\n });\n var ref = context.register(dict);\n return new PDFAcroComboBox(dict, ref);\n };\n return PDFAcroComboBox;\n}(PDFAcroChoice));\nexport default PDFAcroComboBox;\n//# sourceMappingURL=PDFAcroComboBox.js.map","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroField from \"./PDFAcroField\";\nvar PDFAcroNonTerminal = /** @class */ (function (_super) {\n __extends(PDFAcroNonTerminal, _super);\n function PDFAcroNonTerminal() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroNonTerminal.prototype.addField = function (field) {\n var Kids = this.normalizedEntries().Kids;\n Kids === null || Kids === void 0 ? void 0 : Kids.push(field);\n };\n PDFAcroNonTerminal.prototype.normalizedEntries = function () {\n var Kids = this.Kids();\n if (!Kids) {\n Kids = this.dict.context.obj([]);\n this.dict.set(PDFName.of('Kids'), Kids);\n }\n return { Kids: Kids };\n };\n PDFAcroNonTerminal.fromDict = function (dict, ref) {\n return new PDFAcroNonTerminal(dict, ref);\n };\n PDFAcroNonTerminal.create = function (context) {\n var dict = context.obj({});\n var ref = context.register(dict);\n return new PDFAcroNonTerminal(dict, ref);\n };\n return PDFAcroNonTerminal;\n}(PDFAcroField));\nexport default PDFAcroNonTerminal;\n//# sourceMappingURL=PDFAcroNonTerminal.js.map","import { __extends } from \"tslib\";\nimport PDFAcroTerminal from \"./PDFAcroTerminal\";\nvar PDFAcroSignature = /** @class */ (function (_super) {\n __extends(PDFAcroSignature, _super);\n function PDFAcroSignature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroSignature.fromDict = function (dict, ref) {\n return new PDFAcroSignature(dict, ref);\n };\n return PDFAcroSignature;\n}(PDFAcroTerminal));\nexport default PDFAcroSignature;\n//# sourceMappingURL=PDFAcroSignature.js.map","import { __extends } from \"tslib\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFString from \"../objects/PDFString\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroTerminal from \"./PDFAcroTerminal\";\nvar PDFAcroText = /** @class */ (function (_super) {\n __extends(PDFAcroText, _super);\n function PDFAcroText() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroText.prototype.MaxLen = function () {\n var maxLen = this.dict.lookup(PDFName.of('MaxLen'));\n if (maxLen instanceof PDFNumber)\n return maxLen;\n return undefined;\n };\n PDFAcroText.prototype.Q = function () {\n var q = this.dict.lookup(PDFName.of('Q'));\n if (q instanceof PDFNumber)\n return q;\n return undefined;\n };\n PDFAcroText.prototype.setMaxLength = function (maxLength) {\n this.dict.set(PDFName.of('MaxLen'), PDFNumber.of(maxLength));\n };\n PDFAcroText.prototype.removeMaxLength = function () {\n this.dict.delete(PDFName.of('MaxLen'));\n };\n PDFAcroText.prototype.getMaxLength = function () {\n var _a;\n return (_a = this.MaxLen()) === null || _a === void 0 ? void 0 : _a.asNumber();\n };\n PDFAcroText.prototype.setQuadding = function (quadding) {\n this.dict.set(PDFName.of('Q'), PDFNumber.of(quadding));\n };\n PDFAcroText.prototype.getQuadding = function () {\n var _a;\n return (_a = this.Q()) === null || _a === void 0 ? void 0 : _a.asNumber();\n };\n PDFAcroText.prototype.setValue = function (value) {\n this.dict.set(PDFName.of('V'), value);\n // const widgets = this.getWidgets();\n // for (let idx = 0, len = widgets.length; idx < len; idx++) {\n // const widget = widgets[idx];\n // const state = widget.getOnValue() === value ? value : PDFName.of('Off');\n // widget.setAppearanceState(state);\n // }\n };\n PDFAcroText.prototype.removeValue = function () {\n this.dict.delete(PDFName.of('V'));\n };\n PDFAcroText.prototype.getValue = function () {\n var v = this.V();\n if (v instanceof PDFString || v instanceof PDFHexString)\n return v;\n return undefined;\n };\n PDFAcroText.fromDict = function (dict, ref) { return new PDFAcroText(dict, ref); };\n PDFAcroText.create = function (context) {\n var dict = context.obj({\n FT: 'Tx',\n Kids: [],\n });\n var ref = context.register(dict);\n return new PDFAcroText(dict, ref);\n };\n return PDFAcroText;\n}(PDFAcroTerminal));\nexport default PDFAcroText;\n//# sourceMappingURL=PDFAcroText.js.map","import { __extends } from \"tslib\";\nimport PDFAcroButton from \"./PDFAcroButton\";\nimport { AcroButtonFlags } from \"./flags\";\nvar PDFAcroPushButton = /** @class */ (function (_super) {\n __extends(PDFAcroPushButton, _super);\n function PDFAcroPushButton() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroPushButton.fromDict = function (dict, ref) {\n return new PDFAcroPushButton(dict, ref);\n };\n PDFAcroPushButton.create = function (context) {\n var dict = context.obj({\n FT: 'Btn',\n Ff: AcroButtonFlags.PushButton,\n Kids: [],\n });\n var ref = context.register(dict);\n return new PDFAcroPushButton(dict, ref);\n };\n return PDFAcroPushButton;\n}(PDFAcroButton));\nexport default PDFAcroPushButton;\n//# sourceMappingURL=PDFAcroPushButton.js.map","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroButton from \"./PDFAcroButton\";\nimport { AcroButtonFlags } from \"./flags\";\nimport { InvalidAcroFieldValueError } from \"../errors\";\nvar PDFAcroRadioButton = /** @class */ (function (_super) {\n __extends(PDFAcroRadioButton, _super);\n function PDFAcroRadioButton() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroRadioButton.prototype.setValue = function (value) {\n var onValues = this.getOnValues();\n if (!onValues.includes(value) && value !== PDFName.of('Off')) {\n throw new InvalidAcroFieldValueError();\n }\n this.dict.set(PDFName.of('V'), value);\n var widgets = this.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var state = widget.getOnValue() === value ? value : PDFName.of('Off');\n widget.setAppearanceState(state);\n }\n };\n PDFAcroRadioButton.prototype.getValue = function () {\n var v = this.V();\n if (v instanceof PDFName)\n return v;\n return PDFName.of('Off');\n };\n PDFAcroRadioButton.prototype.getOnValues = function () {\n var widgets = this.getWidgets();\n var onValues = [];\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var onValue = widgets[idx].getOnValue();\n if (onValue)\n onValues.push(onValue);\n }\n return onValues;\n };\n PDFAcroRadioButton.fromDict = function (dict, ref) {\n return new PDFAcroRadioButton(dict, ref);\n };\n PDFAcroRadioButton.create = function (context) {\n var dict = context.obj({\n FT: 'Btn',\n Ff: AcroButtonFlags.Radio,\n Kids: [],\n });\n var ref = context.register(dict);\n return new PDFAcroRadioButton(dict, ref);\n };\n return PDFAcroRadioButton;\n}(PDFAcroButton));\nexport default PDFAcroRadioButton;\n//# sourceMappingURL=PDFAcroRadioButton.js.map","import { __extends } from \"tslib\";\nimport PDFAcroChoice from \"./PDFAcroChoice\";\nvar PDFAcroListBox = /** @class */ (function (_super) {\n __extends(PDFAcroListBox, _super);\n function PDFAcroListBox() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFAcroListBox.fromDict = function (dict, ref) {\n return new PDFAcroListBox(dict, ref);\n };\n PDFAcroListBox.create = function (context) {\n var dict = context.obj({\n FT: 'Ch',\n Kids: [],\n });\n var ref = context.register(dict);\n return new PDFAcroListBox(dict, ref);\n };\n return PDFAcroListBox;\n}(PDFAcroChoice));\nexport default PDFAcroListBox;\n//# sourceMappingURL=PDFAcroListBox.js.map","import PDFNumber from \"../objects/PDFNumber\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFAcroTerminal from \"./PDFAcroTerminal\";\nimport PDFAcroNonTerminal from \"./PDFAcroNonTerminal\";\nimport PDFAcroSignature from \"./PDFAcroSignature\";\nimport PDFAcroText from \"./PDFAcroText\";\nimport PDFAcroPushButton from \"./PDFAcroPushButton\";\nimport PDFAcroRadioButton from \"./PDFAcroRadioButton\";\nimport PDFAcroCheckBox from \"./PDFAcroCheckBox\";\nimport PDFAcroComboBox from \"./PDFAcroComboBox\";\nimport PDFAcroListBox from \"./PDFAcroListBox\";\nimport { AcroButtonFlags, AcroChoiceFlags } from \"./flags\";\nexport var createPDFAcroFields = function (kidDicts) {\n if (!kidDicts)\n return [];\n var kids = [];\n for (var idx = 0, len = kidDicts.size(); idx < len; idx++) {\n var ref = kidDicts.get(idx);\n var dict = kidDicts.lookup(idx);\n // if (dict instanceof PDFDict) kids.push(PDFAcroField.fromDict(dict));\n if (ref instanceof PDFRef && dict instanceof PDFDict) {\n kids.push([createPDFAcroField(dict, ref), ref]);\n }\n }\n return kids;\n};\nexport var createPDFAcroField = function (dict, ref) {\n var isNonTerminal = isNonTerminalAcroField(dict);\n if (isNonTerminal)\n return PDFAcroNonTerminal.fromDict(dict, ref);\n return createPDFAcroTerminal(dict, ref);\n};\n// TODO: Maybe just check if the dict is *not* a widget? That might be better.\n// According to the PDF spec:\n//\n// > A field's children in the hierarchy may also include widget annotations\n// > that define its appearance on the page. A field that has children that\n// > are fields is called a non-terminal field. A field that does not have\n// > children that are fields is called a terminal field.\n//\n// The spec is not entirely clear about how to determine whether a given\n// dictionary represents an acrofield or a widget annotation. So we will assume\n// that a dictionary is an acrofield if it is a member of the `/Kids` array\n// and it contains a `/T` entry (widgets do not have `/T` entries). This isn't\n// a bullet proof solution, because the `/T` entry is technically defined as\n// optional for acrofields by the PDF spec. But in practice all acrofields seem\n// to have a `/T` entry defined.\nvar isNonTerminalAcroField = function (dict) {\n var kids = dict.lookup(PDFName.of('Kids'));\n if (kids instanceof PDFArray) {\n for (var idx = 0, len = kids.size(); idx < len; idx++) {\n var kid = kids.lookup(idx);\n var kidIsField = kid instanceof PDFDict && kid.has(PDFName.of('T'));\n if (kidIsField)\n return true;\n }\n }\n return false;\n};\nvar createPDFAcroTerminal = function (dict, ref) {\n var ftNameOrRef = getInheritableAttribute(dict, PDFName.of('FT'));\n var type = dict.context.lookup(ftNameOrRef, PDFName);\n if (type === PDFName.of('Btn'))\n return createPDFAcroButton(dict, ref);\n if (type === PDFName.of('Ch'))\n return createPDFAcroChoice(dict, ref);\n if (type === PDFName.of('Tx'))\n return PDFAcroText.fromDict(dict, ref);\n if (type === PDFName.of('Sig'))\n return PDFAcroSignature.fromDict(dict, ref);\n // We should never reach this line. But there are a lot of weird PDFs out\n // there. So, just to be safe, we'll try to handle things gracefully instead\n // of throwing an error.\n return PDFAcroTerminal.fromDict(dict, ref);\n};\nvar createPDFAcroButton = function (dict, ref) {\n var _a;\n var ffNumberOrRef = getInheritableAttribute(dict, PDFName.of('Ff'));\n var ffNumber = dict.context.lookupMaybe(ffNumberOrRef, PDFNumber);\n var flags = (_a = ffNumber === null || ffNumber === void 0 ? void 0 : ffNumber.asNumber()) !== null && _a !== void 0 ? _a : 0;\n if (flagIsSet(flags, AcroButtonFlags.PushButton)) {\n return PDFAcroPushButton.fromDict(dict, ref);\n }\n else if (flagIsSet(flags, AcroButtonFlags.Radio)) {\n return PDFAcroRadioButton.fromDict(dict, ref);\n }\n else {\n return PDFAcroCheckBox.fromDict(dict, ref);\n }\n};\nvar createPDFAcroChoice = function (dict, ref) {\n var _a;\n var ffNumberOrRef = getInheritableAttribute(dict, PDFName.of('Ff'));\n var ffNumber = dict.context.lookupMaybe(ffNumberOrRef, PDFNumber);\n var flags = (_a = ffNumber === null || ffNumber === void 0 ? void 0 : ffNumber.asNumber()) !== null && _a !== void 0 ? _a : 0;\n if (flagIsSet(flags, AcroChoiceFlags.Combo)) {\n return PDFAcroComboBox.fromDict(dict, ref);\n }\n else {\n return PDFAcroListBox.fromDict(dict, ref);\n }\n};\nvar flagIsSet = function (flags, flag) {\n return (flags & flag) !== 0;\n};\nvar getInheritableAttribute = function (startNode, name) {\n var attribute;\n ascend(startNode, function (node) {\n if (!attribute)\n attribute = node.get(name);\n });\n return attribute;\n};\nvar ascend = function (startNode, visitor) {\n visitor(startNode);\n var Parent = startNode.lookupMaybe(PDFName.of('Parent'), PDFDict);\n if (Parent)\n ascend(Parent, visitor);\n};\n//# sourceMappingURL=utils.js.map","import PDFDict from \"../objects/PDFDict\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFAcroNonTerminal from \"./PDFAcroNonTerminal\";\nimport { createPDFAcroField, createPDFAcroFields, } from \"./utils\";\nvar PDFAcroForm = /** @class */ (function () {\n function PDFAcroForm(dict) {\n this.dict = dict;\n }\n PDFAcroForm.prototype.Fields = function () {\n var fields = this.dict.lookup(PDFName.of('Fields'));\n if (fields instanceof PDFArray)\n return fields;\n return undefined;\n };\n PDFAcroForm.prototype.getFields = function () {\n var Fields = this.normalizedEntries().Fields;\n var fields = new Array(Fields.size());\n for (var idx = 0, len = Fields.size(); idx < len; idx++) {\n var ref = Fields.get(idx);\n var dict = Fields.lookup(idx, PDFDict);\n fields[idx] = [createPDFAcroField(dict, ref), ref];\n }\n return fields;\n };\n PDFAcroForm.prototype.getAllFields = function () {\n var allFields = [];\n var pushFields = function (fields) {\n if (!fields)\n return;\n for (var idx = 0, len = fields.length; idx < len; idx++) {\n var field = fields[idx];\n allFields.push(field);\n var fieldModel = field[0];\n if (fieldModel instanceof PDFAcroNonTerminal) {\n pushFields(createPDFAcroFields(fieldModel.Kids()));\n }\n }\n };\n pushFields(this.getFields());\n return allFields;\n };\n PDFAcroForm.prototype.addField = function (field) {\n var Fields = this.normalizedEntries().Fields;\n Fields === null || Fields === void 0 ? void 0 : Fields.push(field);\n };\n PDFAcroForm.prototype.normalizedEntries = function () {\n var Fields = this.Fields();\n if (!Fields) {\n Fields = this.dict.context.obj([]);\n this.dict.set(PDFName.of('Fields'), Fields);\n }\n return { Fields: Fields };\n };\n PDFAcroForm.fromDict = function (dict) { return new PDFAcroForm(dict); };\n PDFAcroForm.create = function (context) {\n var dict = context.obj({ Fields: [] });\n return new PDFAcroForm(dict);\n };\n return PDFAcroForm;\n}());\nexport default PDFAcroForm;\n//# sourceMappingURL=PDFAcroForm.js.map","import { __extends } from \"tslib\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport { PDFAcroForm } from \"../acroform\";\nvar PDFCatalog = /** @class */ (function (_super) {\n __extends(PDFCatalog, _super);\n function PDFCatalog() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFCatalog.prototype.Pages = function () {\n return this.lookup(PDFName.of('Pages'), PDFDict);\n };\n PDFCatalog.prototype.AcroForm = function () {\n return this.lookupMaybe(PDFName.of('AcroForm'), PDFDict);\n };\n PDFCatalog.prototype.getAcroForm = function () {\n var dict = this.AcroForm();\n if (!dict)\n return undefined;\n return PDFAcroForm.fromDict(dict);\n };\n PDFCatalog.prototype.getOrCreateAcroForm = function () {\n var acroForm = this.getAcroForm();\n if (!acroForm) {\n acroForm = PDFAcroForm.create(this.context);\n var acroFormRef = this.context.register(acroForm.dict);\n this.set(PDFName.of('AcroForm'), acroFormRef);\n }\n return acroForm;\n };\n /**\n * Inserts the given ref as a leaf node of this catalog's page tree at the\n * specified index (zero-based). Also increments the `Count` of each node in\n * the page tree hierarchy to accomodate the new page.\n *\n * Returns the ref of the PDFPageTree node into which `leafRef` was inserted.\n */\n PDFCatalog.prototype.insertLeafNode = function (leafRef, index) {\n var pagesRef = this.get(PDFName.of('Pages'));\n var maybeParentRef = this.Pages().insertLeafNode(leafRef, index);\n return maybeParentRef || pagesRef;\n };\n PDFCatalog.prototype.removeLeafNode = function (index) {\n this.Pages().removeLeafNode(index);\n };\n PDFCatalog.withContextAndPages = function (context, pages) {\n var dict = new Map();\n dict.set(PDFName.of('Type'), PDFName.of('Catalog'));\n dict.set(PDFName.of('Pages'), pages);\n return new PDFCatalog(dict, context);\n };\n PDFCatalog.fromMapWithContext = function (map, context) {\n return new PDFCatalog(map, context);\n };\n return PDFCatalog;\n}(PDFDict));\nexport default PDFCatalog;\n//# sourceMappingURL=PDFCatalog.js.map","import { __extends } from \"tslib\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFPageLeaf from \"./PDFPageLeaf\";\nimport { InvalidTargetIndexError, CorruptPageTreeError } from \"../errors\";\nvar PDFPageTree = /** @class */ (function (_super) {\n __extends(PDFPageTree, _super);\n function PDFPageTree() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFPageTree.prototype.Parent = function () {\n return this.lookup(PDFName.of('Parent'));\n };\n PDFPageTree.prototype.Kids = function () {\n return this.lookup(PDFName.of('Kids'), PDFArray);\n };\n PDFPageTree.prototype.Count = function () {\n return this.lookup(PDFName.of('Count'), PDFNumber);\n };\n PDFPageTree.prototype.pushTreeNode = function (treeRef) {\n var Kids = this.Kids();\n Kids.push(treeRef);\n };\n PDFPageTree.prototype.pushLeafNode = function (leafRef) {\n var Kids = this.Kids();\n this.insertLeafKid(Kids.size(), leafRef);\n };\n /**\n * Inserts the given ref as a leaf node of this page tree at the specified\n * index (zero-based). Also increments the `Count` of each page tree in the\n * hierarchy to accomodate the new page.\n *\n * Returns the ref of the PDFPageTree node into which `leafRef` was inserted,\n * or `undefined` if it was inserted into the root node (the PDFPageTree upon\n * which the method was first called).\n */\n PDFPageTree.prototype.insertLeafNode = function (leafRef, targetIndex) {\n var Kids = this.Kids();\n var Count = this.Count().asNumber();\n if (targetIndex > Count) {\n throw new InvalidTargetIndexError(targetIndex, Count);\n }\n var leafsRemainingUntilTarget = targetIndex;\n for (var idx = 0, len = Kids.size(); idx < len; idx++) {\n if (leafsRemainingUntilTarget === 0) {\n // Insert page and return\n this.insertLeafKid(idx, leafRef);\n return undefined;\n }\n var kidRef = Kids.get(idx);\n var kid = this.context.lookup(kidRef);\n if (kid instanceof PDFPageTree) {\n if (kid.Count().asNumber() > leafsRemainingUntilTarget) {\n // Dig in\n return (kid.insertLeafNode(leafRef, leafsRemainingUntilTarget) || kidRef);\n }\n else {\n // Move on\n leafsRemainingUntilTarget -= kid.Count().asNumber();\n }\n }\n if (kid instanceof PDFPageLeaf) {\n // Move on\n leafsRemainingUntilTarget -= 1;\n }\n }\n if (leafsRemainingUntilTarget === 0) {\n // Insert page at the end and return\n this.insertLeafKid(Kids.size(), leafRef);\n return undefined;\n }\n // Should never get here if `targetIndex` is valid\n throw new CorruptPageTreeError(targetIndex, 'insertLeafNode');\n };\n /**\n * Removes the leaf node at the specified index (zero-based) from this page\n * tree. Also decrements the `Count` of each page tree in the hierarchy to\n * account for the removed page.\n *\n * If `prune` is true, then intermediate tree nodes will be removed from the\n * tree if they contain 0 children after the leaf node is removed.\n */\n PDFPageTree.prototype.removeLeafNode = function (targetIndex, prune) {\n if (prune === void 0) { prune = true; }\n var Kids = this.Kids();\n var Count = this.Count().asNumber();\n if (targetIndex >= Count) {\n throw new InvalidTargetIndexError(targetIndex, Count);\n }\n var leafsRemainingUntilTarget = targetIndex;\n for (var idx = 0, len = Kids.size(); idx < len; idx++) {\n var kidRef = Kids.get(idx);\n var kid = this.context.lookup(kidRef);\n if (kid instanceof PDFPageTree) {\n if (kid.Count().asNumber() > leafsRemainingUntilTarget) {\n // Dig in\n kid.removeLeafNode(leafsRemainingUntilTarget, prune);\n if (prune && kid.Kids().size() === 0)\n Kids.remove(idx);\n return;\n }\n else {\n // Move on\n leafsRemainingUntilTarget -= kid.Count().asNumber();\n }\n }\n if (kid instanceof PDFPageLeaf) {\n if (leafsRemainingUntilTarget === 0) {\n // Remove page and return\n this.removeKid(idx);\n return;\n }\n else {\n // Move on\n leafsRemainingUntilTarget -= 1;\n }\n }\n }\n // Should never get here if `targetIndex` is valid\n throw new CorruptPageTreeError(targetIndex, 'removeLeafNode');\n };\n PDFPageTree.prototype.ascend = function (visitor) {\n visitor(this);\n var Parent = this.Parent();\n if (Parent)\n Parent.ascend(visitor);\n };\n /** Performs a Post-Order traversal of this page tree */\n PDFPageTree.prototype.traverse = function (visitor) {\n var Kids = this.Kids();\n for (var idx = 0, len = Kids.size(); idx < len; idx++) {\n var kidRef = Kids.get(idx);\n var kid = this.context.lookup(kidRef);\n if (kid instanceof PDFPageTree)\n kid.traverse(visitor);\n visitor(kid, kidRef);\n }\n };\n PDFPageTree.prototype.insertLeafKid = function (kidIdx, leafRef) {\n var Kids = this.Kids();\n this.ascend(function (node) {\n var newCount = node.Count().asNumber() + 1;\n node.set(PDFName.of('Count'), PDFNumber.of(newCount));\n });\n Kids.insert(kidIdx, leafRef);\n };\n PDFPageTree.prototype.removeKid = function (kidIdx) {\n var Kids = this.Kids();\n var kid = Kids.lookup(kidIdx);\n if (kid instanceof PDFPageLeaf) {\n this.ascend(function (node) {\n var newCount = node.Count().asNumber() - 1;\n node.set(PDFName.of('Count'), PDFNumber.of(newCount));\n });\n }\n Kids.remove(kidIdx);\n };\n PDFPageTree.withContext = function (context, parent) {\n var dict = new Map();\n dict.set(PDFName.of('Type'), PDFName.of('Pages'));\n dict.set(PDFName.of('Kids'), context.obj([]));\n dict.set(PDFName.of('Count'), context.obj(0));\n if (parent)\n dict.set(PDFName.of('Parent'), parent);\n return new PDFPageTree(dict, context);\n };\n PDFPageTree.fromMapWithContext = function (map, context) {\n return new PDFPageTree(map, context);\n };\n return PDFPageTree;\n}(PDFDict));\nexport default PDFPageTree;\n//# sourceMappingURL=PDFPageTree.js.map","import CharCodes from \"./CharCodes\";\nexport var IsDigit = new Uint8Array(256);\nIsDigit[CharCodes.Zero] = 1;\nIsDigit[CharCodes.One] = 1;\nIsDigit[CharCodes.Two] = 1;\nIsDigit[CharCodes.Three] = 1;\nIsDigit[CharCodes.Four] = 1;\nIsDigit[CharCodes.Five] = 1;\nIsDigit[CharCodes.Six] = 1;\nIsDigit[CharCodes.Seven] = 1;\nIsDigit[CharCodes.Eight] = 1;\nIsDigit[CharCodes.Nine] = 1;\nexport var IsNumericPrefix = new Uint8Array(256);\nIsNumericPrefix[CharCodes.Period] = 1;\nIsNumericPrefix[CharCodes.Plus] = 1;\nIsNumericPrefix[CharCodes.Minus] = 1;\nexport var IsNumeric = new Uint8Array(256);\nfor (var idx = 0, len = 256; idx < len; idx++) {\n IsNumeric[idx] = IsDigit[idx] || IsNumericPrefix[idx] ? 1 : 0;\n}\n//# sourceMappingURL=Numeric.js.map","import { NumberParsingError } from \"../errors\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { IsDigit, IsNumeric } from \"../syntax/Numeric\";\nimport { IsWhitespace } from \"../syntax/Whitespace\";\nimport { charFromCode } from \"../../utils\";\nvar Newline = CharCodes.Newline, CarriageReturn = CharCodes.CarriageReturn;\n// TODO: Throw error if eof is reached before finishing object parse...\nvar BaseParser = /** @class */ (function () {\n function BaseParser(bytes, capNumbers) {\n if (capNumbers === void 0) { capNumbers = false; }\n this.bytes = bytes;\n this.capNumbers = capNumbers;\n }\n BaseParser.prototype.parseRawInt = function () {\n var value = '';\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (!IsDigit[byte])\n break;\n value += charFromCode(this.bytes.next());\n }\n var numberValue = Number(value);\n if (!value || !isFinite(numberValue)) {\n throw new NumberParsingError(this.bytes.position(), value);\n }\n return numberValue;\n };\n // TODO: Maybe handle exponential format?\n // TODO: Compare performance of string concatenation to charFromCode(...bytes)\n BaseParser.prototype.parseRawNumber = function () {\n var value = '';\n // Parse integer-part, the leading (+ | - | . | 0-9)\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (!IsNumeric[byte])\n break;\n value += charFromCode(this.bytes.next());\n if (byte === CharCodes.Period)\n break;\n }\n // Parse decimal-part, the trailing (0-9)\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (!IsDigit[byte])\n break;\n value += charFromCode(this.bytes.next());\n }\n var numberValue = Number(value);\n if (!value || !isFinite(numberValue)) {\n throw new NumberParsingError(this.bytes.position(), value);\n }\n if (numberValue > Number.MAX_SAFE_INTEGER) {\n if (this.capNumbers) {\n var msg = \"Parsed number that is too large for some PDF readers: \" + value + \", using Number.MAX_SAFE_INTEGER instead.\";\n console.warn(msg);\n return Number.MAX_SAFE_INTEGER;\n }\n else {\n var msg = \"Parsed number that is too large for some PDF readers: \" + value + \", not capping.\";\n console.warn(msg);\n }\n }\n return numberValue;\n };\n BaseParser.prototype.skipWhitespace = function () {\n while (!this.bytes.done() && IsWhitespace[this.bytes.peek()]) {\n this.bytes.next();\n }\n };\n BaseParser.prototype.skipLine = function () {\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (byte === Newline || byte === CarriageReturn)\n return;\n this.bytes.next();\n }\n };\n BaseParser.prototype.skipComment = function () {\n if (this.bytes.peek() !== CharCodes.Percent)\n return false;\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (byte === Newline || byte === CarriageReturn)\n return true;\n this.bytes.next();\n }\n return true;\n };\n BaseParser.prototype.skipWhitespaceAndComments = function () {\n this.skipWhitespace();\n while (this.skipComment())\n this.skipWhitespace();\n };\n BaseParser.prototype.matchKeyword = function (keyword) {\n var initialOffset = this.bytes.offset();\n for (var idx = 0, len = keyword.length; idx < len; idx++) {\n if (this.bytes.done() || this.bytes.next() !== keyword[idx]) {\n this.bytes.moveTo(initialOffset);\n return false;\n }\n }\n return true;\n };\n return BaseParser;\n}());\nexport default BaseParser;\n//# sourceMappingURL=BaseParser.js.map","import { assertIs, error } from \"../utils\";\nexport var RotationTypes;\n(function (RotationTypes) {\n RotationTypes[\"Degrees\"] = \"degrees\";\n RotationTypes[\"Radians\"] = \"radians\";\n})(RotationTypes || (RotationTypes = {}));\nexport var radians = function (radianAngle) {\n assertIs(radianAngle, 'radianAngle', ['number']);\n return { type: RotationTypes.Radians, angle: radianAngle };\n};\nexport var degrees = function (degreeAngle) {\n assertIs(degreeAngle, 'degreeAngle', ['number']);\n return { type: RotationTypes.Degrees, angle: degreeAngle };\n};\nvar Radians = RotationTypes.Radians, Degrees = RotationTypes.Degrees;\nexport var degreesToRadians = function (degree) { return (degree * Math.PI) / 180; };\nexport var radiansToDegrees = function (radian) { return (radian * 180) / Math.PI; };\n// prettier-ignore\nexport var toRadians = function (rotation) {\n return rotation.type === Radians ? rotation.angle\n : rotation.type === Degrees ? degreesToRadians(rotation.angle)\n : error(\"Invalid rotation: \" + JSON.stringify(rotation));\n};\n// prettier-ignore\nexport var toDegrees = function (rotation) {\n return rotation.type === Radians ? radiansToDegrees(rotation.angle)\n : rotation.type === Degrees ? rotation.angle\n : error(\"Invalid rotation: \" + JSON.stringify(rotation));\n};\nexport var reduceRotation = function (degreeAngle) {\n if (degreeAngle === void 0) { degreeAngle = 0; }\n var quadrants = (degreeAngle / 90) % 4;\n if (quadrants === 0)\n return 0;\n if (quadrants === 1)\n return 90;\n if (quadrants === 2)\n return 180;\n if (quadrants === 3)\n return 270;\n return 0; // `degreeAngle` is not a multiple of 90\n};\nexport var adjustDimsForRotation = function (dims, degreeAngle) {\n if (degreeAngle === void 0) { degreeAngle = 0; }\n var rotation = reduceRotation(degreeAngle);\n return rotation === 90 || rotation === 270\n ? { width: dims.height, height: dims.width }\n : { width: dims.width, height: dims.height };\n};\nexport var rotateRectangle = function (rectangle, borderWidth, degreeAngle) {\n if (borderWidth === void 0) { borderWidth = 0; }\n if (degreeAngle === void 0) { degreeAngle = 0; }\n var x = rectangle.x, y = rectangle.y, w = rectangle.width, h = rectangle.height;\n var r = reduceRotation(degreeAngle);\n var b = borderWidth / 2;\n // prettier-ignore\n if (r === 0)\n return { x: x - b, y: y - b, width: w, height: h };\n else if (r === 90)\n return { x: x - h + b, y: y - b, width: h, height: w };\n else if (r === 180)\n return { x: x - w + b, y: y - h + b, width: w, height: h };\n else if (r === 270)\n return { x: x - b, y: y - w + b, width: h, height: w };\n else\n return { x: x - b, y: y - b, width: w, height: h };\n};\n//# sourceMappingURL=rotations.js.map","import { NextByteAssertionError } from \"../errors\";\nimport { decodePDFRawStream } from \"../streams/decode\";\nimport CharCodes from \"../syntax/CharCodes\";\n// TODO: See how line/col tracking affects performance\nvar ByteStream = /** @class */ (function () {\n function ByteStream(bytes) {\n this.idx = 0;\n this.line = 0;\n this.column = 0;\n this.bytes = bytes;\n this.length = this.bytes.length;\n }\n ByteStream.prototype.moveTo = function (offset) {\n this.idx = offset;\n };\n ByteStream.prototype.next = function () {\n var byte = this.bytes[this.idx++];\n if (byte === CharCodes.Newline) {\n this.line += 1;\n this.column = 0;\n }\n else {\n this.column += 1;\n }\n return byte;\n };\n ByteStream.prototype.assertNext = function (expected) {\n if (this.peek() !== expected) {\n throw new NextByteAssertionError(this.position(), expected, this.peek());\n }\n return this.next();\n };\n ByteStream.prototype.peek = function () {\n return this.bytes[this.idx];\n };\n ByteStream.prototype.peekAhead = function (steps) {\n return this.bytes[this.idx + steps];\n };\n ByteStream.prototype.peekAt = function (offset) {\n return this.bytes[offset];\n };\n ByteStream.prototype.done = function () {\n return this.idx >= this.length;\n };\n ByteStream.prototype.offset = function () {\n return this.idx;\n };\n ByteStream.prototype.slice = function (start, end) {\n return this.bytes.slice(start, end);\n };\n ByteStream.prototype.position = function () {\n return { line: this.line, column: this.column, offset: this.idx };\n };\n ByteStream.of = function (bytes) { return new ByteStream(bytes); };\n ByteStream.fromPDFRawStream = function (rawStream) {\n return ByteStream.of(decodePDFRawStream(rawStream).decode());\n };\n return ByteStream;\n}());\nexport default ByteStream;\n//# sourceMappingURL=ByteStream.js.map","import { __spreadArrays } from \"tslib\";\nimport CharCodes from \"./CharCodes\";\nvar Space = CharCodes.Space, CarriageReturn = CharCodes.CarriageReturn, Newline = CharCodes.Newline;\nvar stream = [\n CharCodes.s,\n CharCodes.t,\n CharCodes.r,\n CharCodes.e,\n CharCodes.a,\n CharCodes.m,\n];\nvar endstream = [\n CharCodes.e,\n CharCodes.n,\n CharCodes.d,\n CharCodes.s,\n CharCodes.t,\n CharCodes.r,\n CharCodes.e,\n CharCodes.a,\n CharCodes.m,\n];\nexport var Keywords = {\n header: [\n CharCodes.Percent,\n CharCodes.P,\n CharCodes.D,\n CharCodes.F,\n CharCodes.Dash,\n ],\n eof: [\n CharCodes.Percent,\n CharCodes.Percent,\n CharCodes.E,\n CharCodes.O,\n CharCodes.F,\n ],\n obj: [CharCodes.o, CharCodes.b, CharCodes.j],\n endobj: [\n CharCodes.e,\n CharCodes.n,\n CharCodes.d,\n CharCodes.o,\n CharCodes.b,\n CharCodes.j,\n ],\n xref: [CharCodes.x, CharCodes.r, CharCodes.e, CharCodes.f],\n trailer: [\n CharCodes.t,\n CharCodes.r,\n CharCodes.a,\n CharCodes.i,\n CharCodes.l,\n CharCodes.e,\n CharCodes.r,\n ],\n startxref: [\n CharCodes.s,\n CharCodes.t,\n CharCodes.a,\n CharCodes.r,\n CharCodes.t,\n CharCodes.x,\n CharCodes.r,\n CharCodes.e,\n CharCodes.f,\n ],\n true: [CharCodes.t, CharCodes.r, CharCodes.u, CharCodes.e],\n false: [CharCodes.f, CharCodes.a, CharCodes.l, CharCodes.s, CharCodes.e],\n null: [CharCodes.n, CharCodes.u, CharCodes.l, CharCodes.l],\n stream: stream,\n streamEOF1: __spreadArrays(stream, [Space, CarriageReturn, Newline]),\n streamEOF2: __spreadArrays(stream, [CarriageReturn, Newline]),\n streamEOF3: __spreadArrays(stream, [CarriageReturn]),\n streamEOF4: __spreadArrays(stream, [Newline]),\n endstream: endstream,\n EOF1endstream: __spreadArrays([CarriageReturn, Newline], endstream),\n EOF2endstream: __spreadArrays([CarriageReturn], endstream),\n EOF3endstream: __spreadArrays([Newline], endstream),\n};\n//# sourceMappingURL=Keywords.js.map","import { __extends } from \"tslib\";\nimport { PDFObjectParsingError, PDFStreamParsingError, UnbalancedParenthesisError, } from \"../errors\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFBool from \"../objects/PDFBool\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNull from \"../objects/PDFNull\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRawStream from \"../objects/PDFRawStream\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFString from \"../objects/PDFString\";\nimport BaseParser from \"./BaseParser\";\nimport ByteStream from \"./ByteStream\";\nimport PDFCatalog from \"../structures/PDFCatalog\";\nimport PDFPageLeaf from \"../structures/PDFPageLeaf\";\nimport PDFPageTree from \"../structures/PDFPageTree\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { IsDelimiter } from \"../syntax/Delimiters\";\nimport { Keywords } from \"../syntax/Keywords\";\nimport { IsDigit, IsNumeric } from \"../syntax/Numeric\";\nimport { IsWhitespace } from \"../syntax/Whitespace\";\nimport { charFromCode } from \"../../utils\";\n// TODO: Throw error if eof is reached before finishing object parse...\nvar PDFObjectParser = /** @class */ (function (_super) {\n __extends(PDFObjectParser, _super);\n function PDFObjectParser(byteStream, context, capNumbers) {\n if (capNumbers === void 0) { capNumbers = false; }\n var _this = _super.call(this, byteStream, capNumbers) || this;\n _this.context = context;\n return _this;\n }\n // TODO: Is it possible to reduce duplicate parsing for ref lookaheads?\n PDFObjectParser.prototype.parseObject = function () {\n this.skipWhitespaceAndComments();\n if (this.matchKeyword(Keywords.true))\n return PDFBool.True;\n if (this.matchKeyword(Keywords.false))\n return PDFBool.False;\n if (this.matchKeyword(Keywords.null))\n return PDFNull;\n var byte = this.bytes.peek();\n if (byte === CharCodes.LessThan &&\n this.bytes.peekAhead(1) === CharCodes.LessThan) {\n return this.parseDictOrStream();\n }\n if (byte === CharCodes.LessThan)\n return this.parseHexString();\n if (byte === CharCodes.LeftParen)\n return this.parseString();\n if (byte === CharCodes.ForwardSlash)\n return this.parseName();\n if (byte === CharCodes.LeftSquareBracket)\n return this.parseArray();\n if (IsNumeric[byte])\n return this.parseNumberOrRef();\n throw new PDFObjectParsingError(this.bytes.position(), byte);\n };\n PDFObjectParser.prototype.parseNumberOrRef = function () {\n var firstNum = this.parseRawNumber();\n this.skipWhitespaceAndComments();\n var lookaheadStart = this.bytes.offset();\n if (IsDigit[this.bytes.peek()]) {\n var secondNum = this.parseRawNumber();\n this.skipWhitespaceAndComments();\n if (this.bytes.peek() === CharCodes.R) {\n this.bytes.assertNext(CharCodes.R);\n return PDFRef.of(firstNum, secondNum);\n }\n }\n this.bytes.moveTo(lookaheadStart);\n return PDFNumber.of(firstNum);\n };\n // TODO: Maybe update PDFHexString.of() logic to remove whitespace and validate input?\n PDFObjectParser.prototype.parseHexString = function () {\n var value = '';\n this.bytes.assertNext(CharCodes.LessThan);\n while (!this.bytes.done() && this.bytes.peek() !== CharCodes.GreaterThan) {\n value += charFromCode(this.bytes.next());\n }\n this.bytes.assertNext(CharCodes.GreaterThan);\n return PDFHexString.of(value);\n };\n PDFObjectParser.prototype.parseString = function () {\n var nestingLvl = 0;\n var isEscaped = false;\n var value = '';\n while (!this.bytes.done()) {\n var byte = this.bytes.next();\n value += charFromCode(byte);\n // Check for unescaped parenthesis\n if (!isEscaped) {\n if (byte === CharCodes.LeftParen)\n nestingLvl += 1;\n if (byte === CharCodes.RightParen)\n nestingLvl -= 1;\n }\n // Track whether current character is being escaped or not\n if (byte === CharCodes.BackSlash) {\n isEscaped = !isEscaped;\n }\n else if (isEscaped) {\n isEscaped = false;\n }\n // Once (if) the unescaped parenthesis balance out, return their contents\n if (nestingLvl === 0) {\n // Remove the outer parens so they aren't part of the contents\n return PDFString.of(value.substring(1, value.length - 1));\n }\n }\n throw new UnbalancedParenthesisError(this.bytes.position());\n };\n // TODO: Compare performance of string concatenation to charFromCode(...bytes)\n // TODO: Maybe preallocate small Uint8Array if can use charFromCode?\n PDFObjectParser.prototype.parseName = function () {\n this.bytes.assertNext(CharCodes.ForwardSlash);\n var name = '';\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (IsWhitespace[byte] || IsDelimiter[byte])\n break;\n name += charFromCode(byte);\n this.bytes.next();\n }\n return PDFName.of(name);\n };\n PDFObjectParser.prototype.parseArray = function () {\n this.bytes.assertNext(CharCodes.LeftSquareBracket);\n this.skipWhitespaceAndComments();\n var pdfArray = PDFArray.withContext(this.context);\n while (this.bytes.peek() !== CharCodes.RightSquareBracket) {\n var element = this.parseObject();\n pdfArray.push(element);\n this.skipWhitespaceAndComments();\n }\n this.bytes.assertNext(CharCodes.RightSquareBracket);\n return pdfArray;\n };\n PDFObjectParser.prototype.parseDict = function () {\n this.bytes.assertNext(CharCodes.LessThan);\n this.bytes.assertNext(CharCodes.LessThan);\n this.skipWhitespaceAndComments();\n var dict = new Map();\n while (!this.bytes.done() &&\n this.bytes.peek() !== CharCodes.GreaterThan &&\n this.bytes.peekAhead(1) !== CharCodes.GreaterThan) {\n var key = this.parseName();\n var value = this.parseObject();\n dict.set(key, value);\n this.skipWhitespaceAndComments();\n }\n this.skipWhitespaceAndComments();\n this.bytes.assertNext(CharCodes.GreaterThan);\n this.bytes.assertNext(CharCodes.GreaterThan);\n var Type = dict.get(PDFName.of('Type'));\n if (Type === PDFName.of('Catalog')) {\n return PDFCatalog.fromMapWithContext(dict, this.context);\n }\n else if (Type === PDFName.of('Pages')) {\n return PDFPageTree.fromMapWithContext(dict, this.context);\n }\n else if (Type === PDFName.of('Page')) {\n return PDFPageLeaf.fromMapWithContext(dict, this.context);\n }\n else {\n return PDFDict.fromMapWithContext(dict, this.context);\n }\n };\n PDFObjectParser.prototype.parseDictOrStream = function () {\n var startPos = this.bytes.position();\n var dict = this.parseDict();\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.streamEOF1) &&\n !this.matchKeyword(Keywords.streamEOF2) &&\n !this.matchKeyword(Keywords.streamEOF3) &&\n !this.matchKeyword(Keywords.streamEOF4) &&\n !this.matchKeyword(Keywords.stream)) {\n return dict;\n }\n var start = this.bytes.offset();\n var end;\n var Length = dict.get(PDFName.of('Length'));\n if (Length instanceof PDFNumber) {\n end = start + Length.asNumber();\n this.bytes.moveTo(end);\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.endstream)) {\n this.bytes.moveTo(start);\n end = this.findEndOfStreamFallback(startPos);\n }\n }\n else {\n end = this.findEndOfStreamFallback(startPos);\n }\n var contents = this.bytes.slice(start, end);\n return PDFRawStream.of(dict, contents);\n };\n PDFObjectParser.prototype.findEndOfStreamFallback = function (startPos) {\n // Move to end of stream, while handling nested streams\n var nestingLvl = 1;\n var end = this.bytes.offset();\n while (!this.bytes.done()) {\n end = this.bytes.offset();\n if (this.matchKeyword(Keywords.stream)) {\n nestingLvl += 1;\n }\n else if (this.matchKeyword(Keywords.EOF1endstream) ||\n this.matchKeyword(Keywords.EOF2endstream) ||\n this.matchKeyword(Keywords.EOF3endstream) ||\n this.matchKeyword(Keywords.endstream)) {\n nestingLvl -= 1;\n }\n else {\n this.bytes.next();\n }\n if (nestingLvl === 0)\n break;\n }\n if (nestingLvl !== 0)\n throw new PDFStreamParsingError(startPos);\n return end;\n };\n PDFObjectParser.forBytes = function (bytes, context, capNumbers) { return new PDFObjectParser(ByteStream.of(bytes), context, capNumbers); };\n PDFObjectParser.forByteStream = function (byteStream, context, capNumbers) {\n if (capNumbers === void 0) { capNumbers = false; }\n return new PDFObjectParser(byteStream, context, capNumbers);\n };\n return PDFObjectParser;\n}(BaseParser));\nexport default PDFObjectParser;\n//# sourceMappingURL=PDFObjectParser.js.map","import { __awaiter, __extends, __generator } from \"tslib\";\nimport { ReparseError } from \"../errors\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRef from \"../objects/PDFRef\";\nimport ByteStream from \"./ByteStream\";\nimport PDFObjectParser from \"./PDFObjectParser\";\nimport { waitForTick } from \"../../utils\";\nvar PDFObjectStreamParser = /** @class */ (function (_super) {\n __extends(PDFObjectStreamParser, _super);\n function PDFObjectStreamParser(rawStream, shouldWaitForTick) {\n var _this = _super.call(this, ByteStream.fromPDFRawStream(rawStream), rawStream.dict.context) || this;\n var dict = rawStream.dict;\n _this.alreadyParsed = false;\n _this.shouldWaitForTick = shouldWaitForTick || (function () { return false; });\n _this.firstOffset = dict.lookup(PDFName.of('First'), PDFNumber).asNumber();\n _this.objectCount = dict.lookup(PDFName.of('N'), PDFNumber).asNumber();\n return _this;\n }\n PDFObjectStreamParser.prototype.parseIntoContext = function () {\n return __awaiter(this, void 0, void 0, function () {\n var offsetsAndObjectNumbers, idx, len, _a, objectNumber, offset, object, ref;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (this.alreadyParsed) {\n throw new ReparseError('PDFObjectStreamParser', 'parseIntoContext');\n }\n this.alreadyParsed = true;\n offsetsAndObjectNumbers = this.parseOffsetsAndObjectNumbers();\n idx = 0, len = offsetsAndObjectNumbers.length;\n _b.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n _a = offsetsAndObjectNumbers[idx], objectNumber = _a.objectNumber, offset = _a.offset;\n this.bytes.moveTo(this.firstOffset + offset);\n object = this.parseObject();\n ref = PDFRef.of(objectNumber, 0);\n this.context.assign(ref, object);\n if (!this.shouldWaitForTick()) return [3 /*break*/, 3];\n return [4 /*yield*/, waitForTick()];\n case 2:\n _b.sent();\n _b.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n PDFObjectStreamParser.prototype.parseOffsetsAndObjectNumbers = function () {\n var offsetsAndObjectNumbers = [];\n for (var idx = 0, len = this.objectCount; idx < len; idx++) {\n this.skipWhitespaceAndComments();\n var objectNumber = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var offset = this.parseRawInt();\n offsetsAndObjectNumbers.push({ objectNumber: objectNumber, offset: offset });\n }\n return offsetsAndObjectNumbers;\n };\n PDFObjectStreamParser.forStream = function (rawStream, shouldWaitForTick) { return new PDFObjectStreamParser(rawStream, shouldWaitForTick); };\n return PDFObjectStreamParser;\n}(PDFObjectParser));\nexport default PDFObjectStreamParser;\n//# sourceMappingURL=PDFObjectStreamParser.js.map","import { ReparseError } from \"../errors\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRef from \"../objects/PDFRef\";\nimport ByteStream from \"./ByteStream\";\nvar PDFXRefStreamParser = /** @class */ (function () {\n function PDFXRefStreamParser(rawStream) {\n this.alreadyParsed = false;\n this.dict = rawStream.dict;\n this.bytes = ByteStream.fromPDFRawStream(rawStream);\n this.context = this.dict.context;\n var Size = this.dict.lookup(PDFName.of('Size'), PDFNumber);\n var Index = this.dict.lookup(PDFName.of('Index'));\n if (Index instanceof PDFArray) {\n this.subsections = [];\n for (var idx = 0, len = Index.size(); idx < len; idx += 2) {\n var firstObjectNumber = Index.lookup(idx + 0, PDFNumber).asNumber();\n var length_1 = Index.lookup(idx + 1, PDFNumber).asNumber();\n this.subsections.push({ firstObjectNumber: firstObjectNumber, length: length_1 });\n }\n }\n else {\n this.subsections = [{ firstObjectNumber: 0, length: Size.asNumber() }];\n }\n var W = this.dict.lookup(PDFName.of('W'), PDFArray);\n this.byteWidths = [-1, -1, -1];\n for (var idx = 0, len = W.size(); idx < len; idx++) {\n this.byteWidths[idx] = W.lookup(idx, PDFNumber).asNumber();\n }\n }\n PDFXRefStreamParser.prototype.parseIntoContext = function () {\n if (this.alreadyParsed) {\n throw new ReparseError('PDFXRefStreamParser', 'parseIntoContext');\n }\n this.alreadyParsed = true;\n this.context.trailerInfo = {\n Root: this.dict.get(PDFName.of('Root')),\n Encrypt: this.dict.get(PDFName.of('Encrypt')),\n Info: this.dict.get(PDFName.of('Info')),\n ID: this.dict.get(PDFName.of('ID')),\n };\n var entries = this.parseEntries();\n // for (let idx = 0, len = entries.length; idx < len; idx++) {\n // const entry = entries[idx];\n // if (entry.deleted) this.context.delete(entry.ref);\n // }\n return entries;\n };\n PDFXRefStreamParser.prototype.parseEntries = function () {\n var entries = [];\n var _a = this.byteWidths, typeFieldWidth = _a[0], offsetFieldWidth = _a[1], genFieldWidth = _a[2];\n for (var subsectionIdx = 0, subsectionLen = this.subsections.length; subsectionIdx < subsectionLen; subsectionIdx++) {\n var _b = this.subsections[subsectionIdx], firstObjectNumber = _b.firstObjectNumber, length_2 = _b.length;\n for (var objIdx = 0; objIdx < length_2; objIdx++) {\n var type = 0;\n for (var idx = 0, len = typeFieldWidth; idx < len; idx++) {\n type = (type << 8) | this.bytes.next();\n }\n var offset = 0;\n for (var idx = 0, len = offsetFieldWidth; idx < len; idx++) {\n offset = (offset << 8) | this.bytes.next();\n }\n var generationNumber = 0;\n for (var idx = 0, len = genFieldWidth; idx < len; idx++) {\n generationNumber = (generationNumber << 8) | this.bytes.next();\n }\n // When the `type` field is absent, it defaults to 1\n if (typeFieldWidth === 0)\n type = 1;\n var objectNumber = firstObjectNumber + objIdx;\n var entry = {\n ref: PDFRef.of(objectNumber, generationNumber),\n offset: offset,\n deleted: type === 0,\n inObjectStream: type === 2,\n };\n entries.push(entry);\n }\n }\n return entries;\n };\n PDFXRefStreamParser.forStream = function (rawStream) {\n return new PDFXRefStreamParser(rawStream);\n };\n return PDFXRefStreamParser;\n}());\nexport default PDFXRefStreamParser;\n//# sourceMappingURL=PDFXRefStreamParser.js.map","import { __awaiter, __extends, __generator } from \"tslib\";\nimport PDFCrossRefSection from \"../document/PDFCrossRefSection\";\nimport PDFHeader from \"../document/PDFHeader\";\nimport PDFTrailer from \"../document/PDFTrailer\";\nimport { MissingKeywordError, MissingPDFHeaderError, PDFInvalidObjectParsingError, ReparseError, StalledParserError, } from \"../errors\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFInvalidObject from \"../objects/PDFInvalidObject\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFRawStream from \"../objects/PDFRawStream\";\nimport PDFRef from \"../objects/PDFRef\";\nimport ByteStream from \"./ByteStream\";\nimport PDFObjectParser from \"./PDFObjectParser\";\nimport PDFObjectStreamParser from \"./PDFObjectStreamParser\";\nimport PDFXRefStreamParser from \"./PDFXRefStreamParser\";\nimport PDFContext from \"../PDFContext\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { Keywords } from \"../syntax/Keywords\";\nimport { IsDigit } from \"../syntax/Numeric\";\nimport { waitForTick } from \"../../utils\";\nvar PDFParser = /** @class */ (function (_super) {\n __extends(PDFParser, _super);\n function PDFParser(pdfBytes, objectsPerTick, throwOnInvalidObject, capNumbers) {\n if (objectsPerTick === void 0) { objectsPerTick = Infinity; }\n if (throwOnInvalidObject === void 0) { throwOnInvalidObject = false; }\n if (capNumbers === void 0) { capNumbers = false; }\n var _this = _super.call(this, ByteStream.of(pdfBytes), PDFContext.create(), capNumbers) || this;\n _this.alreadyParsed = false;\n _this.parsedObjects = 0;\n _this.shouldWaitForTick = function () {\n _this.parsedObjects += 1;\n return _this.parsedObjects % _this.objectsPerTick === 0;\n };\n _this.objectsPerTick = objectsPerTick;\n _this.throwOnInvalidObject = throwOnInvalidObject;\n return _this;\n }\n PDFParser.prototype.parseDocument = function () {\n return __awaiter(this, void 0, void 0, function () {\n var prevOffset, offset;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this.alreadyParsed) {\n throw new ReparseError('PDFParser', 'parseDocument');\n }\n this.alreadyParsed = true;\n this.context.header = this.parseHeader();\n _a.label = 1;\n case 1:\n if (!!this.bytes.done()) return [3 /*break*/, 3];\n return [4 /*yield*/, this.parseDocumentSection()];\n case 2:\n _a.sent();\n offset = this.bytes.offset();\n if (offset === prevOffset) {\n throw new StalledParserError(this.bytes.position());\n }\n prevOffset = offset;\n return [3 /*break*/, 1];\n case 3:\n this.maybeRecoverRoot();\n if (this.context.lookup(PDFRef.of(0))) {\n console.warn('Removing parsed object: 0 0 R');\n this.context.delete(PDFRef.of(0));\n }\n return [2 /*return*/, this.context];\n }\n });\n });\n };\n PDFParser.prototype.maybeRecoverRoot = function () {\n var isValidCatalog = function (obj) {\n return obj instanceof PDFDict &&\n obj.lookup(PDFName.of('Type')) === PDFName.of('Catalog');\n };\n var catalog = this.context.lookup(this.context.trailerInfo.Root);\n if (!isValidCatalog(catalog)) {\n var indirectObjects = this.context.enumerateIndirectObjects();\n for (var idx = 0, len = indirectObjects.length; idx < len; idx++) {\n var _a = indirectObjects[idx], ref = _a[0], object = _a[1];\n if (isValidCatalog(object)) {\n this.context.trailerInfo.Root = ref;\n }\n }\n }\n };\n PDFParser.prototype.parseHeader = function () {\n while (!this.bytes.done()) {\n if (this.matchKeyword(Keywords.header)) {\n var major = this.parseRawInt();\n this.bytes.assertNext(CharCodes.Period);\n var minor = this.parseRawInt();\n var header = PDFHeader.forVersion(major, minor);\n this.skipBinaryHeaderComment();\n return header;\n }\n this.bytes.next();\n }\n throw new MissingPDFHeaderError(this.bytes.position());\n };\n PDFParser.prototype.parseIndirectObjectHeader = function () {\n this.skipWhitespaceAndComments();\n var objectNumber = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var generationNumber = this.parseRawInt();\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.obj)) {\n throw new MissingKeywordError(this.bytes.position(), Keywords.obj);\n }\n return PDFRef.of(objectNumber, generationNumber);\n };\n PDFParser.prototype.matchIndirectObjectHeader = function () {\n var initialOffset = this.bytes.offset();\n try {\n this.parseIndirectObjectHeader();\n return true;\n }\n catch (e) {\n this.bytes.moveTo(initialOffset);\n return false;\n }\n };\n PDFParser.prototype.parseIndirectObject = function () {\n return __awaiter(this, void 0, void 0, function () {\n var ref, object;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n ref = this.parseIndirectObjectHeader();\n this.skipWhitespaceAndComments();\n object = this.parseObject();\n this.skipWhitespaceAndComments();\n // if (!this.matchKeyword(Keywords.endobj)) {\n // throw new MissingKeywordError(this.bytes.position(), Keywords.endobj);\n // }\n // TODO: Log a warning if this fails...\n this.matchKeyword(Keywords.endobj);\n if (!(object instanceof PDFRawStream &&\n object.dict.lookup(PDFName.of('Type')) === PDFName.of('ObjStm'))) return [3 /*break*/, 2];\n return [4 /*yield*/, PDFObjectStreamParser.forStream(object, this.shouldWaitForTick).parseIntoContext()];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n if (object instanceof PDFRawStream &&\n object.dict.lookup(PDFName.of('Type')) === PDFName.of('XRef')) {\n PDFXRefStreamParser.forStream(object).parseIntoContext();\n }\n else {\n this.context.assign(ref, object);\n }\n _a.label = 3;\n case 3: return [2 /*return*/, ref];\n }\n });\n });\n };\n // TODO: Improve and clean this up\n PDFParser.prototype.tryToParseInvalidIndirectObject = function () {\n var startPos = this.bytes.position();\n var msg = \"Trying to parse invalid object: \" + JSON.stringify(startPos) + \")\";\n if (this.throwOnInvalidObject)\n throw new Error(msg);\n console.warn(msg);\n var ref = this.parseIndirectObjectHeader();\n console.warn(\"Invalid object ref: \" + ref);\n this.skipWhitespaceAndComments();\n var start = this.bytes.offset();\n var failed = true;\n while (!this.bytes.done()) {\n if (this.matchKeyword(Keywords.endobj)) {\n failed = false;\n }\n if (!failed)\n break;\n this.bytes.next();\n }\n if (failed)\n throw new PDFInvalidObjectParsingError(startPos);\n var end = this.bytes.offset() - Keywords.endobj.length;\n var object = PDFInvalidObject.of(this.bytes.slice(start, end));\n this.context.assign(ref, object);\n return ref;\n };\n PDFParser.prototype.parseIndirectObjects = function () {\n return __awaiter(this, void 0, void 0, function () {\n var initialOffset, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.skipWhitespaceAndComments();\n _a.label = 1;\n case 1:\n if (!(!this.bytes.done() && IsDigit[this.bytes.peek()])) return [3 /*break*/, 8];\n initialOffset = this.bytes.offset();\n _a.label = 2;\n case 2:\n _a.trys.push([2, 4, , 5]);\n return [4 /*yield*/, this.parseIndirectObject()];\n case 3:\n _a.sent();\n return [3 /*break*/, 5];\n case 4:\n e_1 = _a.sent();\n // TODO: Add tracing/logging mechanism to track when this happens!\n this.bytes.moveTo(initialOffset);\n this.tryToParseInvalidIndirectObject();\n return [3 /*break*/, 5];\n case 5:\n this.skipWhitespaceAndComments();\n // TODO: Can this be done only when needed, to avoid harming performance?\n this.skipJibberish();\n if (!this.shouldWaitForTick()) return [3 /*break*/, 7];\n return [4 /*yield*/, waitForTick()];\n case 6:\n _a.sent();\n _a.label = 7;\n case 7: return [3 /*break*/, 1];\n case 8: return [2 /*return*/];\n }\n });\n });\n };\n PDFParser.prototype.maybeParseCrossRefSection = function () {\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.xref))\n return;\n this.skipWhitespaceAndComments();\n var objectNumber = -1;\n var xref = PDFCrossRefSection.createEmpty();\n while (!this.bytes.done() && IsDigit[this.bytes.peek()]) {\n var firstInt = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var secondInt = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var byte = this.bytes.peek();\n if (byte === CharCodes.n || byte === CharCodes.f) {\n var ref = PDFRef.of(objectNumber, secondInt);\n if (this.bytes.next() === CharCodes.n) {\n xref.addEntry(ref, firstInt);\n }\n else {\n // this.context.delete(ref);\n xref.addDeletedEntry(ref, firstInt);\n }\n objectNumber += 1;\n }\n else {\n objectNumber = firstInt;\n }\n this.skipWhitespaceAndComments();\n }\n return xref;\n };\n PDFParser.prototype.maybeParseTrailerDict = function () {\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.trailer))\n return;\n this.skipWhitespaceAndComments();\n var dict = this.parseDict();\n var context = this.context;\n context.trailerInfo = {\n Root: dict.get(PDFName.of('Root')) || context.trailerInfo.Root,\n Encrypt: dict.get(PDFName.of('Encrypt')) || context.trailerInfo.Encrypt,\n Info: dict.get(PDFName.of('Info')) || context.trailerInfo.Info,\n ID: dict.get(PDFName.of('ID')) || context.trailerInfo.ID,\n };\n };\n PDFParser.prototype.maybeParseTrailer = function () {\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.startxref))\n return;\n this.skipWhitespaceAndComments();\n var offset = this.parseRawInt();\n this.skipWhitespace();\n this.matchKeyword(Keywords.eof);\n this.skipWhitespaceAndComments();\n this.matchKeyword(Keywords.eof);\n this.skipWhitespaceAndComments();\n return PDFTrailer.forLastCrossRefSectionOffset(offset);\n };\n PDFParser.prototype.parseDocumentSection = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.parseIndirectObjects()];\n case 1:\n _a.sent();\n this.maybeParseCrossRefSection();\n this.maybeParseTrailerDict();\n this.maybeParseTrailer();\n // TODO: Can this be done only when needed, to avoid harming performance?\n this.skipJibberish();\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * This operation is not necessary for valid PDF files. But some invalid PDFs\n * contain jibberish in between indirect objects. This method is designed to\n * skip past that jibberish, should it exist, until it reaches the next\n * indirect object header, an xref table section, or the file trailer.\n */\n PDFParser.prototype.skipJibberish = function () {\n this.skipWhitespaceAndComments();\n while (!this.bytes.done()) {\n var initialOffset = this.bytes.offset();\n var byte = this.bytes.peek();\n var isAlphaNumeric = byte >= CharCodes.Space && byte <= CharCodes.Tilde;\n if (isAlphaNumeric) {\n if (this.matchKeyword(Keywords.xref) ||\n this.matchKeyword(Keywords.trailer) ||\n this.matchKeyword(Keywords.startxref) ||\n this.matchIndirectObjectHeader()) {\n this.bytes.moveTo(initialOffset);\n break;\n }\n }\n this.bytes.next();\n }\n };\n /**\n * Skips the binary comment following a PDF header. The specification\n * defines this binary comment (section 7.5.2 File Header) as a sequence of 4\n * or more bytes that are 128 or greater, and which are preceded by a \"%\".\n *\n * This would imply that to strip out this binary comment, we could check for\n * a sequence of bytes starting with \"%\", and remove all subsequent bytes that\n * are 128 or greater. This works for many documents that properly comply with\n * the spec. But in the wild, there are PDFs that omit the leading \"%\", and\n * include bytes that are less than 128 (e.g. 0 or 1). So in order to parse\n * these headers correctly, we just throw out all bytes leading up to the\n * first indirect object header.\n */\n PDFParser.prototype.skipBinaryHeaderComment = function () {\n this.skipWhitespaceAndComments();\n try {\n var initialOffset = this.bytes.offset();\n this.parseIndirectObjectHeader();\n this.bytes.moveTo(initialOffset);\n }\n catch (e) {\n this.bytes.next();\n this.skipWhitespaceAndComments();\n }\n };\n PDFParser.forBytesWithOptions = function (pdfBytes, objectsPerTick, throwOnInvalidObject, capNumbers) {\n return new PDFParser(pdfBytes, objectsPerTick, throwOnInvalidObject, capNumbers);\n };\n return PDFParser;\n}(PDFObjectParser));\nexport default PDFParser;\n//# sourceMappingURL=PDFParser.js.map","import { PDFName, PDFNumber } from \"../core\";\nexport var asPDFName = function (name) {\n return name instanceof PDFName ? name : PDFName.of(name);\n};\nexport var asPDFNumber = function (num) {\n return num instanceof PDFNumber ? num : PDFNumber.of(num);\n};\nexport var asNumber = function (num) {\n return num instanceof PDFNumber ? num.asNumber() : num;\n};\n//# sourceMappingURL=objects.js.map","import { asNumber, asPDFName, asPDFNumber } from \"./objects\";\nimport { degreesToRadians } from \"./rotations\";\nimport { PDFOperator, PDFOperatorNames as Ops, } from \"../core\";\n/* ==================== Clipping Path Operators ==================== */\nexport var clip = function () { return PDFOperator.of(Ops.ClipNonZero); };\nexport var clipEvenOdd = function () { return PDFOperator.of(Ops.ClipEvenOdd); };\n/* ==================== Graphics State Operators ==================== */\nvar cos = Math.cos, sin = Math.sin, tan = Math.tan;\nexport var concatTransformationMatrix = function (a, b, c, d, e, f) {\n return PDFOperator.of(Ops.ConcatTransformationMatrix, [\n asPDFNumber(a),\n asPDFNumber(b),\n asPDFNumber(c),\n asPDFNumber(d),\n asPDFNumber(e),\n asPDFNumber(f),\n ]);\n};\nexport var translate = function (xPos, yPos) {\n return concatTransformationMatrix(1, 0, 0, 1, xPos, yPos);\n};\nexport var scale = function (xPos, yPos) {\n return concatTransformationMatrix(xPos, 0, 0, yPos, 0, 0);\n};\nexport var rotateRadians = function (angle) {\n return concatTransformationMatrix(cos(asNumber(angle)), sin(asNumber(angle)), -sin(asNumber(angle)), cos(asNumber(angle)), 0, 0);\n};\nexport var rotateDegrees = function (angle) {\n return rotateRadians(degreesToRadians(asNumber(angle)));\n};\nexport var skewRadians = function (xSkewAngle, ySkewAngle) {\n return concatTransformationMatrix(1, tan(asNumber(xSkewAngle)), tan(asNumber(ySkewAngle)), 1, 0, 0);\n};\nexport var skewDegrees = function (xSkewAngle, ySkewAngle) {\n return skewRadians(degreesToRadians(asNumber(xSkewAngle)), degreesToRadians(asNumber(ySkewAngle)));\n};\nexport var setDashPattern = function (dashArray, dashPhase) {\n return PDFOperator.of(Ops.SetLineDashPattern, [\n \"[\" + dashArray.map(asPDFNumber).join(' ') + \"]\",\n asPDFNumber(dashPhase),\n ]);\n};\nexport var restoreDashPattern = function () { return setDashPattern([], 0); };\nexport var LineCapStyle;\n(function (LineCapStyle) {\n LineCapStyle[LineCapStyle[\"Butt\"] = 0] = \"Butt\";\n LineCapStyle[LineCapStyle[\"Round\"] = 1] = \"Round\";\n LineCapStyle[LineCapStyle[\"Projecting\"] = 2] = \"Projecting\";\n})(LineCapStyle || (LineCapStyle = {}));\nexport var setLineCap = function (style) {\n return PDFOperator.of(Ops.SetLineCapStyle, [asPDFNumber(style)]);\n};\nexport var LineJoinStyle;\n(function (LineJoinStyle) {\n LineJoinStyle[LineJoinStyle[\"Miter\"] = 0] = \"Miter\";\n LineJoinStyle[LineJoinStyle[\"Round\"] = 1] = \"Round\";\n LineJoinStyle[LineJoinStyle[\"Bevel\"] = 2] = \"Bevel\";\n})(LineJoinStyle || (LineJoinStyle = {}));\nexport var setLineJoin = function (style) {\n return PDFOperator.of(Ops.SetLineJoinStyle, [asPDFNumber(style)]);\n};\nexport var setGraphicsState = function (state) {\n return PDFOperator.of(Ops.SetGraphicsStateParams, [asPDFName(state)]);\n};\nexport var pushGraphicsState = function () { return PDFOperator.of(Ops.PushGraphicsState); };\nexport var popGraphicsState = function () { return PDFOperator.of(Ops.PopGraphicsState); };\nexport var setLineWidth = function (width) {\n return PDFOperator.of(Ops.SetLineWidth, [asPDFNumber(width)]);\n};\n/* ==================== Path Construction Operators ==================== */\nexport var appendBezierCurve = function (x1, y1, x2, y2, x3, y3) {\n return PDFOperator.of(Ops.AppendBezierCurve, [\n asPDFNumber(x1),\n asPDFNumber(y1),\n asPDFNumber(x2),\n asPDFNumber(y2),\n asPDFNumber(x3),\n asPDFNumber(y3),\n ]);\n};\nexport var appendQuadraticCurve = function (x1, y1, x2, y2) {\n return PDFOperator.of(Ops.CurveToReplicateInitialPoint, [\n asPDFNumber(x1),\n asPDFNumber(y1),\n asPDFNumber(x2),\n asPDFNumber(y2),\n ]);\n};\nexport var closePath = function () { return PDFOperator.of(Ops.ClosePath); };\nexport var moveTo = function (xPos, yPos) {\n return PDFOperator.of(Ops.MoveTo, [asPDFNumber(xPos), asPDFNumber(yPos)]);\n};\nexport var lineTo = function (xPos, yPos) {\n return PDFOperator.of(Ops.LineTo, [asPDFNumber(xPos), asPDFNumber(yPos)]);\n};\n/**\n * @param xPos x coordinate for the lower left corner of the rectangle\n * @param yPos y coordinate for the lower left corner of the rectangle\n * @param width width of the rectangle\n * @param height height of the rectangle\n */\nexport var rectangle = function (xPos, yPos, width, height) {\n return PDFOperator.of(Ops.AppendRectangle, [\n asPDFNumber(xPos),\n asPDFNumber(yPos),\n asPDFNumber(width),\n asPDFNumber(height),\n ]);\n};\n/**\n * @param xPos x coordinate for the lower left corner of the square\n * @param yPos y coordinate for the lower left corner of the square\n * @param size width and height of the square\n */\nexport var square = function (xPos, yPos, size) {\n return rectangle(xPos, yPos, size, size);\n};\n/* ==================== Path Painting Operators ==================== */\nexport var stroke = function () { return PDFOperator.of(Ops.StrokePath); };\nexport var fill = function () { return PDFOperator.of(Ops.FillNonZero); };\nexport var fillAndStroke = function () { return PDFOperator.of(Ops.FillNonZeroAndStroke); };\nexport var endPath = function () { return PDFOperator.of(Ops.EndPath); };\n/* ==================== Text Positioning Operators ==================== */\nexport var nextLine = function () { return PDFOperator.of(Ops.NextLine); };\nexport var moveText = function (x, y) {\n return PDFOperator.of(Ops.MoveText, [asPDFNumber(x), asPDFNumber(y)]);\n};\n/* ==================== Text Showing Operators ==================== */\nexport var showText = function (text) {\n return PDFOperator.of(Ops.ShowText, [text]);\n};\n/* ==================== Text State Operators ==================== */\nexport var beginText = function () { return PDFOperator.of(Ops.BeginText); };\nexport var endText = function () { return PDFOperator.of(Ops.EndText); };\nexport var setFontAndSize = function (name, size) { return PDFOperator.of(Ops.SetFontAndSize, [asPDFName(name), asPDFNumber(size)]); };\nexport var setCharacterSpacing = function (spacing) {\n return PDFOperator.of(Ops.SetCharacterSpacing, [asPDFNumber(spacing)]);\n};\nexport var setWordSpacing = function (spacing) {\n return PDFOperator.of(Ops.SetWordSpacing, [asPDFNumber(spacing)]);\n};\n/** @param squeeze horizontal character spacing */\nexport var setCharacterSqueeze = function (squeeze) {\n return PDFOperator.of(Ops.SetTextHorizontalScaling, [asPDFNumber(squeeze)]);\n};\nexport var setLineHeight = function (lineHeight) {\n return PDFOperator.of(Ops.SetTextLineHeight, [asPDFNumber(lineHeight)]);\n};\nexport var setTextRise = function (rise) {\n return PDFOperator.of(Ops.SetTextRise, [asPDFNumber(rise)]);\n};\nexport var TextRenderingMode;\n(function (TextRenderingMode) {\n TextRenderingMode[TextRenderingMode[\"Fill\"] = 0] = \"Fill\";\n TextRenderingMode[TextRenderingMode[\"Outline\"] = 1] = \"Outline\";\n TextRenderingMode[TextRenderingMode[\"FillAndOutline\"] = 2] = \"FillAndOutline\";\n TextRenderingMode[TextRenderingMode[\"Invisible\"] = 3] = \"Invisible\";\n TextRenderingMode[TextRenderingMode[\"FillAndClip\"] = 4] = \"FillAndClip\";\n TextRenderingMode[TextRenderingMode[\"OutlineAndClip\"] = 5] = \"OutlineAndClip\";\n TextRenderingMode[TextRenderingMode[\"FillAndOutlineAndClip\"] = 6] = \"FillAndOutlineAndClip\";\n TextRenderingMode[TextRenderingMode[\"Clip\"] = 7] = \"Clip\";\n})(TextRenderingMode || (TextRenderingMode = {}));\nexport var setTextRenderingMode = function (mode) {\n return PDFOperator.of(Ops.SetTextRenderingMode, [asPDFNumber(mode)]);\n};\nexport var setTextMatrix = function (a, b, c, d, e, f) {\n return PDFOperator.of(Ops.SetTextMatrix, [\n asPDFNumber(a),\n asPDFNumber(b),\n asPDFNumber(c),\n asPDFNumber(d),\n asPDFNumber(e),\n asPDFNumber(f),\n ]);\n};\nexport var rotateAndSkewTextRadiansAndTranslate = function (rotationAngle, xSkewAngle, ySkewAngle, x, y) {\n return setTextMatrix(cos(asNumber(rotationAngle)), sin(asNumber(rotationAngle)) + tan(asNumber(xSkewAngle)), -sin(asNumber(rotationAngle)) + tan(asNumber(ySkewAngle)), cos(asNumber(rotationAngle)), x, y);\n};\nexport var rotateAndSkewTextDegreesAndTranslate = function (rotationAngle, xSkewAngle, ySkewAngle, x, y) {\n return rotateAndSkewTextRadiansAndTranslate(degreesToRadians(asNumber(rotationAngle)), degreesToRadians(asNumber(xSkewAngle)), degreesToRadians(asNumber(ySkewAngle)), x, y);\n};\n/* ==================== XObject Operator ==================== */\nexport var drawObject = function (name) {\n return PDFOperator.of(Ops.DrawObject, [asPDFName(name)]);\n};\n/* ==================== Color Operators ==================== */\nexport var setFillingGrayscaleColor = function (gray) {\n return PDFOperator.of(Ops.NonStrokingColorGray, [asPDFNumber(gray)]);\n};\nexport var setStrokingGrayscaleColor = function (gray) {\n return PDFOperator.of(Ops.StrokingColorGray, [asPDFNumber(gray)]);\n};\nexport var setFillingRgbColor = function (red, green, blue) {\n return PDFOperator.of(Ops.NonStrokingColorRgb, [\n asPDFNumber(red),\n asPDFNumber(green),\n asPDFNumber(blue),\n ]);\n};\nexport var setStrokingRgbColor = function (red, green, blue) {\n return PDFOperator.of(Ops.StrokingColorRgb, [\n asPDFNumber(red),\n asPDFNumber(green),\n asPDFNumber(blue),\n ]);\n};\nexport var setFillingCmykColor = function (cyan, magenta, yellow, key) {\n return PDFOperator.of(Ops.NonStrokingColorCmyk, [\n asPDFNumber(cyan),\n asPDFNumber(magenta),\n asPDFNumber(yellow),\n asPDFNumber(key),\n ]);\n};\nexport var setStrokingCmykColor = function (cyan, magenta, yellow, key) {\n return PDFOperator.of(Ops.StrokingColorCmyk, [\n asPDFNumber(cyan),\n asPDFNumber(magenta),\n asPDFNumber(yellow),\n asPDFNumber(key),\n ]);\n};\n/* ==================== Marked Content Operators ==================== */\nexport var beginMarkedContent = function (tag) {\n return PDFOperator.of(Ops.BeginMarkedContent, [asPDFName(tag)]);\n};\nexport var endMarkedContent = function () { return PDFOperator.of(Ops.EndMarkedContent); };\n//# sourceMappingURL=operators.js.map","import { setFillingCmykColor, setFillingGrayscaleColor, setFillingRgbColor, setStrokingCmykColor, setStrokingGrayscaleColor, setStrokingRgbColor, } from \"./operators\";\nimport { assertRange, error } from \"../utils\";\nexport var ColorTypes;\n(function (ColorTypes) {\n ColorTypes[\"Grayscale\"] = \"Grayscale\";\n ColorTypes[\"RGB\"] = \"RGB\";\n ColorTypes[\"CMYK\"] = \"CMYK\";\n})(ColorTypes || (ColorTypes = {}));\nexport var grayscale = function (gray) {\n assertRange(gray, 'gray', 0.0, 1.0);\n return { type: ColorTypes.Grayscale, gray: gray };\n};\nexport var rgb = function (red, green, blue) {\n assertRange(red, 'red', 0, 1);\n assertRange(green, 'green', 0, 1);\n assertRange(blue, 'blue', 0, 1);\n return { type: ColorTypes.RGB, red: red, green: green, blue: blue };\n};\nexport var cmyk = function (cyan, magenta, yellow, key) {\n assertRange(cyan, 'cyan', 0, 1);\n assertRange(magenta, 'magenta', 0, 1);\n assertRange(yellow, 'yellow', 0, 1);\n assertRange(key, 'key', 0, 1);\n return { type: ColorTypes.CMYK, cyan: cyan, magenta: magenta, yellow: yellow, key: key };\n};\nvar Grayscale = ColorTypes.Grayscale, RGB = ColorTypes.RGB, CMYK = ColorTypes.CMYK;\n// prettier-ignore\nexport var setFillingColor = function (color) {\n return color.type === Grayscale ? setFillingGrayscaleColor(color.gray)\n : color.type === RGB ? setFillingRgbColor(color.red, color.green, color.blue)\n : color.type === CMYK ? setFillingCmykColor(color.cyan, color.magenta, color.yellow, color.key)\n : error(\"Invalid color: \" + JSON.stringify(color));\n};\n// prettier-ignore\nexport var setStrokingColor = function (color) {\n return color.type === Grayscale ? setStrokingGrayscaleColor(color.gray)\n : color.type === RGB ? setStrokingRgbColor(color.red, color.green, color.blue)\n : color.type === CMYK ? setStrokingCmykColor(color.cyan, color.magenta, color.yellow, color.key)\n : error(\"Invalid color: \" + JSON.stringify(color));\n};\n// prettier-ignore\nexport var componentsToColor = function (comps, scale) {\n if (scale === void 0) { scale = 1; }\n return ((comps === null || comps === void 0 ? void 0 : comps.length) === 1 ? grayscale(comps[0] * scale)\n : (comps === null || comps === void 0 ? void 0 : comps.length) === 3 ? rgb(comps[0] * scale, comps[1] * scale, comps[2] * scale)\n : (comps === null || comps === void 0 ? void 0 : comps.length) === 4 ? cmyk(comps[0] * scale, comps[1] * scale, comps[2] * scale, comps[3] * scale)\n : undefined);\n};\n// prettier-ignore\nexport var colorToComponents = function (color) {\n return color.type === Grayscale ? [color.gray]\n : color.type === RGB ? [color.red, color.green, color.blue]\n : color.type === CMYK ? [color.cyan, color.magenta, color.yellow, color.key]\n : error(\"Invalid color: \" + JSON.stringify(color));\n};\n//# sourceMappingURL=colors.js.map","export var TextAlignment;\n(function (TextAlignment) {\n TextAlignment[TextAlignment[\"Left\"] = 0] = \"Left\";\n TextAlignment[TextAlignment[\"Center\"] = 1] = \"Center\";\n TextAlignment[TextAlignment[\"Right\"] = 2] = \"Right\";\n})(TextAlignment || (TextAlignment = {}));\n//# sourceMappingURL=alignment.js.map","// Originated from pdfkit Copyright (c) 2014 Devon Govett\n// https://github.com/foliojs/pdfkit/blob/1e62e6ffe24b378eb890df507a47610f4c4a7b24/lib/path.js\n// MIT LICENSE\n// Updated for pdf-lib & TypeScript by Jeremy Messenger\nimport { appendBezierCurve, appendQuadraticCurve, closePath, lineTo, moveTo, } from \"./operators\";\nvar cx = 0;\nvar cy = 0;\nvar px = 0;\nvar py = 0;\nvar sx = 0;\nvar sy = 0;\nvar parameters = new Map([\n ['A', 7],\n ['a', 7],\n ['C', 6],\n ['c', 6],\n ['H', 1],\n ['h', 1],\n ['L', 2],\n ['l', 2],\n ['M', 2],\n ['m', 2],\n ['Q', 4],\n ['q', 4],\n ['S', 4],\n ['s', 4],\n ['T', 2],\n ['t', 2],\n ['V', 1],\n ['v', 1],\n ['Z', 0],\n ['z', 0],\n]);\nvar parse = function (path) {\n var cmd;\n var ret = [];\n var args = [];\n var curArg = '';\n var foundDecimal = false;\n var params = 0;\n for (var _i = 0, path_1 = path; _i < path_1.length; _i++) {\n var c = path_1[_i];\n if (parameters.has(c)) {\n params = parameters.get(c);\n if (cmd) {\n // save existing command\n if (curArg.length > 0) {\n args[args.length] = +curArg;\n }\n ret[ret.length] = { cmd: cmd, args: args };\n args = [];\n curArg = '';\n foundDecimal = false;\n }\n cmd = c;\n }\n else if ([' ', ','].includes(c) ||\n (c === '-' && curArg.length > 0 && curArg[curArg.length - 1] !== 'e') ||\n (c === '.' && foundDecimal)) {\n if (curArg.length === 0) {\n continue;\n }\n if (args.length === params) {\n // handle reused commands\n ret[ret.length] = { cmd: cmd, args: args };\n args = [+curArg];\n // handle assumed commands\n if (cmd === 'M') {\n cmd = 'L';\n }\n if (cmd === 'm') {\n cmd = 'l';\n }\n }\n else {\n args[args.length] = +curArg;\n }\n foundDecimal = c === '.';\n // fix for negative numbers or repeated decimals with no delimeter between commands\n curArg = ['-', '.'].includes(c) ? c : '';\n }\n else {\n curArg += c;\n if (c === '.') {\n foundDecimal = true;\n }\n }\n }\n // add the last command\n if (curArg.length > 0) {\n if (args.length === params) {\n // handle reused commands\n ret[ret.length] = { cmd: cmd, args: args };\n args = [+curArg];\n // handle assumed commands\n if (cmd === 'M') {\n cmd = 'L';\n }\n if (cmd === 'm') {\n cmd = 'l';\n }\n }\n else {\n args[args.length] = +curArg;\n }\n }\n ret[ret.length] = { cmd: cmd, args: args };\n return ret;\n};\nvar apply = function (commands) {\n // current point, control point, and subpath starting point\n cx = cy = px = py = sx = sy = 0;\n // run the commands\n var cmds = [];\n for (var i = 0; i < commands.length; i++) {\n var c = commands[i];\n if (c.cmd && typeof runners[c.cmd] === 'function') {\n var cmd = runners[c.cmd](c.args);\n if (Array.isArray(cmd)) {\n cmds = cmds.concat(cmd);\n }\n else {\n cmds.push(cmd);\n }\n }\n }\n return cmds;\n};\nvar runners = {\n M: function (a) {\n cx = a[0];\n cy = a[1];\n px = py = null;\n sx = cx;\n sy = cy;\n return moveTo(cx, cy);\n },\n m: function (a) {\n cx += a[0];\n cy += a[1];\n px = py = null;\n sx = cx;\n sy = cy;\n return moveTo(cx, cy);\n },\n C: function (a) {\n cx = a[4];\n cy = a[5];\n px = a[2];\n py = a[3];\n return appendBezierCurve(a[0], a[1], a[2], a[3], a[4], a[5]);\n },\n c: function (a) {\n var cmd = appendBezierCurve(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy, a[4] + cx, a[5] + cy);\n px = cx + a[2];\n py = cy + a[3];\n cx += a[4];\n cy += a[5];\n return cmd;\n },\n S: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n }\n var cmd = appendBezierCurve(cx - (px - cx), cy - (py - cy), a[0], a[1], a[2], a[3]);\n px = a[0];\n py = a[1];\n cx = a[2];\n cy = a[3];\n return cmd;\n },\n s: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n }\n var cmd = appendBezierCurve(cx - (px - cx), cy - (py - cy), cx + a[0], cy + a[1], cx + a[2], cy + a[3]);\n px = cx + a[0];\n py = cy + a[1];\n cx += a[2];\n cy += a[3];\n return cmd;\n },\n Q: function (a) {\n px = a[0];\n py = a[1];\n cx = a[2];\n cy = a[3];\n return appendQuadraticCurve(a[0], a[1], cx, cy);\n },\n q: function (a) {\n var cmd = appendQuadraticCurve(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy);\n px = cx + a[0];\n py = cy + a[1];\n cx += a[2];\n cy += a[3];\n return cmd;\n },\n T: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n }\n else {\n px = cx - (px - cx);\n py = cy - (py - cy);\n }\n var cmd = appendQuadraticCurve(px, py, a[0], a[1]);\n px = cx - (px - cx);\n py = cy - (py - cy);\n cx = a[0];\n cy = a[1];\n return cmd;\n },\n t: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n }\n else {\n px = cx - (px - cx);\n py = cy - (py - cy);\n }\n var cmd = appendQuadraticCurve(px, py, cx + a[0], cy + a[1]);\n cx += a[0];\n cy += a[1];\n return cmd;\n },\n A: function (a) {\n var cmds = solveArc(cx, cy, a);\n cx = a[5];\n cy = a[6];\n return cmds;\n },\n a: function (a) {\n a[5] += cx;\n a[6] += cy;\n var cmds = solveArc(cx, cy, a);\n cx = a[5];\n cy = a[6];\n return cmds;\n },\n L: function (a) {\n cx = a[0];\n cy = a[1];\n px = py = null;\n return lineTo(cx, cy);\n },\n l: function (a) {\n cx += a[0];\n cy += a[1];\n px = py = null;\n return lineTo(cx, cy);\n },\n H: function (a) {\n cx = a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n h: function (a) {\n cx += a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n V: function (a) {\n cy = a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n v: function (a) {\n cy += a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n Z: function () {\n var cmd = closePath();\n cx = sx;\n cy = sy;\n return cmd;\n },\n z: function () {\n var cmd = closePath();\n cx = sx;\n cy = sy;\n return cmd;\n },\n};\nvar solveArc = function (x, y, coords) {\n var rx = coords[0], ry = coords[1], rot = coords[2], large = coords[3], sweep = coords[4], ex = coords[5], ey = coords[6];\n var segs = arcToSegments(ex, ey, rx, ry, large, sweep, rot, x, y);\n var cmds = [];\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n var bez = segmentToBezier.apply(void 0, seg);\n cmds.push(appendBezierCurve.apply(void 0, bez));\n }\n return cmds;\n};\n// from Inkscape svgtopdf, thanks!\nvar arcToSegments = function (x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n var th = rotateX * (Math.PI / 180);\n var sinTh = Math.sin(th);\n var cosTh = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n px = cosTh * (ox - x) * 0.5 + sinTh * (oy - y) * 0.5;\n py = cosTh * (oy - y) * 0.5 - sinTh * (ox - x) * 0.5;\n var pl = (px * px) / (rx * rx) + (py * py) / (ry * ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n var a00 = cosTh / rx;\n var a01 = sinTh / rx;\n var a10 = -sinTh / ry;\n var a11 = cosTh / ry;\n var x0 = a00 * ox + a01 * oy;\n var y0 = a10 * ox + a11 * oy;\n var x1 = a00 * x + a01 * y;\n var y1 = a10 * x + a11 * y;\n var d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);\n var sfactorSq = 1 / d - 0.25;\n if (sfactorSq < 0) {\n sfactorSq = 0;\n }\n var sfactor = Math.sqrt(sfactorSq);\n if (sweep === large) {\n sfactor = -sfactor;\n }\n var xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);\n var yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);\n var th0 = Math.atan2(y0 - yc, x0 - xc);\n var th1 = Math.atan2(y1 - yc, x1 - xc);\n var thArc = th1 - th0;\n if (thArc < 0 && sweep === 1) {\n thArc += 2 * Math.PI;\n }\n else if (thArc > 0 && sweep === 0) {\n thArc -= 2 * Math.PI;\n }\n var segments = Math.ceil(Math.abs(thArc / (Math.PI * 0.5 + 0.001)));\n var result = [];\n for (var i = 0; i < segments; i++) {\n var th2 = th0 + (i * thArc) / segments;\n var th3 = th0 + ((i + 1) * thArc) / segments;\n result[i] = [xc, yc, th2, th3, rx, ry, sinTh, cosTh];\n }\n return result;\n};\nvar segmentToBezier = function (cx1, cy1, th0, th1, rx, ry, sinTh, cosTh) {\n var a00 = cosTh * rx;\n var a01 = -sinTh * ry;\n var a10 = sinTh * rx;\n var a11 = cosTh * ry;\n var thHalf = 0.5 * (th1 - th0);\n var t = ((8 / 3) * Math.sin(thHalf * 0.5) * Math.sin(thHalf * 0.5)) /\n Math.sin(thHalf);\n var x1 = cx1 + Math.cos(th0) - t * Math.sin(th0);\n var y1 = cy1 + Math.sin(th0) + t * Math.cos(th0);\n var x3 = cx1 + Math.cos(th1);\n var y3 = cy1 + Math.sin(th1);\n var x2 = x3 + t * Math.sin(th1);\n var y2 = y3 - t * Math.cos(th1);\n var result = [\n a00 * x1 + a01 * y1,\n a10 * x1 + a11 * y1,\n a00 * x2 + a01 * y2,\n a10 * x2 + a11 * y2,\n a00 * x3 + a01 * y3,\n a10 * x3 + a11 * y3,\n ];\n return result;\n};\nexport var svgPathToOperators = function (path) { return apply(parse(path)); };\n//# sourceMappingURL=svgPath.js.map","import { __spreadArrays } from \"tslib\";\nimport { setFillingColor, setStrokingColor } from \"./colors\";\nimport { beginText, closePath, drawObject, endText, fill, fillAndStroke, lineTo, moveTo, nextLine, popGraphicsState, pushGraphicsState, rotateAndSkewTextRadiansAndTranslate, rotateRadians, scale, setFontAndSize, setLineHeight, setLineWidth, showText, skewRadians, stroke, translate, setLineCap, rotateDegrees, setGraphicsState, setDashPattern, beginMarkedContent, endMarkedContent, clip, endPath, appendBezierCurve, } from \"./operators\";\nimport { toRadians, degrees } from \"./rotations\";\nimport { svgPathToOperators } from \"./svgPath\";\nimport { asNumber } from \"./objects\";\nexport var drawText = function (line, options) {\n return [\n pushGraphicsState(),\n options.graphicsState && setGraphicsState(options.graphicsState),\n beginText(),\n setFillingColor(options.color),\n setFontAndSize(options.font, options.size),\n rotateAndSkewTextRadiansAndTranslate(toRadians(options.rotate), toRadians(options.xSkew), toRadians(options.ySkew), options.x, options.y),\n showText(line),\n endText(),\n popGraphicsState(),\n ].filter(Boolean);\n};\nexport var drawLinesOfText = function (lines, options) {\n var operators = [\n pushGraphicsState(),\n options.graphicsState && setGraphicsState(options.graphicsState),\n beginText(),\n setFillingColor(options.color),\n setFontAndSize(options.font, options.size),\n setLineHeight(options.lineHeight),\n rotateAndSkewTextRadiansAndTranslate(toRadians(options.rotate), toRadians(options.xSkew), toRadians(options.ySkew), options.x, options.y),\n ].filter(Boolean);\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n operators.push(showText(lines[idx]), nextLine());\n }\n operators.push(endText(), popGraphicsState());\n return operators;\n};\nexport var drawImage = function (name, options) {\n return [\n pushGraphicsState(),\n options.graphicsState && setGraphicsState(options.graphicsState),\n translate(options.x, options.y),\n rotateRadians(toRadians(options.rotate)),\n scale(options.width, options.height),\n skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)),\n drawObject(name),\n popGraphicsState(),\n ].filter(Boolean);\n};\nexport var drawPage = function (name, options) {\n return [\n pushGraphicsState(),\n options.graphicsState && setGraphicsState(options.graphicsState),\n translate(options.x, options.y),\n rotateRadians(toRadians(options.rotate)),\n scale(options.xScale, options.yScale),\n skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)),\n drawObject(name),\n popGraphicsState(),\n ].filter(Boolean);\n};\nexport var drawLine = function (options) {\n var _a, _b;\n return [\n pushGraphicsState(),\n options.graphicsState && setGraphicsState(options.graphicsState),\n options.color && setStrokingColor(options.color),\n setLineWidth(options.thickness),\n setDashPattern((_a = options.dashArray) !== null && _a !== void 0 ? _a : [], (_b = options.dashPhase) !== null && _b !== void 0 ? _b : 0),\n moveTo(options.start.x, options.start.y),\n options.lineCap && setLineCap(options.lineCap),\n moveTo(options.start.x, options.start.y),\n lineTo(options.end.x, options.end.y),\n stroke(),\n popGraphicsState(),\n ].filter(Boolean);\n};\nexport var drawRectangle = function (options) {\n var _a, _b;\n return [\n pushGraphicsState(),\n options.graphicsState && setGraphicsState(options.graphicsState),\n options.color && setFillingColor(options.color),\n options.borderColor && setStrokingColor(options.borderColor),\n setLineWidth(options.borderWidth),\n options.borderLineCap && setLineCap(options.borderLineCap),\n setDashPattern((_a = options.borderDashArray) !== null && _a !== void 0 ? _a : [], (_b = options.borderDashPhase) !== null && _b !== void 0 ? _b : 0),\n translate(options.x, options.y),\n rotateRadians(toRadians(options.rotate)),\n skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)),\n moveTo(0, 0),\n lineTo(0, options.height),\n lineTo(options.width, options.height),\n lineTo(options.width, 0),\n closePath(),\n // prettier-ignore\n options.color && options.borderWidth ? fillAndStroke()\n : options.color ? fill()\n : options.borderColor ? stroke()\n : closePath(),\n popGraphicsState(),\n ].filter(Boolean);\n};\nvar KAPPA = 4.0 * ((Math.sqrt(2) - 1.0) / 3.0);\n/** @deprecated */\nexport var drawEllipsePath = function (config) {\n var x = asNumber(config.x);\n var y = asNumber(config.y);\n var xScale = asNumber(config.xScale);\n var yScale = asNumber(config.yScale);\n x -= xScale;\n y -= yScale;\n var ox = xScale * KAPPA;\n var oy = yScale * KAPPA;\n var xe = x + xScale * 2;\n var ye = y + yScale * 2;\n var xm = x + xScale;\n var ym = y + yScale;\n return [\n pushGraphicsState(),\n moveTo(x, ym),\n appendBezierCurve(x, ym - oy, xm - ox, y, xm, y),\n appendBezierCurve(xm + ox, y, xe, ym - oy, xe, ym),\n appendBezierCurve(xe, ym + oy, xm + ox, ye, xm, ye),\n appendBezierCurve(xm - ox, ye, x, ym + oy, x, ym),\n popGraphicsState(),\n ];\n};\nvar drawEllipseCurves = function (config) {\n var centerX = asNumber(config.x);\n var centerY = asNumber(config.y);\n var xScale = asNumber(config.xScale);\n var yScale = asNumber(config.yScale);\n var x = -xScale;\n var y = -yScale;\n var ox = xScale * KAPPA;\n var oy = yScale * KAPPA;\n var xe = x + xScale * 2;\n var ye = y + yScale * 2;\n var xm = x + xScale;\n var ym = y + yScale;\n return [\n translate(centerX, centerY),\n rotateRadians(toRadians(config.rotate)),\n moveTo(x, ym),\n appendBezierCurve(x, ym - oy, xm - ox, y, xm, y),\n appendBezierCurve(xm + ox, y, xe, ym - oy, xe, ym),\n appendBezierCurve(xe, ym + oy, xm + ox, ye, xm, ye),\n appendBezierCurve(xm - ox, ye, x, ym + oy, x, ym),\n ];\n};\nexport var drawEllipse = function (options) {\n var _a, _b, _c;\n return __spreadArrays([\n pushGraphicsState(),\n options.graphicsState && setGraphicsState(options.graphicsState),\n options.color && setFillingColor(options.color),\n options.borderColor && setStrokingColor(options.borderColor),\n setLineWidth(options.borderWidth),\n options.borderLineCap && setLineCap(options.borderLineCap),\n setDashPattern((_a = options.borderDashArray) !== null && _a !== void 0 ? _a : [], (_b = options.borderDashPhase) !== null && _b !== void 0 ? _b : 0)\n ], (options.rotate === undefined\n ? drawEllipsePath({\n x: options.x,\n y: options.y,\n xScale: options.xScale,\n yScale: options.yScale,\n })\n : drawEllipseCurves({\n x: options.x,\n y: options.y,\n xScale: options.xScale,\n yScale: options.yScale,\n rotate: (_c = options.rotate) !== null && _c !== void 0 ? _c : degrees(0),\n })), [\n // prettier-ignore\n options.color && options.borderWidth ? fillAndStroke()\n : options.color ? fill()\n : options.borderColor ? stroke()\n : closePath(),\n popGraphicsState(),\n ]).filter(Boolean);\n};\nexport var drawSvgPath = function (path, options) {\n var _a, _b, _c;\n return __spreadArrays([\n pushGraphicsState(),\n options.graphicsState && setGraphicsState(options.graphicsState),\n translate(options.x, options.y),\n rotateRadians(toRadians((_a = options.rotate) !== null && _a !== void 0 ? _a : degrees(0))),\n // SVG path Y axis is opposite pdf-lib's\n options.scale ? scale(options.scale, -options.scale) : scale(1, -1),\n options.color && setFillingColor(options.color),\n options.borderColor && setStrokingColor(options.borderColor),\n options.borderWidth && setLineWidth(options.borderWidth),\n options.borderLineCap && setLineCap(options.borderLineCap),\n setDashPattern((_b = options.borderDashArray) !== null && _b !== void 0 ? _b : [], (_c = options.borderDashPhase) !== null && _c !== void 0 ? _c : 0)\n ], svgPathToOperators(path), [\n // prettier-ignore\n options.color && options.borderWidth ? fillAndStroke()\n : options.color ? fill()\n : options.borderColor ? stroke()\n : closePath(),\n popGraphicsState(),\n ]).filter(Boolean);\n};\nexport var drawCheckMark = function (options) {\n var size = asNumber(options.size);\n /*********************** Define Check Mark Points ***************************/\n // A check mark is defined by three points in some coordinate space. Here, we\n // define these points in a unit coordinate system, where the range of the x\n // and y axis are both [-1, 1].\n //\n // Note that we do not hard code `p1y` in case we wish to change the\n // size/shape of the check mark in the future. We want the check mark to\n // always form a right angle. This means that the dot product between (p1-p2)\n // and (p3-p2) should be zero:\n //\n // (p1x-p2x) * (p3x-p2x) + (p1y-p2y) * (p3y-p2y) = 0\n //\n // We can now rejigger this equation to solve for `p1y`:\n //\n // (p1y-p2y) * (p3y-p2y) = -((p1x-p2x) * (p3x-p2x))\n // (p1y-p2y) = -((p1x-p2x) * (p3x-p2x)) / (p3y-p2y)\n // p1y = -((p1x-p2x) * (p3x-p2x)) / (p3y-p2y) + p2y\n //\n // Thanks to my friend Joel Walker (https://github.com/JWalker1995) for\n // devising the above equation and unit coordinate system approach!\n // (x, y) coords of the check mark's bottommost point\n var p2x = -1 + 0.75;\n var p2y = -1 + 0.51;\n // (x, y) coords of the check mark's topmost point\n var p3y = 1 - 0.525;\n var p3x = 1 - 0.31;\n // (x, y) coords of the check mark's center (vertically) point\n var p1x = -1 + 0.325;\n var p1y = -((p1x - p2x) * (p3x - p2x)) / (p3y - p2y) + p2y;\n /****************************************************************************/\n return [\n pushGraphicsState(),\n options.color && setStrokingColor(options.color),\n setLineWidth(options.thickness),\n translate(options.x, options.y),\n moveTo(p1x * size, p1y * size),\n lineTo(p2x * size, p2y * size),\n lineTo(p3x * size, p3y * size),\n stroke(),\n popGraphicsState(),\n ].filter(Boolean);\n};\n// prettier-ignore\nexport var rotateInPlace = function (options) {\n return options.rotation === 0 ? [\n translate(0, 0),\n rotateDegrees(0)\n ]\n : options.rotation === 90 ? [\n translate(options.width, 0),\n rotateDegrees(90)\n ]\n : options.rotation === 180 ? [\n translate(options.width, options.height),\n rotateDegrees(180)\n ]\n : options.rotation === 270 ? [\n translate(0, options.height),\n rotateDegrees(270)\n ]\n : [];\n}; // Invalid rotation - noop\nexport var drawCheckBox = function (options) {\n var outline = drawRectangle({\n x: options.x,\n y: options.y,\n width: options.width,\n height: options.height,\n borderWidth: options.borderWidth,\n color: options.color,\n borderColor: options.borderColor,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0),\n });\n if (!options.filled)\n return outline;\n var width = asNumber(options.width);\n var height = asNumber(options.height);\n var checkMarkSize = Math.min(width, height) / 2;\n var checkMark = drawCheckMark({\n x: width / 2,\n y: height / 2,\n size: checkMarkSize,\n thickness: options.thickness,\n color: options.markColor,\n });\n return __spreadArrays([pushGraphicsState()], outline, checkMark, [popGraphicsState()]);\n};\nexport var drawRadioButton = function (options) {\n var width = asNumber(options.width);\n var height = asNumber(options.height);\n var outlineScale = Math.min(width, height) / 2;\n var outline = drawEllipse({\n x: options.x,\n y: options.y,\n xScale: outlineScale,\n yScale: outlineScale,\n color: options.color,\n borderColor: options.borderColor,\n borderWidth: options.borderWidth,\n });\n if (!options.filled)\n return outline;\n var dot = drawEllipse({\n x: options.x,\n y: options.y,\n xScale: outlineScale * 0.45,\n yScale: outlineScale * 0.45,\n color: options.dotColor,\n borderColor: undefined,\n borderWidth: 0,\n });\n return __spreadArrays([pushGraphicsState()], outline, dot, [popGraphicsState()]);\n};\nexport var drawButton = function (options) {\n var x = asNumber(options.x);\n var y = asNumber(options.y);\n var width = asNumber(options.width);\n var height = asNumber(options.height);\n var background = drawRectangle({\n x: x,\n y: y,\n width: width,\n height: height,\n borderWidth: options.borderWidth,\n color: options.color,\n borderColor: options.borderColor,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0),\n });\n var lines = drawTextLines(options.textLines, {\n color: options.textColor,\n font: options.font,\n size: options.fontSize,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0),\n });\n return __spreadArrays([pushGraphicsState()], background, lines, [popGraphicsState()]);\n};\nexport var drawTextLines = function (lines, options) {\n var operators = [\n beginText(),\n setFillingColor(options.color),\n setFontAndSize(options.font, options.size),\n ];\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n var _a = lines[idx], encoded = _a.encoded, x = _a.x, y = _a.y;\n operators.push(rotateAndSkewTextRadiansAndTranslate(toRadians(options.rotate), toRadians(options.xSkew), toRadians(options.ySkew), x, y), showText(encoded));\n }\n operators.push(endText());\n return operators;\n};\nexport var drawTextField = function (options) {\n var x = asNumber(options.x);\n var y = asNumber(options.y);\n var width = asNumber(options.width);\n var height = asNumber(options.height);\n var borderWidth = asNumber(options.borderWidth);\n var padding = asNumber(options.padding);\n var clipX = x + borderWidth / 2 + padding;\n var clipY = y + borderWidth / 2 + padding;\n var clipWidth = width - (borderWidth / 2 + padding) * 2;\n var clipHeight = height - (borderWidth / 2 + padding) * 2;\n var clippingArea = [\n moveTo(clipX, clipY),\n lineTo(clipX, clipY + clipHeight),\n lineTo(clipX + clipWidth, clipY + clipHeight),\n lineTo(clipX + clipWidth, clipY),\n closePath(),\n clip(),\n endPath(),\n ];\n var background = drawRectangle({\n x: x,\n y: y,\n width: width,\n height: height,\n borderWidth: options.borderWidth,\n color: options.color,\n borderColor: options.borderColor,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0),\n });\n var lines = drawTextLines(options.textLines, {\n color: options.textColor,\n font: options.font,\n size: options.fontSize,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0),\n });\n var markedContent = __spreadArrays([\n beginMarkedContent('Tx'),\n pushGraphicsState()\n ], lines, [\n popGraphicsState(),\n endMarkedContent(),\n ]);\n return __spreadArrays([\n pushGraphicsState()\n ], background, clippingArea, markedContent, [\n popGraphicsState(),\n ]);\n};\nexport var drawOptionList = function (options) {\n var x = asNumber(options.x);\n var y = asNumber(options.y);\n var width = asNumber(options.width);\n var height = asNumber(options.height);\n var lineHeight = asNumber(options.lineHeight);\n var borderWidth = asNumber(options.borderWidth);\n var padding = asNumber(options.padding);\n var clipX = x + borderWidth / 2 + padding;\n var clipY = y + borderWidth / 2 + padding;\n var clipWidth = width - (borderWidth / 2 + padding) * 2;\n var clipHeight = height - (borderWidth / 2 + padding) * 2;\n var clippingArea = [\n moveTo(clipX, clipY),\n lineTo(clipX, clipY + clipHeight),\n lineTo(clipX + clipWidth, clipY + clipHeight),\n lineTo(clipX + clipWidth, clipY),\n closePath(),\n clip(),\n endPath(),\n ];\n var background = drawRectangle({\n x: x,\n y: y,\n width: width,\n height: height,\n borderWidth: options.borderWidth,\n color: options.color,\n borderColor: options.borderColor,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0),\n });\n var highlights = [];\n for (var idx = 0, len = options.selectedLines.length; idx < len; idx++) {\n var line = options.textLines[options.selectedLines[idx]];\n highlights.push.apply(highlights, drawRectangle({\n x: line.x - padding,\n y: line.y - (lineHeight - line.height) / 2,\n width: width - borderWidth,\n height: line.height + (lineHeight - line.height) / 2,\n borderWidth: 0,\n color: options.selectedColor,\n borderColor: undefined,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0),\n }));\n }\n var lines = drawTextLines(options.textLines, {\n color: options.textColor,\n font: options.font,\n size: options.fontSize,\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0),\n });\n var markedContent = __spreadArrays([\n beginMarkedContent('Tx'),\n pushGraphicsState()\n ], lines, [\n popGraphicsState(),\n endMarkedContent(),\n ]);\n return __spreadArrays([\n pushGraphicsState()\n ], background, highlights, clippingArea, markedContent, [\n popGraphicsState(),\n ]);\n};\n//# sourceMappingURL=operations.js.map","// tslint:disable: max-classes-per-file\nimport { __extends } from \"tslib\";\n// TODO: Include link to documentation with example\nvar EncryptedPDFError = /** @class */ (function (_super) {\n __extends(EncryptedPDFError, _super);\n function EncryptedPDFError() {\n var _this = this;\n var msg = 'Input document to `PDFDocument.load` is encrypted. You can use `PDFDocument.load(..., { ignoreEncryption: true })` if you wish to load the document anyways.';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return EncryptedPDFError;\n}(Error));\nexport { EncryptedPDFError };\n// TODO: Include link to documentation with example\nvar FontkitNotRegisteredError = /** @class */ (function (_super) {\n __extends(FontkitNotRegisteredError, _super);\n function FontkitNotRegisteredError() {\n var _this = this;\n var msg = 'Input to `PDFDocument.embedFont` was a custom font, but no `fontkit` instance was found. You must register a `fontkit` instance with `PDFDocument.registerFontkit(...)` before embedding custom fonts.';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return FontkitNotRegisteredError;\n}(Error));\nexport { FontkitNotRegisteredError };\n// TODO: Include link to documentation with example\nvar ForeignPageError = /** @class */ (function (_super) {\n __extends(ForeignPageError, _super);\n function ForeignPageError() {\n var _this = this;\n var msg = 'A `page` passed to `PDFDocument.addPage` or `PDFDocument.insertPage` was from a different (foreign) PDF document. If you want to copy pages from one PDFDocument to another, you must use `PDFDocument.copyPages(...)` to copy the pages before adding or inserting them.';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return ForeignPageError;\n}(Error));\nexport { ForeignPageError };\n// TODO: Include link to documentation with example\nvar RemovePageFromEmptyDocumentError = /** @class */ (function (_super) {\n __extends(RemovePageFromEmptyDocumentError, _super);\n function RemovePageFromEmptyDocumentError() {\n var _this = this;\n var msg = 'PDFDocument has no pages so `PDFDocument.removePage` cannot be called';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return RemovePageFromEmptyDocumentError;\n}(Error));\nexport { RemovePageFromEmptyDocumentError };\nvar NoSuchFieldError = /** @class */ (function (_super) {\n __extends(NoSuchFieldError, _super);\n function NoSuchFieldError(name) {\n var _this = this;\n var msg = \"PDFDocument has no form field with the name \\\"\" + name + \"\\\"\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return NoSuchFieldError;\n}(Error));\nexport { NoSuchFieldError };\nvar UnexpectedFieldTypeError = /** @class */ (function (_super) {\n __extends(UnexpectedFieldTypeError, _super);\n function UnexpectedFieldTypeError(name, expected, actual) {\n var _a, _b;\n var _this = this;\n var expectedType = expected === null || expected === void 0 ? void 0 : expected.name;\n var actualType = (_b = (_a = actual === null || actual === void 0 ? void 0 : actual.constructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : actual;\n var msg = \"Expected field \\\"\" + name + \"\\\" to be of type \" + expectedType + \", \" +\n (\"but it is actually of type \" + actualType);\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return UnexpectedFieldTypeError;\n}(Error));\nexport { UnexpectedFieldTypeError };\nvar MissingOnValueCheckError = /** @class */ (function (_super) {\n __extends(MissingOnValueCheckError, _super);\n function MissingOnValueCheckError(onValue) {\n var _this = this;\n var msg = \"Failed to select check box due to missing onValue: \\\"\" + onValue + \"\\\"\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MissingOnValueCheckError;\n}(Error));\nexport { MissingOnValueCheckError };\nvar FieldAlreadyExistsError = /** @class */ (function (_super) {\n __extends(FieldAlreadyExistsError, _super);\n function FieldAlreadyExistsError(name) {\n var _this = this;\n var msg = \"A field already exists with the specified name: \\\"\" + name + \"\\\"\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return FieldAlreadyExistsError;\n}(Error));\nexport { FieldAlreadyExistsError };\nvar InvalidFieldNamePartError = /** @class */ (function (_super) {\n __extends(InvalidFieldNamePartError, _super);\n function InvalidFieldNamePartError(namePart) {\n var _this = this;\n var msg = \"Field name contains invalid component: \\\"\" + namePart + \"\\\"\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return InvalidFieldNamePartError;\n}(Error));\nexport { InvalidFieldNamePartError };\nvar FieldExistsAsNonTerminalError = /** @class */ (function (_super) {\n __extends(FieldExistsAsNonTerminalError, _super);\n function FieldExistsAsNonTerminalError(name) {\n var _this = this;\n var msg = \"A non-terminal field already exists with the specified name: \\\"\" + name + \"\\\"\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return FieldExistsAsNonTerminalError;\n}(Error));\nexport { FieldExistsAsNonTerminalError };\nvar RichTextFieldReadError = /** @class */ (function (_super) {\n __extends(RichTextFieldReadError, _super);\n function RichTextFieldReadError(fieldName) {\n var _this = this;\n var msg = \"Reading rich text fields is not supported: Attempted to read rich text field: \" + fieldName;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return RichTextFieldReadError;\n}(Error));\nexport { RichTextFieldReadError };\nvar CombedTextLayoutError = /** @class */ (function (_super) {\n __extends(CombedTextLayoutError, _super);\n function CombedTextLayoutError(lineLength, cellCount) {\n var _this = this;\n var msg = \"Failed to layout combed text as lineLength=\" + lineLength + \" is greater than cellCount=\" + cellCount;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return CombedTextLayoutError;\n}(Error));\nexport { CombedTextLayoutError };\nvar ExceededMaxLengthError = /** @class */ (function (_super) {\n __extends(ExceededMaxLengthError, _super);\n function ExceededMaxLengthError(textLength, maxLength, name) {\n var _this = this;\n var msg = \"Attempted to set text with length=\" + textLength + \" for TextField with maxLength=\" + maxLength + \" and name=\" + name;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return ExceededMaxLengthError;\n}(Error));\nexport { ExceededMaxLengthError };\nvar InvalidMaxLengthError = /** @class */ (function (_super) {\n __extends(InvalidMaxLengthError, _super);\n function InvalidMaxLengthError(textLength, maxLength, name) {\n var _this = this;\n var msg = \"Attempted to set maxLength=\" + maxLength + \", which is less than \" + textLength + \", the length of this field's current value (name=\" + name + \")\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return InvalidMaxLengthError;\n}(Error));\nexport { InvalidMaxLengthError };\n//# sourceMappingURL=errors.js.map","import { CombedTextLayoutError } from \"../errors\";\nimport { TextAlignment } from \"./alignment\";\nimport { cleanText, lineSplit, mergeLines, charAtIndex, charSplit, } from \"../../utils\";\nvar MIN_FONT_SIZE = 4;\nvar MAX_FONT_SIZE = 500;\nvar computeFontSize = function (lines, font, bounds) {\n var fontSize = MIN_FONT_SIZE;\n while (fontSize < MAX_FONT_SIZE) {\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n var line = lines[idx];\n var tooLong = font.widthOfTextAtSize(line, fontSize) > bounds.width;\n if (tooLong)\n return fontSize - 1;\n }\n var height = font.heightAtSize(fontSize);\n var lineHeight = height + height * 0.2;\n var totalHeight = lines.length * lineHeight;\n if (totalHeight > bounds.height)\n return fontSize - 1;\n fontSize += 1;\n }\n return fontSize;\n};\nvar computeCombedFontSize = function (line, font, bounds, cellCount) {\n var cellWidth = bounds.width / cellCount;\n var cellHeight = bounds.height;\n var fontSize = MIN_FONT_SIZE;\n var chars = charSplit(line);\n while (fontSize < MAX_FONT_SIZE) {\n for (var idx = 0, len = chars.length; idx < len; idx++) {\n var c = chars[idx];\n var tooLong = font.widthOfTextAtSize(c, fontSize) > cellWidth * 0.75;\n if (tooLong)\n return fontSize - 1;\n }\n var height = font.heightAtSize(fontSize, { descender: false });\n if (height > cellHeight)\n return fontSize - 1;\n fontSize += 1;\n }\n return fontSize;\n};\nvar lastIndexOfWhitespace = function (line) {\n for (var idx = line.length; idx > 0; idx--) {\n if (/\\s/.test(line[idx]))\n return idx;\n }\n return undefined;\n};\nvar splitOutLines = function (input, maxWidth, font, fontSize) {\n var _a;\n var lastWhitespaceIdx = input.length;\n while (lastWhitespaceIdx > 0) {\n var line = input.substring(0, lastWhitespaceIdx);\n var encoded = font.encodeText(line);\n var width = font.widthOfTextAtSize(line, fontSize);\n if (width < maxWidth) {\n var remainder = input.substring(lastWhitespaceIdx) || undefined;\n return { line: line, encoded: encoded, width: width, remainder: remainder };\n }\n lastWhitespaceIdx = (_a = lastIndexOfWhitespace(line)) !== null && _a !== void 0 ? _a : 0;\n }\n // We were unable to split the input enough to get a chunk that would fit\n // within the specified `maxWidth` so we'll just return everything\n return {\n line: input,\n encoded: font.encodeText(input),\n width: font.widthOfTextAtSize(input, fontSize),\n remainder: undefined,\n };\n};\nexport var layoutMultilineText = function (text, _a) {\n var alignment = _a.alignment, fontSize = _a.fontSize, font = _a.font, bounds = _a.bounds;\n var lines = lineSplit(cleanText(text));\n if (fontSize === undefined || fontSize === 0) {\n // fontSize = computeFontSize(lines, font, bounds);\n // This is hardcoded to make it easier to perform automatic line-wrapping.\n //\n // TODO: Update `computeFontSize` to support automatic line-wrapping and\n // automatic font size calculation.\n fontSize = 12;\n }\n var height = font.heightAtSize(fontSize);\n var lineHeight = height + height * 0.2;\n var textLines = [];\n var minX = bounds.x;\n var minY = bounds.y;\n var maxX = bounds.x + bounds.width;\n var maxY = bounds.y + bounds.height;\n var y = bounds.y + bounds.height;\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n var prevRemainder = lines[idx];\n while (prevRemainder !== undefined) {\n var _b = splitOutLines(prevRemainder, bounds.width, font, fontSize), line = _b.line, encoded = _b.encoded, width = _b.width, remainder = _b.remainder;\n // prettier-ignore\n var x = (alignment === TextAlignment.Left ? bounds.x\n : alignment === TextAlignment.Center ? bounds.x + (bounds.width / 2) - (width / 2)\n : alignment === TextAlignment.Right ? bounds.x + bounds.width - width\n : bounds.x);\n y -= lineHeight;\n if (x < minX)\n minX = x;\n if (y < minY)\n minY = y;\n if (x + width > maxX)\n maxX = x + width;\n if (y + height > maxY)\n maxY = y + height;\n textLines.push({ text: line, encoded: encoded, width: width, height: height, x: x, y: y });\n // Only trim lines that we had to split ourselves. So we won't trim lines\n // that the user provided themselves with whitespace.\n prevRemainder = remainder === null || remainder === void 0 ? void 0 : remainder.trim();\n }\n }\n return {\n fontSize: fontSize,\n lineHeight: lineHeight,\n lines: textLines,\n bounds: {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n },\n };\n};\nexport var layoutCombedText = function (text, _a) {\n var fontSize = _a.fontSize, font = _a.font, bounds = _a.bounds, cellCount = _a.cellCount;\n var line = mergeLines(cleanText(text));\n if (line.length > cellCount) {\n throw new CombedTextLayoutError(line.length, cellCount);\n }\n if (fontSize === undefined || fontSize === 0) {\n fontSize = computeCombedFontSize(line, font, bounds, cellCount);\n }\n var cellWidth = bounds.width / cellCount;\n var height = font.heightAtSize(fontSize, { descender: false });\n var y = bounds.y + (bounds.height / 2 - height / 2);\n var cells = [];\n var minX = bounds.x;\n var minY = bounds.y;\n var maxX = bounds.x + bounds.width;\n var maxY = bounds.y + bounds.height;\n var cellOffset = 0;\n var charOffset = 0;\n while (cellOffset < cellCount) {\n var _b = charAtIndex(line, charOffset), char = _b[0], charLength = _b[1];\n var encoded = font.encodeText(char);\n var width = font.widthOfTextAtSize(char, fontSize);\n var cellCenter = bounds.x + (cellWidth * cellOffset + cellWidth / 2);\n var x = cellCenter - width / 2;\n if (x < minX)\n minX = x;\n if (y < minY)\n minY = y;\n if (x + width > maxX)\n maxX = x + width;\n if (y + height > maxY)\n maxY = y + height;\n cells.push({ text: line, encoded: encoded, width: width, height: height, x: x, y: y });\n cellOffset += 1;\n charOffset += charLength;\n }\n return {\n fontSize: fontSize,\n cells: cells,\n bounds: {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n },\n };\n};\nexport var layoutSinglelineText = function (text, _a) {\n var alignment = _a.alignment, fontSize = _a.fontSize, font = _a.font, bounds = _a.bounds;\n var line = mergeLines(cleanText(text));\n if (fontSize === undefined || fontSize === 0) {\n fontSize = computeFontSize([line], font, bounds);\n }\n var encoded = font.encodeText(line);\n var width = font.widthOfTextAtSize(line, fontSize);\n var height = font.heightAtSize(fontSize, { descender: false });\n // prettier-ignore\n var x = (alignment === TextAlignment.Left ? bounds.x\n : alignment === TextAlignment.Center ? bounds.x + (bounds.width / 2) - (width / 2)\n : alignment === TextAlignment.Right ? bounds.x + bounds.width - width\n : bounds.x);\n var y = bounds.y + (bounds.height / 2 - height / 2);\n return {\n fontSize: fontSize,\n line: { text: line, encoded: encoded, width: width, height: height, x: x, y: y },\n bounds: { x: x, y: y, width: width, height: height },\n };\n};\n//# sourceMappingURL=layout.js.map","export var StandardFonts;\n(function (StandardFonts) {\n StandardFonts[\"Courier\"] = \"Courier\";\n StandardFonts[\"CourierBold\"] = \"Courier-Bold\";\n StandardFonts[\"CourierOblique\"] = \"Courier-Oblique\";\n StandardFonts[\"CourierBoldOblique\"] = \"Courier-BoldOblique\";\n StandardFonts[\"Helvetica\"] = \"Helvetica\";\n StandardFonts[\"HelveticaBold\"] = \"Helvetica-Bold\";\n StandardFonts[\"HelveticaOblique\"] = \"Helvetica-Oblique\";\n StandardFonts[\"HelveticaBoldOblique\"] = \"Helvetica-BoldOblique\";\n StandardFonts[\"TimesRoman\"] = \"Times-Roman\";\n StandardFonts[\"TimesRomanBold\"] = \"Times-Bold\";\n StandardFonts[\"TimesRomanItalic\"] = \"Times-Italic\";\n StandardFonts[\"TimesRomanBoldItalic\"] = \"Times-BoldItalic\";\n StandardFonts[\"Symbol\"] = \"Symbol\";\n StandardFonts[\"ZapfDingbats\"] = \"ZapfDingbats\";\n})(StandardFonts || (StandardFonts = {}));\n//# sourceMappingURL=StandardFonts.js.map","import { __assign, __spreadArrays } from \"tslib\";\nimport { drawCheckBox, rotateInPlace, drawRadioButton, drawButton, drawTextField, drawOptionList, } from \"../operations\";\nimport { rgb, componentsToColor, setFillingColor, grayscale, cmyk, } from \"../colors\";\nimport { reduceRotation, adjustDimsForRotation } from \"../rotations\";\nimport { layoutMultilineText, layoutCombedText, layoutSinglelineText, } from \"../text/layout\";\nimport { TextAlignment } from \"../text/alignment\";\nimport { setFontAndSize } from \"../operators\";\n/********************* Appearance Provider Functions **************************/\nexport var normalizeAppearance = function (appearance) {\n if ('normal' in appearance)\n return appearance;\n return { normal: appearance };\n};\nvar findLastMatch = function (value, regex) {\n var _a;\n var position = 0;\n var lastMatch;\n while (position < value.length) {\n var match = value.substring(position).match(regex);\n if (!match)\n return lastMatch;\n lastMatch = match;\n position += ((_a = match.index) !== null && _a !== void 0 ? _a : 0) + match[0].length;\n }\n return lastMatch;\n};\n// Examples:\n// `/Helv 12 Tf` -> ['Helv', '12']\n// `/HeBo 8.00 Tf` -> ['HeBo', '8.00']\nvar tfRegex = /\\/([^\\0\\t\\n\\f\\r\\ ]+)[\\0\\t\\n\\f\\r\\ ]+(\\d*\\.\\d+|\\d+)[\\0\\t\\n\\f\\r\\ ]+Tf/;\nvar getDefaultFontSize = function (field) {\n var _a, _b;\n var da = (_a = field.getDefaultAppearance()) !== null && _a !== void 0 ? _a : '';\n var daMatch = (_b = findLastMatch(da, tfRegex)) !== null && _b !== void 0 ? _b : [];\n var defaultFontSize = Number(daMatch[2]);\n return isFinite(defaultFontSize) ? defaultFontSize : undefined;\n};\n// Examples:\n// `0.3 g` -> ['0.3', 'g']\n// `0.3 1 .3 rg` -> ['0.3', '1', '.3', 'rg']\n// `0.3 1 .3 0 k` -> ['0.3', '1', '.3', '0', 'k']\nvar colorRegex = /(\\d*\\.\\d+|\\d+)[\\0\\t\\n\\f\\r\\ ]*(\\d*\\.\\d+|\\d+)?[\\0\\t\\n\\f\\r\\ ]*(\\d*\\.\\d+|\\d+)?[\\0\\t\\n\\f\\r\\ ]*(\\d*\\.\\d+|\\d+)?[\\0\\t\\n\\f\\r\\ ]+(g|rg|k)/;\nvar getDefaultColor = function (field) {\n var _a;\n var da = (_a = field.getDefaultAppearance()) !== null && _a !== void 0 ? _a : '';\n var daMatch = findLastMatch(da, colorRegex);\n var _b = daMatch !== null && daMatch !== void 0 ? daMatch : [], c1 = _b[1], c2 = _b[2], c3 = _b[3], c4 = _b[4], colorSpace = _b[5];\n if (colorSpace === 'g' && c1) {\n return grayscale(Number(c1));\n }\n if (colorSpace === 'rg' && c1 && c2 && c3) {\n return rgb(Number(c1), Number(c2), Number(c3));\n }\n if (colorSpace === 'k' && c1 && c2 && c3 && c4) {\n return cmyk(Number(c1), Number(c2), Number(c3), Number(c4));\n }\n return undefined;\n};\nvar updateDefaultAppearance = function (field, color, font, fontSize) {\n var _a;\n if (fontSize === void 0) { fontSize = 0; }\n var da = [\n setFillingColor(color).toString(),\n setFontAndSize((_a = font === null || font === void 0 ? void 0 : font.name) !== null && _a !== void 0 ? _a : 'dummy__noop', fontSize).toString(),\n ].join('\\n');\n field.setDefaultAppearance(da);\n};\nexport var defaultCheckBoxAppearanceProvider = function (checkBox, widget) {\n var _a, _b, _c;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(checkBox.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var borderWidth = (_a = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _a !== void 0 ? _a : 0;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _d = adjustDimsForRotation(rectangle, rotation), width = _d.width, height = _d.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation: rotation }));\n var black = rgb(0, 0, 0);\n var borderColor = (_b = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor())) !== null && _b !== void 0 ? _b : black;\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var downBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor(), 0.8);\n // Update color\n var textColor = (_c = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _c !== void 0 ? _c : black;\n if (widgetColor) {\n updateDefaultAppearance(widget, textColor);\n }\n else {\n updateDefaultAppearance(checkBox.acroField, textColor);\n }\n var options = {\n x: 0 + borderWidth / 2,\n y: 0 + borderWidth / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n thickness: 1.5,\n borderWidth: borderWidth,\n borderColor: borderColor,\n markColor: textColor,\n };\n return {\n normal: {\n on: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), { color: normalBackgroundColor, filled: true }))),\n off: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), { color: normalBackgroundColor, filled: false }))),\n },\n down: {\n on: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), { color: downBackgroundColor, filled: true }))),\n off: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), { color: downBackgroundColor, filled: false }))),\n },\n };\n};\nexport var defaultRadioGroupAppearanceProvider = function (radioGroup, widget) {\n var _a, _b, _c;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(radioGroup.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var borderWidth = (_a = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _a !== void 0 ? _a : 0;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _d = adjustDimsForRotation(rectangle, rotation), width = _d.width, height = _d.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation: rotation }));\n var black = rgb(0, 0, 0);\n var borderColor = (_b = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor())) !== null && _b !== void 0 ? _b : black;\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var downBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor(), 0.8);\n // Update color\n var textColor = (_c = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _c !== void 0 ? _c : black;\n if (widgetColor) {\n updateDefaultAppearance(widget, textColor);\n }\n else {\n updateDefaultAppearance(radioGroup.acroField, textColor);\n }\n var options = {\n x: width / 2,\n y: height / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n borderWidth: borderWidth,\n borderColor: borderColor,\n dotColor: textColor,\n };\n return {\n normal: {\n on: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), { color: normalBackgroundColor, filled: true }))),\n off: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), { color: normalBackgroundColor, filled: false }))),\n },\n down: {\n on: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), { color: downBackgroundColor, filled: true }))),\n off: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), { color: downBackgroundColor, filled: false }))),\n },\n };\n};\nexport var defaultButtonAppearanceProvider = function (button, widget, font) {\n var _a, _b, _c, _d, _e;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(button.acroField);\n var widgetFontSize = getDefaultFontSize(widget);\n var fieldFontSize = getDefaultFontSize(button.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var captions = ap === null || ap === void 0 ? void 0 : ap.getCaptions();\n var normalText = (_a = captions === null || captions === void 0 ? void 0 : captions.normal) !== null && _a !== void 0 ? _a : '';\n var downText = (_c = (_b = captions === null || captions === void 0 ? void 0 : captions.down) !== null && _b !== void 0 ? _b : normalText) !== null && _c !== void 0 ? _c : '';\n var borderWidth = (_d = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _d !== void 0 ? _d : 1;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _f = adjustDimsForRotation(rectangle, rotation), width = _f.width, height = _f.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation: rotation }));\n var black = rgb(0, 0, 0);\n var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var downBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor(), 0.8);\n var bounds = {\n x: borderWidth,\n y: borderWidth,\n width: width - borderWidth * 2,\n height: height - borderWidth * 2,\n };\n var normalLayout = layoutSinglelineText(normalText, {\n alignment: TextAlignment.Center,\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds,\n });\n var downLayout = layoutSinglelineText(downText, {\n alignment: TextAlignment.Center,\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds,\n });\n // Update font size and color\n var fontSize = Math.min(normalLayout.fontSize, downLayout.fontSize);\n var textColor = (_e = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _e !== void 0 ? _e : black;\n if (widgetColor || widgetFontSize !== undefined) {\n updateDefaultAppearance(widget, textColor, font, fontSize);\n }\n else {\n updateDefaultAppearance(button.acroField, textColor, font, fontSize);\n }\n var options = {\n x: 0 + borderWidth / 2,\n y: 0 + borderWidth / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n borderWidth: borderWidth,\n borderColor: borderColor,\n textColor: textColor,\n font: font.name,\n fontSize: fontSize,\n };\n return {\n normal: __spreadArrays(rotate, drawButton(__assign(__assign({}, options), { color: normalBackgroundColor, textLines: [normalLayout.line] }))),\n down: __spreadArrays(rotate, drawButton(__assign(__assign({}, options), { color: downBackgroundColor, textLines: [downLayout.line] }))),\n };\n};\nexport var defaultTextFieldAppearanceProvider = function (textField, widget, font) {\n var _a, _b, _c, _d;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(textField.acroField);\n var widgetFontSize = getDefaultFontSize(widget);\n var fieldFontSize = getDefaultFontSize(textField.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var text = (_a = textField.getText()) !== null && _a !== void 0 ? _a : '';\n var borderWidth = (_b = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _b !== void 0 ? _b : 1;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _e = adjustDimsForRotation(rectangle, rotation), width = _e.width, height = _e.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation: rotation }));\n var black = rgb(0, 0, 0);\n var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var textLines;\n var fontSize;\n var padding = textField.isCombed() ? 0 : 1;\n var bounds = {\n x: borderWidth + padding,\n y: borderWidth + padding,\n width: width - (borderWidth + padding) * 2,\n height: height - (borderWidth + padding) * 2,\n };\n if (textField.isMultiline()) {\n var layout = layoutMultilineText(text, {\n alignment: textField.getAlignment(),\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds,\n });\n textLines = layout.lines;\n fontSize = layout.fontSize;\n }\n else if (textField.isCombed()) {\n var layout = layoutCombedText(text, {\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds,\n cellCount: (_c = textField.getMaxLength()) !== null && _c !== void 0 ? _c : 0,\n });\n textLines = layout.cells;\n fontSize = layout.fontSize;\n }\n else {\n var layout = layoutSinglelineText(text, {\n alignment: textField.getAlignment(),\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds,\n });\n textLines = [layout.line];\n fontSize = layout.fontSize;\n }\n // Update font size and color\n var textColor = (_d = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _d !== void 0 ? _d : black;\n if (widgetColor || widgetFontSize !== undefined) {\n updateDefaultAppearance(widget, textColor, font, fontSize);\n }\n else {\n updateDefaultAppearance(textField.acroField, textColor, font, fontSize);\n }\n var options = {\n x: 0 + borderWidth / 2,\n y: 0 + borderWidth / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n borderWidth: borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0,\n borderColor: borderColor,\n textColor: textColor,\n font: font.name,\n fontSize: fontSize,\n color: normalBackgroundColor,\n textLines: textLines,\n padding: padding,\n };\n return __spreadArrays(rotate, drawTextField(options));\n};\nexport var defaultDropdownAppearanceProvider = function (dropdown, widget, font) {\n var _a, _b, _c;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(dropdown.acroField);\n var widgetFontSize = getDefaultFontSize(widget);\n var fieldFontSize = getDefaultFontSize(dropdown.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var text = (_a = dropdown.getSelected()[0]) !== null && _a !== void 0 ? _a : '';\n var borderWidth = (_b = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _b !== void 0 ? _b : 1;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _d = adjustDimsForRotation(rectangle, rotation), width = _d.width, height = _d.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation: rotation }));\n var black = rgb(0, 0, 0);\n var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var padding = 1;\n var bounds = {\n x: borderWidth + padding,\n y: borderWidth + padding,\n width: width - (borderWidth + padding) * 2,\n height: height - (borderWidth + padding) * 2,\n };\n var _e = layoutSinglelineText(text, {\n alignment: TextAlignment.Left,\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds,\n }), line = _e.line, fontSize = _e.fontSize;\n // Update font size and color\n var textColor = (_c = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _c !== void 0 ? _c : black;\n if (widgetColor || widgetFontSize !== undefined) {\n updateDefaultAppearance(widget, textColor, font, fontSize);\n }\n else {\n updateDefaultAppearance(dropdown.acroField, textColor, font, fontSize);\n }\n var options = {\n x: 0 + borderWidth / 2,\n y: 0 + borderWidth / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n borderWidth: borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0,\n borderColor: borderColor,\n textColor: textColor,\n font: font.name,\n fontSize: fontSize,\n color: normalBackgroundColor,\n textLines: [line],\n padding: padding,\n };\n return __spreadArrays(rotate, drawTextField(options));\n};\nexport var defaultOptionListAppearanceProvider = function (optionList, widget, font) {\n var _a, _b;\n // The `/DA` entry can be at the widget or field level - so we handle both\n var widgetColor = getDefaultColor(widget);\n var fieldColor = getDefaultColor(optionList.acroField);\n var widgetFontSize = getDefaultFontSize(widget);\n var fieldFontSize = getDefaultFontSize(optionList.acroField);\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var borderWidth = (_a = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _a !== void 0 ? _a : 1;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var _c = adjustDimsForRotation(rectangle, rotation), width = _c.width, height = _c.height;\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation: rotation }));\n var black = rgb(0, 0, 0);\n var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());\n var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());\n var options = optionList.getOptions();\n var selected = optionList.getSelected();\n if (optionList.isSorted())\n options.sort();\n var text = '';\n for (var idx = 0, len = options.length; idx < len; idx++) {\n text += options[idx];\n if (idx < len - 1)\n text += '\\n';\n }\n var padding = 1;\n var bounds = {\n x: borderWidth + padding,\n y: borderWidth + padding,\n width: width - (borderWidth + padding) * 2,\n height: height - (borderWidth + padding) * 2,\n };\n var _d = layoutMultilineText(text, {\n alignment: TextAlignment.Left,\n fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,\n font: font,\n bounds: bounds,\n }), lines = _d.lines, fontSize = _d.fontSize, lineHeight = _d.lineHeight;\n var selectedLines = [];\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n var line = lines[idx];\n if (selected.includes(line.text))\n selectedLines.push(idx);\n }\n var blue = rgb(153 / 255, 193 / 255, 218 / 255);\n // Update font size and color\n var textColor = (_b = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _b !== void 0 ? _b : black;\n if (widgetColor || widgetFontSize !== undefined) {\n updateDefaultAppearance(widget, textColor, font, fontSize);\n }\n else {\n updateDefaultAppearance(optionList.acroField, textColor, font, fontSize);\n }\n return __spreadArrays(rotate, drawOptionList({\n x: 0 + borderWidth / 2,\n y: 0 + borderWidth / 2,\n width: width - borderWidth,\n height: height - borderWidth,\n borderWidth: borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0,\n borderColor: borderColor,\n textColor: textColor,\n font: font.name,\n fontSize: fontSize,\n color: normalBackgroundColor,\n textLines: lines,\n lineHeight: lineHeight,\n selectedColor: blue,\n selectedLines: selectedLines,\n padding: padding,\n }));\n};\n//# sourceMappingURL=appearances.js.map","import { __awaiter, __generator } from \"tslib\";\nimport PDFDocument from \"./PDFDocument\";\nimport { PDFPageEmbedder, PDFRef } from \"../core\";\nimport { assertIs } from \"../utils\";\n/**\n * Represents a PDF page that has been embedded in a [[PDFDocument]].\n */\nvar PDFEmbeddedPage = /** @class */ (function () {\n function PDFEmbeddedPage(ref, doc, embedder) {\n this.alreadyEmbedded = false;\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n assertIs(embedder, 'embedder', [[PDFPageEmbedder, 'PDFPageEmbedder']]);\n this.ref = ref;\n this.doc = doc;\n this.width = embedder.width;\n this.height = embedder.height;\n this.embedder = embedder;\n }\n /**\n * Compute the width and height of this page after being scaled by the\n * given `factor`. For example:\n * ```js\n * embeddedPage.width // => 500\n * embeddedPage.height // => 250\n *\n * const scaled = embeddedPage.scale(0.5)\n * scaled.width // => 250\n * scaled.height // => 125\n * ```\n * This operation is often useful before drawing a page with\n * [[PDFPage.drawPage]] to compute the `width` and `height` options.\n * @param factor The factor by which this page should be scaled.\n * @returns The width and height of the page after being scaled.\n */\n PDFEmbeddedPage.prototype.scale = function (factor) {\n assertIs(factor, 'factor', ['number']);\n return { width: this.width * factor, height: this.height * factor };\n };\n /**\n * Get the width and height of this page. For example:\n * ```js\n * const { width, height } = embeddedPage.size()\n * ```\n * @returns The width and height of the page.\n */\n PDFEmbeddedPage.prototype.size = function () {\n return this.scale(1);\n };\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all embeddable pages get embedded.\n *\n * Embed this embeddable page in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFEmbeddedPage.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.alreadyEmbedded) return [3 /*break*/, 2];\n return [4 /*yield*/, this.embedder.embedIntoContext(this.doc.context, this.ref)];\n case 1:\n _a.sent();\n this.alreadyEmbedded = true;\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.embedPdf]] and\n * > [[PDFDocument.embedPage]] methods, which will create instances of\n * > [[PDFEmbeddedPage]] for you.\n *\n * Create an instance of [[PDFEmbeddedPage]] from an existing ref and embedder\n *\n * @param ref The unique reference for this embedded page.\n * @param doc The document to which the embedded page will belong.\n * @param embedder The embedder that will be used to embed the page.\n */\n PDFEmbeddedPage.of = function (ref, doc, embedder) {\n return new PDFEmbeddedPage(ref, doc, embedder);\n };\n return PDFEmbeddedPage;\n}());\nexport default PDFEmbeddedPage;\n//# sourceMappingURL=PDFEmbeddedPage.js.map","import { __awaiter, __generator } from \"tslib\";\nimport PDFDocument from \"./PDFDocument\";\nimport { CustomFontEmbedder, PDFRef, StandardFontEmbedder, } from \"../core\";\nimport { assertIs, assertOrUndefined } from \"../utils\";\n/**\n * Represents a font that has been embedded in a [[PDFDocument]].\n */\nvar PDFFont = /** @class */ (function () {\n function PDFFont(ref, doc, embedder) {\n this.modified = true;\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n assertIs(embedder, 'embedder', [\n [CustomFontEmbedder, 'CustomFontEmbedder'],\n [StandardFontEmbedder, 'StandardFontEmbedder'],\n ]);\n this.ref = ref;\n this.doc = doc;\n this.name = embedder.fontName;\n this.embedder = embedder;\n }\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFPage.drawText]] method will automatically encode the text it is\n * > given.\n *\n * Encodes a string of text in this font.\n *\n * @param text The text to be encoded.\n * @returns The encoded text as a hex string.\n */\n PDFFont.prototype.encodeText = function (text) {\n assertIs(text, 'text', ['string']);\n this.modified = true;\n return this.embedder.encodeText(text);\n };\n /**\n * Measure the width of a string of text drawn in this font at a given size.\n * For example:\n * ```js\n * const width = font.widthOfTextAtSize('Foo Bar Qux Baz', 36)\n * ```\n * @param text The string of text to be measured.\n * @param size The font size to be used for this measurement.\n * @returns The width of the string of text when drawn in this font at the\n * given size.\n */\n PDFFont.prototype.widthOfTextAtSize = function (text, size) {\n assertIs(text, 'text', ['string']);\n assertIs(size, 'size', ['number']);\n return this.embedder.widthOfTextAtSize(text, size);\n };\n /**\n * Measure the height of this font at a given size. For example:\n * ```js\n * const height = font.heightAtSize(24)\n * ```\n *\n * The `options.descender` value controls whether or not the font's\n * descender is included in the height calculation.\n *\n * @param size The font size to be used for this measurement.\n * @param options The options to be used when computing this measurement.\n * @returns The height of this font at the given size.\n */\n PDFFont.prototype.heightAtSize = function (size, options) {\n var _a;\n assertIs(size, 'size', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.descender, 'options.descender', ['boolean']);\n return this.embedder.heightOfFontAtSize(size, {\n descender: (_a = options === null || options === void 0 ? void 0 : options.descender) !== null && _a !== void 0 ? _a : true,\n });\n };\n /**\n * Compute the font size at which this font is a given height. For example:\n * ```js\n * const fontSize = font.sizeAtHeight(12)\n * ```\n * @param height The height to be used for this calculation.\n * @returns The font size at which this font is the given height.\n */\n PDFFont.prototype.sizeAtHeight = function (height) {\n assertIs(height, 'height', ['number']);\n return this.embedder.sizeOfFontAtHeight(height);\n };\n /**\n * Get the set of unicode code points that can be represented by this font.\n * @returns The set of unicode code points supported by this font.\n */\n PDFFont.prototype.getCharacterSet = function () {\n if (this.embedder instanceof StandardFontEmbedder) {\n return this.embedder.encoding.supportedCodePoints;\n }\n else {\n return this.embedder.font.characterSet;\n }\n };\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all fonts get embedded.\n *\n * Embed this font in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFFont.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this.modified) return [3 /*break*/, 2];\n return [4 /*yield*/, this.embedder.embedIntoContext(this.doc.context, this.ref)];\n case 1:\n _a.sent();\n this.modified = false;\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.embedFont]] and\n * > [[PDFDocument.embedStandardFont]] methods, which will create instances\n * > of [[PDFFont]] for you.\n *\n * Create an instance of [[PDFFont]] from an existing ref and embedder\n *\n * @param ref The unique reference for this font.\n * @param doc The document to which the font will belong.\n * @param embedder The embedder that will be used to embed the font.\n */\n PDFFont.of = function (ref, doc, embedder) {\n return new PDFFont(ref, doc, embedder);\n };\n return PDFFont;\n}());\nexport default PDFFont;\n//# sourceMappingURL=PDFFont.js.map","import { __awaiter, __generator } from \"tslib\";\nimport PDFDocument from \"./PDFDocument\";\nimport { JpegEmbedder, PDFRef, PngEmbedder } from \"../core\";\nimport { assertIs } from \"../utils\";\n/**\n * Represents an image that has been embedded in a [[PDFDocument]].\n */\nvar PDFImage = /** @class */ (function () {\n function PDFImage(ref, doc, embedder) {\n this.alreadyEmbedded = false;\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n assertIs(embedder, 'embedder', [\n [JpegEmbedder, 'JpegEmbedder'],\n [PngEmbedder, 'PngEmbedder'],\n ]);\n this.ref = ref;\n this.doc = doc;\n this.width = embedder.width;\n this.height = embedder.height;\n this.embedder = embedder;\n }\n /**\n * Compute the width and height of this image after being scaled by the\n * given `factor`. For example:\n * ```js\n * image.width // => 500\n * image.height // => 250\n *\n * const scaled = image.scale(0.5)\n * scaled.width // => 250\n * scaled.height // => 125\n * ```\n * This operation is often useful before drawing an image with\n * [[PDFPage.drawImage]] to compute the `width` and `height` options.\n * @param factor The factor by which this image should be scaled.\n * @returns The width and height of the image after being scaled.\n */\n PDFImage.prototype.scale = function (factor) {\n assertIs(factor, 'factor', ['number']);\n return { width: this.width * factor, height: this.height * factor };\n };\n /**\n * Get the width and height of this image after scaling it as large as\n * possible while maintaining its aspect ratio and not exceeding the\n * specified `width` and `height`. For example:\n * ```\n * image.width // => 500\n * image.height // => 250\n *\n * const scaled = image.scaleToFit(750, 1000)\n * scaled.width // => 750\n * scaled.height // => 375\n * ```\n * The `width` and `height` parameters can also be thought of as the width\n * and height of a box that the scaled image must fit within.\n * @param width The bounding box's width.\n * @param height The bounding box's height.\n * @returns The width and height of the image after being scaled.\n */\n PDFImage.prototype.scaleToFit = function (width, height) {\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var imgWidthScale = width / this.width;\n var imgHeightScale = height / this.height;\n var scale = Math.min(imgWidthScale, imgHeightScale);\n return this.scale(scale);\n };\n /**\n * Get the width and height of this image. For example:\n * ```js\n * const { width, height } = image.size()\n * ```\n * @returns The width and height of the image.\n */\n PDFImage.prototype.size = function () {\n return this.scale(1);\n };\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all images get embedded.\n *\n * Embed this image in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFImage.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.alreadyEmbedded) return [3 /*break*/, 2];\n return [4 /*yield*/, this.embedder.embedIntoContext(this.doc.context, this.ref)];\n case 1:\n _a.sent();\n this.alreadyEmbedded = true;\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.embedPng]] and [[PDFDocument.embedJpg]]\n * > methods, which will create instances of [[PDFImage]] for you.\n *\n * Create an instance of [[PDFImage]] from an existing ref and embedder\n *\n * @param ref The unique reference for this image.\n * @param doc The document to which the image will belong.\n * @param embedder The embedder that will be used to embed the image.\n */\n PDFImage.of = function (ref, doc, embedder) {\n return new PDFImage(ref, doc, embedder);\n };\n return PDFImage;\n}());\nexport default PDFImage;\n//# sourceMappingURL=PDFImage.js.map","import PDFDocument from \"../PDFDocument\";\nimport { colorToComponents, setFillingColor } from \"../colors\";\nimport { toDegrees, rotateRectangle } from \"../rotations\";\nimport { PDFRef, PDFWidgetAnnotation, PDFName, MethodNotImplementedError, PDFAcroField, AcroFieldFlags, } from \"../../core\";\nimport { assertIs, assertMultiple, assertOrUndefined } from \"../../utils\";\nexport var assertFieldAppearanceOptions = function (options) {\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.x, 'options.x', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.y, 'options.y', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.width, 'options.width', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.height, 'options.height', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.textColor, 'options.textColor', [\n [Object, 'Color'],\n ]);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.backgroundColor, 'options.backgroundColor', [\n [Object, 'Color'],\n ]);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.borderColor, 'options.borderColor', [\n [Object, 'Color'],\n ]);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.borderWidth, 'options.borderWidth', ['number']);\n assertOrUndefined(options === null || options === void 0 ? void 0 : options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n};\n/**\n * Represents a field of a [[PDFForm]].\n *\n * This class is effectively abstract. All fields in a [[PDFForm]] will\n * actually be an instance of a subclass of this class.\n *\n * Note that each field in a PDF is represented by a single field object.\n * However, a given field object may be rendered at multiple locations within\n * the document (across one or more pages). The rendering of a field is\n * controlled by its widgets. Each widget causes its field to be displayed at a\n * particular location in the document.\n *\n * Most of the time each field in a PDF has only a single widget, and thus is\n * only rendered once. However, if a field is rendered multiple times, it will\n * have multiple widgets - one for each location it is rendered.\n *\n * This abstraction of field objects and widgets is defined in the PDF\n * specification and dictates how PDF files store fields and where they are\n * to be rendered.\n */\nvar PDFField = /** @class */ (function () {\n function PDFField(acroField, ref, doc) {\n assertIs(acroField, 'acroField', [[PDFAcroField, 'PDFAcroField']]);\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n this.acroField = acroField;\n this.ref = ref;\n this.doc = doc;\n }\n /**\n * Get the fully qualified name of this field. For example:\n * ```js\n * const fields = form.getFields()\n * fields.forEach(field => {\n * const name = field.getName()\n * console.log('Field name:', name)\n * })\n * ```\n * Note that PDF fields are structured as a tree. Each field is the\n * descendent of a series of ancestor nodes all the way up to the form node,\n * which is always the root of the tree. Each node in the tree (except for\n * the form node) has a partial name. Partial names can be composed of any\n * unicode characters except a period (`.`). The fully qualified name of a\n * field is composed of the partial names of all its ancestors joined\n * with periods. This means that splitting the fully qualified name on\n * periods and taking the last element of the resulting array will give you\n * the partial name of a specific field.\n * @returns The fully qualified name of this field.\n */\n PDFField.prototype.getName = function () {\n var _a;\n return (_a = this.acroField.getFullyQualifiedName()) !== null && _a !== void 0 ? _a : '';\n };\n /**\n * Returns `true` if this field is read only. This means that PDF readers\n * will not allow users to interact with the field or change its value. See\n * [[PDFField.enableReadOnly]] and [[PDFField.disableReadOnly]].\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * if (field.isReadOnly()) console.log('Read only is enabled')\n * ```\n * @returns Whether or not this is a read only field.\n */\n PDFField.prototype.isReadOnly = function () {\n return this.acroField.hasFlag(AcroFieldFlags.ReadOnly);\n };\n /**\n * Prevent PDF readers from allowing users to interact with this field or\n * change its value. The field will not respond to mouse or keyboard input.\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * field.enableReadOnly()\n * ```\n * Useful for fields whose values are computed, imported from a database, or\n * prefilled by software before being displayed to the user.\n */\n PDFField.prototype.enableReadOnly = function () {\n this.acroField.setFlagTo(AcroFieldFlags.ReadOnly, true);\n };\n /**\n * Allow users to interact with this field and change its value in PDF\n * readers via mouse and keyboard input. For example:\n * ```js\n * const field = form.getField('some.field')\n * field.disableReadOnly()\n * ```\n */\n PDFField.prototype.disableReadOnly = function () {\n this.acroField.setFlagTo(AcroFieldFlags.ReadOnly, false);\n };\n /**\n * Returns `true` if this field must have a value when the form is submitted.\n * See [[PDFField.enableRequired]] and [[PDFField.disableRequired]].\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * if (field.isRequired()) console.log('Field is required')\n * ```\n * @returns Whether or not this field is required.\n */\n PDFField.prototype.isRequired = function () {\n return this.acroField.hasFlag(AcroFieldFlags.Required);\n };\n /**\n * Require this field to have a value when the form is submitted.\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * field.enableRequired()\n * ```\n */\n PDFField.prototype.enableRequired = function () {\n this.acroField.setFlagTo(AcroFieldFlags.Required, true);\n };\n /**\n * Do not require this field to have a value when the form is submitted.\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * field.disableRequired()\n * ```\n */\n PDFField.prototype.disableRequired = function () {\n this.acroField.setFlagTo(AcroFieldFlags.Required, false);\n };\n /**\n * Returns `true` if this field's value should be exported when the form is\n * submitted. See [[PDFField.enableExporting]] and\n * [[PDFField.disableExporting]].\n * For example:\n * ```js\n * const field = form.getField('some.field')\n * if (field.isExported()) console.log('Exporting is enabled')\n * ```\n * @returns Whether or not this field's value should be exported.\n */\n PDFField.prototype.isExported = function () {\n return !this.acroField.hasFlag(AcroFieldFlags.NoExport);\n };\n /**\n * Indicate that this field's value should be exported when the form is\n * submitted in a PDF reader. For example:\n * ```js\n * const field = form.getField('some.field')\n * field.enableExporting()\n * ```\n */\n PDFField.prototype.enableExporting = function () {\n this.acroField.setFlagTo(AcroFieldFlags.NoExport, false);\n };\n /**\n * Indicate that this field's value should **not** be exported when the form\n * is submitted in a PDF reader. For example:\n * ```js\n * const field = form.getField('some.field')\n * field.disableExporting()\n * ```\n */\n PDFField.prototype.disableExporting = function () {\n this.acroField.setFlagTo(AcroFieldFlags.NoExport, true);\n };\n /** @ignore */\n PDFField.prototype.needsAppearancesUpdate = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'needsAppearancesUpdate');\n };\n /** @ignore */\n PDFField.prototype.defaultUpdateAppearances = function (_font) {\n throw new MethodNotImplementedError(this.constructor.name, 'defaultUpdateAppearances');\n };\n PDFField.prototype.markAsDirty = function () {\n this.doc.getForm().markFieldAsDirty(this.ref);\n };\n PDFField.prototype.markAsClean = function () {\n this.doc.getForm().markFieldAsClean(this.ref);\n };\n PDFField.prototype.isDirty = function () {\n return this.doc.getForm().fieldIsDirty(this.ref);\n };\n PDFField.prototype.createWidget = function (options) {\n var _a;\n var textColor = options.textColor;\n var backgroundColor = options.backgroundColor;\n var borderColor = options.borderColor;\n var borderWidth = options.borderWidth;\n var degreesAngle = toDegrees(options.rotate);\n var caption = options.caption;\n var x = options.x;\n var y = options.y;\n var width = options.width + borderWidth;\n var height = options.height + borderWidth;\n assertMultiple(degreesAngle, 'degreesAngle', 90);\n // Create a widget for this field\n var widget = PDFWidgetAnnotation.create(this.doc.context, this.ref);\n // Set widget properties\n var rect = rotateRectangle({ x: x, y: y, width: width, height: height }, borderWidth, degreesAngle);\n widget.setRectangle(rect);\n var ac = widget.getOrCreateAppearanceCharacteristics();\n if (backgroundColor) {\n ac.setBackgroundColor(colorToComponents(backgroundColor));\n }\n ac.setRotation(degreesAngle);\n if (caption)\n ac.setCaptions({ normal: caption });\n if (borderColor)\n ac.setBorderColor(colorToComponents(borderColor));\n var bs = widget.getOrCreateBorderStyle();\n if (borderWidth !== undefined)\n bs.setWidth(borderWidth);\n // Set acrofield properties\n if (textColor) {\n var da = (_a = this.acroField.getDefaultAppearance()) !== null && _a !== void 0 ? _a : '';\n var newDa = da + '\\n' + setFillingColor(textColor).toString();\n this.acroField.setDefaultAppearance(newDa);\n }\n return widget;\n };\n PDFField.prototype.updateWidgetAppearanceWithFont = function (widget, font, _a) {\n var normal = _a.normal, rollover = _a.rollover, down = _a.down;\n this.updateWidgetAppearances(widget, {\n normal: this.createAppearanceStream(widget, normal, font),\n rollover: rollover && this.createAppearanceStream(widget, rollover, font),\n down: down && this.createAppearanceStream(widget, down, font),\n });\n };\n PDFField.prototype.updateOnOffWidgetAppearance = function (widget, onValue, _a) {\n var normal = _a.normal, rollover = _a.rollover, down = _a.down;\n this.updateWidgetAppearances(widget, {\n normal: this.createAppearanceDict(widget, normal, onValue),\n rollover: rollover && this.createAppearanceDict(widget, rollover, onValue),\n down: down && this.createAppearanceDict(widget, down, onValue),\n });\n };\n PDFField.prototype.updateWidgetAppearances = function (widget, _a) {\n var normal = _a.normal, rollover = _a.rollover, down = _a.down;\n widget.setNormalAppearance(normal);\n if (rollover) {\n widget.setRolloverAppearance(rollover);\n }\n else {\n widget.removeRolloverAppearance();\n }\n if (down) {\n widget.setDownAppearance(down);\n }\n else {\n widget.removeDownAppearance();\n }\n };\n // // TODO: Do we need to do this...?\n // private foo(font: PDFFont, dict: PDFDict) {\n // if (!dict.lookup(PDFName.of('DR'))) {\n // dict.set(PDFName.of('DR'), dict.context.obj({}));\n // }\n // const DR = dict.lookup(PDFName.of('DR'), PDFDict);\n // if (!DR.lookup(PDFName.of('Font'))) {\n // DR.set(PDFName.of('Font'), dict.context.obj({}));\n // }\n // const Font = DR.lookup(PDFName.of('Font'), PDFDict);\n // Font.set(PDFName.of(font.name), font.ref);\n // }\n PDFField.prototype.createAppearanceStream = function (widget, appearance, font) {\n var _a;\n var context = this.acroField.dict.context;\n var _b = widget.getRectangle(), width = _b.width, height = _b.height;\n // TODO: Do we need to do this...?\n // if (font) {\n // this.foo(font, widget.dict);\n // this.foo(font, this.doc.getForm().acroForm.dict);\n // }\n // END TODO\n var Resources = font && { Font: (_a = {}, _a[font.name] = font.ref, _a) };\n var stream = context.formXObject(appearance, {\n Resources: Resources,\n BBox: context.obj([0, 0, width, height]),\n Matrix: context.obj([1, 0, 0, 1, 0, 0]),\n });\n var streamRef = context.register(stream);\n return streamRef;\n };\n PDFField.prototype.createAppearanceDict = function (widget, appearance, onValue) {\n var context = this.acroField.dict.context;\n var onStreamRef = this.createAppearanceStream(widget, appearance.on);\n var offStreamRef = this.createAppearanceStream(widget, appearance.off);\n var appearanceDict = context.obj({});\n appearanceDict.set(onValue, onStreamRef);\n appearanceDict.set(PDFName.of('Off'), offStreamRef);\n return appearanceDict;\n };\n return PDFField;\n}());\nexport default PDFField;\n//# sourceMappingURL=PDFField.js.map","import { __extends } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport { normalizeAppearance, defaultCheckBoxAppearanceProvider, } from \"./appearances\";\nimport { rgb } from \"../colors\";\nimport { degrees } from \"../rotations\";\nimport PDFField, { assertFieldAppearanceOptions, } from \"./PDFField\";\nimport { PDFName, PDFDict, PDFAcroCheckBox, } from \"../../core\";\nimport { assertIs, assertOrUndefined } from \"../../utils\";\n/**\n * Represents a check box field of a [[PDFForm]].\n *\n * [[PDFCheckBox]] fields are interactive boxes that users can click with their\n * mouse. This type of [[PDFField]] has two states: `on` and `off`. The purpose\n * of a check box is to enable users to select from one or more options, where\n * each option is represented by a single check box. Check boxes are typically\n * square in shape and display a check mark when they are in the `on` state.\n */\nvar PDFCheckBox = /** @class */ (function (_super) {\n __extends(PDFCheckBox, _super);\n function PDFCheckBox(acroCheckBox, ref, doc) {\n var _this = _super.call(this, acroCheckBox, ref, doc) || this;\n assertIs(acroCheckBox, 'acroCheckBox', [\n [PDFAcroCheckBox, 'PDFAcroCheckBox'],\n ]);\n _this.acroField = acroCheckBox;\n return _this;\n }\n /**\n * Mark this check box. This operation is analogous to a human user clicking\n * a check box to fill it in a PDF reader. This method will update the\n * underlying state of the check box field to indicate it has been selected.\n * PDF libraries and readers will be able to extract this value from the\n * saved document and determine that it was selected.\n *\n * For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * checkBox.check()\n * ```\n *\n * This method will mark this check box as dirty, causing its appearance\n * streams to be updated when either [[PDFDocument.save]] or\n * [[PDFForm.updateFieldAppearances]] is called. The updated appearance\n * streams will display a check mark inside the widgets of this check box\n * field.\n */\n PDFCheckBox.prototype.check = function () {\n var _a;\n var onValue = (_a = this.acroField.getOnValue()) !== null && _a !== void 0 ? _a : PDFName.of('Yes');\n this.markAsDirty();\n this.acroField.setValue(onValue);\n };\n /**\n * Clears this check box. This operation is analogous to a human user clicking\n * a check box to unmark it in a PDF reader. This method will update the\n * underlying state of the check box field to indicate it has been deselected.\n * PDF libraries and readers will be able to extract this value from the\n * saved document and determine that it was not selected.\n *\n * For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * checkBox.uncheck()\n * ```\n *\n * This method will mark this check box as dirty. See [[PDFCheckBox.check]]\n * for more details about what this means.\n */\n PDFCheckBox.prototype.uncheck = function () {\n this.markAsDirty();\n this.acroField.setValue(PDFName.of('Off'));\n };\n /**\n * Returns `true` if this check box is selected (either by a human user via\n * a PDF reader, or else programmatically via software). For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * if (checkBox.isChecked()) console.log('check box is selected')\n * ```\n * @returns Whether or not this check box is selected.\n */\n PDFCheckBox.prototype.isChecked = function () {\n var onValue = this.acroField.getOnValue();\n return !!onValue && onValue === this.acroField.getValue();\n };\n /**\n * Show this check box on the specified page. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const checkBox = form.createCheckBox('some.checkBox.field')\n *\n * checkBox.addToPage(page, {\n * x: 50,\n * y: 75,\n * width: 25,\n * height: 25,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * })\n * ```\n * This will create a new widget for this check box field.\n * @param page The page to which this check box widget should be added.\n * @param options The options to be used when adding this check box widget.\n */\n PDFCheckBox.prototype.addToPage = function (page, options) {\n var _a, _b, _c, _d, _e, _f;\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n if (!options)\n options = {};\n if (!('textColor' in options))\n options.textColor = rgb(0, 0, 0);\n if (!('backgroundColor' in options))\n options.backgroundColor = rgb(1, 1, 1);\n if (!('borderColor' in options))\n options.borderColor = rgb(0, 0, 0);\n if (!('borderWidth' in options))\n options.borderWidth = 1;\n // Create a widget for this check box\n var widget = this.createWidget({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : 50,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : 50,\n textColor: options.textColor,\n backgroundColor: options.backgroundColor,\n borderColor: options.borderColor,\n borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,\n rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n this.acroField.addWidget(widgetRef);\n // Set appearance streams for widget\n widget.setAppearanceState(PDFName.of('Off'));\n this.updateWidgetAppearance(widget, PDFName.of('Yes'));\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if any of this check box's widgets do not have an\n * appearance stream for its current state. For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * if (checkBox.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this check box needs an appearance update.\n */\n PDFCheckBox.prototype.needsAppearancesUpdate = function () {\n var _a;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var value = this.acroField.getValue();\n var normal = (_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal;\n return !(normal instanceof PDFDict && normal.has(value));\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this check box's widgets using\n * the default appearance provider for check boxes. For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * checkBox.defaultUpdateAppearances()\n * ```\n */\n PDFCheckBox.prototype.defaultUpdateAppearances = function () {\n this.updateAppearances();\n };\n /**\n * Update the appearance streams for each of this check box's widgets using\n * the given appearance provider. If no `provider` is passed, the default\n * appearance provider for check boxs will be used. For example:\n * ```js\n * const checkBox = form.getCheckBox('some.checkBox.field')\n * checkBox.updateAppearances((field, widget) => {\n * ...\n * return {\n * normal: { on: drawCheckBox(...), off: drawCheckBox(...) },\n * down: { on: drawCheckBox(...), off: drawCheckBox(...) },\n * }\n * })\n * ```\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFCheckBox.prototype.updateAppearances = function (provider) {\n var _a;\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var onValue = (_a = widget.getOnValue()) !== null && _a !== void 0 ? _a : PDFName.of('Yes');\n if (!onValue)\n continue;\n this.updateWidgetAppearance(widget, onValue, provider);\n }\n this.markAsClean();\n };\n PDFCheckBox.prototype.updateWidgetAppearance = function (widget, onValue, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultCheckBoxAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget));\n this.updateOnOffWidgetAppearance(widget, onValue, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getCheckBox]] method, which will create an\n * > instance of [[PDFCheckBox]] for you.\n *\n * Create an instance of [[PDFCheckBox]] from an existing acroCheckBox and ref\n *\n * @param acroCheckBox The underlying `PDFAcroCheckBox` for this check box.\n * @param ref The unique reference for this check box.\n * @param doc The document to which this check box will belong.\n */\n PDFCheckBox.of = function (acroCheckBox, ref, doc) {\n return new PDFCheckBox(acroCheckBox, ref, doc);\n };\n return PDFCheckBox;\n}(PDFField));\nexport default PDFCheckBox;\n//# sourceMappingURL=PDFCheckBox.js.map","import { __extends } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport PDFFont from \"../PDFFont\";\nimport PDFField, { assertFieldAppearanceOptions, } from \"./PDFField\";\nimport { normalizeAppearance, defaultDropdownAppearanceProvider, } from \"./appearances\";\nimport { rgb } from \"../colors\";\nimport { degrees } from \"../rotations\";\nimport { PDFHexString, PDFStream, PDFAcroComboBox, AcroChoiceFlags, } from \"../../core\";\nimport { assertIs, assertOrUndefined } from \"../../utils\";\n/**\n * Represents a dropdown field of a [[PDFForm]].\n *\n * [[PDFDropdown]] fields are interactive text boxes that display a single\n * element (the currently selected value). The purpose of a dropdown is to\n * enable users to select a single option from a set of possible options. Users\n * can click on a dropdown to view the full list of options it provides.\n * Clicking on an option in the list will cause it to be selected and displayed\n * in the dropdown's text box. Some dropdowns allow users to enter text\n * directly into the box from their keyboard, rather than only being allowed to\n * choose an option from the list (see [[PDFDropdown.isEditable]]).\n */\nvar PDFDropdown = /** @class */ (function (_super) {\n __extends(PDFDropdown, _super);\n function PDFDropdown(acroComboBox, ref, doc) {\n var _this = _super.call(this, acroComboBox, ref, doc) || this;\n assertIs(acroComboBox, 'acroComboBox', [\n [PDFAcroComboBox, 'PDFAcroComboBox'],\n ]);\n _this.acroField = acroComboBox;\n return _this;\n }\n /**\n * Get the list of available options for this dropdown. These options will be\n * displayed to users who click on this dropdown in a PDF reader.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * const options = dropdown.getOptions()\n * console.log('Dropdown options:', options)\n * ```\n * @returns The options for this dropdown.\n */\n PDFDropdown.prototype.getOptions = function () {\n var rawOptions = this.acroField.getOptions();\n var options = new Array(rawOptions.length);\n for (var idx = 0, len = options.length; idx < len; idx++) {\n var _a = rawOptions[idx], display = _a.display, value = _a.value;\n options[idx] = (display !== null && display !== void 0 ? display : value).decodeText();\n }\n return options;\n };\n /**\n * Get the selected options for this dropdown. These are the values that were\n * selected by a human user via a PDF reader, or programatically via\n * software.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * const selections = dropdown.getSelected()\n * console.log('Dropdown selections:', selections)\n * ```\n * > **NOTE:** Note that PDF readers only display one selected option when\n * > rendering dropdowns. However, the PDF specification does allow for\n * > multiple values to be selected in a dropdown. As such, the `pdf-lib`\n * > API supports this. However, in most cases the array returned by this\n * > method will contain only a single element (or no elements).\n * @returns The selected options in this dropdown.\n */\n PDFDropdown.prototype.getSelected = function () {\n var values = this.acroField.getValues();\n var selected = new Array(values.length);\n for (var idx = 0, len = values.length; idx < len; idx++) {\n selected[idx] = values[idx].decodeText();\n }\n return selected;\n };\n /**\n * Set the list of options that are available for this dropdown. These are\n * the values that will be available for users to select when they view this\n * dropdown in a PDF reader. Note that preexisting options for this dropdown\n * will be removed. Only the values passed as `options` will be available to\n * select.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('planets.dropdown')\n * dropdown.setOptions(['Earth', 'Mars', 'Pluto', 'Venus'])\n * ```\n * @param options The options that should be available in this dropdown.\n */\n PDFDropdown.prototype.setOptions = function (options) {\n assertIs(options, 'options', [Array]);\n var optionObjects = new Array(options.length);\n for (var idx = 0, len = options.length; idx < len; idx++) {\n optionObjects[idx] = { value: PDFHexString.fromText(options[idx]) };\n }\n this.acroField.setOptions(optionObjects);\n };\n /**\n * Add to the list of options that are available for this dropdown. Users\n * will be able to select these values in a PDF reader. In addition to the\n * values passed as `options`, any preexisting options for this dropdown will\n * still be available for users to select.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('rockets.dropdown')\n * dropdown.addOptions(['Saturn IV', 'Falcon Heavy'])\n * ```\n * @param options New options that should be available in this dropdown.\n */\n PDFDropdown.prototype.addOptions = function (options) {\n assertIs(options, 'options', ['string', Array]);\n var optionsArr = Array.isArray(options) ? options : [options];\n var existingOptions = this.acroField.getOptions();\n var newOptions = new Array(optionsArr.length);\n for (var idx = 0, len = optionsArr.length; idx < len; idx++) {\n newOptions[idx] = { value: PDFHexString.fromText(optionsArr[idx]) };\n }\n this.acroField.setOptions(existingOptions.concat(newOptions));\n };\n /**\n * Select one or more values for this dropdown. This operation is analogous\n * to a human user opening the dropdown in a PDF reader and clicking on a\n * value to select it. This method will update the underlying state of the\n * dropdown to indicate which values have been selected. PDF libraries and\n * readers will be able to extract these values from the saved document and\n * determine which values were selected.\n *\n * For example:\n * ```js\n * const dropdown = form.getDropdown('best.superhero.dropdown')\n * dropdown.select('One Punch Man')\n * ```\n *\n * This method will mark this dropdown as dirty, causing its appearance\n * streams to be updated when either [[PDFDocument.save]] or\n * [[PDFForm.updateFieldAppearances]] is called. The updated streams will\n * display the selected option inside the widgets of this dropdown.\n *\n * **IMPORTANT:** The default font used to update appearance streams is\n * [[StandardFonts.Helvetica]]. Note that this is a WinAnsi font. This means\n * that encoding errors will be thrown if the selected option for this field\n * contains characters outside the WinAnsi character set (the latin alphabet).\n *\n * Embedding a custom font and passing it to\n * [[PDFForm.updateFieldAppearances]] or [[PDFDropdown.updateAppearances]]\n * allows you to generate appearance streams with characters outside the\n * latin alphabet (assuming the custom font supports them).\n *\n * Selecting an option that does not exist in this dropdown's option list\n * (see [[PDFDropdown.getOptions]]) will enable editing on this dropdown\n * (see [[PDFDropdown.enableEditing]]).\n *\n * > **NOTE:** PDF readers only display one selected option when rendering\n * > dropdowns. However, the PDF specification does allow for multiple values\n * > to be selected in a dropdown. As such, the `pdf-lib` API supports this.\n * > However, it is not recommended to select more than one value with this\n * > method, as only one will be visible. [[PDFOptionList]] fields are better\n * > suited for displaying multiple selected values.\n *\n * @param options The options to be selected.\n * @param merge Whether or not existing selections should be preserved.\n */\n PDFDropdown.prototype.select = function (options, merge) {\n if (merge === void 0) { merge = false; }\n assertIs(options, 'options', ['string', Array]);\n assertIs(merge, 'merge', ['boolean']);\n var optionsArr = Array.isArray(options) ? options : [options];\n var validOptions = this.getOptions();\n var hasCustomOption = optionsArr.find(function (option) { return !validOptions.includes(option); });\n if (hasCustomOption)\n this.enableEditing();\n this.markAsDirty();\n if (optionsArr.length > 1 || (optionsArr.length === 1 && merge)) {\n this.enableMultiselect();\n }\n var values = new Array(optionsArr.length);\n for (var idx = 0, len = optionsArr.length; idx < len; idx++) {\n values[idx] = PDFHexString.fromText(optionsArr[idx]);\n }\n if (merge) {\n var existingValues = this.acroField.getValues();\n this.acroField.setValues(existingValues.concat(values));\n }\n else {\n this.acroField.setValues(values);\n }\n };\n /**\n * Clear all selected values for this dropdown. This operation is equivalent\n * to selecting an empty list. This method will update the underlying state\n * of the dropdown to indicate that no values have been selected.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.clear()\n * ```\n * This method will mark this text field as dirty. See [[PDFDropdown.select]]\n * for more details about what this means.\n */\n PDFDropdown.prototype.clear = function () {\n this.markAsDirty();\n this.acroField.setValues([]);\n };\n /**\n * Returns `true` if users are allowed to edit the selected value of this\n * dropdown directly and are not constrained by the list of available\n * options. See [[PDFDropdown.enableEditing]] and\n * [[PDFDropdown.disableEditing]]. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.isEditable()) console.log('Editing is enabled')\n * ```\n * @returns Whether or not this dropdown is editable.\n */\n PDFDropdown.prototype.isEditable = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.Edit);\n };\n /**\n * Allow users to edit the selected value of this dropdown in PDF readers\n * with their keyboard. This means that the selected value of this dropdown\n * will not be constrained by the list of available options. However, if this\n * dropdown has any available options, users will still be allowed to select\n * from that list.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.enableEditing()\n * ```\n */\n PDFDropdown.prototype.enableEditing = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Edit, true);\n };\n /**\n * Do not allow users to edit the selected value of this dropdown in PDF\n * readers with their keyboard. This will constrain the selected value of\n * this dropdown to the list of available options. Users will only be able\n * to select an option from that list.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.disableEditing()\n * ```\n */\n PDFDropdown.prototype.disableEditing = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Edit, false);\n };\n /**\n * Returns `true` if the option list of this dropdown is always displayed\n * in alphabetical order, irrespective of the order in which the options\n * were added to the dropdown. See [[PDFDropdown.enableSorting]] and\n * [[PDFDropdown.disableSorting]]. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.isSorted()) console.log('Sorting is enabled')\n * ```\n * @returns Whether or not this dropdown's options are sorted.\n */\n PDFDropdown.prototype.isSorted = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.Sort);\n };\n /**\n * Always display the option list of this dropdown in alphabetical order,\n * irrespective of the order in which the options were added to this dropdown.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.enableSorting()\n * ```\n */\n PDFDropdown.prototype.enableSorting = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Sort, true);\n };\n /**\n * Do not always display the option list of this dropdown in alphabetical\n * order. Instead, display the options in whichever order they were added\n * to the list. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.disableSorting()\n * ```\n */\n PDFDropdown.prototype.disableSorting = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Sort, false);\n };\n /**\n * Returns `true` if multiple options can be selected from this dropdown's\n * option list. See [[PDFDropdown.enableMultiselect]] and\n * [[PDFDropdown.disableMultiselect]]. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.isMultiselect()) console.log('Multiselect is enabled')\n * ```\n * @returns Whether or not multiple options can be selected.\n */\n PDFDropdown.prototype.isMultiselect = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.MultiSelect);\n };\n /**\n * Allow users to select more than one option from this dropdown's option\n * list. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.enableMultiselect()\n * ```\n */\n PDFDropdown.prototype.enableMultiselect = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, true);\n };\n /**\n * Do not allow users to select more than one option from this dropdown's\n * option list. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.disableMultiselect()\n * ```\n */\n PDFDropdown.prototype.disableMultiselect = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, false);\n };\n /**\n * Returns `true` if the selected option should be spell checked by PDF\n * readers. Spell checking will only be performed if this dropdown allows\n * editing (see [[PDFDropdown.isEditable]]). See\n * [[PDFDropdown.enableSpellChecking]] and\n * [[PDFDropdown.disableSpellChecking]]. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.isSpellChecked()) console.log('Spell checking is enabled')\n * ```\n * @returns Whether or not this dropdown can be spell checked.\n */\n PDFDropdown.prototype.isSpellChecked = function () {\n return !this.acroField.hasFlag(AcroChoiceFlags.DoNotSpellCheck);\n };\n /**\n * Allow PDF readers to spell check the selected option of this dropdown.\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.enableSpellChecking()\n * ```\n */\n PDFDropdown.prototype.enableSpellChecking = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.DoNotSpellCheck, false);\n };\n /**\n * Do not allow PDF readers to spell check the selected option of this\n * dropdown. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.disableSpellChecking()\n * ```\n */\n PDFDropdown.prototype.disableSpellChecking = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.DoNotSpellCheck, true);\n };\n /**\n * Returns `true` if the option selected by a user is stored, or \"committed\",\n * when the user clicks the option. The alternative is that the user's\n * selection is stored when the user leaves this dropdown field (by clicking\n * outside of it - on another field, for example). See\n * [[PDFDropdown.enableSelectOnClick]] and\n * [[PDFDropdown.disableSelectOnClick]]. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.isSelectOnClick()) console.log('Select on click is enabled')\n * ```\n * @returns Whether or not options are selected immediately after they are\n * clicked.\n */\n PDFDropdown.prototype.isSelectOnClick = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.CommitOnSelChange);\n };\n /**\n * Store the option selected by a user immediately after the user clicks the\n * option. Do not wait for the user to leave this dropdown field (by clicking\n * outside of it - on another field, for example). For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.enableSelectOnClick()\n * ```\n */\n PDFDropdown.prototype.enableSelectOnClick = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, true);\n };\n /**\n * Wait to store the option selected by a user until they leave this dropdown\n * field (by clicking outside of it - on another field, for example).\n * For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.disableSelectOnClick()\n * ```\n */\n PDFDropdown.prototype.disableSelectOnClick = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, false);\n };\n /**\n * Show this dropdown on the specified page. For example:\n * ```js\n * const ubuntuFont = await pdfDoc.embedFont(ubuntuFontBytes)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const dropdown = form.createDropdown('best.gundam')\n * dropdown.setOptions(['Exia', 'Dynames'])\n * dropdown.select('Exia')\n *\n * dropdown.addToPage(page, {\n * x: 50,\n * y: 75,\n * width: 200,\n * height: 100,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * font: ubuntuFont,\n * })\n * ```\n * This will create a new widget for this dropdown field.\n * @param page The page to which this dropdown widget should be added.\n * @param options The options to be used when adding this dropdown widget.\n */\n PDFDropdown.prototype.addToPage = function (page, options) {\n var _a, _b, _c, _d, _e, _f, _g;\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n if (!options)\n options = {};\n if (!('textColor' in options))\n options.textColor = rgb(0, 0, 0);\n if (!('backgroundColor' in options))\n options.backgroundColor = rgb(1, 1, 1);\n if (!('borderColor' in options))\n options.borderColor = rgb(0, 0, 0);\n if (!('borderWidth' in options))\n options.borderWidth = 1;\n // Create a widget for this dropdown\n var widget = this.createWidget({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : 200,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : 50,\n textColor: options.textColor,\n backgroundColor: options.backgroundColor,\n borderColor: options.borderColor,\n borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,\n rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n this.acroField.addWidget(widgetRef);\n // Set appearance streams for widget\n var font = (_g = options.font) !== null && _g !== void 0 ? _g : this.doc.getForm().getDefaultFont();\n this.updateWidgetAppearance(widget, font);\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if this dropdown has been marked as dirty, or if any of\n * this dropdown's widgets do not have an appearance stream. For example:\n * ```js\n * const dropdown = form.getDropdown('some.dropdown.field')\n * if (dropdown.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this dropdown needs an appearance update.\n */\n PDFDropdown.prototype.needsAppearancesUpdate = function () {\n var _a;\n if (this.isDirty())\n return true;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream;\n if (!hasAppearances)\n return true;\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this dropdown's widgets using\n * the default appearance provider for dropdowns. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.defaultUpdateAppearances(helvetica)\n * ```\n * @param font The font to be used for creating the appearance streams.\n */\n PDFDropdown.prototype.defaultUpdateAppearances = function (font) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n this.updateAppearances(font);\n };\n /**\n * Update the appearance streams for each of this dropdown's widgets using\n * the given appearance provider. If no `provider` is passed, the default\n * appearance provider for dropdowns will be used. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const dropdown = form.getDropdown('some.dropdown.field')\n * dropdown.updateAppearances(helvetica, (field, widget, font) => {\n * ...\n * return drawTextField(...)\n * })\n * ```\n * @param font The font to be used for creating the appearance streams.\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFDropdown.prototype.updateAppearances = function (font, provider) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n this.updateWidgetAppearance(widget, font, provider);\n }\n this.markAsClean();\n };\n // getOption(index: number): string {}\n // getSelectedIndices(): number[] {}\n // removeOptions(option: string | string[]) {}\n // removeIndices(option: number[]) {}\n // deselect(options: string | string[]) {}\n // deselectIndices(optionIndices: number[]) {}\n PDFDropdown.prototype.updateWidgetAppearance = function (widget, font, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultDropdownAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget, font));\n this.updateWidgetAppearanceWithFont(widget, font, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getDropdown]] method, which will create an\n * > instance of [[PDFDropdown]] for you.\n *\n * Create an instance of [[PDFDropdown]] from an existing acroComboBox and ref\n *\n * @param acroComboBox The underlying `PDFAcroComboBox` for this dropdown.\n * @param ref The unique reference for this dropdown.\n * @param doc The document to which this dropdown will belong.\n */\n PDFDropdown.of = function (acroComboBox, ref, doc) {\n return new PDFDropdown(acroComboBox, ref, doc);\n };\n return PDFDropdown;\n}(PDFField));\nexport default PDFDropdown;\n//# sourceMappingURL=PDFDropdown.js.map","import { __extends } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport PDFFont from \"../PDFFont\";\nimport PDFField, { assertFieldAppearanceOptions, } from \"./PDFField\";\nimport { normalizeAppearance, defaultOptionListAppearanceProvider, } from \"./appearances\";\nimport { rgb } from \"../colors\";\nimport { degrees } from \"../rotations\";\nimport { PDFHexString, PDFStream, PDFAcroListBox, AcroChoiceFlags, } from \"../../core\";\nimport { assertIs, assertOrUndefined, assertIsSubset } from \"../../utils\";\n/**\n * Represents an option list field of a [[PDFForm]].\n *\n * [[PDFOptionList]] fields are interactive lists of options. The purpose of an\n * option list is to enable users to select one or more options from a set of\n * possible options. Users are able to see the full set of options without\n * first having to click on the field (though scrolling may be necessary).\n * Clicking an option in the list will cause it to be selected and displayed\n * with a highlighted background. Some option lists allow users to select\n * more than one option (see [[PDFOptionList.isMultiselect]]).\n */\nvar PDFOptionList = /** @class */ (function (_super) {\n __extends(PDFOptionList, _super);\n function PDFOptionList(acroListBox, ref, doc) {\n var _this = _super.call(this, acroListBox, ref, doc) || this;\n assertIs(acroListBox, 'acroListBox', [[PDFAcroListBox, 'PDFAcroListBox']]);\n _this.acroField = acroListBox;\n return _this;\n }\n /**\n * Get the list of available options for this option list. These options will\n * be displayed to users who view this option list in a PDF reader.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * const options = optionList.getOptions()\n * console.log('Option List options:', options)\n * ```\n * @returns The options for this option list.\n */\n PDFOptionList.prototype.getOptions = function () {\n var rawOptions = this.acroField.getOptions();\n var options = new Array(rawOptions.length);\n for (var idx = 0, len = options.length; idx < len; idx++) {\n var _a = rawOptions[idx], display = _a.display, value = _a.value;\n options[idx] = (display !== null && display !== void 0 ? display : value).decodeText();\n }\n return options;\n };\n /**\n * Get the selected options for this option list. These are the values that\n * were selected by a human user via a PDF reader, or programatically via\n * software.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * const selections = optionList.getSelected()\n * console.log('Option List selections:', selections)\n * ```\n * @returns The selected options for this option list.\n */\n PDFOptionList.prototype.getSelected = function () {\n var values = this.acroField.getValues();\n var selected = new Array(values.length);\n for (var idx = 0, len = values.length; idx < len; idx++) {\n selected[idx] = values[idx].decodeText();\n }\n return selected;\n };\n /**\n * Set the list of options that are available for this option list. These are\n * the values that will be available for users to select when they view this\n * option list in a PDF reader. Note that preexisting options for this\n * option list will be removed. Only the values passed as `options` will be\n * available to select.\n *\n * For example:\n * ```js\n * const optionList = form.getOptionList('planets.optionList')\n * optionList.setOptions(['Earth', 'Mars', 'Pluto', 'Venus'])\n * ```\n *\n * This method will mark this option list as dirty, causing its appearance\n * streams to be updated when either [[PDFDocument.save]] or\n * [[PDFForm.updateFieldAppearances]] is called. The updated streams will\n * display the options this field contains inside the widgets of this text\n * field (with selected options highlighted).\n *\n * **IMPORTANT:** The default font used to update appearance streams is\n * [[StandardFonts.Helvetica]]. Note that this is a WinAnsi font. This means\n * that encoding errors will be thrown if this field contains any options\n * with characters outside the WinAnsi character set (the latin alphabet).\n *\n * Embedding a custom font and passing it to\n * [[PDFForm.updateFieldAppearances]] or [[PDFOptionList.updateAppearances]]\n * allows you to generate appearance streams with characters outside the\n * latin alphabet (assuming the custom font supports them).\n *\n * @param options The options that should be available in this option list.\n */\n PDFOptionList.prototype.setOptions = function (options) {\n assertIs(options, 'options', [Array]);\n this.markAsDirty();\n var optionObjects = new Array(options.length);\n for (var idx = 0, len = options.length; idx < len; idx++) {\n optionObjects[idx] = { value: PDFHexString.fromText(options[idx]) };\n }\n this.acroField.setOptions(optionObjects);\n };\n /**\n * Add to the list of options that are available for this option list. Users\n * will be able to select these values in a PDF reader. In addition to the\n * values passed as `options`, any preexisting options for this option list\n * will still be available for users to select.\n * For example:\n * ```js\n * const optionList = form.getOptionList('rockets.optionList')\n * optionList.addOptions(['Saturn IV', 'Falcon Heavy'])\n * ```\n * This method will mark this option list as dirty. See\n * [[PDFOptionList.setOptions]] for more details about what this means.\n * @param options New options that should be available in this option list.\n */\n PDFOptionList.prototype.addOptions = function (options) {\n assertIs(options, 'options', ['string', Array]);\n this.markAsDirty();\n var optionsArr = Array.isArray(options) ? options : [options];\n var existingOptions = this.acroField.getOptions();\n var newOptions = new Array(optionsArr.length);\n for (var idx = 0, len = optionsArr.length; idx < len; idx++) {\n newOptions[idx] = { value: PDFHexString.fromText(optionsArr[idx]) };\n }\n this.acroField.setOptions(existingOptions.concat(newOptions));\n };\n /**\n * Select one or more values for this option list. This operation is analogous\n * to a human user opening the option list in a PDF reader and clicking on one\n * or more values to select them. This method will update the underlying state\n * of the option list to indicate which values have been selected. PDF\n * libraries and readers will be able to extract these values from the saved\n * document and determine which values were selected.\n * For example:\n * ```js\n * const optionList = form.getOptionList('best.superheroes.optionList')\n * optionList.select(['One Punch Man', 'Iron Man'])\n * ```\n * This method will mark this option list as dirty. See\n * [[PDFOptionList.setOptions]] for more details about what this means.\n * @param options The options to be selected.\n * @param merge Whether or not existing selections should be preserved.\n */\n PDFOptionList.prototype.select = function (options, merge) {\n if (merge === void 0) { merge = false; }\n assertIs(options, 'options', ['string', Array]);\n assertIs(merge, 'merge', ['boolean']);\n var optionsArr = Array.isArray(options) ? options : [options];\n var validOptions = this.getOptions();\n assertIsSubset(optionsArr, 'option', validOptions);\n this.markAsDirty();\n if (optionsArr.length > 1 || (optionsArr.length === 1 && merge)) {\n this.enableMultiselect();\n }\n var values = new Array(optionsArr.length);\n for (var idx = 0, len = optionsArr.length; idx < len; idx++) {\n values[idx] = PDFHexString.fromText(optionsArr[idx]);\n }\n if (merge) {\n var existingValues = this.acroField.getValues();\n this.acroField.setValues(existingValues.concat(values));\n }\n else {\n this.acroField.setValues(values);\n }\n };\n /**\n * Clear all selected values for this option list. This operation is\n * equivalent to selecting an empty list. This method will update the\n * underlying state of the option list to indicate that no values have been\n * selected.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.clear()\n * ```\n * This method will mark this option list as dirty. See\n * [[PDFOptionList.setOptions]] for more details about what this means.\n */\n PDFOptionList.prototype.clear = function () {\n this.markAsDirty();\n this.acroField.setValues([]);\n };\n /**\n * Returns `true` if the options of this option list are always displayed\n * in alphabetical order, irrespective of the order in which the options\n * were added to the option list. See [[PDFOptionList.enableSorting]] and\n * [[PDFOptionList.disableSorting]]. For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * if (optionList.isSorted()) console.log('Sorting is enabled')\n * ```\n * @returns Whether or not this option list is sorted.\n */\n PDFOptionList.prototype.isSorted = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.Sort);\n };\n /**\n * Always display the options of this option list in alphabetical order,\n * irrespective of the order in which the options were added to this option\n * list.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.enableSorting()\n * ```\n */\n PDFOptionList.prototype.enableSorting = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Sort, true);\n };\n /**\n * Do not always display the options of this option list in alphabetical\n * order. Instead, display the options in whichever order they were added\n * to this option list. For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.disableSorting()\n * ```\n */\n PDFOptionList.prototype.disableSorting = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.Sort, false);\n };\n /**\n * Returns `true` if multiple options can be selected from this option list.\n * See [[PDFOptionList.enableMultiselect]] and\n * [[PDFOptionList.disableMultiselect]]. For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * if (optionList.isMultiselect()) console.log('Multiselect is enabled')\n * ```\n * @returns Whether or not multiple options can be selected.\n */\n PDFOptionList.prototype.isMultiselect = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.MultiSelect);\n };\n /**\n * Allow users to select more than one option from this option list.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.enableMultiselect()\n * ```\n */\n PDFOptionList.prototype.enableMultiselect = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, true);\n };\n /**\n * Do not allow users to select more than one option from this option list.\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.disableMultiselect()\n * ```\n */\n PDFOptionList.prototype.disableMultiselect = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, false);\n };\n /**\n * Returns `true` if the option selected by a user is stored, or \"committed\",\n * when the user clicks the option. The alternative is that the user's\n * selection is stored when the user leaves this option list field (by\n * clicking outside of it - on another field, for example). See\n * [[PDFOptionList.enableSelectOnClick]] and\n * [[PDFOptionList.disableSelectOnClick]]. For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * if (optionList.isSelectOnClick()) console.log('Select on click is enabled')\n * ```\n * @returns Whether or not options are selected immediately after they are\n * clicked.\n */\n PDFOptionList.prototype.isSelectOnClick = function () {\n return this.acroField.hasFlag(AcroChoiceFlags.CommitOnSelChange);\n };\n /**\n * Store the option selected by a user immediately after the user clicks the\n * option. Do not wait for the user to leave this option list field (by\n * clicking outside of it - on another field, for example). For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.enableSelectOnClick()\n * ```\n */\n PDFOptionList.prototype.enableSelectOnClick = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, true);\n };\n /**\n * Wait to store the option selected by a user until they leave this option\n * list field (by clicking outside of it - on another field, for example).\n * For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.disableSelectOnClick()\n * ```\n */\n PDFOptionList.prototype.disableSelectOnClick = function () {\n this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, false);\n };\n /**\n * Show this option list on the specified page. For example:\n * ```js\n * const ubuntuFont = await pdfDoc.embedFont(ubuntuFontBytes)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const optionList = form.createOptionList('best.gundams')\n * optionList.setOptions(['Exia', 'Dynames', 'Kyrios', 'Virtue'])\n * optionList.select(['Exia', 'Virtue'])\n *\n * optionList.addToPage(page, {\n * x: 50,\n * y: 75,\n * width: 200,\n * height: 100,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * font: ubuntuFont,\n * })\n * ```\n * This will create a new widget for this option list field.\n * @param page The page to which this option list widget should be added.\n * @param options The options to be used when adding this option list widget.\n */\n PDFOptionList.prototype.addToPage = function (page, options) {\n var _a, _b, _c, _d, _e, _f, _g;\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n if (!options)\n options = {};\n if (!('textColor' in options))\n options.textColor = rgb(0, 0, 0);\n if (!('backgroundColor' in options))\n options.backgroundColor = rgb(1, 1, 1);\n if (!('borderColor' in options))\n options.borderColor = rgb(0, 0, 0);\n if (!('borderWidth' in options))\n options.borderWidth = 1;\n // Create a widget for this option list\n var widget = this.createWidget({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : 200,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : 100,\n textColor: options.textColor,\n backgroundColor: options.backgroundColor,\n borderColor: options.borderColor,\n borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,\n rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n this.acroField.addWidget(widgetRef);\n // Set appearance streams for widget\n var font = (_g = options.font) !== null && _g !== void 0 ? _g : this.doc.getForm().getDefaultFont();\n this.updateWidgetAppearance(widget, font);\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if this option list has been marked as dirty, or if any of\n * this option list's widgets do not have an appearance stream. For example:\n * ```js\n * const optionList = form.getOptionList('some.optionList.field')\n * if (optionList.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this option list needs an appearance update.\n */\n PDFOptionList.prototype.needsAppearancesUpdate = function () {\n var _a;\n if (this.isDirty())\n return true;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream;\n if (!hasAppearances)\n return true;\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this option list's widgets using\n * the default appearance provider for option lists. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.defaultUpdateAppearances(helvetica)\n * ```\n * @param font The font to be used for creating the appearance streams.\n */\n PDFOptionList.prototype.defaultUpdateAppearances = function (font) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n this.updateAppearances(font);\n };\n /**\n * Update the appearance streams for each of this option list's widgets using\n * the given appearance provider. If no `provider` is passed, the default\n * appearance provider for option lists will be used. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const optionList = form.getOptionList('some.optionList.field')\n * optionList.updateAppearances(helvetica, (field, widget, font) => {\n * ...\n * return drawOptionList(...)\n * })\n * ```\n * @param font The font to be used for creating the appearance streams.\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFOptionList.prototype.updateAppearances = function (font, provider) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n this.updateWidgetAppearance(widget, font, provider);\n }\n this.markAsClean();\n };\n // getOption(index: number): string {}\n // getSelectedIndices(): number[] {}\n // removeOptions(option: string | string[]) {}\n // removeIndices(option: number[]) {}\n // deselect(options: string | string[]) {}\n // deselectIndices(optionIndices: number[]) {}\n PDFOptionList.prototype.updateWidgetAppearance = function (widget, font, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultOptionListAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget, font));\n this.updateWidgetAppearanceWithFont(widget, font, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getOptionList]] method, which will create\n * > an instance of [[PDFOptionList]] for you.\n *\n * Create an instance of [[PDFOptionList]] from an existing acroListBox and\n * ref\n *\n * @param acroComboBox The underlying `PDFAcroListBox` for this option list.\n * @param ref The unique reference for this option list.\n * @param doc The document to which this option list will belong.\n */\n PDFOptionList.of = function (acroListBox, ref, doc) {\n return new PDFOptionList(acroListBox, ref, doc);\n };\n return PDFOptionList;\n}(PDFField));\nexport default PDFOptionList;\n//# sourceMappingURL=PDFOptionList.js.map","import { __extends } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport PDFField, { assertFieldAppearanceOptions, } from \"./PDFField\";\nimport { normalizeAppearance, defaultRadioGroupAppearanceProvider, } from \"./appearances\";\nimport { rgb } from \"../colors\";\nimport { degrees } from \"../rotations\";\nimport { PDFName, PDFHexString, PDFDict, PDFAcroRadioButton, AcroButtonFlags, } from \"../../core\";\nimport { assertIs, assertOrUndefined, assertIsOneOf } from \"../../utils\";\n/**\n * Represents a radio group field of a [[PDFForm]].\n *\n * [[PDFRadioGroup]] fields are collections of radio buttons. The purpose of a\n * radio group is to enable users to select one option from a set of mutually\n * exclusive choices. Each choice in a radio group is represented by a radio\n * button. Radio buttons each have two states: `on` and `off`. At most one\n * radio button in a group may be in the `on` state at any time. Users can\n * click on a radio button to select it (and thereby automatically deselect any\n * other radio button that might have already been selected). Some radio\n * groups allow users to toggle a selected radio button `off` by clicking on\n * it (see [[PDFRadioGroup.isOffToggleable]]).\n *\n * Note that some radio groups allow multiple radio buttons to be in the `on`\n * state at the same type **if** they represent the same underlying value (see\n * [[PDFRadioGroup.isMutuallyExclusive]]).\n */\nvar PDFRadioGroup = /** @class */ (function (_super) {\n __extends(PDFRadioGroup, _super);\n function PDFRadioGroup(acroRadioButton, ref, doc) {\n var _this = _super.call(this, acroRadioButton, ref, doc) || this;\n assertIs(acroRadioButton, 'acroRadioButton', [\n [PDFAcroRadioButton, 'PDFAcroRadioButton'],\n ]);\n _this.acroField = acroRadioButton;\n return _this;\n }\n /**\n * Get the list of available options for this radio group. Each option is\n * represented by a radio button. These radio buttons are displayed at\n * various locations in the document, potentially on different pages (though\n * typically they are stacked horizontally or vertically on the same page).\n * For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * const options = radioGroup.getOptions()\n * console.log('Radio Group options:', options)\n * ```\n * @returns The options for this radio group.\n */\n PDFRadioGroup.prototype.getOptions = function () {\n var exportValues = this.acroField.getExportValues();\n if (exportValues) {\n var exportOptions = new Array(exportValues.length);\n for (var idx = 0, len = exportValues.length; idx < len; idx++) {\n exportOptions[idx] = exportValues[idx].decodeText();\n }\n return exportOptions;\n }\n var onValues = this.acroField.getOnValues();\n var onOptions = new Array(onValues.length);\n for (var idx = 0, len = onOptions.length; idx < len; idx++) {\n onOptions[idx] = onValues[idx].decodeText();\n }\n return onOptions;\n };\n /**\n * Get the selected option for this radio group. The selected option is\n * represented by the radio button in this group that is turned on. At most\n * one radio button in a group can be selected. If no buttons in this group\n * are selected, `undefined` is returned.\n * For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * const selected = radioGroup.getSelected()\n * console.log('Selected radio button:', selected)\n * ```\n * @returns The selected option for this radio group.\n */\n PDFRadioGroup.prototype.getSelected = function () {\n var value = this.acroField.getValue();\n if (value === PDFName.of('Off'))\n return undefined;\n var exportValues = this.acroField.getExportValues();\n if (exportValues) {\n var onValues = this.acroField.getOnValues();\n for (var idx = 0, len = onValues.length; idx < len; idx++) {\n if (onValues[idx] === value)\n return exportValues[idx].decodeText();\n }\n }\n return value.decodeText();\n };\n // // TODO: Figure out why this seems to crash Acrobat. Maybe it's because we\n // // aren't removing the widget reference from the page's Annots?\n // removeOption(option: string) {\n // assertIs(option, 'option', ['string']);\n // // TODO: Assert is valid `option`!\n // const onValues = this.acroField.getOnValues();\n // const exportValues = this.acroField.getExportValues();\n // if (exportValues) {\n // for (let idx = 0, len = exportValues.length; idx < len; idx++) {\n // if (exportValues[idx].decodeText() === option) {\n // this.acroField.removeWidget(idx);\n // this.acroField.removeExportValue(idx);\n // }\n // }\n // } else {\n // for (let idx = 0, len = onValues.length; idx < len; idx++) {\n // const value = onValues[idx];\n // if (value.decodeText() === option) {\n // this.acroField.removeWidget(idx);\n // this.acroField.removeExportValue(idx);\n // }\n // }\n // }\n // }\n /**\n * Select an option for this radio group. This operation is analogous to a\n * human user clicking one of the radio buttons in this group via a PDF\n * reader to toggle it on. This method will update the underlying state of\n * the radio group to indicate which option has been selected. PDF libraries\n * and readers will be able to extract this value from the saved document and\n * determine which option was selected.\n *\n * For example:\n * ```js\n * const radioGroup = form.getRadioGroup('best.superhero.radioGroup')\n * radioGroup.select('One Punch Man')\n * ```\n *\n * This method will mark this radio group as dirty, causing its appearance\n * streams to be updated when either [[PDFDocument.save]] or\n * [[PDFForm.updateFieldAppearances]] is called. The updated appearance\n * streams will display a dot inside the widget of this check box field\n * that represents the selected option.\n *\n * @param option The option to be selected.\n */\n PDFRadioGroup.prototype.select = function (option) {\n assertIs(option, 'option', ['string']);\n var validOptions = this.getOptions();\n assertIsOneOf(option, 'option', validOptions);\n this.markAsDirty();\n var onValues = this.acroField.getOnValues();\n var exportValues = this.acroField.getExportValues();\n if (exportValues) {\n for (var idx = 0, len = exportValues.length; idx < len; idx++) {\n if (exportValues[idx].decodeText() === option) {\n this.acroField.setValue(onValues[idx]);\n }\n }\n }\n else {\n for (var idx = 0, len = onValues.length; idx < len; idx++) {\n var value = onValues[idx];\n if (value.decodeText() === option)\n this.acroField.setValue(value);\n }\n }\n };\n /**\n * Clear any selected option for this dropdown. This will result in all\n * radio buttons in this group being toggled off. This method will update\n * the underlying state of the dropdown to indicate that no radio buttons\n * have been selected.\n * For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.clear()\n * ```\n * This method will mark this radio group as dirty. See\n * [[PDFRadioGroup.select]] for more details about what this means.\n */\n PDFRadioGroup.prototype.clear = function () {\n this.markAsDirty();\n this.acroField.setValue(PDFName.of('Off'));\n };\n /**\n * Returns `true` if users can click on radio buttons in this group to toggle\n * them off. The alternative is that once a user clicks on a radio button\n * to select it, the only way to deselect it is by selecting on another radio\n * button in the group. See [[PDFRadioGroup.enableOffToggling]] and\n * [[PDFRadioGroup.disableOffToggling]]. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * if (radioGroup.isOffToggleable()) console.log('Off toggling is enabled')\n * ```\n */\n PDFRadioGroup.prototype.isOffToggleable = function () {\n return !this.acroField.hasFlag(AcroButtonFlags.NoToggleToOff);\n };\n /**\n * Allow users to click on selected radio buttons in this group to toggle\n * them off. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.enableOffToggling()\n * ```\n * > **NOTE:** This feature is documented in the PDF specification\n * > (Table 226). However, most PDF readers do not respect this option and\n * > prevent users from toggling radio buttons off even when it is enabled.\n * > At the time of this writing (9/6/2020) Mac's Preview software did\n * > respect the option. Adobe Acrobat, Foxit Reader, and Google Chrome did\n * > not.\n */\n PDFRadioGroup.prototype.enableOffToggling = function () {\n this.acroField.setFlagTo(AcroButtonFlags.NoToggleToOff, false);\n };\n /**\n * Prevent users from clicking on selected radio buttons in this group to\n * toggle them off. Clicking on a selected radio button will have no effect.\n * The only way to deselect a selected radio button is to click on a\n * different radio button in the group. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.disableOffToggling()\n * ```\n */\n PDFRadioGroup.prototype.disableOffToggling = function () {\n this.acroField.setFlagTo(AcroButtonFlags.NoToggleToOff, true);\n };\n /**\n * Returns `true` if the radio buttons in this group are mutually exclusive.\n * This means that when the user selects a radio button, only that specific\n * button will be turned on. Even if other radio buttons in the group\n * represent the same value, they will not be enabled. The alternative to\n * this is that clicking a radio button will select that button along with\n * any other radio buttons in the group that share the same value. See\n * [[PDFRadioGroup.enableMutualExclusion]] and\n * [[PDFRadioGroup.disableMutualExclusion]].\n * For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * if (radioGroup.isMutuallyExclusive()) console.log('Mutual exclusion is enabled')\n * ```\n */\n PDFRadioGroup.prototype.isMutuallyExclusive = function () {\n return !this.acroField.hasFlag(AcroButtonFlags.RadiosInUnison);\n };\n /**\n * When the user clicks a radio button in this group it will be selected. In\n * addition, any other radio buttons in this group that share the same\n * underlying value will also be selected. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.enableMutualExclusion()\n * ```\n * Note that this option must be enabled prior to adding options to the\n * radio group. It does not currently apply retroactively to existing\n * radio buttons in the group.\n */\n PDFRadioGroup.prototype.enableMutualExclusion = function () {\n this.acroField.setFlagTo(AcroButtonFlags.RadiosInUnison, false);\n };\n /**\n * When the user clicks a radio button in this group only it will be selected.\n * No other radio buttons in the group will be selected, even if they share\n * the same underlying value. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.disableMutualExclusion()\n * ```\n * Note that this option must be disabled prior to adding options to the\n * radio group. It does not currently apply retroactively to existing\n * radio buttons in the group.\n */\n PDFRadioGroup.prototype.disableMutualExclusion = function () {\n this.acroField.setFlagTo(AcroButtonFlags.RadiosInUnison, true);\n };\n /**\n * Add a new radio button to this group on the specified page. For example:\n * ```js\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const radioGroup = form.createRadioGroup('best.gundam')\n *\n * const options = {\n * x: 50,\n * width: 25,\n * height: 25,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * }\n *\n * radioGroup.addOptionToPage('Exia', page, { ...options, y: 50 })\n * radioGroup.addOptionToPage('Dynames', page, { ...options, y: 110 })\n * ```\n * This will create a new radio button widget for this radio group field.\n * @param option The option that the radio button widget represents.\n * @param page The page to which the radio button widget should be added.\n * @param options The options to be used when adding the radio button widget.\n */\n PDFRadioGroup.prototype.addOptionToPage = function (option, page, options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n assertIs(option, 'option', ['string']);\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n // Create a widget for this radio button\n var widget = this.createWidget({\n x: (_a = options === null || options === void 0 ? void 0 : options.x) !== null && _a !== void 0 ? _a : 0,\n y: (_b = options === null || options === void 0 ? void 0 : options.y) !== null && _b !== void 0 ? _b : 0,\n width: (_c = options === null || options === void 0 ? void 0 : options.width) !== null && _c !== void 0 ? _c : 50,\n height: (_d = options === null || options === void 0 ? void 0 : options.height) !== null && _d !== void 0 ? _d : 50,\n textColor: (_e = options === null || options === void 0 ? void 0 : options.textColor) !== null && _e !== void 0 ? _e : rgb(0, 0, 0),\n backgroundColor: (_f = options === null || options === void 0 ? void 0 : options.backgroundColor) !== null && _f !== void 0 ? _f : rgb(1, 1, 1),\n borderColor: (_g = options === null || options === void 0 ? void 0 : options.borderColor) !== null && _g !== void 0 ? _g : rgb(0, 0, 0),\n borderWidth: (_h = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _h !== void 0 ? _h : 1,\n rotate: (_j = options === null || options === void 0 ? void 0 : options.rotate) !== null && _j !== void 0 ? _j : degrees(0),\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n var apStateValue = this.acroField.addWidgetWithOpt(widgetRef, PDFHexString.fromText(option), !this.isMutuallyExclusive());\n // Set appearance streams for widget\n widget.setAppearanceState(PDFName.of('Off'));\n this.updateWidgetAppearance(widget, apStateValue);\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if any of this group's radio button widgets do not have an\n * appearance stream for their current state. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * if (radioGroup.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this radio group needs an appearance update.\n */\n PDFRadioGroup.prototype.needsAppearancesUpdate = function () {\n var _a;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var value = this.acroField.getValue();\n var normal = (_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal;\n return !(normal instanceof PDFDict && normal.has(value));\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this group's radio button widgets\n * using the default appearance provider for radio groups. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.defaultUpdateAppearances()\n * ```\n */\n PDFRadioGroup.prototype.defaultUpdateAppearances = function () {\n this.updateAppearances();\n };\n // rg.updateAppearances((field: any, widget: any) => {\n // assert(field === rg);\n // assert(widget instanceof PDFWidgetAnnotation);\n // return { on: [...rectangle, ...circle], off: [...rectangle, ...circle] };\n // });\n /**\n * Update the appearance streams for each of this group's radio button widgets\n * using the given appearance provider. If no `provider` is passed, the\n * default appearance provider for radio groups will be used. For example:\n * ```js\n * const radioGroup = form.getRadioGroup('some.radioGroup.field')\n * radioGroup.updateAppearances((field, widget) => {\n * ...\n * return {\n * normal: { on: drawRadioButton(...), off: drawRadioButton(...) },\n * down: { on: drawRadioButton(...), off: drawRadioButton(...) },\n * }\n * })\n * ```\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFRadioGroup.prototype.updateAppearances = function (provider) {\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var onValue = widget.getOnValue();\n if (!onValue)\n continue;\n this.updateWidgetAppearance(widget, onValue, provider);\n }\n };\n PDFRadioGroup.prototype.updateWidgetAppearance = function (widget, onValue, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultRadioGroupAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget));\n this.updateOnOffWidgetAppearance(widget, onValue, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getOptionList]] method, which will create an\n * > instance of [[PDFOptionList]] for you.\n *\n * Create an instance of [[PDFOptionList]] from an existing acroRadioButton\n * and ref\n *\n * @param acroRadioButton The underlying `PDFAcroRadioButton` for this\n * radio group.\n * @param ref The unique reference for this radio group.\n * @param doc The document to which this radio group will belong.\n */\n PDFRadioGroup.of = function (acroRadioButton, ref, doc) { return new PDFRadioGroup(acroRadioButton, ref, doc); };\n return PDFRadioGroup;\n}(PDFField));\nexport default PDFRadioGroup;\n//# sourceMappingURL=PDFRadioGroup.js.map","import { __extends } from \"tslib\";\nimport PDFField from \"./PDFField\";\nimport { PDFAcroSignature } from \"../../core\";\nimport { assertIs } from \"../../utils\";\n/**\n * Represents a signature field of a [[PDFForm]].\n *\n * [[PDFSignature]] fields are digital signatures. `pdf-lib` does not\n * currently provide any specialized APIs for creating digital signatures or\n * reading the contents of existing digital signatures.\n */\nvar PDFSignature = /** @class */ (function (_super) {\n __extends(PDFSignature, _super);\n function PDFSignature(acroSignature, ref, doc) {\n var _this = _super.call(this, acroSignature, ref, doc) || this;\n assertIs(acroSignature, 'acroSignature', [\n [PDFAcroSignature, 'PDFAcroSignature'],\n ]);\n _this.acroField = acroSignature;\n return _this;\n }\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getSignature]] method, which will create an\n * > instance of [[PDFSignature]] for you.\n *\n * Create an instance of [[PDFSignature]] from an existing acroSignature and\n * ref\n *\n * @param acroSignature The underlying `PDFAcroSignature` for this signature.\n * @param ref The unique reference for this signature.\n * @param doc The document to which this signature will belong.\n */\n PDFSignature.of = function (acroSignature, ref, doc) { return new PDFSignature(acroSignature, ref, doc); };\n return PDFSignature;\n}(PDFField));\nexport default PDFSignature;\n//# sourceMappingURL=PDFSignature.js.map","import { __extends } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport PDFFont from \"../PDFFont\";\nimport PDFField, { assertFieldAppearanceOptions, } from \"./PDFField\";\nimport { normalizeAppearance, defaultTextFieldAppearanceProvider, } from \"./appearances\";\nimport { rgb } from \"../colors\";\nimport { degrees } from \"../rotations\";\nimport { RichTextFieldReadError, ExceededMaxLengthError, InvalidMaxLengthError, } from \"../errors\";\nimport { TextAlignment } from \"../text/alignment\";\nimport { PDFHexString, PDFStream, PDFAcroText, AcroTextFlags, } from \"../../core\";\nimport { assertIs, assertIsOneOf, assertOrUndefined, assertRangeOrUndefined, } from \"../../utils\";\n/**\n * Represents a text field of a [[PDFForm]].\n *\n * [[PDFTextField]] fields are boxes that display text entered by the user. The\n * purpose of a text field is to enable users to enter text or view text values\n * in the document prefilled by software. Users can click on a text field and\n * input text via their keyboard. Some text fields allow multiple lines of text\n * to be entered (see [[PDFTextField.isMultiline]]).\n */\nvar PDFTextField = /** @class */ (function (_super) {\n __extends(PDFTextField, _super);\n function PDFTextField(acroText, ref, doc) {\n var _this = _super.call(this, acroText, ref, doc) || this;\n assertIs(acroText, 'acroText', [[PDFAcroText, 'PDFAcroText']]);\n _this.acroField = acroText;\n return _this;\n }\n /**\n * Get the text that this field contains. This text is visible to users who\n * view this field in a PDF reader.\n *\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * const text = textField.getText()\n * console.log('Text field contents:', text)\n * ```\n *\n * Note that if this text field contains no underlying value, `undefined`\n * will be returned. Text fields may also contain an underlying value that\n * is simply an empty string (`''`). This detail is largely irrelevant for\n * most applications. In general, you'll want to treat both cases the same\n * way and simply consider the text field to be empty. In either case, the\n * text field will appear empty to users when viewed in a PDF reader.\n *\n * An error will be thrown if this is a rich text field. `pdf-lib` does not\n * support reading rich text fields. Nor do most PDF readers and writers.\n * Rich text fields are based on XFA (XML Forms Architecture). Relatively few\n * PDFs use rich text fields or XFA. Unlike PDF itself, XFA is not an ISO\n * standard. XFA has been deprecated in PDF 2.0:\n * * https://en.wikipedia.org/wiki/XFA\n * * http://blog.pdfshareforms.com/pdf-2-0-release-bid-farewell-xfa-forms/\n *\n * @returns The text contained in this text field.\n */\n PDFTextField.prototype.getText = function () {\n var value = this.acroField.getValue();\n if (!value && this.isRichFormatted()) {\n throw new RichTextFieldReadError(this.getName());\n }\n return value === null || value === void 0 ? void 0 : value.decodeText();\n };\n /**\n * Set the text for this field. This operation is analogous to a human user\n * clicking on the text field in a PDF reader and typing in text via their\n * keyboard. This method will update the underlying state of the text field\n * to indicate what text has been set. PDF libraries and readers will be able\n * to extract these values from the saved document and determine what text\n * was set.\n *\n * For example:\n * ```js\n * const textField = form.getTextField('best.superhero.text.field')\n * textField.setText('One Punch Man')\n * ```\n *\n * This method will mark this text field as dirty, causing its appearance\n * streams to be updated when either [[PDFDocument.save]] or\n * [[PDFForm.updateFieldAppearances]] is called. The updated streams will\n * display the text this field contains inside the widgets of this text\n * field.\n *\n * **IMPORTANT:** The default font used to update appearance streams is\n * [[StandardFonts.Helvetica]]. Note that this is a WinAnsi font. This means\n * that encoding errors will be thrown if this field contains text outside\n * the WinAnsi character set (the latin alphabet).\n *\n * Embedding a custom font and passing it to\n * [[PDFForm.updateFieldAppearances]] or [[PDFTextField.updateAppearances]]\n * allows you to generate appearance streams with characters outside the\n * latin alphabet (assuming the custom font supports them).\n *\n * If this is a rich text field, it will be converted to a standard text\n * field in order to set the text. `pdf-lib` does not support writing rich\n * text strings. Nor do most PDF readers and writers. See\n * [[PDFTextField.getText]] for more information about rich text fields and\n * their deprecation in PDF 2.0.\n *\n * @param text The text this field should contain.\n */\n PDFTextField.prototype.setText = function (text) {\n assertOrUndefined(text, 'text', ['string']);\n var maxLength = this.getMaxLength();\n if (maxLength !== undefined && text && text.length > maxLength) {\n throw new ExceededMaxLengthError(text.length, maxLength, this.getName());\n }\n this.markAsDirty();\n this.disableRichFormatting();\n if (text) {\n this.acroField.setValue(PDFHexString.fromText(text));\n }\n else {\n this.acroField.removeValue();\n }\n };\n /**\n * Get the alignment for this text field. This value represents the\n * justification of the text when it is displayed to the user in PDF readers.\n * There are three possible alignments: left, center, and right. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * const alignment = textField.getAlignment()\n * if (alignment === TextAlignment.Left) console.log('Text is left justified')\n * if (alignment === TextAlignment.Center) console.log('Text is centered')\n * if (alignment === TextAlignment.Right) console.log('Text is right justified')\n * ```\n * @returns The alignment of this text field.\n */\n PDFTextField.prototype.getAlignment = function () {\n var quadding = this.acroField.getQuadding();\n // prettier-ignore\n return (quadding === 0 ? TextAlignment.Left\n : quadding === 1 ? TextAlignment.Center\n : quadding === 2 ? TextAlignment.Right\n : TextAlignment.Left);\n };\n /**\n * Set the alignment for this text field. This will determine the\n * justification of the text when it is displayed to the user in PDF readers.\n * There are three possible alignments: left, center, and right. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n *\n * // Text will be left justified when displayed\n * textField.setAlignment(TextAlignment.Left)\n *\n * // Text will be centered when displayed\n * textField.setAlignment(TextAlignment.Center)\n *\n * // Text will be right justified when displayed\n * textField.setAlignment(TextAlignment.Right)\n * ```\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n * @param alignment The alignment for this text field.\n */\n PDFTextField.prototype.setAlignment = function (alignment) {\n assertIsOneOf(alignment, 'alignment', TextAlignment);\n this.markAsDirty();\n this.acroField.setQuadding(alignment);\n };\n /**\n * Get the maximum length of this field. This value represents the maximum\n * number of characters that can be typed into this field by the user. If\n * this field does not have a maximum length, `undefined` is returned.\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * const maxLength = textField.getMaxLength()\n * if (maxLength === undefined) console.log('No max length')\n * else console.log(`Max length is ${maxLength}`)\n * ```\n * @returns The maximum number of characters allowed in this field, or\n * `undefined` if no limit exists.\n */\n PDFTextField.prototype.getMaxLength = function () {\n return this.acroField.getMaxLength();\n };\n /**\n * Set the maximum length of this field. This limits the number of characters\n * that can be typed into this field by the user. This also limits the length\n * of the string that can be passed to [[PDFTextField.setText]]. This limit\n * can be removed by passing `undefined` as `maxLength`. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n *\n * // Allow between 0 and 5 characters to be entered\n * textField.setMaxLength(5)\n *\n * // Allow any number of characters to be entered\n * textField.setMaxLength(undefined)\n * ```\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n * @param maxLength The maximum number of characters allowed in this field, or\n * `undefined` to remove the limit.\n */\n PDFTextField.prototype.setMaxLength = function (maxLength) {\n assertRangeOrUndefined(maxLength, 'maxLength', 0, Number.MAX_SAFE_INTEGER);\n this.markAsDirty();\n if (maxLength === undefined) {\n this.acroField.removeMaxLength();\n }\n else {\n var text = this.getText();\n if (text && text.length > maxLength) {\n throw new InvalidMaxLengthError(text.length, maxLength, this.getName());\n }\n this.acroField.setMaxLength(maxLength);\n }\n };\n /**\n * Remove the maximum length for this text field. This allows any number of\n * characters to be typed into this field by the user. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.removeMaxLength()\n * ```\n * Calling this method is equivalent to passing `undefined` to\n * [[PDFTextField.setMaxLength]].\n */\n PDFTextField.prototype.removeMaxLength = function () {\n this.markAsDirty();\n this.acroField.removeMaxLength();\n };\n /**\n * Returns `true` if each line of text is shown on a new line when this\n * field is displayed in a PDF reader. The alternative is that all lines of\n * text are merged onto a single line when displayed. See\n * [[PDFTextField.enableMultiline]] and [[PDFTextField.disableMultiline]].\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isMultiline()) console.log('Multiline is enabled')\n * ```\n * @returns Whether or not this is a multiline text field.\n */\n PDFTextField.prototype.isMultiline = function () {\n return this.acroField.hasFlag(AcroTextFlags.Multiline);\n };\n /**\n * Display each line of text on a new line when this field is displayed in a\n * PDF reader. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableMultiline()\n * ```\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n */\n PDFTextField.prototype.enableMultiline = function () {\n this.markAsDirty();\n this.acroField.setFlagTo(AcroTextFlags.Multiline, true);\n };\n /**\n * Display each line of text on the same line when this field is displayed\n * in a PDF reader. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableMultiline()\n * ```\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n */\n PDFTextField.prototype.disableMultiline = function () {\n this.markAsDirty();\n this.acroField.setFlagTo(AcroTextFlags.Multiline, false);\n };\n /**\n * Returns `true` if this is a password text field. This means that the field\n * is intended for storing a secure password. See\n * [[PDFTextField.enablePassword]] and [[PDFTextField.disablePassword]].\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isPassword()) console.log('Password is enabled')\n * ```\n * @returns Whether or not this is a password text field.\n */\n PDFTextField.prototype.isPassword = function () {\n return this.acroField.hasFlag(AcroTextFlags.Password);\n };\n /**\n * Indicate that this text field is intended for storing a secure password.\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enablePassword()\n * ```\n * Values entered into password text fields should not be displayed on the\n * screen by PDF readers. Most PDF readers will display the value as\n * asterisks or bullets. PDF readers should never store values entered by the\n * user into password text fields. Similarly, applications should not\n * write data to a password text field.\n *\n * **Please note that this method does not cause entered values to be\n * encrypted or secured in any way! It simply sets a flag that PDF software\n * and readers can access to determine the _purpose_ of this field.**\n */\n PDFTextField.prototype.enablePassword = function () {\n this.acroField.setFlagTo(AcroTextFlags.Password, true);\n };\n /**\n * Indicate that this text field is **not** intended for storing a secure\n * password. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disablePassword()\n * ```\n */\n PDFTextField.prototype.disablePassword = function () {\n this.acroField.setFlagTo(AcroTextFlags.Password, false);\n };\n /**\n * Returns `true` if the contents of this text field represent a file path.\n * See [[PDFTextField.enableFileSelection]] and\n * [[PDFTextField.disableFileSelection]]. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isFileSelector()) console.log('Is a file selector')\n * ```\n * @returns Whether or not this field should contain file paths.\n */\n PDFTextField.prototype.isFileSelector = function () {\n return this.acroField.hasFlag(AcroTextFlags.FileSelect);\n };\n /**\n * Indicate that this text field is intended to store a file path. The\n * contents of the file stored at that path should be submitted as the value\n * of the field. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableFileSelection()\n * ```\n */\n PDFTextField.prototype.enableFileSelection = function () {\n this.acroField.setFlagTo(AcroTextFlags.FileSelect, true);\n };\n /**\n * Indicate that this text field is **not** intended to store a file path.\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableFileSelection()\n * ```\n */\n PDFTextField.prototype.disableFileSelection = function () {\n this.acroField.setFlagTo(AcroTextFlags.FileSelect, false);\n };\n /**\n * Returns `true` if the text entered in this field should be spell checked\n * by PDF readers. See [[PDFTextField.enableSpellChecking]] and\n * [[PDFTextField.disableSpellChecking]]. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isSpellChecked()) console.log('Spell checking is enabled')\n * ```\n * @returns Whether or not this field should be spell checked.\n */\n PDFTextField.prototype.isSpellChecked = function () {\n return !this.acroField.hasFlag(AcroTextFlags.DoNotSpellCheck);\n };\n /**\n * Allow PDF readers to spell check the text entered in this field.\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableSpellChecking()\n * ```\n */\n PDFTextField.prototype.enableSpellChecking = function () {\n this.acroField.setFlagTo(AcroTextFlags.DoNotSpellCheck, false);\n };\n /**\n * Do not allow PDF readers to spell check the text entered in this field.\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableSpellChecking()\n * ```\n */\n PDFTextField.prototype.disableSpellChecking = function () {\n this.acroField.setFlagTo(AcroTextFlags.DoNotSpellCheck, true);\n };\n /**\n * Returns `true` if PDF readers should allow the user to scroll the text\n * field when its contents do not fit within the field's view bounds. See\n * [[PDFTextField.enableScrolling]] and [[PDFTextField.disableScrolling]].\n * For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isScrollable()) console.log('Scrolling is enabled')\n * ```\n * @returns Whether or not the field is scrollable in PDF readers.\n */\n PDFTextField.prototype.isScrollable = function () {\n return !this.acroField.hasFlag(AcroTextFlags.DoNotScroll);\n };\n /**\n * Allow PDF readers to present a scroll bar to the user when the contents\n * of this text field do not fit within its view bounds. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableScrolling()\n * ```\n * A horizontal scroll bar should be shown for singleline fields. A vertical\n * scroll bar should be shown for multiline fields.\n */\n PDFTextField.prototype.enableScrolling = function () {\n this.acroField.setFlagTo(AcroTextFlags.DoNotScroll, false);\n };\n /**\n * Do not allow PDF readers to present a scroll bar to the user when the\n * contents of this text field do not fit within its view bounds. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableScrolling()\n * ```\n */\n PDFTextField.prototype.disableScrolling = function () {\n this.acroField.setFlagTo(AcroTextFlags.DoNotScroll, true);\n };\n /**\n * Returns `true` if this is a combed text field. This means that the field\n * is split into `n` equal size cells with one character in each (where `n`\n * is equal to the max length of the text field). The result is that all\n * characters in this field are displayed an equal distance apart from one\n * another. See [[PDFTextField.enableCombing]] and\n * [[PDFTextField.disableCombing]]. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isCombed()) console.log('Combing is enabled')\n * ```\n * Note that in order for a text field to be combed, the following must be\n * true (in addition to enabling combing):\n * * It must not be a multiline field (see [[PDFTextField.isMultiline]])\n * * It must not be a password field (see [[PDFTextField.isPassword]])\n * * It must not be a file selector field (see [[PDFTextField.isFileSelector]])\n * * It must have a max length defined (see [[PDFTextField.setMaxLength]])\n * @returns Whether or not this field is combed.\n */\n PDFTextField.prototype.isCombed = function () {\n return (this.acroField.hasFlag(AcroTextFlags.Comb) &&\n !this.isMultiline() &&\n !this.isPassword() &&\n !this.isFileSelector() &&\n this.getMaxLength() !== undefined);\n };\n /**\n * Split this field into `n` equal size cells with one character in each\n * (where `n` is equal to the max length of the text field). This will cause\n * all characters in the field to be displayed an equal distance apart from\n * one another. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableCombing()\n * ```\n *\n * In addition to calling this method, text fields must have a max length\n * defined in order to be combed (see [[PDFTextField.setMaxLength]]).\n *\n * This method will also call the following three methods internally:\n * * [[PDFTextField.disableMultiline]]\n * * [[PDFTextField.disablePassword]]\n * * [[PDFTextField.disableFileSelection]]\n *\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n */\n PDFTextField.prototype.enableCombing = function () {\n if (this.getMaxLength() === undefined) {\n var msg = \"PDFTextFields must have a max length in order to be combed\";\n console.warn(msg);\n }\n this.markAsDirty();\n this.disableMultiline();\n this.disablePassword();\n this.disableFileSelection();\n this.acroField.setFlagTo(AcroTextFlags.Comb, true);\n };\n /**\n * Turn off combing for this text field. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableCombing()\n * ```\n * See [[PDFTextField.isCombed]] and [[PDFTextField.enableCombing]] for more\n * information about what combing is.\n *\n * This method will mark this text field as dirty. See\n * [[PDFTextField.setText]] for more details about what this means.\n */\n PDFTextField.prototype.disableCombing = function () {\n this.markAsDirty();\n this.acroField.setFlagTo(AcroTextFlags.Comb, false);\n };\n /**\n * Returns `true` if this text field contains rich text. See\n * [[PDFTextField.enableRichFormatting]] and\n * [[PDFTextField.disableRichFormatting]]. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.isRichFormatted()) console.log('Rich formatting enabled')\n * ```\n * @returns Whether or not this field contains rich text.\n */\n PDFTextField.prototype.isRichFormatted = function () {\n return this.acroField.hasFlag(AcroTextFlags.RichText);\n };\n /**\n * Indicate that this field contains XFA data - or rich text. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.enableRichFormatting()\n * ```\n * Note that `pdf-lib` does not support reading or writing rich text fields.\n * Nor do most PDF readers and writers. Rich text fields are based on XFA\n * (XML Forms Architecture). Relatively few PDFs use rich text fields or XFA.\n * Unlike PDF itself, XFA is not an ISO standard. XFA has been deprecated in\n * PDF 2.0:\n * * https://en.wikipedia.org/wiki/XFA\n * * http://blog.pdfshareforms.com/pdf-2-0-release-bid-farewell-xfa-forms/\n */\n PDFTextField.prototype.enableRichFormatting = function () {\n this.acroField.setFlagTo(AcroTextFlags.RichText, true);\n };\n /**\n * Indicate that this is a standard text field that does not XFA data (rich\n * text). For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * textField.disableRichFormatting()\n * ```\n */\n PDFTextField.prototype.disableRichFormatting = function () {\n this.acroField.setFlagTo(AcroTextFlags.RichText, false);\n };\n /**\n * Show this text field on the specified page. For example:\n * ```js\n * const ubuntuFont = await pdfDoc.embedFont(ubuntuFontBytes)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const textField = form.createTextField('best.gundam')\n * textField.setText('Exia')\n *\n * textField.addToPage(page, {\n * x: 50,\n * y: 75,\n * width: 200,\n * height: 100,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * font: ubuntuFont,\n * })\n * ```\n * This will create a new widget for this text field.\n * @param page The page to which this text field widget should be added.\n * @param options The options to be used when adding this text field widget.\n */\n PDFTextField.prototype.addToPage = function (page, options) {\n var _a, _b, _c, _d, _e, _f, _g;\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n if (!options)\n options = {};\n if (!('textColor' in options))\n options.textColor = rgb(0, 0, 0);\n if (!('backgroundColor' in options))\n options.backgroundColor = rgb(1, 1, 1);\n if (!('borderColor' in options))\n options.borderColor = rgb(0, 0, 0);\n if (!('borderWidth' in options))\n options.borderWidth = 1;\n // Create a widget for this text field\n var widget = this.createWidget({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : 200,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : 50,\n textColor: options.textColor,\n backgroundColor: options.backgroundColor,\n borderColor: options.borderColor,\n borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,\n rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n this.acroField.addWidget(widgetRef);\n // Set appearance streams for widget\n var font = (_g = options.font) !== null && _g !== void 0 ? _g : this.doc.getForm().getDefaultFont();\n this.updateWidgetAppearance(widget, font);\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if this text field has been marked as dirty, or if any of\n * this text field's widgets do not have an appearance stream. For example:\n * ```js\n * const textField = form.getTextField('some.text.field')\n * if (textField.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this text field needs an appearance update.\n */\n PDFTextField.prototype.needsAppearancesUpdate = function () {\n var _a;\n if (this.isDirty())\n return true;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream;\n if (!hasAppearances)\n return true;\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this text field's widgets using\n * the default appearance provider for text fields. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const textField = form.getTextField('some.text.field')\n * textField.defaultUpdateAppearances(helvetica)\n * ```\n * @param font The font to be used for creating the appearance streams.\n */\n PDFTextField.prototype.defaultUpdateAppearances = function (font) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n this.updateAppearances(font);\n };\n /**\n * Update the appearance streams for each of this text field's widgets using\n * the given appearance provider. If no `provider` is passed, the default\n * appearance provider for text fields will be used. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const textField = form.getTextField('some.text.field')\n * textField.updateAppearances(helvetica, (field, widget, font) => {\n * ...\n * return drawTextField(...)\n * })\n * ```\n * @param font The font to be used for creating the appearance streams.\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFTextField.prototype.updateAppearances = function (font, provider) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n this.updateWidgetAppearance(widget, font, provider);\n }\n this.markAsClean();\n };\n PDFTextField.prototype.updateWidgetAppearance = function (widget, font, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultTextFieldAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget, font));\n this.updateWidgetAppearanceWithFont(widget, font, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getTextField]] method, which will create an\n * > instance of [[PDFTextField]] for you.\n *\n * Create an instance of [[PDFTextField]] from an existing acroText and ref\n *\n * @param acroText The underlying `PDFAcroText` for this text field.\n * @param ref The unique reference for this text field.\n * @param doc The document to which this text field will belong.\n */\n PDFTextField.of = function (acroText, ref, doc) {\n return new PDFTextField(acroText, ref, doc);\n };\n return PDFTextField;\n}(PDFField));\nexport default PDFTextField;\n//# sourceMappingURL=PDFTextField.js.map","import PDFDocument from \"../PDFDocument\";\nimport PDFButton from \"./PDFButton\";\nimport PDFCheckBox from \"./PDFCheckBox\";\nimport PDFDropdown from \"./PDFDropdown\";\nimport PDFOptionList from \"./PDFOptionList\";\nimport PDFRadioGroup from \"./PDFRadioGroup\";\nimport PDFSignature from \"./PDFSignature\";\nimport PDFTextField from \"./PDFTextField\";\nimport { NoSuchFieldError, UnexpectedFieldTypeError, FieldAlreadyExistsError, InvalidFieldNamePartError, } from \"../errors\";\nimport PDFFont from \"../PDFFont\";\nimport { StandardFonts } from \"../StandardFonts\";\nimport { PDFAcroForm, PDFAcroCheckBox, PDFAcroComboBox, PDFAcroListBox, PDFAcroRadioButton, PDFAcroSignature, PDFAcroText, PDFAcroPushButton, PDFAcroNonTerminal, PDFRef, createPDFAcroFields, PDFName, } from \"../../core\";\nimport { assertIs, Cache, assertOrUndefined } from \"../../utils\";\n/**\n * Represents the interactive form of a [[PDFDocument]].\n *\n * Interactive forms (sometimes called _AcroForms_) are collections of fields\n * designed to gather information from a user. A PDF document may contains any\n * number of fields that appear on various pages, all of which make up a single,\n * global interactive form spanning the entire document. This means that\n * instances of [[PDFDocument]] shall contain at most one [[PDFForm]].\n *\n * The fields of an interactive form are represented by [[PDFField]] instances.\n */\nvar PDFForm = /** @class */ (function () {\n function PDFForm(acroForm, doc) {\n var _this = this;\n this.embedDefaultFont = function () {\n return _this.doc.embedStandardFont(StandardFonts.Helvetica);\n };\n assertIs(acroForm, 'acroForm', [[PDFAcroForm, 'PDFAcroForm']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n this.acroForm = acroForm;\n this.doc = doc;\n this.dirtyFields = new Set();\n this.defaultFontCache = Cache.populatedBy(this.embedDefaultFont);\n }\n /**\n * Returns `true` if this [[PDFForm]] has XFA data. Most PDFs with form\n * fields do not use XFA as it is not widely supported by PDF readers.\n *\n * > `pdf-lib` does not support creation, modification, or reading of XFA\n * > fields.\n *\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * if (form.hasXFA()) console.log('PDF has XFA data')\n * ```\n * @returns Whether or not this form has XFA data.\n */\n PDFForm.prototype.hasXFA = function () {\n return this.acroForm.dict.has(PDFName.of('XFA'));\n };\n /**\n * Disconnect the XFA data from this [[PDFForm]] (if any exists). This will\n * force readers to fallback to standard fields if the [[PDFDocument]]\n * contains any. For example:\n *\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * form.deleteXFA()\n * ```\n */\n PDFForm.prototype.deleteXFA = function () {\n this.acroForm.dict.delete(PDFName.of('XFA'));\n };\n /**\n * Get all fields contained in this [[PDFForm]]. For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const fields = form.getFields()\n * fields.forEach(field => {\n * const type = field.constructor.name\n * const name = field.getName()\n * console.log(`${type}: ${name}`)\n * })\n * ```\n * @returns An array of all fields in this form.\n */\n PDFForm.prototype.getFields = function () {\n var allFields = this.acroForm.getAllFields();\n var fields = [];\n for (var idx = 0, len = allFields.length; idx < len; idx++) {\n var _a = allFields[idx], acroField = _a[0], ref = _a[1];\n var field = convertToPDFField(acroField, ref, this.doc);\n if (field)\n fields.push(field);\n }\n return fields;\n };\n /**\n * Get the field in this [[PDFForm]] with the given name. For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const field = form.getFieldMaybe('Page1.Foo.Bar[0]')\n * if (field) console.log('Field exists!')\n * ```\n * @param name A fully qualified field name.\n * @returns The field with the specified name, if one exists.\n */\n PDFForm.prototype.getFieldMaybe = function (name) {\n assertIs(name, 'name', ['string']);\n var fields = this.getFields();\n for (var idx = 0, len = fields.length; idx < len; idx++) {\n var field = fields[idx];\n if (field.getName() === name)\n return field;\n }\n return undefined;\n };\n /**\n * Get the field in this [[PDFForm]] with the given name. For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const field = form.getField('Page1.Foo.Bar[0]')\n * ```\n * If no field exists with the provided name, an error will be thrown.\n * @param name A fully qualified field name.\n * @returns The field with the specified name.\n */\n PDFForm.prototype.getField = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getFieldMaybe(name);\n if (field)\n return field;\n throw new NoSuchFieldError(name);\n };\n /**\n * Get the button field in this [[PDFForm]] with the given name. For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const button = form.getButton('Page1.Foo.Button[0]')\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a button.\n * @param name A fully qualified button name.\n * @returns The button with the specified name.\n */\n PDFForm.prototype.getButton = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFButton)\n return field;\n throw new UnexpectedFieldTypeError(name, PDFButton, field);\n };\n /**\n * Get the check box field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const checkBox = form.getCheckBox('Page1.Foo.CheckBox[0]')\n * checkBox.check()\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a check box.\n * @param name A fully qualified check box name.\n * @returns The check box with the specified name.\n */\n PDFForm.prototype.getCheckBox = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFCheckBox)\n return field;\n throw new UnexpectedFieldTypeError(name, PDFCheckBox, field);\n };\n /**\n * Get the dropdown field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const dropdown = form.getDropdown('Page1.Foo.Dropdown[0]')\n * const options = dropdown.getOptions()\n * dropdown.select(options[0])\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a dropdown.\n * @param name A fully qualified dropdown name.\n * @returns The dropdown with the specified name.\n */\n PDFForm.prototype.getDropdown = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFDropdown)\n return field;\n throw new UnexpectedFieldTypeError(name, PDFDropdown, field);\n };\n /**\n * Get the option list field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const optionList = form.getOptionList('Page1.Foo.OptionList[0]')\n * const options = optionList.getOptions()\n * optionList.select(options[0])\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not an option list.\n * @param name A fully qualified option list name.\n * @returns The option list with the specified name.\n */\n PDFForm.prototype.getOptionList = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFOptionList)\n return field;\n throw new UnexpectedFieldTypeError(name, PDFOptionList, field);\n };\n /**\n * Get the radio group field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const radioGroup = form.getRadioGroup('Page1.Foo.RadioGroup[0]')\n * const options = radioGroup.getOptions()\n * dropdown.select(options[0])\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a radio group.\n * @param name A fully qualified radio group name.\n * @returns The radio group with the specified name.\n */\n PDFForm.prototype.getRadioGroup = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFRadioGroup)\n return field;\n throw new UnexpectedFieldTypeError(name, PDFRadioGroup, field);\n };\n /**\n * Get the signature field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const signature = form.getSignature('Page1.Foo.Signature[0]')\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a signature.\n * @param name A fully qualified signature name.\n * @returns The signature with the specified name.\n */\n PDFForm.prototype.getSignature = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFSignature)\n return field;\n throw new UnexpectedFieldTypeError(name, PDFSignature, field);\n };\n /**\n * Get the text field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const textField = form.getTextField('Page1.Foo.TextField[0]')\n * textField.setText('Are you designed to act or to be acted upon?')\n * ```\n * An error will be thrown if no field exists with the provided name, or if\n * the field exists but is not a text field.\n * @param name A fully qualified text field name.\n * @returns The text field with the specified name.\n */\n PDFForm.prototype.getTextField = function (name) {\n assertIs(name, 'name', ['string']);\n var field = this.getField(name);\n if (field instanceof PDFTextField)\n return field;\n throw new UnexpectedFieldTypeError(name, PDFTextField, field);\n };\n /**\n * Create a new button field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const button = form.createButton('cool.new.button')\n *\n * button.addToPage('Do Stuff', font, page)\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new button.\n * @returns The new button field.\n */\n PDFForm.prototype.createButton = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var button = PDFAcroPushButton.create(this.doc.context);\n button.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [button, button.ref], nameParts.terminal);\n return PDFButton.of(button, button.ref, this.doc);\n };\n /**\n * Create a new check box field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const checkBox = form.createCheckBox('cool.new.checkBox')\n *\n * checkBox.addToPage(page)\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new check box.\n * @returns The new check box field.\n */\n PDFForm.prototype.createCheckBox = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var checkBox = PDFAcroCheckBox.create(this.doc.context);\n checkBox.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [checkBox, checkBox.ref], nameParts.terminal);\n return PDFCheckBox.of(checkBox, checkBox.ref, this.doc);\n };\n /**\n * Create a new dropdown field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const dropdown = form.createDropdown('cool.new.dropdown')\n *\n * dropdown.addToPage(font, page)\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new dropdown.\n * @returns The new dropdown field.\n */\n PDFForm.prototype.createDropdown = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var comboBox = PDFAcroComboBox.create(this.doc.context);\n comboBox.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [comboBox, comboBox.ref], nameParts.terminal);\n return PDFDropdown.of(comboBox, comboBox.ref, this.doc);\n };\n /**\n * Create a new option list field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const optionList = form.createOptionList('cool.new.optionList')\n *\n * optionList.addToPage(font, page)\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new option list.\n * @returns The new option list field.\n */\n PDFForm.prototype.createOptionList = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var listBox = PDFAcroListBox.create(this.doc.context);\n listBox.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [listBox, listBox.ref], nameParts.terminal);\n return PDFOptionList.of(listBox, listBox.ref, this.doc);\n };\n /**\n * Create a new radio group field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const radioGroup = form.createRadioGroup('cool.new.radioGroup')\n *\n * radioGroup.addOptionToPage('is-dog', page, { y: 0 })\n * radioGroup.addOptionToPage('is-cat', page, { y: 75 })\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new radio group.\n * @returns The new radio group field.\n */\n PDFForm.prototype.createRadioGroup = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var radioButton = PDFAcroRadioButton.create(this.doc.context);\n radioButton.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [radioButton, radioButton.ref], nameParts.terminal);\n return PDFRadioGroup.of(radioButton, radioButton.ref, this.doc);\n };\n /**\n * Create a new text field in this [[PDFForm]] with the given name.\n * For example:\n * ```js\n * const font = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const textField = form.createTextField('cool.new.textField')\n *\n * textField.addToPage(font, page)\n * ```\n * An error will be thrown if a field already exists with the provided name.\n * @param name The fully qualified name for the new radio group.\n * @returns The new radio group field.\n */\n PDFForm.prototype.createTextField = function (name) {\n assertIs(name, 'name', ['string']);\n var nameParts = splitFieldName(name);\n var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);\n var text = PDFAcroText.create(this.doc.context);\n text.setPartialName(nameParts.terminal);\n addFieldToParent(parent, [text, text.ref], nameParts.terminal);\n return PDFTextField.of(text, text.ref, this.doc);\n };\n /**\n * Update the appearance streams for all widgets of all fields in this\n * [[PDFForm]]. Appearance streams will only be created for a widget if it\n * does not have any existing appearance streams, or the field's value has\n * changed (e.g. by calling [[PDFTextField.setText]] or\n * [[PDFDropdown.select]]).\n *\n * For example:\n * ```js\n * const courier = await pdfDoc.embedFont(StandardFonts.Courier)\n * const form = pdfDoc.getForm()\n * form.updateFieldAppearances(courier)\n * ```\n *\n * **IMPORTANT:** The default value for the `font` parameter is\n * [[StandardFonts.Helvetica]]. Note that this is a WinAnsi font. This means\n * that encoding errors will be thrown if any fields contain text with\n * characters outside the WinAnsi character set (the latin alphabet).\n *\n * Embedding a custom font and passing that as the `font`\n * parameter allows you to generate appearance streams with non WinAnsi\n * characters (assuming your custom font supports them).\n *\n * > **NOTE:** The [[PDFDocument.save]] method will call this method to\n * > update appearances automatically if a form was accessed via the\n * > [[PDFDocument.getForm]] method prior to saving.\n *\n * @param font Optionally, the font to use when creating new appearances.\n */\n PDFForm.prototype.updateFieldAppearances = function (font) {\n assertOrUndefined(font, 'font', [[PDFFont, 'PDFFont']]);\n font = font !== null && font !== void 0 ? font : this.getDefaultFont();\n var fields = this.getFields();\n for (var idx = 0, len = fields.length; idx < len; idx++) {\n var field = fields[idx];\n if (field.needsAppearancesUpdate()) {\n field.defaultUpdateAppearances(font);\n }\n }\n };\n /**\n * Mark a field as dirty. This will cause its appearance streams to be\n * updated by [[PDFForm.updateFieldAppearances]].\n * ```js\n * const form = pdfDoc.getForm()\n * const field = form.getField('foo.bar')\n * form.markFieldAsDirty(field.ref)\n * ```\n * @param fieldRef The reference to the field that should be marked.\n */\n PDFForm.prototype.markFieldAsDirty = function (fieldRef) {\n assertOrUndefined(fieldRef, 'fieldRef', [[PDFRef, 'PDFRef']]);\n this.dirtyFields.add(fieldRef);\n };\n /**\n * Mark a field as dirty. This will cause its appearance streams to not be\n * updated by [[PDFForm.updateFieldAppearances]].\n * ```js\n * const form = pdfDoc.getForm()\n * const field = form.getField('foo.bar')\n * form.markFieldAsClean(field.ref)\n * ```\n * @param fieldRef The reference to the field that should be marked.\n */\n PDFForm.prototype.markFieldAsClean = function (fieldRef) {\n assertOrUndefined(fieldRef, 'fieldRef', [[PDFRef, 'PDFRef']]);\n this.dirtyFields.delete(fieldRef);\n };\n /**\n * Returns `true` is the specified field has been marked as dirty.\n * ```js\n * const form = pdfDoc.getForm()\n * const field = form.getField('foo.bar')\n * if (form.fieldIsDirty(field.ref)) console.log('Field is dirty')\n * ```\n * @param fieldRef The reference to the field that should be checked.\n * @returns Whether or not the specified field is dirty.\n */\n PDFForm.prototype.fieldIsDirty = function (fieldRef) {\n assertOrUndefined(fieldRef, 'fieldRef', [[PDFRef, 'PDFRef']]);\n return this.dirtyFields.has(fieldRef);\n };\n PDFForm.prototype.getDefaultFont = function () {\n return this.defaultFontCache.access();\n };\n PDFForm.prototype.findOrCreateNonTerminals = function (partialNames) {\n var nonTerminal = [\n this.acroForm,\n ];\n for (var idx = 0, len = partialNames.length; idx < len; idx++) {\n var namePart = partialNames[idx];\n if (!namePart)\n throw new InvalidFieldNamePartError(namePart);\n var parent_1 = nonTerminal[0], parentRef = nonTerminal[1];\n var res = this.findNonTerminal(namePart, parent_1);\n if (res) {\n nonTerminal = res;\n }\n else {\n var node = PDFAcroNonTerminal.create(this.doc.context);\n node.setPartialName(namePart);\n node.setParent(parentRef);\n var nodeRef = this.doc.context.register(node.dict);\n parent_1.addField(nodeRef);\n nonTerminal = [node, nodeRef];\n }\n }\n return nonTerminal;\n };\n PDFForm.prototype.findNonTerminal = function (partialName, parent) {\n var fields = parent instanceof PDFAcroForm\n ? this.acroForm.getFields()\n : createPDFAcroFields(parent.Kids());\n for (var idx = 0, len = fields.length; idx < len; idx++) {\n var _a = fields[idx], field = _a[0], ref = _a[1];\n if (field.getPartialName() === partialName) {\n if (field instanceof PDFAcroNonTerminal)\n return [field, ref];\n throw new FieldAlreadyExistsError(partialName);\n }\n }\n return undefined;\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.getForm]] method, which will create an\n * > instance of [[PDFForm]] for you.\n *\n * Create an instance of [[PDFForm]] from an existing acroForm and embedder\n *\n * @param acroForm The underlying `PDFAcroForm` for this form.\n * @param doc The document to which the form will belong.\n */\n PDFForm.of = function (acroForm, doc) {\n return new PDFForm(acroForm, doc);\n };\n return PDFForm;\n}());\nexport default PDFForm;\nvar convertToPDFField = function (field, ref, doc) {\n if (field instanceof PDFAcroPushButton)\n return PDFButton.of(field, ref, doc);\n if (field instanceof PDFAcroCheckBox)\n return PDFCheckBox.of(field, ref, doc);\n if (field instanceof PDFAcroComboBox)\n return PDFDropdown.of(field, ref, doc);\n if (field instanceof PDFAcroListBox)\n return PDFOptionList.of(field, ref, doc);\n if (field instanceof PDFAcroText)\n return PDFTextField.of(field, ref, doc);\n if (field instanceof PDFAcroRadioButton) {\n return PDFRadioGroup.of(field, ref, doc);\n }\n if (field instanceof PDFAcroSignature) {\n return PDFSignature.of(field, ref, doc);\n }\n return undefined;\n};\nvar splitFieldName = function (fullyQualifiedName) {\n if (fullyQualifiedName.length === 0) {\n throw new Error('PDF field names must not be empty strings');\n }\n var parts = fullyQualifiedName.split('.');\n for (var idx = 0, len = parts.length; idx < len; idx++) {\n if (parts[idx] === '') {\n throw new Error(\"Periods in PDF field names must be separated by at least one character: \\\"\" + fullyQualifiedName + \"\\\"\");\n }\n }\n if (parts.length === 1)\n return { nonTerminal: [], terminal: parts[0] };\n return {\n nonTerminal: parts.slice(0, parts.length - 1),\n terminal: parts[parts.length - 1],\n };\n};\nvar addFieldToParent = function (_a, _b, partialName) {\n var parent = _a[0], parentRef = _a[1];\n var field = _b[0], fieldRef = _b[1];\n var entries = parent.normalizedEntries();\n var fields = createPDFAcroFields('Kids' in entries ? entries.Kids : entries.Fields);\n for (var idx = 0, len = fields.length; idx < len; idx++) {\n if (fields[idx][0].getPartialName() === partialName) {\n throw new FieldAlreadyExistsError(partialName);\n }\n }\n parent.addField(fieldRef);\n field.setParent(parentRef);\n};\n//# sourceMappingURL=PDFForm.js.map","export var ParseSpeeds;\n(function (ParseSpeeds) {\n ParseSpeeds[ParseSpeeds[\"Fastest\"] = Infinity] = \"Fastest\";\n ParseSpeeds[ParseSpeeds[\"Fast\"] = 1500] = \"Fast\";\n ParseSpeeds[ParseSpeeds[\"Medium\"] = 500] = \"Medium\";\n ParseSpeeds[ParseSpeeds[\"Slow\"] = 100] = \"Slow\";\n})(ParseSpeeds || (ParseSpeeds = {}));\n//# sourceMappingURL=PDFDocumentOptions.js.map","export var PageSizes = {\n '4A0': [4767.87, 6740.79],\n '2A0': [3370.39, 4767.87],\n A0: [2383.94, 3370.39],\n A1: [1683.78, 2383.94],\n A2: [1190.55, 1683.78],\n A3: [841.89, 1190.55],\n A4: [595.28, 841.89],\n A5: [419.53, 595.28],\n A6: [297.64, 419.53],\n A7: [209.76, 297.64],\n A8: [147.4, 209.76],\n A9: [104.88, 147.4],\n A10: [73.7, 104.88],\n B0: [2834.65, 4008.19],\n B1: [2004.09, 2834.65],\n B2: [1417.32, 2004.09],\n B3: [1000.63, 1417.32],\n B4: [708.66, 1000.63],\n B5: [498.9, 708.66],\n B6: [354.33, 498.9],\n B7: [249.45, 354.33],\n B8: [175.75, 249.45],\n B9: [124.72, 175.75],\n B10: [87.87, 124.72],\n C0: [2599.37, 3676.54],\n C1: [1836.85, 2599.37],\n C2: [1298.27, 1836.85],\n C3: [918.43, 1298.27],\n C4: [649.13, 918.43],\n C5: [459.21, 649.13],\n C6: [323.15, 459.21],\n C7: [229.61, 323.15],\n C8: [161.57, 229.61],\n C9: [113.39, 161.57],\n C10: [79.37, 113.39],\n RA0: [2437.8, 3458.27],\n RA1: [1729.13, 2437.8],\n RA2: [1218.9, 1729.13],\n RA3: [864.57, 1218.9],\n RA4: [609.45, 864.57],\n SRA0: [2551.18, 3628.35],\n SRA1: [1814.17, 2551.18],\n SRA2: [1275.59, 1814.17],\n SRA3: [907.09, 1275.59],\n SRA4: [637.8, 907.09],\n Executive: [521.86, 756.0],\n Folio: [612.0, 936.0],\n Legal: [612.0, 1008.0],\n Letter: [612.0, 792.0],\n Tabloid: [792.0, 1224.0],\n};\n//# sourceMappingURL=sizes.js.map","import { __awaiter, __generator } from \"tslib\";\nimport { PDFName, PDFArray, PDFDict, PDFHexString } from \"../core\";\n/**\n * Represents a file that has been embedded in a [[PDFDocument]].\n */\nvar PDFEmbeddedFile = /** @class */ (function () {\n function PDFEmbeddedFile(ref, doc, embedder) {\n this.alreadyEmbedded = false;\n this.ref = ref;\n this.doc = doc;\n this.embedder = embedder;\n }\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all embeddable files get embedded.\n *\n * Embed this embeddable file in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFEmbeddedFile.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n var ref, Names, EmbeddedFiles, EFNames;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.alreadyEmbedded) return [3 /*break*/, 2];\n return [4 /*yield*/, this.embedder.embedIntoContext(this.doc.context, this.ref)];\n case 1:\n ref = _a.sent();\n if (!this.doc.catalog.has(PDFName.of('Names'))) {\n this.doc.catalog.set(PDFName.of('Names'), this.doc.context.obj({}));\n }\n Names = this.doc.catalog.lookup(PDFName.of('Names'), PDFDict);\n if (!Names.has(PDFName.of('EmbeddedFiles'))) {\n Names.set(PDFName.of('EmbeddedFiles'), this.doc.context.obj({}));\n }\n EmbeddedFiles = Names.lookup(PDFName.of('EmbeddedFiles'), PDFDict);\n if (!EmbeddedFiles.has(PDFName.of('Names'))) {\n EmbeddedFiles.set(PDFName.of('Names'), this.doc.context.obj([]));\n }\n EFNames = EmbeddedFiles.lookup(PDFName.of('Names'), PDFArray);\n EFNames.push(PDFHexString.fromText(this.embedder.fileName));\n EFNames.push(ref);\n this.alreadyEmbedded = true;\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.attach]] method, which will create\n * instances of [[PDFEmbeddedFile]] for you.\n *\n * Create an instance of [[PDFEmbeddedFile]] from an existing ref and embedder\n *\n * @param ref The unique reference for this file.\n * @param doc The document to which the file will belong.\n * @param embedder The embedder that will be used to embed the file.\n */\n PDFEmbeddedFile.of = function (ref, doc, embedder) {\n return new PDFEmbeddedFile(ref, doc, embedder);\n };\n return PDFEmbeddedFile;\n}());\nexport default PDFEmbeddedFile;\n//# sourceMappingURL=PDFEmbeddedFile.js.map","export var BlendMode;\n(function (BlendMode) {\n BlendMode[\"Normal\"] = \"Normal\";\n BlendMode[\"Multiply\"] = \"Multiply\";\n BlendMode[\"Screen\"] = \"Screen\";\n BlendMode[\"Overlay\"] = \"Overlay\";\n BlendMode[\"Darken\"] = \"Darken\";\n BlendMode[\"Lighten\"] = \"Lighten\";\n BlendMode[\"ColorDodge\"] = \"ColorDodge\";\n BlendMode[\"ColorBurn\"] = \"ColorBurn\";\n BlendMode[\"HardLight\"] = \"HardLight\";\n BlendMode[\"SoftLight\"] = \"SoftLight\";\n BlendMode[\"Difference\"] = \"Difference\";\n BlendMode[\"Exclusion\"] = \"Exclusion\";\n})(BlendMode || (BlendMode = {}));\n//# sourceMappingURL=PDFPageOptions.js.map","import { __awaiter, __generator, __rest } from \"tslib\";\nimport { EncryptedPDFError, FontkitNotRegisteredError, ForeignPageError, RemovePageFromEmptyDocumentError, } from \"./errors\";\nimport PDFEmbeddedPage from \"./PDFEmbeddedPage\";\nimport PDFFont from \"./PDFFont\";\nimport PDFImage from \"./PDFImage\";\nimport PDFPage from \"./PDFPage\";\nimport PDFForm from \"./form/PDFForm\";\nimport { PageSizes } from \"./sizes\";\nimport { CustomFontEmbedder, CustomFontSubsetEmbedder, JpegEmbedder, PageEmbeddingMismatchedContextError, PDFCatalog, PDFContext, PDFDict, PDFHexString, PDFName, PDFObjectCopier, PDFPageEmbedder, PDFPageLeaf, PDFPageTree, PDFParser, PDFStreamWriter, PDFString, PDFWriter, PngEmbedder, StandardFontEmbedder, UnexpectedObjectTypeError, } from \"../core\";\nimport { ParseSpeeds, } from \"./PDFDocumentOptions\";\nimport { assertIs, assertOrUndefined, assertRange, Cache, canBeConvertedToUint8Array, encodeToBase64, isStandardFont, pluckIndices, range, toUint8Array, } from \"../utils\";\nimport FileEmbedder from \"../core/embedders/FileEmbedder\";\nimport PDFEmbeddedFile from \"./PDFEmbeddedFile\";\n/**\n * Represents a PDF document.\n */\nvar PDFDocument = /** @class */ (function () {\n function PDFDocument(context, ignoreEncryption, updateMetadata) {\n var _this = this;\n /** The default word breaks used in PDFPage.drawText */\n this.defaultWordBreaks = [' '];\n this.computePages = function () {\n var pages = [];\n _this.catalog.Pages().traverse(function (node, ref) {\n if (node instanceof PDFPageLeaf) {\n var page = _this.pageMap.get(node);\n if (!page) {\n page = PDFPage.of(node, ref, _this);\n _this.pageMap.set(node, page);\n }\n pages.push(page);\n }\n });\n return pages;\n };\n this.getOrCreateForm = function () {\n var acroForm = _this.catalog.getOrCreateAcroForm();\n return PDFForm.of(acroForm, _this);\n };\n assertIs(context, 'context', [[PDFContext, 'PDFContext']]);\n assertIs(ignoreEncryption, 'ignoreEncryption', ['boolean']);\n this.context = context;\n this.catalog = context.lookup(context.trailerInfo.Root);\n this.isEncrypted = !!context.lookup(context.trailerInfo.Encrypt);\n this.pageCache = Cache.populatedBy(this.computePages);\n this.pageMap = new Map();\n this.formCache = Cache.populatedBy(this.getOrCreateForm);\n this.fonts = [];\n this.images = [];\n this.embeddedPages = [];\n this.embeddedFiles = [];\n if (!ignoreEncryption && this.isEncrypted)\n throw new EncryptedPDFError();\n if (updateMetadata)\n this.updateInfoDict();\n }\n /**\n * Load an existing [[PDFDocument]]. The input data can be provided in\n * multiple formats:\n *\n * | Type | Contents |\n * | ------------- | ------------------------------------------------------ |\n * | `string` | A base64 encoded string (or data URI) containing a PDF |\n * | `Uint8Array` | The raw bytes of a PDF |\n * | `ArrayBuffer` | The raw bytes of a PDF |\n *\n * For example:\n * ```js\n * import { PDFDocument } from 'pdf-lib'\n *\n * // pdf=string\n * const base64 =\n * 'JVBERi0xLjcKJYGBgYEKCjUgMCBvYmoKPDwKL0ZpbHRlciAvRmxhdGVEZWNvZGUKL0xlbm' +\n * 'd0aCAxMDQKPj4Kc3RyZWFtCniccwrhMlAAwaJ0Ln2P1Jyy1JLM5ERdc0MjCwUjE4WQNC4Q' +\n * '6cNlCFZkqGCqYGSqEJLLZWNuYGZiZmbkYuZsZmlmZGRgZmluDCQNzc3NTM2NzdzMXMxMjQ' +\n * 'ztFEKyuEK0uFxDuAAOERdVCmVuZHN0cmVhbQplbmRvYmoKCjYgMCBvYmoKPDwKL0ZpbHRl' +\n * 'ciAvRmxhdGVEZWNvZGUKL1R5cGUgL09ialN0bQovTiA0Ci9GaXJzdCAyMAovTGVuZ3RoID' +\n * 'IxNQo+PgpzdHJlYW0KeJxVj9GqwjAMhu/zFHkBzTo3nCCCiiKIHPEICuJF3cKoSCu2E8/b' +\n * '20wPIr1p8v9/8kVhgilmGfawX2CGaVrgcAi0/bsy0lrX7IGWpvJ4iJYEN3gEmrrGBlQwGs' +\n * 'HHO9VBX1wNrxAqMX87RBD5xpJuddqwd82tjAHxzV1U5LPgy52DKXWnr1Lheg+j/c/pzGVr' +\n * 'iqV0VlwZPXGPCJjElw/ybkwUmeoWgxesDXGhHJC/D/iikp1Av80ptKU0FdBEe25pPihAM1' +\n * 'u6ytgaaWfs2Hrz35CJT1+EWmAKZW5kc3RyZWFtCmVuZG9iagoKNyAwIG9iago8PAovU2l6' +\n * 'ZSA4Ci9Sb290IDIgMCBSCi9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9UeXBlIC9YUmVmCi9MZW' +\n * '5ndGggMzgKL1cgWyAxIDIgMiBdCi9JbmRleCBbIDAgOCBdCj4+CnN0cmVhbQp4nBXEwREA' +\n * 'EBAEsCwz3vrvRmOOyyOoGhZdutHN2MT55fIAVocD+AplbmRzdHJlYW0KZW5kb2JqCgpzdG' +\n * 'FydHhyZWYKNTEwCiUlRU9G'\n *\n * const dataUri = 'data:application/pdf;base64,' + base64\n *\n * const pdfDoc1 = await PDFDocument.load(base64)\n * const pdfDoc2 = await PDFDocument.load(dataUri)\n *\n * // pdf=Uint8Array\n * import fs from 'fs'\n * const uint8Array = fs.readFileSync('with_update_sections.pdf')\n * const pdfDoc3 = await PDFDocument.load(uint8Array)\n *\n * // pdf=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/with_update_sections.pdf'\n * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())\n * const pdfDoc4 = await PDFDocument.load(arrayBuffer)\n *\n * ```\n *\n * @param pdf The input data containing a PDF document.\n * @param options The options to be used when loading the document.\n * @returns Resolves with a document loaded from the input.\n */\n PDFDocument.load = function (pdf, options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, ignoreEncryption, _b, parseSpeed, _c, throwOnInvalidObject, _d, updateMetadata, _e, capNumbers, bytes, context;\n return __generator(this, function (_f) {\n switch (_f.label) {\n case 0:\n _a = options.ignoreEncryption, ignoreEncryption = _a === void 0 ? false : _a, _b = options.parseSpeed, parseSpeed = _b === void 0 ? ParseSpeeds.Slow : _b, _c = options.throwOnInvalidObject, throwOnInvalidObject = _c === void 0 ? false : _c, _d = options.updateMetadata, updateMetadata = _d === void 0 ? true : _d, _e = options.capNumbers, capNumbers = _e === void 0 ? false : _e;\n assertIs(pdf, 'pdf', ['string', Uint8Array, ArrayBuffer]);\n assertIs(ignoreEncryption, 'ignoreEncryption', ['boolean']);\n assertIs(parseSpeed, 'parseSpeed', ['number']);\n assertIs(throwOnInvalidObject, 'throwOnInvalidObject', ['boolean']);\n bytes = toUint8Array(pdf);\n return [4 /*yield*/, PDFParser.forBytesWithOptions(bytes, parseSpeed, throwOnInvalidObject, capNumbers).parseDocument()];\n case 1:\n context = _f.sent();\n return [2 /*return*/, new PDFDocument(context, ignoreEncryption, updateMetadata)];\n }\n });\n });\n };\n /**\n * Create a new [[PDFDocument]].\n * @returns Resolves with the newly created document.\n */\n PDFDocument.create = function (options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, updateMetadata, context, pageTree, pageTreeRef, catalog;\n return __generator(this, function (_b) {\n _a = options.updateMetadata, updateMetadata = _a === void 0 ? true : _a;\n context = PDFContext.create();\n pageTree = PDFPageTree.withContext(context);\n pageTreeRef = context.register(pageTree);\n catalog = PDFCatalog.withContextAndPages(context, pageTreeRef);\n context.trailerInfo.Root = context.register(catalog);\n return [2 /*return*/, new PDFDocument(context, false, updateMetadata)];\n });\n });\n };\n /**\n * Register a fontkit instance. This must be done before custom fonts can\n * be embedded. See [here](https://github.com/Hopding/pdf-lib/tree/master#fontkit-installation)\n * for instructions on how to install and register a fontkit instance.\n *\n * > You do **not** need to call this method to embed standard fonts.\n *\n * For example:\n * ```js\n * import { PDFDocument } from 'pdf-lib'\n * import fontkit from '@pdf-lib/fontkit'\n *\n * const pdfDoc = await PDFDocument.create()\n * pdfDoc.registerFontkit(fontkit)\n * ```\n *\n * @param fontkit The fontkit instance to be registered.\n */\n PDFDocument.prototype.registerFontkit = function (fontkit) {\n this.fontkit = fontkit;\n };\n /**\n * Get the [[PDFForm]] containing all interactive fields for this document.\n * For example:\n * ```js\n * const form = pdfDoc.getForm()\n * const fields = form.getFields()\n * fields.forEach(field => {\n * const type = field.constructor.name\n * const name = field.getName()\n * console.log(`${type}: ${name}`)\n * })\n * ```\n * @returns The form for this document.\n */\n PDFDocument.prototype.getForm = function () {\n var form = this.formCache.access();\n if (form.hasXFA()) {\n console.warn('Removing XFA form data as pdf-lib does not support reading or writing XFA');\n form.deleteXFA();\n }\n return form;\n };\n /**\n * Get this document's title metadata. The title appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const title = pdfDoc.getTitle()\n * ```\n * @returns A string containing the title of this document, if it has one.\n */\n PDFDocument.prototype.getTitle = function () {\n var title = this.getInfoDict().lookup(PDFName.Title);\n if (!title)\n return undefined;\n assertIsLiteralOrHexString(title);\n return title.decodeText();\n };\n /**\n * Get this document's author metadata. The author appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const author = pdfDoc.getAuthor()\n * ```\n * @returns A string containing the author of this document, if it has one.\n */\n PDFDocument.prototype.getAuthor = function () {\n var author = this.getInfoDict().lookup(PDFName.Author);\n if (!author)\n return undefined;\n assertIsLiteralOrHexString(author);\n return author.decodeText();\n };\n /**\n * Get this document's subject metadata. The subject appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const subject = pdfDoc.getSubject()\n * ```\n * @returns A string containing the subject of this document, if it has one.\n */\n PDFDocument.prototype.getSubject = function () {\n var subject = this.getInfoDict().lookup(PDFName.Subject);\n if (!subject)\n return undefined;\n assertIsLiteralOrHexString(subject);\n return subject.decodeText();\n };\n /**\n * Get this document's keywords metadata. The keywords appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const keywords = pdfDoc.getKeywords()\n * ```\n * @returns A string containing the keywords of this document, if it has any.\n */\n PDFDocument.prototype.getKeywords = function () {\n var keywords = this.getInfoDict().lookup(PDFName.Keywords);\n if (!keywords)\n return undefined;\n assertIsLiteralOrHexString(keywords);\n return keywords.decodeText();\n };\n /**\n * Get this document's creator metadata. The creator appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const creator = pdfDoc.getCreator()\n * ```\n * @returns A string containing the creator of this document, if it has one.\n */\n PDFDocument.prototype.getCreator = function () {\n var creator = this.getInfoDict().lookup(PDFName.Creator);\n if (!creator)\n return undefined;\n assertIsLiteralOrHexString(creator);\n return creator.decodeText();\n };\n /**\n * Get this document's producer metadata. The producer appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const producer = pdfDoc.getProducer()\n * ```\n * @returns A string containing the producer of this document, if it has one.\n */\n PDFDocument.prototype.getProducer = function () {\n var producer = this.getInfoDict().lookup(PDFName.Producer);\n if (!producer)\n return undefined;\n assertIsLiteralOrHexString(producer);\n return producer.decodeText();\n };\n /**\n * Get this document's creation date metadata. The creation date appears in\n * the \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const creationDate = pdfDoc.getCreationDate()\n * ```\n * @returns A Date containing the creation date of this document,\n * if it has one.\n */\n PDFDocument.prototype.getCreationDate = function () {\n var creationDate = this.getInfoDict().lookup(PDFName.CreationDate);\n if (!creationDate)\n return undefined;\n assertIsLiteralOrHexString(creationDate);\n return creationDate.decodeDate();\n };\n /**\n * Get this document's modification date metadata. The modification date\n * appears in the \"Document Properties\" section of most PDF readers.\n * For example:\n * ```js\n * const modification = pdfDoc.getModificationDate()\n * ```\n * @returns A Date containing the modification date of this document,\n * if it has one.\n */\n PDFDocument.prototype.getModificationDate = function () {\n var modificationDate = this.getInfoDict().lookup(PDFName.ModDate);\n if (!modificationDate)\n return undefined;\n assertIsLiteralOrHexString(modificationDate);\n return modificationDate.decodeDate();\n };\n /**\n * Set this document's title metadata. The title will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setTitle('🥚 The Life of an Egg 🍳')\n * ```\n * @param title The title of this document.\n */\n PDFDocument.prototype.setTitle = function (title) {\n assertIs(title, 'title', ['string']);\n var key = PDFName.of('Title');\n this.getInfoDict().set(key, PDFHexString.fromText(title));\n };\n /**\n * Set this document's author metadata. The author will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setAuthor('Humpty Dumpty')\n * ```\n * @param author The author of this document.\n */\n PDFDocument.prototype.setAuthor = function (author) {\n assertIs(author, 'author', ['string']);\n var key = PDFName.of('Author');\n this.getInfoDict().set(key, PDFHexString.fromText(author));\n };\n /**\n * Set this document's subject metadata. The subject will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setSubject('📘 An Epic Tale of Woe 📖')\n * ```\n * @param subject The subject of this document.\n */\n PDFDocument.prototype.setSubject = function (subject) {\n assertIs(subject, 'author', ['string']);\n var key = PDFName.of('Subject');\n this.getInfoDict().set(key, PDFHexString.fromText(subject));\n };\n /**\n * Set this document's keyword metadata. These keywords will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setKeywords(['eggs', 'wall', 'fall', 'king', 'horses', 'men'])\n * ```\n * @param keywords An array of keywords associated with this document.\n */\n PDFDocument.prototype.setKeywords = function (keywords) {\n assertIs(keywords, 'keywords', [Array]);\n var key = PDFName.of('Keywords');\n this.getInfoDict().set(key, PDFHexString.fromText(keywords.join(' ')));\n };\n /**\n * Set this document's creator metadata. The creator will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setCreator('PDF App 9000 🤖')\n * ```\n * @param creator The creator of this document.\n */\n PDFDocument.prototype.setCreator = function (creator) {\n assertIs(creator, 'creator', ['string']);\n var key = PDFName.of('Creator');\n this.getInfoDict().set(key, PDFHexString.fromText(creator));\n };\n /**\n * Set this document's producer metadata. The producer will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setProducer('PDF App 9000 🤖')\n * ```\n * @param producer The producer of this document.\n */\n PDFDocument.prototype.setProducer = function (producer) {\n assertIs(producer, 'creator', ['string']);\n var key = PDFName.of('Producer');\n this.getInfoDict().set(key, PDFHexString.fromText(producer));\n };\n /**\n * Set this document's language metadata. The language will appear in the\n * \"Document Properties\" section of some PDF readers. For example:\n * ```js\n * pdfDoc.setLanguage('en-us')\n * ```\n *\n * @param language An RFC 3066 _Language-Tag_ denoting the language of this\n * document, or an empty string if the language is unknown.\n */\n PDFDocument.prototype.setLanguage = function (language) {\n assertIs(language, 'language', ['string']);\n var key = PDFName.of('Lang');\n this.catalog.set(key, PDFString.of(language));\n };\n /**\n * Set this document's creation date metadata. The creation date will appear\n * in the \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setCreationDate(new Date())\n * ```\n * @param creationDate The date this document was created.\n */\n PDFDocument.prototype.setCreationDate = function (creationDate) {\n assertIs(creationDate, 'creationDate', [[Date, 'Date']]);\n var key = PDFName.of('CreationDate');\n this.getInfoDict().set(key, PDFString.fromDate(creationDate));\n };\n /**\n * Set this document's modification date metadata. The modification date will\n * appear in the \"Document Properties\" section of most PDF readers. For\n * example:\n * ```js\n * pdfDoc.setModificationDate(new Date())\n * ```\n * @param modificationDate The date this document was last modified.\n */\n PDFDocument.prototype.setModificationDate = function (modificationDate) {\n assertIs(modificationDate, 'modificationDate', [[Date, 'Date']]);\n var key = PDFName.of('ModDate');\n this.getInfoDict().set(key, PDFString.fromDate(modificationDate));\n };\n /**\n * Get the number of pages contained in this document. For example:\n * ```js\n * const totalPages = pdfDoc.getPageCount()\n * ```\n * @returns The number of pages in this document.\n */\n PDFDocument.prototype.getPageCount = function () {\n if (this.pageCount === undefined)\n this.pageCount = this.getPages().length;\n return this.pageCount;\n };\n /**\n * Get an array of all the pages contained in this document. The pages are\n * stored in the array in the same order that they are rendered in the\n * document. For example:\n * ```js\n * const pages = pdfDoc.getPages()\n * pages[0] // The first page of the document\n * pages[2] // The third page of the document\n * pages[197] // The 198th page of the document\n * ```\n * @returns An array of all the pages contained in this document.\n */\n PDFDocument.prototype.getPages = function () {\n return this.pageCache.access();\n };\n /**\n * Get the page rendered at a particular `index` of the document. For example:\n * ```js\n * pdfDoc.getPage(0) // The first page of the document\n * pdfDoc.getPage(2) // The third page of the document\n * pdfDoc.getPage(197) // The 198th page of the document\n * ```\n * @returns The [[PDFPage]] rendered at the given `index` of the document.\n */\n PDFDocument.prototype.getPage = function (index) {\n var pages = this.getPages();\n assertRange(index, 'index', 0, pages.length - 1);\n return pages[index];\n };\n /**\n * Get an array of indices for all the pages contained in this document. The\n * array will contain a range of integers from\n * `0..pdfDoc.getPageCount() - 1`. For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n * pdfDoc.addPage()\n * pdfDoc.addPage()\n * pdfDoc.addPage()\n *\n * const indices = pdfDoc.getPageIndices()\n * indices // => [0, 1, 2]\n * ```\n * @returns An array of indices for all pages contained in this document.\n */\n PDFDocument.prototype.getPageIndices = function () {\n return range(0, this.getPageCount());\n };\n /**\n * Remove the page at a given index from this document. For example:\n * ```js\n * pdfDoc.removePage(0) // Remove the first page of the document\n * pdfDoc.removePage(2) // Remove the third page of the document\n * pdfDoc.removePage(197) // Remove the 198th page of the document\n * ```\n * Once a page has been removed, it will no longer be rendered at that index\n * in the document.\n * @param index The index of the page to be removed.\n */\n PDFDocument.prototype.removePage = function (index) {\n var pageCount = this.getPageCount();\n if (this.pageCount === 0)\n throw new RemovePageFromEmptyDocumentError();\n assertRange(index, 'index', 0, pageCount - 1);\n this.catalog.removeLeafNode(index);\n this.pageCount = pageCount - 1;\n };\n /**\n * Add a page to the end of this document. This method accepts three\n * different value types for the `page` parameter:\n *\n * | Type | Behavior |\n * | ------------------ | ----------------------------------------------------------------------------------- |\n * | `undefined` | Create a new page and add it to the end of this document |\n * | `[number, number]` | Create a new page with the given dimensions and add it to the end of this document |\n * | `PDFPage` | Add the existing page to the end of this document |\n *\n * For example:\n * ```js\n * // page=undefined\n * const newPage = pdfDoc.addPage()\n *\n * // page=[number, number]\n * import { PageSizes } from 'pdf-lib'\n * const newPage1 = pdfDoc.addPage(PageSizes.A7)\n * const newPage2 = pdfDoc.addPage(PageSizes.Letter)\n * const newPage3 = pdfDoc.addPage([500, 750])\n *\n * // page=PDFPage\n * const pdfDoc1 = await PDFDocument.create()\n * const pdfDoc2 = await PDFDocument.load(...)\n * const [existingPage] = await pdfDoc1.copyPages(pdfDoc2, [0])\n * pdfDoc1.addPage(existingPage)\n * ```\n *\n * @param page Optionally, the desired dimensions or existing page.\n * @returns The newly created (or existing) page.\n */\n PDFDocument.prototype.addPage = function (page) {\n assertIs(page, 'page', ['undefined', [PDFPage, 'PDFPage'], Array]);\n return this.insertPage(this.getPageCount(), page);\n };\n /**\n * Insert a page at a given index within this document. This method accepts\n * three different value types for the `page` parameter:\n *\n * | Type | Behavior |\n * | ------------------ | ------------------------------------------------------------------------------ |\n * | `undefined` | Create a new page and insert it into this document |\n * | `[number, number]` | Create a new page with the given dimensions and insert it into this document |\n * | `PDFPage` | Insert the existing page into this document |\n *\n * For example:\n * ```js\n * // page=undefined\n * const newPage = pdfDoc.insertPage(2)\n *\n * // page=[number, number]\n * import { PageSizes } from 'pdf-lib'\n * const newPage1 = pdfDoc.insertPage(2, PageSizes.A7)\n * const newPage2 = pdfDoc.insertPage(0, PageSizes.Letter)\n * const newPage3 = pdfDoc.insertPage(198, [500, 750])\n *\n * // page=PDFPage\n * const pdfDoc1 = await PDFDocument.create()\n * const pdfDoc2 = await PDFDocument.load(...)\n * const [existingPage] = await pdfDoc1.copyPages(pdfDoc2, [0])\n * pdfDoc1.insertPage(0, existingPage)\n * ```\n *\n * @param index The index at which the page should be inserted (zero-based).\n * @param page Optionally, the desired dimensions or existing page.\n * @returns The newly created (or existing) page.\n */\n PDFDocument.prototype.insertPage = function (index, page) {\n var pageCount = this.getPageCount();\n assertRange(index, 'index', 0, pageCount);\n assertIs(page, 'page', ['undefined', [PDFPage, 'PDFPage'], Array]);\n if (!page || Array.isArray(page)) {\n var dims = Array.isArray(page) ? page : PageSizes.A4;\n page = PDFPage.create(this);\n page.setSize.apply(page, dims);\n }\n else if (page.doc !== this) {\n throw new ForeignPageError();\n }\n var parentRef = this.catalog.insertLeafNode(page.ref, index);\n page.node.setParent(parentRef);\n this.pageMap.set(page.node, page);\n this.pageCache.invalidate();\n this.pageCount = pageCount + 1;\n return page;\n };\n /**\n * Copy pages from a source document into this document. Allows pages to be\n * copied between different [[PDFDocument]] instances. For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n * const srcDoc = await PDFDocument.load(...)\n *\n * const copiedPages = await pdfDoc.copyPages(srcDoc, [0, 3, 89])\n * const [firstPage, fourthPage, ninetiethPage] = copiedPages;\n *\n * pdfDoc.addPage(fourthPage)\n * pdfDoc.insertPage(0, ninetiethPage)\n * pdfDoc.addPage(firstPage)\n * ```\n * @param srcDoc The document from which pages should be copied.\n * @param indices The indices of the pages that should be copied.\n * @returns Resolves with an array of pages copied into this document.\n */\n PDFDocument.prototype.copyPages = function (srcDoc, indices) {\n return __awaiter(this, void 0, void 0, function () {\n var copier, srcPages, copiedPages, idx, len, srcPage, copiedPage, ref;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(srcDoc, 'srcDoc', [[PDFDocument, 'PDFDocument']]);\n assertIs(indices, 'indices', [Array]);\n return [4 /*yield*/, srcDoc.flush()];\n case 1:\n _a.sent();\n copier = PDFObjectCopier.for(srcDoc.context, this.context);\n srcPages = srcDoc.getPages();\n copiedPages = new Array(indices.length);\n for (idx = 0, len = indices.length; idx < len; idx++) {\n srcPage = srcPages[indices[idx]];\n copiedPage = copier.copy(srcPage.node);\n ref = this.context.register(copiedPage);\n copiedPages[idx] = PDFPage.of(copiedPage, ref, this);\n }\n return [2 /*return*/, copiedPages];\n }\n });\n });\n };\n /**\n * Add an attachment to this document. Attachments are visible in the\n * \"Attachments\" panel of Adobe Acrobat and some other PDF readers. Any\n * type of file can be added as an attachment. This includes, but is not\n * limited to, `.png`, `.jpg`, `.pdf`, `.csv`, `.docx`, and `.xlsx` files.\n *\n * The input data can be provided in multiple formats:\n *\n * | Type | Contents |\n * | ------------- | -------------------------------------------------------------- |\n * | `string` | A base64 encoded string (or data URI) containing an attachment |\n * | `Uint8Array` | The raw bytes of an attachment |\n * | `ArrayBuffer` | The raw bytes of an attachment |\n *\n * For example:\n * ```js\n * // attachment=string\n * await pdfDoc.attach('/9j/4AAQSkZJRgABAQAAAQABAAD/2wBD...', 'cat_riding_unicorn.jpg', {\n * mimeType: 'image/jpeg',\n * description: 'Cool cat riding a unicorn! 🦄🐈🕶️',\n * creationDate: new Date('2019/12/01'),\n * modificationDate: new Date('2020/04/19'),\n * })\n * await pdfDoc.attach('data:image/jpeg;base64,/9j/4AAQ...', 'cat_riding_unicorn.jpg', {\n * mimeType: 'image/jpeg',\n * description: 'Cool cat riding a unicorn! 🦄🐈🕶️',\n * creationDate: new Date('2019/12/01'),\n * modificationDate: new Date('2020/04/19'),\n * })\n *\n * // attachment=Uint8Array\n * import fs from 'fs'\n * const uint8Array = fs.readFileSync('cat_riding_unicorn.jpg')\n * await pdfDoc.attach(uint8Array, 'cat_riding_unicorn.jpg', {\n * mimeType: 'image/jpeg',\n * description: 'Cool cat riding a unicorn! 🦄🐈🕶️',\n * creationDate: new Date('2019/12/01'),\n * modificationDate: new Date('2020/04/19'),\n * })\n *\n * // attachment=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/cat_riding_unicorn.jpg'\n * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())\n * await pdfDoc.attach(arrayBuffer, 'cat_riding_unicorn.jpg', {\n * mimeType: 'image/jpeg',\n * description: 'Cool cat riding a unicorn! 🦄🐈🕶️',\n * creationDate: new Date('2019/12/01'),\n * modificationDate: new Date('2020/04/19'),\n * })\n * ```\n *\n * @param attachment The input data containing the file to be attached.\n * @param name The name of the file to be attached.\n * @returns Resolves when the attachment is complete.\n */\n PDFDocument.prototype.attach = function (attachment, name, options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var bytes, embedder, ref, embeddedFile;\n return __generator(this, function (_a) {\n assertIs(attachment, 'attachment', ['string', Uint8Array, ArrayBuffer]);\n assertIs(name, 'name', ['string']);\n assertOrUndefined(options.mimeType, 'mimeType', ['string']);\n assertOrUndefined(options.description, 'description', ['string']);\n assertOrUndefined(options.creationDate, 'options.creationDate', [Date]);\n assertOrUndefined(options.modificationDate, 'options.modificationDate', [\n Date,\n ]);\n bytes = toUint8Array(attachment);\n embedder = FileEmbedder.for(bytes, name, options);\n ref = this.context.nextRef();\n embeddedFile = PDFEmbeddedFile.of(ref, this, embedder);\n this.embeddedFiles.push(embeddedFile);\n return [2 /*return*/];\n });\n });\n };\n /**\n * Embed a font into this document. The input data can be provided in multiple\n * formats:\n *\n * | Type | Contents |\n * | --------------- | ------------------------------------------------------- |\n * | `StandardFonts` | One of the standard 14 fonts |\n * | `string` | A base64 encoded string (or data URI) containing a font |\n * | `Uint8Array` | The raw bytes of a font |\n * | `ArrayBuffer` | The raw bytes of a font |\n *\n * For example:\n * ```js\n * // font=StandardFonts\n * import { StandardFonts } from 'pdf-lib'\n * const font1 = await pdfDoc.embedFont(StandardFonts.Helvetica)\n *\n * // font=string\n * const font2 = await pdfDoc.embedFont('AAEAAAAVAQAABABQRFNJRx/upe...')\n * const font3 = await pdfDoc.embedFont('data:font/opentype;base64,AAEAAA...')\n *\n * // font=Uint8Array\n * import fs from 'fs'\n * const font4 = await pdfDoc.embedFont(fs.readFileSync('Ubuntu-R.ttf'))\n *\n * // font=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/ubuntu/Ubuntu-R.ttf'\n * const ubuntuBytes = await fetch(url).then(res => res.arrayBuffer())\n * const font5 = await pdfDoc.embedFont(ubuntuBytes)\n * ```\n * See also: [[registerFontkit]]\n * @param font The input data for a font.\n * @param options The options to be used when embedding the font.\n * @returns Resolves with the embedded font.\n */\n PDFDocument.prototype.embedFont = function (font, options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, subset, customName, embedder, bytes, fontkit, _b, ref, pdfFont;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _a = options.subset, subset = _a === void 0 ? false : _a, customName = options.customName;\n assertIs(font, 'font', ['string', Uint8Array, ArrayBuffer]);\n assertIs(subset, 'subset', ['boolean']);\n if (!isStandardFont(font)) return [3 /*break*/, 1];\n embedder = StandardFontEmbedder.for(font, customName);\n return [3 /*break*/, 7];\n case 1:\n if (!canBeConvertedToUint8Array(font)) return [3 /*break*/, 6];\n bytes = toUint8Array(font);\n fontkit = this.assertFontkit();\n if (!subset) return [3 /*break*/, 3];\n return [4 /*yield*/, CustomFontSubsetEmbedder.for(fontkit, bytes, customName)];\n case 2:\n _b = _c.sent();\n return [3 /*break*/, 5];\n case 3: return [4 /*yield*/, CustomFontEmbedder.for(fontkit, bytes, customName)];\n case 4:\n _b = _c.sent();\n _c.label = 5;\n case 5:\n embedder = _b;\n return [3 /*break*/, 7];\n case 6: throw new TypeError('`font` must be one of `StandardFonts | string | Uint8Array | ArrayBuffer`');\n case 7:\n ref = this.context.nextRef();\n pdfFont = PDFFont.of(ref, this, embedder);\n this.fonts.push(pdfFont);\n return [2 /*return*/, pdfFont];\n }\n });\n });\n };\n /**\n * Embed a standard font into this document.\n * For example:\n * ```js\n * import { StandardFonts } from 'pdf-lib'\n * const helveticaFont = pdfDoc.embedFont(StandardFonts.Helvetica)\n * ```\n * @param font The standard font to be embedded.\n * @param customName The name to be used when embedding the font.\n * @returns The embedded font.\n */\n PDFDocument.prototype.embedStandardFont = function (font, customName) {\n assertIs(font, 'font', ['string']);\n if (!isStandardFont(font)) {\n throw new TypeError('`font` must be one of type `StandardFonts`');\n }\n var embedder = StandardFontEmbedder.for(font, customName);\n var ref = this.context.nextRef();\n var pdfFont = PDFFont.of(ref, this, embedder);\n this.fonts.push(pdfFont);\n return pdfFont;\n };\n /**\n * Embed a JPEG image into this document. The input data can be provided in\n * multiple formats:\n *\n * | Type | Contents |\n * | ------------- | ------------------------------------------------------------- |\n * | `string` | A base64 encoded string (or data URI) containing a JPEG image |\n * | `Uint8Array` | The raw bytes of a JPEG image |\n * | `ArrayBuffer` | The raw bytes of a JPEG image |\n *\n * For example:\n * ```js\n * // jpg=string\n * const image1 = await pdfDoc.embedJpg('/9j/4AAQSkZJRgABAQAAAQABAAD/2wBD...')\n * const image2 = await pdfDoc.embedJpg('data:image/jpeg;base64,/9j/4AAQ...')\n *\n * // jpg=Uint8Array\n * import fs from 'fs'\n * const uint8Array = fs.readFileSync('cat_riding_unicorn.jpg')\n * const image3 = await pdfDoc.embedJpg(uint8Array)\n *\n * // jpg=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/cat_riding_unicorn.jpg'\n * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())\n * const image4 = await pdfDoc.embedJpg(arrayBuffer)\n * ```\n *\n * @param jpg The input data for a JPEG image.\n * @returns Resolves with the embedded image.\n */\n PDFDocument.prototype.embedJpg = function (jpg) {\n return __awaiter(this, void 0, void 0, function () {\n var bytes, embedder, ref, pdfImage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(jpg, 'jpg', ['string', Uint8Array, ArrayBuffer]);\n bytes = toUint8Array(jpg);\n return [4 /*yield*/, JpegEmbedder.for(bytes)];\n case 1:\n embedder = _a.sent();\n ref = this.context.nextRef();\n pdfImage = PDFImage.of(ref, this, embedder);\n this.images.push(pdfImage);\n return [2 /*return*/, pdfImage];\n }\n });\n });\n };\n /**\n * Embed a PNG image into this document. The input data can be provided in\n * multiple formats:\n *\n * | Type | Contents |\n * | ------------- | ------------------------------------------------------------ |\n * | `string` | A base64 encoded string (or data URI) containing a PNG image |\n * | `Uint8Array` | The raw bytes of a PNG image |\n * | `ArrayBuffer` | The raw bytes of a PNG image |\n *\n * For example:\n * ```js\n * // png=string\n * const image1 = await pdfDoc.embedPng('iVBORw0KGgoAAAANSUhEUgAAAlgAAAF3...')\n * const image2 = await pdfDoc.embedPng('data:image/png;base64,iVBORw0KGg...')\n *\n * // png=Uint8Array\n * import fs from 'fs'\n * const uint8Array = fs.readFileSync('small_mario.png')\n * const image3 = await pdfDoc.embedPng(uint8Array)\n *\n * // png=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/small_mario.png'\n * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())\n * const image4 = await pdfDoc.embedPng(arrayBuffer)\n * ```\n *\n * @param png The input data for a PNG image.\n * @returns Resolves with the embedded image.\n */\n PDFDocument.prototype.embedPng = function (png) {\n return __awaiter(this, void 0, void 0, function () {\n var bytes, embedder, ref, pdfImage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(png, 'png', ['string', Uint8Array, ArrayBuffer]);\n bytes = toUint8Array(png);\n return [4 /*yield*/, PngEmbedder.for(bytes)];\n case 1:\n embedder = _a.sent();\n ref = this.context.nextRef();\n pdfImage = PDFImage.of(ref, this, embedder);\n this.images.push(pdfImage);\n return [2 /*return*/, pdfImage];\n }\n });\n });\n };\n /**\n * Embed one or more PDF pages into this document.\n *\n * For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourcePdf = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n *\n * // Embed page 74 of `sourcePdf` into `pdfDoc`\n * const [embeddedPage] = await pdfDoc.embedPdf(sourcePdf, [73])\n * ```\n *\n * See [[PDFDocument.load]] for examples of the allowed input data formats.\n *\n * @param pdf The input data containing a PDF document.\n * @param indices The indices of the pages that should be embedded.\n * @returns Resolves with an array of the embedded pages.\n */\n PDFDocument.prototype.embedPdf = function (pdf, indices) {\n if (indices === void 0) { indices = [0]; }\n return __awaiter(this, void 0, void 0, function () {\n var srcDoc, _a, srcPages;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n assertIs(pdf, 'pdf', [\n 'string',\n Uint8Array,\n ArrayBuffer,\n [PDFDocument, 'PDFDocument'],\n ]);\n assertIs(indices, 'indices', [Array]);\n if (!(pdf instanceof PDFDocument)) return [3 /*break*/, 1];\n _a = pdf;\n return [3 /*break*/, 3];\n case 1: return [4 /*yield*/, PDFDocument.load(pdf)];\n case 2:\n _a = _b.sent();\n _b.label = 3;\n case 3:\n srcDoc = _a;\n srcPages = pluckIndices(srcDoc.getPages(), indices);\n return [2 /*return*/, this.embedPages(srcPages)];\n }\n });\n });\n };\n /**\n * Embed a single PDF page into this document.\n *\n * For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourceBuffer = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n * const sourcePdfDoc = await PDFDocument.load(sourceBuffer)\n * const sourcePdfPage = sourcePdfDoc.getPages()[73]\n *\n * const embeddedPage = await pdfDoc.embedPage(\n * sourcePdfPage,\n *\n * // Clip a section of the source page so that we only embed part of it\n * { left: 100, right: 450, bottom: 330, top: 570 },\n *\n * // Translate all drawings of the embedded page by (10, 200) units\n * [1, 0, 0, 1, 10, 200],\n * )\n * ```\n *\n * @param page The page to be embedded.\n * @param boundingBox\n * Optionally, an area of the source page that should be embedded\n * (defaults to entire page).\n * @param transformationMatrix\n * Optionally, a transformation matrix that is always applied to the embedded\n * page anywhere it is drawn.\n * @returns Resolves with the embedded pdf page.\n */\n PDFDocument.prototype.embedPage = function (page, boundingBox, transformationMatrix) {\n return __awaiter(this, void 0, void 0, function () {\n var embeddedPage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n return [4 /*yield*/, this.embedPages([page], [boundingBox], [transformationMatrix])];\n case 1:\n embeddedPage = (_a.sent())[0];\n return [2 /*return*/, embeddedPage];\n }\n });\n });\n };\n /**\n * Embed one or more PDF pages into this document.\n *\n * For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourceBuffer = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n * const sourcePdfDoc = await PDFDocument.load(sourceBuffer)\n *\n * const page1 = sourcePdfDoc.getPages()[0]\n * const page2 = sourcePdfDoc.getPages()[52]\n * const page3 = sourcePdfDoc.getPages()[73]\n *\n * const embeddedPages = await pdfDoc.embedPages([page1, page2, page3])\n * ```\n *\n * @param page\n * The pages to be embedded (they must all share the same context).\n * @param boundingBoxes\n * Optionally, an array of clipping boundaries - one for each page\n * (defaults to entirety of each page).\n * @param transformationMatrices\n * Optionally, an array of transformation matrices - one for each page\n * (each page's transformation will apply anywhere it is drawn).\n * @returns Resolves with an array of the embedded pdf pages.\n */\n PDFDocument.prototype.embedPages = function (pages, boundingBoxes, transformationMatrices) {\n if (boundingBoxes === void 0) { boundingBoxes = []; }\n if (transformationMatrices === void 0) { transformationMatrices = []; }\n return __awaiter(this, void 0, void 0, function () {\n var idx, len, currPage, nextPage, context, maybeCopyPage, embeddedPages, idx, len, page, box, matrix, embedder, ref;\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (pages.length === 0)\n return [2 /*return*/, []];\n // Assert all pages have the same context\n for (idx = 0, len = pages.length - 1; idx < len; idx++) {\n currPage = pages[idx];\n nextPage = pages[idx + 1];\n if (currPage.node.context !== nextPage.node.context) {\n throw new PageEmbeddingMismatchedContextError();\n }\n }\n context = pages[0].node.context;\n maybeCopyPage = context === this.context\n ? function (p) { return p; }\n : PDFObjectCopier.for(context, this.context).copy;\n embeddedPages = new Array(pages.length);\n idx = 0, len = pages.length;\n _b.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n page = maybeCopyPage(pages[idx].node);\n box = boundingBoxes[idx];\n matrix = transformationMatrices[idx];\n return [4 /*yield*/, PDFPageEmbedder.for(page, box, matrix)];\n case 2:\n embedder = _b.sent();\n ref = this.context.nextRef();\n embeddedPages[idx] = PDFEmbeddedPage.of(ref, this, embedder);\n _b.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4:\n (_a = this.embeddedPages).push.apply(_a, embeddedPages);\n return [2 /*return*/, embeddedPages];\n }\n });\n });\n };\n /**\n * > **NOTE:** You shouldn't need to call this method directly. The [[save]]\n * > and [[saveAsBase64]] methods will automatically ensure that all embedded\n * > assets are flushed before serializing the document.\n *\n * Flush all embedded fonts, PDF pages, and images to this document's\n * [[context]].\n *\n * @returns Resolves when the flush is complete.\n */\n PDFDocument.prototype.flush = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.embedAll(this.fonts)];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.embedAll(this.images)];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.embedAll(this.embeddedPages)];\n case 3:\n _a.sent();\n return [4 /*yield*/, this.embedAll(this.embeddedFiles)];\n case 4:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Serialize this document to an array of bytes making up a PDF file.\n * For example:\n * ```js\n * const pdfBytes = await pdfDoc.save()\n * ```\n *\n * There are a number of things you can do with the serialized document,\n * depending on the JavaScript environment you're running in:\n * * Write it to a file in Node or React Native\n * * Download it as a Blob in the browser\n * * Render it in an `iframe`\n *\n * @param options The options to be used when saving the document.\n * @returns Resolves with the bytes of the serialized document.\n */\n PDFDocument.prototype.save = function (options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, useObjectStreams, _b, addDefaultPage, _c, objectsPerTick, _d, updateFieldAppearances, form, Writer;\n return __generator(this, function (_e) {\n switch (_e.label) {\n case 0:\n _a = options.useObjectStreams, useObjectStreams = _a === void 0 ? true : _a, _b = options.addDefaultPage, addDefaultPage = _b === void 0 ? true : _b, _c = options.objectsPerTick, objectsPerTick = _c === void 0 ? 50 : _c, _d = options.updateFieldAppearances, updateFieldAppearances = _d === void 0 ? true : _d;\n assertIs(useObjectStreams, 'useObjectStreams', ['boolean']);\n assertIs(addDefaultPage, 'addDefaultPage', ['boolean']);\n assertIs(objectsPerTick, 'objectsPerTick', ['number']);\n assertIs(updateFieldAppearances, 'updateFieldAppearances', ['boolean']);\n if (addDefaultPage && this.getPageCount() === 0)\n this.addPage();\n if (updateFieldAppearances) {\n form = this.formCache.getValue();\n if (form)\n form.updateFieldAppearances();\n }\n return [4 /*yield*/, this.flush()];\n case 1:\n _e.sent();\n Writer = useObjectStreams ? PDFStreamWriter : PDFWriter;\n return [2 /*return*/, Writer.forContext(this.context, objectsPerTick).serializeToBuffer()];\n }\n });\n });\n };\n /**\n * Serialize this document to a base64 encoded string or data URI making up a\n * PDF file. For example:\n * ```js\n * const base64String = await pdfDoc.saveAsBase64()\n * base64String // => 'JVBERi0xLjcKJYGBgYEKC...'\n *\n * const base64DataUri = await pdfDoc.saveAsBase64({ dataUri: true })\n * base64DataUri // => 'data:application/pdf;base64,JVBERi0xLjcKJYGBgYEKC...'\n * ```\n *\n * @param options The options to be used when saving the document.\n * @returns Resolves with a base64 encoded string or data URI of the\n * serialized document.\n */\n PDFDocument.prototype.saveAsBase64 = function (options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, dataUri, otherOptions, bytes, base64;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = options.dataUri, dataUri = _a === void 0 ? false : _a, otherOptions = __rest(options, [\"dataUri\"]);\n assertIs(dataUri, 'dataUri', ['boolean']);\n return [4 /*yield*/, this.save(otherOptions)];\n case 1:\n bytes = _b.sent();\n base64 = encodeToBase64(bytes);\n return [2 /*return*/, dataUri ? \"data:application/pdf;base64,\" + base64 : base64];\n }\n });\n });\n };\n PDFDocument.prototype.embedAll = function (embeddables) {\n return __awaiter(this, void 0, void 0, function () {\n var idx, len;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n idx = 0, len = embeddables.length;\n _a.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n return [4 /*yield*/, embeddables[idx].embed()];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n PDFDocument.prototype.updateInfoDict = function () {\n var pdfLib = \"pdf-lib (https://github.com/Hopding/pdf-lib)\";\n var now = new Date();\n var info = this.getInfoDict();\n this.setProducer(pdfLib);\n this.setModificationDate(now);\n if (!info.get(PDFName.of('Creator')))\n this.setCreator(pdfLib);\n if (!info.get(PDFName.of('CreationDate')))\n this.setCreationDate(now);\n };\n PDFDocument.prototype.getInfoDict = function () {\n var existingInfo = this.context.lookup(this.context.trailerInfo.Info);\n if (existingInfo instanceof PDFDict)\n return existingInfo;\n var newInfo = this.context.obj({});\n this.context.trailerInfo.Info = this.context.register(newInfo);\n return newInfo;\n };\n PDFDocument.prototype.assertFontkit = function () {\n if (!this.fontkit)\n throw new FontkitNotRegisteredError();\n return this.fontkit;\n };\n return PDFDocument;\n}());\nexport default PDFDocument;\n/* tslint:disable-next-line only-arrow-functions */\nfunction assertIsLiteralOrHexString(pdfObject) {\n if (!(pdfObject instanceof PDFHexString) &&\n !(pdfObject instanceof PDFString)) {\n throw new UnexpectedObjectTypeError([PDFHexString, PDFString], pdfObject);\n }\n}\n//# sourceMappingURL=PDFDocument.js.map","import { __assign } from \"tslib\";\nimport { rgb } from \"./colors\";\nimport { drawImage, drawLine, drawLinesOfText, drawPage, drawRectangle, drawSvgPath, drawEllipse, } from \"./operations\";\nimport { popGraphicsState, pushGraphicsState, translate, LineCapStyle, } from \"./operators\";\nimport PDFDocument from \"./PDFDocument\";\nimport PDFEmbeddedPage from \"./PDFEmbeddedPage\";\nimport PDFFont from \"./PDFFont\";\nimport PDFImage from \"./PDFImage\";\nimport { BlendMode, } from \"./PDFPageOptions\";\nimport { degrees, toDegrees } from \"./rotations\";\nimport { StandardFonts } from \"./StandardFonts\";\nimport { PDFContentStream, PDFName, PDFOperator, PDFPageLeaf, PDFRef, } from \"../core\";\nimport { addRandomSuffix, assertEachIs, assertIs, assertMultiple, assertOrUndefined, breakTextIntoLines, cleanText, rectanglesAreEqual, lineSplit, assertRangeOrUndefined, assertIsOneOfOrUndefined, } from \"../utils\";\n/**\n * Represents a single page of a [[PDFDocument]].\n */\nvar PDFPage = /** @class */ (function () {\n function PDFPage(leafNode, ref, doc) {\n this.fontSize = 24;\n this.fontColor = rgb(0, 0, 0);\n this.lineHeight = 24;\n this.x = 0;\n this.y = 0;\n assertIs(leafNode, 'leafNode', [[PDFPageLeaf, 'PDFPageLeaf']]);\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n this.node = leafNode;\n this.ref = ref;\n this.doc = doc;\n }\n /**\n * Rotate this page by a multiple of 90 degrees. For example:\n * ```js\n * import { degrees } from 'pdf-lib'\n *\n * page.setRotation(degrees(-90))\n * page.setRotation(degrees(0))\n * page.setRotation(degrees(90))\n * page.setRotation(degrees(180))\n * page.setRotation(degrees(270))\n * ```\n * @param angle The angle to rotate this page.\n */\n PDFPage.prototype.setRotation = function (angle) {\n var degreesAngle = toDegrees(angle);\n assertMultiple(degreesAngle, 'degreesAngle', 90);\n this.node.set(PDFName.of('Rotate'), this.doc.context.obj(degreesAngle));\n };\n /**\n * Get this page's rotation angle in degrees. For example:\n * ```js\n * const rotationAngle = page.getRotation().angle;\n * ```\n * @returns The rotation angle of the page in degrees (always a multiple of\n * 90 degrees).\n */\n PDFPage.prototype.getRotation = function () {\n var Rotate = this.node.Rotate();\n return degrees(Rotate ? Rotate.asNumber() : 0);\n };\n /**\n * Resize this page by increasing or decreasing its width and height. For\n * example:\n * ```js\n * page.setSize(250, 500)\n * page.setSize(page.getWidth() + 50, page.getHeight() + 100)\n * page.setSize(page.getWidth() - 50, page.getHeight() - 100)\n * ```\n *\n * Note that the PDF specification does not allow for pages to have explicit\n * widths and heights. Instead it defines the \"size\" of a page in terms of\n * five rectangles: the MediaBox, CropBox, BleedBox, TrimBox, and ArtBox. As a\n * result, this method cannot directly change the width and height of a page.\n * Instead, it works by adjusting these five boxes.\n *\n * This method performs the following steps:\n * 1. Set width & height of MediaBox.\n * 2. Set width & height of CropBox, if it has same dimensions as MediaBox.\n * 3. Set width & height of BleedBox, if it has same dimensions as MediaBox.\n * 4. Set width & height of TrimBox, if it has same dimensions as MediaBox.\n * 5. Set width & height of ArtBox, if it has same dimensions as MediaBox.\n *\n * This approach works well for most PDF documents as all PDF pages must\n * have a MediaBox, but relatively few have a CropBox, BleedBox, TrimBox, or\n * ArtBox. And when they do have these additional boxes, they often have the\n * same dimensions as the MediaBox. However, if you find this method does not\n * work for your document, consider setting the boxes directly:\n * * [[PDFPage.setMediaBox]]\n * * [[PDFPage.setCropBox]]\n * * [[PDFPage.setBleedBox]]\n * * [[PDFPage.setTrimBox]]\n * * [[PDFPage.setArtBox]]\n *\n * @param width The new width of the page.\n * @param height The new height of the page.\n */\n PDFPage.prototype.setSize = function (width, height) {\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var mediaBox = this.getMediaBox();\n this.setMediaBox(mediaBox.x, mediaBox.y, width, height);\n var cropBox = this.getCropBox();\n var bleedBox = this.getBleedBox();\n var trimBox = this.getTrimBox();\n var artBox = this.getArtBox();\n var hasCropBox = this.node.CropBox();\n var hasBleedBox = this.node.BleedBox();\n var hasTrimBox = this.node.TrimBox();\n var hasArtBox = this.node.ArtBox();\n if (hasCropBox && rectanglesAreEqual(cropBox, mediaBox)) {\n this.setCropBox(mediaBox.x, mediaBox.y, width, height);\n }\n if (hasBleedBox && rectanglesAreEqual(bleedBox, mediaBox)) {\n this.setBleedBox(mediaBox.x, mediaBox.y, width, height);\n }\n if (hasTrimBox && rectanglesAreEqual(trimBox, mediaBox)) {\n this.setTrimBox(mediaBox.x, mediaBox.y, width, height);\n }\n if (hasArtBox && rectanglesAreEqual(artBox, mediaBox)) {\n this.setArtBox(mediaBox.x, mediaBox.y, width, height);\n }\n };\n /**\n * Resize this page by increasing or decreasing its width. For example:\n * ```js\n * page.setWidth(250)\n * page.setWidth(page.getWidth() + 50)\n * page.setWidth(page.getWidth() - 50)\n * ```\n *\n * This method uses [[PDFPage.setSize]] to set the page's width.\n *\n * @param width The new width of the page.\n */\n PDFPage.prototype.setWidth = function (width) {\n assertIs(width, 'width', ['number']);\n this.setSize(width, this.getSize().height);\n };\n /**\n * Resize this page by increasing or decreasing its height. For example:\n * ```js\n * page.setHeight(500)\n * page.setHeight(page.getWidth() + 100)\n * page.setHeight(page.getWidth() - 100)\n * ```\n *\n * This method uses [[PDFPage.setSize]] to set the page's height.\n *\n * @param height The new height of the page.\n */\n PDFPage.prototype.setHeight = function (height) {\n assertIs(height, 'height', ['number']);\n this.setSize(this.getSize().width, height);\n };\n /**\n * Set the MediaBox of this page. For example:\n * ```js\n * const mediaBox = page.getMediaBox()\n *\n * page.setMediaBox(0, 0, 250, 500)\n * page.setMediaBox(mediaBox.x, mediaBox.y, 50, 100)\n * page.setMediaBox(15, 5, mediaBox.width - 50, mediaBox.height - 100)\n * ```\n *\n * See [[PDFPage.getMediaBox]] for details about what the MediaBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new MediaBox.\n * @param y The y coordinate of the lower left corner of the new MediaBox.\n * @param width The width of the new MediaBox.\n * @param height The height of the new MediaBox.\n */\n PDFPage.prototype.setMediaBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var mediaBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.MediaBox, mediaBox);\n };\n /**\n * Set the CropBox of this page. For example:\n * ```js\n * const cropBox = page.getCropBox()\n *\n * page.setCropBox(0, 0, 250, 500)\n * page.setCropBox(cropBox.x, cropBox.y, 50, 100)\n * page.setCropBox(15, 5, cropBox.width - 50, cropBox.height - 100)\n * ```\n *\n * See [[PDFPage.getCropBox]] for details about what the CropBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new CropBox.\n * @param y The y coordinate of the lower left corner of the new CropBox.\n * @param width The width of the new CropBox.\n * @param height The height of the new CropBox.\n */\n PDFPage.prototype.setCropBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var cropBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.CropBox, cropBox);\n };\n /**\n * Set the BleedBox of this page. For example:\n * ```js\n * const bleedBox = page.getBleedBox()\n *\n * page.setBleedBox(0, 0, 250, 500)\n * page.setBleedBox(bleedBox.x, bleedBox.y, 50, 100)\n * page.setBleedBox(15, 5, bleedBox.width - 50, bleedBox.height - 100)\n * ```\n *\n * See [[PDFPage.getBleedBox]] for details about what the BleedBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new BleedBox.\n * @param y The y coordinate of the lower left corner of the new BleedBox.\n * @param width The width of the new BleedBox.\n * @param height The height of the new BleedBox.\n */\n PDFPage.prototype.setBleedBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var bleedBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.BleedBox, bleedBox);\n };\n /**\n * Set the TrimBox of this page. For example:\n * ```js\n * const trimBox = page.getTrimBox()\n *\n * page.setTrimBox(0, 0, 250, 500)\n * page.setTrimBox(trimBox.x, trimBox.y, 50, 100)\n * page.setTrimBox(15, 5, trimBox.width - 50, trimBox.height - 100)\n * ```\n *\n * See [[PDFPage.getTrimBox]] for details about what the TrimBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new TrimBox.\n * @param y The y coordinate of the lower left corner of the new TrimBox.\n * @param width The width of the new TrimBox.\n * @param height The height of the new TrimBox.\n */\n PDFPage.prototype.setTrimBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var trimBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.TrimBox, trimBox);\n };\n /**\n * Set the ArtBox of this page. For example:\n * ```js\n * const artBox = page.getArtBox()\n *\n * page.setArtBox(0, 0, 250, 500)\n * page.setArtBox(artBox.x, artBox.y, 50, 100)\n * page.setArtBox(15, 5, artBox.width - 50, artBox.height - 100)\n * ```\n *\n * See [[PDFPage.getArtBox]] for details about what the ArtBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new ArtBox.\n * @param y The y coordinate of the lower left corner of the new ArtBox.\n * @param width The width of the new ArtBox.\n * @param height The height of the new ArtBox.\n */\n PDFPage.prototype.setArtBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var artBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.ArtBox, artBox);\n };\n /**\n * Get this page's width and height. For example:\n * ```js\n * const { width, height } = page.getSize()\n * ```\n *\n * This method uses [[PDFPage.getMediaBox]] to obtain the page's\n * width and height.\n *\n * @returns The width and height of the page.\n */\n PDFPage.prototype.getSize = function () {\n var _a = this.getMediaBox(), width = _a.width, height = _a.height;\n return { width: width, height: height };\n };\n /**\n * Get this page's width. For example:\n * ```js\n * const width = page.getWidth()\n * ```\n *\n * This method uses [[PDFPage.getSize]] to obtain the page's size.\n *\n * @returns The width of the page.\n */\n PDFPage.prototype.getWidth = function () {\n return this.getSize().width;\n };\n /**\n * Get this page's height. For example:\n * ```js\n * const height = page.getHeight()\n * ```\n *\n * This method uses [[PDFPage.getSize]] to obtain the page's size.\n *\n * @returns The height of the page.\n */\n PDFPage.prototype.getHeight = function () {\n return this.getSize().height;\n };\n /**\n * Get the rectangle defining this page's MediaBox. For example:\n * ```js\n * const { x, y, width, height } = page.getMediaBox()\n * ```\n *\n * The MediaBox of a page defines the boundaries of the physical medium on\n * which the page is to be displayed/printed. It may include extended area\n * surrounding the page content for bleed marks, printing marks, etc...\n * It may also include areas close to the edges of the medium that cannot be\n * marked because of physical limitations of the output device. Content\n * falling outside this boundary may safely be discarded without affecting\n * the meaning of the PDF file.\n *\n * @returns An object defining the lower left corner of the MediaBox and its\n * width & height.\n */\n PDFPage.prototype.getMediaBox = function () {\n var mediaBox = this.node.MediaBox();\n return mediaBox.asRectangle();\n };\n /**\n * Get the rectangle defining this page's CropBox. For example:\n * ```js\n * const { x, y, width, height } = page.getCropBox()\n * ```\n *\n * The CropBox of a page defines the region to which the contents of the page\n * shall be clipped when displayed or printed. Unlike the other boxes, the\n * CropBox does not necessarily represent the physical page geometry. It\n * merely imposes clipping on the page contents.\n *\n * The CropBox's default value is the page's MediaBox.\n *\n * @returns An object defining the lower left corner of the CropBox and its\n * width & height.\n */\n PDFPage.prototype.getCropBox = function () {\n var _a;\n var cropBox = this.node.CropBox();\n return (_a = cropBox === null || cropBox === void 0 ? void 0 : cropBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getMediaBox();\n };\n /**\n * Get the rectangle defining this page's BleedBox. For example:\n * ```js\n * const { x, y, width, height } = page.getBleedBox()\n * ```\n *\n * The BleedBox of a page defines the region to which the contents of the\n * page shall be clipped when output in a production environment. This may\n * include any extra bleed area needed to accommodate the physical\n * limitations of cutting, folding, and trimming equipment. The actual\n * printed page may include printing marks that fall outside the BleedBox.\n *\n * The BleedBox's default value is the page's CropBox.\n *\n * @returns An object defining the lower left corner of the BleedBox and its\n * width & height.\n */\n PDFPage.prototype.getBleedBox = function () {\n var _a;\n var bleedBox = this.node.BleedBox();\n return (_a = bleedBox === null || bleedBox === void 0 ? void 0 : bleedBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();\n };\n /**\n * Get the rectangle defining this page's TrimBox. For example:\n * ```js\n * const { x, y, width, height } = page.getTrimBox()\n * ```\n *\n * The TrimBox of a page defines the intended dimensions of the finished\n * page after trimming. It may be smaller than the MediaBox to allow for\n * production-related content, such as printing instructions, cut marks, or\n * color bars.\n *\n * The TrimBox's default value is the page's CropBox.\n *\n * @returns An object defining the lower left corner of the TrimBox and its\n * width & height.\n */\n PDFPage.prototype.getTrimBox = function () {\n var _a;\n var trimBox = this.node.TrimBox();\n return (_a = trimBox === null || trimBox === void 0 ? void 0 : trimBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();\n };\n /**\n * Get the rectangle defining this page's ArtBox. For example:\n * ```js\n * const { x, y, width, height } = page.getArtBox()\n * ```\n *\n * The ArtBox of a page defines the extent of the page's meaningful content\n * (including potential white space).\n *\n * The ArtBox's default value is the page's CropBox.\n *\n * @returns An object defining the lower left corner of the ArtBox and its\n * width & height.\n */\n PDFPage.prototype.getArtBox = function () {\n var _a;\n var artBox = this.node.ArtBox();\n return (_a = artBox === null || artBox === void 0 ? void 0 : artBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();\n };\n /**\n * Translate this page's content to a new location on the page. This operation\n * is often useful after resizing the page with [[setSize]]. For example:\n * ```js\n * // Add 50 units of whitespace to the top and right of the page\n * page.setSize(page.getWidth() + 50, page.getHeight() + 50)\n *\n * // Move the page's content from the lower-left corner of the page\n * // to the top-right corner.\n * page.translateContent(50, 50)\n *\n * // Now there are 50 units of whitespace to the left and bottom of the page\n * ```\n * See also: [[resetPosition]]\n * @param x The new position on the x-axis for this page's content.\n * @param y The new position on the y-axis for this page's content.\n */\n PDFPage.prototype.translateContent = function (x, y) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n this.node.normalize();\n this.getContentStream();\n var start = this.createContentStream(pushGraphicsState(), translate(x, y));\n var startRef = this.doc.context.register(start);\n var end = this.createContentStream(popGraphicsState());\n var endRef = this.doc.context.register(end);\n this.node.wrapContentStreams(startRef, endRef);\n };\n /**\n * Reset the x and y coordinates of this page to `(0, 0)`. This operation is\n * often useful after calling [[translateContent]]. For example:\n * ```js\n * // Shift the page's contents up and to the right by 50 units\n * page.translateContent(50, 50)\n *\n * // This text will shifted - it will be drawn at (50, 50)\n * page.drawText('I am shifted')\n *\n * // Move back to (0, 0)\n * page.resetPosition()\n *\n * // This text will not be shifted - it will be drawn at (0, 0)\n * page.drawText('I am not shifted')\n * ```\n */\n PDFPage.prototype.resetPosition = function () {\n this.getContentStream(false);\n this.x = 0;\n this.y = 0;\n };\n /**\n * Choose a default font for this page. The default font will be used whenever\n * text is drawn on this page and no font is specified. For example:\n * ```js\n * import { StandardFonts } from 'pdf-lib'\n *\n * const timesRomanFont = await pdfDoc.embedFont(StandardFonts.TimesRoman)\n * const helveticaFont = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const courierFont = await pdfDoc.embedFont(StandardFonts.Courier)\n *\n * const page = pdfDoc.addPage()\n *\n * page.setFont(helveticaFont)\n * page.drawText('I will be drawn in Helvetica')\n *\n * page.setFont(timesRomanFont)\n * page.drawText('I will be drawn in Courier', { font: courierFont })\n * ```\n * @param font The default font to be used when drawing text on this page.\n */\n PDFPage.prototype.setFont = function (font) {\n // TODO: Reuse image Font name if we've already added this image to Resources.Fonts\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n this.font = font;\n this.fontKey = addRandomSuffix(this.font.name);\n this.node.setFontDictionary(PDFName.of(this.fontKey), this.font.ref);\n };\n /**\n * Choose a default font size for this page. The default font size will be\n * used whenever text is drawn on this page and no font size is specified.\n * For example:\n * ```js\n * page.setFontSize(12)\n * page.drawText('I will be drawn in size 12')\n *\n * page.setFontSize(36)\n * page.drawText('I will be drawn in size 24', { fontSize: 24 })\n * ```\n * @param fontSize The default font size to be used when drawing text on this\n * page.\n */\n PDFPage.prototype.setFontSize = function (fontSize) {\n assertIs(fontSize, 'fontSize', ['number']);\n this.fontSize = fontSize;\n };\n /**\n * Choose a default font color for this page. The default font color will be\n * used whenever text is drawn on this page and no font color is specified.\n * For example:\n * ```js\n * import { rgb, cmyk, grayscale } from 'pdf-lib'\n *\n * page.setFontColor(rgb(0.97, 0.02, 0.97))\n * page.drawText('I will be drawn in pink')\n *\n * page.setFontColor(cmyk(0.4, 0.7, 0.39, 0.15))\n * page.drawText('I will be drawn in gray', { color: grayscale(0.5) })\n * ```\n * @param fontColor The default font color to be used when drawing text on\n * this page.\n */\n PDFPage.prototype.setFontColor = function (fontColor) {\n assertIs(fontColor, 'fontColor', [[Object, 'Color']]);\n this.fontColor = fontColor;\n };\n /**\n * Choose a default line height for this page. The default line height will be\n * used whenever text is drawn on this page and no line height is specified.\n * For example:\n * ```js\n * page.setLineHeight(12);\n * page.drawText('These lines will be vertically \\n separated by 12 units')\n *\n * page.setLineHeight(36);\n * page.drawText('These lines will be vertically \\n separated by 24 units', {\n * lineHeight: 24\n * })\n * ```\n * @param lineHeight The default line height to be used when drawing text on\n * this page.\n */\n PDFPage.prototype.setLineHeight = function (lineHeight) {\n assertIs(lineHeight, 'lineHeight', ['number']);\n this.lineHeight = lineHeight;\n };\n /**\n * Get the default position of this page. For example:\n * ```js\n * const { x, y } = page.getPosition()\n * ```\n * @returns The default position of the page.\n */\n PDFPage.prototype.getPosition = function () {\n return { x: this.x, y: this.y };\n };\n /**\n * Get the default x coordinate of this page. For example:\n * ```js\n * const x = page.getX()\n * ```\n * @returns The default x coordinate of the page.\n */\n PDFPage.prototype.getX = function () {\n return this.x;\n };\n /**\n * Get the default y coordinate of this page. For example:\n * ```js\n * const y = page.getY()\n * ```\n * @returns The default y coordinate of the page.\n */\n PDFPage.prototype.getY = function () {\n return this.y;\n };\n /**\n * Change the default position of this page. For example:\n * ```js\n * page.moveTo(0, 0)\n * page.drawText('I will be drawn at the origin')\n *\n * page.moveTo(0, 25)\n * page.drawText('I will be drawn 25 units up')\n *\n * page.moveTo(25, 25)\n * page.drawText('I will be drawn 25 units up and 25 units to the right')\n * ```\n * @param x The new default position on the x-axis for this page.\n * @param y The new default position on the y-axis for this page.\n */\n PDFPage.prototype.moveTo = function (x, y) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n this.x = x;\n this.y = y;\n };\n /**\n * Change the default position of this page to be further down the y-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveDown(10)\n * page.drawText('I will be drawn at (50, 40)')\n * ```\n * @param yDecrease The amount by which the page's default position along the\n * y-axis should be decreased.\n */\n PDFPage.prototype.moveDown = function (yDecrease) {\n assertIs(yDecrease, 'yDecrease', ['number']);\n this.y -= yDecrease;\n };\n /**\n * Change the default position of this page to be further up the y-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveUp(10)\n * page.drawText('I will be drawn at (50, 60)')\n * ```\n * @param yIncrease The amount by which the page's default position along the\n * y-axis should be increased.\n */\n PDFPage.prototype.moveUp = function (yIncrease) {\n assertIs(yIncrease, 'yIncrease', ['number']);\n this.y += yIncrease;\n };\n /**\n * Change the default position of this page to be further left on the x-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveLeft(10)\n * page.drawText('I will be drawn at (40, 50)')\n * ```\n * @param xDecrease The amount by which the page's default position along the\n * x-axis should be decreased.\n */\n PDFPage.prototype.moveLeft = function (xDecrease) {\n assertIs(xDecrease, 'xDecrease', ['number']);\n this.x -= xDecrease;\n };\n /**\n * Change the default position of this page to be further right on the y-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveRight(10)\n * page.drawText('I will be drawn at (60, 50)')\n * ```\n * @param xIncrease The amount by which the page's default position along the\n * x-axis should be increased.\n */\n PDFPage.prototype.moveRight = function (xIncrease) {\n assertIs(xIncrease, 'xIncrease', ['number']);\n this.x += xIncrease;\n };\n /**\n * Push one or more operators to the end of this page's current content\n * stream. For example:\n * ```js\n * import {\n * pushGraphicsState,\n * moveTo,\n * lineTo,\n * closePath,\n * setFillingColor,\n * rgb,\n * fill,\n * popGraphicsState,\n * } from 'pdf-lib'\n *\n * // Draw a green triangle in the lower-left corner of the page\n * page.pushOperators(\n * pushGraphicsState(),\n * moveTo(0, 0),\n * lineTo(100, 0),\n * lineTo(50, 100),\n * closePath(),\n * setFillingColor(rgb(0.0, 1.0, 0.0)),\n * fill(),\n * popGraphicsState(),\n * )\n * ```\n * @param operator The operators to be pushed.\n */\n PDFPage.prototype.pushOperators = function () {\n var operator = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operator[_i] = arguments[_i];\n }\n assertEachIs(operator, 'operator', [[PDFOperator, 'PDFOperator']]);\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, operator);\n };\n /**\n * Draw one or more lines of text on this page. For example:\n * ```js\n * import { StandardFonts, rgb } from 'pdf-lib'\n *\n * const helveticaFont = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const timesRomanFont = await pdfDoc.embedFont(StandardFonts.TimesRoman)\n *\n * const page = pdfDoc.addPage()\n *\n * page.setFont(helveticaFont)\n *\n * page.moveTo(5, 200)\n * page.drawText('The Life of an Egg', { size: 36 })\n *\n * page.moveDown(36)\n * page.drawText('An Epic Tale of Woe', { size: 30 })\n *\n * page.drawText(\n * `Humpty Dumpty sat on a wall \\n` +\n * `Humpty Dumpty had a great fall; \\n` +\n * `All the king's horses and all the king's men \\n` +\n * `Couldn't put Humpty together again. \\n`,\n * {\n * x: 25,\n * y: 100,\n * font: timesRomanFont,\n * size: 24,\n * color: rgb(1, 0, 0),\n * lineHeight: 24,\n * opacity: 0.75,\n * },\n * )\n * ```\n * @param text The text to be drawn.\n * @param options The options to be used when drawing the text.\n */\n PDFPage.prototype.drawText = function (text, options) {\n var _a, _b, _c, _d, _e, _f, _g;\n if (options === void 0) { options = {}; }\n assertIs(text, 'text', ['string']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertOrUndefined(options.font, 'options.font', [[PDFFont, 'PDFFont']]);\n assertOrUndefined(options.size, 'options.size', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.lineHeight, 'options.lineHeight', ['number']);\n assertOrUndefined(options.maxWidth, 'options.maxWidth', ['number']);\n assertOrUndefined(options.wordBreaks, 'options.wordBreaks', [Array]);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var originalFont = this.getFont()[0];\n if (options.font)\n this.setFont(options.font);\n var _h = this.getFont(), font = _h[0], fontKey = _h[1];\n var fontSize = options.size || this.fontSize;\n var wordBreaks = options.wordBreaks || this.doc.defaultWordBreaks;\n var textWidth = function (t) { return font.widthOfTextAtSize(t, fontSize); };\n var lines = options.maxWidth === undefined\n ? lineSplit(cleanText(text))\n : breakTextIntoLines(text, wordBreaks, options.maxWidth, textWidth);\n var encodedLines = new Array(lines.length);\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n encodedLines[idx] = font.encodeText(lines[idx]);\n }\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n blendMode: options.blendMode,\n });\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawLinesOfText(encodedLines, {\n color: (_a = options.color) !== null && _a !== void 0 ? _a : this.fontColor,\n font: fontKey,\n size: fontSize,\n rotate: (_b = options.rotate) !== null && _b !== void 0 ? _b : degrees(0),\n xSkew: (_c = options.xSkew) !== null && _c !== void 0 ? _c : degrees(0),\n ySkew: (_d = options.ySkew) !== null && _d !== void 0 ? _d : degrees(0),\n x: (_e = options.x) !== null && _e !== void 0 ? _e : this.x,\n y: (_f = options.y) !== null && _f !== void 0 ? _f : this.y,\n lineHeight: (_g = options.lineHeight) !== null && _g !== void 0 ? _g : this.lineHeight,\n graphicsState: graphicsStateKey,\n }));\n if (options.font)\n this.setFont(originalFont);\n };\n /**\n * Draw an image on this page. For example:\n * ```js\n * import { degrees } from 'pdf-lib'\n *\n * const jpgUrl = 'https://pdf-lib.js.org/assets/cat_riding_unicorn.jpg'\n * const jpgImageBytes = await fetch(jpgUrl).then((res) => res.arrayBuffer())\n *\n * const jpgImage = await pdfDoc.embedJpg(jpgImageBytes)\n * const jpgDims = jpgImage.scale(0.5)\n *\n * const page = pdfDoc.addPage()\n *\n * page.drawImage(jpgImage, {\n * x: 25,\n * y: 25,\n * width: jpgDims.width,\n * height: jpgDims.height,\n * rotate: degrees(30),\n * opacity: 0.75,\n * })\n * ```\n * @param image The image to be drawn.\n * @param options The options to be used when drawing the image.\n */\n PDFPage.prototype.drawImage = function (image, options) {\n var _a, _b, _c, _d, _e, _f, _g;\n if (options === void 0) { options = {}; }\n // TODO: Reuse image XObject name if we've already added this image to Resources.XObjects\n assertIs(image, 'image', [[PDFImage, 'PDFImage']]);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.width, 'options.width', ['number']);\n assertOrUndefined(options.height, 'options.height', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var xObjectKey = addRandomSuffix('Image', 10);\n this.node.setXObject(PDFName.of(xObjectKey), image.ref);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n blendMode: options.blendMode,\n });\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawImage(xObjectKey, {\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : image.size().width,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : image.size().height,\n rotate: (_e = options.rotate) !== null && _e !== void 0 ? _e : degrees(0),\n xSkew: (_f = options.xSkew) !== null && _f !== void 0 ? _f : degrees(0),\n ySkew: (_g = options.ySkew) !== null && _g !== void 0 ? _g : degrees(0),\n graphicsState: graphicsStateKey,\n }));\n };\n /**\n * Draw an embedded PDF page on this page. For example:\n * ```js\n * import { degrees } from 'pdf-lib'\n *\n * const pdfDoc = await PDFDocument.create()\n * const page = pdfDoc.addPage()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourcePdf = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n *\n * // Embed page 74 from the PDF\n * const [embeddedPage] = await pdfDoc.embedPdf(sourcePdf, 73)\n *\n * page.drawPage(embeddedPage, {\n * x: 250,\n * y: 200,\n * xScale: 0.5,\n * yScale: 0.5,\n * rotate: degrees(30),\n * opacity: 0.75,\n * })\n * ```\n *\n * The `options` argument accepts both `width`/`height` and `xScale`/`yScale`\n * as options. Since each of these options defines the size of the drawn page,\n * if both options are given, `width` and `height` take precedence and the\n * corresponding scale variants are ignored.\n *\n * @param embeddedPage The embedded page to be drawn.\n * @param options The options to be used when drawing the embedded page.\n */\n PDFPage.prototype.drawPage = function (embeddedPage, options) {\n var _a, _b, _c, _d, _e;\n if (options === void 0) { options = {}; }\n // TODO: Reuse embeddedPage XObject name if we've already added this embeddedPage to Resources.XObjects\n assertIs(embeddedPage, 'embeddedPage', [\n [PDFEmbeddedPage, 'PDFEmbeddedPage'],\n ]);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.xScale, 'options.xScale', ['number']);\n assertOrUndefined(options.yScale, 'options.yScale', ['number']);\n assertOrUndefined(options.width, 'options.width', ['number']);\n assertOrUndefined(options.height, 'options.height', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var xObjectKey = addRandomSuffix('EmbeddedPdfPage', 10);\n this.node.setXObject(PDFName.of(xObjectKey), embeddedPage.ref);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n blendMode: options.blendMode,\n });\n // prettier-ignore\n var xScale = (options.width !== undefined ? options.width / embeddedPage.width\n : options.xScale !== undefined ? options.xScale\n : 1);\n // prettier-ignore\n var yScale = (options.height !== undefined ? options.height / embeddedPage.height\n : options.yScale !== undefined ? options.yScale\n : 1);\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawPage(xObjectKey, {\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n xScale: xScale,\n yScale: yScale,\n rotate: (_c = options.rotate) !== null && _c !== void 0 ? _c : degrees(0),\n xSkew: (_d = options.xSkew) !== null && _d !== void 0 ? _d : degrees(0),\n ySkew: (_e = options.ySkew) !== null && _e !== void 0 ? _e : degrees(0),\n graphicsState: graphicsStateKey,\n }));\n };\n /**\n * Draw an SVG path on this page. For example:\n * ```js\n * import { rgb } from 'pdf-lib'\n *\n * const svgPath = 'M 0,20 L 100,160 Q 130,200 150,120 C 190,-40 200,200 300,150 L 400,90'\n *\n * // Draw path as black line\n * page.drawSvgPath(svgPath, { x: 25, y: 75 })\n *\n * // Change border style and opacity\n * page.drawSvgPath(svgPath, {\n * x: 25,\n * y: 275,\n * borderColor: rgb(0.5, 0.5, 0.5),\n * borderWidth: 2,\n * borderOpacity: 0.75,\n * })\n *\n * // Set fill color and opacity\n * page.drawSvgPath(svgPath, {\n * x: 25,\n * y: 475,\n * color: rgb(1.0, 0, 0),\n * opacity: 0.75,\n * })\n *\n * // Draw 50% of original size\n * page.drawSvgPath(svgPath, {\n * x: 25,\n * y: 675,\n * scale: 0.5,\n * })\n * ```\n * @param path The SVG path to be drawn.\n * @param options The options to be used when drawing the SVG path.\n */\n PDFPage.prototype.drawSvgPath = function (path, options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n if (options === void 0) { options = {}; }\n assertIs(path, 'path', ['string']);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.scale, 'options.scale', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.borderWidth, 'options.borderWidth', ['number']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertOrUndefined(options.borderColor, 'options.borderColor', [\n [Object, 'Color'],\n ]);\n assertOrUndefined(options.borderDashArray, 'options.borderDashArray', [\n Array,\n ]);\n assertOrUndefined(options.borderDashPhase, 'options.borderDashPhase', [\n 'number',\n ]);\n assertIsOneOfOrUndefined(options.borderLineCap, 'options.borderLineCap', LineCapStyle);\n assertRangeOrUndefined(options.borderOpacity, 'options.borderOpacity', 0, 1);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n borderOpacity: options.borderOpacity,\n blendMode: options.blendMode,\n });\n if (!('color' in options) && !('borderColor' in options)) {\n options.borderColor = rgb(0, 0, 0);\n }\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawSvgPath(path, {\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n scale: options.scale,\n rotate: (_c = options.rotate) !== null && _c !== void 0 ? _c : degrees(0),\n color: (_d = options.color) !== null && _d !== void 0 ? _d : undefined,\n borderColor: (_e = options.borderColor) !== null && _e !== void 0 ? _e : undefined,\n borderWidth: (_f = options.borderWidth) !== null && _f !== void 0 ? _f : 0,\n borderDashArray: (_g = options.borderDashArray) !== null && _g !== void 0 ? _g : undefined,\n borderDashPhase: (_h = options.borderDashPhase) !== null && _h !== void 0 ? _h : undefined,\n borderLineCap: (_j = options.borderLineCap) !== null && _j !== void 0 ? _j : undefined,\n graphicsState: graphicsStateKey,\n }));\n };\n /**\n * Draw a line on this page. For example:\n * ```js\n * import { rgb } from 'pdf-lib'\n *\n * page.drawLine({\n * start: { x: 25, y: 75 },\n * end: { x: 125, y: 175 },\n * thickness: 2,\n * color: rgb(0.75, 0.2, 0.2),\n * opacity: 0.75,\n * })\n * ```\n * @param options The options to be used when drawing the line.\n */\n PDFPage.prototype.drawLine = function (options) {\n var _a, _b, _c, _d, _e;\n assertIs(options.start, 'options.start', [\n [Object, '{ x: number, y: number }'],\n ]);\n assertIs(options.end, 'options.end', [\n [Object, '{ x: number, y: number }'],\n ]);\n assertIs(options.start.x, 'options.start.x', ['number']);\n assertIs(options.start.y, 'options.start.y', ['number']);\n assertIs(options.end.x, 'options.end.x', ['number']);\n assertIs(options.end.y, 'options.end.y', ['number']);\n assertOrUndefined(options.thickness, 'options.thickness', ['number']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertOrUndefined(options.dashArray, 'options.dashArray', [Array]);\n assertOrUndefined(options.dashPhase, 'options.dashPhase', ['number']);\n assertIsOneOfOrUndefined(options.lineCap, 'options.lineCap', LineCapStyle);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n borderOpacity: options.opacity,\n blendMode: options.blendMode,\n });\n if (!('color' in options)) {\n options.color = rgb(0, 0, 0);\n }\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawLine({\n start: options.start,\n end: options.end,\n thickness: (_a = options.thickness) !== null && _a !== void 0 ? _a : 1,\n color: (_b = options.color) !== null && _b !== void 0 ? _b : undefined,\n dashArray: (_c = options.dashArray) !== null && _c !== void 0 ? _c : undefined,\n dashPhase: (_d = options.dashPhase) !== null && _d !== void 0 ? _d : undefined,\n lineCap: (_e = options.lineCap) !== null && _e !== void 0 ? _e : undefined,\n graphicsState: graphicsStateKey,\n }));\n };\n /**\n * Draw a rectangle on this page. For example:\n * ```js\n * import { degrees, grayscale, rgb } from 'pdf-lib'\n *\n * page.drawRectangle({\n * x: 25,\n * y: 75,\n * width: 250,\n * height: 75,\n * rotate: degrees(-15),\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2),\n * opacity: 0.5,\n * borderOpacity: 0.75,\n * })\n * ```\n * @param options The options to be used when drawing the rectangle.\n */\n PDFPage.prototype.drawRectangle = function (options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;\n if (options === void 0) { options = {}; }\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.width, 'options.width', ['number']);\n assertOrUndefined(options.height, 'options.height', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.borderWidth, 'options.borderWidth', ['number']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertOrUndefined(options.borderColor, 'options.borderColor', [\n [Object, 'Color'],\n ]);\n assertOrUndefined(options.borderDashArray, 'options.borderDashArray', [\n Array,\n ]);\n assertOrUndefined(options.borderDashPhase, 'options.borderDashPhase', [\n 'number',\n ]);\n assertIsOneOfOrUndefined(options.borderLineCap, 'options.borderLineCap', LineCapStyle);\n assertRangeOrUndefined(options.borderOpacity, 'options.borderOpacity', 0, 1);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n borderOpacity: options.borderOpacity,\n blendMode: options.blendMode,\n });\n if (!('color' in options) && !('borderColor' in options)) {\n options.color = rgb(0, 0, 0);\n }\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawRectangle({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : 150,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : 100,\n rotate: (_e = options.rotate) !== null && _e !== void 0 ? _e : degrees(0),\n xSkew: (_f = options.xSkew) !== null && _f !== void 0 ? _f : degrees(0),\n ySkew: (_g = options.ySkew) !== null && _g !== void 0 ? _g : degrees(0),\n borderWidth: (_h = options.borderWidth) !== null && _h !== void 0 ? _h : 0,\n color: (_j = options.color) !== null && _j !== void 0 ? _j : undefined,\n borderColor: (_k = options.borderColor) !== null && _k !== void 0 ? _k : undefined,\n borderDashArray: (_l = options.borderDashArray) !== null && _l !== void 0 ? _l : undefined,\n borderDashPhase: (_m = options.borderDashPhase) !== null && _m !== void 0 ? _m : undefined,\n graphicsState: graphicsStateKey,\n borderLineCap: (_o = options.borderLineCap) !== null && _o !== void 0 ? _o : undefined,\n }));\n };\n /**\n * Draw a square on this page. For example:\n * ```js\n * import { degrees, grayscale, rgb } from 'pdf-lib'\n *\n * page.drawSquare({\n * x: 25,\n * y: 75,\n * size: 100,\n * rotate: degrees(-15),\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2),\n * opacity: 0.5,\n * borderOpacity: 0.75,\n * })\n * ```\n * @param options The options to be used when drawing the square.\n */\n PDFPage.prototype.drawSquare = function (options) {\n if (options === void 0) { options = {}; }\n var size = options.size;\n assertOrUndefined(size, 'size', ['number']);\n this.drawRectangle(__assign(__assign({}, options), { width: size, height: size }));\n };\n /**\n * Draw an ellipse on this page. For example:\n * ```js\n * import { grayscale, rgb } from 'pdf-lib'\n *\n * page.drawEllipse({\n * x: 200,\n * y: 75,\n * xScale: 100,\n * yScale: 50,\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2),\n * opacity: 0.5,\n * borderOpacity: 0.75,\n * })\n * ```\n * @param options The options to be used when drawing the ellipse.\n */\n PDFPage.prototype.drawEllipse = function (options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n if (options === void 0) { options = {}; }\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.xScale, 'options.xScale', ['number']);\n assertOrUndefined(options.yScale, 'options.yScale', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertRangeOrUndefined(options.opacity, 'opacity.opacity', 0, 1);\n assertOrUndefined(options.borderColor, 'options.borderColor', [\n [Object, 'Color'],\n ]);\n assertRangeOrUndefined(options.borderOpacity, 'options.borderOpacity', 0, 1);\n assertOrUndefined(options.borderWidth, 'options.borderWidth', ['number']);\n assertOrUndefined(options.borderDashArray, 'options.borderDashArray', [\n Array,\n ]);\n assertOrUndefined(options.borderDashPhase, 'options.borderDashPhase', [\n 'number',\n ]);\n assertIsOneOfOrUndefined(options.borderLineCap, 'options.borderLineCap', LineCapStyle);\n assertIsOneOfOrUndefined(options.blendMode, 'options.blendMode', BlendMode);\n var graphicsStateKey = this.maybeEmbedGraphicsState({\n opacity: options.opacity,\n borderOpacity: options.borderOpacity,\n blendMode: options.blendMode,\n });\n if (!('color' in options) && !('borderColor' in options)) {\n options.color = rgb(0, 0, 0);\n }\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawEllipse({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n xScale: (_c = options.xScale) !== null && _c !== void 0 ? _c : 100,\n yScale: (_d = options.yScale) !== null && _d !== void 0 ? _d : 100,\n rotate: (_e = options.rotate) !== null && _e !== void 0 ? _e : undefined,\n color: (_f = options.color) !== null && _f !== void 0 ? _f : undefined,\n borderColor: (_g = options.borderColor) !== null && _g !== void 0 ? _g : undefined,\n borderWidth: (_h = options.borderWidth) !== null && _h !== void 0 ? _h : 0,\n borderDashArray: (_j = options.borderDashArray) !== null && _j !== void 0 ? _j : undefined,\n borderDashPhase: (_k = options.borderDashPhase) !== null && _k !== void 0 ? _k : undefined,\n borderLineCap: (_l = options.borderLineCap) !== null && _l !== void 0 ? _l : undefined,\n graphicsState: graphicsStateKey,\n }));\n };\n /**\n * Draw a circle on this page. For example:\n * ```js\n * import { grayscale, rgb } from 'pdf-lib'\n *\n * page.drawCircle({\n * x: 200,\n * y: 150,\n * size: 100,\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2),\n * opacity: 0.5,\n * borderOpacity: 0.75,\n * })\n * ```\n * @param options The options to be used when drawing the ellipse.\n */\n PDFPage.prototype.drawCircle = function (options) {\n if (options === void 0) { options = {}; }\n var _a = options.size, size = _a === void 0 ? 100 : _a;\n assertOrUndefined(size, 'size', ['number']);\n this.drawEllipse(__assign(__assign({}, options), { xScale: size, yScale: size }));\n };\n PDFPage.prototype.getFont = function () {\n if (!this.font || !this.fontKey) {\n var font = this.doc.embedStandardFont(StandardFonts.Helvetica);\n this.setFont(font);\n }\n return [this.font, this.fontKey];\n };\n PDFPage.prototype.getContentStream = function (useExisting) {\n if (useExisting === void 0) { useExisting = true; }\n if (useExisting && this.contentStream)\n return this.contentStream;\n this.contentStream = this.createContentStream();\n this.contentStreamRef = this.doc.context.register(this.contentStream);\n this.node.addContentStream(this.contentStreamRef);\n return this.contentStream;\n };\n PDFPage.prototype.createContentStream = function () {\n var operators = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operators[_i] = arguments[_i];\n }\n var dict = this.doc.context.obj({});\n var contentStream = PDFContentStream.of(dict, operators);\n return contentStream;\n };\n PDFPage.prototype.maybeEmbedGraphicsState = function (options) {\n var opacity = options.opacity, borderOpacity = options.borderOpacity, blendMode = options.blendMode;\n if (opacity === undefined &&\n borderOpacity === undefined &&\n blendMode === undefined) {\n return undefined;\n }\n var key = addRandomSuffix('GS', 10);\n var graphicsState = this.doc.context.obj({\n Type: 'ExtGState',\n ca: opacity,\n CA: borderOpacity,\n BM: blendMode,\n });\n this.node.setExtGState(PDFName.of(key), graphicsState);\n return key;\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.addPage]] and [[PDFDocument.insertPage]]\n * > methods, which can create instances of [[PDFPage]] for you.\n *\n * Create an instance of [[PDFPage]] from an existing leaf node.\n *\n * @param leafNode The leaf node to be wrapped.\n * @param ref The unique reference for the page.\n * @param doc The document to which the page will belong.\n */\n PDFPage.of = function (leafNode, ref, doc) {\n return new PDFPage(leafNode, ref, doc);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.addPage]] and [[PDFDocument.insertPage]]\n * > methods, which can create instances of [[PDFPage]] for you.\n *\n * Create an instance of [[PDFPage]].\n *\n * @param doc The document to which the page will belong.\n */\n PDFPage.create = function (doc) {\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n var dummyRef = PDFRef.of(-1);\n var pageLeaf = PDFPageLeaf.withContextAndParent(doc.context, dummyRef);\n var pageRef = doc.context.register(pageLeaf);\n return new PDFPage(pageLeaf, pageRef, doc);\n };\n return PDFPage;\n}());\nexport default PDFPage;\n//# sourceMappingURL=PDFPage.js.map","import { __assign, __extends, __spreadArrays } from \"tslib\";\nimport PDFPage from \"../PDFPage\";\nimport PDFFont from \"../PDFFont\";\nimport { normalizeAppearance, defaultButtonAppearanceProvider, } from \"./appearances\";\nimport PDFField, { assertFieldAppearanceOptions, } from \"./PDFField\";\nimport { rgb } from \"../colors\";\nimport { degrees, adjustDimsForRotation, reduceRotation, } from \"../rotations\";\nimport { drawImage, rotateInPlace } from \"../operations\";\nimport { PDFStream, PDFAcroPushButton, } from \"../../core\";\nimport { assertIs, assertOrUndefined, addRandomSuffix } from \"../../utils\";\n/**\n * Represents a button field of a [[PDFForm]].\n *\n * [[PDFButton]] fields are interactive controls that users can click with their\n * mouse. This type of [[PDFField]] is not stateful. The purpose of a button\n * is to perform an action when the user clicks on it, such as opening a print\n * modal or resetting the form. Buttons are typically rectangular in shape and\n * have a text label describing the action that they perform when clicked.\n */\nvar PDFButton = /** @class */ (function (_super) {\n __extends(PDFButton, _super);\n function PDFButton(acroPushButton, ref, doc) {\n var _this = _super.call(this, acroPushButton, ref, doc) || this;\n assertIs(acroPushButton, 'acroButton', [\n [PDFAcroPushButton, 'PDFAcroPushButton'],\n ]);\n _this.acroField = acroPushButton;\n return _this;\n }\n // NOTE: This doesn't handle image borders.\n // NOTE: Acrobat seems to resize the image (maybe even skewing its aspect\n // ratio) to fit perfectly within the widget's rectangle. This method\n // does not currently do that. Should there be an option for that?\n /**\n * Display an image inside the bounds of this button's widgets. For example:\n * ```js\n * const pngImage = await pdfDoc.embedPng(...)\n * const button = form.getButton('some.button.field')\n * button.setImage(pngImage)\n * ```\n * This will update the appearances streams for each of this button's widgets.\n * @param image The image that should be displayed.\n */\n PDFButton.prototype.setImage = function (image) {\n var _a;\n var _b;\n // Create appearance stream with image, ignoring caption property\n var context = this.acroField.dict.context;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n ////////////\n var rectangle = widget.getRectangle();\n var ap = widget.getAppearanceCharacteristics();\n var bs = widget.getBorderStyle();\n var borderWidth = (_b = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _b !== void 0 ? _b : 1;\n var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());\n var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation: rotation }));\n var adj = adjustDimsForRotation(rectangle, rotation);\n var imageDims = image.scaleToFit(adj.width - borderWidth * 2, adj.height - borderWidth * 2);\n var drawingArea = {\n x: 0 + borderWidth,\n y: 0 + borderWidth,\n width: adj.width - borderWidth * 2,\n height: adj.height - borderWidth * 2,\n };\n // Support borders on images and maybe other properties\n var options = {\n x: drawingArea.x + (drawingArea.width / 2 - imageDims.width / 2),\n y: drawingArea.y + (drawingArea.height / 2 - imageDims.height / 2),\n width: imageDims.width,\n height: imageDims.height,\n //\n rotate: degrees(0),\n xSkew: degrees(0),\n ySkew: degrees(0),\n };\n var imageName = addRandomSuffix('Image', 10);\n var appearance = __spreadArrays(rotate, drawImage(imageName, options));\n ////////////\n var Resources = { XObject: (_a = {}, _a[imageName] = image.ref, _a) };\n var stream = context.formXObject(appearance, {\n Resources: Resources,\n BBox: context.obj([0, 0, rectangle.width, rectangle.height]),\n Matrix: context.obj([1, 0, 0, 1, 0, 0]),\n });\n var streamRef = context.register(stream);\n this.updateWidgetAppearances(widget, { normal: streamRef });\n }\n this.markAsClean();\n };\n /**\n * Show this button on the specified page with the given text. For example:\n * ```js\n * const ubuntuFont = await pdfDoc.embedFont(ubuntuFontBytes)\n * const page = pdfDoc.addPage()\n *\n * const form = pdfDoc.getForm()\n * const button = form.createButton('some.button.field')\n *\n * button.addToPage('Do Stuff', page, {\n * x: 50,\n * y: 75,\n * width: 200,\n * height: 100,\n * textColor: rgb(1, 0, 0),\n * backgroundColor: rgb(0, 1, 0),\n * borderColor: rgb(0, 0, 1),\n * borderWidth: 2,\n * rotate: degrees(90),\n * font: ubuntuFont,\n * })\n * ```\n * This will create a new widget for this button field.\n * @param text The text to be displayed for this button widget.\n * @param page The page to which this button widget should be added.\n * @param options The options to be used when adding this button widget.\n */\n PDFButton.prototype.addToPage = function (\n // TODO: This needs to be optional, e.g. for image buttons\n text, page, options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n assertOrUndefined(text, 'text', ['string']);\n assertOrUndefined(page, 'page', [[PDFPage, 'PDFPage']]);\n assertFieldAppearanceOptions(options);\n // Create a widget for this button\n var widget = this.createWidget({\n x: ((_a = options === null || options === void 0 ? void 0 : options.x) !== null && _a !== void 0 ? _a : 0) - ((_b = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _b !== void 0 ? _b : 0) / 2,\n y: ((_c = options === null || options === void 0 ? void 0 : options.y) !== null && _c !== void 0 ? _c : 0) - ((_d = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _d !== void 0 ? _d : 0) / 2,\n width: (_e = options === null || options === void 0 ? void 0 : options.width) !== null && _e !== void 0 ? _e : 100,\n height: (_f = options === null || options === void 0 ? void 0 : options.height) !== null && _f !== void 0 ? _f : 50,\n textColor: (_g = options === null || options === void 0 ? void 0 : options.textColor) !== null && _g !== void 0 ? _g : rgb(0, 0, 0),\n backgroundColor: (_h = options === null || options === void 0 ? void 0 : options.backgroundColor) !== null && _h !== void 0 ? _h : rgb(0.75, 0.75, 0.75),\n borderColor: options === null || options === void 0 ? void 0 : options.borderColor,\n borderWidth: (_j = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _j !== void 0 ? _j : 0,\n rotate: (_k = options === null || options === void 0 ? void 0 : options.rotate) !== null && _k !== void 0 ? _k : degrees(0),\n caption: text,\n });\n var widgetRef = this.doc.context.register(widget.dict);\n // Add widget to this field\n this.acroField.addWidget(widgetRef);\n // Set appearance streams for widget\n var font = (_l = options === null || options === void 0 ? void 0 : options.font) !== null && _l !== void 0 ? _l : this.doc.getForm().getDefaultFont();\n this.updateWidgetAppearance(widget, font);\n // Add widget to the given page\n page.node.addAnnot(widgetRef);\n };\n /**\n * Returns `true` if this button has been marked as dirty, or if any of this\n * button's widgets do not have an appearance stream. For example:\n * ```js\n * const button = form.getButton('some.button.field')\n * if (button.needsAppearancesUpdate()) console.log('Needs update')\n * ```\n * @returns Whether or not this button needs an appearance update.\n */\n PDFButton.prototype.needsAppearancesUpdate = function () {\n var _a;\n if (this.isDirty())\n return true;\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream;\n if (!hasAppearances)\n return true;\n }\n return false;\n };\n /**\n * Update the appearance streams for each of this button's widgets using\n * the default appearance provider for buttons. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const button = form.getButton('some.button.field')\n * button.defaultUpdateAppearances(helvetica)\n * ```\n * @param font The font to be used for creating the appearance streams.\n */\n PDFButton.prototype.defaultUpdateAppearances = function (font) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n this.updateAppearances(font);\n };\n /**\n * Update the appearance streams for each of this button's widgets using\n * the given appearance provider. If no `provider` is passed, the default\n * appearance provider for buttons will be used. For example:\n * ```js\n * const helvetica = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const button = form.getButton('some.button.field')\n * button.updateAppearances(helvetica, (field, widget, font) => {\n * ...\n * return {\n * normal: drawButton(...),\n * down: drawButton(...),\n * }\n * })\n * ```\n * @param font The font to be used for creating the appearance streams.\n * @param provider Optionally, the appearance provider to be used for\n * generating the contents of the appearance streams.\n */\n PDFButton.prototype.updateAppearances = function (font, provider) {\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n assertOrUndefined(provider, 'provider', [Function]);\n var widgets = this.acroField.getWidgets();\n for (var idx = 0, len = widgets.length; idx < len; idx++) {\n var widget = widgets[idx];\n this.updateWidgetAppearance(widget, font, provider);\n }\n };\n PDFButton.prototype.updateWidgetAppearance = function (widget, font, provider) {\n var apProvider = provider !== null && provider !== void 0 ? provider : defaultButtonAppearanceProvider;\n var appearances = normalizeAppearance(apProvider(this, widget, font));\n this.updateWidgetAppearanceWithFont(widget, font, appearances);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFForm.getButton]] method, which will create an\n * > instance of [[PDFButton]] for you.\n *\n * Create an instance of [[PDFButton]] from an existing acroPushButton and ref\n *\n * @param acroPushButton The underlying `PDFAcroPushButton` for this button.\n * @param ref The unique reference for this button.\n * @param doc The document to which this button will belong.\n */\n PDFButton.of = function (acroPushButton, ref, doc) { return new PDFButton(acroPushButton, ref, doc); };\n return PDFButton;\n}(PDFField));\nexport default PDFButton;\n//# sourceMappingURL=PDFButton.js.map"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","TypeError","pop","push","__spreadArrays","il","r","k","a","j","jl","chars","lookup","Uint8Array","charCodeAt","ByteOrder","encodeToBase64","bytes","base64","len","substring","decodeFromBase64","encoded1","encoded2","encoded3","encoded4","bufferLength","DATA_URI_PREFIX_REGEX","decodeFromBase64DataUri","dataUri","trimmedUri","trim","res","match","fullMatch","data","toCharCode","character","toCodePoint","codePointAt","toHexStringOfMinLength","num","minLength","padStart","toString","toUpperCase","toHexString","charFromCode","code","String","fromCharCode","charFromHexCode","hex","parseInt","padChar","padding","idx","copyStringIntoBuffer","str","buffer","offset","addRandomSuffix","prefix","suffixLength","Math","floor","random","pow","escapeRegExp","replace","cleanText","text","escapedNewlineChars","newlineChars","isNewlineChar","test","lineSplit","split","mergeLines","charAtIndex","index","cuSecond","cuFirst","nextIndex","slice","charSplit","_a","c","cLen","breakTextIntoLines","wordBreaks","maxWidth","computeWidthOfText","regex","newlineCharUnion","join","escapedRules","wordBreak","breakRules","RegExp","buildWordBreakRegex","words","currLine","currWidth","lines","pushCurrLine","word","width","dateRegex","parseDate","dateStr","year","month","_b","day","_c","hours","_d","mins","_e","secs","_f","offsetSign","_g","offsetHours","_h","Date","last","array","typedArrayFor","typedArray","mergeIntoTypedArray","arrays","_i","arrayCount","typedArrays","element","totalSize","merged","arrIdx","arr","byteIdx","arrLen","mergeUint8Arrays","mergedBuffer","set","arrayAsString","byAscendingId","id","sortedUniq","indexer","uniq","curr","prev","reverseArray","arrayLen","leftIdx","rightIdx","temp","sum","total","range","start","end","pluckIndices","indices","plucked","canBeConvertedToUint8Array","input","ArrayBuffer","toUint8Array","waitForTick","setTimeout","utf8Encode","byteOrderMark","encoded","codePoint","byte1","byte2","byte3","Error","byte4","utf16Encode","highSurrogate","lowSurrogate","Uint16Array","isWithinBMP","hasSurrogates","REPLACEMENT","utf16Decode","fromCodePoint","byteOrder","readBOM","BigEndian","codePoints","first","decodeValues","isHighSurrogate","second","isLowSurrogate","LittleEndian","hasUtf16BigEndianBOM","hasUtf16LittleEndianBOM","hasUtf16BOM","numberToString","numStr","abs","negative","sizeInBytes","ceil","bytesFor","error","msg","TYPED_OK","Int32Array","_has","obj","key","exports","sources","source","shift","buf","size","subarray","fnTyped","arraySet","dest","src","src_offs","dest_offs","flattenChunks","chunks","l","pos","chunk","fnUntyped","concat","on","setTyped","zero","extra_lbits","extra_dbits","extra_blbits","bl_order","static_ltree","static_dtree","D_CODES","_dist_code","_length_code","MAX_MATCH","base_length","static_l_desc","static_d_desc","static_bl_desc","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","has_stree","TreeDesc","dyn_tree","stat_desc","max_code","d_code","dist","put_short","w","pending_buf","pending","send_bits","bi_valid","bi_buf","send_code","tree","bi_reverse","gen_codes","bl_count","bits","next_code","MAX_BITS","init_block","LITERALS","dyn_ltree","dyn_dtree","bl_tree","END_BLOCK","opt_len","static_len","last_lit","matches","bi_windup","smaller","m","depth","_n2","_m2","pqdownheap","heap","heap_len","compress_block","ltree","dtree","lc","extra","lx","d_buf","l_buf","build_tree","desc","node","stree","heap_max","h","xbits","base","overflow","gen_bitlen","scan_tree","curlen","prevlen","nextlen","count","max_count","min_count","REP_3_6","REPZ_3_10","REPZ_11_138","send_tree","static_init_done","_tr_stored_block","stored_len","header","utils","window","copy_block","LENGTH_CODES","L_CODES","tr_static_init","l_desc","d_desc","bl_desc","opt_lenb","static_lenb","max_blindex","level","strm","data_type","black_mask","detect_data_type","BL_CODES","build_bl_tree","strategy","lcodes","dcodes","blcodes","rank","send_all_trees","lit_bufsize","STATIC_TREES","bi_flush","adler","s1","s2","crcTable","table","makeTable","configuration_table","crc","2","1","0","-1","-2","-3","-4","-5","-6","err","errorCode","flush_pending","state","avail_out","output","pending_out","next_out","total_out","flush_block_only","trees","_tr_flush_block","block_start","strstart","put_byte","putShortMSB","read_buf","avail_in","next_in","wrap","adler32","crc32","total_in","longest_match","cur_match","chain_length","max_chain_length","scan","best_len","prev_length","nice_match","limit","w_size","_win","wmask","w_mask","strend","scan_end1","scan_end","good_match","lookahead","match_start","fill_window","more","_w_size","window_size","hash_size","head","insert","ins_h","hash_shift","hash_mask","deflate_fast","flush","hash_head","bflush","match_length","_tr_tally","max_lazy_match","MIN_MATCH","deflate_slow","max_insert","prev_match","match_available","Config","good_length","max_lazy","nice_length","max_chain","func","DeflateState","status","pending_buf_size","gzhead","gzindex","method","last_flush","w_bits","hash_bits","Buf16","HEAP_SIZE","deflateResetKeep","_tr_init","deflateReset","ret","deflateInit2","windowBits","memLevel","Buf8","max_block_size","max_start","old_flush","beg","val","hcrc","name","comment","time","os","bstate","deflate_huff","deflate_rle","_tr_align","dictionary","avail","tmpDict","dictLength","STR_APPLY_OK","STR_APPLY_UIA_OK","_utf8len","q","buf2binstring","shrinkBuf","c2","m_pos","str_len","buf_len","max","out","c_len","utf16buf","Deflate","options","chunkSize","to","opt","raw","gzip","ended","ZStream","zlib_deflate","deflateSetHeader","dict","strings","deflateSetDictionary","_dict_set","deflate","deflator","mode","_mode","onEnd","onData","deflateEnd","_in","_out","dmax","wsize","whave","wnext","s_window","hold","lcode","dcode","lmask","dmask","here","from","from_source","lencode","distcode","lenbits","distbits","top","dolen","dodist","sane","lbase","lext","dbase","dext","type","lens","lens_index","codes","table_index","work","opts","incr","fill","low","mask","here_bits","here_op","here_val","sym","min","root","drop","left","used","huff","base_index","MAXBITS","offs","extra_index","zswap32","InflateState","havedict","flags","check","wbits","ncode","nlen","ndist","have","lendyn","distdyn","back","was","inflateResetKeep","Buf32","inflateReset","inflateReset2","inflateInit2","lenfix","distfix","virgin","fixedtables","inflate_table","updatewindow","copy","put","last_bits","last_op","last_val","hbuf","order","inf_leave","xflags","extra_len","inflate_fast","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_BLOCK","Z_TREES","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_ERRNO","Z_STREAM_ERROR","Z_DATA_ERROR","Z_BUF_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_DEFAULT_STRATEGY","Z_BINARY","Z_TEXT","Z_UNKNOWN","Z_DEFLATED","Inflate","zlib_inflate","GZheader","inflateGetHeader","inflateSetDictionary","inflate","inflator","next_out_utf8","tail","utf8str","allowBufError","inflateEnd","pako","require$$0","constants","FontNames","decompressJson","compressedJson","arrayToString","compressedJsonForFontName","Courier","Courier-Bold","Courier-Oblique","Courier-BoldOblique","Helvetica","Helvetica-Bold","Helvetica-Oblique","Helvetica-BoldOblique","Times-Roman","Times-Bold","Times-Italic","Times-BoldItalic","ZapfDingbats","fontCache","Font","_this","getWidthOfGlyph","glyphName","CharWidths","getXAxisKerningForPair","leftGlyphName","rightGlyphName","KernPairXAmounts","load","fontName","cachedFont","json","font","JSON","parse","CharMetrics","reduce","acc","metric","N","WX","KernPairs","name1","name2","decompressedEncodings","allUnicodeMappings","Encoding","unicodeMappings","canEncodeUnicodeCodePoint","encodeUnicodeCodePoint","mapped","hexCode","supportedCodePoints","keys","map","Number","sort","Encodings","symbol","zapfdingbats","WinAnsi","win1252","values","StandardFontValues","isStandardFont","includes","rectanglesAreEqual","x","height","backtick","singleQuote","formatValue","createValueErrorMsg","valueName","allowedValues","joinedValues","assertIsOneOf","isArray","objectValues","assertIsOneOfOrUndefined","undefined","assertIsSubset","getType","isNaN","isType","Function","createTypeErrorMsg","types","allowedTypes","joinedTypes","assertIs","assertOrUndefined","assertEachIs","assertRange","assertRangeOrUndefined","assertMultiple","multiplier","pdfDocEncodingToUnicode","CharCodes","pdfDocEncodingDecode","Cache","populate","getValue","access","invalidate","populatedBy","MethodNotImplementedError","_super","className","methodName","PrivateConstructorError","UnexpectedObjectTypeError","expected","actual","UnsupportedEncodingError","encoding","ReparseError","MissingCatalogError","ref","MissingPageContentsEmbeddingError","UnrecognizedStreamTypeError","stream","contructor","PageEmbeddingMismatchedContextError","PDFArrayIsNotRectangleError","InvalidPDFDateStringError","InvalidTargetIndexError","targetIndex","Count","CorruptPageTreeError","operation","IndexOutOfBoundsError","InvalidAcroFieldValueError","MultiSelectValueError","NumberParsingError","line","column","PDFParsingError","details","NextByteAssertionError","expectedByte","actualByte","PDFObjectParsingError","byte","PDFInvalidObjectParsingError","PDFStreamParsingError","UnbalancedParenthesisError","StalledParserError","MissingPDFHeaderError","MissingKeywordError","keyword","PDFHeader","major","minor","bc","copyBytesInto","initialOffset","Percent","D","F","Dash","Period","Newline","forVersion","PDFObject","clone","_context","_buffer","_offset","PDFNumber","numberValue","stringValue","asNumber","of","PDFArray","context","object","splice","remove","get","lookupMaybe","asRectangle","lowerLeftX","lowerLeftY","asArray","withContext","arrayString","LeftSquareBracket","Space","RightSquareBracket","ENFORCER","PDFBool","enforcer","asBoolean","u","True","False","PDFNull","asNull","PDFDict","entries","has","delete","asMap","Map","dictString","LessThan","GreaterThan","fromMapWithContext","IsDelimiter","LeftParen","RightParen","LeftCurly","RightCurly","ForwardSlash","IsWhitespace","Null","Tab","FormFeed","CarriageReturn","IsIrregular","Hash","PDFOperatorNames","pool","PDFName","charCode","encodedName","ExclamationPoint","Tilde","asBytes","escaped","pushByte","char","nextChar","Zero","Nine","A","decodeText","asString","decodedValue","decodeName","instance","Length","FlateDecode","Resources","XObject","ExtGState","Contents","Type","Parent","MediaBox","Page","Annots","TrimBox","ArtBox","BleedBox","CropBox","Rotate","Title","Author","Subject","Creator","Keywords","Producer","CreationDate","ModDate","PDFStream","getContentsString","getContents","getContentsSize","updateDict","contentsSize","streamString","contents","PDFRawStream","asUint8Array","PDFRef","objectNumber","generationNumber","tag","PDFOperator","args","arg","EntryType","PDFFlateStream","encode","computeContents","unencodedContents","getUnencodedContents","contentsCache","PDFContentStream","operators","getUnencodedContentsSize","byAscendingObjectNumber","PDFContext","largestObjectNumber","trailerInfo","indirectObjects","nextRef","register","enumerateIndirectObjects","literal","flateStream","Filter","contentStream","formXObject","BBox","Matrix","Subtype","getPushGraphicsStateContentStream","pushGraphicsStateContentStreamRef","Ops","PushGraphicsState","getPopGraphicsStateContentStream","popGraphicsStateContentStreamRef","PopGraphicsState","PDFPageLeaf","autoNormalizeCTM","normalized","dictOrRef","getInheritableAttribute","arrayOrRef","numberOrRef","attribute","ascend","setParent","parentRef","addContentStream","contentStreamRef","normalizedEntries","wrapContentStreams","startStream","endStream","addAnnot","annotRef","setFontDictionary","fontDictRef","setXObject","xObjectRef","setExtGState","extGStateRef","visitor","normalize","contentsRef","InheritableEntries","withContextAndParent","parent","PDFObjectCopier","traversedObjects","copyPDFPage","copyPDFDict","copyPDFArray","copyPDFStream","copyPDFIndirectObject","originalPage","clonedPage","originalDict","clonedDict","originalArray","clonedArray","originalStream","clonedStream","newRef","dereferencedValue","cloned","for","PDFCrossRefSection","firstEntry","subsections","chunkIdx","chunkLength","addEntry","append","deleted","addDeletedEntry","nextFreeObjectNumber","section","rangeIdx","rangeLen","entryIdx","entryLen","entry","subsection","subsectionLength","copySubsectionsIntoBuffer","firstObjectNumber","rangeLength","copyEntriesIntoBuffer","entryOffset","entryGen","currEntry","prevEntry","createEmpty","PDFTrailer","lastXRefOffset","E","O","forLastCrossRefSectionOffset","PDFTrailerDict","PDFObjectStream","objects","offsets","computeObjectOffsets","offsetsString","computeOffsetsString","getObjectsCount","withContextAndObjects","PDFWriter","objectsPerTick","parsedObjects","shouldWaitForTick","serializeToBuffer","xref","trailerDict","trailer","computeBufferSize","o","computeIndirectObjectSize","createTrailerDict","Size","Root","Encrypt","Info","ID","indirectObject","xrefOffset","forContext","PDFInvalidObject","ColorSpace","PDFCrossRefStream","computeIndex","computeEntryTuples","entryTuples","Deleted","Uncompressed","Compressed","objectStreamRef","computeMaxEntryByteWidths","entryTuplesCache","widths","third","firstSize","secondSize","thirdSize","maxByteWidthsCache","indexCache","addUncompressedEntry","addCompressedEntry","byteWidths","entriesLen","firstBytes","secondBytes","thirdBytes","PDFStreamWriter","encodeStreams","objectsPerStream","xrefStream","uncompressedObjects","compressedObjects","objectStreamRefs","objectStream","xrefStreamRef","PDFHexString","hexLength","hexOffset","bytesOffset","decodeDate","date","fromText","StandardFontEmbedder","customName","FontName","encodeText","glyphs","encodeTextAsGlyphs","hexCodes","widthOfTextAtSize","totalWidth","right","kernAmount","widthOfGlyph","heightOfFontAtSize","descender","Ascender","Descender","FontBBox","sizeOfFontAtHeight","embedIntoContext","fontDict","BaseFont","fillCmapTemplate","bfChars","cmapHexFormat","cmapHexString","cmapCodePointFormat","hs","ls","PDFString","octal","Backspace","BackSlash","Seven","fromDate","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","CustomFontEmbedder","fontData","allGlyphsInFontSortedById","characterSet","glyphForCodePoint","scale","unitsPerEm","postscriptName","baseFontName","glyphCache","fontkit","layout","advanceWidth","ascent","descent","bbox","maxY","minY","embedFontDict","cidFontDictRef","unicodeCMapRef","embedCIDFontDict","embedUnicodeCmap","DescendantFonts","ToUnicode","isCFF","cff","fontDescriptorRef","cidFontDict","embedFontDescriptor","CIDSystemInfo","Registry","Ordering","Supplement","FontDescriptor","W","computeWidths","fontStreamRef","italicAngle","capHeight","xHeight","minX","maxX","fontDescriptor","embedFontStream","Flags","familyClass","sFamilyClass","fixedPitch","post","isFixedPitch","serif","symbolic","script","italic","macStyle","flipBit","bit","nonsymbolic","allCap","smallCap","forceBold","ItalicAngle","Ascent","Descent","CapHeight","XHeight","StemV","serializeFont","fontStream","cmap","glyphId","glyph","unicode","createCmap","bind","cmapStream","currSection","currGlyph","prevGlyph","currGlyphId","prevGlyphId","CustomFontSubsetEmbedder","customFontName","subset","createSubset","glyphIdMap","subsetGlyphId","includeGlyph","parts","encodeStream","FileEmbedder","fileData","fileName","mimeType","description","creationDate","modificationDate","embeddedFileStream","embeddedFileStreamRef","fileSpecDict","Params","UF","EF","Desc","MARKERS","ChannelToColorSpace","DeviceGray","3","DeviceRGB","4","DeviceCMYK","JpegEmbedder","imageData","bitsPerComponent","colorSpace","dataView","marker","channelByte","channelName","DataView","getUint16","byteLength","getUint8","xObject","BitsPerComponent","Width","Height","Decode","H","UPNG","toRGBA8","tabs","acTL","decodeImage","frms","frames","img","empty","frm","fx","rect","fy","fw","fh","fdata","blend","_copyTile","dispose","area","bpp","decode","_getBPP","bpl","bf","bf32","Uint32Array","ctype","rs","_bin","readUshort","qarea","ts","ti","tr","tg","tb","qi","ap","tl","s0","t0","cj","gr","di","off","al","buff","fd","bin","rUs","rUi","readUint","dd","doff","foff","mgck","readASCII","_IHDR","num_frames","num_plays","fr","_decompress","rct","del","delay","round","nz","nextZero","keyw","readUTF8","readBytes","pl","compress","interlace","filter","_inflate","_filterZero","_readInterlace","inflateRaw","C","R","J","Q","X","V","M","I","Z","K","S","T","z","$","Y","byteOffset","cbpp","starting_row","starting_col","row_increment","col_increment","pass","ri","ci","sw","sh","cr","cc","bpll","row","col","cdi","ii","paeth","_paeth","pa","pb","pc","writeUshort","writeUint","writeASCII","pad","ns","decodeURIComponent","sb","tw","th","xoff","yoff","si","fa","fg","fb","ba","br","bg","bb","ifa","oa","ioa","bufs","ps","dels","forbidPlte","nimg","compressPNG","_main","encodeLL","ac","bipp","bipl","wUi","wUs","wAs","anim","pltAlpha","leng","dl","plte","cimg","wr","fi","imgd","ioff","levelZero","nh","prms","onlyBlend","evenCrd","forbidPrev","minBits","alphaAnd","ilen","gotAlpha","framize","inds","nbufs","abuf","concatRGBA","qres","quantize","cof","bln","est","rgba","img32","nw","ind","cmc","inj","alwaysBlend","cimg32","nx","ny","tlim","tstp","tarea","it","pimg","p32","mix","miy","may","sarea","_prepareDiff","r0","r1","miX","miY","_updateFrame","U8","U32","pimg32","cx","cy","rec","fls","ftry","CMPR","UZIP","_filterLine","tsize","tab","update","oimg","nimg32","KD","getKDtree","leafs","planeDst","nd","getNearest","i0","i1","bst","tdst","stats","estats","maxL","mi","L","splitPixels","eMq255","ln","rn","node0","node1","eMq","d0","d1","d2","d3","vecDot","m0","m1","m2","m3","iN","Rj","M4","tmi","multVec","sqrt","dot","sml","Cov","tlen","noff","PngType","AcroFieldFlags","AcroButtonFlags","AcroTextFlags","AcroChoiceFlags","PNG","pngData","upng","rgbaChannel","pixelCount","rgbChannel","alphaChannel","rgbaOffset","rgbOffset","alphaOffset","splitAlphaChannel","some","Greyscale","Truecolour","IndexedColour","GreyscaleWithAlpha","TruecolourWithAlpha","getImageType","PngEmbedder","png","image","SMask","embedAlphaChannel","Stream","defineProperty","enumerable","configurable","getByte","b0","b1","getInt32","getBytes","forceClamped","strEnd","Uint8ClampedArray","peekByte","peekedByte","peekBytes","skip","reset","moveStart","makeSubStream","emptyBuffer","DecodeStream","maybeMinBufferLength","eof","minBufferLength","readBlock","ensureBuffer","bufEnd","requested","buffer2","isSpace","ch","Ascii85Stream","maybeLength","AsciiHexStream","firstDigit","maxDecodeLength","digit","codeLenCodeMap","lengthDecode","distDecode","fixedLitCodeTab","fixedDistCodeTab","FlateStream","cmf","flg","codeSize","codeBuf","hdr","getBits","litCodeTable","distCodeTable","numLitCodes","numDistCodes","numCodeLenCodes","codeLenCodeLengths","codeLenCodeTab","generateHuffmanTable","codeLengths","bitsLength","bitsOffset","what","getCode","repeatLength","code1","code2","blockLen","maxLen","console","log","codeLen","codeVal","lengths","LZWStream","earlyChange","cachedData","bitsCached","lzwState","codeLength","nextCode","dictionaryValues","dictionaryLengths","dictionaryPrevCodes","currentSequence","currentSequenceLength","estimatedDecodedSize","blockSize","prevCode","decodedLength","currentBufferLength","readBits","hasPrev","RunLengthStream","repeatHeader","decodeStream","params","EarlyChange","decodePDFRawStream","DecodeParms","PDFPageEmbedder","page","boundingBox","transformationMatrix","mediaBox","bottom","fullPageBoundingBox","boundingBoxAdjustedMatrix","decodedContents","decodeContents","FormType","newline","content","PDFAcroField","Ff","valueOrRef","Kids","DA","da","setKids","kids","getParent","getFullyQualifiedName","getPartialName","setPartialName","partialName","setDefaultAppearance","appearance","getDefaultAppearance","getFlags","setFlags","hasFlag","flag","setFlag","clearFlag","setFlagTo","enable","BorderStyle","getWidth","setWidth","fromDict","PDFAnnotation","Rect","AP","getRectangle","setRectangle","setAppearanceState","setAppearances","appearances","ensureAP","setNormalAppearance","setRolloverAppearance","setDownAppearance","removeRolloverAppearance","removeDownAppearance","getAppearances","normal","rollover","down","AppearanceCharacteristics","BC","BG","CA","RC","AC","getRotation","getBorderColor","components","component","getBackgroundColor","getCaptions","setRotation","rotation","setBorderColor","color","setBackgroundColor","setCaptions","captions","PDFWidgetAnnotation","MK","BS","getAppearanceCharacteristics","getOrCreateAppearanceCharacteristics","getBorderStyle","getOrCreateBorderStyle","bs","getOnValue","PDFAcroTerminal","FT","nameOrRef","getWidgets","kidDicts","widgets","addWidget","removeWidget","PDFAcroButton","Opt","setOpt","getExportValues","removeExportValue","normalizeExportValues","exportValues","widget","exportVal","addOpt","useExistingOptIdx","existingIdx","optText","addWidgetWithOpt","optIdx","apStateValue","PDFAcroCheckBox","setValue","bitIndex","PDFAcroChoice","setValues","Combo","Edit","valuesAreValid","MultiSelect","updateSelectedIndices","getOptions","_loop_1","find","display","state_1","_loop_2","findIndex","getValues","setOptions","newOpt","item","PDFAcroComboBox","PDFAcroNonTerminal","addField","field","PDFAcroSignature","PDFAcroText","MaxLen","setMaxLength","maxLength","removeMaxLength","getMaxLength","setQuadding","quadding","getQuadding","removeValue","PDFAcroPushButton","PushButton","PDFAcroRadioButton","getOnValues","onValues","onValue","Radio","PDFAcroListBox","createPDFAcroFields","createPDFAcroField","isNonTerminalAcroField","createPDFAcroTerminal","kid","ftNameOrRef","createPDFAcroButton","createPDFAcroChoice","ffNumberOrRef","ffNumber","flagIsSet","startNode","PDFAcroForm","Fields","fields","getFields","getAllFields","allFields","pushFields","fieldModel","PDFCatalog","Pages","AcroForm","getAcroForm","getOrCreateAcroForm","acroForm","acroFormRef","insertLeafNode","leafRef","pagesRef","removeLeafNode","withContextAndPages","pages","PDFPageTree","pushTreeNode","treeRef","pushLeafNode","insertLeafKid","leafsRemainingUntilTarget","kidRef","prune","removeKid","traverse","kidIdx","newCount","IsDigit","One","Two","Three","Four","Five","Six","Eight","IsNumericPrefix","Plus","Minus","IsNumeric","RotationTypes","BaseParser","capNumbers","parseRawInt","peek","isFinite","position","parseRawNumber","MAX_SAFE_INTEGER","warn","skipWhitespace","skipLine","skipComment","skipWhitespaceAndComments","matchKeyword","moveTo","ByteStream","assertNext","peekAhead","steps","peekAt","fromPDFRawStream","rawStream","endstream","endobj","startxref","true","false","null","streamEOF1","streamEOF2","streamEOF3","streamEOF4","EOF1endstream","EOF2endstream","EOF3endstream","PDFObjectParser","byteStream","parseObject","parseDictOrStream","parseHexString","parseString","parseName","parseArray","parseNumberOrRef","firstNum","lookaheadStart","secondNum","nestingLvl","isEscaped","pdfArray","parseDict","startPos","findEndOfStreamFallback","forBytes","forByteStream","PDFObjectStreamParser","alreadyParsed","firstOffset","objectCount","parseIntoContext","offsetsAndObjectNumbers","parseOffsetsAndObjectNumbers","forStream","PDFXRefStreamParser","Index","length_1","parseEntries","typeFieldWidth","offsetFieldWidth","genFieldWidth","subsectionIdx","subsectionLen","length_2","objIdx","inObjectStream","PDFParser","pdfBytes","throwOnInvalidObject","Infinity","parseDocument","prevOffset","parseHeader","parseDocumentSection","maybeRecoverRoot","isValidCatalog","skipBinaryHeaderComment","parseIndirectObjectHeader","matchIndirectObjectHeader","parseIndirectObject","tryToParseInvalidIndirectObject","stringify","failed","parseIndirectObjects","skipJibberish","maybeParseCrossRefSection","firstInt","secondInt","maybeParseTrailerDict","maybeParseTrailer","forBytesWithOptions","asPDFName","asPDFNumber","LineCapStyle","radians","radianAngle","Radians","angle","degrees","degreeAngle","Degrees","degreesToRadians","degree","PI","radiansToDegrees","radian","toRadians","toDegrees","reduceRotation","quadrants","adjustDimsForRotation","dims","rotateRectangle","rectangle","borderWidth","clip","ClipNonZero","clipEvenOdd","ClipEvenOdd","cos","sin","tan","concatTransformationMatrix","ConcatTransformationMatrix","translate","xPos","yPos","rotateRadians","rotateDegrees","skewRadians","xSkewAngle","ySkewAngle","skewDegrees","setDashPattern","dashArray","dashPhase","SetLineDashPattern","restoreDashPattern","LineJoinStyle","setLineCap","style","SetLineCapStyle","TextRenderingMode","setLineJoin","SetLineJoinStyle","setGraphicsState","SetGraphicsStateParams","pushGraphicsState","popGraphicsState","setLineWidth","SetLineWidth","appendBezierCurve","x1","y1","x2","y2","x3","y3","AppendBezierCurve","appendQuadraticCurve","CurveToReplicateInitialPoint","closePath","ClosePath","MoveTo","lineTo","LineTo","AppendRectangle","square","stroke","StrokePath","FillNonZero","fillAndStroke","FillNonZeroAndStroke","endPath","EndPath","nextLine","NextLine","moveText","MoveText","showText","ShowText","beginText","BeginText","endText","EndText","setFontAndSize","SetFontAndSize","setCharacterSpacing","spacing","SetCharacterSpacing","setWordSpacing","SetWordSpacing","setCharacterSqueeze","squeeze","SetTextHorizontalScaling","setLineHeight","lineHeight","SetTextLineHeight","setTextRise","rise","SetTextRise","ColorTypes","setTextRenderingMode","SetTextRenderingMode","setTextMatrix","SetTextMatrix","rotateAndSkewTextRadiansAndTranslate","rotationAngle","rotateAndSkewTextDegreesAndTranslate","drawObject","DrawObject","setFillingGrayscaleColor","gray","NonStrokingColorGray","setStrokingGrayscaleColor","StrokingColorGray","setFillingRgbColor","red","green","blue","NonStrokingColorRgb","setStrokingRgbColor","StrokingColorRgb","setFillingCmykColor","cyan","magenta","yellow","NonStrokingColorCmyk","setStrokingCmykColor","StrokingColorCmyk","beginMarkedContent","BeginMarkedContent","endMarkedContent","EndMarkedContent","TextAlignment","grayscale","Grayscale","rgb","RGB","cmyk","CMYK","setFillingColor","setStrokingColor","componentsToColor","comps","colorToComponents","px","py","sx","sy","parameters","runners","cmd","cmds","solveArc","coords","rx","ry","rot","large","sweep","ex","ey","segs_1","arcToSegments","seg","bez","segmentToBezier","rotateX","ox","oy","sinTh","cosTh","a00","a01","a10","a11","x0","y0","sfactorSq","sfactor","xc","yc","th0","atan2","thArc","segments","th2","th3","cx1","cy1","th1","thHalf","svgPathToOperators","path","commands","curArg","foundDecimal","path_1","drawText","graphicsState","rotate","xSkew","ySkew","Boolean","drawLinesOfText","drawImage","drawPage","xScale","yScale","drawLine","thickness","lineCap","drawRectangle","borderColor","borderLineCap","borderDashArray","borderDashPhase","KAPPA","drawEllipsePath","config","xe","ye","xm","ym","drawEllipse","centerX","centerY","drawSvgPath","drawCheckMark","rotateInPlace","drawCheckBox","outline","filled","checkMarkSize","checkMark","markColor","drawRadioButton","outlineScale","dotColor","drawButton","background","drawTextLines","textLines","textColor","fontSize","drawTextField","clipX","clipY","clipWidth","clipHeight","clippingArea","markedContent","drawOptionList","highlights","selectedLines","selectedColor","EncryptedPDFError","FontkitNotRegisteredError","ForeignPageError","RemovePageFromEmptyDocumentError","NoSuchFieldError","UnexpectedFieldTypeError","MissingOnValueCheckError","FieldAlreadyExistsError","InvalidFieldNamePartError","namePart","FieldExistsAsNonTerminalError","RichTextFieldReadError","fieldName","CombedTextLayoutError","lineLength","cellCount","ExceededMaxLengthError","textLength","InvalidMaxLengthError","StandardFonts","lastIndexOfWhitespace","splitOutLines","lastWhitespaceIdx","remainder","layoutMultilineText","alignment","bounds","heightAtSize","prevRemainder","Left","Center","Right","layoutCombedText","cellWidth","cellHeight","computeCombedFontSize","cells","cellOffset","charOffset","charLength","layoutSinglelineText","computeFontSize","normalizeAppearance","findLastMatch","lastMatch","tfRegex","getDefaultFontSize","daMatch","defaultFontSize","colorRegex","getDefaultColor","c1","c3","c4","updateDefaultAppearance","defaultCheckBoxAppearanceProvider","checkBox","widgetColor","fieldColor","acroField","black","normalBackgroundColor","downBackgroundColor","defaultRadioGroupAppearanceProvider","radioGroup","defaultButtonAppearanceProvider","button","widgetFontSize","fieldFontSize","normalText","downText","normalLayout","downLayout","defaultTextFieldAppearanceProvider","textField","getText","isCombed","isMultiline","getAlignment","defaultDropdownAppearanceProvider","dropdown","getSelected","defaultOptionListAppearanceProvider","optionList","selected","isSorted","PDFEmbeddedPage","doc","embedder","alreadyEmbedded","PDFDocument","factor","embed","PDFFont","modified","sizeAtHeight","getCharacterSet","PDFImage","scaleToFit","imgWidthScale","imgHeightScale","assertFieldAppearanceOptions","backgroundColor","PDFField","getName","isReadOnly","ReadOnly","enableReadOnly","disableReadOnly","isRequired","Required","enableRequired","disableRequired","isExported","NoExport","enableExporting","disableExporting","needsAppearancesUpdate","defaultUpdateAppearances","_font","markAsDirty","getForm","markFieldAsDirty","markAsClean","markFieldAsClean","isDirty","fieldIsDirty","createWidget","degreesAngle","caption","newDa","updateWidgetAppearanceWithFont","updateWidgetAppearances","createAppearanceStream","updateOnOffWidgetAppearance","createAppearanceDict","onStreamRef","offStreamRef","appearanceDict","PDFCheckBox","acroCheckBox","uncheck","isChecked","addToPage","PDFPage","widgetRef","updateWidgetAppearance","updateAppearances","provider","PDFDropdown","acroComboBox","rawOptions","optionObjects","addOptions","optionsArr","existingOptions","newOptions","select","merge","validOptions","option","enableEditing","enableMultiselect","existingValues","clear","isEditable","disableEditing","Sort","enableSorting","disableSorting","isMultiselect","disableMultiselect","isSpellChecked","DoNotSpellCheck","enableSpellChecking","disableSpellChecking","isSelectOnClick","CommitOnSelChange","enableSelectOnClick","disableSelectOnClick","getDefaultFont","PDFOptionList","acroListBox","PDFRadioGroup","acroRadioButton","exportOptions","onOptions","isOffToggleable","NoToggleToOff","enableOffToggling","disableOffToggling","isMutuallyExclusive","RadiosInUnison","enableMutualExclusion","disableMutualExclusion","addOptionToPage","_j","PDFSignature","acroSignature","PDFTextField","acroText","isRichFormatted","setText","disableRichFormatting","setAlignment","Multiline","enableMultiline","disableMultiline","isPassword","Password","enablePassword","disablePassword","isFileSelector","FileSelect","enableFileSelection","disableFileSelection","isScrollable","DoNotScroll","enableScrolling","disableScrolling","Comb","enableCombing","disableCombing","RichText","enableRichFormatting","ParseSpeeds","PDFForm","embedDefaultFont","embedStandardFont","dirtyFields","Set","defaultFontCache","hasXFA","deleteXFA","convertToPDFField","getFieldMaybe","getField","getButton","PDFButton","getCheckBox","getDropdown","getOptionList","getRadioGroup","getSignature","getTextField","createButton","nameParts","splitFieldName","findOrCreateNonTerminals","nonTerminal","terminal","addFieldToParent","createCheckBox","createDropdown","comboBox","createOptionList","listBox","createRadioGroup","radioButton","createTextField","updateFieldAppearances","fieldRef","add","partialNames","parent_1","findNonTerminal","nodeRef","fullyQualifiedName","PageSizes","4A0","2A0","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","B10","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","C10","RA0","RA1","RA2","RA3","RA4","SRA0","SRA1","SRA2","SRA3","SRA4","Executive","Folio","Legal","Letter","Tabloid","BlendMode","PDFEmbeddedFile","Names","EmbeddedFiles","EFNames","catalog","ignoreEncryption","updateMetadata","defaultWordBreaks","computePages","pageMap","getOrCreateForm","isEncrypted","pageCache","formCache","fonts","images","embeddedPages","embeddedFiles","updateInfoDict","pdf","parseSpeed","Slow","pageTree","pageTreeRef","registerFontkit","form","getTitle","title","getInfoDict","assertIsLiteralOrHexString","getAuthor","author","getSubject","subject","getKeywords","keywords","getCreator","creator","getProducer","producer","getCreationDate","getModificationDate","setTitle","setAuthor","setSubject","setKeywords","setCreator","setProducer","setLanguage","language","setCreationDate","setModificationDate","getPageCount","pageCount","getPages","getPage","getPageIndices","removePage","addPage","insertPage","setSize","copyPages","srcDoc","copier","srcPages","copiedPages","srcPage","copiedPage","attach","attachment","embeddedFile","embedFont","pdfFont","assertFontkit","embedJpg","jpg","pdfImage","embedPng","embedPdf","embedPages","embedPage","boundingBoxes","transformationMatrices","currPage","nextPage","maybeCopyPage","box","matrix","embedAll","save","useObjectStreams","addDefaultPage","saveAsBase64","otherOptions","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__rest","embeddables","pdfLib","now","info","existingInfo","newInfo","pdfObject","leafNode","fontColor","getMediaBox","setMediaBox","cropBox","getCropBox","bleedBox","getBleedBox","trimBox","getTrimBox","artBox","getArtBox","hasCropBox","hasBleedBox","hasTrimBox","hasArtBox","setCropBox","setBleedBox","setTrimBox","setArtBox","getSize","setHeight","getHeight","translateContent","getContentStream","createContentStream","startRef","endRef","resetPosition","setFont","fontKey","setFontSize","setFontColor","getPosition","getX","getY","moveDown","yDecrease","moveUp","yIncrease","moveLeft","xDecrease","moveRight","xIncrease","pushOperators","operator","opacity","blendMode","originalFont","getFont","encodedLines","graphicsStateKey","maybeEmbedGraphicsState","xObjectKey","embeddedPage","borderOpacity","_k","_l","_m","_o","drawSquare","drawCircle","useExisting","ca","BM","dummyRef","pageLeaf","acroPushButton","setImage","adj","imageDims","drawingArea","imageName","streamRef"],"mappings":";;;;;;;;;;;;;;AAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,IAGrB,SAASO,EAAUR,EAAGC,GAEzB,SAASQ,IAAOC,KAAKC,YAAcX,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEY,UAAkB,OAANX,EAAaC,OAAOW,OAAOZ,IAAMQ,EAAGG,UAAYX,EAAEW,UAAW,IAAIH,GAG5E,IAAIK,EAAW,WAQlB,OAPAA,EAAWZ,OAAOa,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,E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