

import * as wjcCore from 'wijmo/wijmo';


import * as wjcSelf from 'wijmo/wijmo.pdf';
window['wijmo'] = window['wijmo'] || {};
window['wijmo']['pdf'] = wjcSelf;

/*
    *
    * Wijmo Library 5.20173.409
    * http://wijmo.com/
    *
    * Copyright(c) GrapeCity, Inc.  All rights reserved.
    *
    * Licensed under the GrapeCity Commercial License.
    * sales@wijmo.com
    * wijmo.com/products/wijmo-5/license/
    *
    */
// Merge with future versions notes.
// In order to bring this file to work as a part of external module we had to rename the following 
// identifiers: 
// exports to localExports
// module to localModule
// define to localDefine
// require to localRequire
//
// In case of merging with a newer pdfkit version makes sense to do it in the following way:
// - Rename these identifiers back to their original names.
// - Perform merge.
// - Rename these identifiers back to the localXxx names.
// Use Match Whole Word and Match Case options of the Replace tool.
// Note that after renaming "module" to "localModule" you get the "module" keyword in the 
// module declarations replaced as well, you'll need to correct them after that.

declare global {
interface Function {
	__super__: any;
	__proto__: any;
}
}


	declare var localExports;
	declare var localModule;
	declare var localDefine;
	declare var global;
	declare var localRequire;
	declare var Symbol;

	(function (f) { if (typeof localExports === "object" && typeof localModule !== "undefined") { localModule.localExports = f() } else if (typeof localDefine === "function" && localDefine.amd) { localDefine([], f) } else { var g; if (typeof window !== "undefined") { g = window } else if (typeof global !== "undefined") { g = global } else if (typeof self !== "undefined") { g = self } else { g = this } g.PDFDocument = f() } })(function () {
		var localDefine, localModule, localExports; return (function e(t, n, r) { function s(o, u?) { if (!n[o]) { if (!t[o]) { var a = typeof localRequire == "function" && localRequire; if (!u && a) return a(o, !0); if (i) return i(o, !0); var f: any = new Error("Cannot find localModule '" + o + "'"); throw f.code = "localModule_NOT_FOUND", f } var l = n[o] = { localExports: {} }; t[o][0].call(l.localExports, function (e) { var n = t[o][1][e]; return s(n ? n : e) }, l, l.localExports, e, t, n, r) } return n[o].localExports } var i = typeof localRequire == "function" && localRequire; for (var o = 0; o < r.length; o++)s(r[o]); return s })({
			1: [function (localRequire, localModule, localExports) {
				var Data;

				Data = (function () {
					function Data(data) {
						this.data = data != null ? data : [];
						this.pos = 0;
						this.length = this.data.length;
					}

					Data.prototype.readByte = function () {
						return this.data[this.pos++];
					};

					Data.prototype.writeByte = function (byte) {
						return this.data[this.pos++] = byte;
					};

					Data.prototype.byteAt = function (index) {
						return this.data[index];
					};

					Data.prototype.readBool = function () {
						return !!this.readByte();
					};

					Data.prototype.writeBool = function (val) {
						return this.writeByte(val ? 1 : 0);
					};

					Data.prototype.readUInt32 = function () {
						var b1, b2, b3, b4;
						b1 = this.readByte() * 0x1000000;
						b2 = this.readByte() << 16;
						b3 = this.readByte() << 8;
						b4 = this.readByte();
						return b1 + b2 + b3 + b4;
					};

					Data.prototype.writeUInt32 = function (val) {
						this.writeByte((val >>> 24) & 0xff);
						this.writeByte((val >> 16) & 0xff);
						this.writeByte((val >> 8) & 0xff);
						return this.writeByte(val & 0xff);
					};

					Data.prototype.readInt32 = function () {
						var int;
						int = this.readUInt32();
						if (int >= 0x80000000) {
							return int - 0x100000000;
						} else {
							return int;
						}
					};

					Data.prototype.writeInt32 = function (val) {
						if (val < 0) {
							val += 0x100000000;
						}
						return this.writeUInt32(val);
					};

					Data.prototype.readUInt16 = function () {
						var b1, b2;
						b1 = this.readByte() << 8;
						b2 = this.readByte();
						return b1 | b2;
					};

					Data.prototype.writeUInt16 = function (val) {
						this.writeByte((val >> 8) & 0xff);
						return this.writeByte(val & 0xff);
					};

					Data.prototype.readInt16 = function () {
						var int;
						int = this.readUInt16();
						if (int >= 0x8000) {
							return int - 0x10000;
						} else {
							return int;
						}
					};

					Data.prototype.writeInt16 = function (val) {
						if (val < 0) {
							val += 0x10000;
						}
						return this.writeUInt16(val);
					};

					Data.prototype.readString = function (length) {
						var i, ret, _i;
						ret = [];
						for (i = _i = 0; 0 <= length ? _i < length : _i > length; i = 0 <= length ? ++_i : --_i) {
							ret[i] = String.fromCharCode(this.readByte());
						}
						return ret.join('');
					};

					Data.prototype.writeString = function (val) {
						var i, _i, _ref, _results;
						_results = [];
						for (i = _i = 0, _ref = val.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
							_results.push(this.writeByte(val.charCodeAt(i)));
						}
						return _results;
					};

					Data.prototype.stringAt = function (pos, length) {
						this.pos = pos;
						return this.readString(length);
					};

					Data.prototype.readShort = function () {
						return this.readInt16();
					};

					Data.prototype.writeShort = function (val) {
						return this.writeInt16(val);
					};

					Data.prototype.readLongLong = function () {
						var b1, b2, b3, b4, b5, b6, b7, b8;
						b1 = this.readByte();
						b2 = this.readByte();
						b3 = this.readByte();
						b4 = this.readByte();
						b5 = this.readByte();
						b6 = this.readByte();
						b7 = this.readByte();
						b8 = this.readByte();
						if (b1 & 0x80) {
							return ((b1 ^ 0xff) * 0x100000000000000 + (b2 ^ 0xff) * 0x1000000000000 + (b3 ^ 0xff) * 0x10000000000 + (b4 ^ 0xff) * 0x100000000 + (b5 ^ 0xff) * 0x1000000 + (b6 ^ 0xff) * 0x10000 + (b7 ^ 0xff) * 0x100 + (b8 ^ 0xff) + 1) * -1;
						}
						return b1 * 0x100000000000000 + b2 * 0x1000000000000 + b3 * 0x10000000000 + b4 * 0x100000000 + b5 * 0x1000000 + b6 * 0x10000 + b7 * 0x100 + b8;
					};

					Data.prototype.writeLongLong = function (val) {
						var high, low;
						high = Math.floor(val / 0x100000000);
						low = val & 0xffffffff;
						this.writeByte((high >> 24) & 0xff);
						this.writeByte((high >> 16) & 0xff);
						this.writeByte((high >> 8) & 0xff);
						this.writeByte(high & 0xff);
						this.writeByte((low >> 24) & 0xff);
						this.writeByte((low >> 16) & 0xff);
						this.writeByte((low >> 8) & 0xff);
						return this.writeByte(low & 0xff);
					};

					Data.prototype.readInt = function () {
						return this.readInt32();
					};

					Data.prototype.writeInt = function (val) {
						return this.writeInt32(val);
					};

					Data.prototype.slice = function (start, end) {
						return this.data.slice(start, end);
					};

					Data.prototype.read = function (bytes) {
						var buf, i, _i;
						buf = [];
						for (i = _i = 0; 0 <= bytes ? _i < bytes : _i > bytes; i = 0 <= bytes ? ++_i : --_i) {
							buf.push(this.readByte());
						}
						return buf;
					};

					Data.prototype.write = function (bytes) {
						var byte, _i, _len, _results;
						_results = [];
						for (_i = 0, _len = bytes.length; _i < _len; _i++) {
							byte = bytes[_i];
							_results.push(this.writeByte(byte));
						}
						return _results;
					};

					return Data;

				})();

				localModule.localExports = Data;

			}, {}], 2: [function (localRequire, localModule, localExports) {
				(function (Buffer) {

					/*
					PDFDocument - represents an entire PDF document
					By Devon Govett
					 */
					var PDFDocument, PDFObject, PDFPage, PDFReference, fs, stream,
						__hasProp = {}.hasOwnProperty,
						__extends = function (child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

					stream = localRequire('stream');

					fs = localRequire('fs');

					PDFObject = localRequire('./object');

					PDFReference = localRequire('./reference');

					PDFPage = localRequire('./page');

					PDFDocument = (function (_super) {
						var mixin;

						__extends(PDFDocument, _super);

						function PDFDocument(options) {
							var key, val, _ref, _ref1;
							this.options = options != null ? options : {};
							PDFDocument.__super__.constructor.apply(this, arguments);
							this.version = 1.3;
							this.compress = (_ref = this.options.compress) != null ? _ref : true;
							this._pageBuffer = [];
							this._pageBufferStart = 0;
							this._offsets = [];
							this._waiting = 0;
							this._ended = false;
							this._offset = 0;
							this._root = this.ref({
								Type: 'Catalog',
								Pages: this.ref({
									Type: 'Pages',
									Count: 0,
									Kids: []
								})
							});
							this.page = null;
							this.initColor();
							this.initVector();
							this.initFonts();
							this.initText();
							this.initImages();
							this.info = {
								Producer: 'PDFKit',
								Creator: 'PDFKit',
								CreationDate: new Date()
							};
							if (this.options.info) {
								_ref1 = this.options.info;
								for (key in _ref1) {
									val = _ref1[key];
									this.info[key] = val;
								}
							}
							this._write("%PDF-" + this.version);
							this._write("%\xFF\xFF\xFF\xFF");
							// GrapeCity begin
							if (this.options.pageAdding) {
								this.on('pageAdding', this.options.pageAdding);
							}
							if (this.options.pageAdded) {
								this.on('pageAdded', this.options.pageAdded);
							}
							// GrapeCity end
							if (this.options.autoFirstPage !== false) {
								this.addPage();
							}
						}

						mixin = function (methods) {
							var method, name, _results;
							_results = [];
							for (name in methods) {
								method = methods[name];
								_results.push(PDFDocument.prototype[name] = method);
							}
							return _results;
						};

						mixin(localRequire('./mixins/color'));

						mixin(localRequire('./mixins/vector'));

						mixin(localRequire('./mixins/fonts'));

						mixin(localRequire('./mixins/text'));

						mixin(localRequire('./mixins/images'));

						mixin(localRequire('./mixins/annotations'));

						PDFDocument.prototype.addPage = function (options) {
							var pages;
							if (options == null) {
								options = this.options;
							}
							// GrapeCity begin
							this.emit('pageAdding', this, options);
							// GrapeCity end
							if (!this.options.bufferPages) {
								this.flushPages();
							}
							this.page = new PDFPage(this, options);
							this._pageBuffer.push(this.page);
							pages = this._root.data.Pages.data;
							pages.Kids.push(this.page.dictionary);
							pages.Count++;
							this.x = this.page.margins.left;
							this.y = this.page.margins.top;
							this._ctm = [1, 0, 0, 1, 0, 0];
							this.transform(1, 0, 0, -1, 0, this.page.height);
							// GrapeCity begin
							this.emit('pageAdded', this);
							// GrapeCity end
							return this;
						};

						PDFDocument.prototype.bufferedPageRange = function () {
							return {
								start: this._pageBufferStart,
								count: this._pageBuffer.length
							};
						};

						PDFDocument.prototype.switchToPage = function (n) {
							var page;
							if (!(page = this._pageBuffer[n - this._pageBufferStart])) {
								throw new Error("switchToPage(" + n + ") out of bounds, current buffer covers pages " + this._pageBufferStart + " to " + (this._pageBufferStart + this._pageBuffer.length - 1));
							}
							return this.page = page;
						};

						PDFDocument.prototype.flushPages = function () {
							var page, pages, _i, _len;
							pages = this._pageBuffer;
							this._pageBuffer = [];
							this._pageBufferStart += pages.length;
							for (_i = 0, _len = pages.length; _i < _len; _i++) {
								page = pages[_i];
								page.end();
							}
						};

						PDFDocument.prototype.ref = function (data) {
							var ref;
							ref = new PDFReference(this, this._offsets.length + 1, data);
							this._offsets.push(null);
							this._waiting++;
							return ref;
						};

						PDFDocument.prototype._read = function () { };

						PDFDocument.prototype._write = function (data) {
							if (!Buffer.isBuffer(data)) {
								data = new Buffer(data + '\n', 'binary');
							}
							this.push(data);
							return this._offset += data.length;
						};

						PDFDocument.prototype.addContent = function (data) {
							this.page.write(data);
							return this;
						};

						PDFDocument.prototype._refEnd = function (ref) {
							this._offsets[ref.id - 1] = ref.offset;
							if (--this._waiting === 0 && this._ended) {
								this._finalize();
								return this._ended = false;
							}
						};

						PDFDocument.prototype.write = function (filename, fn) {
							var err;
							err = new Error('PDFDocument#write is deprecated, and will be removed in a future version of PDFKit. Please pipe the document into a Node stream.');
							console.warn(err.stack);
							this.pipe(fs.createWriteStream(filename));
							this.end();
							return this.once('end', fn);
						};

						PDFDocument.prototype.output = function (fn) {
							throw new Error('PDFDocument#output is deprecated, and has been removed from PDFKit. Please pipe the document into a Node stream.');
						};

						PDFDocument.prototype.end = function () {
							var font, key, name, val, _ref, _ref1;
							// GrapeCity begin
							this.emit('ending');
							// GrapeCity end
							this.flushPages();
							this._info = this.ref();
							_ref = this.info;
							for (key in _ref) {
								val = _ref[key];
								if (typeof val === 'string') {
									val = new String(val);
								}
								this._info.data[key] = val;
							}
							this._info.end();
							_ref1 = this._fontFamilies;
							for (name in _ref1) {
								font = _ref1[name];
								font.finalize();
							}
							this._root.end();
							this._root.data.Pages.end();
							if (this._waiting === 0) {
								return this._finalize();
							} else {
								return this._ended = true;
							}
						};

						PDFDocument.prototype._finalize = function (fn) {
							var offset, xRefOffset, _i, _len, _ref;
							xRefOffset = this._offset;
							this._write("xref");
							this._write("0 " + (this._offsets.length + 1));
							this._write("0000000000 65535 f ");
							_ref = this._offsets;
							for (_i = 0, _len = _ref.length; _i < _len; _i++) {
								offset = _ref[_i];
								offset = ('0000000000' + offset).slice(-10);
								this._write(offset + ' 00000 n ');
							}
							this._write('trailer');
							this._write(PDFObject.convert({
								Size: this._offsets.length + 1,
								Root: this._root,
								Info: this._info
							}));
							this._write('startxref');
							this._write("" + xRefOffset);
							this._write('%%EOF');
							return this.push(null);
						};

						PDFDocument.prototype.toString = function () {
							return "[object PDFDocument]";
						};

						return PDFDocument;

					})(stream.Readable);

					localModule.localExports = PDFDocument;

				}).call(this, localRequire("buffer").Buffer)

			}, { "./mixins/annotations": 12, "./mixins/color": 13, "./mixins/fonts": 14, "./mixins/images": 15, "./mixins/text": 16, "./mixins/vector": 17, "./object": 18, "./page": 19, "./reference": 21, "buffer": 60, "fs": 59, "stream": 216 }], 3: [function (localRequire, localModule, localExports) {
				(function (Buffer) {
					var EmbeddedFont, PDFFont, StandardFont, fontkit;

					fontkit = localRequire('fontkit');

					PDFFont = (function () {
						(<any>PDFFont).open = function (document, src, family, id) {
							var font;
							if (typeof src === 'string') {
								if (StandardFont.isStandardFont(src)) {
									return new StandardFont(document, src, id);
								}
								//font = fontkit.openSync(src, family);
							} else if (Buffer.isBuffer(src)) {
								font = fontkit.create(src, family);
							} else if (src instanceof Uint8Array) {
								font = fontkit.create(new Buffer(src), family);
							} else if (src instanceof ArrayBuffer) {
								font = fontkit.create(new Buffer(new Uint8Array(src)), family);
							}
							if (font == null) {
								throw new Error('Not a supported font format or standard PDF font.');
							}
							return new EmbeddedFont(document, font, id);
						};

						function PDFFont() {
							throw new Error('Cannot construct a PDFFont directly.');
						}

						PDFFont.prototype.encode = function (text) {
							throw new Error('Must be implemented by subclasses');
						};

						PDFFont.prototype.widthOfString = function (text) {
							throw new Error('Must be implemented by subclasses');
						};

						PDFFont.prototype.ref = function () {
							return this.dictionary != null ? this.dictionary : this.dictionary = this.document.ref();
						};

						PDFFont.prototype.finalize = function () {
							if (this.embedded || (this.dictionary == null)) {
								return;
							}
							this.embed();
							return this.embedded = true;
						};

						PDFFont.prototype.embed = function () {
							throw new Error('Must be implemented by subclasses');
						};

						PDFFont.prototype.lineHeight = function (size, includeGap) {
							var gap;
							if (includeGap == null) {
								includeGap = false;
							}
							gap = includeGap ? this.lineGap : 0;
							return (this.ascender + gap - this.descender) / 1000 * size;
						};

						// GrapeCity begin
						PDFFont.prototype.getAscender = function (size) {
							return this.ascender / 1000 * size;
						};

						PDFFont.prototype.getBBox = function (size) {
							return {
								llx: this.bbox[0] / 1000 * size,
								lly: this.bbox[1] / 1000 * size,
								urx: this.bbox[2] / 1000 * size,
								ury: this.bbox[3] / 1000 * size,
							}
						}
						// GrapeCity end

						return PDFFont;

					})();

					localModule.localExports = PDFFont;

					StandardFont = localRequire('./font/standard');

					EmbeddedFont = localRequire('./font/embedded');

				}).call(this, localRequire("buffer").Buffer)

			}, { "./font/embedded": 5, "./font/standard": 6, "buffer": 60, "fontkit": 165 }], 4: [function (localRequire, localModule, localExports) {

				var AFMFont, fs;

				//fs = localRequire('fs');
				var base64 = localRequire('base64-js');

				// GrapeCity begin: the class has been reworked to support compressed AFM.
				AFMFont = (function () {
					var WIN_ANSI_MAP = { 402: 131, 8211: 150, 8212: 151, 8216: 145, 8217: 146, 8218: 130, 8220: 147, 8221: 148, 8222: 132, 8224: 134, 8225: 135, 8226: 149, 8230: 133, 8364: 128, 8240: 137, 8249: 139, 8250: 155, 710: 136, 8482: 153, 338: 140, 339: 156, 732: 152, 352: 138, 353: 154, 376: 159, 381: 142, 382: 158 };
					var CHAR_TABLE = "space:exclam:quotedbl:numbersign:dollar:percent:ampersand:quoteright:parenleft:parenright:asterisk:plus:comma:hyphen:period:slash:zero:one:two:three:four:five:six:seven:eight:nine:colon:semicolon:less:equal:greater:question:at:A:B:C:D:E:F:G:H:I:J:K:L:M:N:O:P:Q:R:S:T:U:V:W:X:Y:Z:bracketleft:backslash:bracketright:asciicircum:underscore:quoteleft:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:braceleft:bar:braceright:asciitilde:exclamdown:cent:sterling:fraction:yen:florin:section:currency:quotesingle:quotedblleft:guillemotleft:guilsinglleft:guilsinglright:fi:fl:endash:dagger:daggerdbl:periodcentered:paragraph:bullet:quotesinglbase:quotedblbase:quotedblright:guillemotright:ellipsis:perthousand:questiondown:grave:acute:circumflex:tilde:macron:breve:dotaccent:dieresis:ring:cedilla:hungarumlaut:ogonek:caron:emdash:AE:ordfeminine:Lslash:Oslash:OE:ordmasculine:ae:dotlessi:lslash:oslash:oe:germandbls:Idieresis:eacute:abreve:uhungarumlaut:ecaron:Ydieresis:divide:Yacute:Acircumflex:aacute:Ucircumflex:yacute:scommaaccent:ecircumflex:Uring:Udieresis:aogonek:Uacute:uogonek:Edieresis:Dcroat:commaaccent:copyright:Emacron:ccaron:aring:Ncommaaccent:lacute:agrave:Tcommaaccent:Cacute:atilde:Edotaccent:scaron:scedilla:iacute:lozenge:Rcaron:Gcommaaccent:ucircumflex:acircumflex:Amacron:rcaron:ccedilla:Zdotaccent:Thorn:Omacron:Racute:Sacute:dcaron:Umacron:uring:threesuperior:Ograve:Agrave:Abreve:multiply:uacute:Tcaron:partialdiff:ydieresis:Nacute:icircumflex:Ecircumflex:adieresis:edieresis:cacute:nacute:umacron:Ncaron:Iacute:plusminus:brokenbar:registered:Gbreve:Idotaccent:summation:Egrave:racute:omacron:Zacute:Zcaron:greaterequal:Eth:Ccedilla:lcommaaccent:tcaron:eogonek:Uogonek:Aacute:Adieresis:egrave:zacute:iogonek:Oacute:oacute:amacron:sacute:idieresis:Ocircumflex:Ugrave:Delta:thorn:twosuperior:Odieresis:mu:igrave:ohungarumlaut:Eogonek:dcroat:threequarters:Scedilla:lcaron:Kcommaaccent:Lacute:trademark:edotaccent:Igrave:Imacron:Lcaron:onehalf:lessequal:ocircumflex:ntilde:Uhungarumlaut:Eacute:emacron:gbreve:onequarter:Scaron:Scommaaccent:Ohungarumlaut:degree:ograve:Ccaron:ugrave:radical:Dcaron:rcommaaccent:Ntilde:otilde:Rcommaaccent:Lcommaaccent:Atilde:Aogonek:Aring:Otilde:zdotaccent:Ecaron:Iogonek:kcommaaccent:minus:Icircumflex:ncaron:tcommaaccent:logicalnot:odieresis:udieresis:notequal:gcommaaccent:eth:zcaron:ncommaaccent:onesuperior:imacron:Euro:universal:existential:suchthat:asteriskmath:congruent:Alpha:Beta:Chi:Epsilon:Phi:Gamma:Eta:Iota:theta1:Kappa:Lambda:Mu:Nu:Omicron:Pi:Theta:Rho:Sigma:Tau:Upsilon:sigma1:Omega:Xi:Psi:Zeta:therefore:perpendicular:radicalex:alpha:beta:chi:delta:epsilon:phi:gamma:eta:iota:phi1:kappa:lambda:nu:omicron:pi:theta:rho:sigma:tau:upsilon:omega1:omega:xi:psi:zeta:similar:Upsilon1:minute:infinity:club:diamond:heart:spade:arrowboth:arrowleft:arrowup:arrowright:arrowdown:second:proportional:equivalence:approxequal:arrowvertex:arrowhorizex:carriagereturn:aleph:Ifraktur:Rfraktur:weierstrass:circlemultiply:circleplus:emptyset:intersection:union:propersuperset:reflexsuperset:notsubset:propersubset:reflexsubset:element:notelement:angle:gradient:registerserif:copyrightserif:trademarkserif:product:dotmath:logicaland:logicalor:arrowdblboth:arrowdblleft:arrowdblup:arrowdblright:arrowdbldown:angleleft:registersans:copyrightsans:trademarksans:parenlefttp:parenleftex:parenleftbt:bracketlefttp:bracketleftex:bracketleftbt:bracelefttp:braceleftmid:braceleftbt:braceex:angleright:integral:integraltp:integralex:integralbt:parenrighttp:parenrightex:parenrightbt:bracketrighttp:bracketrightex:bracketrightbt:bracerighttp:bracerightmid:bracerightbt:apple:a1:a2:a202:a3:a4:a5:a119:a118:a117:a11:a12:a13:a14:a15:a16:a105:a17:a18:a19:a20:a21:a22:a23:a24:a25:a26:a27:a28:a6:a7:a8:a9:a10:a29:a30:a31:a32:a33:a34:a35:a36:a37:a38:a39:a40:a41:a42:a43:a44:a45:a46:a47:a48:a49:a50:a51:a52:a53:a54:a55:a56:a57:a58:a59:a60:a61:a62:a63:a64:a65:a66:a67:a68:a69:a70:a71:a72:a73:a74:a203:a75:a204:a76:a77:a78:a79:a81:a82:a83:a84:a97:a98:a99:a100:a89:a90:a93:a94:a91:a92:a205:a85:a206:a86:a87:a88:a95:a96:a101:a102:a103:a104:a106:a107:a108:a112:a111:a110:a109:a120:a121:a122:a123:a124:a125:a126:a127:a128:a129:a130:a131:a132:a133:a134:a135:a136:a137:a138:a139:a140:a141:a142:a143:a144:a145:a146:a147:a148:a149:a150:a151:a152:a153:a154:a155:a156:a157:a158:a159:a160:a161:a163:a164:a196:a165:a192:a166:a167:a168:a169:a170:a171:a172:a173:a162:a174:a175:a176:a177:a178:a179:a193:a180:a199:a181:a200:a182:a201:a183:a184:a197:a185:a194:a198:a186:a195:a187:a188:a189:a190:a191".split(":"),
						CHARACTERS = ".notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde .notdef Euro .notdef quotesinglbase florin quotedblbase ellipsis dagger daggerdbl circumflex perthousand Scaron guilsinglleft OE .notdef Zcaron .notdef .notdef quoteleft quoteright quotedblleft quotedblright bullet endash emdash tilde trademark scaron guilsinglright oe .notdef zcaron ydieresis space exclamdown cent sterling currency yen brokenbar section dieresis copyright ordfeminine guillemotleft logicalnot hyphen registered macron degree plusminus twosuperior threesuperior acute mu paragraph periodcentered cedilla onesuperior ordmasculine guillemotright onequarter onehalf threequarters questiondown Agrave Aacute Acircumflex Atilde Adieresis Aring AE Ccedilla Egrave Eacute Ecircumflex Edieresis Igrave Iacute Icircumflex Idieresis Eth Ntilde Ograve Oacute Ocircumflex Otilde Odieresis multiply Oslash Ugrave Uacute Ucircumflex Udieresis Yacute Thorn germandbls agrave aacute acircumflex atilde adieresis aring ae ccedilla egrave eacute ecircumflex edieresis igrave iacute icircumflex idieresis eth ntilde ograve oacute ocircumflex otilde odieresis divide oslash ugrave uacute ucircumflex udieresis yacute thorn ydieresis".split(" ");

					//(<any>AFMFont).open = function (filename) {
					//	return new AFMFont(fs.readFileSync(filename, 'utf8'));
					//};

					function AFMFont(contents) {
						this.bbox = this._parseFontBBox(contents[1]);
						this.ascender = contents[4];
						this.descender = contents[5];
						this.glyphWidths = this._parseGlyphWidths(contents[6]);
						this.charWidths = this._getCharWidths();
						this.kernPairs = this._parseKerningPairs(contents[7]);
						this.lineGap = (this.bbox[3] - this.bbox[1]) - (this.ascender - this.descender);
					}

					AFMFont.prototype.encodeText = function (text) {
						var res = [];

						for (var i = 0; i < text.length; i++) {
							var char = text.charCodeAt(i);
							char = WIN_ANSI_MAP[char] || char;
							res.push(char.toString(16));
						}

						return res;
					};

					AFMFont.prototype.glyphsForString = function (text) {
						var res = [];

						for (var i = 0; i < text.length; i++) {
							var charCode = text.charCodeAt(i);
							res.push(this.characterToGlyph(charCode));
						}

						return res;
					};

					AFMFont.prototype.characterToGlyph = function (character) {
						return CHARACTERS[WIN_ANSI_MAP[character] || character] || '.notdef';
					};

					AFMFont.prototype.widthOfGlyph = function (glyph) {
						return this.glyphWidths[glyph] || 0;
					};

					AFMFont.prototype.getKernPair = function (left, right) {
						return this.kernPairs[left + '\0' + right] || 0;
					};

					AFMFont.prototype.advancesForGlyphs = function (glyphs) {
						var res = [];

						for (var i = 0; i < glyphs.length; i++) {
							var left = glyphs[i],
								right = glyphs[i + 1];

							res.push(this.widthOfGlyph(left) + this.getKernPair(left, right));
						}

						return res;
					};

					AFMFont.prototype._parseFontBBox = function (val) {
						var tmp = val.split(":"),
							res = [];

						for (var i = 0; i < tmp.length; i++) {
							res.push(parseInt(tmp[i]));
						}

						return res;
					};

					AFMFont.prototype._getCharWidths = function () {
						var res = [];

						for (var i = 0; i <= 255; i++) {
							res.push(this.glyphWidths[CHARACTERS[i]]);
						}

						return res;
					};

					AFMFont.prototype._parseGlyphWidths = function (val) {
						var widths = val.split(","),
							res = {},
							width: number;

						if (widths.length === 1) {
							var m = widths[0].match(/(^\d+)-(\d+):(\d+)$/),
								start = parseInt(m[1]),
								end = parseInt(m[2]);

							width = parseInt(m[3]);

							for (var i = start; i <= end; i++) {
								res[CHAR_TABLE[i]] = width;
							}
						}
						else {
							var charTableIndex = 0;
							for (var i = 0; i < widths.length; i++) {
								var pair = widths[i].split(":");

								if (pair.length == 1) {
									width = parseInt(pair[0]);
								}
								else {
									charTableIndex = parseInt(pair[0]);
									width = parseInt(pair[1]);
								}

								res[CHAR_TABLE[charTableIndex++]] = width;
							}
						}
						return res;
					};

					AFMFont.prototype._parseKerningPairs = function (val) {
						var res = {};
						//if (val) {
						//	var b1Mask = 255,
						//		b2Mask = 128,
						//		cycle = 1, // [1..8]
						//		tmp = [],
						//		bytes = base64.toByteArray(val); // A bit vector, each value is packed into 9 bit (LE).

						//	for (var i = 0; i < bytes.length - 1; i++) {
						//		var b1 = bytes[i];
						//		var b2 = bytes[i + 1];

						//		b1 = (b1 & b1Mask) << cycle;
						//		b2 = (b2 & b2Mask) >> (8 - cycle);
						//		tmp.push(b1 | b2);
						//		b1Mask = b1Mask >> 1;
						//		b2Mask = (b2Mask >> 1) | 128;
						//		cycle++;

						//		if (cycle > 8) {
						//			i++; // skip one byte because it is fully processed.
						//			cycle = 1;
						//			b1Mask = 255;
						//			b2Mask = 128;
						//		}
						//	}

						//	// now tmp is an array of triplets <firstCharIndex, secondCharIndex, kerning>
						//	for (var i = 0; i < tmp.length - 2; i = i + 3) {
						//		var kerning = tmp[i + 2],
						//			first = CHAR_TABLE[tmp[i]],
						//			second = CHAR_TABLE[tmp[i + 1]];

						//		kerning = kerning > 255
						//			? -(kerning & 255) // handle negative value, "sign and magnitude" representation.
						//			: kerning;

						//		res[first + '\0' + second] = kerning;
						//	}
						//}
						return res;
					};

					return AFMFont;

				})();

				localModule.localExports = AFMFont;

			}, { /*"fs": 59 */ "base64-js": 45 }], 5: [function (localRequire, localModule, localExports) {
				var EmbeddedFont, PDFFont, PDFObject,
					__hasProp = {}.hasOwnProperty,
					__extends = function (child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
					__slice = [].slice;

				PDFFont = localRequire('../font');

				PDFObject = localRequire('../object');

				EmbeddedFont = (function (_super) {
					var toHex;

					__extends(EmbeddedFont, _super);

					function EmbeddedFont(document, font, id) {
						this.document = document;
						this.font = font;
						this.id = id;
						this.subset = this.font.createSubset();
						this.unicode = [[0]];
						this.widths = [this.font.getGlyph(0).advanceWidth];
						this.name = this.font.postscriptName;
						this.scale = 1000 / this.font.unitsPerEm;
						this.ascender = this.font.ascent * this.scale;
						this.descender = this.font.descent * this.scale;
						this.lineGap = this.font.lineGap * this.scale;
						this.bbox = this.font.bbox;
					}

					EmbeddedFont.prototype.encode = function (text, features) {
						var gid, glyph, glyphs, i, key, positions, res, _base, _base1, _i, _len, _ref;
						_ref = this.font.layout(text, features), glyphs = _ref.glyphs, positions = _ref.positions;
						res = [];
						for (i = _i = 0, _len = glyphs.length; _i < _len; i = ++_i) {
							glyph = glyphs[i];
							gid = this.subset.includeGlyph(glyph.id);
							res.push(('0000' + gid.toString(16)).slice(-4));
							if ((_base = this.widths)[gid] == null) {
								_base[gid] = glyph.advanceWidth * this.scale;
							}
							if ((_base1 = this.unicode)[gid] == null) {
								_base1[gid] = glyph.codePoints;
							}
							for (key in positions[i]) {
								positions[i][key] *= this.scale;
							}
							positions[i].advanceWidth = glyph.advanceWidth * this.scale;
						}
						return [res, positions];
					};

					EmbeddedFont.prototype.widthOfString = function (string, size, features) {
						var scale, width;
						width = this.font.layout(string, features).advanceWidth;
						scale = size / this.font.unitsPerEm;
						return width * scale;
					};

					EmbeddedFont.prototype.embed = function () {
						var bbox, descendantFont, descriptor, familyClass, flags, fontFile, i, isCFF, name, tag, _ref;
						//isCFF = this.subset.cff != null;
						fontFile = this.document.ref();
						//if (isCFF) {
						//	fontFile.data.Subtype = 'CIDFontType0C';
						//}
						this.subset.encodeStream().pipe(fontFile);
						familyClass = (((_ref = this.font['OS/2']) != null ? _ref.sFamilyClass : void 0) || 0) >> 8;
						flags = 0;
						if (this.font.post.isFixedPitch) {
							flags |= 1 << 0;
						}
						if ((1 <= familyClass && familyClass <= 7)) {
							flags |= 1 << 1;
						}
						flags |= 1 << 2;
						if (familyClass === 10) {
							flags |= 1 << 3;
						}
						if (this.font.head.macStyle.italic) {
							flags |= 1 << 6;
						}
						tag = ((function () {
							var _i, _results;
							_results = [];
							for (i = _i = 0; _i < 6; i = ++_i) {
								_results.push(String.fromCharCode(Math.random() * 26 + 65));
							}
							return _results;
						})()).join('');
						name = tag + '+' + this.font.postscriptName;
						bbox = this.font.bbox;
						descriptor = this.document.ref({
							Type: 'FontDescriptor',
							FontName: name,
							Flags: flags,
							FontBBox: [bbox.minX * this.scale, bbox.minY * this.scale, bbox.maxX * this.scale, bbox.maxY * this.scale],
							ItalicAngle: this.font.italicAngle,
							Ascent: this.ascender,
							Descent: this.descender,
							CapHeight: (this.font.capHeight || this.font.ascent) * this.scale,
							XHeight: (this.font.xHeight || 0) * this.scale,
							StemV: 0
						});
						if (isCFF) {
							descriptor.data.FontFile3 = fontFile;
						} else {
							descriptor.data.FontFile2 = fontFile;
						}
						descriptor.end();
						descendantFont = this.document.ref({
							Type: 'Font',
							Subtype: /*isCFF ? 'CIDFontType0' :*/ 'CIDFontType2',
							BaseFont: name,
							CIDSystemInfo: {
								Registry: new String('Adobe'),
								Ordering: new String('Identity'),
								Supplement: 0
							},
							FontDescriptor: descriptor,
							W: [0, this.widths]
						});
						descendantFont.end();
						this.dictionary.data = {
							Type: 'Font',
							Subtype: 'Type0',
							BaseFont: name,
							Encoding: 'Identity-H',
							DescendantFonts: [descendantFont],
							ToUnicode: this.toUnicodeCmap()
						};
						return this.dictionary.end();
					};

					toHex = function () {
						var code, codePoints, codes;
						codePoints = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
						codes = (function () {
							var _i, _len, _results;
							_results = [];
							for (_i = 0, _len = codePoints.length; _i < _len; _i++) {
								code = codePoints[_i];
								_results.push(('0000' + code.toString(16)).slice(-4));
							}
							return _results;
						})();
						return codes.join('');
					};

					EmbeddedFont.prototype.toUnicodeCmap = function () {
						var cmap, codePoints, encoded, entries, value, _i, _j, _len, _len1, _ref;
						cmap = this.document.ref();
						entries = [];
						_ref = this.unicode;
						for (_i = 0, _len = _ref.length; _i < _len; _i++) {
							codePoints = _ref[_i];
							encoded = [];
							for (_j = 0, _len1 = codePoints.length; _j < _len1; _j++) {
								value = codePoints[_j];
								if (value > 0xffff) {
									value -= 0x10000;
									encoded.push(toHex(value >>> 10 & 0x3ff | 0xd800));
									value = 0xdc00 | value & 0x3ff;
								}
								encoded.push(toHex(value));
							}
							entries.push("<" + (encoded.join(' ')) + ">");
						}
						cmap.end("/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><ffff>\nendcodespacerange\n1 beginbfrange\n<0000> <" + (toHex(entries.length - 1)) + "> [" + (entries.join(' ')) + "]\nendbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend");
						return cmap;
					};

					return EmbeddedFont;

				})(PDFFont);

				localModule.localExports = EmbeddedFont;

			}, { "../font": 3, "../object": 18 }], 6: [function (localRequire, localModule, localExports) {
				var AFMFont, PDFFont, StandardFont, fs,
					__hasProp = {}.hasOwnProperty,
					__extends = function (child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

				AFMFont = localRequire('./afm');

				PDFFont = localRequire('../font');

				fs = localRequire('fs');

				StandardFont = (function (_super) {
					var STANDARD_FONTS;

					__extends(StandardFont, _super);

					function StandardFont(document, name, id) {
						var _ref;
						this.document = document;
						this.name = name;
						this.id = id;
						this.font = new AFMFont(STANDARD_FONTS[this.name]());

						_ref = this.font, this.ascender = _ref.ascender, this.descender = _ref.descender, this.bbox = _ref.bbox, this.lineGap = _ref.lineGap;
					}

					StandardFont.prototype.embed = function () {
						this.dictionary.data = {
							Type: 'Font',
							BaseFont: this.name,
							Subtype: 'Type1',
							Encoding: 'WinAnsiEncoding'
						};
						return this.dictionary.end();
					};

					StandardFont.prototype.encode = function (text) {
						var advances, encoded, glyph, glyphs, i, positions, _i, _len;
						encoded = this.font.encodeText(text);
						glyphs = this.font.glyphsForString('' + text);
						advances = this.font.advancesForGlyphs(glyphs);
						positions = [];
						for (i = _i = 0, _len = glyphs.length; _i < _len; i = ++_i) {
							glyph = glyphs[i];
							positions.push({
								xAdvance: advances[i],
								yAdvance: 0,
								xOffset: 0,
								yOffset: 0,
								advanceWidth: this.font.widthOfGlyph(glyph)
							});
						}
						return [encoded, positions];
					};

					StandardFont.prototype.widthOfString = function (string, size) {
						var advance, advances, glyphs, scale, width, _i, _len;
						glyphs = this.font.glyphsForString('' + string);
						advances = this.font.advancesForGlyphs(glyphs);
						width = 0;
						for (_i = 0, _len = advances.length; _i < _len; _i++) {
							advance = advances[_i];
							width += advance;
						}
						scale = size / 1000;
						return width * scale;
					};

					(<any>StandardFont).isStandardFont = function (name) {
						return name in STANDARD_FONTS;
					};

					STANDARD_FONTS = {
						"Courier": function () {
							return [0, "-23:-250:715:805", 562, 426, 629, -157, "0-314:600"];
						},
						"Courier-Bold": function () {
							return [0, "-113:-250:749:801", 562, 439, 629, -157, "0-314:600"];
						},
						"Courier-Oblique": function () {
							return [-12, "-27:-250:849:805", 562, 426, 629, -157, "0-314:600"];
						},
						"Courier-BoldOblique": function () {
							return [-12, "-57:-250:869:801", 562, 439, 629, -157, "0-314:600"]
						},
						"Helvetica": function () {
							return [0, "-166:-225:1000:931", 718, 523, 718, -207, "278,278,355,556,556,889,667,222,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,222,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,167,556,556,556,556,191,333,556,333,333,500,500,556,556,556,278,537,350,222,333,333,556,1000,1000,611,333,333,333,333,333,333,333,333,333,333,333,333,333,1000,1000,370,556,778,1000,365,889,278,222,611,944,611,278,556,556,556,556,667,584,667,667,556,722,500,500,556,722,722,556,722,556,667,722,250,737,667,500,556,722,222,556,611,722,556,667,500,500,278,471,722,778,556,556,667,333,500,611,667,778,722,667,643,722,556,333,778,667,667,584,556,611,476,500,722,278,667,556,556,500,556,556,722,278,584,260,737,778,278,600,667,333,556,611,611,549,722,722,222,317,556,722,667,667,556,500,222,778,556,556,500,278,778,722,612,556,333,778,556,278,556,667,556,834,667,299,667,556,1000,556,278,278,556,834,549,556,556,722,667,556,556,834,667,667,778,400,556,722,556,453,722,333,722,556,722,556,667,667,667,778,500,667,278,500,584,278,556,278,584,556,556,549,556,556,500,556,333,278,556"];
						},
						"Helvetica-Bold": function () {
							return [0, "-170:-228:1003:962", 718, 532, 718, -207, "278,333,474,556,556,889,722,278,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,278,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,167,556,556,556,556,238,500,556,333,333,611,611,556,556,556,278,556,350,278,500,500,556,1000,1000,611,333,333,333,333,333,333,333,333,333,333,333,333,333,1000,1000,370,611,778,1000,365,889,278,278,611,944,611,278,556,556,611,556,667,584,667,722,556,722,556,556,556,722,722,556,722,611,667,722,250,737,667,556,556,722,278,556,611,722,556,667,556,556,278,494,722,778,611,556,722,389,556,611,667,778,722,667,743,722,611,333,778,722,722,584,611,611,494,556,722,278,667,556,556,556,611,611,722,278,584,280,737,778,278,600,667,389,611,611,611,549,722,722,278,389,556,722,722,722,556,500,278,778,611,556,556,278,778,722,612,611,333,778,611,278,611,667,611,834,667,400,722,611,1000,556,278,278,611,834,549,611,611,722,667,556,611,834,667,667,778,400,611,722,611,549,722,389,722,611,722,611,722,722,722,778,500,667,278,556,584,278,611,333,584,611,611,549,611,611,500,611,333,278,556"];
						},
						"Helvetica-Oblique": function () {
							return [-12, "-170:-225:1116:931", 718, 523, 718, -207, "278,278,355,556,556,889,667,222,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,222,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,167,556,556,556,556,191,333,556,333,333,500,500,556,556,556,278,537,350,222,333,333,556,1000,1000,611,333,333,333,333,333,333,333,333,333,333,333,333,333,1000,1000,370,556,778,1000,365,889,278,222,611,944,611,278,556,556,556,556,667,584,667,667,556,722,500,500,556,722,722,556,722,556,667,722,250,737,667,500,556,722,222,556,611,722,556,667,500,500,278,471,722,778,556,556,667,333,500,611,667,778,722,667,643,722,556,333,778,667,667,584,556,611,476,500,722,278,667,556,556,500,556,556,722,278,584,260,737,778,278,600,667,333,556,611,611,549,722,722,222,317,556,722,667,667,556,500,222,778,556,556,500,278,778,722,612,556,333,778,556,278,556,667,556,834,667,299,667,556,1000,556,278,278,556,834,549,556,556,722,667,556,556,834,667,667,778,400,556,722,556,453,722,333,722,556,722,556,667,667,667,778,500,667,278,500,584,278,556,278,584,556,556,549,556,556,500,556,333,278,556"];
						},
						"Helvetica-BoldOblique": function () {
							return [-12, "-174:-228:1114:962", 718, 532, 718, -207, "278,333,474,556,556,889,722,278,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,278,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,167,556,556,556,556,238,500,556,333,333,611,611,556,556,556,278,556,350,278,500,500,556,1000,1000,611,333,333,333,333,333,333,333,333,333,333,333,333,333,1000,1000,370,611,778,1000,365,889,278,278,611,944,611,278,556,556,611,556,667,584,667,722,556,722,556,556,556,722,722,556,722,611,667,722,250,737,667,556,556,722,278,556,611,722,556,667,556,556,278,494,722,778,611,556,722,389,556,611,667,778,722,667,743,722,611,333,778,722,722,584,611,611,494,556,722,278,667,556,556,556,611,611,722,278,584,280,737,778,278,600,667,389,611,611,611,549,722,722,278,389,556,722,722,722,556,500,278,778,611,556,556,278,778,722,612,611,333,778,611,278,611,667,611,834,667,400,722,611,1000,556,278,278,611,834,549,611,611,722,667,556,611,834,667,667,778,400,611,722,611,549,722,389,722,611,722,611,722,722,722,778,500,667,278,556,584,278,611,333,584,611,611,549,611,611,500,611,333,278,556"];
						},
						"Times-Roman": function () {
							return [0, "-168:-218:1000:898", 662, 450, 683, -217, "250,333,408,500,500,833,778,333,333,333,500,564,250,333,250,278,500,500,500,500,500,500,500,500,500,500,278,278,564,564,564,444,921,722,667,667,722,611,556,722,722,333,389,722,611,889,722,722,556,722,667,556,611,722,722,944,722,722,611,333,278,333,469,500,333,444,500,444,500,444,333,500,500,278,278,500,278,778,500,500,500,500,333,389,278,500,500,722,500,500,444,480,200,480,541,333,500,500,167,500,500,500,500,180,444,500,333,333,556,556,500,500,500,250,453,350,333,444,444,500,1000,1000,444,333,333,333,333,333,333,333,333,333,333,333,333,333,1000,889,276,611,722,889,310,667,278,278,500,722,500,333,444,444,500,444,722,564,722,722,444,722,500,389,444,722,722,444,722,500,611,722,250,760,611,444,444,722,278,444,611,667,444,611,389,389,278,471,667,722,500,444,722,333,444,611,556,722,667,556,588,722,500,300,722,722,722,564,500,611,476,500,722,278,611,444,444,444,500,500,722,333,564,200,760,722,333,600,611,333,500,611,611,549,722,667,278,326,444,722,722,722,444,444,278,722,500,444,389,278,722,722,612,500,300,722,500,278,500,611,500,750,556,344,722,611,980,444,333,333,611,750,549,500,500,722,611,444,500,750,556,556,722,400,500,667,500,453,722,333,722,500,667,611,722,722,722,722,444,611,333,500,564,333,500,278,564,500,500,549,500,500,444,500,300,278,500"];
						},
						"Times-Bold": function () {
							return [0, "-168:-218:1000:935", 676, 461, 683, -217, "250,333,555,500,500,1000,833,333,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,930,722,667,722,722,667,611,778,778,389,500,778,667,944,722,778,611,778,722,556,667,722,722,1000,722,722,667,333,278,333,581,500,333,500,556,444,556,444,333,500,556,278,333,556,278,833,556,500,556,556,444,389,333,556,500,722,500,500,444,394,220,394,520,333,500,500,167,500,500,500,500,278,500,500,333,333,556,556,500,500,500,250,540,350,333,500,500,500,1000,1000,500,333,333,333,333,333,333,333,333,333,333,333,333,333,1000,1000,300,667,778,1000,330,722,278,278,500,722,556,389,444,500,556,444,722,570,722,722,500,722,500,389,444,722,722,500,722,556,667,722,250,747,667,444,500,722,278,500,667,722,500,667,389,389,278,494,722,778,556,500,722,444,444,667,611,778,722,556,672,722,556,300,778,722,722,570,556,667,494,500,722,278,667,500,444,444,556,556,722,389,570,220,747,778,389,600,667,444,500,667,667,549,722,722,278,416,444,722,722,722,444,444,278,778,500,500,389,278,778,722,612,556,300,778,556,278,500,667,556,750,556,394,778,667,1000,444,389,389,667,750,549,500,556,722,667,444,500,750,556,556,778,400,500,722,556,549,722,444,722,500,722,667,722,722,722,778,444,667,389,556,570,389,556,333,570,500,556,549,500,500,444,556,300,278,500"];
						},
						"Times-Italic": function () {
							return [-15.5, "-169:-217:1010:883", 653, 441, 683, -217, "250,333,420,500,500,833,778,333,333,333,500,675,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,675,675,675,500,920,611,611,667,722,611,611,722,722,333,444,667,556,833,667,722,611,722,611,500,556,722,611,833,611,556,556,389,278,389,422,500,333,500,500,444,500,444,278,500,500,278,278,444,278,722,500,500,500,500,389,389,278,500,444,667,444,444,389,400,275,400,541,389,500,500,167,500,500,500,500,214,556,500,333,333,500,500,500,500,500,250,523,350,333,556,556,500,889,1000,500,333,333,333,333,333,333,333,333,333,333,333,333,333,889,889,276,556,722,944,310,667,278,278,500,667,500,333,444,500,500,444,556,675,556,611,500,722,444,389,444,722,722,500,722,500,611,722,250,760,611,444,500,667,278,500,556,667,500,611,389,389,278,471,611,722,500,500,611,389,444,556,611,722,611,500,544,722,500,300,722,611,611,675,500,556,476,444,667,278,611,500,444,444,500,500,667,333,675,275,760,722,333,600,611,389,500,556,556,549,722,667,278,300,444,722,611,611,444,389,278,722,500,500,389,278,722,722,612,500,300,722,500,278,500,611,500,750,500,300,667,556,980,444,333,333,611,750,549,500,500,722,611,444,500,750,500,500,722,400,500,667,500,453,722,389,667,500,611,556,611,611,611,722,389,611,333,444,675,333,500,278,675,500,500,549,500,500,389,500,300,278,500"];
						},
						"Times-BoldItalic": function () {
							return [-15, "-200:-218:996:921", 669, 462, 683, -217, "250,389,555,500,500,833,778,333,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,832,667,667,667,722,667,667,722,778,389,500,667,611,889,722,722,611,722,667,556,611,722,667,889,667,611,611,333,278,333,570,500,333,500,500,444,500,444,333,500,556,278,278,500,278,778,556,500,500,500,389,389,278,556,444,667,500,444,389,348,220,348,570,389,500,500,167,500,500,500,500,278,500,500,333,333,556,556,500,500,500,250,500,350,333,500,500,500,1000,1000,500,333,333,333,333,333,333,333,333,333,333,333,333,333,1000,944,266,611,722,944,300,722,278,278,500,722,500,389,444,500,556,444,611,570,611,667,500,722,444,389,444,722,722,500,722,556,667,722,250,747,667,444,500,722,278,500,611,667,500,667,389,389,278,494,667,722,556,500,667,389,444,611,611,722,667,556,608,722,556,300,722,667,667,570,556,611,494,444,722,278,667,500,444,444,556,556,722,389,570,220,747,722,389,600,667,389,500,611,611,549,722,667,278,366,444,722,667,667,444,389,278,722,500,500,389,278,722,722,612,500,300,722,576,278,500,667,500,750,556,382,667,611,1000,444,389,389,611,750,549,500,556,722,667,444,500,750,556,556,722,400,500,667,556,549,722,389,722,500,667,611,667,667,667,722,389,667,389,500,606,389,556,278,606,500,556,549,500,500,389,556,300,278,500"];
						},
						"Symbol": function () {
							return [0, "-180:-293:1090:1010", 0, 0, 0, 0, "250,333,315:713,3:500,316:549,5:833,778,317:439,8:333,333,318:500,11:549,250,300:549,14:250,278,500,500,500,500,500,500,500,500,500,500,278,278,549,549,549,444,319:549,722,667,722,250:612,323:611,763,603,722,333,631,722,686,889,722,722,768,741,556,592,611,690,439,768,645,795,611,59:333,345:863,61:333,346:658,63:500,347:500,631,549,549,494,439,521,411,603,329,603,549,549,254:576,360:521,549,549,521,549,603,439,576,713,686,493,686,494,91:480,200,480,373:549,314:750,374:620,247,270:549,98:167,376:713,100:500,377:753,753,753,753,1042,987,603,987,603,281:400,220:549,386:411,231:549,205:549,387:713,208:494,115:460,155:549,307:549,388:549,549,120:1000,390:603,1000,658,823,686,795,987,768,768,823,768,768,713,713,713,713,713,713,713,768,713,790,790,890,823,285:549,415:250,304:713,416:603,603,1042,987,603,987,603,185:494,423:329,790,790,786,225:713,427:384,384,384,384,384,384,494,494,494,494,329,274,686,686,686,384,384,384,384,384,384,494,494,494,790"];
						},
						"ZapfDingbats": function () {
							return [0, "-1:-143:981:820", 0, 0, 0, 0, "278,452:974,961,974,980,719,789,790,791,690,960,939,549,855,911,933,911,945,974,755,846,762,761,571,677,763,760,759,754,494,552,537,577,692,786,788,788,790,793,794,816,823,789,841,823,833,816,831,923,744,723,749,790,792,695,776,768,792,759,707,708,682,701,826,815,789,789,707,687,696,689,786,787,713,791,785,791,873,761,762,762,759,759,892,892,788,784,438,138,277,415,392,392,668,668,390,390,317,317,276,276,509,509,410,410,234,234,334,334,732,544,544,910,667,760,760,776,595,694,626,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,894,838,1016,458,748,924,748,918,927,928,928,834,873,828,924,924,917,930,931,463,883,836,836,867,867,696,696,874,874,760,946,771,865,771,888,967,888,831,873,927,970,918"];
						}
					};

					return StandardFont;

				})(PDFFont);

				localModule.localExports = StandardFont;

			}, { "../font": 3, "./afm": 4, "fs": 59 }], 7: [function (localRequire, localModule, localExports) {
				var PDFGradient, PDFLinearGradient, PDFRadialGradient,
					__hasProp = {}.hasOwnProperty,
					__extends = function (child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

				PDFGradient = (function () {
					function PDFGradient(doc) {
						this.doc = doc;
						this.stops = [];
						this.embedded = false;
						this.transform = [1, 0, 0, 1, 0, 0];
						this._colorSpace = 'DeviceRGB';
					}

					PDFGradient.prototype.stop = function (pos, color, opacity) {
						if (opacity == null) {
							opacity = 1;
						}
						opacity = Math.max(0, Math.min(1, opacity));
						this.stops.push([pos, this.doc._normalizeColor(color), opacity]);
						return this;
					};

					PDFGradient.prototype.embed = function () {
						var bounds, dx, dy, encode, fn, form, grad, group, gstate, i, last, m, m0, m1, m11, m12, m2, m21, m22, m3, m4, m5, name, pattern, resources, sMask, shader, stop, stops, v, _i, _j, _len, _ref, _ref1, _ref2;
						if (this.embedded || this.stops.length === 0) {
							return;
						}
						this.embedded = true;
						last = this.stops[this.stops.length - 1];
						if (last[0] < 1) {
							this.stops.push([1, last[1], last[2]]);
						}
						bounds = [];
						encode = [];
						stops = [];
						for (i = _i = 0, _ref = this.stops.length - 1; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
							encode.push(0, 1);
							if (i + 2 !== this.stops.length) {
								bounds.push(this.stops[i + 1][0]);
							}
							fn = this.doc.ref({
								FunctionType: 2,
								Domain: [0, 1],
								C0: this.stops[i + 0][1],
								C1: this.stops[i + 1][1],
								N: 1
							});
							stops.push(fn);
							fn.end();
						}
						if (stops.length === 1) {
							fn = stops[0];
						} else {
							fn = this.doc.ref({
								FunctionType: 3,
								Domain: [0, 1],
								Functions: stops,
								Bounds: bounds,
								Encode: encode
							});
							fn.end();
						}
						this.id = 'Sh' + (++this.doc._gradCount);
						m = this.doc._ctm.slice();
						m0 = m[0], m1 = m[1], m2 = m[2], m3 = m[3], m4 = m[4], m5 = m[5];
						_ref1 = this.transform, m11 = _ref1[0], m12 = _ref1[1], m21 = _ref1[2], m22 = _ref1[3], dx = _ref1[4], dy = _ref1[5];
						m[0] = m0 * m11 + m2 * m12;
						m[1] = m1 * m11 + m3 * m12;
						m[2] = m0 * m21 + m2 * m22;
						m[3] = m1 * m21 + m3 * m22;
						m[4] = m0 * dx + m2 * dy + m4;
						m[5] = m1 * dx + m3 * dy + m5;
						shader = this.shader(fn);
						shader.end();
						pattern = this.doc.ref({
							Type: 'Pattern',
							PatternType: 2,
							Shading: shader,
							Matrix: (function () {
								var _j, _len, _results;
								_results = [];
								for (_j = 0, _len = m.length; _j < _len; _j++) {
									v = m[_j];
									_results.push(+v.toFixed(5));
								}
								return _results;
							})()
						});
						this.doc.page.patterns[this.id] = pattern;
						pattern.end();
						if (this.stops.some(function (stop) {
							return stop[2] < 1;
						})) {
							grad = this.opacityGradient();
							grad._colorSpace = 'DeviceGray';
							_ref2 = this.stops;
							for (_j = 0, _len = _ref2.length; _j < _len; _j++) {
								stop = _ref2[_j];
								grad.stop(stop[0], [stop[2]]);
							}
							grad = grad.embed();
							group = this.doc.ref({
								Type: 'Group',
								S: 'Transparency',
								CS: 'DeviceGray'
							});
							group.end();
							resources = this.doc.ref({
								ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'],
								Shading: {
									Sh1: grad.data.Shading
								}
							});
							resources.end();
							form = this.doc.ref({
								Type: 'XObject',
								Subtype: 'Form',
								FormType: 1,
								BBox: [0, 0, this.doc.page.width, this.doc.page.height],
								Group: group,
								Resources: resources
							});
							form.end("/Sh1 sh");
							sMask = this.doc.ref({
								Type: 'Mask',
								S: 'Luminosity',
								G: form
							});
							sMask.end();
							gstate = this.doc.ref({
								Type: 'ExtGState',
								SMask: sMask
							});
							this.opacity_id = ++this.doc._opacityCount;
							name = "Gs" + this.opacity_id;
							this.doc.page.ext_gstates[name] = gstate;
							gstate.end();
						}
						return pattern;
					};

					PDFGradient.prototype.apply = function (op) {
						if (!this.embedded) {
							this.embed();
						}
						this.doc.addContent("/" + this.id + " " + op);
						if (this.opacity_id) {
							this.doc.addContent("/Gs" + this.opacity_id + " gs");
							return this.doc._sMasked = true;
						}
					};

					return PDFGradient;

				})();

				PDFLinearGradient = (function (_super) {
					__extends(PDFLinearGradient, _super);

					function PDFLinearGradient(doc, x1, y1, x2, y2) {
						this.doc = doc;
						this.x1 = x1;
						this.y1 = y1;
						this.x2 = x2;
						this.y2 = y2;
						PDFLinearGradient.__super__.constructor.apply(this, arguments);
					}

					PDFLinearGradient.prototype.shader = function (fn) {
						return this.doc.ref({
							ShadingType: 2,
							ColorSpace: this._colorSpace,
							Coords: [this.x1, this.y1, this.x2, this.y2],
							Function: fn,
							Extend: [true, true]
						});
					};

					PDFLinearGradient.prototype.opacityGradient = function () {
						return new PDFLinearGradient(this.doc, this.x1, this.y1, this.x2, this.y2);
					};

					return PDFLinearGradient;

				})(PDFGradient);

				PDFRadialGradient = (function (_super) {
					__extends(PDFRadialGradient, _super);

					function PDFRadialGradient(doc, x1, y1, r1, x2, y2, r2) {
						this.doc = doc;
						this.x1 = x1;
						this.y1 = y1;
						this.r1 = r1;
						this.x2 = x2;
						this.y2 = y2;
						this.r2 = r2;
						PDFRadialGradient.__super__.constructor.apply(this, arguments);
					}

					PDFRadialGradient.prototype.shader = function (fn) {
						return this.doc.ref({
							ShadingType: 3,
							ColorSpace: this._colorSpace,
							Coords: [this.x1, this.y1, this.r1, this.x2, this.y2, this.r2],
							Function: fn,
							Extend: [true, true]
						});
					};

					PDFRadialGradient.prototype.opacityGradient = function () {
						return new PDFRadialGradient(this.doc, this.x1, this.y1, this.r1, this.x2, this.y2, this.r2);
					};

					return PDFRadialGradient;

				})(PDFGradient);

				localModule.localExports = {
					PDFGradient: PDFGradient,
					PDFLinearGradient: PDFLinearGradient,
					PDFRadialGradient: PDFRadialGradient
				};

			}, {}], 8: [function (localRequire, localModule, localExports) {
				(function (Buffer) {

					/*
					PDFImage - embeds images in PDF documents
					By Devon Govett
					 */
					var Data, JPEG, PDFImage, PNG, fs;

					fs = localRequire('fs');

					Data = localRequire('./data');

					JPEG = localRequire('./image/jpeg');

					PNG = localRequire('./image/png');

					PDFImage = (function () {
						function PDFImage() { }

						(<any>PDFImage).open = function (src, label) {
							var data, match;
							if (Buffer.isBuffer(src)) {
								data = src;
							} else if (src instanceof ArrayBuffer) {
								data = new Buffer(new Uint8Array(src));
							} else {
								if (match = /^data:.+;base64,(.*)$/.exec(src)) {
									data = new Buffer(match[1], 'base64');
								} else {
									data = fs.readFileSync(src);
									if (!data) {
										return;
									}
								}
							}
							if (data[0] === 0xff && data[1] === 0xd8) {
								return new JPEG(data, label);
							} else if (data[0] === 0x89 && data.toString('ascii', 1, 4) === 'PNG') {
								return new PNG(data, label);
							} else {
								throw new Error('Unknown image format.');
							}
						};

						return PDFImage;

					})();

					localModule.localExports = PDFImage;

				}).call(this, localRequire("buffer").Buffer)

			}, { "./data": 1, "./image/jpeg": 9, "./image/png": 10, "buffer": 60, "fs": 59 }], 9: [function (localRequire, localModule, localExports) {
				var JPEG, fs,
					__indexOf = [].indexOf || function (item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

				fs = localRequire('fs');

				JPEG = (function () {
					var MARKERS;

					MARKERS = [0xFFC0, 0xFFC1, 0xFFC2, 0xFFC3, 0xFFC5, 0xFFC6, 0xFFC7, 0xFFC8, 0xFFC9, 0xFFCA, 0xFFCB, 0xFFCC, 0xFFCD, 0xFFCE, 0xFFCF];

					function JPEG(data, label) {
						var channels, marker, pos;
						this.data = data;
						this.label = label;
						if (this.data.readUInt16BE(0) !== 0xFFD8) {
							throw "SOI not found in JPEG";
						}
						pos = 2;
						while (pos < this.data.length) {
							marker = this.data.readUInt16BE(pos);
							pos += 2;
							if (__indexOf.call(MARKERS, marker) >= 0) {
								break;
							}
							pos += this.data.readUInt16BE(pos);
						}
						if (__indexOf.call(MARKERS, marker) < 0) {
							throw "Invalid JPEG.";
						}
						pos += 2;
						this.bits = this.data[pos++];
						this.height = this.data.readUInt16BE(pos);
						pos += 2;
						this.width = this.data.readUInt16BE(pos);
						pos += 2;
						channels = this.data[pos++];
						this.colorSpace = (function () {
							switch (channels) {
								case 1:
									return 'DeviceGray';
								case 3:
									return 'DeviceRGB';
								case 4:
									return 'DeviceCMYK';
							}
						})();
						this.obj = null;
					}

					JPEG.prototype.embed = function (document) {
						if (this.obj) {
							return;
						}
						this.obj = document.ref({
							Type: 'XObject',
							Subtype: 'Image',
							BitsPerComponent: this.bits,
							Width: this.width,
							Height: this.height,
							ColorSpace: this.colorSpace,
							Filter: 'DCTDecode'
						});
						if (this.colorSpace === 'DeviceCMYK') {
							this.obj.data['Decode'] = [1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0];
						}
						this.obj.end(this.data);
						return this.data = null;
					};

					return JPEG;

				})();

				localModule.localExports = JPEG;

			}, { "fs": 59 }], 10: [function (localRequire, localModule, localExports) {
				(function (Buffer) {
					var PNG, PNGImage, zlib;

					zlib = localRequire('zlib');

					PNG = localRequire('png-js');

					PNGImage = (function () {
						function PNGImage(data, label) {
							this.label = label;
							this.image = new PNG(data);
							this.width = this.image.width;
							this.height = this.image.height;
							this.imgData = this.image.imgData;
							this.obj = null;
						}

						PNGImage.prototype.embed = function (document) {
							var mask, palette, params, rgb, val, x, _i, _len;
							this.document = document;
							if (this.obj) {
								return;
							}
							this.obj = this.document.ref({
								Type: 'XObject',
								Subtype: 'Image',
								BitsPerComponent: this.image.bits,
								Width: this.width,
								Height: this.height,
								Filter: 'FlateDecode'
							});
							if (!this.image.hasAlphaChannel) {
								params = this.document.ref({
									Predictor: 15,
									Colors: this.image.colors,
									BitsPerComponent: this.image.bits,
									Columns: this.width
								});
								this.obj.data['DecodeParms'] = params;
								params.end();
							}
							if (this.image.palette.length === 0) {
								this.obj.data['ColorSpace'] = this.image.colorSpace;
							} else {
								palette = this.document.ref();
								palette.end(new Buffer(this.image.palette));
								this.obj.data['ColorSpace'] = ['Indexed', 'DeviceRGB', (this.image.palette.length / 3) - 1, palette];
							}
							if (this.image.transparency.grayscale) {
								val = this.image.transparency.greyscale;
								return this.obj.data['Mask'] = [val, val];
							} else if (this.image.transparency.rgb) {
								rgb = this.image.transparency.rgb;
								mask = [];
								for (_i = 0, _len = rgb.length; _i < _len; _i++) {
									x = rgb[_i];
									mask.push(x, x);
								}
								return this.obj.data['Mask'] = mask;
							} else if (this.image.transparency.indexed) {
								return this.loadIndexedAlphaChannel();
							} else if (this.image.hasAlphaChannel) {
								return this.splitAlphaChannel();
							} else {
								return this.finalize();
							}
						};

						PNGImage.prototype.finalize = function () {
							var sMask;
							if (this.alphaChannel) {
								sMask = this.document.ref({
									Type: 'XObject',
									Subtype: 'Image',
									Height: this.height,
									Width: this.width,
									BitsPerComponent: 8,
									Filter: 'FlateDecode',
									ColorSpace: 'DeviceGray',
									Decode: [0, 1]
								});
								sMask.end(this.alphaChannel);
								this.obj.data['SMask'] = sMask;
							}
							this.obj.end(this.imgData);
							this.image = null;
							return this.imgData = null;
						};

						PNGImage.prototype.splitAlphaChannel = function () {
							return this.image.decodePixels((function (_this) {
								return function (pixels) {
									var a, alphaChannel, colorByteSize, done, i, imgData, len, p, pixelCount;
									colorByteSize = _this.image.colors * _this.image.bits / 8;
									pixelCount = _this.width * _this.height;
									imgData = new Buffer(pixelCount * colorByteSize);
									alphaChannel = new Buffer(pixelCount);
									i = p = a = 0;
									len = pixels.length;
									while (i < len) {
										imgData[p++] = pixels[i++];
										imgData[p++] = pixels[i++];
										imgData[p++] = pixels[i++];
										alphaChannel[a++] = pixels[i++];
									}
									done = 0;
									zlib.deflate(imgData, function (err, imgData) {
										_this.imgData = imgData;
										if (err) {
											throw err;
										}
										if (++done === 2) {
											return _this.finalize();
										}
									});
									return zlib.deflate(alphaChannel, function (err, alphaChannel) {
										_this.alphaChannel = alphaChannel;
										if (err) {
											throw err;
										}
										if (++done === 2) {
											return _this.finalize();
										}
									});
								};
							})(this));
						};

						PNGImage.prototype.loadIndexedAlphaChannel = function (fn) {
							var transparency;
							transparency = this.image.transparency.indexed;
							return this.image.decodePixels((function (_this) {
								return function (pixels) {
									var alphaChannel, i, j, _i, _ref;
									alphaChannel = new Buffer(_this.width * _this.height);
									i = 0;
									for (j = _i = 0, _ref = pixels.length; _i < _ref; j = _i += 1) {
										alphaChannel[i++] = transparency[pixels[j]];
									}
									return zlib.deflate(alphaChannel, function (err, alphaChannel) {
										_this.alphaChannel = alphaChannel;
										if (err) {
											throw err;
										}
										return _this.finalize();
									});
								};
							})(this));
						};

						return PNGImage;

					})();

					localModule.localExports = PNGImage;

				}).call(this, localRequire("buffer").Buffer)

			}, { "buffer": 60, "png-js": 186, "zlib": 58 }], 11: [function (localRequire, localModule, localExports) {
				var EventEmitter, LineBreaker, LineWrapper,
					__hasProp = {}.hasOwnProperty,
					__extends = function (child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

				EventEmitter = localRequire('events').EventEmitter;

				LineBreaker = localRequire('linebreak');

				LineWrapper = (function (_super) {
					__extends(LineWrapper, _super);

					function LineWrapper(document, options) {
						var _ref;
						this.document = document;
						this.indent = options.indent || 0;
						this.characterSpacing = options.characterSpacing || 0;
						this.wordSpacing = options.wordSpacing === 0;
						this.columns = options.columns || 1;
						this.columnGap = (_ref = options.columnGap) != null ? _ref : 18;
						this.lineWidth = (options.width - (this.columnGap * (this.columns - 1))) / this.columns;
						this.spaceLeft = this.lineWidth;
						this.startX = this.document.x;
						this.startY = this.document.y;
						this.column = 1;
						this.ellipsis = options.ellipsis;
						this.continuedX = 0;
						this.features = options.features;
						if (options.height != null) {
							this.height = options.height;
							this.maxY = this.startY + options.height;
						} else {
							this.maxY = this.document.page.maxY();
						}
						this.on('firstLine', (function (_this) {
							return function (options) {
								var indent;
								indent = _this.continuedX || _this.indent;
								_this.document.x += indent;
								_this.lineWidth -= indent;
								return _this.once('line', function () {
									_this.document.x -= indent;
									_this.lineWidth += indent;
									if (options.continued && !_this.continuedX) {
										_this.continuedX = _this.indent;
									}
									if (!options.continued) {
										return _this.continuedX = 0;
									}
								});
							};
						})(this));
						this.on('lastLine', (function (_this) {
							return function (options) {
								var align;
								align = options.align;
								if (align === 'justify') {
									options.align = 'left';
								}
								_this.lastLine = true;
								return _this.once('line', function () {
									_this.document.y += options.paragraphGap || 0;
									options.align = align;
									return _this.lastLine = false;
								});
							};
						})(this));
					}

					LineWrapper.prototype.wordWidth = function (word) {
						return this.document.widthOfString(word, this) + this.characterSpacing + this.wordSpacing;
					};

					LineWrapper.prototype.eachWord = function (text, fn) {
						var bk, breaker, fbk, l, last, lbk, shouldContinue, w, word, wordWidths;
						breaker = new LineBreaker(text);
						last = null;
						wordWidths = Object.create(null);
						while (bk = breaker.nextBreak()) {
							word = text.slice((last != null ? last.position : void 0) || 0, bk.position);
							w = wordWidths[word] != null ? wordWidths[word] : wordWidths[word] = this.wordWidth(word);
							if (w > this.lineWidth + this.continuedX) {
								lbk = last;
								fbk = {};
								while (word.length) {
									l = word.length;
									while (w > this.spaceLeft) {
										w = this.wordWidth(word.slice(0, --l));
									}
									fbk.required = l < word.length;
									shouldContinue = fn(word.slice(0, l), w, fbk, lbk);
									lbk = {
										required: false
									};
									word = word.slice(l);
									w = this.wordWidth(word);
									if (shouldContinue === false) {
										break;
									}
								}
							} else {
								shouldContinue = fn(word, w, bk, last);
							}
							if (shouldContinue === false) {
								break;
							}
							last = bk;
						}
					};

					LineWrapper.prototype.wrap = function (text, options) {
						var buffer, emitLine, lc, nextY, textWidth, wc, y;
						if (options.indent != null) {
							this.indent = options.indent;
						}
						if (options.characterSpacing != null) {
							this.characterSpacing = options.characterSpacing;
						}
						if (options.wordSpacing != null) {
							this.wordSpacing = options.wordSpacing;
						}
						if (options.ellipsis != null) {
							this.ellipsis = options.ellipsis;
						}
						nextY = this.document.y + this.document.currentLineHeight(true);
						if (this.document.y > this.maxY || nextY > this.maxY) {
							this.nextSection();
						}
						buffer = '';
						textWidth = 0;
						wc = 0;
						lc = 0;
						y = this.document.y;
						emitLine = (function (_this) {
							return function () {
								options.textWidth = textWidth + _this.wordSpacing * (wc - 1);
								options.wordCount = wc;
								options.lineWidth = _this.lineWidth;
								y = _this.document.y;
								_this.emit('line', buffer, options, _this);
								return lc++;
							};
						})(this);
						this.emit('sectionStart', options, this);
						this.eachWord(text, (function (_this) {
							return function (word, w, bk, last): any {
								var lh, shouldContinue;
								if ((last == null) || last.required) {
									_this.emit('firstLine', options, _this);
									_this.spaceLeft = _this.lineWidth;
								}
								if (w <= _this.spaceLeft) {
									buffer += word;
									textWidth += w;
									wc++;
								}
								if (bk.required || w > _this.spaceLeft) {
									if (bk.required) {
										_this.emit('lastLine', options, _this);
									}
									lh = _this.document.currentLineHeight(true);
									if ((_this.height != null) && _this.ellipsis && _this.document.y + lh * 2 > _this.maxY && _this.column >= _this.columns) {
										if (_this.ellipsis === true) {
											_this.ellipsis = 'вЂ¦';
										}
										buffer = buffer.replace(/\s+$/, '');
										textWidth = _this.wordWidth(buffer + _this.ellipsis);
										while (textWidth > _this.lineWidth) {
											buffer = buffer.slice(0, -1).replace(/\s+$/, '');
											textWidth = _this.wordWidth(buffer + _this.ellipsis);
										}
										buffer = buffer + _this.ellipsis;
									}
									emitLine();
									// GrapeCity begin
									//if (_this.document.y + lh > _this.maxY) {
									if (_this.maxY - (_this.document.y + lh) < -1e-6) {
									// GrapeCity end
										shouldContinue = _this.nextSection();
										if (!shouldContinue) {
											wc = 0;
											buffer = '';
											return false;
										}
									}
									if (bk.required) {
										if (w > _this.spaceLeft) {
											buffer = word;
											textWidth = w;
											wc = 1;
											emitLine();
										}
										_this.spaceLeft = _this.lineWidth;
										buffer = '';
										textWidth = 0;
										return wc = 0;
									} else {
										_this.spaceLeft = _this.lineWidth - w;
										buffer = word;
										textWidth = w;
										return wc = 1;
									}
								} else {
									return _this.spaceLeft -= w;
								}
							};
						})(this));
						if (wc > 0) {
							this.emit('lastLine', options, this);
							emitLine();
						}
						this.emit('sectionEnd', options, this);
						if (options.continued === true) {
							if (lc > 1) {
								this.continuedX = 0;
							}
							this.continuedX += options.textWidth;
							return this.document.y = y;
						} else {
							return this.document.x = this.startX;
						}
					};

					LineWrapper.prototype.nextSection = function (options) {
						var _ref;
						this.emit('sectionEnd', options, this);
						if (++this.column > this.columns) {
							if (this.height != null) {
								return false;
							}
							this.document.addPage();
							this.column = 1;
							this.startY = this.document.page.margins.top;
							this.maxY = this.document.page.maxY();
							this.document.x = this.startX;
							if (this.document._fillColor) {
								(_ref = this.document).fillColor.apply(_ref, this.document._fillColor);
							}
							this.emit('pageBreak', options, this);
						} else {
							this.document.x += this.lineWidth + this.columnGap;
							this.document.y = this.startY;
							this.emit('columnBreak', options, this);
						}
						this.emit('sectionStart', options, this);
						return true;
					};

					return LineWrapper;

				})(EventEmitter);

				localModule.localExports = LineWrapper;

			}, { "events": 164, "linebreak": 173 }], 12: [function (localRequire, localModule, localExports) {
				localModule.localExports = {
					annotate: function (x, y, w, h, options) {
						var key, ref, val;
						options.Type = 'Annot';
						options.Rect = this._convertRect(x, y, w, h);
						options.Border = [0, 0, 0];
						if (options.Subtype !== 'Link') {
							if (options.C == null) {
								options.C = this._normalizeColor(options.color || [0, 0, 0]);
							}
						}
						delete options.color;
						if (typeof options.Dest === 'string') {
							options.Dest = new String(options.Dest);
						}
						for (key in options) {
							val = options[key];
							options[key[0].toUpperCase() + key.slice(1)] = val;
						}
						ref = this.ref(options);
						this.page.annotations.push(ref);
						ref.end();
						return this;
					},
					note: function (x, y, w, h, contents, options) {
						if (options == null) {
							options = {};
						}
						options.Subtype = 'Text';
						options.Contents = new String(contents);
						options.Name = 'Comment';
						if (options.color == null) {
							options.color = [243, 223, 92];
						}
						return this.annotate(x, y, w, h, options);
					},
					link: function (x, y, w, h, url, options) {
						if (options == null) {
							options = {};
						}
						options.Subtype = 'Link';
						options.A = this.ref({
							S: 'URI',
							URI: new String(url)
						});
						options.A.end();
						return this.annotate(x, y, w, h, options);
					},
					_markup: function (x, y, w, h, options) {
						var x1, x2, y1, y2, _ref;
						if (options == null) {
							options = {};
						}
						_ref = this._convertRect(x, y, w, h), x1 = _ref[0], y1 = _ref[1], x2 = _ref[2], y2 = _ref[3];
						options.QuadPoints = [x1, y2, x2, y2, x1, y1, x2, y1];
						options.Contents = new String;
						return this.annotate(x, y, w, h, options);
					},
					highlight: function (x, y, w, h, options) {
						if (options == null) {
							options = {};
						}
						options.Subtype = 'Highlight';
						if (options.color == null) {
							options.color = [241, 238, 148];
						}
						return this._markup(x, y, w, h, options);
					},
					underline: function (x, y, w, h, options) {
						if (options == null) {
							options = {};
						}
						options.Subtype = 'Underline';
						return this._markup(x, y, w, h, options);
					},
					strike: function (x, y, w, h, options) {
						if (options == null) {
							options = {};
						}
						options.Subtype = 'StrikeOut';
						return this._markup(x, y, w, h, options);
					},
					lineAnnotation: function (x1, y1, x2, y2, options) {
						if (options == null) {
							options = {};
						}
						options.Subtype = 'Line';
						options.Contents = new String;
						options.L = [x1, this.page.height - y1, x2, this.page.height - y2];
						return this.annotate(x1, y1, x2, y2, options);
					},
					rectAnnotation: function (x, y, w, h, options) {
						if (options == null) {
							options = {};
						}
						options.Subtype = 'Square';
						options.Contents = new String;
						return this.annotate(x, y, w, h, options);
					},
					ellipseAnnotation: function (x, y, w, h, options) {
						if (options == null) {
							options = {};
						}
						options.Subtype = 'Circle';
						options.Contents = new String;
						return this.annotate(x, y, w, h, options);
					},
					textAnnotation: function (x, y, w, h, text, options) {
						if (options == null) {
							options = {};
						}
						options.Subtype = 'FreeText';
						options.Contents = new String(text);
						options.DA = new String;
						return this.annotate(x, y, w, h, options);
					},
					_convertRect: function (x1, y1, w, h) {
						var m0, m1, m2, m3, m4, m5, x2, y2, _ref;
						y2 = y1;
						y1 += h;
						x2 = x1 + w;
						_ref = this._ctm, m0 = _ref[0], m1 = _ref[1], m2 = _ref[2], m3 = _ref[3], m4 = _ref[4], m5 = _ref[5];
						x1 = m0 * x1 + m2 * y1 + m4;
						y1 = m1 * x1 + m3 * y1 + m5;
						x2 = m0 * x2 + m2 * y2 + m4;
						y2 = m1 * x2 + m3 * y2 + m5;
						return [x1, y1, x2, y2];
					}
				};

			}, {}], 13: [function (localRequire, localModule, localExports) {
				var PDFGradient, PDFLinearGradient, PDFRadialGradient, namedColors, _ref;

				_ref = localRequire('../gradient'), PDFGradient = _ref.PDFGradient, PDFLinearGradient = _ref.PDFLinearGradient, PDFRadialGradient = _ref.PDFRadialGradient;

				localModule.localExports = {
					initColor: function () {
						this._opacityRegistry = {};
						this._opacityCount = 0;
						return this._gradCount = 0;
					},
					_normalizeColor: function (color) {
						var hex, part;
						if (color instanceof PDFGradient) {
							return color;
						}
						if (typeof color === 'string') {
							if (color.charAt(0) === '#') {
								if (color.length === 4) {
									color = color.replace(/#([0-9A-F])([0-9A-F])([0-9A-F])/i, "#$1$1$2$2$3$3");
								}
								hex = parseInt(color.slice(1), 16);
								color = [hex >> 16, hex >> 8 & 0xff, hex & 0xff];
							} else if (namedColors[color]) {
								color = namedColors[color];
							}
						}
						if (Array.isArray(color)) {
							if (color.length === 3) {
								color = (function () {
									var _i, _len, _results;
									_results = [];
									for (_i = 0, _len = color.length; _i < _len; _i++) {
										part = color[_i];
										_results.push(part / 255);
									}
									return _results;
								})();
							} else if (color.length === 4) {
								color = (function () {
									var _i, _len, _results;
									_results = [];
									for (_i = 0, _len = color.length; _i < _len; _i++) {
										part = color[_i];
										_results.push(part / 100);
									}
									return _results;
								})();
							}
							return color;
						}
						return null;
					},
					_setColor: function (color, stroke) {
						var gstate, name, op, space;
						color = this._normalizeColor(color);
						if (!color) {
							return false;
						}
						if (this._sMasked) {
							gstate = this.ref({
								Type: 'ExtGState',
								SMask: 'None'
							});
							gstate.end();
							name = "Gs" + (++this._opacityCount);
							this.page.ext_gstates[name] = gstate;
							this.addContent("/" + name + " gs");
							this._sMasked = false;
						}
						op = stroke ? 'SCN' : 'scn';
						if (color instanceof PDFGradient) {
							this._setColorSpace('Pattern', stroke);
							color.apply(op);
						} else {
							space = color.length === 4 ? 'DeviceCMYK' : 'DeviceRGB';
							this._setColorSpace(space, stroke);
							color = color.join(' ');
							this.addContent("" + color + " " + op);
						}
						return true;
					},
					_setColorSpace: function (space, stroke) {
						var op;
						op = stroke ? 'CS' : 'cs';
						return this.addContent("/" + space + " " + op);
					},
					fillColor: function (color, opacity) {
						var set;
						if (opacity == null) {
							opacity = 1;
						}
						set = this._setColor(color, false);
						if (set) {
							this.fillOpacity(opacity);
						}
						this._fillColor = [color, opacity];
						return this;
					},
					strokeColor: function (color, opacity) {
						var set;
						if (opacity == null) {
							opacity = 1;
						}
						set = this._setColor(color, true);
						if (set) {
							this.strokeOpacity(opacity);
						}
						return this;
					},
					opacity: function (opacity) {
						this._doOpacity(opacity, opacity);
						return this;
					},
					fillOpacity: function (opacity) {
						this._doOpacity(opacity, null);
						return this;
					},
					strokeOpacity: function (opacity) {
						this._doOpacity(null, opacity);
						return this;
					},
					_doOpacity: function (fillOpacity, strokeOpacity) {
						var dictionary, id, key, name, _ref1;
						if (!((fillOpacity != null) || (strokeOpacity != null))) {
							return;
						}
						if (fillOpacity != null) {
							fillOpacity = Math.max(0, Math.min(1, fillOpacity));
						}
						if (strokeOpacity != null) {
							strokeOpacity = Math.max(0, Math.min(1, strokeOpacity));
						}
						key = "" + fillOpacity + "_" + strokeOpacity;
						if (this._opacityRegistry[key]) {
							_ref1 = this._opacityRegistry[key], dictionary = _ref1[0], name = _ref1[1];
						} else {
							dictionary = {
								Type: 'ExtGState'
							};
							if (fillOpacity != null) {
								dictionary.ca = fillOpacity;
							}
							if (strokeOpacity != null) {
								dictionary.CA = strokeOpacity;
							}
							dictionary = this.ref(dictionary);
							dictionary.end();
							id = ++this._opacityCount;
							name = "Gs" + id;
							this._opacityRegistry[key] = [dictionary, name];
						}
						this.page.ext_gstates[name] = dictionary;
						return this.addContent("/" + name + " gs");
					},
					linearGradient: function (x1, y1, x2, y2) {
						return new PDFLinearGradient(this, x1, y1, x2, y2);
					},
					radialGradient: function (x1, y1, r1, x2, y2, r2) {
						return new PDFRadialGradient(this, x1, y1, r1, x2, y2, r2);
					}
				};

				namedColors = {
					aliceblue: [240, 248, 255],
					antiquewhite: [250, 235, 215],
					aqua: [0, 255, 255],
					aquamarine: [127, 255, 212],
					azure: [240, 255, 255],
					beige: [245, 245, 220],
					bisque: [255, 228, 196],
					black: [0, 0, 0],
					blanchedalmond: [255, 235, 205],
					blue: [0, 0, 255],
					blueviolet: [138, 43, 226],
					brown: [165, 42, 42],
					burlywood: [222, 184, 135],
					cadetblue: [95, 158, 160],
					chartreuse: [127, 255, 0],
					chocolate: [210, 105, 30],
					coral: [255, 127, 80],
					cornflowerblue: [100, 149, 237],
					cornsilk: [255, 248, 220],
					crimson: [220, 20, 60],
					cyan: [0, 255, 255],
					darkblue: [0, 0, 139],
					darkcyan: [0, 139, 139],
					darkgoldenrod: [184, 134, 11],
					darkgray: [169, 169, 169],
					darkgreen: [0, 100, 0],
					darkgrey: [169, 169, 169],
					darkkhaki: [189, 183, 107],
					darkmagenta: [139, 0, 139],
					darkolivegreen: [85, 107, 47],
					darkorange: [255, 140, 0],
					darkorchid: [153, 50, 204],
					darkred: [139, 0, 0],
					darksalmon: [233, 150, 122],
					darkseagreen: [143, 188, 143],
					darkslateblue: [72, 61, 139],
					darkslategray: [47, 79, 79],
					darkslategrey: [47, 79, 79],
					darkturquoise: [0, 206, 209],
					darkviolet: [148, 0, 211],
					deeppink: [255, 20, 147],
					deepskyblue: [0, 191, 255],
					dimgray: [105, 105, 105],
					dimgrey: [105, 105, 105],
					dodgerblue: [30, 144, 255],
					firebrick: [178, 34, 34],
					floralwhite: [255, 250, 240],
					forestgreen: [34, 139, 34],
					fuchsia: [255, 0, 255],
					gainsboro: [220, 220, 220],
					ghostwhite: [248, 248, 255],
					gold: [255, 215, 0],
					goldenrod: [218, 165, 32],
					gray: [128, 128, 128],
					grey: [128, 128, 128],
					green: [0, 128, 0],
					greenyellow: [173, 255, 47],
					honeydew: [240, 255, 240],
					hotpink: [255, 105, 180],
					indianred: [205, 92, 92],
					indigo: [75, 0, 130],
					ivory: [255, 255, 240],
					khaki: [240, 230, 140],
					lavender: [230, 230, 250],
					lavenderblush: [255, 240, 245],
					lawngreen: [124, 252, 0],
					lemonchiffon: [255, 250, 205],
					lightblue: [173, 216, 230],
					lightcoral: [240, 128, 128],
					lightcyan: [224, 255, 255],
					lightgoldenrodyellow: [250, 250, 210],
					lightgray: [211, 211, 211],
					lightgreen: [144, 238, 144],
					lightgrey: [211, 211, 211],
					lightpink: [255, 182, 193],
					lightsalmon: [255, 160, 122],
					lightseagreen: [32, 178, 170],
					lightskyblue: [135, 206, 250],
					lightslategray: [119, 136, 153],
					lightslategrey: [119, 136, 153],
					lightsteelblue: [176, 196, 222],
					lightyellow: [255, 255, 224],
					lime: [0, 255, 0],
					limegreen: [50, 205, 50],
					linen: [250, 240, 230],
					magenta: [255, 0, 255],
					maroon: [128, 0, 0],
					mediumaquamarine: [102, 205, 170],
					mediumblue: [0, 0, 205],
					mediumorchid: [186, 85, 211],
					mediumpurple: [147, 112, 219],
					mediumseagreen: [60, 179, 113],
					mediumslateblue: [123, 104, 238],
					mediumspringgreen: [0, 250, 154],
					mediumturquoise: [72, 209, 204],
					mediumvioletred: [199, 21, 133],
					midnightblue: [25, 25, 112],
					mintcream: [245, 255, 250],
					mistyrose: [255, 228, 225],
					moccasin: [255, 228, 181],
					navajowhite: [255, 222, 173],
					navy: [0, 0, 128],
					oldlace: [253, 245, 230],
					olive: [128, 128, 0],
					olivedrab: [107, 142, 35],
					orange: [255, 165, 0],
					orangered: [255, 69, 0],
					orchid: [218, 112, 214],
					palegoldenrod: [238, 232, 170],
					palegreen: [152, 251, 152],
					paleturquoise: [175, 238, 238],
					palevioletred: [219, 112, 147],
					papayawhip: [255, 239, 213],
					peachpuff: [255, 218, 185],
					peru: [205, 133, 63],
					pink: [255, 192, 203],
					plum: [221, 160, 221],
					powderblue: [176, 224, 230],
					purple: [128, 0, 128],
					red: [255, 0, 0],
					rosybrown: [188, 143, 143],
					royalblue: [65, 105, 225],
					saddlebrown: [139, 69, 19],
					salmon: [250, 128, 114],
					sandybrown: [244, 164, 96],
					seagreen: [46, 139, 87],
					seashell: [255, 245, 238],
					sienna: [160, 82, 45],
					silver: [192, 192, 192],
					skyblue: [135, 206, 235],
					slateblue: [106, 90, 205],
					slategray: [112, 128, 144],
					slategrey: [112, 128, 144],
					snow: [255, 250, 250],
					springgreen: [0, 255, 127],
					steelblue: [70, 130, 180],
					tan: [210, 180, 140],
					teal: [0, 128, 128],
					thistle: [216, 191, 216],
					tomato: [255, 99, 71],
					turquoise: [64, 224, 208],
					violet: [238, 130, 238],
					wheat: [245, 222, 179],
					white: [255, 255, 255],
					whitesmoke: [245, 245, 245],
					yellow: [255, 255, 0],
					yellowgreen: [154, 205, 50]
				};

			}, { "../gradient": 7 }], 14: [function (localRequire, localModule, localExports) {
				var PDFFont;

				PDFFont = localRequire('../font');

				localModule.localExports = {
					initFonts: function () {
						this._fontFamilies = {};
						this._fontCount = 0;
						this._fontSize = 12;
						this._font = null;
						this._registeredFonts = {};
						return this.font('Helvetica');
					},
					font: function (src, family, size) {
						var cacheKey, font, id, _ref;
						if (typeof family === 'number') {
							size = family;
							family = null;
						}
						if (typeof src === 'string' && this._registeredFonts[src]) {
							cacheKey = src;
							_ref = this._registeredFonts[src], src = _ref.src, family = _ref.family;
						} else {
							cacheKey = family || src;
							if (typeof cacheKey !== 'string') {
								cacheKey = null;
							}
						}
						if (size != null) {
							this.fontSize(size);
						}
						if (font = this._fontFamilies[cacheKey]) {
							this._font = font;
							return this;
						}
						id = 'F' + (++this._fontCount);
						this._font = PDFFont.open(this, src, family, id);
						if (font = this._fontFamilies[this._font.name]) {
							this._font = font;
							return this;
						}
						if (cacheKey) {
							this._fontFamilies[cacheKey] = this._font;
						}
						this._fontFamilies[this._font.name] = this._font;
						return this;
					},
					fontSize: function (_fontSize) {
						this._fontSize = _fontSize;
						return this;
					},
					currentLineHeight: function (includeGap) {
						if (includeGap == null) {
							includeGap = false;
						}
						return this._font.lineHeight(this._fontSize, includeGap);
					},
					// GrapeCity begin
					currentFontAscender: function () {
						return this._font.getAscender(this._fontSize);
					},
					currentFontBBox: function () {
						return this._font.getBBox(this._fontSize);
					},
					currentFontSize: function () {
						return this._fontSize;
					},
					// GrapeCity end
					registerFont: function (name, src, family) {
						this._registeredFonts[name] = {
							src: src,
							family: family
						};
						return this;
					}
				};

			}, { "../font": 3 }], 15: [function (localRequire, localModule, localExports) {
				(function (Buffer) {
					var PDFImage;

					PDFImage = localRequire('../image');

					localModule.localExports = {
						initImages: function () {
							this._imageRegistry = {};
							return this._imageCount = 0;
						},
						image: function (src, x, y, options) {
							var bh, bp, bw, h, hp, image, ip, w, wp, _base, _name, _ref, _ref1, _ref2;
							if (options == null) {
								options = {};
							}
							if (typeof x === 'object') {
								options = x;
								x = null;
							}
							x = (_ref = x != null ? x : options.x) != null ? _ref : this.x;
							y = (_ref1 = y != null ? y : options.y) != null ? _ref1 : this.y;
							if (!Buffer.isBuffer(src)) {
								image = this._imageRegistry[src];
							}
							if (!image) {
								image = PDFImage.open(src, 'I' + (++this._imageCount));
								image.embed(this);
								if (!Buffer.isBuffer(src)) {
									this._imageRegistry[src] = image;
								}
							}
							if ((_base = this.page.xobjects)[_name = image.label] == null) {
								_base[_name] = image.obj;
							}
							// GrapeCity begin
							var imageWidth = image.width * 0.75;  // px -> pt
							var imageHeight = image.height * 0.75;
							// GrapeCity end
							w = options.width || imageWidth; // GrapeCity
							h = options.height || imageHeight; // GrapeCity
							if (options.width && !options.height) {
								wp = w / imageWidth;
								w = imageWidth * wp; // GrapeCity
								h = imageHeight * wp; // GrapeCity
							} else if (options.height && !options.width) {
								hp = h / imageHeight;
								w = imageWidth * hp; // GrapeCity
								h = imageHeight * hp; // GrapeCity
							} else if (options.scale) {
								w = imageWidth * options.scale; // GrapeCity
								h = imageHeight * options.scale; // GrapeCity
							} else if (options.fit) {
								_ref2 = options.fit, bw = _ref2[0], bh = _ref2[1];
								bp = bw / bh;
								ip = imageWidth / imageHeight; // GrapeCity
								if (ip > bp) {
									w = bw;
									h = bw / ip;
								} else {
									h = bh;
									w = bh * ip;
								}
								if (options.align === 'center') {
									x = x + bw / 2 - w / 2;
								} else if (options.align === 'right') {
									x = x + bw - w;
								}
								if (options.valign === 'center') {
									y = y + bh / 2 - h / 2;
								} else if (options.valign === 'bottom') {
									y = y + bh - h;
								}
							}
							if (this.y === y) {
								this.y += h;
							}
							this.save();
							this.transform(w, 0, 0, -h, x, y + h);
							this.addContent("/" + image.label + " Do");
							this.restore();
							return this;
						}
					};

				}).call(this, { "isBuffer": localRequire("../../node_modules/is-buffer/index.js") })

			}, { "../../node_modules/is-buffer/index.js": 168, "../image": 8 }], 16: [function (localRequire, localModule, localExports) {
				var LineWrapper;

				LineWrapper = localRequire('../line_wrapper');

				localModule.localExports = {
					initText: function () {
						this.x = 0;
						this.y = 0;
						return this._lineGap = 0;
					},
					// GrapeCity begin
					currentLineGap: function () {
						return this._lineGap;
					},
					// GrapeCity end
					lineGap: function (_lineGap) {
						this._lineGap = _lineGap;
						return this;
					},
					moveDown: function (lines) {
						if (lines == null) {
							lines = 1;
						}
						this.y += this.currentLineHeight(true) * lines + this._lineGap;
						return this;
					},
					moveUp: function (lines) {
						if (lines == null) {
							lines = 1;
						}
						this.y -= this.currentLineHeight(true) * lines + this._lineGap;
						return this;
					},
					_text: function (text, x, y, options, lineCallback) {
						var line, wrapper, _i, _len, _ref;
						options = this._initOptions(x, y, options);
						text = '' + text;
						if (options.wordSpacing) {
							text = text.replace(/\s{2,}/g, ' ');
						}
						if (options.width) {
							wrapper = this._wrapper;
							if (!wrapper) {
								wrapper = new LineWrapper(this, options);
								wrapper.on('line', lineCallback);
							}
							this._wrapper = options.continued ? wrapper : null;
							this._textOptions = options.continued ? options : null;
							wrapper.wrap(text, options);
						} else {
							_ref = text.split('\n');
							for (_i = 0, _len = _ref.length; _i < _len; _i++) {
								line = _ref[_i];
								lineCallback(line, options);
							}
						}
						return this;
					},
					text: function (text, x, y, options) {
						return this._text(text, x, y, options, this._line.bind(this));
					},
					widthOfString: function (string, options) {
						if (options == null) {
							options = {};
						}
						return this._font.widthOfString(string, this._fontSize, options.features) + (options.characterSpacing || 0) * (string.length - 1);
					},
					heightOfString: function (text, options) {
						var height, lineGap, x, y;
						if (options == null) {
							options = {};
						}
						x = this.x, y = this.y;
						options = this._initOptions(options);
						options.height = Infinity;
						lineGap = options.lineGap || this._lineGap || 0;
						this._text(text, this.x, this.y, options, (function (_this) {
							return function (line, options) {
								return _this.y += _this.currentLineHeight(true) + lineGap;
							};
						})(this));
						height = this.y - y;
						this.x = x;
						this.y = y;
						return height;
					},
					// GrapeCity begin
					// based on the text and heightOfString methods (see above).
					textAndMeasure: function (text, x, y, options: _IPdfKitMeasurementTextOptions, measureOnly) {
						options = options || {};

						if (x == null) {
							x = this.x; y = this.y;
						}

						var self = this,
							tx = this.x, ty = this.y,
							sz = { width: 0, height: 0, charCount: 0 },
							lineGap = options.lineGap || this._lineGap || 0,
							columnGap = options.columnGap || 18,
							lastColX = x == null ? this.x : x,
							col = [],
							colCnt = 0;

						if (measureOnly) {
							if (options.height == null) {
								options.height = Infinity;
							}
						}

						this._text(text, x, y, options, function (line, options, wrapper) {
							sz.charCount += line.length;

							if (self.x === x) { // summarize the first column lines only
								sz.height += self.currentLineHeight(true) + lineGap;
							}

							if (options.textWidth) { // has a wrapper
								if (self.x > lastColX) { // a new column has started
									lastColX = self.x;
									col[colCnt++] = options.lineWidth; // change the max textWidth to a common column width (max textWidth <= lineWidth).
								}

								col[colCnt] = Math.max(col[colCnt] || 0, options.textWidth);
							}

							if (measureOnly) {
								// taken from _line().
								if (!wrapper) {
									self.x += self.widthOfString(text);
								} else {
									self.y += self.currentLineHeight(true) + lineGap;
								}
							} else {
								self._line.apply(self, arguments);
							}
						});

						if (!col.length) { // no wrapper
							sz.width = this.x - tx;
						} else {
							col.forEach(function (v) { sz.width += v + columnGap; });
							sz.width -= columnGap;
						}

						if (options.includeLastLineExternalLeading === false) {
							sz.height -= this.currentLineHeight(true) - this.currentLineHeight(false); // substract the last line external leading
						}
						sz.height = Math.max(0, sz.height);

						if (measureOnly) {
							this.x = tx;
							this.y = ty;
						}

						return sz;
					},
					// GrapeCity end
					list: function (list, x, y, options, wrapper) {
						var flatten, i, indent, itemIndent, items, level, levels, r;
						options = this._initOptions(x, y, options);
						r = Math.round((this._font.ascender / 1000 * this._fontSize) / 3);
						indent = options.textIndent || r * 5;
						itemIndent = options.bulletIndent || r * 8;
						level = 1;
						items = [];
						levels = [];
						flatten = function (list) {
							var i, item, _i, _len, _results;
							_results = [];
							for (i = _i = 0, _len = list.length; _i < _len; i = ++_i) {
								item = list[i];
								if (Array.isArray(item)) {
									level++;
									flatten(item);
									_results.push(level--);
								} else {
									items.push(item);
									_results.push(levels.push(level));
								}
							}
							return _results;
						};
						flatten(list);
						wrapper = new LineWrapper(this, options);
						wrapper.on('line', this._line.bind(this));
						level = 1;
						i = 0;
						wrapper.on('firstLine', (function (_this) {
							return function () {
								var diff, l;
								if ((l = levels[i++]) !== level) {
									diff = itemIndent * (l - level);
									_this.x += diff;
									wrapper.lineWidth -= diff;
									level = l;
								}
								_this.circle(_this.x - indent + r, _this.y + r + (r / 2), r);
								return _this.fill();
							};
						})(this));
						wrapper.on('sectionStart', (function (_this) {
							return function () {
								var pos;
								pos = indent + itemIndent * (level - 1);
								_this.x += pos;
								return wrapper.lineWidth -= pos;
							};
						})(this));
						wrapper.on('sectionEnd', (function (_this) {
							return function () {
								var pos;
								pos = indent + itemIndent * (level - 1);
								_this.x -= pos;
								return wrapper.lineWidth += pos;
							};
						})(this));
						wrapper.wrap(items.join('\n'), options);
						return this;
					},
					_initOptions: function (x, y, options) {
						var key, margins, val, _ref;
						if (x == null) {
							x = {};
						}
						if (options == null) {
							options = {};
						}
						if (typeof x === 'object') {
							options = x;
							x = null;
						}
						options = (function () {
							var k, opts, v;
							opts = {};
							for (k in options) {
								v = options[k];
								opts[k] = v;
							}
							return opts;
						})();
						if (this._textOptions) {
							_ref = this._textOptions;
							for (key in _ref) {
								val = _ref[key];
								if (key !== 'continued') {
									if (options[key] == null) {
										options[key] = val;
									}
								}
							}
						}
						if (x != null) {
							this.x = x;
						}
						if (y != null) {
							this.y = y;
						}
						if (options.lineBreak !== false) {
							margins = this.page.margins;
							if (options.width == null) {
								options.width = this.page.width - this.x - margins.right;
								// GrapeCity begin
								options.width = Math.max(options.width, 0); // Otherwise PDFKit will hangs up. This situation (options.width < 0) can occur if scaling is enabled.
								// GrapeCity end
							}
						}
						options.columns || (options.columns = 0);
						if (options.columnGap == null) {
							options.columnGap = 18;
						}
						return options;
					},
					_line: function (text, options, wrapper) {
						var lineGap;
						if (options == null) {
							options = {};
						}
						this._fragment(text, this.x, this.y, options);
						lineGap = options.lineGap || this._lineGap || 0;
						if (!wrapper) {
							return this.x += this.widthOfString(text);
						} else {
							return this.y += this.currentLineHeight(true) + lineGap;
						}
					},
					_fragment: function (text, x, y, options) {
						var addSegment, align, characterSpacing, commands, d, encoded, encodedWord, flush, hadOffset, i, last, lineWidth, lineY, mode, pos, positions, positionsWord, renderedWidth, scale, spaceWidth, textWidth, word, wordSpacing, words, _base, _i, _j, _len, _len1, _name, _ref, _ref1;
						text = ('' + text).replace(/\n/g, '');
						if (text.length === 0) {
							return;
						}
						align = options.align || 'left';
						wordSpacing = options.wordSpacing || 0;
						characterSpacing = options.characterSpacing || 0;
						if (options.width) {
							switch (align) {
								case 'right':
									textWidth = this.widthOfString(text.replace(/\s+$/, ''), options);
									x += options.lineWidth - textWidth;
									break;
								case 'center':
									x += options.lineWidth / 2 - options.textWidth / 2;
									break;
								case 'justify':
									words = text.trim().split(/\s+/);
									textWidth = this.widthOfString(text.replace(/\s+/g, ''), options);
									spaceWidth = this.widthOfString(' ') + characterSpacing;
									wordSpacing = Math.max(0, (options.lineWidth - textWidth) / Math.max(1, words.length - 1) - spaceWidth);
							}
						}
						renderedWidth = options.textWidth + (wordSpacing * (options.wordCount - 1)) + (characterSpacing * (text.length - 1));
						if (options.link) {
							this.link(x, y, renderedWidth, this.currentLineHeight(), options.link);
						}
						if (options.underline || options.strike) {
							this.save();
							if (!options.stroke) {
								this.strokeColor.apply(this, this._fillColor);
							}
							lineWidth = this._fontSize < 10 ? 0.5 : Math.floor(this._fontSize / 10);
							this.lineWidth(lineWidth);
							d = options.underline ? 1 : 2;
							lineY = y + this.currentLineHeight() / d;
							if (options.underline) {
								lineY -= lineWidth;
							}
							this.moveTo(x, lineY);
							this.lineTo(x + renderedWidth, lineY);
							this.stroke();
							this.restore();
						}
						this.save();
						this.transform(1, 0, 0, -1, 0, this.page.height);
						y = this.page.height - y - (this._font.ascender / 1000 * this._fontSize);
						if ((_base = this.page.fonts)[_name = this._font.id] == null) {
							_base[_name] = this._font.ref();
						}
						this.addContent("BT");
						this.addContent("1 0 0 1 " + x + " " + y + " Tm");
						this.addContent("/" + this._font.id + " " + this._fontSize + " Tf");
						mode = options.fill && options.stroke ? 2 : options.stroke ? 1 : 0;
						if (mode) {
							this.addContent("" + mode + " Tr");
						}
						if (characterSpacing) {
							this.addContent("" + characterSpacing + " Tc");
						}
						if (wordSpacing) {
							words = text.trim().split(/\s+/);
							wordSpacing += this.widthOfString(' ') + characterSpacing;
							wordSpacing *= 1000 / this._fontSize;
							encoded = [];
							positions = [];
							for (_i = 0, _len = words.length; _i < _len; _i++) {
								word = words[_i];
								_ref = this._font.encode(word, options.features), encodedWord = _ref[0], positionsWord = _ref[1];
								encoded.push.apply(encoded, encodedWord);
								positions.push.apply(positions, positionsWord);
								positions[positions.length - 1].xAdvance += wordSpacing;
							}
						} else {
							_ref1 = this._font.encode(text, options.features), encoded = _ref1[0], positions = _ref1[1];
						}
						scale = this._fontSize / 1000;
						commands = [];
						last = 0;
						hadOffset = false;
						addSegment = (function (_this) {
							return function (cur) {
								var advance, hex;
								if (last < cur) {
									hex = encoded.slice(last, cur).join('');
									advance = positions[cur - 1].xAdvance - positions[cur - 1].advanceWidth;
									commands.push("<" + hex + "> " + (-advance));
								}
								return last = cur;
							};
						})(this);
						flush = (function (_this) {
							return function (i) {
								addSegment(i);
								if (commands.length > 0) {
									_this.addContent("[" + (commands.join(' ')) + "] TJ");
									return commands.length = 0;
								}
							};
						})(this);
						for (i = _j = 0, _len1 = positions.length; _j < _len1; i = ++_j) {
							pos = positions[i];
							if (pos.xOffset || pos.yOffset) {
								flush(i);
								this.addContent("1 0 0 1 " + (x + pos.xOffset * scale) + " " + (y + pos.yOffset * scale) + " Tm");
								flush(i + 1);
								hadOffset = true;
							} else {
								if (hadOffset) {
									this.addContent("1 0 0 1 " + x + " " + y + " Tm");
									hadOffset = false;
								}
								if (pos.xAdvance - pos.advanceWidth !== 0) {
									addSegment(i + 1);
								}
							}
							x += pos.xAdvance * scale;
						}
						flush(i);
						this.addContent("ET");
						return this.restore();
					}
				};

			}, { "../line_wrapper": 11 }], 17: [function (localRequire, localModule, localExports) {
				var KAPPA, SVGPath,
					__slice = [].slice;

				SVGPath = localRequire('../path');

				KAPPA = 4.0 * ((Math.sqrt(2) - 1.0) / 3.0);

				localModule.localExports = {
					initVector: function () {
						this._ctm = [1, 0, 0, 1, 0, 0];
						return this._ctmStack = [];
					},
					save: function () {
						this._ctmStack.push(this._ctm.slice());
						return this.addContent('q');
					},
					restore: function () {
						this._ctm = this._ctmStack.pop() || [1, 0, 0, 1, 0, 0];
						return this.addContent('Q');
					},
					closePath: function () {
						return this.addContent('h');
					},
					lineWidth: function (w) {
						return this.addContent("" + w + " w");
					},
					_CAP_STYLES: {
						BUTT: 0,
						ROUND: 1,
						SQUARE: 2
					},
					lineCap: function (c) {
						if (typeof c === 'string') {
							c = this._CAP_STYLES[c.toUpperCase()];
						}
						return this.addContent("" + c + " J");
					},
					_JOIN_STYLES: {
						MITER: 0,
						ROUND: 1,
						BEVEL: 2
					},
					lineJoin: function (j) {
						if (typeof j === 'string') {
							j = this._JOIN_STYLES[j.toUpperCase()];
						}
						return this.addContent("" + j + " j");
					},
					miterLimit: function (m) {
						return this.addContent("" + m + " M");
					},
					dash: function (length, options) {
						var phase, space, _ref;
						if (options == null) {
							options = {};
						}
						if (length == null) {
							return this;
						}
						space = (_ref = options.space) != null ? _ref : length;
						phase = options.phase || 0;
						return this.addContent("[" + length + " " + space + "] " + phase + " d");
					},
					undash: function () {
						return this.addContent("[] 0 d");
					},
					moveTo: function (x, y) {
						return this.addContent("" + x + " " + y + " m");
					},
					lineTo: function (x, y) {
						return this.addContent("" + x + " " + y + " l");
					},
					bezierCurveTo: function (cp1x, cp1y, cp2x, cp2y, x, y) {
						return this.addContent("" + cp1x + " " + cp1y + " " + cp2x + " " + cp2y + " " + x + " " + y + " c");
					},
					quadraticCurveTo: function (cpx, cpy, x, y) {
						return this.addContent("" + cpx + " " + cpy + " " + x + " " + y + " v");
					},
					rect: function (x, y, w, h) {
						return this.addContent("" + x + " " + y + " " + w + " " + h + " re");
					},
					roundedRect: function (x, y, w, h, r) {
						if (r == null) {
							r = 0;
						}
						this.moveTo(x + r, y);
						this.lineTo(x + w - r, y);
						this.quadraticCurveTo(x + w, y, x + w, y + r);
						this.lineTo(x + w, y + h - r);
						this.quadraticCurveTo(x + w, y + h, x + w - r, y + h);
						this.lineTo(x + r, y + h);
						this.quadraticCurveTo(x, y + h, x, y + h - r);
						this.lineTo(x, y + r);
						return this.quadraticCurveTo(x, y, x + r, y);
					},
					ellipse: function (x, y, r1, r2) {
						var ox, oy, xe, xm, ye, ym;
						if (r2 == null) {
							r2 = r1;
						}
						x -= r1;
						y -= r2;
						ox = r1 * KAPPA;
						oy = r2 * KAPPA;
						xe = x + r1 * 2;
						ye = y + r2 * 2;
						xm = x + r1;
						ym = y + r2;
						this.moveTo(x, ym);
						this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
						this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
						this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
						this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
						return this.closePath();
					},
					circle: function (x, y, radius) {
						return this.ellipse(x, y, radius);
					},
					polygon: function () {
						var point, points, _i, _len;
						points = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
						this.moveTo.apply(this, points.shift());
						for (_i = 0, _len = points.length; _i < _len; _i++) {
							point = points[_i];
							this.lineTo.apply(this, point);
						}
						return this.closePath();
					},
					path: function (path) {
						SVGPath.apply(this, path);
						return this;
					},
					_windingRule: function (rule) {
						if (/even-?odd/.test(rule)) {
							return '*';
						}
						return '';
					},
					fill: function (color, rule) {
						if (/(even-?odd)|(non-?zero)/.test(color)) {
							rule = color;
							color = null;
						}
						if (color) {
							this.fillColor(color);
						}
						return this.addContent('f' + this._windingRule(rule));
					},
					stroke: function (color) {
						if (color) {
							this.strokeColor(color);
						}
						return this.addContent('S');
					},
					fillAndStroke: function (fillColor, strokeColor, rule) {
						var isFillRule;
						if (strokeColor == null) {
							strokeColor = fillColor;
						}
						isFillRule = /(even-?odd)|(non-?zero)/;
						if (isFillRule.test(fillColor)) {
							rule = fillColor;
							fillColor = null;
						}
						if (isFillRule.test(strokeColor)) {
							rule = strokeColor;
							strokeColor = fillColor;
						}
						if (fillColor) {
							this.fillColor(fillColor);
							this.strokeColor(strokeColor);
						}
						return this.addContent('B' + this._windingRule(rule));
					},
					clip: function (rule) {
						return this.addContent('W' + this._windingRule(rule) + ' n');
					},
					transform: function (m11, m12, m21, m22, dx, dy) {
						var m, m0, m1, m2, m3, m4, m5, v, values;
						m = this._ctm;
						m0 = m[0], m1 = m[1], m2 = m[2], m3 = m[3], m4 = m[4], m5 = m[5];
						m[0] = m0 * m11 + m2 * m12;
						m[1] = m1 * m11 + m3 * m12;
						m[2] = m0 * m21 + m2 * m22;
						m[3] = m1 * m21 + m3 * m22;
						m[4] = m0 * dx + m2 * dy + m4;
						m[5] = m1 * dx + m3 * dy + m5;
						values = ((function () {
							var _i, _len, _ref, _results;
							_ref = [m11, m12, m21, m22, dx, dy];
							_results = [];
							for (_i = 0, _len = _ref.length; _i < _len; _i++) {
								v = _ref[_i];
								_results.push(+v.toFixed(5));
							}
							return _results;
						})()).join(' ');
						return this.addContent("" + values + " cm");
					},
					translate: function (x, y) {
						return this.transform(1, 0, 0, 1, x, y);
					},
					rotate: function (angle, options) {
						var cos, rad, sin, x, x1, y, y1, _ref;
						if (options == null) {
							options = {};
						}
						rad = angle * Math.PI / 180;
						cos = Math.cos(rad);
						sin = Math.sin(rad);
						x = y = 0;
						if (options.origin != null) {
							_ref = options.origin, x = _ref[0], y = _ref[1];
							x1 = x * cos - y * sin;
							y1 = x * sin + y * cos;
							x -= x1;
							y -= y1;
						}
						return this.transform(cos, sin, -sin, cos, x, y);
					},
					scale: function (xFactor, yFactor, options) {
						var x, y, _ref;
						if (yFactor == null) {
							yFactor = xFactor;
						}
						if (options == null) {
							options = {};
						}
						if (arguments.length === 2) {
							yFactor = xFactor;
							options = yFactor;
						}
						x = y = 0;
						if (options.origin != null) {
							_ref = options.origin, x = _ref[0], y = _ref[1];
							x -= xFactor * x;
							y -= yFactor * y;
						}
						return this.transform(xFactor, 0, 0, yFactor, x, y);
					}
				};

			}, { "../path": 20 }], 18: [function (localRequire, localModule, localExports) {
				(function (Buffer) {

					/*
					PDFObject - converts JavaScript types into their corrisponding PDF types.
					By Devon Govett
					 */
					var PDFObject, PDFReference;

					PDFObject = (function () {
						var escapable, escapableRe, pad, swapBytes;

						function PDFObject() { }

						pad = function (str, length) {
							return (Array(length + 1).join('0') + str).slice(-length);
						};

						escapableRe = /[\n\r\t\b\f\(\)\\]/g;

						escapable = {
							'\n': '\\n',
							'\r': '\\r',
							'\t': '\\t',
							'\b': '\\b',
							'\f': '\\f',
							'\\': '\\\\',
							'(': '\\(',
							')': '\\)'
						};

						swapBytes = function (buff) {
							var a, i, l, _i, _ref;
							l = buff.length;
							if (l & 0x01) {
								throw new Error("Buffer length must be even");
							} else {
								for (i = _i = 0, _ref = l - 1; _i < _ref; i = _i += 2) {
									a = buff[i];
									buff[i] = buff[i + 1];
									buff[i + 1] = a;
								}
							}
							return buff;
						};

						(<any>PDFObject).convert = function (object) {
							var e, i, isUnicode, items, key, out, string, val, _i, _ref;
							if (typeof object === 'string') {
								return '/' + object;
							} else if (object instanceof String) {
								string = object.replace(escapableRe, function (c) {
									return escapable[c];
								});
								isUnicode = false;
								for (i = _i = 0, _ref = string.length; _i < _ref; i = _i += 1) {
									if (string.charCodeAt(i) > 0x7f) {
										isUnicode = true;
										break;
									}
								}
								if (isUnicode) {
									string = swapBytes(new Buffer('\ufeff' + string, 'utf16le')).toString('binary');
								}
								return '(' + string + ')';
							} else if (Buffer.isBuffer(object)) {
								return '<' + object.toString('hex') + '>';
							} else if (object instanceof PDFReference) {
								return object.toString();
							} else if (object instanceof Date) {
								return '(D:' + pad(object.getUTCFullYear(), 4) + pad(object.getUTCMonth() + 1, 2) + pad(object.getUTCDate(), 2) + pad(object.getUTCHours(), 2) + pad(object.getUTCMinutes(), 2) + pad(object.getUTCSeconds(), 2) + 'Z)';
							} else if (Array.isArray(object)) {
								items = ((function () {
									var _j, _len, _results;
									_results = [];
									for (_j = 0, _len = object.length; _j < _len; _j++) {
										e = object[_j];
										_results.push((<any>PDFObject).convert(e));
									}
									return _results;
								})()).join(' ');
								return '[' + items + ']';
							} else if ({}.toString.call(object) === '[object Object]') {
								out = ['<<'];
								for (key in object) {
									val = object[key];
									out.push('/' + key + ' ' + (<any>PDFObject).convert(val));
								}
								out.push('>>');
								return out.join('\n');
							} else {
								return '' + object;
							}
						};

						return PDFObject;

					})();

					localModule.localExports = PDFObject;

					PDFReference = localRequire('./reference');

				}).call(this, localRequire("buffer").Buffer)

			}, { "./reference": 21, "buffer": 60 }], 19: [function (localRequire, localModule, localExports) {

				/*
				PDFPage - represents a single page in the PDF document
				By Devon Govett
				 */
				var PDFPage;

				PDFPage = (function () {
					var DEFAULT_MARGINS, SIZES;

					function PDFPage(document, options) {
						var dimensions;
						this.document = document;
						if (options == null) {
							options = {};
						}
						this.size = options.size || 'letter';
						this.layout = options.layout || 'portrait';
						if (typeof options.margin === 'number') {
							this.margins = {
								top: options.margin,
								left: options.margin,
								bottom: options.margin,
								right: options.margin
							};
						} else {
							this.margins = options.margins || DEFAULT_MARGINS;
							// GrapeCity begin
							this.margins = {
								top: this.margins.top,
								left: this.margins.left,
								bottom: this.margins.bottom,
								right: this.margins.right
							};
							// GrapeCity end
						}
						dimensions = Array.isArray(this.size) ? this.size : SIZES[this.size.toUpperCase()];
						this.width = dimensions[this.layout === 'portrait' ? 0 : 1];
						this.height = dimensions[this.layout === 'portrait' ? 1 : 0];
						this.content = this.document.ref();
						this.resources = this.document.ref({
							ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI']
						});
						Object.defineProperties(this, {
							fonts: {
								get: (function (_this) {
									return function () {
										var _base;
										return (_base = _this.resources.data).Font != null ? _base.Font : _base.Font = {};
									};
								})(this)
							},
							xobjects: {
								get: (function (_this) {
									return function () {
										var _base;
										return (_base = _this.resources.data).XObject != null ? _base.XObject : _base.XObject = {};
									};
								})(this)
							},
							ext_gstates: {
								get: (function (_this) {
									return function () {
										var _base;
										return (_base = _this.resources.data).ExtGState != null ? _base.ExtGState : _base.ExtGState = {};
									};
								})(this)
							},
							patterns: {
								get: (function (_this) {
									return function () {
										var _base;
										return (_base = _this.resources.data).Pattern != null ? _base.Pattern : _base.Pattern = {};
									};
								})(this)
							},
							annotations: {
								get: (function (_this) {
									return function () {
										var _base;
										return (_base = _this.dictionary.data).Annots != null ? _base.Annots : _base.Annots = [];
									};
								})(this)
							}
						});
						this.dictionary = this.document.ref({
							Type: 'Page',
							Parent: this.document._root.data.Pages,
							MediaBox: [0, 0, this.width, this.height],
							Contents: this.content,
							Resources: this.resources
						});
					}

					PDFPage.prototype.maxY = function () {
						return this.height - this.margins.bottom;
					};

					PDFPage.prototype.write = function (chunk) {
						return this.content.write(chunk);
					};

					PDFPage.prototype.end = function () {
						this.dictionary.end();
						this.resources.end();
						return this.content.end();
					};

					DEFAULT_MARGINS = {
						top: 72,
						left: 72,
						bottom: 72,
						right: 72
					};

					SIZES = {
						'4A0': [4767.87, 6740.79],
						'2A0': [3370.39, 4767.87],
						A0: [2383.94, 3370.39],
						A1: [1683.78, 2383.94],
						A2: [1190.55, 1683.78],
						A3: [841.89, 1190.55],
						A4: [595.28, 841.89],
						A5: [419.53, 595.28],
						A6: [297.64, 419.53],
						A7: [209.76, 297.64],
						A8: [147.40, 209.76],
						A9: [104.88, 147.40],
						A10: [73.70, 104.88],
						B0: [2834.65, 4008.19],
						B1: [2004.09, 2834.65],
						B2: [1417.32, 2004.09],
						B3: [1000.63, 1417.32],
						B4: [708.66, 1000.63],
						B5: [498.90, 708.66],
						B6: [354.33, 498.90],
						B7: [249.45, 354.33],
						B8: [175.75, 249.45],
						B9: [124.72, 175.75],
						B10: [87.87, 124.72],
						C0: [2599.37, 3676.54],
						C1: [1836.85, 2599.37],
						C2: [1298.27, 1836.85],
						C3: [918.43, 1298.27],
						C4: [649.13, 918.43],
						C5: [459.21, 649.13],
						C6: [323.15, 459.21],
						C7: [229.61, 323.15],
						C8: [161.57, 229.61],
						C9: [113.39, 161.57],
						C10: [79.37, 113.39],
						RA0: [2437.80, 3458.27],
						RA1: [1729.13, 2437.80],
						RA2: [1218.90, 1729.13],
						RA3: [864.57, 1218.90],
						RA4: [609.45, 864.57],
						SRA0: [2551.18, 3628.35],
						SRA1: [1814.17, 2551.18],
						SRA2: [1275.59, 1814.17],
						SRA3: [907.09, 1275.59],
						SRA4: [637.80, 907.09],
						EXECUTIVE: [521.86, 756.00],
						FOLIO: [612.00, 936.00],
						LEGAL: [612.00, 1008.00],
						LETTER: [612.00, 792.00],
						TABLOID: [792.00, 1224.00]
					};

					return PDFPage;

				})();

				localModule.localExports = PDFPage;

			}, {}], 20: [function (localRequire, localModule, localExports) {
				var SVGPath;

				SVGPath = (function () {
					var apply, arcToSegments, cx, cy, fixRoundingError, parameters, parse, px, py, runners, segmentToBezier, solveArc, sx, sy;

					function SVGPath() { }

					SVGPath.apply = function (doc, path) {
						var commands;
						commands = parse(path);
						return apply(commands, doc);
					};

					parameters = {
						A: 7,
						a: 7,
						C: 6,
						c: 6,
						H: 1,
						h: 1,
						L: 2,
						l: 2,
						M: 2,
						m: 2,
						Q: 4,
						q: 4,
						S: 4,
						s: 4,
						T: 2,
						t: 2,
						V: 1,
						v: 1,
						Z: 0,
						z: 0
					};

					parse = function (path) {
						var args, c, cmd, curArg, foundDecimal, params, ret, _i, _len;
						ret = [];
						args = [];
						curArg = "";
						foundDecimal = false;
						params = 0;
						for (_i = 0, _len = path.length; _i < _len; _i++) {
							c = path[_i];
							if (parameters[c] != null) {
								params = parameters[c];
								if (cmd) {
									if (curArg.length > 0) {
										args[args.length] = +curArg;
									}
									ret[ret.length] = {
										cmd: cmd,
										args: args
									};
									args = [];
									curArg = "";
									foundDecimal = false;
								}
								cmd = c;
							} else if ((c === " " || c === ",") || (c === "-" && curArg.length > 0 && curArg[curArg.length - 1] !== 'e') || (c === "." && foundDecimal)) {
								if (curArg.length === 0) {
									continue;
								}
								if (args.length === params) {
									ret[ret.length] = {
										cmd: cmd,
										args: args
									};
									args = [+curArg];
									if (cmd === "M") {
										cmd = "L";
									}
									if (cmd === "m") {
										cmd = "l";
									}
								} else {
									args[args.length] = +curArg;
								}
								foundDecimal = c === ".";
								curArg = c === '-' || c === '.' ? c : '';
							} else {
								curArg += c;
								if (c === '.') {
									foundDecimal = true;
								}
							}
						}
						if (curArg.length > 0) {
							if (args.length === params) {
								ret[ret.length] = {
									cmd: cmd,
									args: args
								};
								args = [+curArg];
								if (cmd === "M") {
									cmd = "L";
								}
								if (cmd === "m") {
									cmd = "l";
								}
							} else {
								args[args.length] = +curArg;
							}
						}
						ret[ret.length] = {
							cmd: cmd,
							args: args
						};
						return ret;
					};

					cx = cy = px = py = sx = sy = 0;

					apply = function (commands, doc) {
						var c, i, _i, _len, _name;
						cx = cy = px = py = sx = sy = 0;
						for (i = _i = 0, _len = commands.length; _i < _len; i = ++_i) {
							c = commands[i];
							if (typeof runners[_name = c.cmd] === "function") {
								runners[_name](doc, c.args);
							}
						}
						return cx = cy = px = py = 0;
					};

					runners = {
						M: function (doc, a) {
							cx = a[0];
							cy = a[1];
							px = py = null;
							sx = cx;
							sy = cy;
							return doc.moveTo(cx, cy);
						},
						m: function (doc, a) {
							cx += a[0];
							cy += a[1];
							px = py = null;
							sx = cx;
							sy = cy;
							return doc.moveTo(cx, cy);
						},
						C: function (doc, a) {
							cx = a[4];
							cy = a[5];
							px = a[2];
							py = a[3];
							return doc.bezierCurveTo.apply(doc, a);
						},
						c: function (doc, a) {
							doc.bezierCurveTo(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy, a[4] + cx, a[5] + cy);
							px = cx + a[2];
							py = cy + a[3];
							cx += a[4];
							return cy += a[5];
						},
						S: function (doc, a) {
							if (px === null) {
								px = cx;
								py = cy;
							}
							doc.bezierCurveTo(cx - (px - cx), cy - (py - cy), a[0], a[1], a[2], a[3]);
							px = a[0];
							py = a[1];
							cx = a[2];
							return cy = a[3];
						},
						s: function (doc, a) {
							if (px === null) {
								px = cx;
								py = cy;
							}
							doc.bezierCurveTo(cx - (px - cx), cy - (py - cy), cx + a[0], cy + a[1], cx + a[2], cy + a[3]);
							px = cx + a[0];
							py = cy + a[1];
							cx += a[2];
							return cy += a[3];
						},
						Q: function (doc, a) {
							px = a[0];
							py = a[1];
							cx = a[2];
							cy = a[3];
							return doc.quadraticCurveTo(a[0], a[1], cx, cy);
						},
						q: function (doc, a) {
							doc.quadraticCurveTo(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy);
							px = cx + a[0];
							py = cy + a[1];
							cx += a[2];
							return cy += a[3];
						},
						T: function (doc, a) {
							if (px === null) {
								px = cx;
								py = cy;
							} else {
								px = cx - (px - cx);
								py = cy - (py - cy);
							}
							doc.quadraticCurveTo(px, py, a[0], a[1]);
							px = cx - (px - cx);
							py = cy - (py - cy);
							cx = a[0];
							return cy = a[1];
						},
						t: function (doc, a) {
							if (px === null) {
								px = cx;
								py = cy;
							} else {
								px = cx - (px - cx);
								py = cy - (py - cy);
							}
							doc.quadraticCurveTo(px, py, cx + a[0], cy + a[1]);
							cx += a[0];
							return cy += a[1];
						},
						A: function (doc, a) {
							solveArc(doc, cx, cy, a);
							cx = a[5];
							return cy = a[6];
						},
						a: function (doc, a) {
							a[5] += cx;
							a[6] += cy;
							solveArc(doc, cx, cy, a);
							cx = a[5];
							return cy = a[6];
						},
						L: function (doc, a) {
							cx = a[0];
							cy = a[1];
							px = py = null;
							return doc.lineTo(cx, cy);
						},
						l: function (doc, a) {
							cx += a[0];
							cy += a[1];
							px = py = null;
							return doc.lineTo(cx, cy);
						},
						H: function (doc, a) {
							cx = a[0];
							px = py = null;
							return doc.lineTo(cx, cy);
						},
						h: function (doc, a) {
							cx += a[0];
							px = py = null;
							return doc.lineTo(cx, cy);
						},
						V: function (doc, a) {
							cy = a[0];
							px = py = null;
							return doc.lineTo(cx, cy);
						},
						v: function (doc, a) {
							cy += a[0];
							px = py = null;
							return doc.lineTo(cx, cy);
						},
						Z: function (doc) {
							doc.closePath();
							cx = sx;
							return cy = sy;
						},
						z: function (doc) {
							doc.closePath();
							cx = sx;
							return cy = sy;
						}
					};

					solveArc = function (doc, x, y, coords) {
						var bez, ex, ey, large, rot, rx, ry, seg, segs, sweep, _i, _len, _results;
						rx = coords[0], ry = coords[1], rot = coords[2], large = coords[3], sweep = coords[4], ex = coords[5], ey = coords[6];
						segs = arcToSegments(ex, ey, rx, ry, large, sweep, rot, x, y);
						_results = [];
						for (_i = 0, _len = segs.length; _i < _len; _i++) {
							seg = segs[_i];
							bez = segmentToBezier.apply(null, seg);
							_results.push(doc.bezierCurveTo.apply(doc, bez));
						}
						return _results;
					};

					arcToSegments = function (x, y, rx, ry, large, sweep, rotateX, ox, oy) {
						var a00, a01, a10, a11, cos_th, d, i, pl, result, segments, sfactor, sfactor_sq, sin_th, th, th0, th1, th2, th3, th_arc, x0, x1, xc, y0, y1, yc, _i;
						th = rotateX * (Math.PI / 180);
						sin_th = Math.sin(th);
						cos_th = Math.cos(th);
						rx = Math.abs(rx);
						ry = Math.abs(ry);
						px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;
						py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;
						pl = (px * px) / (rx * rx) + (py * py) / (ry * ry);
						if (pl > 1) {
							pl = Math.sqrt(pl);
							rx *= pl;
							ry *= pl;
						}
						a00 = cos_th / rx;
						a01 = sin_th / rx;
						a10 = (-sin_th) / ry;
						a11 = cos_th / ry;
						x0 = a00 * ox + a01 * oy;
						y0 = a10 * ox + a11 * oy;
						x1 = a00 * x + a01 * y;
						y1 = a10 * x + a11 * y;
						d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);
						sfactor_sq = 1 / d - 0.25;
						if (sfactor_sq < 0) {
							sfactor_sq = 0;
						}
						sfactor = Math.sqrt(sfactor_sq);
						if (sweep === large) {
							sfactor = -sfactor;
						}
						xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);
						yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);
						th0 = Math.atan2(y0 - yc, x0 - xc);
						th1 = Math.atan2(y1 - yc, x1 - xc);
						th_arc = th1 - th0;
						if (th_arc < 0 && sweep === 1) {
							th_arc += 2 * Math.PI;
						} else if (th_arc > 0 && sweep === 0) {
							th_arc -= 2 * Math.PI;
						}
						segments = Math.ceil(Math.abs(th_arc / (Math.PI * 0.5 + 0.001)));
						result = [];
						for (i = _i = 0; 0 <= segments ? _i < segments : _i > segments; i = 0 <= segments ? ++_i : --_i) {
							th2 = th0 + i * th_arc / segments;
							th3 = th0 + (i + 1) * th_arc / segments;
							result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];
						}
						return result;
					};

					segmentToBezier = function (cx, cy, th0, th1, rx, ry, sin_th, cos_th) {
						var a00, a01, a10, a11, t, th_half, x1, x2, x3, y1, y2, y3;
						a00 = cos_th * rx;
						a01 = -sin_th * ry;
						a10 = sin_th * rx;
						a11 = cos_th * ry;
						th_half = 0.5 * (th1 - th0);
						t = (8 / 3) * Math.sin(th_half * 0.5) * Math.sin(th_half * 0.5) / Math.sin(th_half);
						x1 = fixRoundingError(cx + Math.cos(th0) - t * Math.sin(th0));
						y1 = fixRoundingError(cy + Math.sin(th0) + t * Math.cos(th0));
						x3 = fixRoundingError(cx + Math.cos(th1));
						y3 = fixRoundingError(cy + Math.sin(th1));
						x2 = fixRoundingError(x3 + t * Math.sin(th1));
						y2 = fixRoundingError(y3 - t * Math.cos(th1));
						return [a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3];
					};

					fixRoundingError = function (x) {
						if (Math.abs(Math.round(x) - x) < 0.0000000000001) {
							return Math.round(x);
						}
						return x;
					};

					return SVGPath;

				})();

				localModule.localExports = SVGPath;

			}, {}], 21: [function (localRequire, localModule, localExports) {
				(function (Buffer) {

					/*
					PDFReference - represents a reference to another object in the PDF object heirarchy
					By Devon Govett
					 */
					var PDFObject, PDFReference, stream, zlib,
						__bind = function (fn, me) { return function () { return fn.apply(me, arguments); }; },
						__hasProp = {}.hasOwnProperty,
						__extends = function (child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

					zlib = localRequire('zlib');

					stream = localRequire('stream');

					PDFReference = (function (_super) {
						__extends(PDFReference, _super);

						function PDFReference(document, id, data) {
							this.document = document;
							this.id = id;
							this.data = data != null ? data : {};
							this.finalize = __bind(this.finalize, this);
							PDFReference.__super__.constructor.call(this, {
								decodeStrings: false
							});
							this.gen = 0;
							this.deflate = null;
							this.compress = this.document.compress && !this.data.Filter;
							this.uncompressedLength = 0;
							this.chunks = [];
						}

						PDFReference.prototype.initDeflate = function () {
							this.data.Filter = 'FlateDecode';
							this.deflate = zlib.createDeflate();
							this.deflate.on('data', (function (_this) {
								return function (chunk) {
									_this.chunks.push(chunk);
									return _this.data.Length += chunk.length;
								};
							})(this));
							return this.deflate.on('end', this.finalize);
						};

						PDFReference.prototype._write = function (chunk, encoding, callback) {
							var _base;
							if (!Buffer.isBuffer(chunk)) {
								chunk = new Buffer(chunk + '\n', 'binary');
							}
							this.uncompressedLength += chunk.length;
							if ((_base = this.data).Length == null) {
								_base.Length = 0;
							}
							if (this.compress) {
								if (!this.deflate) {
									this.initDeflate();
								}
								this.deflate.write(chunk);
							} else {
								this.chunks.push(chunk);
								this.data.Length += chunk.length;
							}
							return callback();
						};

						PDFReference.prototype.end = function (chunk) {
							PDFReference.__super__.end.apply(this, arguments);
							if (this.deflate) {
								return this.deflate.end();
							} else {
								return this.finalize();
							}
						};

						PDFReference.prototype.finalize = function () {
							var chunk, _i, _len, _ref;
							this.offset = this.document._offset;
							this.document._write("" + this.id + " " + this.gen + " obj");
							this.document._write(PDFObject.convert(this.data));
							if (this.chunks.length) {
								this.document._write('stream');
								_ref = this.chunks;
								for (_i = 0, _len = _ref.length; _i < _len; _i++) {
									chunk = _ref[_i];
									this.document._write(chunk);
								}
								this.chunks.length = 0;
								this.document._write('\nendstream');
							}
							this.document._write('endobj');
							return this.document._refEnd(this);
						};

						PDFReference.prototype.toString = function () {
							return "" + this.id + " " + this.gen + " R";
						};

						return PDFReference;

					})(stream.Writable);

					localModule.localExports = PDFReference;

					PDFObject = localRequire('./object');

				}).call(this, localRequire("buffer").Buffer)

			}, { "./object": 18, "buffer": 60, "stream": 216, "zlib": 58 }], 22: [function (localRequire, localModule, localExports) {
				// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
				//
				// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
				//
				// Originally from narwhal.js (http://narwhaljs.org)
				// Copyright (c) 2009 Thomas Robinson <280north.com>
				//
				// Permission is hereby granted, free of charge, to any person obtaining a copy
				// of this software and associated documentation files (the 'Software'), to
				// deal in the Software without restriction, including without limitation the
				// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
				// sell copies of the Software, and to permit persons to whom the Software is
				// furnished to do so, subject to the following conditions:
				//
				// The above copyright notice and this permission notice shall be included in
				// all copies or substantial portions of the Software.
				//
				// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
				// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
				// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
				// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
				// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
				// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

				// when used in node, this will actually load the util module we depend on
				// versus loading the builtin util module as happens otherwise
				// this is a bug in node module loading as far as I am concerned
				var util = localRequire('util/');

				var pSlice = Array.prototype.slice;
				var hasOwn = Object.prototype.hasOwnProperty;

				// 1. The assert module provides functions that throw
				// AssertionError's when particular conditions are not met. The
				// assert module must conform to the following interface.

				var assert: any = localModule.localExports = ok;

				// 2. The AssertionError is defined in assert.
				// new assert.AssertionError({ message: message,
				//                             actual: actual,
				//                             expected: expected })

				assert.AssertionError = function AssertionError(options) {
					this.name = 'AssertionError';
					this.actual = options.actual;
					this.expected = options.expected;
					this.operator = options.operator;
					if (options.message) {
						this.message = options.message;
						this.generatedMessage = false;
					} else {
						this.message = getMessage(this);
						this.generatedMessage = true;
					}
					var stackStartFunction = options.stackStartFunction || fail;

					if ((<any>Error).captureStackTrace) {
						(<any>Error).captureStackTrace(this, stackStartFunction);
					}
					else {
						// non v8 browsers so we can have a stacktrace
						var err: any = new Error();
						if (err.stack) {
							var out = err.stack;

							// try to strip useless frames
							var fn_name = stackStartFunction.name;
							var idx = out.indexOf('\n' + fn_name);
							if (idx >= 0) {
								// once we have located the function frame
								// we need to strip out everything before it (and its line)
								var next_line = out.indexOf('\n', idx + 1);
								out = out.substring(next_line + 1);
							}

							this.stack = out;
						}
					}
				};

				// assert.AssertionError instanceof Error
				util.inherits(assert.AssertionError, Error);

				function replacer(key, value) {
					if (util.isUndefined(value)) {
						return '' + value;
					}
					if (util.isNumber(value) && !isFinite(value)) {
						return value.toString();
					}
					if (util.isFunction(value) || util.isRegExp(value)) {
						return value.toString();
					}
					return value;
				}

				function truncate(s, n) {
					if (util.isString(s)) {
						return s.length < n ? s : s.slice(0, n);
					} else {
						return s;
					}
				}

				function getMessage(self) {
					return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +
						self.operator + ' ' +
						truncate(JSON.stringify(self.expected, replacer), 128);
				}

				// At present only the three keys mentioned above are used and
				// understood by the spec. Implementations or sub modules can pass
				// other keys to the AssertionError's constructor - they will be
				// ignored.

				// 3. All of the following functions must throw an AssertionError
				// when a corresponding condition is not met, with a message that
				// may be undefined if not provided.  All assertion methods provide
				// both the actual and expected values to the assertion error for
				// display purposes.

				function fail(actual, expected, message, operator?, stackStartFunction?) {
					throw new (<any>assert).AssertionError({
						message: message,
						actual: actual,
						expected: expected,
						operator: operator,
						stackStartFunction: stackStartFunction
					});
				}

				// EXTENSION! allows for well behaved errors defined elsewhere.
				assert.fail = fail;

				// 4. Pure assertion tests whether a value is truthy, as determined
				// by !!guard.
				// assert.ok(guard, message_opt);
				// This statement is equivalent to assert.equal(true, !!guard,
				// message_opt);. To test strictly for the value true, use
				// assert.strictEqual(true, guard, message_opt);.

				function ok(value, message) {
					if (!value) fail(value, true, message, '==', assert.ok);
				}
				assert.ok = ok;

				// 5. The equality assertion tests shallow, coercive equality with
				// ==.
				// assert.equal(actual, expected, message_opt);

				assert.equal = function equal(actual, expected, message) {
					if (actual != expected) fail(actual, expected, message, '==', assert.equal);
				};

				// 6. The non-equality assertion tests for whether two objects are not equal
				// with != assert.notEqual(actual, expected, message_opt);

				assert.notEqual = function notEqual(actual, expected, message) {
					if (actual == expected) {
						fail(actual, expected, message, '!=', assert.notEqual);
					}
				};

				// 7. The equivalence assertion tests a deep equality relation.
				// assert.deepEqual(actual, expected, message_opt);

				assert.deepEqual = function deepEqual(actual, expected, message) {
					if (!_deepEqual(actual, expected)) {
						fail(actual, expected, message, 'deepEqual', assert.deepEqual);
					}
				};

				function _deepEqual(actual, expected) {
					// 7.1. All identical values are equivalent, as determined by ===.
					if (actual === expected) {
						return true;

					} else if (util.isBuffer(actual) && util.isBuffer(expected)) {
						if (actual.length != expected.length) return false;

						for (var i = 0; i < actual.length; i++) {
							if (actual[i] !== expected[i]) return false;
						}

						return true;

						// 7.2. If the expected value is a Date object, the actual value is
						// equivalent if it is also a Date object that refers to the same time.
					} else if (util.isDate(actual) && util.isDate(expected)) {
						return actual.getTime() === expected.getTime();

						// 7.3 If the expected value is a RegExp object, the actual value is
						// equivalent if it is also a RegExp object with the same source and
						// properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
					} else if (util.isRegExp(actual) && util.isRegExp(expected)) {
						return actual.source === expected.source &&
							actual.global === expected.global &&
							actual.multiline === expected.multiline &&
							actual.lastIndex === expected.lastIndex &&
							actual.ignoreCase === expected.ignoreCase;

						// 7.4. Other pairs that do not both pass typeof value == 'object',
						// equivalence is determined by ==.
					} else if (!util.isObject(actual) && !util.isObject(expected)) {
						return actual == expected;

						// 7.5 For all other Object pairs, including Array objects, equivalence is
						// determined by having the same number of owned properties (as verified
						// with Object.prototype.hasOwnProperty.call), the same set of keys
						// (although not necessarily the same order), equivalent values for every
						// corresponding key, and an identical 'prototype' property. Note: this
						// accounts for both named and indexed properties on Arrays.
					} else {
						return objEquiv(actual, expected);
					}
				}

				function isArguments(object) {
					return Object.prototype.toString.call(object) == '[object Arguments]';
				}

				function objEquiv(a, b) {
					if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))
						return false;
					// an identical 'prototype' property.
					if (a.prototype !== b.prototype) return false;
					// if one is a primitive, the other must be same
					if (util.isPrimitive(a) || util.isPrimitive(b)) {
						return a === b;
					}
					var aIsArgs = isArguments(a),
						bIsArgs = isArguments(b);
					if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
						return false;
					if (aIsArgs) {
						a = pSlice.call(a);
						b = pSlice.call(b);
						return _deepEqual(a, b);
					}
					var ka = objectKeys(a),
						kb = objectKeys(b),
						key, i;
					// having the same number of owned properties (keys incorporates
					// hasOwnProperty)
					if (ka.length != kb.length)
						return false;
					//the same set of keys (although not necessarily the same order),
					ka.sort();
					kb.sort();
					//~~~cheap key test
					for (i = ka.length - 1; i >= 0; i--) {
						if (ka[i] != kb[i])
							return false;
					}
					//equivalent values for every corresponding key, and
					//~~~possibly expensive deep test
					for (i = ka.length - 1; i >= 0; i--) {
						key = ka[i];
						if (!_deepEqual(a[key], b[key])) return false;
					}
					return true;
				}

				// 8. The non-equivalence assertion tests for any deep inequality.
				// assert.notDeepEqual(actual, expected, message_opt);

				assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
					if (_deepEqual(actual, expected)) {
						fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
					}
				};

				// 9. The strict equality assertion tests strict equality, as determined by ===.
				// assert.strictEqual(actual, expected, message_opt);

				assert.strictEqual = function strictEqual(actual, expected, message) {
					if (actual !== expected) {
						fail(actual, expected, message, '===', assert.strictEqual);
					}
				};

				// 10. The strict non-equality assertion tests for strict inequality, as
				// determined by !==.  assert.notStrictEqual(actual, expected, message_opt);

				assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
					if (actual === expected) {
						fail(actual, expected, message, '!==', assert.notStrictEqual);
					}
				};

				function expectedException(actual, expected) {
					if (!actual || !expected) {
						return false;
					}

					if (Object.prototype.toString.call(expected) == '[object RegExp]') {
						return expected.test(actual);
					} else if (actual instanceof expected) {
						return true;
					} else if (expected.call({}, actual) === true) {
						return true;
					}

					return false;
				}

				function _throws(shouldThrow, block, expected, message) {
					var actual;

					if (util.isString(expected)) {
						message = expected;
						expected = null;
					}

					try {
						block();
					} catch (e) {
						actual = e;
					}

					message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
						(message ? ' ' + message : '.');

					if (shouldThrow && !actual) {
						fail(actual, expected, 'Missing expected exception' + message);
					}

					if (!shouldThrow && expectedException(actual, expected)) {
						fail(actual, expected, 'Got unwanted exception' + message);
					}

					if ((shouldThrow && actual && expected &&
						!expectedException(actual, expected)) || (!shouldThrow && actual)) {
						throw actual;
					}
				}

				// 11. Expected to throw an error:
				// assert.throws(block, Error_opt, message_opt);

				assert.throws = function (block, /*optional*/error, /*optional*/message) {
					_throws.apply(this, [true].concat(pSlice.call(arguments)));
				};

				// EXTENSION! This is annoying to write outside this module.
				assert.doesNotThrow = function (block, /*optional*/message) {
					_throws.apply(this, [false].concat(pSlice.call(arguments)));
				};

				assert.ifError = function (err) { if (err) { throw err; } };

				var objectKeys = Object.keys || function (obj) {
					var keys = [];
					for (var key in obj) {
						if (hasOwn.call(obj, key)) keys.push(key);
					}
					return keys;
				};

			}, { "util/": 224 }], 23: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/array/from"), __esModule: true };
			}, { "core-js/library/fn/array/from": 62 }], 24: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/get-iterator"), __esModule: true };
			}, { "core-js/library/fn/get-iterator": 63 }], 25: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/is-iterable"), __esModule: true };
			}, { "core-js/library/fn/is-iterable": 64 }], 26: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/object/assign"), __esModule: true };
			}, { "core-js/library/fn/object/assign": 65 }], 27: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/object/create"), __esModule: true };
			}, { "core-js/library/fn/object/create": 66 }], 28: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/object/define-properties"), __esModule: true };
			}, { "core-js/library/fn/object/define-properties": 67 }], 29: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/object/define-property"), __esModule: true };
			}, { "core-js/library/fn/object/define-property": 68 }], 30: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/object/freeze"), __esModule: true };
			}, { "core-js/library/fn/object/freeze": 69 }], 31: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/object/get-own-property-descriptor"), __esModule: true };
			}, { "core-js/library/fn/object/get-own-property-descriptor": 70 }], 32: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/object/get-prototype-of"), __esModule: true };
			}, { "core-js/library/fn/object/get-prototype-of": 71 }], 33: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/object/keys"), __esModule: true };
			}, { "core-js/library/fn/object/keys": 72 }], 34: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/object/set-prototype-of"), __esModule: true };
			}, { "core-js/library/fn/object/set-prototype-of": 73 }], 35: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/symbol"), __esModule: true };
			}, { "core-js/library/fn/symbol": 74 }], 36: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "default": localRequire("core-js/library/fn/symbol/iterator"), __esModule: true };
			}, { "core-js/library/fn/symbol/iterator": 75 }], 37: [function (localRequire, localModule, localExports) {
				"use strict";

				localExports.__esModule = true;

				localExports.default = function (instance, Constructor) {
					if (!(instance instanceof Constructor)) {
						throw new TypeError("Cannot call a class as a function");
					}
				};
			}, {}], 38: [function (localRequire, localModule, localExports) {
				"use strict";

				localExports.__esModule = true;

				var _defineProperty = localRequire("../core-js/object/define-property");

				var _defineProperty2 = _interopRequireDefault(_defineProperty);

				function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

				localExports.default = function () {
					function defineProperties(target, props) {
						for (var i = 0; i < props.length; i++) {
							var descriptor = props[i];
							descriptor.enumerable = descriptor.enumerable || false;
							descriptor.configurable = true;
							if ("value" in descriptor) descriptor.writable = true;
							(_defineProperty2.default)(target, descriptor.key, descriptor);
						}
					}

					return function (Constructor, protoProps, staticProps) {
						if (protoProps) defineProperties(Constructor.prototype, protoProps);
						if (staticProps) defineProperties(Constructor, staticProps);
						return Constructor;
					};
				} ();
			}, { "../core-js/object/define-property": 29 }], 39: [function (localRequire, localModule, localExports) {
				"use strict";

				localExports.__esModule = true;

				var _getPrototypeOf = localRequire("../core-js/object/get-prototype-of");

				var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

				var _getOwnPropertyDescriptor = localRequire("../core-js/object/get-own-property-descriptor");

				var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor);

				function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

				localExports.default = function get(object, property, receiver) {
					if (object === null) object = Function.prototype;
					var desc = (_getOwnPropertyDescriptor2.default)(object, property);

					if (desc === undefined) {
						var parent = (_getPrototypeOf2.default)(object);

						if (parent === null) {
							return undefined;
						} else {
							return get(parent, property, receiver);
						}
					} else if ("value" in desc) {
						return desc.value;
					} else {
						var getter = desc.get;

						if (getter === undefined) {
							return undefined;
						}

						return getter.call(receiver);
					}
				};
			}, { "../core-js/object/get-own-property-descriptor": 31, "../core-js/object/get-prototype-of": 32 }], 40: [function (localRequire, localModule, localExports) {
				"use strict";

				localExports.__esModule = true;

				var _setPrototypeOf = localRequire("../core-js/object/set-prototype-of");

				var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);

				var _create = localRequire("../core-js/object/create");

				var _create2 = _interopRequireDefault(_create);

				var _typeof2 = localRequire("../helpers/typeof");

				var _typeof3 = _interopRequireDefault(_typeof2);

				function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

				localExports.default = function (subClass, superClass) {
					if (typeof superClass !== "function" && superClass !== null) {
						throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (_typeof3.default)(superClass)));
					}

					subClass.prototype = (_create2.default)(superClass && superClass.prototype, {
						constructor: {
							value: subClass,
							enumerable: false,
							writable: true,
							configurable: true
						}
					});
					if (superClass) _setPrototypeOf2.default ? (_setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
				};
			}, { "../core-js/object/create": 27, "../core-js/object/set-prototype-of": 34, "../helpers/typeof": 44 }], 41: [function (localRequire, localModule, localExports) {
				"use strict";

				localExports.__esModule = true;

				var _typeof2 = localRequire("../helpers/typeof");

				var _typeof3 = _interopRequireDefault(_typeof2);

				function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

				localExports.default = function (self, call) {
					if (!self) {
						throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
					}

					return call && ((typeof call === "undefined" ? "undefined" : (_typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
				};
			}, { "../helpers/typeof": 44 }], 42: [function (localRequire, localModule, localExports) {
				"use strict";

				localExports.__esModule = true;

				var _isIterable2 = localRequire("../core-js/is-iterable");

				var _isIterable3 = _interopRequireDefault(_isIterable2);

				var _getIterator2 = localRequire("../core-js/get-iterator");

				var _getIterator3 = _interopRequireDefault(_getIterator2);

				function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

				localExports.default = function () {
					function sliceIterator(arr, i) {
						var _arr = [];
						var _n = true;
						var _d = false;
						var _e = undefined;

						try {
							for (var _i = (_getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {
								_arr.push(_s.value);

								if (i && _arr.length === i) break;
							}
						} catch (err) {
							_d = true;
							_e = err;
						} finally {
							try {
								if (!_n && _i["return"]) _i["return"]();
							} finally {
								if (_d) throw _e;
							}
						}

						return _arr;
					}

					return function (arr, i) {
						if (Array.isArray(arr)) {
							return arr;
						} else if ((_isIterable3.default)(Object(arr))) {
							return sliceIterator(arr, i);
						} else {
							throw new TypeError("Invalid attempt to destructure non-iterable instance");
						}
					};
				} ();
			}, { "../core-js/get-iterator": 24, "../core-js/is-iterable": 25 }], 43: [function (localRequire, localModule, localExports) {
				"use strict";

				localExports.__esModule = true;

				var _from = localRequire("../core-js/array/from");

				var _from2 = _interopRequireDefault(_from);

				function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

				localExports.default = function (arr) {
					if (Array.isArray(arr)) {
						for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
							arr2[i] = arr[i];
						}

						return arr2;
					} else {
						return (_from2.default)(arr);
					}
				};
			}, { "../core-js/array/from": 23 }], 44: [function (localRequire, localModule, localExports) {
				"use strict";

				localExports.__esModule = true;

				var _iterator = localRequire("../core-js/symbol/iterator");

				var _iterator2 = _interopRequireDefault(_iterator);

				var _symbol = localRequire("../core-js/symbol");

				var _symbol2 = _interopRequireDefault(_symbol);

				var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default ? "symbol" : typeof obj; };

				function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

				localExports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
					return typeof obj === "undefined" ? "undefined" : _typeof(obj);
				} : function (obj) {
					return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
				};
			}, { "../core-js/symbol": 35, "../core-js/symbol/iterator": 36 }], 45: [function (localRequire, localModule, localExports) {
				'use strict'

				localExports.toByteArray = toByteArray
				localExports.fromByteArray = fromByteArray

				var lookup = []
				var revLookup = []
				var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array

				function init() {
					var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
					for (var i = 0, len = code.length; i < len; ++i) {
						lookup[i] = code[i]
						revLookup[code.charCodeAt(i)] = i
					}

					revLookup['-'.charCodeAt(0)] = 62
					revLookup['_'.charCodeAt(0)] = 63
				}

				init()

				function toByteArray(b64) {
					var i, j, l, tmp, placeHolders, arr
					var len = b64.length

					if (len % 4 > 0) {
						throw new Error('Invalid string. Length must be a multiple of 4')
					}

					// the number of equal signs (place holders)
					// if there are two placeholders, than the two characters before it
					// represent one byte
					// if there is only one, then the three characters before it represent 2 bytes
					// this is just a cheap hack to not do indexOf twice
					placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0

					// base64 is 4/3 + up to two characters of the original data
					arr = new Arr(len * 3 / 4 - placeHolders)

					// if there are placeholders, only get up to the last complete 4 chars
					l = placeHolders > 0 ? len - 4 : len

					var L = 0

					for (i = 0, j = 0; i < l; i += 4, j += 3) {
						tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
						arr[L++] = (tmp >> 16) & 0xFF
						arr[L++] = (tmp >> 8) & 0xFF
						arr[L++] = tmp & 0xFF
					}

					if (placeHolders === 2) {
						tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
						arr[L++] = tmp & 0xFF
					} else if (placeHolders === 1) {
						tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
						arr[L++] = (tmp >> 8) & 0xFF
						arr[L++] = tmp & 0xFF
					}

					return arr
				}

				function tripletToBase64(num) {
					return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
				}

				function encodeChunk(uint8, start, end) {
					var tmp
					var output = []
					for (var i = start; i < end; i += 3) {
						tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
						output.push(tripletToBase64(tmp))
					}
					return output.join('')
				}

				function fromByteArray(uint8) {
					var tmp
					var len = uint8.length
					var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
					var output = ''
					var parts = []
					var maxChunkLength = 16383 // must be multiple of 3

					// go through the array every three bytes, we'll deal with trailing stuff later
					for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
						parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
					}

					// pad the end with zeros, but make sure to not forget the extra bytes
					if (extraBytes === 1) {
						tmp = uint8[len - 1]
						output += lookup[tmp >> 2]
						output += lookup[(tmp << 4) & 0x3F]
						output += '=='
					} else if (extraBytes === 2) {
						tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
						output += lookup[tmp >> 10]
						output += lookup[(tmp >> 4) & 0x3F]
						output += lookup[(tmp << 2) & 0x3F]
						output += '='
					}

					parts.push(output)

					return parts.join('')
				}

			}, {}],
			//46: [function (localRequire, localModule, localExports) {
			//	/* Copyright 2013 Google Inc. All Rights Reserved.
				
			//	   Licensed under the Apache License, Version 2.0 (the "License");
			//	   you may not use this file except in compliance with the License.
			//	   You may obtain a copy of the License at
				
			//	   http://www.apache.org/licenses/LICENSE-2.0
				
			//	   Unless required by applicable law or agreed to in writing, software
			//	   distributed under the License is distributed on an "AS IS" BASIS,
			//	   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
			//	   See the License for the specific language governing permissions and
			//	   limitations under the License.
				
			//	   Bit reading helpers
			//	*/

			//	const BROTLI_READ_SIZE = 4096;
			//	const BROTLI_IBUF_SIZE = (2 * BROTLI_READ_SIZE + 32);
			//	const BROTLI_IBUF_MASK = (2 * BROTLI_READ_SIZE - 1);

			//	const kBitMask = new Uint32Array([
			//		0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767,
			//		65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215
			//	]);

			//	/* Input byte buffer, consist of a ringbuffer and a "slack" region where */
			//	/* bytes from the start of the ringbuffer are copied. */
			//	function BrotliBitReader(input) {
			//		this.buf_ = new Uint8Array(BROTLI_IBUF_SIZE);
			//		this.input_ = input;    /* input callback */

			//		this.reset();
			//	}

			//	(<any>BrotliBitReader).READ_SIZE = BROTLI_READ_SIZE;
			//	(<any>BrotliBitReader).IBUF_MASK = BROTLI_IBUF_MASK;

			//	BrotliBitReader.prototype.reset = function () {
			//		this.buf_ptr_ = 0;      /* next input will write here */
			//		this.val_ = 0;          /* pre-fetched bits */
			//		this.pos_ = 0;          /* byte position in stream */
			//		this.bit_pos_ = 0;      /* current bit-reading position in val_ */
			//		this.bit_end_pos_ = 0;  /* bit-reading end position from LSB of val_ */
			//		this.eos_ = 0;          /* input stream is finished */

			//		this.readMoreInput();
			//		for (var i = 0; i < 4; i++) {
			//			this.val_ |= this.buf_[this.pos_] << (8 * i);
			//			++this.pos_;
			//		}

			//		return this.bit_end_pos_ > 0;
			//	};

			//	/* Fills up the input ringbuffer by calling the input callback.
				
			//	   Does nothing if there are at least 32 bytes present after current position.
				
			//	   Returns 0 if either:
			//		- the input callback returned an error, or
			//		- there is no more input and the position is past the end of the stream.
				
			//	   After encountering the end of the input stream, 32 additional zero bytes are
			//	   copied to the ringbuffer, therefore it is safe to call this function after
			//	   every 32 bytes of input is read.
			//	*/
			//	BrotliBitReader.prototype.readMoreInput = function () {
			//		if (this.bit_end_pos_ > 256) {
			//			return;
			//		} else if (this.eos_) {
			//			if (this.bit_pos_ > this.bit_end_pos_)
			//				throw new Error('Unexpected end of input ' + this.bit_pos_ + ' ' + this.bit_end_pos_);
			//		} else {
			//			var dst = this.buf_ptr_;
			//			var bytes_read = this.input_.read(this.buf_, dst, BROTLI_READ_SIZE);
			//			if (bytes_read < 0) {
			//				throw new Error('Unexpected end of input');
			//			}

			//			if (bytes_read < BROTLI_READ_SIZE) {
			//				this.eos_ = 1;
			//				/* Store 32 bytes of zero after the stream end. */
			//				for (var p = 0; p < 32; p++)
			//					this.buf_[dst + bytes_read + p] = 0;
			//			}

			//			if (dst === 0) {
			//				/* Copy the head of the ringbuffer to the slack region. */
			//				for (var p = 0; p < 32; p++)
			//					this.buf_[(BROTLI_READ_SIZE << 1) + p] = this.buf_[p];

			//				this.buf_ptr_ = BROTLI_READ_SIZE;
			//			} else {
			//				this.buf_ptr_ = 0;
			//			}

			//			this.bit_end_pos_ += bytes_read << 3;
			//		}
			//	};

			//	/* Guarantees that there are at least 24 bits in the buffer. */
			//	BrotliBitReader.prototype.fillBitWindow = function () {
			//		while (this.bit_pos_ >= 8) {
			//			this.val_ >>>= 8;
			//			this.val_ |= this.buf_[this.pos_ & BROTLI_IBUF_MASK] << 24;
			//			++this.pos_;
			//			this.bit_pos_ = this.bit_pos_ - 8 >>> 0;
			//			this.bit_end_pos_ = this.bit_end_pos_ - 8 >>> 0;
			//		}
			//	};

			//	/* Reads the specified number of bits from Read Buffer. */
			//	BrotliBitReader.prototype.readBits = function (n_bits) {
			//		if (32 - this.bit_pos_ < n_bits) {
			//			this.fillBitWindow();
			//		}

			//		var val = ((this.val_ >>> this.bit_pos_) & kBitMask[n_bits]);
			//		this.bit_pos_ += n_bits;
			//		return val;
			//	};

			//	localModule.localExports = BrotliBitReader;

			//}, {}], 47: [function (localRequire, localModule, localExports) {
			//	/* Copyright 2013 Google Inc. All Rights Reserved.
				
			//	   Licensed under the Apache License, Version 2.0 (the "License");
			//	   you may not use this file except in compliance with the License.
			//	   You may obtain a copy of the License at
				
			//	   http://www.apache.org/licenses/LICENSE-2.0
				
			//	   Unless required by applicable law or agreed to in writing, software
			//	   distributed under the License is distributed on an "AS IS" BASIS,
			//	   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
			//	   See the License for the specific language governing permissions and
			//	   limitations under the License.
				
			//	   Lookup table to map the previous two bytes to a context id.
				
			//	   There are four different context modeling modes defined here:
			//		 CONTEXT_LSB6: context id is the least significant 6 bits of the last byte,
			//		 CONTEXT_MSB6: context id is the most significant 6 bits of the last byte,
			//		 CONTEXT_UTF8: second-order context model tuned for UTF8-encoded text,
			//		 CONTEXT_SIGNED: second-order context model tuned for signed integers.
				
			//	   The context id for the UTF8 context model is calculated as follows. If p1
			//	   and p2 are the previous two bytes, we calcualte the context as
				
			//		 context = kContextLookup[p1] | kContextLookup[p2 + 256].
				
			//	   If the previous two bytes are ASCII characters (i.e. < 128), this will be
			//	   equivalent to
				
			//		 context = 4 * context1(p1) + context2(p2),
				
			//	   where context1 is based on the previous byte in the following way:
				
			//		 0  : non-ASCII control
			//		 1  : \t, \n, \r
			//		 2  : space
			//		 3  : other punctuation
			//		 4  : " '
			//		 5  : %
			//		 6  : ( < [ {
			//		 7  : ) > ] }
			//		 8  : , ; :
			//		 9  : .
			//		 10 : =
			//		 11 : number
			//		 12 : upper-case vowel
			//		 13 : upper-case consonant
			//		 14 : lower-case vowel
			//		 15 : lower-case consonant
				
			//	   and context2 is based on the second last byte:
				
			//		 0 : control, space
			//		 1 : punctuation
			//		 2 : upper-case letter, number
			//		 3 : lower-case letter
				
			//	   If the last byte is ASCII, and the second last byte is not (in a valid UTF8
			//	   stream it will be a continuation byte, value between 128 and 191), the
			//	   context is the same as if the second last byte was an ASCII control or space.
				
			//	   If the last byte is a UTF8 lead byte (value >= 192), then the next byte will
			//	   be a continuation byte and the context id is 2 or 3 depending on the LSB of
			//	   the last byte and to a lesser extent on the second last byte if it is ASCII.
				
			//	   If the last byte is a UTF8 continuation byte, the second last byte can be:
			//		 - continuation byte: the next byte is probably ASCII or lead byte (assuming
			//		   4-byte UTF8 characters are rare) and the context id is 0 or 1.
			//		 - lead byte (192 - 207): next byte is ASCII or lead byte, context is 0 or 1
			//		 - lead byte (208 - 255): next byte is continuation byte, context is 2 or 3
				
			//	   The possible value combinations of the previous two bytes, the range of
			//	   context ids and the type of the next byte is summarized in the table below:
				
			//	   |--------\-----------------------------------------------------------------|
			//	   |         \                         Last byte                              |
			//	   | Second   \---------------------------------------------------------------|
			//	   | last byte \    ASCII            |   cont. byte        |   lead byte      |
			//	   |            \   (0-127)          |   (128-191)         |   (192-)         |
			//	   |=============|===================|=====================|==================|
			//	   |  ASCII      | next: ASCII/lead  |  not valid          |  next: cont.     |
			//	   |  (0-127)    | context: 4 - 63   |                     |  context: 2 - 3  |
			//	   |-------------|-------------------|---------------------|------------------|
			//	   |  cont. byte | next: ASCII/lead  |  next: ASCII/lead   |  next: cont.     |
			//	   |  (128-191)  | context: 4 - 63   |  context: 0 - 1     |  context: 2 - 3  |
			//	   |-------------|-------------------|---------------------|------------------|
			//	   |  lead byte  | not valid         |  next: ASCII/lead   |  not valid       |
			//	   |  (192-207)  |                   |  context: 0 - 1     |                  |
			//	   |-------------|-------------------|---------------------|------------------|
			//	   |  lead byte  | not valid         |  next: cont.        |  not valid       |
			//	   |  (208-)     |                   |  context: 2 - 3     |                  |
			//	   |-------------|-------------------|---------------------|------------------|
				
			//	   The context id for the signed context mode is calculated as:
				
			//		 context = (kContextLookup[512 + p1] << 3) | kContextLookup[512 + p2].
				
			//	   For any context modeling modes, the context ids can be calculated by |-ing
			//	   together two lookups from one table using context model dependent offsets:
				
			//		 context = kContextLookup[offset1 + p1] | kContextLookup[offset2 + p2].
				
			//	   where offset1 and offset2 are dependent on the context mode.
			//	*/

			//	const CONTEXT_LSB6 = 0;
			//	const CONTEXT_MSB6 = 1;
			//	const CONTEXT_UTF8 = 2;
			//	const CONTEXT_SIGNED = 3;

			//	/* Common context lookup table for all context modes. */
			//	localExports.lookup = new Uint8Array([
			//		/* CONTEXT_UTF8, last byte. */
			//		/* ASCII range. */
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		8, 12, 16, 12, 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12,
			//		44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12,
			//		12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48,
			//		52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12,
			//		12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56,
			//		60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0,
			//		/* UTF8 continuation byte range. */
			//		0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
			//		0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
			//		0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
			//		0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
			//		/* UTF8 lead byte range. */
			//		2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
			//		2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
			//		2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
			//		2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
			//		/* CONTEXT_UTF8 second last byte. */
			//		/* ASCII range. */
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
			//		2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1,
			//		1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
			//		2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,
			//		1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
			//		3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0,
			//		/* UTF8 continuation byte range. */
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		/* UTF8 lead byte range. */
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
			//		2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
			//		/* CONTEXT_SIGNED, second last byte. */
			//		0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
			//		2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
			//		2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
			//		2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
			//		3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
			//		3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
			//		3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
			//		3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
			//		4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
			//		4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
			//		4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
			//		4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
			//		5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
			//		5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
			//		5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
			//		6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,
			//		/* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */
			//		0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
			//		16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
			//		16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
			//		16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
			//		24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
			//		24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
			//		24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
			//		24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
			//		32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
			//		32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
			//		32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
			//		32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
			//		40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
			//		40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
			//		40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
			//		48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56,
			//		/* CONTEXT_LSB6, last byte. */
			//		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
			//		16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
			//		32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
			//		48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
			//		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
			//		16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
			//		32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
			//		48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
			//		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
			//		16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
			//		32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
			//		48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
			//		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
			//		16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
			//		32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
			//		48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
			//		/* CONTEXT_MSB6, last byte. */
			//		0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
			//		4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
			//		8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11,
			//		12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15,
			//		16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19,
			//		20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23,
			//		24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27,
			//		28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31,
			//		32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35,
			//		36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39,
			//		40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43,
			//		44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47,
			//		48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51,
			//		52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55,
			//		56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59,
			//		60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63,
			//		/* CONTEXT_{M,L}SB6, second last byte, */
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			//	]);

			//	localExports.lookupOffsets = new Uint16Array([
			//		/* CONTEXT_LSB6 */
			//		1024, 1536,
			//		/* CONTEXT_MSB6 */
			//		1280, 1536,
			//		/* CONTEXT_UTF8 */
			//		0, 256,
			//		/* CONTEXT_SIGNED */
			//		768, 512,
			//	]);

			//}, {}], 48: [function (localRequire, localModule, localExports) {
			//	/* Copyright 2013 Google Inc. All Rights Reserved.
				
			//	   Licensed under the Apache License, Version 2.0 (the "License");
			//	   you may not use this file except in compliance with the License.
			//	   You may obtain a copy of the License at
				
			//	   http://www.apache.org/licenses/LICENSE-2.0
				
			//	   Unless required by applicable law or agreed to in writing, software
			//	   distributed under the License is distributed on an "AS IS" BASIS,
			//	   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
			//	   See the License for the specific language governing permissions and
			//	   limitations under the License.
			//	*/

			//	var BrotliInput = localRequire('./streams').BrotliInput;
			//	var BrotliOutput = localRequire('./streams').BrotliOutput;
			//	var BrotliBitReader = localRequire('./bit_reader');
			//	var BrotliDictionary = localRequire('./dictionary');
			//	var HuffmanCode = localRequire('./huffman').HuffmanCode;
			//	var BrotliBuildHuffmanTable = localRequire('./huffman').BrotliBuildHuffmanTable;
			//	var Context = localRequire('./context');
			//	var Prefix = localRequire('./prefix');
			//	var Transform = localRequire('./transform');

			//	const kDefaultCodeLength = 8;
			//	const kCodeLengthRepeatCode = 16;
			//	const kNumLiteralCodes = 256;
			//	const kNumInsertAndCopyCodes = 704;
			//	const kNumBlockLengthCodes = 26;
			//	const kLiteralContextBits = 6;
			//	const kDistanceContextBits = 2;

			//	const HUFFMAN_TABLE_BITS = 8;
			//	const HUFFMAN_TABLE_MASK = 0xff;
			//	/* Maximum possible Huffman table size for an alphabet size of 704, max code
			//	 * length 15 and root table bits 8. */
			//	const HUFFMAN_MAX_TABLE_SIZE = 1080;

			//	const CODE_LENGTH_CODES = 18;
			//	const kCodeLengthCodeOrder = new Uint8Array([
			//		1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15,
			//	]);

			//	const NUM_DISTANCE_SHORT_CODES = 16;
			//	const kDistanceShortCodeIndexOffset = new Uint8Array([
			//		3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2
			//	]);

			//	const kDistanceShortCodeValueOffset = new Int8Array([
			//		0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3
			//	]);

			//	const kMaxHuffmanTableSize = new Uint16Array([
			//		256, 402, 436, 468, 500, 534, 566, 598, 630, 662, 694, 726, 758, 790, 822,
			//		854, 886, 920, 952, 984, 1016, 1048, 1080
			//	]);

			//	function DecodeWindowBits(br) {
			//		var n;
			//		if (br.readBits(1) === 0) {
			//			return 16;
			//		}

			//		n = br.readBits(3);
			//		if (n > 0) {
			//			return 17 + n;
			//		}

			//		n = br.readBits(3);
			//		if (n > 0) {
			//			return 8 + n;
			//		}

			//		return 17;
			//	}

			//	/* Decodes a number in the range [0..255], by reading 1 - 11 bits. */
			//	function DecodeVarLenUint8(br) {
			//		if (br.readBits(1)) {
			//			var nbits = br.readBits(3);
			//			if (nbits === 0) {
			//				return 1;
			//			} else {
			//				return br.readBits(nbits) + (1 << nbits);
			//			}
			//		}
			//		return 0;
			//	}

			//	function MetaBlockLength() {
			//		this.meta_block_length = 0;
			//		this.input_end = 0;
			//		this.is_uncompressed = 0;
			//		this.is_metadata = false;
			//	}

			//	function DecodeMetaBlockLength(br) {
			//		var out = new MetaBlockLength;
			//		var size_nibbles;
			//		var size_bytes;
			//		var i;

			//		out.input_end = br.readBits(1);
			//		if (out.input_end && br.readBits(1)) {
			//			return out;
			//		}

			//		size_nibbles = br.readBits(2) + 4;
			//		if (size_nibbles === 7) {
			//			out.is_metadata = true;

			//			if (br.readBits(1) !== 0)
			//				throw new Error('Invalid reserved bit');

			//			size_bytes = br.readBits(2);
			//			if (size_bytes === 0)
			//				return out;

			//			for (i = 0; i < size_bytes; i++) {
			//				var next_byte = br.readBits(8);
			//				if (i + 1 === size_bytes && size_bytes > 1 && next_byte === 0)
			//					throw new Error('Invalid size byte');

			//				out.meta_block_length |= next_byte << (i * 8);
			//			}
			//		} else {
			//			for (i = 0; i < size_nibbles; ++i) {
			//				var next_nibble = br.readBits(4);
			//				if (i + 1 === size_nibbles && size_nibbles > 4 && next_nibble === 0)
			//					throw new Error('Invalid size nibble');

			//				out.meta_block_length |= next_nibble << (i * 4);
			//			}
			//		}

			//		++out.meta_block_length;

			//		if (!out.input_end && !out.is_metadata) {
			//			out.is_uncompressed = br.readBits(1);
			//		}

			//		return out;
			//	}

			//	/* Decodes the next Huffman code from bit-stream. */
			//	function ReadSymbol(table, index, br) {
			//		var start_index = index;

			//		var nbits;
			//		br.fillBitWindow();
			//		index += (br.val_ >>> br.bit_pos_) & HUFFMAN_TABLE_MASK;
			//		nbits = table[index].bits - HUFFMAN_TABLE_BITS;
			//		if (nbits > 0) {
			//			br.bit_pos_ += HUFFMAN_TABLE_BITS;
			//			index += table[index].value;
			//			index += (br.val_ >>> br.bit_pos_) & ((1 << nbits) - 1);
			//		}
			//		br.bit_pos_ += table[index].bits;
			//		return table[index].value;
			//	}

			//	function ReadHuffmanCodeLengths(code_length_code_lengths, num_symbols, code_lengths, br) {
			//		var symbol = 0;
			//		var prev_code_len = kDefaultCodeLength;
			//		var repeat = 0;
			//		var repeat_code_len = 0;
			//		var space = 32768;

			//		var table = [];
			//		for (var i = 0; i < 32; i++)
			//			table.push(new HuffmanCode(0, 0));

			//		BrotliBuildHuffmanTable(table, 0, 5, code_length_code_lengths, CODE_LENGTH_CODES);

			//		while (symbol < num_symbols && space > 0) {
			//			var p = 0;
			//			var code_len;

			//			br.readMoreInput();
			//			br.fillBitWindow();
			//			p += (br.val_ >>> br.bit_pos_) & 31;
			//			br.bit_pos_ += table[p].bits;
			//			code_len = table[p].value & 0xff;
			//			if (code_len < kCodeLengthRepeatCode) {
			//				repeat = 0;
			//				code_lengths[symbol++] = code_len;
			//				if (code_len !== 0) {
			//					prev_code_len = code_len;
			//					space -= 32768 >> code_len;
			//				}
			//			} else {
			//				var extra_bits = code_len - 14;
			//				var old_repeat;
			//				var repeat_delta;
			//				var new_len = 0;
			//				if (code_len === kCodeLengthRepeatCode) {
			//					new_len = prev_code_len;
			//				}
			//				if (repeat_code_len !== new_len) {
			//					repeat = 0;
			//					repeat_code_len = new_len;
			//				}
			//				old_repeat = repeat;
			//				if (repeat > 0) {
			//					repeat -= 2;
			//					repeat <<= extra_bits;
			//				}
			//				repeat += br.readBits(extra_bits) + 3;
			//				repeat_delta = repeat - old_repeat;
			//				if (symbol + repeat_delta > num_symbols) {
			//					throw new Error('[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols');
			//				}

			//				for (var x = 0; x < repeat_delta; x++)
			//					code_lengths[symbol + x] = repeat_code_len;

			//				symbol += repeat_delta;

			//				if (repeat_code_len !== 0) {
			//					space -= repeat_delta << (15 - repeat_code_len);
			//				}
			//			}
			//		}
			//		if (space !== 0) {
			//			throw new Error("[ReadHuffmanCodeLengths] space = " + space);
			//		}

			//		for (; symbol < num_symbols; symbol++)
			//			code_lengths[symbol] = 0;
			//	}

			//	function ReadHuffmanCode(alphabet_size, tables, table, br) {
			//		var table_size = 0;
			//		var simple_code_or_skip;
			//		var code_lengths = new Uint8Array(alphabet_size);

			//		br.readMoreInput();

			//		/* simple_code_or_skip is used as follows:
			//		   1 for simple code;
			//		   0 for no skipping, 2 skips 2 code lengths, 3 skips 3 code lengths */
			//		simple_code_or_skip = br.readBits(2);
			//		if (simple_code_or_skip === 1) {
			//			/* Read symbols, codes & code lengths directly. */
			//			var i;
			//			var max_bits_counter = alphabet_size - 1;
			//			var max_bits = 0;
			//			var symbols = new Int32Array(4);
			//			var num_symbols = br.readBits(2) + 1;
			//			while (max_bits_counter) {
			//				max_bits_counter >>= 1;
			//				++max_bits;
			//			}

			//			for (i = 0; i < num_symbols; ++i) {
			//				symbols[i] = br.readBits(max_bits) % alphabet_size;
			//				code_lengths[symbols[i]] = 2;
			//			}
			//			code_lengths[symbols[0]] = 1;
			//			switch (num_symbols) {
			//				case 1:
			//					break;
			//				case 3:
			//					if ((symbols[0] === symbols[1]) ||
			//						(symbols[0] === symbols[2]) ||
			//						(symbols[1] === symbols[2])) {
			//						throw new Error('[ReadHuffmanCode] invalid symbols');
			//					}
			//					break;
			//				case 2:
			//					if (symbols[0] === symbols[1]) {
			//						throw new Error('[ReadHuffmanCode] invalid symbols');
			//					}

			//					code_lengths[symbols[1]] = 1;
			//					break;
			//				case 4:
			//					if ((symbols[0] === symbols[1]) ||
			//						(symbols[0] === symbols[2]) ||
			//						(symbols[0] === symbols[3]) ||
			//						(symbols[1] === symbols[2]) ||
			//						(symbols[1] === symbols[3]) ||
			//						(symbols[2] === symbols[3])) {
			//						throw new Error('[ReadHuffmanCode] invalid symbols');
			//					}

			//					if (br.readBits(1)) {
			//						code_lengths[symbols[2]] = 3;
			//						code_lengths[symbols[3]] = 3;
			//					} else {
			//						code_lengths[symbols[0]] = 2;
			//					}
			//					break;
			//			}
			//		} else {  /* Decode Huffman-coded code lengths. */
			//			var i;
			//			var code_length_code_lengths = new Uint8Array(CODE_LENGTH_CODES);
			//			var space = 32;
			//			var num_codes = 0;
			//			/* Static Huffman code for the code length code lengths */
			//			var huff = [
			//				new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2),
			//				new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 1),
			//				new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2),
			//				new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 5)
			//			];
			//			for (i = simple_code_or_skip; i < CODE_LENGTH_CODES && space > 0; ++i) {
			//				var code_len_idx = kCodeLengthCodeOrder[i];
			//				var p = 0;
			//				var v;
			//				br.fillBitWindow();
			//				p += (br.val_ >>> br.bit_pos_) & 15;
			//				br.bit_pos_ += huff[p].bits;
			//				v = huff[p].value;
			//				code_length_code_lengths[code_len_idx] = v;
			//				if (v !== 0) {
			//					space -= (32 >> v);
			//					++num_codes;
			//				}
			//			}

			//			if (!(num_codes === 1 || space === 0))
			//				throw new Error('[ReadHuffmanCode] invalid num_codes or space');

			//			ReadHuffmanCodeLengths(code_length_code_lengths, alphabet_size, code_lengths, br);
			//		}

			//		table_size = BrotliBuildHuffmanTable(tables, table, HUFFMAN_TABLE_BITS, code_lengths, alphabet_size);

			//		if (table_size === 0) {
			//			throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");
			//		}

			//		return table_size;
			//	}

			//	function ReadBlockLength(table, index, br) {
			//		var code;
			//		var nbits;
			//		code = ReadSymbol(table, index, br);
			//		nbits = Prefix.kBlockLengthPrefixCode[code].nbits;
			//		return Prefix.kBlockLengthPrefixCode[code].offset + br.readBits(nbits);
			//	}

			//	function TranslateShortCodes(code, ringbuffer, index) {
			//		var val;
			//		if (code < NUM_DISTANCE_SHORT_CODES) {
			//			index += kDistanceShortCodeIndexOffset[code];
			//			index &= 3;
			//			val = ringbuffer[index] + kDistanceShortCodeValueOffset[code];
			//		} else {
			//			val = code - NUM_DISTANCE_SHORT_CODES + 1;
			//		}
			//		return val;
			//	}

			//	function MoveToFront(v, index) {
			//		var value = v[index];
			//		var i = index;
			//		for (; i; --i) v[i] = v[i - 1];
			//		v[0] = value;
			//	}

			//	function InverseMoveToFrontTransform(v, v_len) {
			//		var mtf = new Uint8Array(256);
			//		var i;
			//		for (i = 0; i < 256; ++i) {
			//			mtf[i] = i;
			//		}
			//		for (i = 0; i < v_len; ++i) {
			//			var index = v[i];
			//			v[i] = mtf[index];
			//			if (index) MoveToFront(mtf, index);
			//		}
			//	}

			//	/* Contains a collection of huffman trees with the same alphabet size. */
			//	function HuffmanTreeGroup(alphabet_size, num_htrees) {
			//		this.alphabet_size = alphabet_size;
			//		this.num_htrees = num_htrees;
			//		this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]);
			//		this.htrees = new Uint32Array(num_htrees);
			//	}

			//	HuffmanTreeGroup.prototype.decode = function (br) {
			//		var i;
			//		var table_size;
			//		var next = 0;
			//		for (i = 0; i < this.num_htrees; ++i) {
			//			this.htrees[i] = next;
			//			table_size = ReadHuffmanCode(this.alphabet_size, this.codes, next, br);
			//			next += table_size;
			//		}
			//	};

			//	function DecodeContextMap(context_map_size, br) {
			//		var out = { num_htrees: null, context_map: null };
			//		var use_rle_for_zeros;
			//		var max_run_length_prefix = 0;
			//		var table;
			//		var i;

			//		br.readMoreInput();
			//		var num_htrees = out.num_htrees = DecodeVarLenUint8(br) + 1;

			//		var context_map = out.context_map = new Uint8Array(context_map_size);
			//		if (num_htrees <= 1) {
			//			return out;
			//		}

			//		use_rle_for_zeros = br.readBits(1);
			//		if (use_rle_for_zeros) {
			//			max_run_length_prefix = br.readBits(4) + 1;
			//		}

			//		table = [];
			//		for (i = 0; i < HUFFMAN_MAX_TABLE_SIZE; i++) {
			//			table[i] = new HuffmanCode(0, 0);
			//		}

			//		ReadHuffmanCode(num_htrees + max_run_length_prefix, table, 0, br);

			//		for (i = 0; i < context_map_size;) {
			//			var code;

			//			br.readMoreInput();
			//			code = ReadSymbol(table, 0, br);
			//			if (code === 0) {
			//				context_map[i] = 0;
			//				++i;
			//			} else if (code <= max_run_length_prefix) {
			//				var reps = 1 + (1 << code) + br.readBits(code);
			//				while (--reps) {
			//					if (i >= context_map_size) {
			//						throw new Error("[DecodeContextMap] i >= context_map_size");
			//					}
			//					context_map[i] = 0;
			//					++i;
			//				}
			//			} else {
			//				context_map[i] = code - max_run_length_prefix;
			//				++i;
			//			}
			//		}
			//		if (br.readBits(1)) {
			//			InverseMoveToFrontTransform(context_map, context_map_size);
			//		}

			//		return out;
			//	}

			//	function DecodeBlockType(max_block_type, trees, tree_type, block_types, ringbuffers, indexes, br) {
			//		var ringbuffer = tree_type * 2;
			//		var index = tree_type;
			//		var type_code = ReadSymbol(trees, tree_type * HUFFMAN_MAX_TABLE_SIZE, br);
			//		var block_type;
			//		if (type_code === 0) {
			//			block_type = ringbuffers[ringbuffer + (indexes[index] & 1)];
			//		} else if (type_code === 1) {
			//			block_type = ringbuffers[ringbuffer + ((indexes[index] - 1) & 1)] + 1;
			//		} else {
			//			block_type = type_code - 2;
			//		}
			//		if (block_type >= max_block_type) {
			//			block_type -= max_block_type;
			//		}
			//		block_types[tree_type] = block_type;
			//		ringbuffers[ringbuffer + (indexes[index] & 1)] = block_type;
			//		++indexes[index];
			//	}

			//	function CopyUncompressedBlockToOutput(output, len, pos, ringbuffer, ringbuffer_mask, br) {
			//		var rb_size = ringbuffer_mask + 1;
			//		var rb_pos = pos & ringbuffer_mask;
			//		var br_pos = br.pos_ & BrotliBitReader.IBUF_MASK;
			//		var nbytes;

			//		/* For short lengths copy byte-by-byte */
			//		if (len < 8 || br.bit_pos_ + (len << 3) < br.bit_end_pos_) {
			//			while (len-- > 0) {
			//				br.readMoreInput();
			//				ringbuffer[rb_pos++] = br.readBits(8);
			//				if (rb_pos === rb_size) {
			//					output.write(ringbuffer, rb_size);
			//					rb_pos = 0;
			//				}
			//			}
			//			return;
			//		}

			//		if (br.bit_end_pos_ < 32) {
			//			throw new Error('[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32');
			//		}

			//		/* Copy remaining 0-4 bytes from br.val_ to ringbuffer. */
			//		while (br.bit_pos_ < 32) {
			//			ringbuffer[rb_pos] = (br.val_ >>> br.bit_pos_);
			//			br.bit_pos_ += 8;
			//			++rb_pos;
			//			--len;
			//		}

			//		/* Copy remaining bytes from br.buf_ to ringbuffer. */
			//		nbytes = (br.bit_end_pos_ - br.bit_pos_) >> 3;
			//		if (br_pos + nbytes > BrotliBitReader.IBUF_MASK) {
			//			var tail = BrotliBitReader.IBUF_MASK + 1 - br_pos;
			//			for (var x = 0; x < tail; x++)
			//				ringbuffer[rb_pos + x] = br.buf_[br_pos + x];

			//			nbytes -= tail;
			//			rb_pos += tail;
			//			len -= tail;
			//			br_pos = 0;
			//		}

			//		for (var x = 0; x < nbytes; x++)
			//			ringbuffer[rb_pos + x] = br.buf_[br_pos + x];

			//		rb_pos += nbytes;
			//		len -= nbytes;

			//		/* If we wrote past the logical end of the ringbuffer, copy the tail of the
			//		   ringbuffer to its beginning and flush the ringbuffer to the output. */
			//		if (rb_pos >= rb_size) {
			//			output.write(ringbuffer, rb_size);
			//			rb_pos -= rb_size;
			//			for (var x = 0; x < rb_pos; x++)
			//				ringbuffer[x] = ringbuffer[rb_size + x];
			//		}

			//		/* If we have more to copy than the remaining size of the ringbuffer, then we
			//		   first fill the ringbuffer from the input and then flush the ringbuffer to
			//		   the output */
			//		while (rb_pos + len >= rb_size) {
			//			nbytes = rb_size - rb_pos;
			//			if (br.input_.read(ringbuffer, rb_pos, nbytes) < nbytes) {
			//				throw new Error('[CopyUncompressedBlockToOutput] not enough bytes');
			//			}
			//			output.write(ringbuffer, rb_size);
			//			len -= nbytes;
			//			rb_pos = 0;
			//		}

			//		/* Copy straight from the input onto the ringbuffer. The ringbuffer will be
			//		   flushed to the output at a later time. */
			//		if (br.input_.read(ringbuffer, rb_pos, len) < len) {
			//			throw new Error('[CopyUncompressedBlockToOutput] not enough bytes');
			//		}

			//		/* Restore the state of the bit reader. */
			//		br.reset();
			//	}

			//	/* Advances the bit reader position to the next byte boundary and verifies
			//	   that any skipped bits are set to zero. */
			//	function JumpToByteBoundary(br) {
			//		var new_bit_pos = (br.bit_pos_ + 7) & ~7;
			//		var pad_bits = br.readBits(new_bit_pos - br.bit_pos_);
			//		return pad_bits == 0;
			//	}

			//	function BrotliDecompressedSize(buffer) {
			//		var input = new BrotliInput(buffer);
			//		var br = new BrotliBitReader(input);
			//		DecodeWindowBits(br);
			//		var out = DecodeMetaBlockLength(br);
			//		return out.meta_block_length;
			//	}

			//	localExports.BrotliDecompressedSize = BrotliDecompressedSize;

			//	function BrotliDecompressBuffer(buffer, output_size) {
			//		var input = new BrotliInput(buffer);

			//		if (output_size == null) {
			//			output_size = BrotliDecompressedSize(buffer);
			//		}

			//		var output_buffer = new Uint8Array(output_size);
			//		var output = new BrotliOutput(output_buffer);

			//		BrotliDecompress(input, output);

			//		if (output.pos < output_buffer.length) {
			//			output_buffer = output_buffer.subarray(0, output.pos);
			//		}

			//		return output_buffer;
			//	}

			//	localExports.BrotliDecompressBuffer = BrotliDecompressBuffer;

			//	function BrotliDecompress(input, output) {
			//		var i;
			//		var pos = 0;
			//		var input_end = 0;
			//		var window_bits = 0;
			//		var max_backward_distance;
			//		var max_distance = 0;
			//		var ringbuffer_size;
			//		var ringbuffer_mask;
			//		var ringbuffer;
			//		var ringbuffer_end;
			//		/* This ring buffer holds a few past copy distances that will be used by */
			//		/* some special distance codes. */
			//		var dist_rb = [16, 15, 11, 4];
			//		var dist_rb_idx = 0;
			//		/* The previous 2 bytes used for context. */
			//		var prev_byte1 = 0;
			//		var prev_byte2 = 0;
			//		var hgroup = [new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0)];
			//		var block_type_trees;
			//		var block_len_trees;
			//		var br;

			//		/* We need the slack region for the following reasons:
			//			 - always doing two 8-byte copies for fast backward copying
			//			 - transforms
			//			 - flushing the input ringbuffer when decoding uncompressed blocks */
			//		const kRingBufferWriteAheadSlack = 128 + BrotliBitReader.READ_SIZE;

			//		br = new BrotliBitReader(input);

			//		/* Decode window size. */
			//		window_bits = DecodeWindowBits(br);
			//		max_backward_distance = (1 << window_bits) - 16;

			//		ringbuffer_size = 1 << window_bits;
			//		ringbuffer_mask = ringbuffer_size - 1;
			//		ringbuffer = new Uint8Array(ringbuffer_size + kRingBufferWriteAheadSlack + BrotliDictionary.maxDictionaryWordLength);
			//		ringbuffer_end = ringbuffer_size;

			//		block_type_trees = [];
			//		block_len_trees = [];
			//		for (var x = 0; x < 3 * HUFFMAN_MAX_TABLE_SIZE; x++) {
			//			block_type_trees[x] = new HuffmanCode(0, 0);
			//			block_len_trees[x] = new HuffmanCode(0, 0);
			//		}

			//		while (!input_end) {
			//			var meta_block_remaining_len = 0;
			//			var is_uncompressed;
			//			var block_length = [1 << 28, 1 << 28, 1 << 28];
			//			var block_type = [0];
			//			var num_block_types = [1, 1, 1];
			//			var block_type_rb = [0, 1, 0, 1, 0, 1];
			//			var block_type_rb_index = [0];
			//			var distance_postfix_bits;
			//			var num_direct_distance_codes;
			//			var distance_postfix_mask;
			//			var num_distance_codes;
			//			var context_map = null;
			//			var context_modes = null;
			//			var num_literal_htrees;
			//			var dist_context_map = null;
			//			var num_dist_htrees;
			//			var context_offset = 0;
			//			var context_map_slice = null;
			//			var literal_htree_index = 0;
			//			var dist_context_offset = 0;
			//			var dist_context_map_slice = null;
			//			var dist_htree_index = 0;
			//			var context_lookup_offset1 = 0;
			//			var context_lookup_offset2 = 0;
			//			var context_mode;
			//			var htree_command;

			//			for (i = 0; i < 3; ++i) {
			//				hgroup[i].codes = null;
			//				hgroup[i].htrees = null;
			//			}

			//			br.readMoreInput();

			//			var _out = DecodeMetaBlockLength(br);
			//			meta_block_remaining_len = _out.meta_block_length;
			//			input_end = _out.input_end;
			//			is_uncompressed = _out.is_uncompressed;

			//			if (_out.is_metadata) {
			//				JumpToByteBoundary(br);

			//				for (; meta_block_remaining_len > 0; --meta_block_remaining_len) {
			//					br.readMoreInput();
			//					/* Read one byte and ignore it. */
			//					br.readBits(8);
			//				}

			//				continue;
			//			}

			//			if (meta_block_remaining_len === 0) {
			//				continue;
			//			}

			//			if (is_uncompressed) {
			//				br.bit_pos_ = (br.bit_pos_ + 7) & ~7;
			//				CopyUncompressedBlockToOutput(output, meta_block_remaining_len, pos,
			//					ringbuffer, ringbuffer_mask, br);
			//				pos += meta_block_remaining_len;
			//				continue;
			//			}

			//			for (i = 0; i < 3; ++i) {
			//				num_block_types[i] = DecodeVarLenUint8(br) + 1;
			//				if (num_block_types[i] >= 2) {
			//					ReadHuffmanCode(num_block_types[i] + 2, block_type_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
			//					ReadHuffmanCode(kNumBlockLengthCodes, block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
			//					block_length[i] = ReadBlockLength(block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
			//					block_type_rb_index[i] = 1;
			//				}
			//			}

			//			br.readMoreInput();

			//			distance_postfix_bits = br.readBits(2);
			//			num_direct_distance_codes = NUM_DISTANCE_SHORT_CODES + (br.readBits(4) << distance_postfix_bits);
			//			distance_postfix_mask = (1 << distance_postfix_bits) - 1;
			//			num_distance_codes = (num_direct_distance_codes + (48 << distance_postfix_bits));
			//			context_modes = new Uint8Array(num_block_types[0]);

			//			for (i = 0; i < num_block_types[0]; ++i) {
			//				context_modes[i] = (br.readBits(2) << 1);
			//			}

			//			var _o1 = DecodeContextMap(num_block_types[0] << kLiteralContextBits, br);
			//			num_literal_htrees = _o1.num_htrees;
			//			context_map = _o1.context_map;

			//			var _o2 = DecodeContextMap(num_block_types[2] << kDistanceContextBits, br);
			//			num_dist_htrees = _o2.num_htrees;
			//			dist_context_map = _o2.context_map;

			//			hgroup[0] = new HuffmanTreeGroup(kNumLiteralCodes, num_literal_htrees);
			//			hgroup[1] = new HuffmanTreeGroup(kNumInsertAndCopyCodes, num_block_types[1]);
			//			hgroup[2] = new HuffmanTreeGroup(num_distance_codes, num_dist_htrees);

			//			for (i = 0; i < 3; ++i) {
			//				hgroup[i].decode(br);
			//			}

			//			context_map_slice = 0;
			//			dist_context_map_slice = 0;
			//			context_mode = context_modes[block_type[0]];
			//			context_lookup_offset1 = Context.lookupOffsets[context_mode];
			//			context_lookup_offset2 = Context.lookupOffsets[context_mode + 1];
			//			htree_command = hgroup[1].htrees[0];

			//			while (meta_block_remaining_len > 0) {
			//				var cmd_code;
			//				var range_idx;
			//				var insert_code;
			//				var copy_code;
			//				var insert_length;
			//				var copy_length;
			//				var distance_code;
			//				var distance;
			//				var context;
			//				var j;
			//				var copy_dst;

			//				br.readMoreInput();

			//				if (block_length[1] === 0) {
			//					DecodeBlockType(num_block_types[1],
			//						block_type_trees, 1, block_type, block_type_rb,
			//						block_type_rb_index, br);
			//					block_length[1] = ReadBlockLength(block_len_trees, HUFFMAN_MAX_TABLE_SIZE, br);
			//					htree_command = hgroup[1].htrees[block_type[1]];
			//				}
			//				--block_length[1];
			//				cmd_code = ReadSymbol(hgroup[1].codes, htree_command, br);
			//				range_idx = cmd_code >> 6;
			//				if (range_idx >= 2) {
			//					range_idx -= 2;
			//					distance_code = -1;
			//				} else {
			//					distance_code = 0;
			//				}
			//				insert_code = Prefix.kInsertRangeLut[range_idx] + ((cmd_code >> 3) & 7);
			//				copy_code = Prefix.kCopyRangeLut[range_idx] + (cmd_code & 7);
			//				insert_length = Prefix.kInsertLengthPrefixCode[insert_code].offset +
			//					br.readBits(Prefix.kInsertLengthPrefixCode[insert_code].nbits);
			//				copy_length = Prefix.kCopyLengthPrefixCode[copy_code].offset +
			//					br.readBits(Prefix.kCopyLengthPrefixCode[copy_code].nbits);
			//				for (j = 0; j < insert_length; ++j) {
			//					br.readMoreInput();

			//					if (block_length[0] === 0) {
			//						DecodeBlockType(num_block_types[0],
			//							block_type_trees, 0, block_type, block_type_rb,
			//							block_type_rb_index, br);
			//						block_length[0] = ReadBlockLength(block_len_trees, 0, br);
			//						context_offset = block_type[0] << kLiteralContextBits;
			//						context_map_slice = context_offset;
			//						context_mode = context_modes[block_type[0]];
			//						context_lookup_offset1 = Context.lookupOffsets[context_mode];
			//						context_lookup_offset2 = Context.lookupOffsets[context_mode + 1];
			//					}
			//					context = (Context.lookup[context_lookup_offset1 + prev_byte1] |
			//						Context.lookup[context_lookup_offset2 + prev_byte2]);
			//					literal_htree_index = context_map[context_map_slice + context];
			//					--block_length[0];
			//					prev_byte2 = prev_byte1;
			//					prev_byte1 = ReadSymbol(hgroup[0].codes, hgroup[0].htrees[literal_htree_index], br);
			//					ringbuffer[pos & ringbuffer_mask] = prev_byte1;
			//					if ((pos & ringbuffer_mask) === ringbuffer_mask) {
			//						output.write(ringbuffer, ringbuffer_size);
			//					}
			//					++pos;
			//				}
			//				meta_block_remaining_len -= insert_length;
			//				if (meta_block_remaining_len <= 0) break;

			//				if (distance_code < 0) {
			//					var context;

			//					br.readMoreInput();
			//					if (block_length[2] === 0) {
			//						DecodeBlockType(num_block_types[2],
			//							block_type_trees, 2, block_type, block_type_rb,
			//							block_type_rb_index, br);
			//						block_length[2] = ReadBlockLength(block_len_trees, 2 * HUFFMAN_MAX_TABLE_SIZE, br);
			//						dist_context_offset = block_type[2] << kDistanceContextBits;
			//						dist_context_map_slice = dist_context_offset;
			//					}
			//					--block_length[2];
			//					context = (copy_length > 4 ? 3 : copy_length - 2) & 0xff;
			//					dist_htree_index = dist_context_map[dist_context_map_slice + context];
			//					distance_code = ReadSymbol(hgroup[2].codes, hgroup[2].htrees[dist_htree_index], br);
			//					if (distance_code >= num_direct_distance_codes) {
			//						var nbits;
			//						var postfix;
			//						var offset;
			//						distance_code -= num_direct_distance_codes;
			//						postfix = distance_code & distance_postfix_mask;
			//						distance_code >>= distance_postfix_bits;
			//						nbits = (distance_code >> 1) + 1;
			//						offset = ((2 + (distance_code & 1)) << nbits) - 4;
			//						distance_code = num_direct_distance_codes +
			//							((offset + br.readBits(nbits)) <<
			//								distance_postfix_bits) + postfix;
			//					}
			//				}

			//				/* Convert the distance code to the actual distance by possibly looking */
			//				/* up past distnaces from the ringbuffer. */
			//				distance = TranslateShortCodes(distance_code, dist_rb, dist_rb_idx);
			//				if (distance < 0) {
			//					throw new Error('[BrotliDecompress] invalid distance');
			//				}

			//				if (pos < max_backward_distance &&
			//					max_distance !== max_backward_distance) {
			//					max_distance = pos;
			//				} else {
			//					max_distance = max_backward_distance;
			//				}

			//				copy_dst = pos & ringbuffer_mask;

			//				if (distance > max_distance) {
			//					if (copy_length >= BrotliDictionary.minDictionaryWordLength &&
			//						copy_length <= BrotliDictionary.maxDictionaryWordLength) {
			//						var offset = BrotliDictionary.offsetsByLength[copy_length];
			//						var word_id = distance - max_distance - 1;
			//						var shift = BrotliDictionary.sizeBitsByLength[copy_length];
			//						var mask = (1 << shift) - 1;
			//						var word_idx = word_id & mask;
			//						var transform_idx = word_id >> shift;
			//						offset += word_idx * copy_length;
			//						if (transform_idx < Transform.kNumTransforms) {
			//							var len = Transform.transformDictionaryWord(ringbuffer, copy_dst, offset, copy_length, transform_idx);
			//							copy_dst += len;
			//							pos += len;
			//							meta_block_remaining_len -= len;
			//							if (copy_dst >= ringbuffer_end) {
			//								output.write(ringbuffer, ringbuffer_size);

			//								for (var _x = 0; _x < (copy_dst - ringbuffer_end); _x++)
			//									ringbuffer[_x] = ringbuffer[ringbuffer_end + _x];
			//							}
			//						} else {
			//							throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance +
			//								" len: " + copy_length + " bytes left: " + meta_block_remaining_len);
			//						}
			//					} else {
			//						throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance +
			//							" len: " + copy_length + " bytes left: " + meta_block_remaining_len);
			//					}
			//				} else {
			//					if (distance_code > 0) {
			//						dist_rb[dist_rb_idx & 3] = distance;
			//						++dist_rb_idx;
			//					}

			//					if (copy_length > meta_block_remaining_len) {
			//						throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance +
			//							" len: " + copy_length + " bytes left: " + meta_block_remaining_len);
			//					}

			//					for (j = 0; j < copy_length; ++j) {
			//						ringbuffer[pos & ringbuffer_mask] = ringbuffer[(pos - distance) & ringbuffer_mask];
			//						if ((pos & ringbuffer_mask) === ringbuffer_mask) {
			//							output.write(ringbuffer, ringbuffer_size);
			//						}
			//						++pos;
			//						--meta_block_remaining_len;
			//					}
			//				}

			//				/* When we get here, we must have inserted at least one literal and */
			//				/* made a copy of at least length two, therefore accessing the last 2 */
			//				/* bytes is valid. */
			//				prev_byte1 = ringbuffer[(pos - 1) & ringbuffer_mask];
			//				prev_byte2 = ringbuffer[(pos - 2) & ringbuffer_mask];
			//			}

			//			/* Protect pos from overflow, wrap it around at every GB of input data */
			//			pos &= 0x3fffffff;
			//		}

			//		output.write(ringbuffer, pos & ringbuffer_mask);
			//	}

			//	localExports.BrotliDecompress = BrotliDecompress;

			//	BrotliDictionary.init();

			//}, { "./bit_reader": 46, "./context": 47, "./dictionary": 50, "./huffman": 51, "./prefix": 52, "./streams": 53, "./transform": 54 }], 49: [function (require, localModule, localExports) {
			//	var base64 = localRequire('base64-js');


			//	/**
			//	 * The normal dictionary-data.js is quite large, which makes it 
			//	 * unsuitable for browser usage. In order to make it smaller, 
			//	 * we read dictionary.bin, which is a compressed version of
			//	 * the dictionary, and on initial load, Brotli decompresses 
			//	 * it's own dictionary. рџњ
			//	 */
			//	localExports.init = function () {
			//		var BrotliDecompressBuffer = localRequire('./decode').BrotliDecompressBuffer;
			//		var compressed = base64.toByteArray(" ");
			//		return BrotliDecompressBuffer(compressed);
			//	};

			//}, { "./decode": 48, "base64-js": 45 }], 50: [function (localRequire, localModule, localExports) {
			//	/* Copyright 2013 Google Inc. All Rights Reserved.
				
			//	   Licensed under the Apache License, Version 2.0 (the "License");
			//	   you may not use this file except in compliance with the License.
			//	   You may obtain a copy of the License at
				
			//	   http://www.apache.org/licenses/LICENSE-2.0
				
			//	   Unless required by applicable law or agreed to in writing, software
			//	   distributed under the License is distributed on an "AS IS" BASIS,
			//	   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
			//	   See the License for the specific language governing permissions and
			//	   limitations under the License.
				
			//	   Collection of static dictionary words.
			//	*/

			//	var data = localRequire('./dictionary-data');
			//	localExports.init = function () {
			//		localExports.dictionary = data.init();
			//	};

			//	localExports.offsetsByLength = new Uint32Array([
			//		0, 0, 0, 0, 0, 4096, 9216, 21504, 35840, 44032,
			//		53248, 63488, 74752, 87040, 93696, 100864, 104704, 106752, 108928, 113536,
			//		115968, 118528, 119872, 121280, 122016,
			//	]);

			//	localExports.sizeBitsByLength = new Uint8Array([
			//		0, 0, 0, 0, 10, 10, 11, 11, 10, 10,
			//		10, 10, 10, 9, 9, 8, 7, 7, 8, 7,
			//		7, 6, 6, 5, 5,
			//	]);

			//	localExports.minDictionaryWordLength = 4;
			//	localExports.maxDictionaryWordLength = 24;

			//}, { "./dictionary-data": 49 }], 51: [function (localRequire, localModule, localExports) {
			//	function HuffmanCode(bits, value) {
			//		this.bits = bits;   /* number of bits used for this symbol */
			//		this.value = value; /* symbol value or table offset */
			//	}

			//	localExports.HuffmanCode = HuffmanCode;

			//	const MAX_LENGTH = 15;

			//	/* Returns reverse(reverse(key, len) + 1, len), where reverse(key, len) is the
			//	   bit-wise reversal of the len least significant bits of key. */
			//	function GetNextKey(key, len) {
			//		var step = 1 << (len - 1);
			//		while (key & step) {
			//			step >>= 1;
			//		}
			//		return (key & (step - 1)) + step;
			//	}

			//	/* Stores code in table[0], table[step], table[2*step], ..., table[end] */
			//	/* Assumes that end is an integer multiple of step */
			//	function ReplicateValue(table, i, step, end, code) {
			//		do {
			//			end -= step;
			//			table[i + end] = new HuffmanCode(code.bits, code.value);
			//		} while (end > 0);
			//	}

			//	/* Returns the table width of the next 2nd level table. count is the histogram
			//	   of bit lengths for the remaining symbols, len is the code length of the next
			//	   processed symbol */
			//	function NextTableBitSize(count, len, root_bits) {
			//		var left = 1 << (len - root_bits);
			//		while (len < MAX_LENGTH) {
			//			left -= count[len];
			//			if (left <= 0) break;
			//			++len;
			//			left <<= 1;
			//		}
			//		return len - root_bits;
			//	}

			//	localExports.BrotliBuildHuffmanTable = function (root_table, table, root_bits, code_lengths, code_lengths_size) {
			//		var start_table = table;
			//		var code;            /* current table entry */
			//		var len;             /* current code length */
			//		var symbol;          /* symbol index in original or sorted table */
			//		var key;             /* reversed prefix code */
			//		var step;            /* step size to replicate values in current table */
			//		var low;             /* low bits for current root entry */
			//		var mask;            /* mask for low bits */
			//		var table_bits;      /* key length of current table */
			//		var table_size;      /* size of current table */
			//		var total_size;      /* sum of root table size and 2nd level table sizes */
			//		var sorted;          /* symbols sorted by code length */
			//		var count = new Int32Array(MAX_LENGTH + 1);  /* number of codes of each length */
			//		var offset = new Int32Array(MAX_LENGTH + 1);  /* offsets in sorted table for each length */

			//		sorted = new Int32Array(code_lengths_size);

			//		/* build histogram of code lengths */
			//		for (symbol = 0; symbol < code_lengths_size; symbol++) {
			//			count[code_lengths[symbol]]++;
			//		}

			//		/* generate offsets into sorted symbol table by code length */
			//		offset[1] = 0;
			//		for (len = 1; len < MAX_LENGTH; len++) {
			//			offset[len + 1] = offset[len] + count[len];
			//		}

			//		/* sort symbols by length, by symbol order within each length */
			//		for (symbol = 0; symbol < code_lengths_size; symbol++) {
			//			if (code_lengths[symbol] !== 0) {
			//				sorted[offset[code_lengths[symbol]]++] = symbol;
			//			}
			//		}

			//		table_bits = root_bits;
			//		table_size = 1 << table_bits;
			//		total_size = table_size;

			//		/* special case code with only one value */
			//		if (offset[MAX_LENGTH] === 1) {
			//			for (key = 0; key < total_size; ++key) {
			//				root_table[table + key] = new HuffmanCode(0, sorted[0] & 0xffff);
			//			}

			//			return total_size;
			//		}

			//		/* fill in root table */
			//		key = 0;
			//		symbol = 0;
			//		for (len = 1, step = 2; len <= root_bits; ++len, step <<= 1) {
			//			for (; count[len] > 0; --count[len]) {
			//				code = new HuffmanCode(len & 0xff, sorted[symbol++] & 0xffff);
			//				ReplicateValue(root_table, table + key, step, table_size, code);
			//				key = GetNextKey(key, len);
			//			}
			//		}

			//		/* fill in 2nd level tables and add pointers to root table */
			//		mask = total_size - 1;
			//		low = -1;
			//		for (len = root_bits + 1, step = 2; len <= MAX_LENGTH; ++len, step <<= 1) {
			//			for (; count[len] > 0; --count[len]) {
			//				if ((key & mask) !== low) {
			//					table += table_size;
			//					table_bits = NextTableBitSize(count, len, root_bits);
			//					table_size = 1 << table_bits;
			//					total_size += table_size;
			//					low = key & mask;
			//					root_table[start_table + low] = new HuffmanCode((table_bits + root_bits) & 0xff, ((table - start_table) - low) & 0xffff);
			//				}
			//				code = new HuffmanCode((len - root_bits) & 0xff, sorted[symbol++] & 0xffff);
			//				ReplicateValue(root_table, table + (key >> root_bits), step, table_size, code);
			//				key = GetNextKey(key, len);
			//			}
			//		}

			//		return total_size;
			//	}

			//}, {}], 52: [function (localRequire, localModule, localExports) {
			//	/* Copyright 2013 Google Inc. All Rights Reserved.
				
			//	   Licensed under the Apache License, Version 2.0 (the "License");
			//	   you may not use this file except in compliance with the License.
			//	   You may obtain a copy of the License at
				
			//	   http://www.apache.org/licenses/LICENSE-2.0
				
			//	   Unless required by applicable law or agreed to in writing, software
			//	   distributed under the License is distributed on an "AS IS" BASIS,
			//	   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
			//	   See the License for the specific language governing permissions and
			//	   limitations under the License.
				
			//	   Lookup tables to map prefix codes to value ranges. This is used during
			//	   decoding of the block lengths, literal insertion lengths and copy lengths.
			//	*/

			//	/* Represents the range of values belonging to a prefix code: */
			//	/* [offset, offset + 2^nbits) */
			//	function PrefixCodeRange(offset, nbits) {
			//		this.offset = offset;
			//		this.nbits = nbits;
			//	}

			//	localExports.kBlockLengthPrefixCode = [
			//		new PrefixCodeRange(1, 2), new PrefixCodeRange(5, 2), new PrefixCodeRange(9, 2), new PrefixCodeRange(13, 2),
			//		new PrefixCodeRange(17, 3), new PrefixCodeRange(25, 3), new PrefixCodeRange(33, 3), new PrefixCodeRange(41, 3),
			//		new PrefixCodeRange(49, 4), new PrefixCodeRange(65, 4), new PrefixCodeRange(81, 4), new PrefixCodeRange(97, 4),
			//		new PrefixCodeRange(113, 5), new PrefixCodeRange(145, 5), new PrefixCodeRange(177, 5), new PrefixCodeRange(209, 5),
			//		new PrefixCodeRange(241, 6), new PrefixCodeRange(305, 6), new PrefixCodeRange(369, 7), new PrefixCodeRange(497, 8),
			//		new PrefixCodeRange(753, 9), new PrefixCodeRange(1265, 10), new PrefixCodeRange(2289, 11), new PrefixCodeRange(4337, 12),
			//		new PrefixCodeRange(8433, 13), new PrefixCodeRange(16625, 24)
			//	];

			//	localExports.kInsertLengthPrefixCode = [
			//		new PrefixCodeRange(0, 0), new PrefixCodeRange(1, 0), new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0),
			//		new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0), new PrefixCodeRange(6, 1), new PrefixCodeRange(8, 1),
			//		new PrefixCodeRange(10, 2), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 3), new PrefixCodeRange(26, 3),
			//		new PrefixCodeRange(34, 4), new PrefixCodeRange(50, 4), new PrefixCodeRange(66, 5), new PrefixCodeRange(98, 5),
			//		new PrefixCodeRange(130, 6), new PrefixCodeRange(194, 7), new PrefixCodeRange(322, 8), new PrefixCodeRange(578, 9),
			//		new PrefixCodeRange(1090, 10), new PrefixCodeRange(2114, 12), new PrefixCodeRange(6210, 14), new PrefixCodeRange(22594, 24),
			//	];

			//	localExports.kCopyLengthPrefixCode = [
			//		new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0), new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0),
			//		new PrefixCodeRange(6, 0), new PrefixCodeRange(7, 0), new PrefixCodeRange(8, 0), new PrefixCodeRange(9, 0),
			//		new PrefixCodeRange(10, 1), new PrefixCodeRange(12, 1), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 2),
			//		new PrefixCodeRange(22, 3), new PrefixCodeRange(30, 3), new PrefixCodeRange(38, 4), new PrefixCodeRange(54, 4),
			//		new PrefixCodeRange(70, 5), new PrefixCodeRange(102, 5), new PrefixCodeRange(134, 6), new PrefixCodeRange(198, 7),
			//		new PrefixCodeRange(326, 8), new PrefixCodeRange(582, 9), new PrefixCodeRange(1094, 10), new PrefixCodeRange(2118, 24),
			//	];

			//	localExports.kInsertRangeLut = [
			//		0, 0, 8, 8, 0, 16, 8, 16, 16,
			//	];

			//	localExports.kCopyRangeLut = [
			//		0, 8, 0, 8, 16, 0, 16, 8, 16,
			//	];

			//}, {}], 53: [function (localRequire, localModule, localExports) {
			//	function BrotliInput(buffer) {
			//		this.buffer = buffer;
			//		this.pos = 0;
			//	}

			//	BrotliInput.prototype.read = function (buf, i, count) {
			//		if (this.pos + count > this.buffer.length) {
			//			count = this.buffer.length - this.pos;
			//		}

			//		for (var p = 0; p < count; p++)
			//			buf[i + p] = this.buffer[this.pos + p];

			//		this.pos += count;
			//		return count;
			//	}

			//	localExports.BrotliInput = BrotliInput;

			//	function BrotliOutput(buf) {
			//		this.buffer = buf;
			//		this.pos = 0;
			//	}

			//	BrotliOutput.prototype.write = function (buf, count) {
			//		if (this.pos + count > this.buffer.length)
			//			throw new Error('Output buffer is not large enough');

			//		this.buffer.set(buf.subarray(0, count), this.pos);
			//		this.pos += count;
			//		return count;
			//	};

			//	localExports.BrotliOutput = BrotliOutput;

			//}, {}], 54: [function (localRequire, localModule, localExports) {
			//	/* Copyright 2013 Google Inc. All Rights Reserved.
				
			//	   Licensed under the Apache License, Version 2.0 (the "License");
			//	   you may not use this file except in compliance with the License.
			//	   You may obtain a copy of the License at
				
			//	   http://www.apache.org/licenses/LICENSE-2.0
				
			//	   Unless required by applicable law or agreed to in writing, software
			//	   distributed under the License is distributed on an "AS IS" BASIS,
			//	   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
			//	   See the License for the specific language governing permissions and
			//	   limitations under the License.
				
			//	   Transformations on dictionary words.
			//	*/

			//	var BrotliDictionary = localRequire('./dictionary');

			//	const kIdentity = 0;
			//	const kOmitLast1 = 1;
			//	const kOmitLast2 = 2;
			//	const kOmitLast3 = 3;
			//	const kOmitLast4 = 4;
			//	const kOmitLast5 = 5;
			//	const kOmitLast6 = 6;
			//	const kOmitLast7 = 7;
			//	const kOmitLast8 = 8;
			//	const kOmitLast9 = 9;
			//	const kUppercaseFirst = 10;
			//	const kUppercaseAll = 11;
			//	const kOmitFirst1 = 12;
			//	const kOmitFirst2 = 13;
			//	const kOmitFirst3 = 14;
			//	const kOmitFirst4 = 15;
			//	const kOmitFirst5 = 16;
			//	const kOmitFirst6 = 17;
			//	const kOmitFirst7 = 18;
			//	const kOmitFirst8 = 19;
			//	const kOmitFirst9 = 20;

			//	function Transform(prefix, transform, suffix) {
			//		this.prefix = new Uint8Array(prefix.length);
			//		this.transform = transform;
			//		this.suffix = new Uint8Array(suffix.length);

			//		for (var i = 0; i < prefix.length; i++)
			//			this.prefix[i] = prefix.charCodeAt(i);

			//		for (var i = 0; i < suffix.length; i++)
			//			this.suffix[i] = suffix.charCodeAt(i);
			//	}

			//	var kTransforms = [
			//		new Transform("", kIdentity, ""),
			//		new Transform("", kIdentity, " "),
			//		new Transform(" ", kIdentity, " "),
			//		new Transform("", kOmitFirst1, ""),
			//		new Transform("", kUppercaseFirst, " "),
			//		new Transform("", kIdentity, " the "),
			//		new Transform(" ", kIdentity, ""),
			//		new Transform("s ", kIdentity, " "),
			//		new Transform("", kIdentity, " of "),
			//		new Transform("", kUppercaseFirst, ""),
			//		new Transform("", kIdentity, " and "),
			//		new Transform("", kOmitFirst2, ""),
			//		new Transform("", kOmitLast1, ""),
			//		new Transform(", ", kIdentity, " "),
			//		new Transform("", kIdentity, ", "),
			//		new Transform(" ", kUppercaseFirst, " "),
			//		new Transform("", kIdentity, " in "),
			//		new Transform("", kIdentity, " to "),
			//		new Transform("e ", kIdentity, " "),
			//		new Transform("", kIdentity, "\""),
			//		new Transform("", kIdentity, "."),
			//		new Transform("", kIdentity, "\">"),
			//		new Transform("", kIdentity, "\n"),
			//		new Transform("", kOmitLast3, ""),
			//		new Transform("", kIdentity, "]"),
			//		new Transform("", kIdentity, " for "),
			//		new Transform("", kOmitFirst3, ""),
			//		new Transform("", kOmitLast2, ""),
			//		new Transform("", kIdentity, " a "),
			//		new Transform("", kIdentity, " that "),
			//		new Transform(" ", kUppercaseFirst, ""),
			//		new Transform("", kIdentity, ". "),
			//		new Transform(".", kIdentity, ""),
			//		new Transform(" ", kIdentity, ", "),
			//		new Transform("", kOmitFirst4, ""),
			//		new Transform("", kIdentity, " with "),
			//		new Transform("", kIdentity, "'"),
			//		new Transform("", kIdentity, " from "),
			//		new Transform("", kIdentity, " by "),
			//		new Transform("", kOmitFirst5, ""),
			//		new Transform("", kOmitFirst6, ""),
			//		new Transform(" the ", kIdentity, ""),
			//		new Transform("", kOmitLast4, ""),
			//		new Transform("", kIdentity, ". The "),
			//		new Transform("", kUppercaseAll, ""),
			//		new Transform("", kIdentity, " on "),
			//		new Transform("", kIdentity, " as "),
			//		new Transform("", kIdentity, " is "),
			//		new Transform("", kOmitLast7, ""),
			//		new Transform("", kOmitLast1, "ing "),
			//		new Transform("", kIdentity, "\n\t"),
			//		new Transform("", kIdentity, ":"),
			//		new Transform(" ", kIdentity, ". "),
			//		new Transform("", kIdentity, "ed "),
			//		new Transform("", kOmitFirst9, ""),
			//		new Transform("", kOmitFirst7, ""),
			//		new Transform("", kOmitLast6, ""),
			//		new Transform("", kIdentity, "("),
			//		new Transform("", kUppercaseFirst, ", "),
			//		new Transform("", kOmitLast8, ""),
			//		new Transform("", kIdentity, " at "),
			//		new Transform("", kIdentity, "ly "),
			//		new Transform(" the ", kIdentity, " of "),
			//		new Transform("", kOmitLast5, ""),
			//		new Transform("", kOmitLast9, ""),
			//		new Transform(" ", kUppercaseFirst, ", "),
			//		new Transform("", kUppercaseFirst, "\""),
			//		new Transform(".", kIdentity, "("),
			//		new Transform("", kUppercaseAll, " "),
			//		new Transform("", kUppercaseFirst, "\">"),
			//		new Transform("", kIdentity, "=\""),
			//		new Transform(" ", kIdentity, "."),
			//		new Transform(".com/", kIdentity, ""),
			//		new Transform(" the ", kIdentity, " of the "),
			//		new Transform("", kUppercaseFirst, "'"),
			//		new Transform("", kIdentity, ". This "),
			//		new Transform("", kIdentity, ","),
			//		new Transform(".", kIdentity, " "),
			//		new Transform("", kUppercaseFirst, "("),
			//		new Transform("", kUppercaseFirst, "."),
			//		new Transform("", kIdentity, " not "),
			//		new Transform(" ", kIdentity, "=\""),
			//		new Transform("", kIdentity, "er "),
			//		new Transform(" ", kUppercaseAll, " "),
			//		new Transform("", kIdentity, "al "),
			//		new Transform(" ", kUppercaseAll, ""),
			//		new Transform("", kIdentity, "='"),
			//		new Transform("", kUppercaseAll, "\""),
			//		new Transform("", kUppercaseFirst, ". "),
			//		new Transform(" ", kIdentity, "("),
			//		new Transform("", kIdentity, "ful "),
			//		new Transform(" ", kUppercaseFirst, ". "),
			//		new Transform("", kIdentity, "ive "),
			//		new Transform("", kIdentity, "less "),
			//		new Transform("", kUppercaseAll, "'"),
			//		new Transform("", kIdentity, "est "),
			//		new Transform(" ", kUppercaseFirst, "."),
			//		new Transform("", kUppercaseAll, "\">"),
			//		new Transform(" ", kIdentity, "='"),
			//		new Transform("", kUppercaseFirst, ","),
			//		new Transform("", kIdentity, "ize "),
			//		new Transform("", kUppercaseAll, "."),
			//		new Transform("\xc2\xa0", kIdentity, ""),
			//		new Transform(" ", kIdentity, ","),
			//		new Transform("", kUppercaseFirst, "=\""),
			//		new Transform("", kUppercaseAll, "=\""),
			//		new Transform("", kIdentity, "ous "),
			//		new Transform("", kUppercaseAll, ", "),
			//		new Transform("", kUppercaseFirst, "='"),
			//		new Transform(" ", kUppercaseFirst, ","),
			//		new Transform(" ", kUppercaseAll, "=\""),
			//		new Transform(" ", kUppercaseAll, ", "),
			//		new Transform("", kUppercaseAll, ","),
			//		new Transform("", kUppercaseAll, "("),
			//		new Transform("", kUppercaseAll, ". "),
			//		new Transform(" ", kUppercaseAll, "."),
			//		new Transform("", kUppercaseAll, "='"),
			//		new Transform(" ", kUppercaseAll, ". "),
			//		new Transform(" ", kUppercaseFirst, "=\""),
			//		new Transform(" ", kUppercaseAll, "='"),
			//		new Transform(" ", kUppercaseFirst, "='")
			//	];

			//	localExports.kTransforms = kTransforms;
			//	localExports.kNumTransforms = kTransforms.length;

			//	function ToUpperCase(p, i) {
			//		if (p[i] < 0xc0) {
			//			if (p[i] >= 97 && p[i] <= 122) {
			//				p[i] ^= 32;
			//			}
			//			return 1;
			//		}

			//		/* An overly simplified uppercasing model for utf-8. */
			//		if (p[i] < 0xe0) {
			//			p[i + 1] ^= 32;
			//			return 2;
			//		}

			//		/* An arbitrary transform for three byte characters. */
			//		p[i + 2] ^= 5;
			//		return 3;
			//	}

			//	localExports.transformDictionaryWord = function (dst, idx, word, len, transform) {
			//		var prefix = kTransforms[transform].prefix;
			//		var suffix = kTransforms[transform].suffix;
			//		var t = kTransforms[transform].transform;
			//		var skip = t < kOmitFirst1 ? 0 : t - (kOmitFirst1 - 1);
			//		var i = 0;
			//		var start_idx = idx;
			//		var uppercase;

			//		if (skip > len) {
			//			skip = len;
			//		}

			//		var prefix_pos = 0;
			//		while (prefix_pos < prefix.length) {
			//			dst[idx++] = prefix[prefix_pos++];
			//		}

			//		word += skip;
			//		len -= skip;

			//		if (t <= kOmitLast9) {
			//			len -= t;
			//		}

			//		for (i = 0; i < len; i++) {
			//			dst[idx++] = BrotliDictionary.dictionary[word + i];
			//		}

			//		uppercase = idx - len;

			//		if (t === kUppercaseFirst) {
			//			ToUpperCase(dst, uppercase);
			//		} else if (t === kUppercaseAll) {
			//			while (len > 0) {
			//				var step = ToUpperCase(dst, uppercase);
			//				uppercase += step;
			//				len -= step;
			//			}
			//		}

			//		var suffix_pos = 0;
			//		while (suffix_pos < suffix.length) {
			//			dst[idx++] = suffix[suffix_pos++];
			//		}

			//		return idx - start_idx;
			//	}

			//}, { "./dictionary": 50 }], 55: [function (localRequire, localModule, localExports) {
			//	localModule.localExports = localRequire('./dec/decode').BrotliDecompressBuffer;

			//}, { "./dec/decode": 48 }],
			56: [function (localRequire, localModule, localExports) {

			}, {}],	57: [function (localRequire, localModule, localExports) {
				(function (process, Buffer) {
					var msg = localRequire('pako/lib/zlib/messages');
					var zstream = localRequire('pako/lib/zlib/zstream');
					var zlib_deflate = localRequire('pako/lib/zlib/deflate.js');
					var zlib_inflate = localRequire('pako/lib/zlib/inflate.js');
					var constants = localRequire('pako/lib/zlib/constants');

					for (var key in constants) {
						localExports[key] = constants[key];
					}

					// zlib modes
					localExports.NONE = 0;
					localExports.DEFLATE = 1;
					localExports.INFLATE = 2;
					localExports.GZIP = 3;
					localExports.GUNZIP = 4;
					localExports.DEFLATERAW = 5;
					localExports.INFLATERAW = 6;
					localExports.UNZIP = 7;

					/**
					 * Emulate Node's zlib C++ layer for use by the JS layer in index.js
					 */
					function Zlib(mode) {
						if (mode < localExports.DEFLATE || mode > localExports.UNZIP)
							throw new TypeError("Bad argument");

						this.mode = mode;
						this.init_done = false;
						this.write_in_progress = false;
						this.pending_close = false;
						this.windowBits = 0;
						this.level = 0;
						this.memLevel = 0;
						this.strategy = 0;
						this.dictionary = null;
					}

					Zlib.prototype.init = function (windowBits, level, memLevel, strategy, dictionary) {
						this.windowBits = windowBits;
						this.level = level;
						this.memLevel = memLevel;
						this.strategy = strategy;
						// dictionary not supported.

						if (this.mode === localExports.GZIP || this.mode === localExports.GUNZIP)
							this.windowBits += 16;

						if (this.mode === localExports.UNZIP)
							this.windowBits += 32;

						if (this.mode === localExports.DEFLATERAW || this.mode === localExports.INFLATERAW)
							this.windowBits = -this.windowBits;

						this.strm = new zstream();

						switch (this.mode) {
							case localExports.DEFLATE:
							case localExports.GZIP:
							case localExports.DEFLATERAW:
								var status = zlib_deflate.deflateInit2(
									this.strm,
									this.level,
									localExports.Z_DEFLATED,
									this.windowBits,
									this.memLevel,
									this.strategy
								);
								break;
							case localExports.INFLATE:
							case localExports.GUNZIP:
							case localExports.INFLATERAW:
							case localExports.UNZIP:
								var status = zlib_inflate.inflateInit2(
									this.strm,
									this.windowBits
								);
								break;
							default:
								throw new Error("Unknown mode " + this.mode);
						}

						if (status !== localExports.Z_OK) {
							this._error(status);
							return;
						}

						this.write_in_progress = false;
						this.init_done = true;
					};

					Zlib.prototype.params = function () {
						throw new Error("deflateParams Not supported");
					};

					Zlib.prototype._writeCheck = function () {
						if (!this.init_done)
							throw new Error("write before init");

						if (this.mode === localExports.NONE)
							throw new Error("already finalized");

						if (this.write_in_progress)
							throw new Error("write already in progress");

						if (this.pending_close)
							throw new Error("close is pending");
					};

					Zlib.prototype.write = function (flush, input, in_off, in_len, out, out_off, out_len) {
						this._writeCheck();
						this.write_in_progress = true;

						var self = this;
						process.nextTick(function () {
							self.write_in_progress = false;
							var res = self._write(flush, input, in_off, in_len, out, out_off, out_len);
							self.callback(res[0], res[1]);

							if (self.pending_close)
								self.close();
						});

						return this;
					};

					// set method for Node buffers, used by pako
					function bufferSet(data, offset) {
						for (var i = 0; i < data.length; i++) {
							this[offset + i] = data[i];
						}
					}

					Zlib.prototype.writeSync = function (flush, input, in_off, in_len, out, out_off, out_len) {
						this._writeCheck();
						return this._write(flush, input, in_off, in_len, out, out_off, out_len);
					};

					Zlib.prototype._write = function (flush, input, in_off, in_len, out, out_off, out_len) {
						this.write_in_progress = true;

						if (flush !== localExports.Z_NO_FLUSH &&
							flush !== localExports.Z_PARTIAL_FLUSH &&
							flush !== localExports.Z_SYNC_FLUSH &&
							flush !== localExports.Z_FULL_FLUSH &&
							flush !== localExports.Z_FINISH &&
							flush !== localExports.Z_BLOCK) {
							throw new Error("Invalid flush value");
						}

						if (input == null) {
							input = new Buffer(0);
							in_len = 0;
							in_off = 0;
						}

						if (out._set)
							out.set = out._set;
						else
							out.set = bufferSet;

						var strm = this.strm;
						strm.avail_in = in_len;
						strm.input = input;
						strm.next_in = in_off;
						strm.avail_out = out_len;
						strm.output = out;
						strm.next_out = out_off;

						switch (this.mode) {
							case localExports.DEFLATE:
							case localExports.GZIP:
							case localExports.DEFLATERAW:
								var status = zlib_deflate.deflate(strm, flush);
								break;
							case localExports.UNZIP:
							case localExports.INFLATE:
							case localExports.GUNZIP:
							case localExports.INFLATERAW:
								var status = zlib_inflate.inflate(strm, flush);
								break;
							default:
								throw new Error("Unknown mode " + this.mode);
						}

						if (status !== localExports.Z_STREAM_END && status !== localExports.Z_OK) {
							this._error(status);
						}

						this.write_in_progress = false;
						return [strm.avail_in, strm.avail_out];
					};

					Zlib.prototype.close = function () {
						if (this.write_in_progress) {
							this.pending_close = true;
							return;
						}

						this.pending_close = false;

						if (this.mode === localExports.DEFLATE || this.mode === localExports.GZIP || this.mode === localExports.DEFLATERAW) {
							zlib_deflate.deflateEnd(this.strm);
						} else {
							zlib_inflate.inflateEnd(this.strm);
						}

						this.mode = localExports.NONE;
					};

					Zlib.prototype.reset = function () {
						switch (this.mode) {
							case localExports.DEFLATE:
							case localExports.DEFLATERAW:
								var status = zlib_deflate.deflateReset(this.strm);
								break;
							case localExports.INFLATE:
							case localExports.INFLATERAW:
								var status = zlib_inflate.inflateReset(this.strm);
								break;
						}

						if (status !== localExports.Z_OK) {
							this._error(status);
						}
					};

					Zlib.prototype._error = function (status) {
						this.onerror(msg[status] + ': ' + this.strm.msg, status);

						this.write_in_progress = false;
						if (this.pending_close)
							this.close();
					};

					localExports.Zlib = Zlib;

				}).call(this, localRequire('_process'), localRequire("buffer").Buffer)

			}, { "_process": 188, "buffer": 60, "pako/lib/zlib/constants": 177, "pako/lib/zlib/deflate.js": 179, "pako/lib/zlib/inflate.js": 181, "pako/lib/zlib/messages": 183, "pako/lib/zlib/zstream": 185 }], 58: [function (localRequire, localModule, localExports) {
				(function (process, Buffer) {
					// Copyright Joyent, Inc. and other Node contributors.
					//
					// Permission is hereby granted, free of charge, to any person obtaining a
					// copy of this software and associated documentation files (the
					// "Software"), to deal in the Software without restriction, including
					// without limitation the rights to use, copy, modify, merge, publish,
					// distribute, sublicense, and/or sell copies of the Software, and to permit
					// persons to whom the Software is furnished to do so, subject to the
					// following conditions:
					//
					// The above copyright notice and this permission notice shall be included
					// in all copies or substantial portions of the Software.
					//
					// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
					// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
					// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
					// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
					// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
					// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
					// USE OR OTHER DEALINGS IN THE SOFTWARE.

					var Transform = localRequire('_stream_transform');

					var binding = localRequire('./binding');
					var util = localRequire('util');
					var assert = localRequire('assert').ok;

					// zlib doesn't provide these, so kludge them in following the same
					// const naming scheme zlib uses.
					binding.Z_MIN_WINDOWBITS = 8;
					binding.Z_MAX_WINDOWBITS = 15;
					binding.Z_DEFAULT_WINDOWBITS = 15;

					// fewer than 64 bytes per chunk is stupid.
					// technically it could work with as few as 8, but even 64 bytes
					// is absurdly low.  Usually a MB or more is best.
					binding.Z_MIN_CHUNK = 64;
					binding.Z_MAX_CHUNK = Infinity;
					binding.Z_DEFAULT_CHUNK = (16 * 1024);

					binding.Z_MIN_MEMLEVEL = 1;
					binding.Z_MAX_MEMLEVEL = 9;
					binding.Z_DEFAULT_MEMLEVEL = 8;

					binding.Z_MIN_LEVEL = -1;
					binding.Z_MAX_LEVEL = 9;
					binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;

					// expose all the zlib constants
					Object.keys(binding).forEach(function (k) {
						if (k.match(/^Z/)) localExports[k] = binding[k];
					});

					// translation table for return codes.
					localExports.codes = {
						Z_OK: binding.Z_OK,
						Z_STREAM_END: binding.Z_STREAM_END,
						Z_NEED_DICT: binding.Z_NEED_DICT,
						Z_ERRNO: binding.Z_ERRNO,
						Z_STREAM_ERROR: binding.Z_STREAM_ERROR,
						Z_DATA_ERROR: binding.Z_DATA_ERROR,
						Z_MEM_ERROR: binding.Z_MEM_ERROR,
						Z_BUF_ERROR: binding.Z_BUF_ERROR,
						Z_VERSION_ERROR: binding.Z_VERSION_ERROR
					};

					Object.keys(localExports.codes).forEach(function (k) {
						localExports.codes[localExports.codes[k]] = k;
					});

					localExports.Deflate = Deflate;
					localExports.Inflate = Inflate;
					localExports.Gzip = Gzip;
					localExports.Gunzip = Gunzip;
					localExports.DeflateRaw = DeflateRaw;
					localExports.InflateRaw = InflateRaw;
					localExports.Unzip = Unzip;

					localExports.createDeflate = function (o) {
						return new Deflate(o);
					};

					localExports.createInflate = function (o) {
						return new Inflate(o);
					};

					localExports.createDeflateRaw = function (o) {
						return new DeflateRaw(o);
					};

					localExports.createInflateRaw = function (o) {
						return new InflateRaw(o);
					};

					localExports.createGzip = function (o) {
						return new Gzip(o);
					};

					localExports.createGunzip = function (o) {
						return new Gunzip(o);
					};

					localExports.createUnzip = function (o) {
						return new Unzip(o);
					};


					// Convenience methods.
					// compress/decompress a string or buffer in one step.
					localExports.deflate = function (buffer, opts, callback) {
						if (typeof opts === 'function') {
							callback = opts;
							opts = {};
						}
						return zlibBuffer(new Deflate(opts), buffer, callback);
					};

					localExports.deflateSync = function (buffer, opts) {
						return zlibBufferSync(new Deflate(opts), buffer);
					};

					localExports.gzip = function (buffer, opts, callback) {
						if (typeof opts === 'function') {
							callback = opts;
							opts = {};
						}
						return zlibBuffer(new Gzip(opts), buffer, callback);
					};

					localExports.gzipSync = function (buffer, opts) {
						return zlibBufferSync(new Gzip(opts), buffer);
					};

					localExports.deflateRaw = function (buffer, opts, callback) {
						if (typeof opts === 'function') {
							callback = opts;
							opts = {};
						}
						return zlibBuffer(new DeflateRaw(opts), buffer, callback);
					};

					localExports.deflateRawSync = function (buffer, opts) {
						return zlibBufferSync(new DeflateRaw(opts), buffer);
					};

					localExports.unzip = function (buffer, opts, callback) {
						if (typeof opts === 'function') {
							callback = opts;
							opts = {};
						}
						return zlibBuffer(new Unzip(opts), buffer, callback);
					};

					localExports.unzipSync = function (buffer, opts) {
						return zlibBufferSync(new Unzip(opts), buffer);
					};

					localExports.inflate = function (buffer, opts, callback) {
						if (typeof opts === 'function') {
							callback = opts;
							opts = {};
						}
						return zlibBuffer(new Inflate(opts), buffer, callback);
					};

					localExports.inflateSync = function (buffer, opts) {
						return zlibBufferSync(new Inflate(opts), buffer);
					};

					localExports.gunzip = function (buffer, opts, callback) {
						if (typeof opts === 'function') {
							callback = opts;
							opts = {};
						}
						return zlibBuffer(new Gunzip(opts), buffer, callback);
					};

					localExports.gunzipSync = function (buffer, opts) {
						return zlibBufferSync(new Gunzip(opts), buffer);
					};

					localExports.inflateRaw = function (buffer, opts, callback) {
						if (typeof opts === 'function') {
							callback = opts;
							opts = {};
						}
						return zlibBuffer(new InflateRaw(opts), buffer, callback);
					};

					localExports.inflateRawSync = function (buffer, opts) {
						return zlibBufferSync(new InflateRaw(opts), buffer);
					};

					function zlibBuffer(engine, buffer, callback) {
						var buffers = [];
						var nread = 0;

						engine.on('error', onError);
						engine.on('end', onEnd);

						engine.end(buffer);
						flow();

						function flow() {
							var chunk;
							while (null !== (chunk = engine.read())) {
								buffers.push(chunk);
								nread += chunk.length;
							}
							engine.once('readable', flow);
						}

						function onError(err) {
							engine.removeListener('end', onEnd);
							engine.removeListener('readable', flow);
							callback(err);
						}

						function onEnd() {
							var buf = Buffer.concat(buffers, nread);
							buffers = [];
							callback(null, buf);
							engine.close();
						}
					}

					function zlibBufferSync(engine, buffer) {
						if (typeof buffer === 'string')
							buffer = new Buffer(buffer);
						if (!Buffer.isBuffer(buffer))
							throw new TypeError('Not a string or buffer');

						var flushFlag = binding.Z_FINISH;

						return engine._processChunk(buffer, flushFlag);
					}

					// generic zlib
					// minimal 2-byte header
					function Deflate(opts): void {
						if (!(this instanceof Deflate)) return new Deflate(opts);
						Zlib.call(this, opts, binding.DEFLATE);
					}

					function Inflate(opts): void {
						if (!(this instanceof Inflate)) return new Inflate(opts);
						Zlib.call(this, opts, binding.INFLATE);
					}



					// gzip - bigger header, same deflate compression
					function Gzip(opts): void {
						if (!(this instanceof Gzip)) return new Gzip(opts);
						Zlib.call(this, opts, binding.GZIP);
					}

					function Gunzip(opts): void {
						if (!(this instanceof Gunzip)) return new Gunzip(opts);
						Zlib.call(this, opts, binding.GUNZIP);
					}



					// raw - no header
					function DeflateRaw(opts): void {
						if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts);
						Zlib.call(this, opts, binding.DEFLATERAW);
					}

					function InflateRaw(opts): void {
						if (!(this instanceof InflateRaw)) return new InflateRaw(opts);
						Zlib.call(this, opts, binding.INFLATERAW);
					}


					// auto-detect header.
					function Unzip(opts): void {
						if (!(this instanceof Unzip)) return new Unzip(opts);
						Zlib.call(this, opts, binding.UNZIP);
					}


					// the Zlib class they all inherit from
					// This thing manages the queue of requests, and returns
					// true or false if there is anything in the queue when
					// you call the .write() method.

					function Zlib(opts, mode) {
						this._opts = opts = opts || {};
						this._chunkSize = opts.chunkSize || localExports.Z_DEFAULT_CHUNK;

						Transform.call(this, opts);

						if (opts.flush) {
							if (opts.flush !== binding.Z_NO_FLUSH &&
								opts.flush !== binding.Z_PARTIAL_FLUSH &&
								opts.flush !== binding.Z_SYNC_FLUSH &&
								opts.flush !== binding.Z_FULL_FLUSH &&
								opts.flush !== binding.Z_FINISH &&
								opts.flush !== binding.Z_BLOCK) {
								throw new Error('Invalid flush flag: ' + opts.flush);
							}
						}
						this._flushFlag = opts.flush || binding.Z_NO_FLUSH;

						if (opts.chunkSize) {
							if (opts.chunkSize < localExports.Z_MIN_CHUNK ||
								opts.chunkSize > localExports.Z_MAX_CHUNK) {
								throw new Error('Invalid chunk size: ' + opts.chunkSize);
							}
						}

						if (opts.windowBits) {
							if (opts.windowBits < localExports.Z_MIN_WINDOWBITS ||
								opts.windowBits > localExports.Z_MAX_WINDOWBITS) {
								throw new Error('Invalid windowBits: ' + opts.windowBits);
							}
						}

						if (opts.level) {
							if (opts.level < localExports.Z_MIN_LEVEL ||
								opts.level > localExports.Z_MAX_LEVEL) {
								throw new Error('Invalid compression level: ' + opts.level);
							}
						}

						if (opts.memLevel) {
							if (opts.memLevel < localExports.Z_MIN_MEMLEVEL ||
								opts.memLevel > localExports.Z_MAX_MEMLEVEL) {
								throw new Error('Invalid memLevel: ' + opts.memLevel);
							}
						}

						if (opts.strategy) {
							if (opts.strategy != localExports.Z_FILTERED &&
								opts.strategy != localExports.Z_HUFFMAN_ONLY &&
								opts.strategy != localExports.Z_RLE &&
								opts.strategy != localExports.Z_FIXED &&
								opts.strategy != localExports.Z_DEFAULT_STRATEGY) {
								throw new Error('Invalid strategy: ' + opts.strategy);
							}
						}

						if (opts.dictionary) {
							if (!Buffer.isBuffer(opts.dictionary)) {
								throw new Error('Invalid dictionary: it should be a Buffer instance');
							}
						}

						this._binding = new binding.Zlib(mode);

						var self = this;
						this._hadError = false;
						this._binding.onerror = function (message, errno) {
							// there is no way to cleanly recover.
							// continuing only obscures problems.
							self._binding = null;
							self._hadError = true;

							var error: any = new Error(message);
							error.errno = errno;
							error.code = localExports.codes[errno];
							self.emit('error', error);
						};

						var level = localExports.Z_DEFAULT_COMPRESSION;
						if (typeof opts.level === 'number') level = opts.level;

						var strategy = localExports.Z_DEFAULT_STRATEGY;
						if (typeof opts.strategy === 'number') strategy = opts.strategy;

						this._binding.init(opts.windowBits || localExports.Z_DEFAULT_WINDOWBITS,
							level,
							opts.memLevel || localExports.Z_DEFAULT_MEMLEVEL,
							strategy,
							opts.dictionary);

						this._buffer = new Buffer(this._chunkSize);
						this._offset = 0;
						this._closed = false;
						this._level = level;
						this._strategy = strategy;

						this.once('end', this.close);
					}

					util.inherits(Zlib, Transform);

					Zlib.prototype.params = function (level, strategy, callback) {
						if (level < localExports.Z_MIN_LEVEL ||
							level > localExports.Z_MAX_LEVEL) {
							throw new RangeError('Invalid compression level: ' + level);
						}
						if (strategy != localExports.Z_FILTERED &&
							strategy != localExports.Z_HUFFMAN_ONLY &&
							strategy != localExports.Z_RLE &&
							strategy != localExports.Z_FIXED &&
							strategy != localExports.Z_DEFAULT_STRATEGY) {
							throw new TypeError('Invalid strategy: ' + strategy);
						}

						if (this._level !== level || this._strategy !== strategy) {
							var self = this;
							this.flush(binding.Z_SYNC_FLUSH, function () {
								self._binding.params(level, strategy);
								if (!self._hadError) {
									self._level = level;
									self._strategy = strategy;
									if (callback) callback();
								}
							});
						} else {
							process.nextTick(callback);
						}
					};

					Zlib.prototype.reset = function () {
						return this._binding.reset();
					};

					// This is the _flush function called by the transform class,
					// internally, when the last chunk has been written.
					Zlib.prototype._flush = function (callback) {
						this._transform(new Buffer(0), '', callback);
					};

					Zlib.prototype.flush = function (kind, callback) {
						var ws = this._writableState;

						if (typeof kind === 'function' || (kind === void 0 && !callback)) {
							callback = kind;
							kind = binding.Z_FULL_FLUSH;
						}

						if (ws.ended) {
							if (callback)
								process.nextTick(callback);
						} else if (ws.ending) {
							if (callback)
								this.once('end', callback);
						} else if (ws.needDrain) {
							var self = this;
							this.once('drain', function () {
								self.flush(callback);
							});
						} else {
							this._flushFlag = kind;
							this.write(new Buffer(0), '', callback);
						}
					};

					Zlib.prototype.close = function (callback) {
						if (callback)
							process.nextTick(callback);

						if (this._closed)
							return;

						this._closed = true;

						this._binding.close();

						var self = this;
						process.nextTick(function () {
							self.emit('close');
						});
					};

					Zlib.prototype._transform = function (chunk, encoding, cb) {
						var flushFlag;
						var ws = this._writableState;
						var ending = ws.ending || ws.ended;
						var last = ending && (!chunk || ws.length === chunk.length);

						if (!chunk === null && !Buffer.isBuffer(chunk))
							return cb(new Error('invalid input'));

						// If it's the last chunk, or a final flush, we use the Z_FINISH flush flag.
						// If it's explicitly flushing at some other time, then we use
						// Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression
						// goodness.
						if (last)
							flushFlag = binding.Z_FINISH;
						else {
							flushFlag = this._flushFlag;
							// once we've flushed the last of the queue, stop flushing and
							// go back to the normal behavior.
							if (chunk.length >= ws.length) {
								this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;
							}
						}

						var self = this;
						this._processChunk(chunk, flushFlag, cb);
					};

					Zlib.prototype._processChunk = function (chunk, flushFlag, cb) {
						var availInBefore = chunk && chunk.length;
						var availOutBefore = this._chunkSize - this._offset;
						var inOff = 0;

						var self = this;

						var async = typeof cb === 'function';

						if (!async) {
							var buffers = [];
							var nread = 0;

							var error;
							this.on('error', function (er) {
								error = er;
							});

							do {
								var res = this._binding.writeSync(flushFlag,
									chunk, // in
									inOff, // in_off
									availInBefore, // in_len
									this._buffer, // out
									this._offset, //out_off
									availOutBefore); // out_len
							} while (!this._hadError && callback(res[0], res[1]));

							if (this._hadError) {
								throw error;
							}

							var buf = Buffer.concat(buffers, nread);
							this.close();

							return buf;
						}

						var req = this._binding.write(flushFlag,
							chunk, // in
							inOff, // in_off
							availInBefore, // in_len
							this._buffer, // out
							this._offset, //out_off
							availOutBefore); // out_len

						req.buffer = chunk;
						req.callback = callback;

						function callback(availInAfter, availOutAfter) {
							if (self._hadError)
								return;

							var have = availOutBefore - availOutAfter;
							assert(have >= 0, 'have should not go down');

							if (have > 0) {
								var out = self._buffer.slice(self._offset, self._offset + have);
								self._offset += have;
								// serve some output to the consumer.
								if (async) {
									self.push(out);
								} else {
									buffers.push(out);
									nread += out.length;
								}
							}

							// exhausted the output buffer, or used all the input create a new one.
							if (availOutAfter === 0 || self._offset >= self._chunkSize) {
								availOutBefore = self._chunkSize;
								self._offset = 0;
								self._buffer = new Buffer(self._chunkSize);
							}

							if (availOutAfter === 0) {
								// Not actually done.  Need to reprocess.
								// Also, update the availInBefore to the availInAfter value,
								// so that if we have to hit it a third (fourth, etc.) time,
								// it'll have the correct byte counts.
								inOff += (availInBefore - availInAfter);
								availInBefore = availInAfter;

								if (!async)
									return true;

								var newReq = self._binding.write(flushFlag,
									chunk,
									inOff,
									availInBefore,
									self._buffer,
									self._offset,
									self._chunkSize);
								newReq.callback = callback; // this same function
								newReq.buffer = chunk;
								return;
							}

							if (!async)
								return false;

							// finished with the chunk.
							cb();
						}
					};

					util.inherits(Deflate, Zlib);
					util.inherits(Inflate, Zlib);
					util.inherits(Gzip, Zlib);
					util.inherits(Gunzip, Zlib);
					util.inherits(DeflateRaw, Zlib);
					util.inherits(InflateRaw, Zlib);
					util.inherits(Unzip, Zlib);

				}).call(this, localRequire('_process'), localRequire("buffer").Buffer)

			}, { "./binding": 57, "_process": 188, "_stream_transform": 197, "assert": 22, "buffer": 60, "util": 224 }], 59: [function (localRequire, localModule, localExports) {
				arguments[4][56][0].apply(localExports, arguments)
			}, { "dup": 56 }], 60: [function (localRequire, localModule, localExports) {
				(function (global) {
					/*!
					 * The buffer module from node.js, for the browser.
					 *
					 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
					 * @license  MIT
					 */
					/* eslint-disable no-proto */

					'use strict'

					var base64 = localRequire('base64-js');
					var ieee754 = localRequire('ieee754');
					var isArray = localRequire('isarray');

					localExports.Buffer = Buffer;
					localExports.SlowBuffer = SlowBuffer;
					localExports.INSPECT_MAX_BYTES = 50;

					/**
					 * If `Buffer.TYPED_ARRAY_SUPPORT`:
					 *   === true    Use Uint8Array implementation (fastest)
					 *   === false   Use Object implementation (most compatible, even IE6)
					 *
					 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
					 * Opera 11.6+, iOS 4.2+.
					 *
					 * Due to various browser bugs, sometimes the Object implementation will be used even
					 * when the browser supports typed arrays.
					 *
					 * Note:
					 *
					 *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
					 *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
					 *
					 *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
					 *
					 *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
					 *     incorrect length in some situations.
					
					 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
					 * get the Object implementation, which is slower but behaves correctly.
					 */
					(<any>Buffer).TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
						? global.TYPED_ARRAY_SUPPORT
						: typedArraySupport();

					/*
					 * Export kMaxLength after typed array support is determined.
					 */
					localExports.kMaxLength = kMaxLength()

					function typedArraySupport() {
						try {
							var arr: any = new Uint8Array(1)
							arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
							return arr.foo() === 42 && // typed array instances can be augmented
								typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
								arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
						} catch (e) {
							return false
						}
					}

					function kMaxLength() {
						return (<any>Buffer).TYPED_ARRAY_SUPPORT
							? 0x7fffffff
							: 0x3fffffff;
					}

					function createBuffer(that, length) {
						if (kMaxLength() < length) {
							throw new RangeError('Invalid typed array length')
						}
						if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
							// Return an augmented `Uint8Array` instance, for best performance
							that = new Uint8Array(length)
							that.__proto__ = Buffer.prototype
						} else {
							// Fallback: Return an object instance of the Buffer class
							if (that === null) {
								that = new Buffer(length)
							}
							that.length = length
						}

						return that
					}

					/**
					 * The Buffer constructor returns instances of `Uint8Array` that have their
					 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
					 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
					 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
					 * returns a single octet.
					 *
					 * The `Uint8Array` prototype remains unmodified.
					 */

					function Buffer(arg, encodingOrOffset?, length?): void {
						if (!(<any>Buffer).TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
							return new Buffer(arg, encodingOrOffset, length)
						}

						// Common case.
						if (typeof arg === 'number') {
							if (typeof encodingOrOffset === 'string') {
								throw new Error(
									'If encoding is specified then the first argument must be a string'
								)
							}
							return allocUnsafe(this, arg)
						}
						return from(this, arg, encodingOrOffset, length)
					}

					(<any>Buffer).poolSize = 8192; // not used by this implementation

					// TODO: Legacy, not needed anymore. Remove in next major version.
					(<any>Buffer)._augment = function (arr) {
						arr.__proto__ = Buffer.prototype
						return arr
					};

					function from(that, value, encodingOrOffset, length) {
						if (typeof value === 'number') {
							throw new TypeError('"value" argument must not be a number')
						}

						if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
							return fromArrayBuffer(that, value, encodingOrOffset, length)
						}

						if (typeof value === 'string') {
							return fromString(that, value, encodingOrOffset)
						}

						return fromObject(that, value)
					}

					/**
					 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
					 * if value is a number.
					 * Buffer.from(str[, encoding])
					 * Buffer.from(array)
					 * Buffer.from(buffer)
					 * Buffer.from(arrayBuffer[, byteOffset[, length]])
					 **/
					(<any>Buffer).from = function (value, encodingOrOffset, length) {
						return from(null, value, encodingOrOffset, length)
					};

					if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
						Buffer.prototype.__proto__ = Uint8Array.prototype
						Buffer.__proto__ = Uint8Array
						if (typeof Symbol !== 'undefined' && Symbol.species &&
							Buffer[Symbol.species] === Buffer) {
							// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
							Object.defineProperty(Buffer, Symbol.species, {
								value: null,
								configurable: true
							})
						}
					}

					function assertSize(size) {
						if (typeof size !== 'number') {
							throw new TypeError('"size" argument must be a number')
						} else if (size < 0) {
							throw new RangeError('"size" argument must not be negative')
						}
					}

					function alloc(that, size, fill, encoding) {
						assertSize(size)
						if (size <= 0) {
							return createBuffer(that, size)
						}
						if (fill !== undefined) {
							// Only pay attention to encoding if it's a string. This
							// prevents accidentally sending in a number that would
							// be interpretted as a start offset.
							return typeof encoding === 'string'
								? createBuffer(that, size).fill(fill, encoding)
								: createBuffer(that, size).fill(fill)
						}
						return createBuffer(that, size)
					}

					/**
					 * Creates a new filled Buffer instance.
					 * alloc(size[, fill[, encoding]])
					 **/
					(<any>Buffer).alloc = function (size, fill, encoding) {
						return alloc(null, size, fill, encoding)
					};

					function allocUnsafe(that, size) {
						assertSize(size)
						that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
						if (!(<any>Buffer).TYPED_ARRAY_SUPPORT) {
							for (var i = 0; i < size; ++i) {
								that[i] = 0
							}
						}
						return that
					}

					/**
					 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
					 * */
					(<any>Buffer).allocUnsafe = function (size) {
						return allocUnsafe(null, size)
					};
					/**
					 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
					 */
					(<any>Buffer).allocUnsafeSlow = function (size) {
						return allocUnsafe(null, size)
					};

					function fromString(that, string, encoding) {
						if (typeof encoding !== 'string' || encoding === '') {
							encoding = 'utf8'
						}

						if (!(<any>Buffer).isEncoding(encoding)) {
							throw new TypeError('"encoding" must be a valid string encoding')
						}

						var length = byteLength(string, encoding) | 0
						that = createBuffer(that, length)

						var actual = that.write(string, encoding)

						if (actual !== length) {
							// Writing a hex string, for example, that contains invalid characters will
							// cause everything after the first invalid character to be ignored. (e.g.
							// 'abxxcd' will be treated as 'ab')
							that = that.slice(0, actual)
						}

						return that
					}

					function fromArrayLike(that, array) {
						var length = array.length < 0 ? 0 : checked(array.length) | 0
						that = createBuffer(that, length)
						for (var i = 0; i < length; i += 1) {
							that[i] = array[i] & 255
						}
						return that
					}

					function fromArrayBuffer(that, array, byteOffset, length) {
						array.byteLength // this throws if `array` is not a valid ArrayBuffer

						if (byteOffset < 0 || array.byteLength < byteOffset) {
							throw new RangeError('\'offset\' is out of bounds')
						}

						if (array.byteLength < byteOffset + (length || 0)) {
							throw new RangeError('\'length\' is out of bounds')
						}

						if (byteOffset === undefined && length === undefined) {
							array = new Uint8Array(array)
						} else if (length === undefined) {
							array = new Uint8Array(array, byteOffset)
						} else {
							array = new Uint8Array(array, byteOffset, length)
						}

						if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
							// Return an augmented `Uint8Array` instance, for best performance
							that = array
							that.__proto__ = Buffer.prototype
						} else {
							// Fallback: Return an object instance of the Buffer class
							that = fromArrayLike(that, array)
						}
						return that
					}

					function fromObject(that, obj) {
						if ((<any>Buffer).isBuffer(obj)) {
							var len = checked(obj.length) | 0
							that = createBuffer(that, len)

							if (that.length === 0) {
								return that
							}

							obj.copy(that, 0, 0, len)
							return that
						}

						if (obj) {
							if ((typeof ArrayBuffer !== 'undefined' &&
								obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
								if (typeof obj.length !== 'number' || isnan(obj.length)) {
									return createBuffer(that, 0)
								}
								return fromArrayLike(that, obj)
							}

							if (obj.type === 'Buffer' && isArray(obj.data)) {
								return fromArrayLike(that, obj.data)
							}
						}

						throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
					}

					function checked(length) {
						// Note: cannot use `length < kMaxLength()` here because that fails when
						// length is NaN (which is otherwise coerced to zero.)
						if (length >= kMaxLength()) {
							throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
								'size: 0x' + kMaxLength().toString(16) + ' bytes')
						}
						return length | 0
					}

					function SlowBuffer(length) {
						if (+length != length) { // eslint-disable-line eqeqeq
							length = 0
						}
						return (<any>Buffer).alloc(+length)
					}

					(<any>Buffer).isBuffer = function isBuffer(b) {
						return !!(b != null && b._isBuffer)
					};

					(<any>Buffer).compare = function compare(a, b) {
						if (!(<any>Buffer).isBuffer(a) || !(<any>Buffer).isBuffer(b)) {
							throw new TypeError('Arguments must be Buffers')
						}

						if (a === b) return 0

						var x = a.length
						var y = b.length

						for (var i = 0, len = Math.min(x, y); i < len; ++i) {
							if (a[i] !== b[i]) {
								x = a[i]
								y = b[i]
								break
							}
						}

						if (x < y) return -1
						if (y < x) return 1
						return 0
					};

					(<any>Buffer).isEncoding = function isEncoding(encoding) {
						switch (String(encoding).toLowerCase()) {
							case 'hex':
							case 'utf8':
							case 'utf-8':
							case 'ascii':
							case 'latin1':
							case 'binary':
							case 'base64':
							case 'ucs2':
							case 'ucs-2':
							case 'utf16le':
							case 'utf-16le':
								return true
							default:
								return false
						}
					};

					(<any>Buffer).concat = function concat(list, length) {
						if (!isArray(list)) {
							throw new TypeError('"list" argument must be an Array of Buffers')
						}

						if (list.length === 0) {
							return (<any>Buffer).alloc(0);
						}

						var i
						if (length === undefined) {
							length = 0
							for (i = 0; i < list.length; ++i) {
								length += list[i].length
							}
						}

						var buffer = (<any>Buffer).allocUnsafe(length);
						var pos = 0
						for (i = 0; i < list.length; ++i) {
							var buf = list[i]
							if (!(<any>Buffer).isBuffer(buf)) {
								throw new TypeError('"list" argument must be an Array of Buffers')
							}
							buf.copy(buffer, pos)
							pos += buf.length
						}
						return buffer
					};

					function byteLength(string, encoding) {
						if ((<any>Buffer).isBuffer(string)) {
							return string.length
						}
						if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
							(ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
							return string.byteLength
						}
						if (typeof string !== 'string') {
							string = '' + string
						}

						var len = string.length
						if (len === 0) return 0

						// Use a for loop to avoid recursion
						var loweredCase = false
						for (; ;) {
							switch (encoding) {
								case 'ascii':
								case 'latin1':
								case 'binary':
									return len
								case 'utf8':
								case 'utf-8':
								case undefined:
									return utf8ToBytes(string).length
								case 'ucs2':
								case 'ucs-2':
								case 'utf16le':
								case 'utf-16le':
									return len * 2
								case 'hex':
									return len >>> 1
								case 'base64':
									return base64ToBytes(string).length
								default:
									if (loweredCase) return utf8ToBytes(string).length // assume utf8
									encoding = ('' + encoding).toLowerCase()
									loweredCase = true
							}
						}
					}
					(<any>Buffer).byteLength = byteLength;

					function slowToString(encoding, start, end) {
						var loweredCase = false

						// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
						// property of a typed array.

						// This behaves neither like String nor Uint8Array in that we set start/end
						// to their upper/lower bounds if the value passed is out of range.
						// undefined is handled specially as per ECMA-262 6th Edition,
						// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
						if (start === undefined || start < 0) {
							start = 0
						}
						// Return early if start > this.length. Done here to prevent potential uint32
						// coercion fail below.
						if (start > this.length) {
							return ''
						}

						if (end === undefined || end > this.length) {
							end = this.length
						}

						if (end <= 0) {
							return ''
						}

						// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
						end >>>= 0
						start >>>= 0

						if (end <= start) {
							return ''
						}

						if (!encoding) encoding = 'utf8'

						while (true) {
							switch (encoding) {
								case 'hex':
									return hexSlice(this, start, end)

								case 'utf8':
								case 'utf-8':
									return utf8Slice(this, start, end)

								case 'ascii':
									return asciiSlice(this, start, end)

								case 'latin1':
								case 'binary':
									return latin1Slice(this, start, end)

								case 'base64':
									return base64Slice(this, start, end)

								case 'ucs2':
								case 'ucs-2':
								case 'utf16le':
								case 'utf-16le':
									return utf16leSlice(this, start, end)

								default:
									if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
									encoding = (encoding + '').toLowerCase()
									loweredCase = true
							}
						}
					}

					// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
					// Buffer instances.
					Buffer.prototype._isBuffer = true

					function swap(b, n, m) {
						var i = b[n]
						b[n] = b[m]
						b[m] = i
					}

					Buffer.prototype.swap16 = function swap16() {
						var len = this.length
						if (len % 2 !== 0) {
							throw new RangeError('Buffer size must be a multiple of 16-bits')
						}
						for (var i = 0; i < len; i += 2) {
							swap(this, i, i + 1)
						}
						return this
					}

					Buffer.prototype.swap32 = function swap32() {
						var len = this.length
						if (len % 4 !== 0) {
							throw new RangeError('Buffer size must be a multiple of 32-bits')
						}
						for (var i = 0; i < len; i += 4) {
							swap(this, i, i + 3)
							swap(this, i + 1, i + 2)
						}
						return this
					}

					Buffer.prototype.swap64 = function swap64() {
						var len = this.length
						if (len % 8 !== 0) {
							throw new RangeError('Buffer size must be a multiple of 64-bits')
						}
						for (var i = 0; i < len; i += 8) {
							swap(this, i, i + 7)
							swap(this, i + 1, i + 6)
							swap(this, i + 2, i + 5)
							swap(this, i + 3, i + 4)
						}
						return this
					}

					Buffer.prototype.toString = function toString() {
						var length = this.length | 0
						if (length === 0) return ''
						if (arguments.length === 0) return utf8Slice(this, 0, length)
						return slowToString.apply(this, arguments)
					}

					Buffer.prototype.equals = function equals(b) {
						if (!(<any>Buffer).isBuffer(b)) throw new TypeError('Argument must be a Buffer')
						if (this === b) return true
						return (<any>Buffer).compare(this, b) === 0;
					}

					Buffer.prototype.inspect = function inspect() {
						var str = ''
						var max = localExports.INSPECT_MAX_BYTES
						if (this.length > 0) {
							str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
							if (this.length > max) str += ' ... '
						}
						return '<Buffer ' + str + '>'
					}

					Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
						if (!(<any>Buffer).isBuffer(target)) {
							throw new TypeError('Argument must be a Buffer')
						}

						if (start === undefined) {
							start = 0
						}
						if (end === undefined) {
							end = target ? target.length : 0
						}
						if (thisStart === undefined) {
							thisStart = 0
						}
						if (thisEnd === undefined) {
							thisEnd = this.length
						}

						if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
							throw new RangeError('out of range index')
						}

						if (thisStart >= thisEnd && start >= end) {
							return 0
						}
						if (thisStart >= thisEnd) {
							return -1
						}
						if (start >= end) {
							return 1
						}

						start >>>= 0
						end >>>= 0
						thisStart >>>= 0
						thisEnd >>>= 0

						if (this === target) return 0

						var x = thisEnd - thisStart
						var y = end - start
						var len = Math.min(x, y)

						var thisCopy = this.slice(thisStart, thisEnd)
						var targetCopy = target.slice(start, end)

						for (var i = 0; i < len; ++i) {
							if (thisCopy[i] !== targetCopy[i]) {
								x = thisCopy[i]
								y = targetCopy[i]
								break
							}
						}

						if (x < y) return -1
						if (y < x) return 1
						return 0
					}

					// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
					// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
					//
					// Arguments:
					// - buffer - a Buffer to search
					// - val - a string, Buffer, or number
					// - byteOffset - an index into `buffer`; will be clamped to an int32
					// - encoding - an optional encoding, relevant is val is a string
					// - dir - true for indexOf, false for lastIndexOf
					function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
						// Empty buffer means no match
						if (buffer.length === 0) return -1

						// Normalize byteOffset
						if (typeof byteOffset === 'string') {
							encoding = byteOffset
							byteOffset = 0
						} else if (byteOffset > 0x7fffffff) {
							byteOffset = 0x7fffffff
						} else if (byteOffset < -0x80000000) {
							byteOffset = -0x80000000
						}
						byteOffset = +byteOffset  // Coerce to Number.
						if (isNaN(byteOffset)) {
							// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
							byteOffset = dir ? 0 : (buffer.length - 1)
						}

						// Normalize byteOffset: negative offsets start from the end of the buffer
						if (byteOffset < 0) byteOffset = buffer.length + byteOffset
						if (byteOffset >= buffer.length) {
							if (dir) return -1
							else byteOffset = buffer.length - 1
						} else if (byteOffset < 0) {
							if (dir) byteOffset = 0
							else return -1
						}

						// Normalize val
						if (typeof val === 'string') {
							val = (<any>Buffer).from(val, encoding);
						}

						// Finally, search either indexOf (if dir is true) or lastIndexOf
						if ((<any>Buffer).isBuffer(val)) {
							// Special case: looking for empty string/buffer always fails
							if (val.length === 0) {
								return -1
							}
							return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
						} else if (typeof val === 'number') {
							val = val & 0xFF // Search for a byte value [0-255]
							if ((<any>Buffer).TYPED_ARRAY_SUPPORT &&
								typeof Uint8Array.prototype.indexOf === 'function') {
								if (dir) {
									return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
								} else {
									return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
								}
							}
							return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
						}

						throw new TypeError('val must be string, number or Buffer')
					}

					function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
						var indexSize = 1
						var arrLength = arr.length
						var valLength = val.length

						if (encoding !== undefined) {
							encoding = String(encoding).toLowerCase()
							if (encoding === 'ucs2' || encoding === 'ucs-2' ||
								encoding === 'utf16le' || encoding === 'utf-16le') {
								if (arr.length < 2 || val.length < 2) {
									return -1
								}
								indexSize = 2
								arrLength /= 2
								valLength /= 2
								byteOffset /= 2
							}
						}

						function read(buf, i) {
							if (indexSize === 1) {
								return buf[i]
							} else {
								return buf.readUInt16BE(i * indexSize)
							}
						}

						var i
						if (dir) {
							var foundIndex = -1
							for (i = byteOffset; i < arrLength; i++) {
								if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
									if (foundIndex === -1) foundIndex = i
									if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
								} else {
									if (foundIndex !== -1) i -= i - foundIndex
									foundIndex = -1
								}
							}
						} else {
							if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
							for (i = byteOffset; i >= 0; i--) {
								var found = true
								for (var j = 0; j < valLength; j++) {
									if (read(arr, i + j) !== read(val, j)) {
										found = false
										break
									}
								}
								if (found) return i
							}
						}

						return -1
					}

					Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
						return this.indexOf(val, byteOffset, encoding) !== -1
					}

					Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
						return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
					}

					Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
						return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
					}

					function hexWrite(buf, string, offset, length) {
						offset = Number(offset) || 0
						var remaining = buf.length - offset
						if (!length) {
							length = remaining
						} else {
							length = Number(length)
							if (length > remaining) {
								length = remaining
							}
						}

						// must be an even number of digits
						var strLen = string.length
						if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')

						if (length > strLen / 2) {
							length = strLen / 2
						}
						for (var i = 0; i < length; ++i) {
							var parsed = parseInt(string.substr(i * 2, 2), 16)
							if (isNaN(parsed)) return i
							buf[offset + i] = parsed
						}
						return i
					}

					function utf8Write(buf, string, offset, length) {
						return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
					}

					function asciiWrite(buf, string, offset, length) {
						return blitBuffer(asciiToBytes(string), buf, offset, length)
					}

					function latin1Write(buf, string, offset, length) {
						return asciiWrite(buf, string, offset, length)
					}

					function base64Write(buf, string, offset, length) {
						return blitBuffer(base64ToBytes(string), buf, offset, length)
					}

					function ucs2Write(buf, string, offset, length) {
						return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
					}

					Buffer.prototype.write = function write(string, offset, length, encoding) {
						// Buffer#write(string)
						if (offset === undefined) {
							encoding = 'utf8'
							length = this.length
							offset = 0
							// Buffer#write(string, encoding)
						} else if (length === undefined && typeof offset === 'string') {
							encoding = offset
							length = this.length
							offset = 0
							// Buffer#write(string, offset[, length][, encoding])
						} else if (isFinite(offset)) {
							offset = offset | 0
							if (isFinite(length)) {
								length = length | 0
								if (encoding === undefined) encoding = 'utf8'
							} else {
								encoding = length
								length = undefined
							}
							// legacy write(string, encoding, offset, length) - remove in v0.13
						} else {
							throw new Error(
								'Buffer.write(string, encoding, offset[, length]) is no longer supported'
							)
						}

						var remaining = this.length - offset
						if (length === undefined || length > remaining) length = remaining

						if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
							throw new RangeError('Attempt to write outside buffer bounds')
						}

						if (!encoding) encoding = 'utf8'

						var loweredCase = false
						for (; ;) {
							switch (encoding) {
								case 'hex':
									return hexWrite(this, string, offset, length)

								case 'utf8':
								case 'utf-8':
									return utf8Write(this, string, offset, length)

								case 'ascii':
									return asciiWrite(this, string, offset, length)

								case 'latin1':
								case 'binary':
									return latin1Write(this, string, offset, length)

								case 'base64':
									// Warning: maxLength not taken into account in base64Write
									return base64Write(this, string, offset, length)

								case 'ucs2':
								case 'ucs-2':
								case 'utf16le':
								case 'utf-16le':
									return ucs2Write(this, string, offset, length)

								default:
									if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
									encoding = ('' + encoding).toLowerCase()
									loweredCase = true
							}
						}
					}

					Buffer.prototype.toJSON = function toJSON() {
						return {
							type: 'Buffer',
							data: Array.prototype.slice.call(this._arr || this, 0)
						}
					}

					function base64Slice(buf, start, end) {
						if (start === 0 && end === buf.length) {
							return base64.fromByteArray(buf)
						} else {
							return base64.fromByteArray(buf.slice(start, end))
						}
					}

					function utf8Slice(buf, start, end) {
						end = Math.min(buf.length, end)
						var res = []

						var i = start
						while (i < end) {
							var firstByte = buf[i]
							var codePoint = null
							var bytesPerSequence = (firstByte > 0xEF) ? 4
								: (firstByte > 0xDF) ? 3
									: (firstByte > 0xBF) ? 2
										: 1

							if (i + bytesPerSequence <= end) {
								var secondByte, thirdByte, fourthByte, tempCodePoint

								switch (bytesPerSequence) {
									case 1:
										if (firstByte < 0x80) {
											codePoint = firstByte
										}
										break
									case 2:
										secondByte = buf[i + 1]
										if ((secondByte & 0xC0) === 0x80) {
											tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
											if (tempCodePoint > 0x7F) {
												codePoint = tempCodePoint
											}
										}
										break
									case 3:
										secondByte = buf[i + 1]
										thirdByte = buf[i + 2]
										if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
											tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
											if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
												codePoint = tempCodePoint
											}
										}
										break
									case 4:
										secondByte = buf[i + 1]
										thirdByte = buf[i + 2]
										fourthByte = buf[i + 3]
										if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
											tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
											if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
												codePoint = tempCodePoint
											}
										}
								}
							}

							if (codePoint === null) {
								// we did not generate a valid codePoint so insert a
								// replacement char (U+FFFD) and advance only 1 byte
								codePoint = 0xFFFD
								bytesPerSequence = 1
							} else if (codePoint > 0xFFFF) {
								// encode to utf16 (surrogate pair dance)
								codePoint -= 0x10000
								res.push(codePoint >>> 10 & 0x3FF | 0xD800)
								codePoint = 0xDC00 | codePoint & 0x3FF
							}

							res.push(codePoint)
							i += bytesPerSequence
						}

						return decodeCodePointsArray(res)
					}

					// Based on http://stackoverflow.com/a/22747272/680742, the browser with
					// the lowest limit is Chrome, with 0x10000 args.
					// We go 1 magnitude less, for safety
					var MAX_ARGUMENTS_LENGTH = 0x1000

					function decodeCodePointsArray(codePoints) {
						var len = codePoints.length
						if (len <= MAX_ARGUMENTS_LENGTH) {
							return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
						}

						// Decode in chunks to avoid "call stack size exceeded".
						var res = ''
						var i = 0
						while (i < len) {
							res += String.fromCharCode.apply(
								String,
								codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
							)
						}
						return res
					}

					function asciiSlice(buf, start, end) {
						var ret = ''
						end = Math.min(buf.length, end)

						for (var i = start; i < end; ++i) {
							ret += String.fromCharCode(buf[i] & 0x7F)
						}
						return ret
					}

					function latin1Slice(buf, start, end) {
						var ret = ''
						end = Math.min(buf.length, end)

						for (var i = start; i < end; ++i) {
							ret += String.fromCharCode(buf[i])
						}
						return ret
					}

					function hexSlice(buf, start, end) {
						var len = buf.length

						if (!start || start < 0) start = 0
						if (!end || end < 0 || end > len) end = len

						var out = ''
						for (var i = start; i < end; ++i) {
							out += toHex(buf[i])
						}
						return out
					}

					function utf16leSlice(buf, start, end) {
						var bytes = buf.slice(start, end)
						var res = ''
						for (var i = 0; i < bytes.length; i += 2) {
							res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
						}
						return res
					}

					Buffer.prototype.slice = function slice(start, end) {
						var len = this.length
						start = ~~start
						end = end === undefined ? len : ~~end

						if (start < 0) {
							start += len
							if (start < 0) start = 0
						} else if (start > len) {
							start = len
						}

						if (end < 0) {
							end += len
							if (end < 0) end = 0
						} else if (end > len) {
							end = len
						}

						if (end < start) end = start

						var newBuf;
						if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
							newBuf = this.subarray(start, end)
							newBuf.__proto__ = Buffer.prototype
						} else {
							var sliceLen = end - start
							newBuf = new Buffer(sliceLen, undefined)
							for (var i = 0; i < sliceLen; ++i) {
								newBuf[i] = this[i + start]
							}
						}

						return newBuf
					}

					/*
					 * Need to make sure that buffer isn't trying to write out of bounds.
					 */
					function checkOffset(offset, ext, length) {
						if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
						if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
					}

					Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
						offset = offset | 0
						byteLength = byteLength | 0
						if (!noAssert) checkOffset(offset, byteLength, this.length)

						var val = this[offset]
						var mul = 1
						var i = 0
						while (++i < byteLength && (mul *= 0x100)) {
							val += this[offset + i] * mul
						}

						return val
					}

					Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
						offset = offset | 0
						byteLength = byteLength | 0
						if (!noAssert) {
							checkOffset(offset, byteLength, this.length)
						}

						var val = this[offset + --byteLength]
						var mul = 1
						while (byteLength > 0 && (mul *= 0x100)) {
							val += this[offset + --byteLength] * mul
						}

						return val
					}

					Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 1, this.length)
						return this[offset]
					}

					Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 2, this.length)
						return this[offset] | (this[offset + 1] << 8)
					}

					Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 2, this.length)
						return (this[offset] << 8) | this[offset + 1]
					}

					Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 4, this.length)

						return ((this[offset]) |
							(this[offset + 1] << 8) |
							(this[offset + 2] << 16)) +
							(this[offset + 3] * 0x1000000)
					}

					Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 4, this.length)

						return (this[offset] * 0x1000000) +
							((this[offset + 1] << 16) |
								(this[offset + 2] << 8) |
								this[offset + 3])
					}

					Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
						offset = offset | 0
						byteLength = byteLength | 0
						if (!noAssert) checkOffset(offset, byteLength, this.length)

						var val = this[offset]
						var mul = 1
						var i = 0
						while (++i < byteLength && (mul *= 0x100)) {
							val += this[offset + i] * mul
						}
						mul *= 0x80

						if (val >= mul) val -= Math.pow(2, 8 * byteLength)

						return val
					}

					Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
						offset = offset | 0
						byteLength = byteLength | 0
						if (!noAssert) checkOffset(offset, byteLength, this.length)

						var i = byteLength
						var mul = 1
						var val = this[offset + --i]
						while (i > 0 && (mul *= 0x100)) {
							val += this[offset + --i] * mul
						}
						mul *= 0x80

						if (val >= mul) val -= Math.pow(2, 8 * byteLength)

						return val
					}

					Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 1, this.length)
						if (!(this[offset] & 0x80)) return (this[offset])
						return ((0xff - this[offset] + 1) * -1)
					}

					Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 2, this.length)
						var val = this[offset] | (this[offset + 1] << 8)
						return (val & 0x8000) ? val | 0xFFFF0000 : val
					}

					Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 2, this.length)
						var val = this[offset + 1] | (this[offset] << 8)
						return (val & 0x8000) ? val | 0xFFFF0000 : val
					}

					Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 4, this.length)

						return (this[offset]) |
							(this[offset + 1] << 8) |
							(this[offset + 2] << 16) |
							(this[offset + 3] << 24)
					}

					Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 4, this.length)

						return (this[offset] << 24) |
							(this[offset + 1] << 16) |
							(this[offset + 2] << 8) |
							(this[offset + 3])
					}

					Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 4, this.length)
						return ieee754.read(this, offset, true, 23, 4)
					}

					Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 4, this.length)
						return ieee754.read(this, offset, false, 23, 4)
					}

					Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 8, this.length)
						return ieee754.read(this, offset, true, 52, 8)
					}

					Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
						if (!noAssert) checkOffset(offset, 8, this.length)
						return ieee754.read(this, offset, false, 52, 8)
					}

					function checkInt(buf, value, offset, ext, max, min) {
						if (!(<any>Buffer).isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
						if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
						if (offset + ext > buf.length) throw new RangeError('Index out of range')
					}

					Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
						value = +value
						offset = offset | 0
						byteLength = byteLength | 0
						if (!noAssert) {
							var maxBytes = Math.pow(2, 8 * byteLength) - 1
							checkInt(this, value, offset, byteLength, maxBytes, 0)
						}

						var mul = 1
						var i = 0
						this[offset] = value & 0xFF
						while (++i < byteLength && (mul *= 0x100)) {
							this[offset + i] = (value / mul) & 0xFF
						}

						return offset + byteLength
					}

					Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
						value = +value
						offset = offset | 0
						byteLength = byteLength | 0
						if (!noAssert) {
							var maxBytes = Math.pow(2, 8 * byteLength) - 1
							checkInt(this, value, offset, byteLength, maxBytes, 0)
						}

						var i = byteLength - 1
						var mul = 1
						this[offset + i] = value & 0xFF
						while (--i >= 0 && (mul *= 0x100)) {
							this[offset + i] = (value / mul) & 0xFF
						}

						return offset + byteLength
					}

					Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
						if (!(<any>Buffer).TYPED_ARRAY_SUPPORT) value = Math.floor(value);
						this[offset] = (value & 0xff)
						return offset + 1
					}

					function objectWriteUInt16(buf, value, offset, littleEndian) {
						if (value < 0) value = 0xffff + value + 1
						for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
							buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
								(littleEndian ? i : 1 - i) * 8
						}
					}

					Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
						if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
							this[offset] = (value & 0xff)
							this[offset + 1] = (value >>> 8)
						} else {
							objectWriteUInt16(this, value, offset, true)
						}
						return offset + 2
					}

					Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
						if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
							this[offset] = (value >>> 8)
							this[offset + 1] = (value & 0xff)
						} else {
							objectWriteUInt16(this, value, offset, false)
						}
						return offset + 2
					}

					function objectWriteUInt32(buf, value, offset, littleEndian) {
						if (value < 0) value = 0xffffffff + value + 1
						for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
							buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
						}
					}

					Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
						if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
							this[offset + 3] = (value >>> 24)
							this[offset + 2] = (value >>> 16)
							this[offset + 1] = (value >>> 8)
							this[offset] = (value & 0xff)
						} else {
							objectWriteUInt32(this, value, offset, true)
						}
						return offset + 4
					}

					Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
						if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
							this[offset] = (value >>> 24)
							this[offset + 1] = (value >>> 16)
							this[offset + 2] = (value >>> 8)
							this[offset + 3] = (value & 0xff)
						} else {
							objectWriteUInt32(this, value, offset, false)
						}
						return offset + 4
					}

					Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) {
							var limit = Math.pow(2, 8 * byteLength - 1)

							checkInt(this, value, offset, byteLength, limit - 1, -limit)
						}

						var i = 0
						var mul = 1
						var sub = 0
						this[offset] = value & 0xFF
						while (++i < byteLength && (mul *= 0x100)) {
							if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
								sub = 1
							}
							this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
						}

						return offset + byteLength
					}

					Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) {
							var limit = Math.pow(2, 8 * byteLength - 1)

							checkInt(this, value, offset, byteLength, limit - 1, -limit)
						}

						var i = byteLength - 1
						var mul = 1
						var sub = 0
						this[offset + i] = value & 0xFF
						while (--i >= 0 && (mul *= 0x100)) {
							if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
								sub = 1
							}
							this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
						}

						return offset + byteLength
					}

					Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
						if (!(<any>Buffer).TYPED_ARRAY_SUPPORT) value = Math.floor(value)
						if (value < 0) value = 0xff + value + 1
						this[offset] = (value & 0xff)
						return offset + 1
					}

					Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
						if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
							this[offset] = (value & 0xff)
							this[offset + 1] = (value >>> 8)
						} else {
							objectWriteUInt16(this, value, offset, true)
						}
						return offset + 2
					}

					Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
						if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
							this[offset] = (value >>> 8)
							this[offset + 1] = (value & 0xff)
						} else {
							objectWriteUInt16(this, value, offset, false)
						}
						return offset + 2
					}

					Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
						if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
							this[offset] = (value & 0xff)
							this[offset + 1] = (value >>> 8)
							this[offset + 2] = (value >>> 16)
							this[offset + 3] = (value >>> 24)
						} else {
							objectWriteUInt32(this, value, offset, true)
						}
						return offset + 4
					}

					Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
						value = +value
						offset = offset | 0
						if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
						if (value < 0) value = 0xffffffff + value + 1
						if ((<any>Buffer).TYPED_ARRAY_SUPPORT) {
							this[offset] = (value >>> 24)
							this[offset + 1] = (value >>> 16)
							this[offset + 2] = (value >>> 8)
							this[offset + 3] = (value & 0xff)
						} else {
							objectWriteUInt32(this, value, offset, false)
						}
						return offset + 4
					}

					function checkIEEE754(buf, value, offset, ext, max, min) {
						if (offset + ext > buf.length) throw new RangeError('Index out of range')
						if (offset < 0) throw new RangeError('Index out of range')
					}

					function writeFloat(buf, value, offset, littleEndian, noAssert) {
						if (!noAssert) {
							checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
						}
						ieee754.write(buf, value, offset, littleEndian, 23, 4)
						return offset + 4
					}

					Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
						return writeFloat(this, value, offset, true, noAssert)
					}

					Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
						return writeFloat(this, value, offset, false, noAssert)
					}

					function writeDouble(buf, value, offset, littleEndian, noAssert) {
						if (!noAssert) {
							checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
						}
						ieee754.write(buf, value, offset, littleEndian, 52, 8)
						return offset + 8
					}

					Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
						return writeDouble(this, value, offset, true, noAssert)
					}

					Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
						return writeDouble(this, value, offset, false, noAssert)
					}

					// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
					Buffer.prototype.copy = function copy(target, targetStart, start, end) {
						if (!start) start = 0
						if (!end && end !== 0) end = this.length
						if (targetStart >= target.length) targetStart = target.length
						if (!targetStart) targetStart = 0
						if (end > 0 && end < start) end = start

						// Copy 0 bytes; we're done
						if (end === start) return 0
						if (target.length === 0 || this.length === 0) return 0

						// Fatal error conditions
						if (targetStart < 0) {
							throw new RangeError('targetStart out of bounds')
						}
						if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
						if (end < 0) throw new RangeError('sourceEnd out of bounds')

						// Are we oob?
						if (end > this.length) end = this.length
						if (target.length - targetStart < end - start) {
							end = target.length - targetStart + start
						}

						var len = end - start
						var i

						if (this === target && start < targetStart && targetStart < end) {
							// descending copy from end
							for (i = len - 1; i >= 0; --i) {
								target[i + targetStart] = this[i + start]
							}
						} else if (len < 1000 || !(<any>Buffer).TYPED_ARRAY_SUPPORT) {
							// ascending copy from start
							for (i = 0; i < len; ++i) {
								target[i + targetStart] = this[i + start]
							}
						} else {
							Uint8Array.prototype.set.call(
								target,
								this.subarray(start, start + len),
								targetStart
							)
						}

						return len
					}

					// Usage:
					//    buffer.fill(number[, offset[, end]])
					//    buffer.fill(buffer[, offset[, end]])
					//    buffer.fill(string[, offset[, end]][, encoding])
					Buffer.prototype.fill = function fill(val, start, end, encoding) {
						// Handle string cases:
						if (typeof val === 'string') {
							if (typeof start === 'string') {
								encoding = start
								start = 0
								end = this.length
							} else if (typeof end === 'string') {
								encoding = end
								end = this.length
							}
							if (val.length === 1) {
								var code = val.charCodeAt(0)
								if (code < 256) {
									val = code
								}
							}
							if (encoding !== undefined && typeof encoding !== 'string') {
								throw new TypeError('encoding must be a string')
							}
							if (typeof encoding === 'string' && !(<any>Buffer).isEncoding(encoding)) {
								throw new TypeError('Unknown encoding: ' + encoding)
							}
						} else if (typeof val === 'number') {
							val = val & 255
						}

						// Invalid ranges are not set to a default, so can range check early.
						if (start < 0 || this.length < start || this.length < end) {
							throw new RangeError('Out of range index')
						}

						if (end <= start) {
							return this
						}

						start = start >>> 0
						end = end === undefined ? this.length : end >>> 0

						if (!val) val = 0

						var i
						if (typeof val === 'number') {
							for (i = start; i < end; ++i) {
								this[i] = val
							}
						} else {
							var bytes = (<any>Buffer).isBuffer(val)
								? val
								: utf8ToBytes(new Buffer(val, encoding).toString());
							var len = bytes.length
							for (i = 0; i < end - start; ++i) {
								this[i + start] = bytes[i % len]
							}
						}

						return this
					}

					// HELPER FUNCTIONS
					// ================

					var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g

					function base64clean(str) {
						// Node strips out invalid characters like \n and \t from the string, base64-js does not
						str = stringtrim(str).replace(INVALID_BASE64_RE, '')
						// Node converts strings with length < 2 to ''
						if (str.length < 2) return ''
						// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
						while (str.length % 4 !== 0) {
							str = str + '='
						}
						return str
					}

					function stringtrim(str) {
						if (str.trim) return str.trim()
						return str.replace(/^\s+|\s+$/g, '')
					}

					function toHex(n) {
						if (n < 16) return '0' + n.toString(16)
						return n.toString(16)
					}

					function utf8ToBytes(string, units?) {
						units = units || Infinity
						var codePoint
						var length = string.length
						var leadSurrogate = null
						var bytes = []

						for (var i = 0; i < length; ++i) {
							codePoint = string.charCodeAt(i)

							// is surrogate component
							if (codePoint > 0xD7FF && codePoint < 0xE000) {
								// last char was a lead
								if (!leadSurrogate) {
									// no lead yet
									if (codePoint > 0xDBFF) {
										// unexpected trail
										if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
										continue
									} else if (i + 1 === length) {
										// unpaired lead
										if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
										continue
									}

									// valid lead
									leadSurrogate = codePoint

									continue
								}

								// 2 leads in a row
								if (codePoint < 0xDC00) {
									if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
									leadSurrogate = codePoint
									continue
								}

								// valid surrogate pair
								codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
							} else if (leadSurrogate) {
								// valid bmp char, but last char was a lead
								if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
							}

							leadSurrogate = null

							// encode utf8
							if (codePoint < 0x80) {
								if ((units -= 1) < 0) break
								bytes.push(codePoint)
							} else if (codePoint < 0x800) {
								if ((units -= 2) < 0) break
								bytes.push(
									codePoint >> 0x6 | 0xC0,
									codePoint & 0x3F | 0x80
								)
							} else if (codePoint < 0x10000) {
								if ((units -= 3) < 0) break
								bytes.push(
									codePoint >> 0xC | 0xE0,
									codePoint >> 0x6 & 0x3F | 0x80,
									codePoint & 0x3F | 0x80
								)
							} else if (codePoint < 0x110000) {
								if ((units -= 4) < 0) break
								bytes.push(
									codePoint >> 0x12 | 0xF0,
									codePoint >> 0xC & 0x3F | 0x80,
									codePoint >> 0x6 & 0x3F | 0x80,
									codePoint & 0x3F | 0x80
								)
							} else {
								throw new Error('Invalid code point')
							}
						}

						return bytes
					}

					function asciiToBytes(str) {
						var byteArray = []
						for (var i = 0; i < str.length; ++i) {
							// Node's code seems to be doing this and not & 0x7F..
							byteArray.push(str.charCodeAt(i) & 0xFF)
						}
						return byteArray
					}

					function utf16leToBytes(str, units) {
						var c, hi, lo
						var byteArray = []
						for (var i = 0; i < str.length; ++i) {
							if ((units -= 2) < 0) break

							c = str.charCodeAt(i)
							hi = c >> 8
							lo = c % 256
							byteArray.push(lo)
							byteArray.push(hi)
						}

						return byteArray
					}

					function base64ToBytes(str) {
						return base64.toByteArray(base64clean(str))
					}

					function blitBuffer(src, dst, offset, length) {
						for (var i = 0; i < length; ++i) {
							if ((i + offset >= dst.length) || (i >= src.length)) break
							dst[i + offset] = src[i]
						}
						return i
					}

					function isnan(val) {
						return val !== val // eslint-disable-line no-self-compare
					}

				}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})

			}, { "base64-js": 45, "ieee754": 166, "isarray": 169 }], 61: [function (localRequire, localModule, localExports) {
				(function (Buffer) {
					var clone = (function () {
						'use strict';

						/**
						 * Clones (copies) an Object using deep copying.
						 *
						 * This function supports circular references by default, but if you are certain
						 * there are no circular references in your object, you can save some CPU time
						 * by calling clone(obj, false).
						 *
						 * Caution: if `circular` is false and `parent` contains circular references,
						 * your program may enter an infinite loop and crash.
						 *
						 * @param `parent` - the object to be cloned
						 * @param `circular` - set to true if the object to be cloned may contain
						 *    circular references. (optional - true by default)
						 * @param `depth` - set to a number if the object is only to be cloned to
						 *    a particular depth. (optional - defaults to Infinity)
						 * @param `prototype` - sets the prototype to be used when cloning an object.
						 *    (optional - defaults to parent prototype).
						*/
						function clone(parent, circular, depth, prototype) {
							var filter;
							if (typeof circular === 'object') {
								depth = circular.depth;
								prototype = circular.prototype;
								filter = circular.filter;
								circular = circular.circular
							}
							// maintain two arrays for circular references, where corresponding parents
							// and children have the same index
							var allParents = [];
							var allChildren = [];

							var useBuffer = typeof Buffer != 'undefined';

							if (typeof circular == 'undefined')
								circular = true;

							if (typeof depth == 'undefined')
								depth = Infinity;

							// recurse this function so we don't reset allParents and allChildren
							function _clone(parent, depth) {
								// cloning null always returns null
								if (parent === null)
									return null;

								if (depth == 0)
									return parent;

								var child;
								var proto;
								if (typeof parent != 'object') {
									return parent;
								}

								if ((<any>clone).__isArray(parent)) {
									child = [];
								} else if ((<any>clone).__isRegExp(parent)) {
									child = new RegExp(parent.source, __getRegExpFlags(parent));
									if (parent.lastIndex) child.lastIndex = parent.lastIndex;
								} else if ((<any>clone).__isDate(parent)) {
									child = new Date(parent.getTime());
								} else if (useBuffer && Buffer.isBuffer(parent)) {
									child = new Buffer(parent.length);
									parent.copy(child);
									return child;
								} else {
									if (typeof prototype == 'undefined') {
										proto = Object.getPrototypeOf(parent);
										child = Object.create(proto);
									}
									else {
										child = Object.create(prototype);
										proto = prototype;
									}
								}

								if (circular) {
									var index = allParents.indexOf(parent);

									if (index != -1) {
										return allChildren[index];
									}
									allParents.push(parent);
									allChildren.push(child);
								}

								for (var i in parent) {
									var attrs;
									if (proto) {
										attrs = Object.getOwnPropertyDescriptor(proto, i);
									}

									if (attrs && attrs.set == null) {
										continue;
									}
									child[i] = _clone(parent[i], depth - 1);
								}

								return child;
							}

							return _clone(parent, depth);
						}

						/**
						 * Simple flat clone using prototype, accepts only objects, usefull for property
						 * override on FLAT configuration object (no nested props).
						 *
						 * USE WITH CAUTION! This may not behave as you wish if you do not know how this
						 * works.
						 */
						(<any>clone).clonePrototype = function clonePrototype(parent) {
							if (parent === null)
								return null;

							var c = function () { };
							c.prototype = parent;
							return new c();
						};

						// private utility functions

						function __objToStr(o) {
							return Object.prototype.toString.call(o);
						};
						(<any>clone).__objToStr = __objToStr;

						function __isDate(o) {
							return typeof o === 'object' && __objToStr(o) === '[object Date]';
						};
						(<any>clone).__isDate = __isDate;

						function __isArray(o) {
							return typeof o === 'object' && __objToStr(o) === '[object Array]';
						};
						(<any>clone).__isArray = __isArray;

						function __isRegExp(o) {
							return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
						};
						(<any>clone).__isRegExp = __isRegExp;

						function __getRegExpFlags(re) {
							var flags = '';
							if (re.global) flags += 'g';
							if (re.ignoreCase) flags += 'i';
							if (re.multiline) flags += 'm';
							return flags;
						};
						(<any>clone).__getRegExpFlags = __getRegExpFlags;

						return clone;
					})();

					if (typeof localModule === 'object' && localModule.localExports) {
						localModule.localExports = clone;
					}

				}).call(this, localRequire("buffer").Buffer)

			}, { "buffer": 60 }], 62: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.string.iterator');
				localRequire('../../modules/es6.array.from');
				localModule.localExports = localRequire('../../modules/_core').Array.from;
			}, { "../../modules/_core": 82, "../../modules/es6.array.from": 143, "../../modules/es6.string.iterator": 155 }], 63: [function (localRequire, localModule, localExports) {
				localRequire('../modules/web.dom.iterable');
				localRequire('../modules/es6.string.iterator');
				localModule.localExports = localRequire('../modules/core.get-iterator');
			}, { "../modules/core.get-iterator": 141, "../modules/es6.string.iterator": 155, "../modules/web.dom.iterable": 159 }], 64: [function (localRequire, localModule, localExports) {
				localRequire('../modules/web.dom.iterable');
				localRequire('../modules/es6.string.iterator');
				localModule.localExports = localRequire('../modules/core.is-iterable');
			}, { "../modules/core.is-iterable": 142, "../modules/es6.string.iterator": 155, "../modules/web.dom.iterable": 159 }], 65: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.object.assign');
				localModule.localExports = localRequire('../../modules/_core').Object.assign;
			}, { "../../modules/_core": 82, "../../modules/es6.object.assign": 145 }], 66: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.object.create');
				var $Object = localRequire('../../modules/_core').Object;
				localModule.localExports = function create(P, D) {
					return $Object.create(P, D);
				};
			}, { "../../modules/_core": 82, "../../modules/es6.object.create": 146 }], 67: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.object.define-properties');
				var $Object = localRequire('../../modules/_core').Object;
				localModule.localExports = function defineProperties(T, D) {
					return $Object.defineProperties(T, D);
				};
			}, { "../../modules/_core": 82, "../../modules/es6.object.define-properties": 147 }], 68: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.object.define-property');
				var $Object = localRequire('../../modules/_core').Object;
				localModule.localExports = function defineProperty(it, key, desc) {
					return $Object.defineProperty(it, key, desc);
				};
			}, { "../../modules/_core": 82, "../../modules/es6.object.define-property": 148 }], 69: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.object.freeze');
				localModule.localExports = localRequire('../../modules/_core').Object.freeze;
			}, { "../../modules/_core": 82, "../../modules/es6.object.freeze": 149 }], 70: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.object.get-own-property-descriptor');
				var $Object = localRequire('../../modules/_core').Object;
				localModule.localExports = function getOwnPropertyDescriptor(it, key) {
					return $Object.getOwnPropertyDescriptor(it, key);
				};
			}, { "../../modules/_core": 82, "../../modules/es6.object.get-own-property-descriptor": 150 }], 71: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.object.get-prototype-of');
				localModule.localExports = localRequire('../../modules/_core').Object.getPrototypeOf;
			}, { "../../modules/_core": 82, "../../modules/es6.object.get-prototype-of": 151 }], 72: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.object.keys');
				localModule.localExports = localRequire('../../modules/_core').Object.keys;
			}, { "../../modules/_core": 82, "../../modules/es6.object.keys": 152 }], 73: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.object.set-prototype-of');
				localModule.localExports = localRequire('../../modules/_core').Object.setPrototypeOf;
			}, { "../../modules/_core": 82, "../../modules/es6.object.set-prototype-of": 153 }], 74: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.symbol');
				localRequire('../../modules/es6.object.to-string');
				localRequire('../../modules/es7.symbol.async-iterator');
				localRequire('../../modules/es7.symbol.observable');
				localModule.localExports = localRequire('../../modules/_core').Symbol;
			}, { "../../modules/_core": 82, "../../modules/es6.object.to-string": 154, "../../modules/es6.symbol": 156, "../../modules/es7.symbol.async-iterator": 157, "../../modules/es7.symbol.observable": 158 }], 75: [function (localRequire, localModule, localExports) {
				localRequire('../../modules/es6.string.iterator');
				localRequire('../../modules/web.dom.iterable');
				localModule.localExports = localRequire('../../modules/_wks-ext').f('iterator');
			}, { "../../modules/_wks-ext": 138, "../../modules/es6.string.iterator": 155, "../../modules/web.dom.iterable": 159 }], 76: [function (localRequire, localModule, localExports) {
				localModule.localExports = function (it) {
					if (typeof it != 'function') throw TypeError(it + ' is not a function!');
					return it;
				};
			}, {}], 77: [function (localRequire, localModule, localExports) {
				localModule.localExports = function () { /* empty */ };
			}, {}], 78: [function (localRequire, localModule, localExports) {
				var isObject = localRequire('./_is-object');
				localModule.localExports = function (it) {
					if (!isObject(it)) throw TypeError(it + ' is not an object!');
					return it;
				};
			}, { "./_is-object": 100 }], 79: [function (localRequire, localModule, localExports) {
				// false -> Array#indexOf
				// true  -> Array#includes
				var toIObject = localRequire('./_to-iobject')
					, toLength = localRequire('./_to-length')
					, toIndex = localRequire('./_to-index');
				localModule.localExports = function (IS_INCLUDES) {
					return function ($this, el, fromIndex) {
						var O = toIObject($this)
							, length = toLength(O.length)
							, index = toIndex(fromIndex, length)
							, value;
						// Array#includes uses SameValueZero equality algorithm
						if (IS_INCLUDES && el != el) while (length > index) {
							value = O[index++];
							if (value != value) return true;
							// Array#toIndex ignores holes, Array#includes - not
						} else for (; length > index; index++)if (IS_INCLUDES || index in O) {
							if (O[index] === el) return IS_INCLUDES || index || 0;
						} return !IS_INCLUDES && -1;
					};
				};
			}, { "./_to-index": 130, "./_to-iobject": 132, "./_to-length": 133 }], 80: [function (localRequire, localModule, localExports) {
				// getting tag from 19.1.3.6 Object.prototype.toString()
				var cof = localRequire('./_cof')
					, TAG = localRequire('./_wks')('toStringTag')
					// ES3 wrong here
					, ARG = cof(function () { return arguments; } ()) == 'Arguments';

				// fallback for IE11 Script Access Denied error
				var tryGet = function (it, key) {
					try {
						return it[key];
					} catch (e) { /* empty */ }
				};

				localModule.localExports = function (it) {
					var O, T, B;
					return it === undefined ? 'Undefined' : it === null ? 'Null'
						// @@toStringTag case
						: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
							// builtinTag case
							: ARG ? cof(O)
								// ES3 arguments fallback
								: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
				};
			}, { "./_cof": 81, "./_wks": 139 }], 81: [function (localRequire, localModule, localExports) {
				var toString = {}.toString;

				localModule.localExports = function (it) {
					return toString.call(it).slice(8, -1);
				};
			}, {}], 82: [function (localRequire, localModule, localExports) {
				var core = localModule.localExports = { version: '2.4.0' };
				var __e;
				if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
			}, {}], 83: [function (localRequire, localModule, localExports) {
				'use strict';
				var $defineProperty = localRequire('./_object-dp')
					, createDesc = localRequire('./_property-desc');

				localModule.localExports = function (object, index, value) {
					if (index in object) $defineProperty.f(object, index, createDesc(0, value));
					else object[index] = value;
				};
			}, { "./_object-dp": 112, "./_property-desc": 123 }], 84: [function (localRequire, localModule, localExports) {
				// optional / simple context binding
				var aFunction = localRequire('./_a-function');
				localModule.localExports = function (fn, that, length) {
					aFunction(fn);
					if (that === undefined) return fn;
					switch (length) {
						case 1: return function (a) {
							return fn.call(that, a);
						};
						case 2: return function (a, b) {
							return fn.call(that, a, b);
						};
						case 3: return function (a, b, c) {
							return fn.call(that, a, b, c);
						};
					}
					return function (/* ...args */) {
						return fn.apply(that, arguments);
					};
				};
			}, { "./_a-function": 76 }], 85: [function (localRequire, localModule, localExports) {
				// 7.2.1 RequireObjectCoercible(argument)
				localModule.localExports = function (it) {
					if (it == undefined) throw TypeError("Can't call method on  " + it);
					return it;
				};
			}, {}], 86: [function (localRequire, localModule, localExports) {
				// Thank's IE8 for his funny defineProperty
				localModule.localExports = !localRequire('./_fails')(function () {
					return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
				});
			}, { "./_fails": 91 }], 87: [function (localRequire, localModule, localExports) {
				var isObject = localRequire('./_is-object')
					, document = localRequire('./_global').document
					// in old IE typeof document.createElement is 'object'
					, is = isObject(document) && isObject(document.createElement);
				localModule.localExports = function (it) {
					return is ? document.createElement(it) : {};
				};
			}, { "./_global": 92, "./_is-object": 100 }], 88: [function (localRequire, localModule, localExports) {
				// IE 8- don't enum bug keys
				localModule.localExports = (
					'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
				).split(',');
			}, {}], 89: [function (localRequire, localModule, localExports) {
				// all enumerable object keys, includes symbols
				var getKeys = localRequire('./_object-keys')
					, gOPS = localRequire('./_object-gops')
					, pIE = localRequire('./_object-pie');
				localModule.localExports = function (it) {
					var result = getKeys(it)
						, getSymbols = gOPS.f;
					if (getSymbols) {
						var symbols = getSymbols(it)
							, isEnum = pIE.f
							, i = 0
							, key;
						while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
					} return result;
				};
			}, { "./_object-gops": 117, "./_object-keys": 120, "./_object-pie": 121 }], 90: [function (localRequire, localModule, localExports) {
				var global = localRequire('./_global')
					, core = localRequire('./_core')
					, ctx = localRequire('./_ctx')
					, hide = localRequire('./_hide')
					, PROTOTYPE = 'prototype';

				var $export: any = function (type, name, source) {
					var IS_FORCED = type & $export.F
						, IS_GLOBAL = type & $export.G
						, IS_STATIC = type & $export.S
						, IS_PROTO = type & $export.P
						, IS_BIND = type & $export.B
						, IS_WRAP = type & $export.W
						, localExports = IS_GLOBAL ? core : core[name] || (core[name] = {})
						, expProto = localExports[PROTOTYPE]
						, target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
						, key, own, out;
					if (IS_GLOBAL) source = name;
					for (key in source) {
						// contains in native
						own = !IS_FORCED && target && target[key] !== undefined;
						if (own && key in localExports) continue;
						// export native or passed
						out = own ? target[key] : source[key];
						// prevent global pollution for namespaces
						localExports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
							// bind timers to global for call from export context
							: IS_BIND && own ? ctx(out, global)
								// wrap global constructors for prevent change them in library
								: IS_WRAP && target[key] == out ? (function (C) {
									var F = function (a, b, c) {
										if (this instanceof C) {
											switch (arguments.length) {
												case 0: return new C;
												case 1: return new C(a);
												case 2: return new C(a, b);
											} return new C(a, b, c);
										} return C.apply(this, arguments);
									};
									F[PROTOTYPE] = C[PROTOTYPE];
									return F;
									// make static versions for prototype methods
								})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
						// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
						if (IS_PROTO) {
							(localExports.virtual || (localExports.virtual = {}))[key] = out;
							// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
							if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
						}
					}
				};
				// type bitmap
				$export.F = 1;   // forced
				$export.G = 2;   // global
				$export.S = 4;   // static
				$export.P = 8;   // proto
				$export.B = 16;  // bind
				$export.W = 32;  // wrap
				$export.U = 64;  // safe
				$export.R = 128; // real proto method for `library` 
				localModule.localExports = $export;
			}, { "./_core": 82, "./_ctx": 84, "./_global": 92, "./_hide": 94 }], 91: [function (localRequire, localModule, localExports) {
				localModule.localExports = function (exec) {
					try {
						return !!exec();
					} catch (e) {
						return true;
					}
				};
			}, {}], 92: [function (localRequire, localModule, localExports) {
				// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
				var global = localModule.localExports = typeof window != 'undefined' && (<any>window).Math == Math
					? window : typeof self != 'undefined' && (<any>self).Math == Math ? self : Function('return this')();
				var __g;
				if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
			}, {}], 93: [function (localRequire, localModule, localExports) {
				var hasOwnProperty = {}.hasOwnProperty;
				localModule.localExports = function (it, key) {
					return hasOwnProperty.call(it, key);
				};
			}, {}], 94: [function (localRequire, localModule, localExports) {
				var dP = localRequire('./_object-dp')
					, createDesc = localRequire('./_property-desc');
				localModule.localExports = localRequire('./_descriptors') ? function (object, key, value) {
					return dP.f(object, key, createDesc(1, value));
				} : function (object, key, value) {
					object[key] = value;
					return object;
				};
			}, { "./_descriptors": 86, "./_object-dp": 112, "./_property-desc": 123 }], 95: [function (localRequire, localModule, localExports) {
				localModule.localExports = localRequire('./_global').document && document.documentElement;
			}, { "./_global": 92 }], 96: [function (localRequire, localModule, localExports) {
				localModule.localExports = !localRequire('./_descriptors') && !localRequire('./_fails')(function () {
					return Object.defineProperty(localRequire('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;
				});
			}, { "./_descriptors": 86, "./_dom-create": 87, "./_fails": 91 }], 97: [function (localRequire, localModule, localExports) {
				// fallback for non-array-like ES3 and non-enumerable old V8 strings
				var cof = localRequire('./_cof');
				localModule.localExports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
					return cof(it) == 'String' ? it.split('') : Object(it);
				};
			}, { "./_cof": 81 }], 98: [function (localRequire, localModule, localExports) {
				// check on default Array iterator
				var Iterators = localRequire('./_iterators')
					, ITERATOR = localRequire('./_wks')('iterator')
					, ArrayProto = Array.prototype;

				localModule.localExports = function (it) {
					return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
				};
			}, { "./_iterators": 106, "./_wks": 139 }], 99: [function (localRequire, localModule, localExports) {
				// 7.2.2 IsArray(argument)
				var cof = localRequire('./_cof');
				localModule.localExports = Array.isArray || function isArray(arg) {
					return cof(arg) == 'Array';
				};
			}, { "./_cof": 81 }], 100: [function (localRequire, localModule, localExports) {
				localModule.localExports = function (it) {
					return typeof it === 'object' ? it !== null : typeof it === 'function';
				};
			}, {}], 101: [function (localRequire, localModule, localExports) {
				// call something on iterator step with safe closing on error
				var anObject = localRequire('./_an-object');
				localModule.localExports = function (iterator, fn, value, entries) {
					try {
						return entries ? fn(anObject(value)[0], value[1]) : fn(value);
						// 7.4.6 IteratorClose(iterator, completion)
					} catch (e) {
						var ret = iterator['return'];
						if (ret !== undefined) anObject(ret.call(iterator));
						throw e;
					}
				};
			}, { "./_an-object": 78 }], 102: [function (localRequire, localModule, localExports) {
				'use strict';
				var create = localRequire('./_object-create')
					, descriptor = localRequire('./_property-desc')
					, setToStringTag = localRequire('./_set-to-string-tag')
					, IteratorPrototype = {};

				// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
				localRequire('./_hide')(IteratorPrototype, localRequire('./_wks')('iterator'), function () { return this; });

				localModule.localExports = function (Constructor, NAME, next) {
					Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
					setToStringTag(Constructor, NAME + ' Iterator');
				};
			}, { "./_hide": 94, "./_object-create": 111, "./_property-desc": 123, "./_set-to-string-tag": 126, "./_wks": 139 }], 103: [function (localRequire, localModule, localExports) {
				'use strict';
				var LIBRARY = localRequire('./_library')
					, $export = localRequire('./_export')
					, redefine = localRequire('./_redefine')
					, hide = localRequire('./_hide')
					, has = localRequire('./_has')
					, Iterators = localRequire('./_iterators')
					, $iterCreate = localRequire('./_iter-create')
					, setToStringTag = localRequire('./_set-to-string-tag')
					, getPrototypeOf = localRequire('./_object-gpo')
					, ITERATOR = localRequire('./_wks')('iterator')
					, BUGGY = !((<any>[]).keys && 'next' in (<any>[]).keys()) // Safari has buggy iterators w/o `next`
					, FF_ITERATOR = '@@iterator'
					, KEYS = 'keys'
					, VALUES = 'values';

				var returnThis = function () { return this; };

				localModule.localExports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
					$iterCreate(Constructor, NAME, next);
					var getMethod = function (kind) {
						if (!BUGGY && kind in proto) return proto[kind];
						switch (kind) {
							case KEYS: return function keys() { return new Constructor(this, kind); };
							case VALUES: return function values() { return new Constructor(this, kind); };
						} return function entries() { return new Constructor(this, kind); };
					};
					var TAG = NAME + ' Iterator'
						, DEF_VALUES = DEFAULT == VALUES
						, VALUES_BUG = false
						, proto = Base.prototype
						, $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
						, $default = $native || getMethod(DEFAULT)
						, $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
						, $anyNative = NAME == 'Array' ? proto.entries || $native : $native
						, methods, key, IteratorPrototype;
					// Fix native
					if ($anyNative) {
						IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
						if (IteratorPrototype !== Object.prototype) {
							// Set @@toStringTag to native iterators
							setToStringTag(IteratorPrototype, TAG, true);
							// fix for some old engines
							if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
						}
					}
					// fix Array#{values, @@iterator}.name in V8 / FF
					if (DEF_VALUES && $native && $native.name !== VALUES) {
						VALUES_BUG = true;
						$default = function values() { return $native.call(this); };
					}
					// Define iterator
					if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
						hide(proto, ITERATOR, $default);
					}
					// Plug for library
					Iterators[NAME] = $default;
					Iterators[TAG] = returnThis;
					if (DEFAULT) {
						methods = {
							values: DEF_VALUES ? $default : getMethod(VALUES),
							keys: IS_SET ? $default : getMethod(KEYS),
							entries: $entries
						};
						if (FORCED) for (key in methods) {
							if (!(key in proto)) redefine(proto, key, methods[key]);
						} else $export($export.P + $export.F * <any>(BUGGY || VALUES_BUG), NAME, methods);
					}
					return methods;
				};
			}, { "./_export": 90, "./_has": 93, "./_hide": 94, "./_iter-create": 102, "./_iterators": 106, "./_library": 108, "./_object-gpo": 118, "./_redefine": 124, "./_set-to-string-tag": 126, "./_wks": 139 }], 104: [function (localRequire, localModule, localExports) {
				var ITERATOR = localRequire('./_wks')('iterator')
					, SAFE_CLOSING = false;

				try {
					var riter = (<any>[7])[ITERATOR]();
					riter['return'] = function () { SAFE_CLOSING = true; };
					(<any>Array).from(riter, function () { throw 2; });
				} catch (e) { /* empty */ }

				localModule.localExports = function (exec, skipClosing) {
					if (!skipClosing && !SAFE_CLOSING) return false;
					var safe = false;
					try {
						var arr: any = [7]
							, iter = arr[ITERATOR]();
						iter.next = function () { return { done: safe = true }; };
						arr[ITERATOR] = function () { return iter; };
						exec(arr);
					} catch (e) { /* empty */ }
					return safe;
				};
			}, { "./_wks": 139 }], 105: [function (localRequire, localModule, localExports) {
				localModule.localExports = function (done, value) {
					return { value: value, done: !!done };
				};
			}, {}], 106: [function (localRequire, localModule, localExports) {
				localModule.localExports = {};
			}, {}], 107: [function (localRequire, localModule, localExports) {
				var getKeys = localRequire('./_object-keys')
					, toIObject = localRequire('./_to-iobject');
				localModule.localExports = function (object, el) {
					var O = toIObject(object)
						, keys = getKeys(O)
						, length = keys.length
						, index = 0
						, key;
					while (length > index) if (O[key = keys[index++]] === el) return key;
				};
			}, { "./_object-keys": 120, "./_to-iobject": 132 }], 108: [function (localRequire, localModule, localExports) {
				localModule.localExports = true;
			}, {}], 109: [function (localRequire, localModule, localExports) {
				var META = localRequire('./_uid')('meta')
					, isObject = localRequire('./_is-object')
					, has = localRequire('./_has')
					, setDesc = localRequire('./_object-dp').f
					, id = 0;
				var isExtensible = Object.isExtensible || function () {
					return true;
				};
				var FREEZE = !localRequire('./_fails')(function () {
					return isExtensible(Object.preventExtensions({}));
				});
				var setMeta = function (it) {
					setDesc(it, META, {
						value: {
							i: 'O' + ++id, // object ID
							w: {}          // weak collections IDs
						}
					});
				};
				var fastKey = function (it, create) {
					// return primitive with prefix
					if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
					if (!has(it, META)) {
						// can't set metadata to uncaught frozen object
						if (!isExtensible(it)) return 'F';
						// not necessary to add metadata
						if (!create) return 'E';
						// add missing metadata
						setMeta(it);
						// return object ID
					} return it[META].i;
				};
				var getWeak = function (it, create) {
					if (!has(it, META)) {
						// can't set metadata to uncaught frozen object
						if (!isExtensible(it)) return true;
						// not necessary to add metadata
						if (!create) return false;
						// add missing metadata
						setMeta(it);
						// return hash weak collections IDs
					} return it[META].w;
				};
				// add metadata on freeze-family methods calling
				var onFreeze = function (it) {
					if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
					return it;
				};
				var meta = localModule.localExports = {
					KEY: META,
					NEED: false,
					fastKey: fastKey,
					getWeak: getWeak,
					onFreeze: onFreeze
				};
			}, { "./_fails": 91, "./_has": 93, "./_is-object": 100, "./_object-dp": 112, "./_uid": 136 }], 110: [function (localRequire, localModule, localExports) {
				'use strict';
				// 19.1.2.1 Object.assign(target, source, ...)
				var getKeys = localRequire('./_object-keys')
					, gOPS = localRequire('./_object-gops')
					, pIE = localRequire('./_object-pie')
					, toObject = localRequire('./_to-object')
					, IObject = localRequire('./_iobject')
					, $assign = (<any>Object).assign;

				// should work with symbols and should have deterministic property order (V8 bug)
				localModule.localExports = !$assign || localRequire('./_fails')(function () {
					var A = {}
						, B = {}
						, S = Symbol()
						, K = 'abcdefghijklmnopqrst';
					A[S] = 7;
					K.split('').forEach(function (k) { B[k] = k; });
					return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
				}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
					var T = toObject(target)
						, aLen = arguments.length
						, index = 1
						, getSymbols = gOPS.f
						, isEnum = pIE.f;
					while (aLen > index) {
						var S = IObject(arguments[index++])
							, keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
							, length = keys.length
							, j = 0
							, key;
						while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
					} return T;
				} : $assign;
			}, { "./_fails": 91, "./_iobject": 97, "./_object-gops": 117, "./_object-keys": 120, "./_object-pie": 121, "./_to-object": 134 }], 111: [function (localRequire, localModule, localExports) {
				// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
				var anObject = localRequire('./_an-object')
					, dPs = localRequire('./_object-dps')
					, enumBugKeys = localRequire('./_enum-bug-keys')
					, IE_PROTO = localRequire('./_shared-key')('IE_PROTO')
					, Empty = function () { /* empty */ }
					, PROTOTYPE = 'prototype';

				// Create object with fake `null` prototype: use iframe Object with cleared prototype
				var createDict = function () {
					// Thrash, waste and sodomy: IE GC bug
					var iframe = localRequire('./_dom-create')('iframe')
						, i = enumBugKeys.length
						, lt = '<'
						, gt = '>'
						, iframeDocument;
					iframe.style.display = 'none';
					localRequire('./_html').appendChild(iframe);
					iframe.src = 'javascript:'; // eslint-disable-line no-script-url
					// createDict = iframe.contentWindow.Object;
					// html.removeChild(iframe);
					iframeDocument = iframe.contentWindow.document;
					iframeDocument.open();
					iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
					iframeDocument.close();
					createDict = iframeDocument.F;
					while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
					return createDict();
				};

				localModule.localExports = Object.create || function create(O, Properties) {
					var result;
					if (O !== null) {
						Empty[PROTOTYPE] = anObject(O);
						result = new Empty;
						Empty[PROTOTYPE] = null;
						// add "__proto__" for Object.getPrototypeOf polyfill
						result[IE_PROTO] = O;
					} else result = createDict();
					return Properties === undefined ? result : dPs(result, Properties);
				};

			}, { "./_an-object": 78, "./_dom-create": 87, "./_enum-bug-keys": 88, "./_html": 95, "./_object-dps": 113, "./_shared-key": 127 }], 112: [function (localRequire, localModule, localExports) {
				var anObject = localRequire('./_an-object')
					, IE8_DOM_DEFINE = localRequire('./_ie8-dom-define')
					, toPrimitive = localRequire('./_to-primitive')
					, dP = Object.defineProperty;

				localExports.f = localRequire('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {
					anObject(O);
					P = toPrimitive(P, true);
					anObject(Attributes);
					if (IE8_DOM_DEFINE) try {
						return dP(O, P, Attributes);
					} catch (e) { /* empty */ }
					if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
					if ('value' in Attributes) O[P] = Attributes.value;
					return O;
				};
			}, { "./_an-object": 78, "./_descriptors": 86, "./_ie8-dom-define": 96, "./_to-primitive": 135 }], 113: [function (localRequire, localModule, localExports) {
				var dP = localRequire('./_object-dp')
					, anObject = localRequire('./_an-object')
					, getKeys = localRequire('./_object-keys');

				localModule.localExports = localRequire('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {
					anObject(O);
					var keys = getKeys(Properties)
						, length = keys.length
						, i = 0
						, P;
					while (length > i) dP.f(O, P = keys[i++], Properties[P]);
					return O;
				};
			}, { "./_an-object": 78, "./_descriptors": 86, "./_object-dp": 112, "./_object-keys": 120 }], 114: [function (localRequire, localModule, localExports) {
				var pIE = localRequire('./_object-pie')
					, createDesc = localRequire('./_property-desc')
					, toIObject = localRequire('./_to-iobject')
					, toPrimitive = localRequire('./_to-primitive')
					, has = localRequire('./_has')
					, IE8_DOM_DEFINE = localRequire('./_ie8-dom-define')
					, gOPD = Object.getOwnPropertyDescriptor;

				localExports.f = localRequire('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {
					O = toIObject(O);
					P = toPrimitive(P, true);
					if (IE8_DOM_DEFINE) try {
						return gOPD(O, P);
					} catch (e) { /* empty */ }
					if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
				};
			}, { "./_descriptors": 86, "./_has": 93, "./_ie8-dom-define": 96, "./_object-pie": 121, "./_property-desc": 123, "./_to-iobject": 132, "./_to-primitive": 135 }], 115: [function (localRequire, localModule, localExports) {
				// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
				var toIObject = localRequire('./_to-iobject')
					, gOPN = localRequire('./_object-gopn').f
					, toString = {}.toString;

				var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
					? Object.getOwnPropertyNames(window) : [];

				var getWindowNames = function (it) {
					try {
						return gOPN(it);
					} catch (e) {
						return windowNames.slice();
					}
				};

				localModule.localExports.f = function getOwnPropertyNames(it) {
					return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
				};

			}, { "./_object-gopn": 116, "./_to-iobject": 132 }], 116: [function (localRequire, localModule, localExports) {
				// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
				var $keys = localRequire('./_object-keys-internal')
					, hiddenKeys = localRequire('./_enum-bug-keys').concat('length', 'prototype');

				localExports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
					return $keys(O, hiddenKeys);
				};
			}, { "./_enum-bug-keys": 88, "./_object-keys-internal": 119 }], 117: [function (localRequire, localModule, localExports) {
				localExports.f = (<any>Object).getOwnPropertySymbols;
			}, {}], 118: [function (localRequire, localModule, localExports) {
				// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
				var has = localRequire('./_has')
					, toObject = localRequire('./_to-object')
					, IE_PROTO = localRequire('./_shared-key')('IE_PROTO')
					, ObjectProto = Object.prototype;

				localModule.localExports = Object.getPrototypeOf || function (O) {
					O = toObject(O);
					if (has(O, IE_PROTO)) return O[IE_PROTO];
					if (typeof O.constructor == 'function' && O instanceof O.constructor) {
						return O.constructor.prototype;
					} return O instanceof Object ? ObjectProto : null;
				};
			}, { "./_has": 93, "./_shared-key": 127, "./_to-object": 134 }], 119: [function (localRequire, localModule, localExports) {
				var has = localRequire('./_has')
					, toIObject = localRequire('./_to-iobject')
					, arrayIndexOf = localRequire('./_array-includes')(false)
					, IE_PROTO = localRequire('./_shared-key')('IE_PROTO');

				localModule.localExports = function (object, names) {
					var O = toIObject(object)
						, i = 0
						, result = []
						, key;
					for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
					// Don't enum bug & hidden keys
					while (names.length > i) if (has(O, key = names[i++])) {
						~arrayIndexOf(result, key) || result.push(key);
					}
					return result;
				};
			}, { "./_array-includes": 79, "./_has": 93, "./_shared-key": 127, "./_to-iobject": 132 }], 120: [function (localRequire, localModule, localExports) {
				// 19.1.2.14 / 15.2.3.14 Object.keys(O)
				var $keys = localRequire('./_object-keys-internal')
					, enumBugKeys = localRequire('./_enum-bug-keys');

				localModule.localExports = Object.keys || function keys(O) {
					return $keys(O, enumBugKeys);
				};
			}, { "./_enum-bug-keys": 88, "./_object-keys-internal": 119 }], 121: [function (localRequire, localModule, localExports) {
				localExports.f = {}.propertyIsEnumerable;
			}, {}], 122: [function (localRequire, localModule, localExports) {
				// most Object methods by ES6 should accept primitives
				var $export = localRequire('./_export')
					, core = localRequire('./_core')
					, fails = localRequire('./_fails');
				localModule.localExports = function (KEY, exec) {
					var fn = (core.Object || {})[KEY] || Object[KEY]
						, exp = {};
					exp[KEY] = exec(fn);
					$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
				};
			}, { "./_core": 82, "./_export": 90, "./_fails": 91 }], 123: [function (localRequire, localModule, localExports) {
				localModule.localExports = function (bitmap, value) {
					return {
						enumerable: !(bitmap & 1),
						configurable: !(bitmap & 2),
						writable: !(bitmap & 4),
						value: value
					};
				};
			}, {}], 124: [function (localRequire, localModule, localExports) {
				localModule.localExports = localRequire('./_hide');
			}, { "./_hide": 94 }], 125: [function (localRequire, localModule, localExports) {
				// Works with __proto__ only. Old v8 can't work with null proto objects.
				/* eslint-disable no-proto */
				var isObject = localRequire('./_is-object')
					, anObject = localRequire('./_an-object');
				var check = function (O, proto) {
					anObject(O);
					if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
				};
				localModule.localExports = {
					set: (<any>Object).setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
						function (test, buggy, set?) {
							try {
								set = localRequire('./_ctx')(Function.call, localRequire('./_object-gopd').f(Object.prototype, '__proto__').set, 2);
								set(test, []);
								buggy = !(test instanceof Array);
							} catch (e) { buggy = true; }
							return function setPrototypeOf(O, proto) {
								check(O, proto);
								if (buggy) O.__proto__ = proto;
								else set(O, proto);
								return O;
							};
						} ({}, false) : undefined),
					check: check
				};
			}, { "./_an-object": 78, "./_ctx": 84, "./_is-object": 100, "./_object-gopd": 114 }], 126: [function (localRequire, localModule, localExports) {
				var def = localRequire('./_object-dp').f
					, has = localRequire('./_has')
					, TAG = localRequire('./_wks')('toStringTag');

				localModule.localExports = function (it, tag, stat) {
					if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
				};
			}, { "./_has": 93, "./_object-dp": 112, "./_wks": 139 }], 127: [function (localRequire, localModule, localExports) {
				var shared = localRequire('./_shared')('keys')
					, uid = localRequire('./_uid');
				localModule.localExports = function (key) {
					return shared[key] || (shared[key] = uid(key));
				};
			}, { "./_shared": 128, "./_uid": 136 }], 128: [function (localRequire, localModule, localExports) {
				var global = localRequire('./_global')
					, SHARED = '__core-js_shared__'
					, store = global[SHARED] || (global[SHARED] = {});
				localModule.localExports = function (key) {
					return store[key] || (store[key] = {});
				};
			}, { "./_global": 92 }], 129: [function (localRequire, localModule, localExports) {
				var toInteger = localRequire('./_to-integer')
					, defined = localRequire('./_defined');
				// true  -> String#at
				// false -> String#codePointAt
				localModule.localExports = function (TO_STRING) {
					return function (that, pos) {
						var s = String(defined(that))
							, i = toInteger(pos)
							, l = s.length
							, a, b;
						if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
						a = s.charCodeAt(i);
						return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
							? TO_STRING ? s.charAt(i) : a
							: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
					};
				};
			}, { "./_defined": 85, "./_to-integer": 131 }], 130: [function (localRequire, localModule, localExports) {
				var toInteger = localRequire('./_to-integer')
					, max = Math.max
					, min = Math.min;
				localModule.localExports = function (index, length) {
					index = toInteger(index);
					return index < 0 ? max(index + length, 0) : min(index, length);
				};
			}, { "./_to-integer": 131 }], 131: [function (localRequire, localModule, localExports) {
				// 7.1.4 ToInteger
				var ceil = Math.ceil
					, floor = Math.floor;
				localModule.localExports = function (it) {
					return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
				};
			}, {}], 132: [function (localRequire, localModule, localExports) {
				// to indexed object, toObject with fallback for non-array-like ES3 strings
				var IObject = localRequire('./_iobject')
					, defined = localRequire('./_defined');
				localModule.localExports = function (it) {
					return IObject(defined(it));
				};
			}, { "./_defined": 85, "./_iobject": 97 }], 133: [function (localRequire, localModule, localExports) {
				// 7.1.15 ToLength
				var toInteger = localRequire('./_to-integer')
					, min = Math.min;
				localModule.localExports = function (it) {
					return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
				};
			}, { "./_to-integer": 131 }], 134: [function (localRequire, localModule, localExports) {
				// 7.1.13 ToObject(argument)
				var defined = localRequire('./_defined');
				localModule.localExports = function (it) {
					return Object(defined(it));
				};
			}, { "./_defined": 85 }], 135: [function (localRequire, localModule, localExports) {
				// 7.1.1 ToPrimitive(input [, PreferredType])
				var isObject = localRequire('./_is-object');
				// instead of the ES6 spec version, we didn't implement @@toPrimitive case
				// and the second argument - flag - preferred type is a string
				localModule.localExports = function (it, S) {
					if (!isObject(it)) return it;
					var fn, val;
					if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
					if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
					if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
					throw TypeError("Can't convert object to primitive value");
				};
			}, { "./_is-object": 100 }], 136: [function (localRequire, localModule, localExports) {
				var id = 0
					, px = Math.random();
				localModule.localExports = function (key) {
					return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
				};
			}, {}], 137: [function (localRequire, localModule, localExports) {
				var global = localRequire('./_global')
					, core = localRequire('./_core')
					, LIBRARY = localRequire('./_library')
					, wksExt = localRequire('./_wks-ext')
					, defineProperty = localRequire('./_object-dp').f;
				localModule.localExports = function (name) {
					var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
					if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
				};
			}, { "./_core": 82, "./_global": 92, "./_library": 108, "./_object-dp": 112, "./_wks-ext": 138 }], 138: [function (localRequire, localModule, localExports) {
				localExports.f = localRequire('./_wks');
			}, { "./_wks": 139 }], 139: [function (localRequire, localModule, localExports) {
				var store = localRequire('./_shared')('wks')
					, uid = localRequire('./_uid')
					, Symbol = localRequire('./_global').Symbol
					, USE_SYMBOL = typeof Symbol == 'function';

				var $exports: any = localModule.localExports = function (name) {
					return store[name] || (store[name] =
						USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
				};

				$exports.store = store;
			}, { "./_global": 92, "./_shared": 128, "./_uid": 136 }], 140: [function (localRequire, localModule, localExports) {
				var classof = localRequire('./_classof')
					, ITERATOR = localRequire('./_wks')('iterator')
					, Iterators = localRequire('./_iterators');
				localModule.localExports = localRequire('./_core').getIteratorMethod = function (it) {
					if (it != undefined) return it[ITERATOR]
						|| it['@@iterator']
						|| Iterators[classof(it)];
				};
			}, { "./_classof": 80, "./_core": 82, "./_iterators": 106, "./_wks": 139 }], 141: [function (localRequire, localModule, localExports) {
				var anObject = localRequire('./_an-object')
					, get = localRequire('./core.get-iterator-method');
				localModule.localExports = localRequire('./_core').getIterator = function (it) {
					var iterFn = get(it);
					if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
					return anObject(iterFn.call(it));
				};
			}, { "./_an-object": 78, "./_core": 82, "./core.get-iterator-method": 140 }], 142: [function (localRequire, localModule, localExports) {
				var classof = localRequire('./_classof')
					, ITERATOR = localRequire('./_wks')('iterator')
					, Iterators = localRequire('./_iterators');
				localModule.localExports = localRequire('./_core').isIterable = function (it) {
					var O = Object(it);
					return O[ITERATOR] !== undefined
						|| '@@iterator' in O
						|| Iterators.hasOwnProperty(classof(O));
				};
			}, { "./_classof": 80, "./_core": 82, "./_iterators": 106, "./_wks": 139 }], 143: [function (localRequire, localModule, localExports) {
				'use strict';
				var ctx = localRequire('./_ctx')
					, $export = localRequire('./_export')
					, toObject = localRequire('./_to-object')
					, call = localRequire('./_iter-call')
					, isArrayIter = localRequire('./_is-array-iter')
					, toLength = localRequire('./_to-length')
					, createProperty = localRequire('./_create-property')
					, getIterFn = localRequire('./core.get-iterator-method');

				$export($export.S + $export.F * <any>!localRequire('./_iter-detect')(function (iter) { (<any>Array).from(iter); }), 'Array', {
					// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
					from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/) {
						var O = toObject(arrayLike)
							, C = typeof this == 'function' ? this : Array
							, aLen = arguments.length
							, mapfn = aLen > 1 ? arguments[1] : undefined
							, mapping = mapfn !== undefined
							, index = 0
							, iterFn = getIterFn(O)
							, length, result, step, iterator;
						if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
						// if object isn't iterable or it's array with default iterator - use simple case
						if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
							for (iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++) {
								createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
							}
						} else {
							length = toLength(O.length);
							for (result = new C(length); length > index; index++) {
								createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
							}
						}
						result.length = index;
						return result;
					}
				});

			}, { "./_create-property": 83, "./_ctx": 84, "./_export": 90, "./_is-array-iter": 98, "./_iter-call": 101, "./_iter-detect": 104, "./_to-length": 133, "./_to-object": 134, "./core.get-iterator-method": 140 }], 144: [function (localRequire, localModule, localExports) {
				'use strict';
				var addToUnscopables = localRequire('./_add-to-unscopables')
					, step = localRequire('./_iter-step')
					, Iterators = localRequire('./_iterators')
					, toIObject = localRequire('./_to-iobject');

				// 22.1.3.4 Array.prototype.entries()
				// 22.1.3.13 Array.prototype.keys()
				// 22.1.3.29 Array.prototype.values()
				// 22.1.3.30 Array.prototype[@@iterator]()
				localModule.localExports = localRequire('./_iter-define')(Array, 'Array', function (iterated, kind) {
					this._t = toIObject(iterated); // target
					this._i = 0;                   // next index
					this._k = kind;                // kind
					// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
				}, function () {
					var O = this._t
						, kind = this._k
						, index = this._i++;
					if (!O || index >= O.length) {
						this._t = undefined;
						return step(1);
					}
					if (kind == 'keys') return step(0, index);
					if (kind == 'values') return step(0, O[index]);
					return step(0, [index, O[index]]);
				}, 'values');

				// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
				Iterators.Arguments = Iterators.Array;

				addToUnscopables('keys');
				addToUnscopables('values');
				addToUnscopables('entries');
			}, { "./_add-to-unscopables": 77, "./_iter-define": 103, "./_iter-step": 105, "./_iterators": 106, "./_to-iobject": 132 }], 145: [function (localRequire, localModule, localExports) {
				// 19.1.3.1 Object.assign(target, source)
				var $export = localRequire('./_export');

				$export($export.S + $export.F, 'Object', { assign: localRequire('./_object-assign') });
			}, { "./_export": 90, "./_object-assign": 110 }], 146: [function (localRequire, localModule, localExports) {
				var $export = localRequire('./_export')
				// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
				$export($export.S, 'Object', { create: localRequire('./_object-create') });
			}, { "./_export": 90, "./_object-create": 111 }], 147: [function (localRequire, localModule, localExports) {
				var $export = localRequire('./_export');
				// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
				$export($export.S + $export.F * <any>!localRequire('./_descriptors'), 'Object', { defineProperties: localRequire('./_object-dps') });
			}, { "./_descriptors": 86, "./_export": 90, "./_object-dps": 113 }], 148: [function (localRequire, localModule, localExports) {
				var $export = localRequire('./_export');
				// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
				$export($export.S + $export.F * <any>!localRequire('./_descriptors'), 'Object', { defineProperty: localRequire('./_object-dp').f });
			}, { "./_descriptors": 86, "./_export": 90, "./_object-dp": 112 }], 149: [function (localRequire, localModule, localExports) {
				// 19.1.2.5 Object.freeze(O)
				var isObject = localRequire('./_is-object')
					, meta = localRequire('./_meta').onFreeze;

				localRequire('./_object-sap')('freeze', function ($freeze) {
					return function freeze(it) {
						return $freeze && isObject(it) ? $freeze(meta(it)) : it;
					};
				});
			}, { "./_is-object": 100, "./_meta": 109, "./_object-sap": 122 }], 150: [function (localRequire, localModule, localExports) {
				// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
				var toIObject = localRequire('./_to-iobject')
					, $getOwnPropertyDescriptor = localRequire('./_object-gopd').f;

				localRequire('./_object-sap')('getOwnPropertyDescriptor', function () {
					return function getOwnPropertyDescriptor(it, key) {
						return $getOwnPropertyDescriptor(toIObject(it), key);
					};
				});
			}, { "./_object-gopd": 114, "./_object-sap": 122, "./_to-iobject": 132 }], 151: [function (localRequire, localModule, localExports) {
				// 19.1.2.9 Object.getPrototypeOf(O)
				var toObject = localRequire('./_to-object')
					, $getPrototypeOf = localRequire('./_object-gpo');

				localRequire('./_object-sap')('getPrototypeOf', function () {
					return function getPrototypeOf(it) {
						return $getPrototypeOf(toObject(it));
					};
				});
			}, { "./_object-gpo": 118, "./_object-sap": 122, "./_to-object": 134 }], 152: [function (localRequire, localModule, localExports) {
				// 19.1.2.14 Object.keys(O)
				var toObject = localRequire('./_to-object')
					, $keys = localRequire('./_object-keys');

				localRequire('./_object-sap')('keys', function () {
					return function keys(it) {
						return $keys(toObject(it));
					};
				});
			}, { "./_object-keys": 120, "./_object-sap": 122, "./_to-object": 134 }], 153: [function (localRequire, localModule, localExports) {
				// 19.1.3.19 Object.setPrototypeOf(O, proto)
				var $export = localRequire('./_export');
				$export($export.S, 'Object', { setPrototypeOf: localRequire('./_set-proto').set });
			}, { "./_export": 90, "./_set-proto": 125 }], 154: [function (localRequire, localModule, localExports) {
				arguments[4][56][0].apply(localExports, arguments)
			}, { "dup": 56 }], 155: [function (localRequire, localModule, localExports) {
				'use strict';
				var $at = localRequire('./_string-at')(true);

				// 21.1.3.27 String.prototype[@@iterator]()
				localRequire('./_iter-define')(String, 'String', function (iterated) {
					this._t = String(iterated); // target
					this._i = 0;                // next index
					// 21.1.5.2.1 %StringIteratorPrototype%.next()
				}, function () {
					var O = this._t
						, index = this._i
						, point;
					if (index >= O.length) return { value: undefined, done: true };
					point = $at(O, index);
					this._i += point.length;
					return { value: point, done: false };
				});
			}, { "./_iter-define": 103, "./_string-at": 129 }], 156: [function (localRequire, localModule, localExports) {
				'use strict';
				// ECMAScript 6 symbols shim
				var global = localRequire('./_global')
					, has = localRequire('./_has')
					, DESCRIPTORS = localRequire('./_descriptors')
					, $export = localRequire('./_export')
					, redefine = localRequire('./_redefine')
					, META = localRequire('./_meta').KEY
					, $fails = localRequire('./_fails')
					, shared = localRequire('./_shared')
					, setToStringTag = localRequire('./_set-to-string-tag')
					, uid = localRequire('./_uid')
					, wks = localRequire('./_wks')
					, wksExt = localRequire('./_wks-ext')
					, wksDefine = localRequire('./_wks-define')
					, keyOf = localRequire('./_keyof')
					, enumKeys = localRequire('./_enum-keys')
					, isArray = localRequire('./_is-array')
					, anObject = localRequire('./_an-object')
					, toIObject = localRequire('./_to-iobject')
					, toPrimitive = localRequire('./_to-primitive')
					, createDesc = localRequire('./_property-desc')
					, _create = localRequire('./_object-create')
					, gOPNExt = localRequire('./_object-gopn-ext')
					, $GOPD = localRequire('./_object-gopd')
					, $DP = localRequire('./_object-dp')
					, $keys = localRequire('./_object-keys')
					, gOPD = $GOPD.f
					, dP = $DP.f
					, gOPN = gOPNExt.f
					, $Symbol = global.Symbol
					, $JSON = global.JSON
					, _stringify = $JSON && $JSON.stringify
					, PROTOTYPE = 'prototype'
					, HIDDEN = wks('_hidden')
					, TO_PRIMITIVE = wks('toPrimitive')
					, isEnum = {}.propertyIsEnumerable
					, SymbolRegistry = shared('symbol-registry')
					, AllSymbols = shared('symbols')
					, OPSymbols = shared('op-symbols')
					, ObjectProto = Object[PROTOTYPE]
					, USE_NATIVE = typeof $Symbol == 'function'
					, QObject = global.QObject;
				// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
				var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;

				// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
				var setSymbolDesc = DESCRIPTORS && $fails(function () {
					return _create(dP({}, 'a', {
						get: function () { return dP(this, 'a', { value: 7 }).a; }
					})).a != 7;
				}) ? function (it, key, D) {
					var protoDesc = gOPD(ObjectProto, key);
					if (protoDesc) delete ObjectProto[key];
					dP(it, key, D);
					if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
				} : dP;

				var wrap = function (tag) {
					var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
					sym._k = tag;
					return sym;
				};

				var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
					return typeof it == 'symbol';
				} : function (it) {
					return it instanceof $Symbol;
				};

				var $defineProperty = function defineProperty(it, key, D) {
					if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
					anObject(it);
					key = toPrimitive(key, true);
					anObject(D);
					if (has(AllSymbols, key)) {
						if (!D.enumerable) {
							if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
							it[HIDDEN][key] = true;
						} else {
							if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
							D = _create(D, { enumerable: createDesc(0, false) });
						} return setSymbolDesc(it, key, D);
					} return dP(it, key, D);
				};
				var $defineProperties = function defineProperties(it, P) {
					anObject(it);
					var keys = enumKeys(P = toIObject(P))
						, i = 0
						, l = keys.length
						, key;
					while (l > i) $defineProperty(it, key = keys[i++], P[key]);
					return it;
				};
				var $create = function create(it, P) {
					return P === undefined ? _create(it) : $defineProperties(_create(it), P);
				};
				var $propertyIsEnumerable = function propertyIsEnumerable(key) {
					var E = isEnum.call(this, key = toPrimitive(key, true));
					if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
					return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
				};
				var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
					it = toIObject(it);
					key = toPrimitive(key, true);
					if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
					var D = gOPD(it, key);
					if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
					return D;
				};
				var $getOwnPropertyNames = function getOwnPropertyNames(it) {
					var names = gOPN(toIObject(it))
						, result = []
						, i = 0
						, key;
					while (names.length > i) {
						if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
					} return result;
				};
				var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
					var IS_OP = it === ObjectProto
						, names = gOPN(IS_OP ? OPSymbols : toIObject(it))
						, result = []
						, i = 0
						, key;
					while (names.length > i) {
						if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
					} return result;
				};

				// 19.4.1.1 Symbol([description])
				if (!USE_NATIVE) {
					$Symbol = function Symbol() {
						if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
						var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
						var $set = function (value) {
							if (this === ObjectProto) $set.call(OPSymbols, value);
							if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
							setSymbolDesc(this, tag, createDesc(1, value));
						};
						if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
						return wrap(tag);
					};
					redefine($Symbol[PROTOTYPE], 'toString', function toString() {
						return this._k;
					});

					$GOPD.f = $getOwnPropertyDescriptor;
					$DP.f = $defineProperty;
					localRequire('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;
					localRequire('./_object-pie').f = $propertyIsEnumerable;
					localRequire('./_object-gops').f = $getOwnPropertySymbols;

					if (DESCRIPTORS && !localRequire('./_library')) {
						redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
					}

					wksExt.f = function (name) {
						return wrap(wks(name));
					}
				}

				$export($export.G + $export.W + $export.F * <any>!USE_NATIVE, { Symbol: $Symbol });

				for (var symbols: any = (
					// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
					'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
				).split(','), i = 0; symbols.length > i;)wks(symbols[i++]);

				for (var symbols = $keys(wks.store), i = 0; symbols.length > i;)wksDefine(symbols[i++]);

				$export($export.S + $export.F * <any>!USE_NATIVE, 'Symbol', {
					// 19.4.2.1 Symbol.for(key)
					'for': function (key) {
						return has(SymbolRegistry, key += '')
							? SymbolRegistry[key]
							: SymbolRegistry[key] = $Symbol(key);
					},
					// 19.4.2.5 Symbol.keyFor(sym)
					keyFor: function keyFor(key) {
						if (isSymbol(key)) return keyOf(SymbolRegistry, key);
						throw TypeError(key + ' is not a symbol!');
					},
					useSetter: function () { setter = true; },
					useSimple: function () { setter = false; }
				});

				$export($export.S + $export.F * <any>!USE_NATIVE, 'Object', {
					// 19.1.2.2 Object.create(O [, Properties])
					create: $create,
					// 19.1.2.4 Object.defineProperty(O, P, Attributes)
					defineProperty: $defineProperty,
					// 19.1.2.3 Object.defineProperties(O, Properties)
					defineProperties: $defineProperties,
					// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
					getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
					// 19.1.2.7 Object.getOwnPropertyNames(O)
					getOwnPropertyNames: $getOwnPropertyNames,
					// 19.1.2.8 Object.getOwnPropertySymbols(O)
					getOwnPropertySymbols: $getOwnPropertySymbols
				});

				// 24.3.2 JSON.stringify(value [, replacer [, space]])
				$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
					var S = $Symbol();
					// MS Edge converts symbol values to JSON as {}
					// WebKit converts symbol values to JSON as null
					// V8 throws on boxed symbols
					return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
				})), 'JSON', {
						stringify: function stringify(it) {
							if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
							var args = [it]
								, i = 1
								, replacer, $replacer;
							while (arguments.length > i) args.push(arguments[i++]);
							replacer = args[1];
							if (typeof replacer == 'function') $replacer = replacer;
							if ($replacer || !isArray(replacer)) replacer = function (key, value) {
								if ($replacer) value = $replacer.call(this, key, value);
								if (!isSymbol(value)) return value;
							};
							args[1] = replacer;
							return _stringify.apply($JSON, args);
						}
					});

				// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
				$Symbol[PROTOTYPE][TO_PRIMITIVE] || localRequire('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
				// 19.4.3.5 Symbol.prototype[@@toStringTag]
				setToStringTag($Symbol, 'Symbol');
				// 20.2.1.9 Math[@@toStringTag]
				setToStringTag(Math, 'Math', true);
				// 24.3.3 JSON[@@toStringTag]
				setToStringTag(global.JSON, 'JSON', true);
			}, { "./_an-object": 78, "./_descriptors": 86, "./_enum-keys": 89, "./_export": 90, "./_fails": 91, "./_global": 92, "./_has": 93, "./_hide": 94, "./_is-array": 99, "./_keyof": 107, "./_library": 108, "./_meta": 109, "./_object-create": 111, "./_object-dp": 112, "./_object-gopd": 114, "./_object-gopn": 116, "./_object-gopn-ext": 115, "./_object-gops": 117, "./_object-keys": 120, "./_object-pie": 121, "./_property-desc": 123, "./_redefine": 124, "./_set-to-string-tag": 126, "./_shared": 128, "./_to-iobject": 132, "./_to-primitive": 135, "./_uid": 136, "./_wks": 139, "./_wks-define": 137, "./_wks-ext": 138 }], 157: [function (localRequire, localModule, localExports) {
				localRequire('./_wks-define')('asyncIterator');
			}, { "./_wks-define": 137 }], 158: [function (localRequire, localModule, localExports) {
				localRequire('./_wks-define')('observable');
			}, { "./_wks-define": 137 }], 159: [function (localRequire, localModule, localExports) {
				localRequire('./es6.array.iterator');
				var global = localRequire('./_global')
					, hide = localRequire('./_hide')
					, Iterators = localRequire('./_iterators')
					, TO_STRING_TAG = localRequire('./_wks')('toStringTag');

				for (var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++) {
					var NAME = collections[i]
						, Collection = global[NAME]
						, proto = Collection && Collection.prototype;
					if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
					Iterators[NAME] = Iterators.Array;
				}
			}, { "./_global": 92, "./_hide": 94, "./_iterators": 106, "./_wks": 139, "./es6.array.iterator": 144 }], 160: [function (localRequire, localModule, localExports) {
				(function (Buffer) {
					// Copyright Joyent, Inc. and other Node contributors.
					//
					// Permission is hereby granted, free of charge, to any person obtaining a
					// copy of this software and associated documentation files (the
					// "Software"), to deal in the Software without restriction, including
					// without limitation the rights to use, copy, modify, merge, publish,
					// distribute, sublicense, and/or sell copies of the Software, and to permit
					// persons to whom the Software is furnished to do so, subject to the
					// following conditions:
					//
					// The above copyright notice and this permission notice shall be included
					// in all copies or substantial portions of the Software.
					//
					// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
					// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
					// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
					// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
					// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
					// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
					// USE OR OTHER DEALINGS IN THE SOFTWARE.

					// NOTE: These type checking functions intentionally don't use `instanceof`
					// because it is fragile and can be easily faked with `Object.create()`.

					function isArray(arg) {
						if (Array.isArray) {
							return Array.isArray(arg);
						}
						return objectToString(arg) === '[object Array]';
					}
					localExports.isArray = isArray;

					function isBoolean(arg) {
						return typeof arg === 'boolean';
					}
					localExports.isBoolean = isBoolean;

					function isNull(arg) {
						return arg === null;
					}
					localExports.isNull = isNull;

					function isNullOrUndefined(arg) {
						return arg == null;
					}
					localExports.isNullOrUndefined = isNullOrUndefined;

					function isNumber(arg) {
						return typeof arg === 'number';
					}
					localExports.isNumber = isNumber;

					function isString(arg) {
						return typeof arg === 'string';
					}
					localExports.isString = isString;

					function isSymbol(arg) {
						return typeof arg === 'symbol';
					}
					localExports.isSymbol = isSymbol;

					function isUndefined(arg) {
						return arg === void 0;
					}
					localExports.isUndefined = isUndefined;

					function isRegExp(re) {
						return objectToString(re) === '[object RegExp]';
					}
					localExports.isRegExp = isRegExp;

					function isObject(arg) {
						return typeof arg === 'object' && arg !== null;
					}
					localExports.isObject = isObject;

					function isDate(d) {
						return objectToString(d) === '[object Date]';
					}
					localExports.isDate = isDate;

					function isError(e) {
						return (objectToString(e) === '[object Error]' || e instanceof Error);
					}
					localExports.isError = isError;

					function isFunction(arg) {
						return typeof arg === 'function';
					}
					localExports.isFunction = isFunction;

					function isPrimitive(arg) {
						return arg === null ||
							typeof arg === 'boolean' ||
							typeof arg === 'number' ||
							typeof arg === 'string' ||
							typeof arg === 'symbol' ||  // ES6 symbol
							typeof arg === 'undefined';
					}
					localExports.isPrimitive = isPrimitive;

					localExports.isBuffer = Buffer.isBuffer;

					function objectToString(o) {
						return Object.prototype.toString.call(o);
					}

				}).call(this, { "isBuffer": localRequire("../../is-buffer/index.js") })

			}, { "../../is-buffer/index.js": 168 }],
			//161: [function (localRequire, localModule, localExports) {
			//	var pSlice = Array.prototype.slice;
			//	var objectKeys = localRequire('./lib/keys.js');
			//	var isArguments = localRequire('./lib/is_arguments.js');

			//	var deepEqual = localModule.localExports = function (actual, expected, opts) {
			//		if (!opts) opts = {};
			//		// 7.1. All identical values are equivalent, as determined by ===.
			//		if (actual === expected) {
			//			return true;

			//		} else if (actual instanceof Date && expected instanceof Date) {
			//			return actual.getTime() === expected.getTime();

			//			// 7.3. Other pairs that do not both pass typeof value == 'object',
			//			// equivalence is determined by ==.
			//		} else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {
			//			return opts.strict ? actual === expected : actual == expected;

			//			// 7.4. For all other Object pairs, including Array objects, equivalence is
			//			// determined by having the same number of owned properties (as verified
			//			// with Object.prototype.hasOwnProperty.call), the same set of keys
			//			// (although not necessarily the same order), equivalent values for every
			//			// corresponding key, and an identical 'prototype' property. Note: this
			//			// accounts for both named and indexed properties on Arrays.
			//		} else {
			//			return objEquiv(actual, expected, opts);
			//		}
			//	}

			//	function isUndefinedOrNull(value) {
			//		return value === null || value === undefined;
			//	}

			//	function isBuffer(x) {
			//		if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;
			//		if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
			//			return false;
			//		}
			//		if (x.length > 0 && typeof x[0] !== 'number') return false;
			//		return true;
			//	}

			//	function objEquiv(a, b, opts) {
			//		var i, key;
			//		if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
			//			return false;
			//		// an identical 'prototype' property.
			//		if (a.prototype !== b.prototype) return false;
			//		//~~~I've managed to break Object.keys through screwy arguments passing.
			//		//   Converting to array solves the problem.
			//		if (isArguments(a)) {
			//			if (!isArguments(b)) {
			//				return false;
			//			}
			//			a = pSlice.call(a);
			//			b = pSlice.call(b);
			//			return deepEqual(a, b, opts);
			//		}
			//		if (isBuffer(a)) {
			//			if (!isBuffer(b)) {
			//				return false;
			//			}
			//			if (a.length !== b.length) return false;
			//			for (i = 0; i < a.length; i++) {
			//				if (a[i] !== b[i]) return false;
			//			}
			//			return true;
			//		}
			//		try {
			//			var ka = objectKeys(a),
			//				kb = objectKeys(b);
			//		} catch (e) {//happens when one is a string literal and the other isn't
			//			return false;
			//		}
			//		// having the same number of owned properties (keys incorporates
			//		// hasOwnProperty)
			//		if (ka.length != kb.length)
			//			return false;
			//		//the same set of keys (although not necessarily the same order),
			//		ka.sort();
			//		kb.sort();
			//		//~~~cheap key test
			//		for (i = ka.length - 1; i >= 0; i--) {
			//			if (ka[i] != kb[i])
			//				return false;
			//		}
			//		//equivalent values for every corresponding key, and
			//		//~~~possibly expensive deep test
			//		for (i = ka.length - 1; i >= 0; i--) {
			//			key = ka[i];
			//			if (!deepEqual(a[key], b[key], opts)) return false;
			//		}
			//		return typeof a === typeof b;
			//	}

			//}, { "./lib/is_arguments.js": 162, "./lib/keys.js": 163 }], 162: [function (localRequire, localModule, localExports) {
			//	var supportsArgumentsClass = (function () {
			//		return Object.prototype.toString.call(arguments)
			//	})() == '[object Arguments]';

			//	localExports = localModule.localExports = supportsArgumentsClass ? supported : unsupported;

			//	localExports.supported = supported;
			//	function supported(object) {
			//		return Object.prototype.toString.call(object) == '[object Arguments]';
			//	};

			//	localExports.unsupported = unsupported;
			//	function unsupported(object) {
			//		return object &&
			//			typeof object == 'object' &&
			//			typeof object.length == 'number' &&
			//			Object.prototype.hasOwnProperty.call(object, 'callee') &&
			//			!Object.prototype.propertyIsEnumerable.call(object, 'callee') ||
			//			false;
			//	};

			//}, {}], 163: [function (localRequire, localModule, localExports) {
			//	localExports = localModule.localExports = typeof Object.keys === 'function'
			//		? Object.keys : shim;

			//	localExports.shim = shim;
			//	function shim(obj) {
			//		var keys = [];
			//		for (var key in obj) keys.push(key);
			//		return keys;
			//	}

			//}, {}],
			164: [function (localRequire, localModule, localExports) {
				// Copyright Joyent, Inc. and other Node contributors.
				//
				// Permission is hereby granted, free of charge, to any person obtaining a
				// copy of this software and associated documentation files (the
				// "Software"), to deal in the Software without restriction, including
				// without limitation the rights to use, copy, modify, merge, publish,
				// distribute, sublicense, and/or sell copies of the Software, and to permit
				// persons to whom the Software is furnished to do so, subject to the
				// following conditions:
				//
				// The above copyright notice and this permission notice shall be included
				// in all copies or substantial portions of the Software.
				//
				// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
				// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
				// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
				// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
				// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
				// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
				// USE OR OTHER DEALINGS IN THE SOFTWARE.

				function EventEmitter() {
					this._events = this._events || {};
					this._maxListeners = this._maxListeners || undefined;
				}
				localModule.localExports = EventEmitter;

				// Backwards-compat with node 0.10.x
				(<any>EventEmitter).EventEmitter = EventEmitter;

				EventEmitter.prototype._events = undefined;
				EventEmitter.prototype._maxListeners = undefined;

				// By default EventEmitters will print a warning if more than 10 listeners are
				// added to it. This is a useful default which helps finding memory leaks.
				(<any>EventEmitter).defaultMaxListeners = 10;

				// Obviously not all Emitters should be limited to 10. This function allows
				// that to be increased. Set to zero for unlimited.
				EventEmitter.prototype.setMaxListeners = function (n) {
					if (!isNumber(n) || n < 0 || isNaN(n))
						throw TypeError('n must be a positive number');
					this._maxListeners = n;
					return this;
				};

				EventEmitter.prototype.emit = function (type) {
					var er, handler, len, args, i, listeners;

					if (!this._events)
						this._events = {};

					// If there is no 'error' event listener then throw.
					if (type === 'error') {
						if (!this._events.error ||
							(isObject(this._events.error) && !this._events.error.length)) {
							er = arguments[1];
							if (er instanceof Error) {
								throw er; // Unhandled 'error' event
							} else {
								// At least give some kind of context to the user
								var err: any = new Error('Uncaught, unspecified "error" event. (' + er + ')');
								err.context = er;
								throw err;
							}
						}
					}

					handler = this._events[type];

					if (isUndefined(handler))
						return false;

					if (isFunction(handler)) {
						switch (arguments.length) {
							// fast cases
							case 1:
								handler.call(this);
								break;
							case 2:
								handler.call(this, arguments[1]);
								break;
							case 3:
								handler.call(this, arguments[1], arguments[2]);
								break;
							// slower
							default:
								args = Array.prototype.slice.call(arguments, 1);
								handler.apply(this, args);
						}
					} else if (isObject(handler)) {
						args = Array.prototype.slice.call(arguments, 1);
						listeners = handler.slice();
						len = listeners.length;
						for (i = 0; i < len; i++)
							listeners[i].apply(this, args);
					}

					return true;
				};

				EventEmitter.prototype.addListener = function (type, listener) {
					var m;

					if (!isFunction(listener))
						throw TypeError('listener must be a function');

					if (!this._events)
						this._events = {};

					// To avoid recursion in the case that type === "newListener"! Before
					// adding it to the listeners, first emit "newListener".
					if (this._events.newListener)
						this.emit('newListener', type,
							isFunction(listener.listener) ?
								listener.listener : listener);

					if (!this._events[type])
						// Optimize the case of one listener. Don't need the extra array object.
						this._events[type] = listener;
					else if (isObject(this._events[type]))
						// If we've already got an array, just append.
						this._events[type].push(listener);
					else
						// Adding the second element, need to change to array.
						this._events[type] = [this._events[type], listener];

					// Check for listener leak
					if (isObject(this._events[type]) && !this._events[type].warned) {
						if (!isUndefined(this._maxListeners)) {
							m = this._maxListeners;
						} else {
							m = (<any>EventEmitter).defaultMaxListeners;
						}

						if (m && m > 0 && this._events[type].length > m) {
							this._events[type].warned = true;
							console.error('(node) warning: possible EventEmitter memory ' +
								'leak detected. %d listeners added. ' +
								'Use emitter.setMaxListeners() to increase limit.',
								this._events[type].length);
							if (typeof console.trace === 'function') {
								// not supported in IE 10
								console.trace();
							}
						}
					}

					return this;
				};

				EventEmitter.prototype.on = EventEmitter.prototype.addListener;

				EventEmitter.prototype.once = function (type, listener) {
					if (!isFunction(listener))
						throw TypeError('listener must be a function');

					var fired = false;

					function g() {
						this.removeListener(type, g);

						if (!fired) {
							fired = true;
							listener.apply(this, arguments);
						}
					}

					(<any>g).listener = listener;
					this.on(type, g);

					return this;
				};

				// emits a 'removeListener' event iff the listener was removed
				EventEmitter.prototype.removeListener = function (type, listener) {
					var list, position, length, i;

					if (!isFunction(listener))
						throw TypeError('listener must be a function');

					if (!this._events || !this._events[type])
						return this;

					list = this._events[type];
					length = list.length;
					position = -1;

					if (list === listener ||
						(isFunction(list.listener) && list.listener === listener)) {
						delete this._events[type];
						if (this._events.removeListener)
							this.emit('removeListener', type, listener);

					} else if (isObject(list)) {
						for (i = length; i-- > 0;) {
							if (list[i] === listener ||
								(list[i].listener && list[i].listener === listener)) {
								position = i;
								break;
							}
						}

						if (position < 0)
							return this;

						if (list.length === 1) {
							list.length = 0;
							delete this._events[type];
						} else {
							list.splice(position, 1);
						}

						if (this._events.removeListener)
							this.emit('removeListener', type, listener);
					}

					return this;
				};

				EventEmitter.prototype.removeAllListeners = function (type) {
					var key, listeners;

					if (!this._events)
						return this;

					// not listening for removeListener, no need to emit
					if (!this._events.removeListener) {
						if (arguments.length === 0)
							this._events = {};
						else if (this._events[type])
							delete this._events[type];
						return this;
					}

					// emit removeListener for all listeners on all events
					if (arguments.length === 0) {
						for (key in this._events) {
							if (key === 'removeListener') continue;
							this.removeAllListeners(key);
						}
						this.removeAllListeners('removeListener');
						this._events = {};
						return this;
					}

					listeners = this._events[type];

					if (isFunction(listeners)) {
						this.removeListener(type, listeners);
					} else if (listeners) {
						// LIFO order
						while (listeners.length)
							this.removeListener(type, listeners[listeners.length - 1]);
					}
					delete this._events[type];

					return this;
				};

				EventEmitter.prototype.listeners = function (type) {
					var ret;
					if (!this._events || !this._events[type])
						ret = [];
					else if (isFunction(this._events[type]))
						ret = [this._events[type]];
					else
						ret = this._events[type].slice();
					return ret;
				};

				EventEmitter.prototype.listenerCount = function (type) {
					if (this._events) {
						var evlistener = this._events[type];

						if (isFunction(evlistener))
							return 1;
						else if (evlistener)
							return evlistener.length;
					}
					return 0;
				};

				(<any>EventEmitter).listenerCount = function (emitter, type) {
					return emitter.listenerCount(type);
				};

				function isFunction(arg) {
					return typeof arg === 'function';
				}

				function isNumber(arg) {
					return typeof arg === 'number';
				}

				function isObject(arg) {
					return typeof arg === 'object' && arg !== null;
				}

				function isUndefined(arg) {
					return arg === void 0;
				}

			}, {}], 165: [function (localRequire, localModule, localExports) {
				(function (process, Buffer) {
					'use strict';

					function _interopDefault(ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

					var r = _interopDefault(localRequire('restructure'));
					var fs;
					var _Object$getOwnPropertyDescriptor = _interopDefault(localRequire('babel-runtime/core-js/object/get-own-property-descriptor'));
					//var _getIterator = _interopDefault(localRequire('babel-runtime/core-js/get-iterator'));
					var _Object$freeze = _interopDefault(localRequire('babel-runtime/core-js/object/freeze'));
					var _Object$keys = _interopDefault(localRequire('babel-runtime/core-js/object/keys'));
					var _typeof = _interopDefault(localRequire('babel-runtime/helpers/typeof'));
					var _Object$defineProperty = _interopDefault(localRequire('babel-runtime/core-js/object/define-property'));
					var _classCallCheck = _interopDefault(localRequire('babel-runtime/helpers/classCallCheck'));
					var _createClass = _interopDefault(localRequire('babel-runtime/helpers/createClass'));
					var _Object$getPrototypeOf = _interopDefault(localRequire('babel-runtime/core-js/object/get-prototype-of'));
					var _possibleConstructorReturn = _interopDefault(localRequire('babel-runtime/helpers/possibleConstructorReturn'));
					var _inherits = _interopDefault(localRequire('babel-runtime/helpers/inherits'));
					//var restructure_src_utils = localRequire('restructure/src/utils');
					var _Object$defineProperties = _interopDefault(localRequire('babel-runtime/core-js/object/define-properties'));
					//var isEqual = _interopDefault(localRequire('deep-equal'));
					var _get = _interopDefault(localRequire('babel-runtime/helpers/get'));
					var _Object$assign = _interopDefault(localRequire('babel-runtime/core-js/object/assign'));
					var _toConsumableArray = _interopDefault(localRequire('babel-runtime/helpers/toConsumableArray'));
					var unicode = _interopDefault(localRequire('unicode-properties'));
					var _slicedToArray = _interopDefault(localRequire('babel-runtime/helpers/slicedToArray'));
					//var UnicodeTrie = _interopDefault(localRequire('unicode-trie'));
					var cloneDeep = _interopDefault(localRequire('clone'));
					//var inflate = _interopDefault(localRequire('tiny-inflate'));
					//var brotli = _interopDefault(localRequire('brotli/decompress'));



					var fontkit: any = {};
					fontkit.logErrors = false;

					var formats = [];
					fontkit.registerFormat = function (format) {
						formats.push(format);
					};

					//fontkit.openSync = function (filename, postscriptName) {
					//	var buffer = fs.readFileSync(filename);
					//	return fontkit.create(buffer, postscriptName);
					//};

					//fontkit.open = function (filename, postscriptName, callback) {
					//	if (typeof postscriptName === 'function') {
					//		callback = postscriptName;
					//		postscriptName = null;
					//	}

					//	fs.readFile(filename, function (err, buffer) {
					//		if (err) {
					//			return callback(err);
					//		}

					//		try {
					//			var font = fontkit.create(buffer, postscriptName);
					//		} catch (e) {
					//			return callback(e);
					//		}

					//		return callback(null, font);
					//	});

					//	return;
					//};

					fontkit.create = function (buffer, postscriptName) {
						for (var i = 0; i < formats.length; i++) {
							var format = formats[i];
							if (format.probe(buffer)) {
								var font = new format(new r.DecodeStream(buffer));
								if (postscriptName) {
									return font.getFont(postscriptName);
								}

								return font;
							}
						}

						throw new Error('Unknown font format');
					};

					/**
					 * This decorator caches the results of a getter such that
					 * the results are lazily computed once, and then cached.
					 * @private
					 */
					function cache(target, key, descriptor) {
						var get = descriptor.get;
						descriptor.get = function () {
							var value = get.call(this);
							_Object$defineProperty(this, key, { value: value });
							return value;
						};
					}

					var SubHeader = new r.Struct({
						firstCode: r.uint16,
						entryCount: r.uint16,
						idDelta: r.int16,
						idRangeOffset: r.uint16
					});

					var CmapGroup = new r.Struct({
						startCharCode: r.uint32,
						endCharCode: r.uint32,
						glyphID: r.uint32
					});

					var UnicodeValueRange = new r.Struct({
						startUnicodeValue: r.uint24,
						additionalCount: r.uint8
					});

					var UVSMapping = new r.Struct({
						unicodeValue: r.uint24,
						glyphID: r.uint16
					});

					//var DefaultUVS = new r.Array(UnicodeValueRange, r.uint32);
					//var NonDefaultUVS = new r.Array(UVSMapping, r.uint32);

					//var VarSelectorRecord = new r.Struct({
					//	varSelector: r.uint24,
					//	defaultUVS: new r.Pointer(r.uint32, DefaultUVS, { type: 'parent' }),
					//	nonDefaultUVS: new r.Pointer(r.uint32, NonDefaultUVS, { type: 'parent' })
					//});

					var CmapSubtable = new r.VersionedStruct(r.uint16, {
						0: { // Byte encoding
							length: r.uint16, // Total table length in bytes (set to 262 for format 0)
							language: r.uint16, // Language code for this encoding subtable, or zero if language-independent
							codeMap: new r.LazyArray(r.uint8, 256)
						},

						2: { // High-byte mapping (CJK)
							length: r.uint16,
							language: r.uint16,
							subHeaderKeys: new r.Array(r.uint16, 256),
							subHeaderCount: function subHeaderCount(t) {
								return Math.max.apply(Math, t.subHeaderKeys);
							},
							subHeaders: new r.LazyArray(SubHeader, 'subHeaderCount'),
							glyphIndexArray: new r.LazyArray(r.uint16, 'subHeaderCount')
						},

						4: { // Segment mapping to delta values
							length: r.uint16, // Total table length in bytes
							language: r.uint16, // Language code
							segCountX2: r.uint16,
							segCount: function segCount(t) {
								return t.segCountX2 >> 1;
							},
							searchRange: r.uint16,
							entrySelector: r.uint16,
							rangeShift: r.uint16,
							endCode: new r.LazyArray(r.uint16, 'segCount'),
							reservedPad: new r.Reserved(r.uint16), // This value should be zero
							startCode: new r.LazyArray(r.uint16, 'segCount'),
							idDelta: new r.LazyArray(r.int16, 'segCount'),
							idRangeOffset: new r.LazyArray(r.uint16, 'segCount'),
							glyphIndexArray: new r.LazyArray(r.uint16, function (t) {
								return (t.length - t._currentOffset) / 2;
							})
						},

						6: { // Trimmed table
							length: r.uint16,
							language: r.uint16,
							firstCode: r.uint16,
							entryCount: r.uint16,
							glyphIndices: new r.LazyArray(r.uint16, 'entryCount')
						},

						8: { // mixed 16-bit and 32-bit coverage
							reserved: new r.Reserved(r.uint16),
							length: r.uint32,
							language: r.uint16,
							is32: new r.LazyArray(r.uint8, 8192),
							nGroups: r.uint32,
							groups: new r.LazyArray(CmapGroup, 'nGroups')
						},

						10: { // Trimmed Array
							reserved: new r.Reserved(r.uint16),
							length: r.uint32,
							language: r.uint32,
							firstCode: r.uint32,
							entryCount: r.uint32,
							glyphIndices: new r.LazyArray(r.uint16, 'numChars')
						},

						12: { // Segmented coverage
							reserved: new r.Reserved(r.uint16),
							length: r.uint32,
							language: r.uint32,
							nGroups: r.uint32,
							groups: new r.LazyArray(CmapGroup, 'nGroups')
						},

						13: { // Many-to-one range mappings (same as 12 except for group.startGlyphID)
							reserved: new r.Reserved(r.uint16),
							length: r.uint32,
							language: r.uint32,
							nGroups: r.uint32,
							groups: new r.LazyArray(CmapGroup, 'nGroups')
						}
						//,

						//14: { // Unicode Variation Sequences
						//	length: r.uint32,
						//	numRecords: r.uint32,
						//	varSelectors: new r.LazyArray(VarSelectorRecord, 'numRecords')
						//}
					});

					var CmapEntry = new r.Struct({
						platformID: r.uint16, // Platform identifier
						encodingID: r.uint16, // Platform-specific encoding identifier
						table: new r.Pointer(r.uint32, CmapSubtable, { type: 'parent', lazy: true })
					});

					// character to glyph mapping
					var cmap = new r.Struct({
						version: r.uint16,
						numSubtables: r.uint16,
						tables: new r.Array(CmapEntry, 'numSubtables')
					});

					// font header
					var head = new r.Struct({
						version: r.int32, // 0x00010000 (version 1.0)
						revision: r.int32, // set by font manufacturer
						checkSumAdjustment: r.uint32,
						magicNumber: r.uint32, // set to 0x5F0F3CF5
						flags: r.uint16,
						unitsPerEm: r.uint16, // range from 64 to 16384
						created: new r.Array(r.int32, 2),
						modified: new r.Array(r.int32, 2),
						xMin: r.int16, // for all glyph bounding boxes
						yMin: r.int16, // for all glyph bounding boxes
						xMax: r.int16, // for all glyph bounding boxes
						yMax: r.int16, // for all glyph bounding boxes
						macStyle: new r.Bitfield(r.uint16, ['bold', 'italic', 'underline', 'outline', 'shadow', 'condensed', 'extended']),
						lowestRecPPEM: r.uint16, // smallest readable size in pixels
						fontDirectionHint: r.int16,
						indexToLocFormat: r.int16, // 0 for short offsets, 1 for long
						glyphDataFormat: r.int16 // 0 for current format
					});

					// horizontal header
					var hhea = new r.Struct({
						version: r.int32,
						ascent: r.int16, // Distance from baseline of highest ascender
						descent: r.int16, // Distance from baseline of lowest descender
						lineGap: r.int16, // Typographic line gap
						advanceWidthMax: r.uint16, // Maximum advance width value in 'hmtx' table
						minLeftSideBearing: r.int16, // Maximum advance width value in 'hmtx' table
						minRightSideBearing: r.int16, // Minimum right sidebearing value
						xMaxExtent: r.int16,
						caretSlopeRise: r.int16, // Used to calculate the slope of the cursor (rise/run); 1 for vertical
						caretSlopeRun: r.int16, // 0 for vertical
						caretOffset: r.int16, // Set to 0 for non-slanted fonts
						reserved: new r.Reserved(r.int16, 4),
						metricDataFormat: r.int16, // 0 for current format
						numberOfMetrics: r.uint16 // Number of advance widths in 'hmtx' table
					});

					var HmtxEntry = new r.Struct({
						advance: r.uint16,
						bearing: r.int16
					});

					var hmtx = new r.Struct({
						metrics: new r.LazyArray(HmtxEntry, function (t) {
							return t.parent.hhea.numberOfMetrics;
						}),
						bearings: new r.LazyArray(r.int16, function (t) {
							return t.parent.maxp.numGlyphs - t.parent.hhea.numberOfMetrics;
						})
					});

					// maxiumum profile
					var maxp = new r.Struct({
						version: r.int32,
						numGlyphs: r.uint16, // The number of glyphs in the font
						maxPoints: r.uint16, // Maximum points in a non-composite glyph
						maxContours: r.uint16, // Maximum contours in a non-composite glyph
						maxComponentPoints: r.uint16, // Maximum points in a composite glyph
						maxComponentContours: r.uint16, // Maximum contours in a composite glyph
						maxZones: r.uint16, // 1 if instructions do not use the twilight zone, 2 otherwise
						maxTwilightPoints: r.uint16, // Maximum points used in Z0
						maxStorage: r.uint16, // Number of Storage Area locations
						maxFunctionDefs: r.uint16, // Number of FDEFs
						maxInstructionDefs: r.uint16, // Number of IDEFs
						maxStackElements: r.uint16, // Maximum stack depth
						maxSizeOfInstructions: r.uint16, // Maximum byte count for glyph instructions
						maxComponentElements: r.uint16, // Maximum number of components referenced at вЂњtop levelвЂќ for any composite glyph
						maxComponentDepth: r.uint16 // Maximum levels of recursion; 1 for simple components
					});

					var NameRecord = new r.Struct({
						platformID: r.uint16,
						encodingID: r.uint16,
						languageID: r.uint16,
						nameID: r.uint16,
						length: r.uint16,
						string: new r.Pointer(r.uint16, new r.String('length', function (t) {
							return ENCODINGS[t.platformID][t.encodingID];
						}), { type: 'parent', relativeTo: 'parent.stringOffset', allowNull: false })
					});

					var LangTagRecord = new r.Struct({
						length: r.uint16,
						tag: new r.Pointer(r.uint16, new r.String('length', 'utf16be'), { type: 'parent', relativeTo: 'stringOffset' })
					});

					var NameTable = new r.VersionedStruct(r.uint16, {
						0: {
							count: r.uint16,
							stringOffset: r.uint16,
							records: new r.Array(NameRecord, 'count')
						},
						1: {
							count: r.uint16,
							stringOffset: r.uint16,
							records: new r.Array(NameRecord, 'count'),
							langTagCount: r.uint16,
							langTags: new r.Array(LangTagRecord, 'langTagCount')
						}
					});

					var NAMES = ['copyright', 'fontFamily', 'fontSubfamily', 'uniqueSubfamily', 'fullName', 'version', 'postscriptName', // Note: A font may have only one PostScript name and that name must be ASCII.
						'trademark', 'manufacturer', 'designer', 'description', 'vendorURL', 'designerURL', 'license', 'licenseURL', null, // reserved
						'preferredFamily', 'preferredSubfamily', 'compatibleFull', 'sampleText', 'postscriptCIDFontName', 'wwsFamilyName', 'wwsSubfamilyName'];

					var ENCODINGS = [
						// unicode
						['utf16be', 'utf16be', 'utf16be', 'utf16be', 'utf16be', 'utf16be'],

						// macintosh
						// Mappings available at http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/
						// 0	  Roman                 17	Malayalam
						// 1	  Japanese	            18	Sinhalese
						// 2	  Traditional Chinese	  19	Burmese
						// 3	  Korean	              20	Khmer
						// 4	  Arabic	              21	Thai
						// 5	  Hebrew	              22	Laotian
						// 6	  Greek	                23	Georgian
						// 7	  Russian	              24	Armenian
						// 8	  RSymbol	              25	Simplified Chinese
						// 9	  Devanagari	          26	Tibetan
						// 10	Gurmukhi	            27	Mongolian
						// 11	Gujarati	            28	Geez
						// 12	Oriya	                29	Slavic
						// 13	Bengali	              30	Vietnamese
						// 14	Tamil	                31	Sindhi
						// 15	Telugu	              32	(Uninterpreted)
						// 16	Kannada
						['macroman', 'shift-jis', 'big5', 'euc-kr', 'iso-8859-6', 'iso-8859-8', 'macgreek', 'maccyrillic', 'symbol', 'Devanagari', 'Gurmukhi', 'Gujarati', 'Oriya', 'Bengali', 'Tamil', 'Telugu', 'Kannada', 'Malayalam', 'Sinhalese', 'Burmese', 'Khmer', 'macthai', 'Laotian', 'Georgian', 'Armenian', 'gb-2312-80', 'Tibetan', 'Mongolian', 'Geez', 'maccyrillic', 'Vietnamese', 'Sindhi'],

						// ISO (deprecated)
						['ascii'],

						// windows
						// Docs here: http://msdn.microsoft.com/en-us/library/system.text.encoding(v=vs.110).aspx
						['symbol', 'utf16be', 'shift-jis', 'gb18030', 'big5', 'wansung', 'johab', null, null, null, 'ucs-4']];

					var LANGUAGES = [
						// unicode
						[], { // macintosh
							0: "English", 59: "Pashto",
							1: "French", 60: "Kurdish",
							2: "German", 61: "Kashmiri",
							3: "Italian", 62: "Sindhi",
							4: "Dutch", 63: "Tibetan",
							5: "Swedish", 64: "Nepali",
							6: "Spanish", 65: "Sanskrit",
							7: "Danish", 66: "Marathi",
							8: "Portuguese", 67: "Bengali",
							9: "Norwegian", 68: "Assamese",
							10: "Hebrew", 69: "Gujarati",
							11: "Japanese", 70: "Punjabi",
							12: "Arabic", 71: "Oriya",
							13: "Finnish", 72: "Malayalam",
							14: "Greek", 73: "Kannada",
							15: "Icelandic", 74: "Tamil",
							16: "Maltese", 75: "Telugu",
							17: "Turkish", 76: "Sinhalese",
							18: "Croatian", 77: "Burmese",
							19: "Chinese (Traditional)", 78: "Khmer",
							20: "Urdu", 79: "Lao",
							21: "Hindi", 80: "Vietnamese",
							22: "Thai", 81: "Indonesian",
							23: "Korean", 82: "Tagalong",
							24: "Lithuanian", 83: "Malay (Roman script)",
							25: "Polish", 84: "Malay (Arabic script)",
							26: "Hungarian", 85: "Amharic",
							27: "Estonian", 86: "Tigrinya",
							28: "Latvian", 87: "Galla",
							29: "Sami", 88: "Somali",
							30: "Faroese", 89: "Swahili",
							31: "Farsi/Persian", 90: "Kinyarwanda/Ruanda",
							32: "Russian", 91: "Rundi",
							33: "Chinese (Simplified)", 92: "Nyanja/Chewa",
							34: "Flemish", 93: "Malagasy",
							35: "Irish Gaelic", 94: "Esperanto",
							36: "Albanian", 128: "Welsh",
							37: "Romanian", 129: "Basque",
							38: "Czech", 130: "Catalan",
							39: "Slovak", 131: "Latin",
							40: "Slovenian", 132: "Quenchua",
							41: "Yiddish", 133: "Guarani",
							42: "Serbian", 134: "Aymara",
							43: "Macedonian", 135: "Tatar",
							44: "Bulgarian", 136: "Uighur",
							45: "Ukrainian", 137: "Dzongkha",
							46: "Byelorussian", 138: "Javanese (Roman script)",
							47: "Uzbek", 139: "Sundanese (Roman script)",
							48: "Kazakh", 140: "Galician",
							49: "Azerbaijani (Cyrillic script)", 141: "Afrikaans",
							50: "Azerbaijani (Arabic script)", 142: "Breton",
							51: "Armenian", 143: "Inuktitut",
							52: "Georgian", 144: "Scottish Gaelic",
							53: "Moldavian", 145: "Manx Gaelic",
							54: "Kirghiz", 146: "Irish Gaelic (with dot above)",
							55: "Tajiki", 147: "Tongan",
							56: "Turkmen", 148: "Greek (polytonic)",
							57: "Mongolian (Mongolian script)", 149: "Greenlandic",
							58: "Mongolian (Cyrillic script)", 150: "Azerbaijani (Roman script)"
						},

						// ISO (deprecated)
						[], { // windows
							0x0436: "Afrikaans", 0x0453: "Khmer",
							0x041C: "Albanian", 0x0486: "K'iche",
							0x0484: "Alsatian", 0x0487: "Kinyarwanda",
							0x045E: "Amharic", 0x0441: "Kiswahili",
							0x1401: "Arabic", 0x0457: "Konkani",
							0x3C01: "Arabic", 0x0412: "Korean",
							0x0C01: "Arabic", 0x0440: "Kyrgyz",
							0x0801: "Arabic", 0x0454: "Lao",
							0x2C01: "Arabic", 0x0426: "Latvian",
							0x3401: "Arabic", 0x0427: "Lithuanian",
							0x3001: "Arabic", 0x082E: "Lower Sorbian",
							0x1001: "Arabic", 0x046E: "Luxembourgish",
							0x1801: "Arabic", 0x042F: "Macedonian (FYROM)",
							0x2001: "Arabic", 0x083E: "Malay",
							0x4001: "Arabic", 0x043E: "Malay",
							0x0401: "Arabic", 0x044C: "Malayalam",
							0x2801: "Arabic", 0x043A: "Maltese",
							0x1C01: "Arabic", 0x0481: "Maori",
							0x3801: "Arabic", 0x047A: "Mapudungun",
							0x2401: "Arabic", 0x044E: "Marathi",
							0x042B: "Armenian", 0x047C: "Mohawk",
							0x044D: "Assamese", 0x0450: "Mongolian (Cyrillic)",
							0x082C: "Azeri (Cyrillic)", 0x0850: "Mongolian (Traditional)",
							0x042C: "Azeri (Latin)", 0x0461: "Nepali",
							0x046D: "Bashkir", 0x0414: "Norwegian (Bokmal)",
							0x042D: "Basque", 0x0814: "Norwegian (Nynorsk)",
							0x0423: "Belarusian", 0x0482: "Occitan",
							0x0845: "Bengali", 0x0448: "Odia (formerly Oriya)",
							0x0445: "Bengali", 0x0463: "Pashto",
							0x201A: "Bosnian (Cyrillic)", 0x0415: "Polish",
							0x141A: "Bosnian (Latin)", 0x0416: "Portuguese",
							0x047E: "Breton", 0x0816: "Portuguese",
							0x0402: "Bulgarian", 0x0446: "Punjabi",
							0x0403: "Catalan", 0x046B: "Quechua",
							0x0C04: "Chinese", 0x086B: "Quechua",
							0x1404: "Chinese", 0x0C6B: "Quechua",
							0x0804: "Chinese", 0x0418: "Romanian",
							0x1004: "Chinese", 0x0417: "Romansh",
							0x0404: "Chinese", 0x0419: "Russian",
							0x0483: "Corsican", 0x243B: "Sami (Inari)",
							0x041A: "Croatian", 0x103B: "Sami (Lule)",
							0x101A: "Croatian (Latin)", 0x143B: "Sami (Lule)",
							0x0405: "Czech", 0x0C3B: "Sami (Northern)",
							0x0406: "Danish", 0x043B: "Sami (Northern)",
							0x048C: "Dari", 0x083B: "Sami (Northern)",
							0x0465: "Divehi", 0x203B: "Sami (Skolt)",
							0x0813: "Dutch", 0x183B: "Sami (Southern)",
							0x0413: "Dutch", 0x1C3B: "Sami (Southern)",
							0x0C09: "English", 0x044F: "Sanskrit",
							0x2809: "English", 0x1C1A: "Serbian (Cyrillic)",
							0x1009: "English", 0x0C1A: "Serbian (Cyrillic)",
							0x2409: "English", 0x181A: "Serbian (Latin)",
							0x4009: "English", 0x081A: "Serbian (Latin)",
							0x1809: "English", 0x046C: "Sesotho sa Leboa",
							0x2009: "English", 0x0432: "Setswana",
							0x4409: "English", 0x045B: "Sinhala",
							0x1409: "English", 0x041B: "Slovak",
							0x3409: "English", 0x0424: "Slovenian",
							0x4809: "English", 0x2C0A: "Spanish",
							0x1C09: "English", 0x400A: "Spanish",
							0x2C09: "English", 0x340A: "Spanish",
							0x0809: "English", 0x240A: "Spanish",
							0x0409: "English", 0x140A: "Spanish",
							0x3009: "English", 0x1C0A: "Spanish",
							0x0425: "Estonian", 0x300A: "Spanish",
							0x0438: "Faroese", 0x440A: "Spanish",
							0x0464: "Filipino", 0x100A: "Spanish",
							0x040B: "Finnish", 0x480A: "Spanish",
							0x080C: "French", 0x080A: "Spanish",
							0x0C0C: "French", 0x4C0A: "Spanish",
							0x040C: "French", 0x180A: "Spanish",
							0x140c: "French", 0x3C0A: "Spanish",
							0x180C: "French", 0x280A: "Spanish",
							0x100C: "French", 0x500A: "Spanish",
							0x0462: "Frisian", 0x0C0A: "Spanish (Modern Sort)",
							0x0456: "Galician", 0x040A: "Spanish (Traditional Sort)",
							0x0437: "Georgian", 0x540A: "Spanish",
							0x0C07: "German", 0x380A: "Spanish",
							0x0407: "German", 0x200A: "Spanish",
							0x1407: "German", 0x081D: "Sweden",
							0x1007: "German", 0x041D: "Swedish",
							0x0807: "German", 0x045A: "Syriac",
							0x0408: "Greek", 0x0428: "Tajik (Cyrillic)",
							0x046F: "Greenlandic", 0x085F: "Tamazight (Latin)",
							0x0447: "Gujarati", 0x0449: "Tamil",
							0x0468: "Hausa (Latin)", 0x0444: "Tatar",
							0x040D: "Hebrew", 0x044A: "Telugu",
							0x0439: "Hindi", 0x041E: "Thai",
							0x040E: "Hungarian", 0x0451: "Tibetan",
							0x040F: "Icelandic", 0x041F: "Turkish",
							0x0470: "Igbo", 0x0442: "Turkmen",
							0x0421: "Indonesian", 0x0480: "Uighur",
							0x045D: "Inuktitut", 0x0422: "Ukrainian",
							0x085D: "Inuktitut (Latin)", 0x042E: "Upper Sorbian",
							0x083C: "Irish", 0x0420: "Urdu",
							0x0434: "isiXhosa", 0x0843: "Uzbek (Cyrillic)",
							0x0435: "isiZulu", 0x0443: "Uzbek (Latin)",
							0x0410: "Italian", 0x042A: "Vietnamese",
							0x0810: "Italian", 0x0452: "Welsh",
							0x0411: "Japanese", 0x0488: "Wolof",
							0x044B: "Kannada", 0x0485: "Yakut",
							0x043F: "Kazakh", 0x0478: "Yi",
							0x046A: "Yoruba"
						}];

					NameTable.process = function (stream) {
						var records: any = {};
						for (var i = 0, keys = Object.keys(this.records); i < keys.length; i++) {
							var record = this.records[keys[i]];

							// find out what language this is for
							var language = LANGUAGES[record.platformID][record.languageID];

							if (language == null && this.langTags != null && record.languageID >= 0x8000) {
								language = this.langTags[record.languageID - 0x8000].tag;
							}

							if (language == null) {
								language = record.platformID + '-' + record.languageID;
							}

							// check for reserved nameIDs
							// if (20 <= record.nameID && record.nameID <= 255) {
							//   throw new Error(`Reserved nameID ${record.nameID}`);
							// }

							// if the nameID is >= 256, it is a font feature record (AAT)
							if (record.nameID >= 256) {
								if (records.fontFeatures == null) { records.fontFeatures = {}; }
								let feature = records.fontFeatures[language] != null ? records.fontFeatures[language] : (records.fontFeatures[language] = {});
								feature[record.nameID] = record.string;
							} else {
								let key = NAMES[record.nameID] || record.nameID;
								if (records[key] == null) { records[key] = {}; }
								records[key][language] = record.string;
							}
						}

						this.records = records;
					};

					NameTable.preEncode = function () {
						if (Array.isArray(this.records)) return;
						this.version = 0;

						var records = [];
						for (var key in this.records) {
							var val = this.records[key];
							if (key === 'fontFeatures') continue;

							records.push({
								platformID: 3,
								encodingID: 1,
								languageID: 0x409,
								nameID: NAMES.indexOf(key),
								length: Buffer.byteLength(val.English, 'utf16le'),
								string: val.English
							});

							if (key === 'postscriptName') {
								records.push({
									platformID: 1,
									encodingID: 0,
									languageID: 0,
									nameID: NAMES.indexOf(key),
									length: val.English.length,
									string: val.English
								});
							}
						}

						this.records = records;
						this.count = records.length;
						this.stringOffset = localModule.localExports.size(this, null, false);
					};

					var OS2 = new r.VersionedStruct(r.uint16, {
						header: {
							xAvgCharWidth: r.int16, // average weighted advance width of lower case letters and space
							usWeightClass: r.uint16, // visual weight of stroke in glyphs
							usWidthClass: r.uint16, // relative change from the normal aspect ratio (width to height ratio)
							fsType: new r.Bitfield(r.uint16, [// Indicates font embedding licensing rights
								null, 'noEmbedding', 'viewOnly', 'editable', null, null, null, null, 'noSubsetting', 'bitmapOnly']),
							ySubscriptXSize: r.int16, // recommended horizontal size in pixels for subscripts
							ySubscriptYSize: r.int16, // recommended vertical size in pixels for subscripts
							ySubscriptXOffset: r.int16, // recommended horizontal offset for subscripts
							ySubscriptYOffset: r.int16, // recommended vertical offset form the baseline for subscripts
							ySuperscriptXSize: r.int16, // recommended horizontal size in pixels for superscripts
							ySuperscriptYSize: r.int16, // recommended vertical size in pixels for superscripts
							ySuperscriptXOffset: r.int16, // recommended horizontal offset for superscripts
							ySuperscriptYOffset: r.int16, // recommended vertical offset from the baseline for superscripts
							yStrikeoutSize: r.int16, // width of the strikeout stroke
							yStrikeoutPosition: r.int16, // position of the strikeout stroke relative to the baseline
							sFamilyClass: r.int16, // classification of font-family design
							panose: new r.Array(r.uint8, 10), // describe the visual characteristics of a given typeface
							ulCharRange: new r.Array(r.uint32, 4),
							vendorID: new r.String(4), // four character identifier for the font vendor
							fsSelection: new r.Bitfield(r.uint16, [// bit field containing information about the font
								'italic', 'underscore', 'negative', 'outlined', 'strikeout', 'bold', 'regular', 'useTypoMetrics', 'wws', 'oblique']),
							usFirstCharIndex: r.uint16, // The minimum Unicode index in this font
							usLastCharIndex: r.uint16 // The maximum Unicode index in this font
						},

						// The Apple version of this table ends here, but the Microsoft one continues on...
						0: {},

						1: {
							typoAscender: r.int16,
							typoDescender: r.int16,
							typoLineGap: r.int16,
							winAscent: r.uint16,
							winDescent: r.uint16,
							codePageRange: new r.Array(r.uint32, 2)
						},

						2: {
							// these should be common with version 1 somehow
							typoAscender: r.int16,
							typoDescender: r.int16,
							typoLineGap: r.int16,
							winAscent: r.uint16,
							winDescent: r.uint16,
							codePageRange: new r.Array(r.uint32, 2),

							xHeight: r.int16,
							capHeight: r.int16,
							defaultChar: r.uint16,
							breakChar: r.uint16,
							maxContent: r.uint16
						},

						5: {
							typoAscender: r.int16,
							typoDescender: r.int16,
							typoLineGap: r.int16,
							winAscent: r.uint16,
							winDescent: r.uint16,
							codePageRange: new r.Array(r.uint32, 2),

							xHeight: r.int16,
							capHeight: r.int16,
							defaultChar: r.uint16,
							breakChar: r.uint16,
							maxContent: r.uint16,

							usLowerOpticalPointSize: r.uint16,
							usUpperOpticalPointSize: r.uint16
						}
					});

					var versions = OS2.versions;
					versions[3] = versions[4] = versions[2];

					// PostScript information
					var post = new r.VersionedStruct(r.fixed32, {
						header: { // these fields exist at the top of all versions
							italicAngle: r.fixed32, // Italic angle in counter-clockwise degrees from the vertical.
							underlinePosition: r.int16, // Suggested distance of the top of the underline from the baseline
							underlineThickness: r.int16, // Suggested values for the underline thickness
							isFixedPitch: r.uint32, // Whether the font is monospaced
							minMemType42: r.uint32, // Minimum memory usage when a TrueType font is downloaded as a Type 42 font
							maxMemType42: r.uint32, // Maximum memory usage when a TrueType font is downloaded as a Type 42 font
							minMemType1: r.uint32, // Minimum memory usage when a TrueType font is downloaded as a Type 1 font
							maxMemType1: r.uint32 // Maximum memory usage when a TrueType font is downloaded as a Type 1 font
						},

						1: {}, // version 1 has no additional fields

						2: {
							numberOfGlyphs: r.uint16,
							glyphNameIndex: new r.Array(r.uint16, 'numberOfGlyphs'),
							names: new r.Array(new r.String(r.uint8))
						},

						2.5: {
							numberOfGlyphs: r.uint16,
							offsets: new r.Array(r.uint8, 'numberOfGlyphs')
						},

						3: {}, // version 3 has no additional fields

						4: {
							map: new r.Array(r.uint32, function (t) {
								return t.parent.maxp.numGlyphs;
							})
						}
					});

					//// An array of predefined values accessible by instructions
					//var cvt = new r.Struct({
					//	controlValues: new r.Array(r.int16)
					//});

					//// A list of instructions that are executed once when a font is first used.
					//// These instructions are known as the font program. The main use of this table
					//// is for the definition of functions that are used in many different glyph programs.
					//var fpgm = new r.Struct({
					//	instructions: new r.Array(r.uint8)
					//});

					var loca = new r.VersionedStruct('head.indexToLocFormat', {
						0: {
							offsets: new r.Array(r.uint16)
						},
						1: {
							offsets: new r.Array(r.uint32)
						}
					});

					loca.process = function () {
						if (this.version === 0) {
							for (var i = 0; i < this.offsets.length; i++) {
								this.offsets[i] <<= 1;
							}
						}
					};

					loca.preEncode = function () {
						if (this.version != null) return;

						// assume this.offsets is a sorted array
						this.version = this.offsets[this.offsets.length - 1] > 0xffff ? 1 : 0;

						if (this.version === 0) {
							for (var i = 0; i < this.offsets.length; i++) {
								this.offsets[i] >>>= 1;
							}
						}
					};

					//// Set of instructions executed whenever the point size or font transformation change
					//var prep = new r.Struct({
					//	controlValueProgram: new r.Array(r.uint8)
					//});

					// only used for encoding
					var glyf = new r.Array(new r.Buffer());

					//var CFFIndex: (...args) => void = function () {
					//	function CFFIndex(type) {
					//		_classCallCheck(this, CFFIndex);

					//		this.type = type;
					//	}

					//	_createClass(CFFIndex, [{
					//		key: "decode",
					//		value: function decode(stream, parent) {
					//			var count = stream.readUInt16BE();
					//			if (count === 0) {
					//				return [];
					//			}

					//			var offSize = stream.readUInt8();
					//			var offsetType = void 0;
					//			if (offSize === 1) {
					//				offsetType = r.uint8;
					//			} else if (offSize === 2) {
					//				offsetType = r.uint16;
					//			} else if (offSize === 3) {
					//				offsetType = r.uint24;
					//			} else if (offSize === 4) {
					//				offsetType = r.uint32;
					//			} else {
					//				throw new Error("Bad offset size in CFFIndex: " + offSize + " " + stream.pos);
					//			}

					//			var ret = [];
					//			var startPos = stream.pos + (count + 1) * offSize - 1;

					//			var start = offsetType.decode(stream);
					//			for (var i = 0; i < count; i++) {
					//				var end = offsetType.decode(stream);

					//				if (this.type != null) {
					//					var pos = stream.pos;
					//					stream.pos = startPos + start;

					//					parent.length = end - start;
					//					ret.push(this.type.decode(stream, parent));
					//					stream.pos = pos;
					//				} else {
					//					ret.push({
					//						offset: startPos + start,
					//						length: end - start
					//					});
					//				}

					//				start = end;
					//			}

					//			stream.pos = startPos + start;
					//			return ret;
					//		}
					//	}, {
					//			key: "size",
					//			value: function size(arr, parent) {
					//				var size = 2;
					//				if (arr.length === 0) {
					//					return size;
					//				}

					//				var type = this.type || new r.Buffer();

					//				// find maximum offset to detminine offset type
					//				var offset = 1;
					//				for (var i = 0; i < arr.length; i++) {
					//					var item = arr[i];
					//					offset += type.size(item, parent);
					//				}

					//				var offsetType = void 0;
					//				if (offset <= 0xff) {
					//					offsetType = r.uint8;
					//				} else if (offset <= 0xffff) {
					//					offsetType = r.uint16;
					//				} else if (offset <= 0xffffff) {
					//					offsetType = r.uint24;
					//				} else if (offset <= 0xffffffff) {
					//					offsetType = r.uint32;
					//				} else {
					//					throw new Error("Bad offset in CFFIndex");
					//				}

					//				size += 1 + offsetType.size() * (arr.length + 1);
					//				size += offset - 1;

					//				return size;
					//			}
					//		}, {
					//			key: "encode",
					//			value: function encode(stream, arr, parent) {
					//				stream.writeUInt16BE(arr.length);
					//				if (arr.length === 0) {
					//					return;
					//				}

					//				var type = this.type || new r.Buffer();

					//				// find maximum offset to detminine offset type
					//				var sizes = [];
					//				var offset = 1;
					//				var _iteratorNormalCompletion = true;
					//				var _didIteratorError = false;
					//				var _iteratorError = undefined;

					//				try {
					//					for (var _iterator = _getIterator(arr), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
					//						var item = _step.value;

					//						var s = type.size(item, parent);
					//						sizes.push(s);
					//						offset += s;
					//					}
					//				} catch (err) {
					//					_didIteratorError = true;
					//					_iteratorError = err;
					//				} finally {
					//					try {
					//						if (!_iteratorNormalCompletion && _iterator.return) {
					//							_iterator.return();
					//						}
					//					} finally {
					//						if (_didIteratorError) {
					//							throw _iteratorError;
					//						}
					//					}
					//				}

					//				var offsetType = void 0;
					//				if (offset <= 0xff) {
					//					offsetType = r.uint8;
					//				} else if (offset <= 0xffff) {
					//					offsetType = r.uint16;
					//				} else if (offset <= 0xffffff) {
					//					offsetType = r.uint24;
					//				} else if (offset <= 0xffffffff) {
					//					offsetType = r.uint32;
					//				} else {
					//					throw new Error("Bad offset in CFFIndex");
					//				}

					//				// write offset size
					//				stream.writeUInt8(offsetType.size());

					//				// write elements
					//				offset = 1;
					//				offsetType.encode(stream, offset);

					//				var _iteratorNormalCompletion2 = true;
					//				var _didIteratorError2 = false;
					//				var _iteratorError2 = undefined;

					//				try {
					//					for (var _iterator2 = _getIterator(sizes), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
					//						var size = _step2.value;

					//						offset += size;
					//						offsetType.encode(stream, offset);
					//					}
					//				} catch (err) {
					//					_didIteratorError2 = true;
					//					_iteratorError2 = err;
					//				} finally {
					//					try {
					//						if (!_iteratorNormalCompletion2 && _iterator2.return) {
					//							_iterator2.return();
					//						}
					//					} finally {
					//						if (_didIteratorError2) {
					//							throw _iteratorError2;
					//						}
					//					}
					//				}

					//				var _iteratorNormalCompletion3 = true;
					//				var _didIteratorError3 = false;
					//				var _iteratorError3 = undefined;

					//				try {
					//					for (var _iterator3 = _getIterator(arr), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
					//						var _item = _step3.value;

					//						type.encode(stream, _item, parent);
					//					}
					//				} catch (err) {
					//					_didIteratorError3 = true;
					//					_iteratorError3 = err;
					//				} finally {
					//					try {
					//						if (!_iteratorNormalCompletion3 && _iterator3.return) {
					//							_iterator3.return();
					//						}
					//					} finally {
					//						if (_didIteratorError3) {
					//							throw _iteratorError3;
					//						}
					//					}
					//				}

					//				return;
					//			}
					//		}]);

					//	return CFFIndex;
					//} ();

					//var FLOAT_EOF = 0xf;
					//var FLOAT_LOOKUP = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', 'E', 'E-', null, '-'];

					//var FLOAT_ENCODE_LOOKUP = {
					//	'.': 10,
					//	'E': 11,
					//	'E-': 12,
					//	'-': 14
					//};

					//var CFFOperand: any = function () {
					//	function CFFOperand() {
					//		_classCallCheck(this, CFFOperand);
					//	}

					//	_createClass(CFFOperand, null, [{
					//		key: 'decode',
					//		value: function decode(stream, value) {
					//			if (32 <= value && value <= 246) {
					//				return value - 139;
					//			}

					//			if (247 <= value && value <= 250) {
					//				return (value - 247) * 256 + stream.readUInt8() + 108;
					//			}

					//			if (251 <= value && value <= 254) {
					//				return -(value - 251) * 256 - stream.readUInt8() - 108;
					//			}

					//			if (value === 28) {
					//				return stream.readInt16BE();
					//			}

					//			if (value === 29) {
					//				return stream.readInt32BE();
					//			}

					//			if (value === 30) {
					//				var str = '';
					//				while (true) {
					//					var b = stream.readUInt8();

					//					var n1 = b >> 4;
					//					if (n1 === FLOAT_EOF) {
					//						break;
					//					}
					//					str += FLOAT_LOOKUP[n1];

					//					var n2 = b & 15;
					//					if (n2 === FLOAT_EOF) {
					//						break;
					//					}
					//					str += FLOAT_LOOKUP[n2];
					//				}

					//				return parseFloat(str);
					//			}

					//			return null;
					//		}
					//	}, {
					//			key: 'size',
					//			value: function size(value) {
					//				// if the value needs to be forced to the largest size (32 bit)
					//				// e.g. for unknown pointers, set to 32768
					//				if (value.forceLarge) {
					//					value = 32768;
					//				}

					//				if ((value | 0) !== value) {
					//					// floating point
					//					var str = '' + value;
					//					return 1 + Math.ceil((str.length + 1) / 2);
					//				} else if (-107 <= value && value <= 107) {
					//					return 1;
					//				} else if (108 <= value && value <= 1131 || -1131 <= value && value <= -108) {
					//					return 2;
					//				} else if (-32768 <= value && value <= 32767) {
					//					return 3;
					//				} else {
					//					return 5;
					//				}
					//			}
					//		}, {
					//			key: 'encode',
					//			value: function encode(stream, value) {
					//				// if the value needs to be forced to the largest size (32 bit)
					//				// e.g. for unknown pointers, save the old value and set to 32768
					//				var val = Number(value);

					//				if (value.forceLarge) {
					//					stream.writeUInt8(29);
					//					return stream.writeInt32BE(val);
					//				} else if ((val | 0) !== val) {
					//					// floating point
					//					stream.writeUInt8(30);

					//					var str = '' + val;
					//					for (var i = 0; i < str.length; i += 2) {
					//						var c1 = str[i];
					//						var n1 = FLOAT_ENCODE_LOOKUP[c1] || +c1;

					//						if (i === str.length - 1) {
					//							var n2: any = FLOAT_EOF;
					//						} else {
					//							var c2 = str[i + 1];
					//							var n2 = FLOAT_ENCODE_LOOKUP[c2] || +c2;
					//						}

					//						stream.writeUInt8(n1 << 4 | n2 & 15);
					//					}

					//					if (n2 !== FLOAT_EOF) {
					//						return stream.writeUInt8(FLOAT_EOF << 4);
					//					}
					//				} else if (-107 <= val && val <= 107) {
					//					return stream.writeUInt8(val + 139);
					//				} else if (108 <= val && val <= 1131) {
					//					val -= 108;
					//					stream.writeUInt8((val >> 8) + 247);
					//					return stream.writeUInt8(val & 0xff);
					//				} else if (-1131 <= val && val <= -108) {
					//					val = -val - 108;
					//					stream.writeUInt8((val >> 8) + 251);
					//					return stream.writeUInt8(val & 0xff);
					//				} else if (-32768 <= val && val <= 32767) {
					//					stream.writeUInt8(28);
					//					return stream.writeInt16BE(val);
					//				} else {
					//					stream.writeUInt8(29);
					//					return stream.writeInt32BE(val);
					//				}
					//			}
					//		}]);

					//	return CFFOperand;
					//} ();

					//var CFFDict: (...args) => void = function () {
					//	function CFFDict() {
					//		var ops = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];

					//		_classCallCheck(this, CFFDict);

					//		this.ops = ops;
					//		this.fields = {};
					//		var _iteratorNormalCompletion = true;
					//		var _didIteratorError = false;
					//		var _iteratorError = undefined;

					//		try {
					//			for (var _iterator = _getIterator(ops), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
					//				var field = _step.value;

					//				var key = Array.isArray(field[0]) ? field[0][0] << 8 | field[0][1] : field[0];
					//				this.fields[key] = field;
					//			}
					//		} catch (err) {
					//			_didIteratorError = true;
					//			_iteratorError = err;
					//		} finally {
					//			try {
					//				if (!_iteratorNormalCompletion && _iterator.return) {
					//					_iterator.return();
					//				}
					//			} finally {
					//				if (_didIteratorError) {
					//					throw _iteratorError;
					//				}
					//			}
					//		}
					//	}

					//	_createClass(CFFDict, [{
					//		key: 'decodeOperands',
					//		value: function decodeOperands(type, stream, ret, operands) {
					//			var _this = this;

					//			if (Array.isArray(type)) {
					//				return operands.map(function (op, i) {
					//					return _this.decodeOperands(type[i], stream, ret, [op]);
					//				});
					//			} else if (type.decode != null) {
					//				return type.decode(stream, ret, operands);
					//			} else {
					//				switch (type) {
					//					case 'number':
					//					case 'offset':
					//					case 'sid':
					//						return operands[0];
					//					case 'boolean':
					//						return !!operands[0];
					//					default:
					//						return operands;
					//				}
					//			}
					//		}
					//	}, {
					//			key: 'encodeOperands',
					//			value: function encodeOperands(type, stream, ctx, operands) {
					//				var _this2 = this;

					//				if (Array.isArray(type)) {
					//					return operands.map(function (op, i) {
					//						return _this2.encodeOperands(type[i], stream, ctx, op)[0];
					//					});
					//				} else if (type.encode != null) {
					//					return type.encode(stream, operands, ctx);
					//				} else if (typeof operands === 'number') {
					//					return [operands];
					//				} else if (typeof operands === 'boolean') {
					//					return [+operands];
					//				} else if (Array.isArray(operands)) {
					//					return operands;
					//				} else {
					//					return [operands];
					//				}
					//			}
					//		}, {
					//			key: 'decode',
					//			value: function decode(stream, parent) {
					//				var end = stream.pos + parent.length;
					//				var ret = {};
					//				var operands = [];

					//				// define hidden properties
					//				_Object$defineProperties(ret, {
					//					parent: { value: parent },
					//					_startOffset: { value: stream.pos }
					//				});

					//				// fill in defaults
					//				for (var key in this.fields) {
					//					var field = this.fields[key];
					//					ret[field[1]] = field[3];
					//				}

					//				while (stream.pos < end) {
					//					var b = stream.readUInt8();
					//					if (b <= 21) {
					//						if (b === 12) {
					//							b = b << 8 | stream.readUInt8();
					//						}

					//						var _field = this.fields[b];
					//						if (!_field) {
					//							throw new Error('Unknown operator ' + b);
					//						}

					//						var val = this.decodeOperands(_field[2], stream, ret, operands);
					//						if (val != null) {
					//							if (val instanceof restructure_src_utils.PropertyDescriptor) {
					//								_Object$defineProperty(ret, _field[1], val);
					//							} else {
					//								ret[_field[1]] = val;
					//							}
					//						}

					//						operands = [];
					//					} else {
					//						operands.push(CFFOperand.decode(stream, b));
					//					}
					//				}

					//				return ret;
					//			}
					//		}, {
					//			key: 'size',
					//			value: function size(dict, parent) {
					//				var includePointers = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];

					//				var ctx = {
					//					parent: parent,
					//					val: dict,
					//					pointerSize: 0,
					//					startOffset: parent.startOffset || 0
					//				};

					//				var len = 0;

					//				for (var k in this.fields) {
					//					var field = this.fields[k];
					//					var val = dict[field[1]];
					//					if (val == null || isEqual(val, field[3])) {
					//						continue;
					//					}

					//					var operands = this.encodeOperands(field[2], null, ctx, val);
					//					var _iteratorNormalCompletion2 = true;
					//					var _didIteratorError2 = false;
					//					var _iteratorError2 = undefined;

					//					try {
					//						for (var _iterator2 = _getIterator(operands), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
					//							var op = _step2.value;

					//							len += CFFOperand.size(op);
					//						}
					//					} catch (err) {
					//						_didIteratorError2 = true;
					//						_iteratorError2 = err;
					//					} finally {
					//						try {
					//							if (!_iteratorNormalCompletion2 && _iterator2.return) {
					//								_iterator2.return();
					//							}
					//						} finally {
					//							if (_didIteratorError2) {
					//								throw _iteratorError2;
					//							}
					//						}
					//					}

					//					var key = Array.isArray(field[0]) ? field[0] : [field[0]];
					//					len += key.length;
					//				}

					//				if (includePointers) {
					//					len += ctx.pointerSize;
					//				}

					//				return len;
					//			}
					//		}, {
					//			key: 'encode',
					//			value: function encode(stream, dict, parent) {
					//				var ctx: any = {
					//					pointers: [],
					//					startOffset: stream.pos,
					//					parent: parent,
					//					val: dict,
					//					pointerSize: 0
					//				};

					//				ctx.pointerOffset = stream.pos + this.size(dict, ctx, false);

					//				var _iteratorNormalCompletion3 = true;
					//				var _didIteratorError3 = false;
					//				var _iteratorError3 = undefined;

					//				try {
					//					for (var _iterator3 = _getIterator(this.ops), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
					//						var field = _step3.value;

					//						var val = dict[field[1]];
					//						if (val == null || isEqual(val, field[3])) {
					//							continue;
					//						}

					//						var operands = this.encodeOperands(field[2], stream, ctx, val);
					//						var _iteratorNormalCompletion4 = true;
					//						var _didIteratorError4 = false;
					//						var _iteratorError4 = undefined;

					//						try {
					//							for (var _iterator4 = _getIterator(operands), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
					//								var op = _step4.value;

					//								CFFOperand.encode(stream, op);
					//							}
					//						} catch (err) {
					//							_didIteratorError4 = true;
					//							_iteratorError4 = err;
					//						} finally {
					//							try {
					//								if (!_iteratorNormalCompletion4 && _iterator4.return) {
					//									_iterator4.return();
					//								}
					//							} finally {
					//								if (_didIteratorError4) {
					//									throw _iteratorError4;
					//								}
					//							}
					//						}

					//						var key = Array.isArray(field[0]) ? field[0] : [field[0]];
					//						var _iteratorNormalCompletion5 = true;
					//						var _didIteratorError5 = false;
					//						var _iteratorError5 = undefined;

					//						try {
					//							for (var _iterator5 = _getIterator(key), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
					//								var _op = _step5.value;

					//								stream.writeUInt8(_op);
					//							}
					//						} catch (err) {
					//							_didIteratorError5 = true;
					//							_iteratorError5 = err;
					//						} finally {
					//							try {
					//								if (!_iteratorNormalCompletion5 && _iterator5.return) {
					//									_iterator5.return();
					//								}
					//							} finally {
					//								if (_didIteratorError5) {
					//									throw _iteratorError5;
					//								}
					//							}
					//						}
					//					}
					//				} catch (err) {
					//					_didIteratorError3 = true;
					//					_iteratorError3 = err;
					//				} finally {
					//					try {
					//						if (!_iteratorNormalCompletion3 && _iterator3.return) {
					//							_iterator3.return();
					//						}
					//					} finally {
					//						if (_didIteratorError3) {
					//							throw _iteratorError3;
					//						}
					//					}
					//				}

					//				var i = 0;
					//				while (i < ctx.pointers.length) {
					//					var ptr = ctx.pointers[i++];
					//					ptr.type.encode(stream, ptr.val, ptr.parent);
					//				}

					//				return;
					//			}
					//		}]);

					//	return CFFDict;
					//} ();

					//var CFFPointer: (...args) => void = function (_r$Pointer) {
					//	_inherits(CFFPointer, _r$Pointer);

					//	function CFFPointer(type) {
					//		var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

					//		_classCallCheck(this, CFFPointer);

					//		if (options.type == null) {
					//			options.type = 'global';
					//		}

					//		return _possibleConstructorReturn(this, (CFFPointer.__proto__ || _Object$getPrototypeOf(CFFPointer)).call(this, null, type, options));
					//	}

					//	_createClass(CFFPointer, [{
					//		key: 'decode',
					//		value: function decode(stream, parent, operands) {
					//			this.offsetType = {
					//				decode: function decode() {
					//					return operands[0];
					//				}
					//			};

					//			return _get(CFFPointer.prototype.__proto__ || _Object$getPrototypeOf(CFFPointer.prototype), 'decode', this).call(this, stream, parent, operands);
					//		}
					//	}, {
					//			key: 'encode',
					//			value: function encode(stream, value, ctx) {
					//				if (!stream) {
					//					// compute the size (so ctx.pointerSize is correct)
					//					this.offsetType = {
					//						size: function size() {
					//							return 0;
					//						}
					//					};

					//					this.size(value, ctx);
					//					return [new Ptr(0)];
					//				}

					//				var ptr = null;
					//				this.offsetType = {
					//					encode: function encode(stream, val) {
					//						return ptr = val;
					//					}
					//				};

					//				_get(CFFPointer.prototype.__proto__ || _Object$getPrototypeOf(CFFPointer.prototype), 'encode', this).call(this, stream, value, ctx);
					//				return [new Ptr(ptr)];
					//			}
					//		}]);

					//	return CFFPointer;
					//} (r.Pointer);

					//var Ptr = function () {
					//	function Ptr(val) {
					//		_classCallCheck(this, Ptr);

					//		this.val = val;
					//		this.forceLarge = true;
					//	}

					//	_createClass(Ptr, [{
					//		key: 'valueOf',
					//		value: function valueOf() {
					//			return this.val;
					//		}
					//	}]);

					//	return Ptr;
					//} ();

					//var CFFPrivateDict = new CFFDict([
					//	// key       name                    type                                          default
					//	[6, 'BlueValues', 'delta', null], [7, 'OtherBlues', 'delta', null], [8, 'FamilyBlues', 'delta', null], [9, 'FamilyOtherBlues', 'delta', null], [[12, 9], 'BlueScale', 'number', 0.039625], [[12, 10], 'BlueShift', 'number', 7], [[12, 11], 'BlueFuzz', 'number', 1], [10, 'StdHW', 'number', null], [11, 'StdVW', 'number', null], [[12, 12], 'StemSnapH', 'delta', null], [[12, 13], 'StemSnapV', 'delta', null], [[12, 14], 'ForceBold', 'boolean', false], [[12, 17], 'LanguageGroup', 'number', 0], [[12, 18], 'ExpansionFactor', 'number', 0.06], [[12, 19], 'initialRandomSeed', 'number', 0], [20, 'defaultWidthX', 'number', 0], [21, 'nominalWidthX', 'number', 0], [19, 'Subrs', new CFFPointer(new CFFIndex(), { type: 'local' }), null]]);

					//// Automatically generated from Appendix A of the CFF specification; do
					//// not edit. Length should be 391.
					//var standardStrings = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"];

					//var StandardEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdown', 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', '', 'endash', 'dagger', 'daggerdbl', 'periodcentered', '', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', '', 'questiondown', '', 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', '', 'ring', 'cedilla', '', 'hungarumlaut', 'ogonek', 'caron', 'emdash', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'AE', '', 'ordfeminine', '', '', '', '', 'Lslash', 'Oslash', 'OE', 'ordmasculine', '', '', '', '', '', 'ae', '', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls'];

					//var ExpertEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclamsmall', 'Hungarumlautsmall', '', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'questionsmall', '', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', '', '', 'isuperior', '', '', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', '', '', 'rsuperior', 'ssuperior', 'tsuperior', '', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', '', '', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', '', 'Dotaccentsmall', '', '', 'Macronsmall', '', '', 'figuredash', 'hypheninferior', '', '', 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', '', '', '', 'onequarter', 'onehalf', 'threequarters', 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', '', '', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', 'Ydieresissmall'];

					//var ISOAdobeCharset = ['.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', 'questiondown', 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'emdash', 'AE', 'ordfeminine', 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', 'dotlessi', 'lslash', 'oslash', 'oe', 'germandbls', 'onesuperior', 'logicalnot', 'mu', 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', 'onequarter', 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', 'twosuperior', 'registered', 'minus', 'eth', 'multiply', 'threesuperior', 'copyright', 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', 'Atilde', 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', 'Ocircumflex', 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', 'Ucircumflex', 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', 'aacute', 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', 'ccedilla', 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', 'icircumflex', 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', 'odieresis', 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', 'udieresis', 'ugrave', 'yacute', 'ydieresis', 'zcaron'];

					//var ExpertCharset = ['.notdef', 'space', 'exclamsmall', 'Hungarumlautsmall', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'questionsmall', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', 'Dotaccentsmall', 'Macronsmall', 'figuredash', 'hypheninferior', 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', 'onequarter', 'onehalf', 'threequarters', 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', 'Ydieresissmall'];

					//var ExpertSubsetCharset = ['.notdef', 'space', 'dollaroldstyle', 'dollarsuperior', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', 'hyphensuperior', 'colonmonetary', 'onefitted', 'rupiah', 'centoldstyle', 'figuredash', 'hypheninferior', 'onequarter', 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior'];

					//// Checks if an operand is an index of a predefined value,
					//// otherwise delegates to the provided type.

					//var PredefinedOp = function () {
					//	function PredefinedOp(predefinedOps, type) {
					//		_classCallCheck(this, PredefinedOp);

					//		this.predefinedOps = predefinedOps;
					//		this.type = type;
					//	}

					//	_createClass(PredefinedOp, [{
					//		key: 'decode',
					//		value: function decode(stream, parent, operands) {
					//			if (this.predefinedOps[operands[0]]) {
					//				return this.predefinedOps[operands[0]];
					//			}

					//			return this.type.decode(stream, parent, operands);
					//		}
					//	}, {
					//			key: 'size',
					//			value: function size(value, ctx) {
					//				return this.type.size(value, ctx);
					//			}
					//		}, {
					//			key: 'encode',
					//			value: function encode(stream, value, ctx) {
					//				var index = this.predefinedOps.indexOf(value);
					//				if (index !== -1) {
					//					return index;
					//				}

					//				return this.type.encode(stream, value, ctx);
					//			}
					//		}]);

					//	return PredefinedOp;
					//} ();

					//var CFFEncodingVersion = function (_r$Number) {
					//	_inherits(CFFEncodingVersion, _r$Number);

					//	function CFFEncodingVersion(): void {
					//		_classCallCheck(this, CFFEncodingVersion);

					//		return _possibleConstructorReturn(this, (CFFEncodingVersion.__proto__ || _Object$getPrototypeOf(CFFEncodingVersion)).call(this, 'UInt8'));
					//	}

					//	_createClass(CFFEncodingVersion, [{
					//		key: 'decode',
					//		value: function decode(stream) {
					//			return r.uint8.decode(stream) & 0x7f;
					//		}
					//	}]);

					//	return CFFEncodingVersion;
					//} (r.Number);

					//var Range1 = new r.Struct({
					//	first: r.uint16,
					//	nLeft: r.uint8
					//});

					//var Range2 = new r.Struct({
					//	first: r.uint16,
					//	nLeft: r.uint16
					//});

					//var CFFCustomEncoding = new r.VersionedStruct(new CFFEncodingVersion(), {
					//	0: {
					//		nCodes: r.uint8,
					//		codes: new r.Array(r.uint8, 'nCodes')
					//	},

					//	1: {
					//		nRanges: r.uint8,
					//		ranges: new r.Array(Range1, 'nRanges')
					//	}

					//	// TODO: supplement?
					//});

					//var CFFEncoding = new PredefinedOp([StandardEncoding, ExpertEncoding], new CFFPointer(CFFCustomEncoding, { lazy: true }));

					//// Decodes an array of ranges until the total
					//// length is equal to the provided length.

					//var RangeArray: (...args) => void = function (_r$Array) {
					//	_inherits(RangeArray, _r$Array);

					//	function RangeArray() {
					//		_classCallCheck(this, RangeArray);

					//		return _possibleConstructorReturn(this, (RangeArray.__proto__ || _Object$getPrototypeOf(RangeArray)).apply(this, arguments));
					//	}

					//	_createClass(RangeArray, [{
					//		key: 'decode',
					//		value: function decode(stream, parent) {
					//			var length = restructure_src_utils.resolveLength(this.length, stream, parent);
					//			var count = 0;
					//			var res = [];
					//			while (count < length) {
					//				var range = this.type.decode(stream, parent);
					//				range.offset = count;
					//				count += range.nLeft + 1;
					//				res.push(range);
					//			}

					//			return res;
					//		}
					//	}]);

					//	return RangeArray;
					//} (r.Array);

					//var CFFCustomCharset = new r.VersionedStruct(r.uint8, {
					//	0: {
					//		glyphs: new r.Array(r.uint16, function (t) {
					//			return t.parent.CharStrings.length - 1;
					//		})
					//	},

					//	1: {
					//		ranges: new RangeArray(Range1, function (t) {
					//			return t.parent.CharStrings.length - 1;
					//		})
					//	},

					//	2: {
					//		ranges: new RangeArray(Range2, function (t) {
					//			return t.parent.CharStrings.length - 1;
					//		})
					//	}
					//});

					//var CFFCharset = new PredefinedOp([ISOAdobeCharset, ExpertCharset, ExpertSubsetCharset], new CFFPointer(CFFCustomCharset, { lazy: true }));

					//var FDRange = new r.Struct({
					//	first: r.uint16,
					//	fd: r.uint8
					//});

					//var FDSelect = new r.VersionedStruct(r.uint8, {
					//	0: {
					//		fds: new r.Array(r.uint8, function (t) {
					//			return t.parent.CharStrings.length;
					//		})
					//	},

					//	3: {
					//		nRanges: r.uint16,
					//		ranges: new r.Array(FDRange, 'nRanges'),
					//		sentinel: r.uint16
					//	}
					//});

					//var ptr = new CFFPointer(CFFPrivateDict);

					//var CFFPrivateOp = function () {
					//	function CFFPrivateOp() {
					//		_classCallCheck(this, CFFPrivateOp);
					//	}

					//	_createClass(CFFPrivateOp, [{
					//		key: 'decode',
					//		value: function decode(stream, parent, operands) {
					//			parent.length = operands[0];
					//			return ptr.decode(stream, parent, [operands[1]]);
					//		}
					//	}, {
					//			key: 'size',
					//			value: function size(dict, ctx) {
					//				return [CFFPrivateDict.size(dict, ctx, false), ptr.size(dict, ctx)[0]];
					//			}
					//		}, {
					//			key: 'encode',
					//			value: function encode(stream, dict, ctx) {
					//				return [CFFPrivateDict.size(dict, ctx, false), ptr.encode(stream, dict, ctx)[0]];
					//			}
					//		}]);

					//	return CFFPrivateOp;
					//} ();

					//var FontDict = new CFFDict([
					//	// key       name                   type(s)                                 default
					//	[18, 'Private', new CFFPrivateOp(), null], [[12, 38], 'FontName', 'sid', null]]);

					//var CFFTopDict = new CFFDict([
					//	// key       name                   type(s)                                 default
					//	[[12, 30], 'ROS', ['sid', 'sid', 'number'], null], [0, 'version', 'sid', null], [1, 'Notice', 'sid', null], [[12, 0], 'Copyright', 'sid', null], [2, 'FullName', 'sid', null], [3, 'FamilyName', 'sid', null], [4, 'Weight', 'sid', null], [[12, 1], 'isFixedPitch', 'boolean', false], [[12, 2], 'ItalicAngle', 'number', 0], [[12, 3], 'UnderlinePosition', 'number', -100], [[12, 4], 'UnderlineThickness', 'number', 50], [[12, 5], 'PaintType', 'number', 0], [[12, 6], 'CharstringType', 'number', 2], [[12, 7], 'FontMatrix', 'array', [0.001, 0, 0, 0.001, 0, 0]], [13, 'UniqueID', 'number', null], [5, 'FontBBox', 'array', [0, 0, 0, 0]], [[12, 8], 'StrokeWidth', 'number', 0], [14, 'XUID', 'array', null], [15, 'charset', CFFCharset, ISOAdobeCharset], [16, 'Encoding', CFFEncoding, StandardEncoding], [17, 'CharStrings', new CFFPointer(new CFFIndex()), null], [18, 'Private', new CFFPrivateOp(), null], [[12, 20], 'SyntheticBase', 'number', null], [[12, 21], 'PostScript', 'sid', null], [[12, 22], 'BaseFontName', 'sid', null], [[12, 23], 'BaseFontBlend', 'delta', null],

					//	// CID font specific
					//	[[12, 31], 'CIDFontVersion', 'number', 0], [[12, 32], 'CIDFontRevision', 'number', 0], [[12, 33], 'CIDFontType', 'number', 0], [[12, 34], 'CIDCount', 'number', 8720], [[12, 35], 'UIDBase', 'number', null], [[12, 37], 'FDSelect', new CFFPointer(FDSelect), null], [[12, 36], 'FDArray', new CFFPointer(new CFFIndex(FontDict)), null], [[12, 38], 'FontName', 'sid', null]]);

					//var CFFHeader = new r.Struct({
					//	majorVersion: r.uint8,
					//	minorVersion: r.uint8,
					//	hdrSize: r.uint8,
					//	offSize: r.uint8
					//});

					//var CFFTop = new r.Struct({
					//	header: CFFHeader,
					//	nameIndex: new CFFIndex(new r.String('length')),
					//	topDictIndex: new CFFIndex(CFFTopDict),
					//	stringIndex: new CFFIndex(new r.String('length')),
					//	globalSubrIndex: new CFFIndex()
					//});

					//var CFFFont = function () {
					//	function CFFFont(stream) {
					//		_classCallCheck(this, CFFFont);

					//		this.stream = stream;
					//		this.decode();
					//	}

					//	_createClass(CFFFont, [{
					//		key: 'decode',
					//		value: function decode() {
					//			var start = this.stream.pos;
					//			var top = CFFTop.decode(this.stream);
					//			for (var key in top) {
					//				var val = top[key];
					//				this[key] = val;
					//			}

					//			if (this.topDictIndex.length !== 1) {
					//				throw new Error("Only a single font is allowed in CFF");
					//			}

					//			this.isCIDFont = this.topDict.ROS != null;

					//			return this;
					//		}
					//	}, {
					//			key: 'string',
					//			value: function string(sid) {
					//				if (sid <= standardStrings.length) {
					//					return standardStrings[sid];
					//				}

					//				return this.stringIndex[sid - standardStrings.length];
					//			}
					//		}, {
					//			key: 'getCharString',
					//			value: function getCharString(glyph) {
					//				this.stream.pos = this.topDict.CharStrings[glyph].offset;
					//				return this.stream.readBuffer(this.topDict.CharStrings[glyph].length);
					//			}
					//		}, {
					//			key: 'getGlyphName',
					//			value: function getGlyphName(gid) {
					//				var charset = this.topDict.charset;

					//				if (Array.isArray(charset)) {
					//					return charset[gid];
					//				}

					//				if (gid === 0) {
					//					return '.notdef';
					//				}

					//				gid -= 1;

					//				switch (charset.version) {
					//					case 0:
					//						return this.string(charset.glyphs[gid]);

					//					case 1: case 2:
					//						for (var i = 0; i < charset.ranges.length; i++) {
					//							var range = charset.ranges[i];
					//							if (range.offset <= gid && gid <= range.offset + range.nLeft) {
					//								return this.string(range.first + (gid - range.offset));
					//							}
					//						}
					//						break;
					//				}

					//				return null;
					//			}
					//		}, {
					//			key: 'fdForGlyph',
					//			value: function fdForGlyph(gid) {
					//				if (!this.topDict.FDSelect) {
					//					return null;
					//				}

					//				switch (this.topDict.FDSelect.version) {
					//					case 0:
					//						return this.topDict.FDSelect.fds[gid];

					//					case 3:
					//						var ranges = this.topDict.FDSelect.ranges;

					//						var low = 0;
					//						var high = ranges.length - 1;

					//						while (low <= high) {
					//							var mid = low + high >> 1;

					//							if (gid < ranges[mid].first) {
					//								high = mid - 1;
					//							} else if (mid < high && gid > ranges[mid + 1].first) {
					//								low = mid + 1;
					//							} else {
					//								return ranges[mid].fd;
					//							}
					//						}
					//					default:
					//						throw new Error('Unknown FDSelect version: ' + this.topDict.FDSelect.version);
					//				}
					//			}
					//		}, {
					//			key: 'privateDictForGlyph',
					//			value: function privateDictForGlyph(gid) {
					//				if (this.topDict.FDSelect) {
					//					var fd = this.fdForGlyph(gid);
					//					if (this.topDict.FDArray[fd]) {
					//						return this.topDict.FDArray[fd].Private;
					//					}

					//					return null;
					//				}

					//				return this.topDict.Private;
					//			}
					//		}, {
					//			key: 'topDict',
					//			get: function get() {
					//				return this.topDictIndex[0];
					//			}
					//		}, {
					//			key: 'postscriptName',
					//			get: function get() {
					//				return this.nameIndex[0];
					//			}
					//		}, {
					//			key: 'fullName',
					//			get: function get() {
					//				return this.string(this.topDict.FullName);
					//			}
					//		}, {
					//			key: 'familyName',
					//			get: function get() {
					//				return this.string(this.topDict.FamilyName);
					//			}
					//		}], [{
					//			key: 'decode',
					//			value: function decode(stream) {
					//				return new CFFFont(stream);
					//			}
					//		}]);

					//	return CFFFont;
					//} ();

					//var VerticalOrigin = new r.Struct({
					//	glyphIndex: r.uint16,
					//	vertOriginY: r.int16
					//});

					//var VORG = new r.Struct({
					//	majorVersion: r.uint16,
					//	minorVersion: r.uint16,
					//	defaultVertOriginY: r.int16,
					//	numVertOriginYMetrics: r.uint16,
					//	metrics: new r.Array(VerticalOrigin, 'numVertOriginYMetrics')
					//});

					//var BigMetrics = new r.Struct({
					//	height: r.uint8,
					//	width: r.uint8,
					//	horiBearingX: r.int8,
					//	horiBearingY: r.int8,
					//	horiAdvance: r.uint8,
					//	vertBearingX: r.int8,
					//	vertBearingY: r.int8,
					//	vertAdvance: r.uint8
					//});

					//var SmallMetrics = new r.Struct({
					//	height: r.uint8,
					//	width: r.uint8,
					//	bearingX: r.int8,
					//	bearingY: r.int8,
					//	advance: r.uint8
					//});

					//var EBDTComponent = new r.Struct({
					//	glyph: r.uint16,
					//	xOffset: r.int8,
					//	yOffset: r.int8
					//});

					//var ByteAligned = function ByteAligned() {
					//	_classCallCheck(this, ByteAligned);
					//};

					//var BitAligned = function BitAligned() {
					//	_classCallCheck(this, BitAligned);
					//};

					//var glyph = new r.VersionedStruct('version', {
					//	1: {
					//		metrics: SmallMetrics,
					//		data: ByteAligned
					//	},

					//	2: {
					//		metrics: SmallMetrics,
					//		data: BitAligned
					//	},

					//	// format 3 is deprecated
					//	// format 4 is not supported by Microsoft

					//	5: {
					//		data: BitAligned
					//	},

					//	6: {
					//		metrics: BigMetrics,
					//		data: ByteAligned
					//	},

					//	7: {
					//		metrics: BigMetrics,
					//		data: BitAligned
					//	},

					//	8: {
					//		metrics: SmallMetrics,
					//		pad: new r.Reserved(r.uint8),
					//		numComponents: r.uint16,
					//		components: new r.Array(EBDTComponent, 'numComponents')
					//	},

					//	9: {
					//		metrics: BigMetrics,
					//		pad: new r.Reserved(r.uint8),
					//		numComponents: r.uint16,
					//		components: new r.Array(EBDTComponent, 'numComponents')
					//	},

					//	17: {
					//		metrics: SmallMetrics,
					//		dataLen: r.uint32,
					//		data: new r.Buffer('dataLen')
					//	},

					//	18: {
					//		metrics: BigMetrics,
					//		dataLen: r.uint32,
					//		data: new r.Buffer('dataLen')
					//	},

					//	19: {
					//		dataLen: r.uint32,
					//		data: new r.Buffer('dataLen')
					//	}
					//});

					//var SBitLineMetrics = new r.Struct({
					//	ascender: r.int8,
					//	descender: r.int8,
					//	widthMax: r.uint8,
					//	caretSlopeNumerator: r.int8,
					//	caretSlopeDenominator: r.int8,
					//	caretOffset: r.int8,
					//	minOriginSB: r.int8,
					//	minAdvanceSB: r.int8,
					//	maxBeforeBL: r.int8,
					//	minAfterBL: r.int8,
					//	pad: new r.Reserved(r.int8, 2)
					//});

					//var CodeOffsetPair = new r.Struct({
					//	glyphCode: r.uint16,
					//	offset: r.uint16
					//});

					//var IndexSubtable = new r.VersionedStruct(r.uint16, {
					//	header: {
					//		imageFormat: r.uint16,
					//		imageDataOffset: r.uint32
					//	},

					//	1: {
					//		offsetArray: new r.Array(r.uint32, function (t) {
					//			return t.parent.lastGlyphIndex - t.parent.firstGlyphIndex + 1;
					//		})
					//	},

					//	2: {
					//		imageSize: r.uint32,
					//		bigMetrics: BigMetrics
					//	},

					//	3: {
					//		offsetArray: new r.Array(r.uint16, function (t) {
					//			return t.parent.lastGlyphIndex - t.parent.firstGlyphIndex + 1;
					//		})
					//	},

					//	4: {
					//		numGlyphs: r.uint32,
					//		glyphArray: new r.Array(CodeOffsetPair, function (t) {
					//			return t.numGlyphs + 1;
					//		})
					//	},

					//	5: {
					//		imageSize: r.uint32,
					//		bigMetrics: BigMetrics,
					//		numGlyphs: r.uint32,
					//		glyphCodeArray: new r.Array(r.uint16, 'numGlyphs')
					//	}
					//});

					//var IndexSubtableArray = new r.Struct({
					//	firstGlyphIndex: r.uint16,
					//	lastGlyphIndex: r.uint16,
					//	subtable: new r.Pointer(r.uint32, IndexSubtable)
					//});

					//var BitmapSizeTable = new r.Struct({
					//	indexSubTableArray: new r.Pointer(r.uint32, new r.Array(IndexSubtableArray, 1), { type: 'parent' }),
					//	indexTablesSize: r.uint32,
					//	numberOfIndexSubTables: r.uint32,
					//	colorRef: r.uint32,
					//	hori: SBitLineMetrics,
					//	vert: SBitLineMetrics,
					//	startGlyphIndex: r.uint16,
					//	endGlyphIndex: r.uint16,
					//	ppemX: r.uint8,
					//	ppemY: r.uint8,
					//	bitDepth: r.uint8,
					//	flags: new r.Bitfield(r.uint8, ['horizontal', 'vertical'])
					//});

					//var EBLC = new r.Struct({
					//	version: r.uint32, // 0x00020000
					//	numSizes: r.uint32,
					//	sizes: new r.Array(BitmapSizeTable, 'numSizes')
					//});

					//var ImageTable = new r.Struct({
					//	ppem: r.uint16,
					//	resolution: r.uint16,
					//	imageOffsets: new r.Array(new r.Pointer(r.uint32, 'void'), function (t) {
					//		return t.parent.parent.maxp.numGlyphs + 1;
					//	})
					//});

					//// This is the Apple sbix table, used by the "Apple Color Emoji" font.
					//// It includes several image tables with images for each bitmap glyph
					//// of several different sizes.
					//var sbix = new r.Struct({
					//	version: r.uint16,
					//	flags: new r.Bitfield(r.uint16, ['renderOutlines']),
					//	numImgTables: r.uint32,
					//	imageTables: new r.Array(new r.Pointer(r.uint32, ImageTable), 'numImgTables')
					//});

					//var LayerRecord = new r.Struct({
					//	gid: r.uint16, // Glyph ID of layer glyph (must be in z-order from bottom to top).
					//	paletteIndex: r.uint16 // Index value to use in the appropriate palette. This value must
					//}); // be less than numPaletteEntries in the CPAL table, except for
					//// the special case noted below. Each palette entry is 16 bits.
					//// A palette index of 0xFFFF is a special case indicating that
					//// the text foreground color should be used.

					//var BaseGlyphRecord = new r.Struct({
					//	gid: r.uint16, // Glyph ID of reference glyph. This glyph is for reference only
					//	// and is not rendered for color.
					//	firstLayerIndex: r.uint16, // Index (from beginning of the Layer Records) to the layer record.
					//	// There will be numLayers consecutive entries for this base glyph.
					//	numLayers: r.uint16
					//});

					//var COLR = new r.Struct({
					//	version: r.uint16,
					//	numBaseGlyphRecords: r.uint16,
					//	baseGlyphRecord: new r.Pointer(r.uint32, new r.Array(BaseGlyphRecord, 'numBaseGlyphRecords')),
					//	layerRecords: new r.Pointer(r.uint32, new r.Array(LayerRecord, 'numLayerRecords'), { lazy: true }),
					//	numLayerRecords: r.uint16
					//});

					//var ColorRecord = new r.Struct({
					//	blue: r.uint8,
					//	green: r.uint8,
					//	red: r.uint8,
					//	alpha: r.uint8
					//});

					//var CPAL = new r.Struct({
					//	version: r.uint16,
					//	numPaletteEntries: r.uint16,
					//	numPalettes: r.uint16,
					//	numColorRecords: r.uint16,
					//	colorRecords: new r.Pointer(r.uint32, new r.Array(ColorRecord, 'numColorRecords')),
					//	colorRecordIndices: new r.Array(r.uint16, 'numPalettes')
					//});

					////########################
					//// Scripts and Languages #
					////########################

					//var LangSysTable = new r.Struct({
					//	reserved: new r.Reserved(r.uint16),
					//	reqFeatureIndex: r.uint16,
					//	featureCount: r.uint16,
					//	featureIndexes: new r.Array(r.uint16, 'featureCount')
					//});

					//var LangSysRecord = new r.Struct({
					//	tag: new r.String(4),
					//	langSys: new r.Pointer(r.uint16, LangSysTable, { type: 'parent' })
					//});

					//var Script = new r.Struct({
					//	defaultLangSys: new r.Pointer(r.uint16, LangSysTable),
					//	count: r.uint16,
					//	langSysRecords: new r.Array(LangSysRecord, 'count')
					//});

					//var ScriptRecord = new r.Struct({
					//	tag: new r.String(4),
					//	script: new r.Pointer(r.uint16, Script, { type: 'parent' })
					//});

					//var ScriptList = new r.Array(ScriptRecord, r.uint16);

					////#######################
					//// Features and Lookups #
					////#######################

					//var Feature = new r.Struct({
					//	featureParams: r.uint16, // pointer
					//	lookupCount: r.uint16,
					//	lookupListIndexes: new r.Array(r.uint16, 'lookupCount')
					//});

					//var FeatureRecord = new r.Struct({
					//	tag: new r.String(4),
					//	feature: new r.Pointer(r.uint16, Feature, { type: 'parent' })
					//});

					//var FeatureList = new r.Array(FeatureRecord, r.uint16);

					//var LookupFlags = new r.Bitfield(r.uint16, ['rightToLeft', 'ignoreBaseGlyphs', 'ignoreLigatures', 'ignoreMarks', 'useMarkFilteringSet', null, 'markAttachmentType']);

					//function LookupList(SubTable): void {
					//	var Lookup = new r.Struct({
					//		lookupType: r.uint16,
					//		flags: LookupFlags,
					//		subTableCount: r.uint16,
					//		subTables: new r.Array(new r.Pointer(r.uint16, SubTable), 'subTableCount'),
					//		markFilteringSet: r.uint16 // TODO: only present when flags says so...
					//	});

					//	return new r.LazyArray(new r.Pointer(r.uint16, Lookup), r.uint16);
					//}

					////#################
					//// Coverage Table #
					////#################

					//var RangeRecord = new r.Struct({
					//	start: r.uint16,
					//	end: r.uint16,
					//	startCoverageIndex: r.uint16
					//});

					//var Coverage = new r.VersionedStruct(r.uint16, {
					//	1: {
					//		glyphCount: r.uint16,
					//		glyphs: new r.Array(r.uint16, 'glyphCount')
					//	},
					//	2: {
					//		rangeCount: r.uint16,
					//		rangeRecords: new r.Array(RangeRecord, 'rangeCount')
					//	}
					//});

					////#########################
					//// Class Definition Table #
					////#########################

					//var ClassRangeRecord = new r.Struct({
					//	start: r.uint16,
					//	end: r.uint16,
					//	class: r.uint16
					//});

					//var ClassDef = new r.VersionedStruct(r.uint16, {
					//	1: { // Class array
					//		startGlyph: r.uint16,
					//		glyphCount: r.uint16,
					//		classValueArray: new r.Array(r.uint16, 'glyphCount')
					//	},
					//	2: { // Class ranges
					//		classRangeCount: r.uint16,
					//		classRangeRecord: new r.Array(ClassRangeRecord, 'classRangeCount')
					//	}
					//});

					////###############
					//// Device Table #
					////###############

					//var Device = new r.Struct({
					//	startSize: r.uint16,
					//	endSize: r.uint16,
					//	deltaFormat: r.uint16
					//});

					////#############################################
					//// Contextual Substitution/Positioning Tables #
					////#############################################

					//var LookupRecord = new r.Struct({
					//	sequenceIndex: r.uint16,
					//	lookupListIndex: r.uint16
					//});

					//var Rule = new r.Struct({
					//	glyphCount: r.uint16,
					//	lookupCount: r.uint16,
					//	input: new r.Array(r.uint16, function (t) {
					//		return t.glyphCount - 1;
					//	}),
					//	lookupRecords: new r.Array(LookupRecord, 'lookupCount')
					//});

					//var RuleSet = new r.Array(new r.Pointer(r.uint16, Rule), r.uint16);

					//var ClassRule = new r.Struct({
					//	glyphCount: r.uint16,
					//	lookupCount: r.uint16,
					//	classes: new r.Array(r.uint16, function (t) {
					//		return t.glyphCount - 1;
					//	}),
					//	lookupRecords: new r.Array(LookupRecord, 'lookupCount')
					//});

					//var ClassSet = new r.Array(new r.Pointer(r.uint16, ClassRule), r.uint16);

					//var Context = new r.VersionedStruct(r.uint16, {
					//	1: { // Simple context
					//		coverage: new r.Pointer(r.uint16, Coverage),
					//		ruleSetCount: r.uint16,
					//		ruleSets: new r.Array(new r.Pointer(r.uint16, RuleSet), 'ruleSetCount')
					//	},
					//	2: { // Class-based context
					//		coverage: new r.Pointer(r.uint16, Coverage),
					//		classDef: new r.Pointer(r.uint16, ClassDef),
					//		classSetCnt: r.uint16,
					//		classSet: new r.Array(new r.Pointer(r.uint16, ClassSet), 'classSetCnt')
					//	},
					//	3: {
					//		glyphCount: r.uint16,
					//		lookupCount: r.uint16,
					//		coverages: new r.Array(new r.Pointer(r.uint16, Coverage), 'glyphCount'),
					//		lookupRecords: new r.Array(LookupRecord, 'lookupCount')
					//	}
					//});

					////######################################################
					//// Chaining Contextual Substitution/Positioning Tables #
					////######################################################

					//var ChainRule = new r.Struct({
					//	backtrackGlyphCount: r.uint16,
					//	backtrack: new r.Array(r.uint16, 'backtrackGlyphCount'),
					//	inputGlyphCount: r.uint16,
					//	input: new r.Array(r.uint16, function (t) {
					//		return t.inputGlyphCount - 1;
					//	}),
					//	lookaheadGlyphCount: r.uint16,
					//	lookahead: new r.Array(r.uint16, 'lookaheadGlyphCount'),
					//	lookupCount: r.uint16,
					//	lookupRecords: new r.Array(LookupRecord, 'lookupCount')
					//});

					//var ChainRuleSet = new r.Array(new r.Pointer(r.uint16, ChainRule), r.uint16);

					//var ChainingContext = new r.VersionedStruct(r.uint16, {
					//	1: { // Simple context glyph substitution
					//		coverage: new r.Pointer(r.uint16, Coverage),
					//		chainCount: r.uint16,
					//		chainRuleSets: new r.Array(new r.Pointer(r.uint16, ChainRuleSet), 'chainCount')
					//	},

					//	2: { // Class-based chaining context
					//		coverage: new r.Pointer(r.uint16, Coverage),
					//		backtrackClassDef: new r.Pointer(r.uint16, ClassDef),
					//		inputClassDef: new r.Pointer(r.uint16, ClassDef),
					//		lookaheadClassDef: new r.Pointer(r.uint16, ClassDef),
					//		chainCount: r.uint16,
					//		chainClassSet: new r.Array(new r.Pointer(r.uint16, ChainRuleSet), 'chainCount')
					//	},

					//	3: { // Coverage-based chaining context
					//		backtrackGlyphCount: r.uint16,
					//		backtrackCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'backtrackGlyphCount'),
					//		inputGlyphCount: r.uint16,
					//		inputCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'inputGlyphCount'),
					//		lookaheadGlyphCount: r.uint16,
					//		lookaheadCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'lookaheadGlyphCount'),
					//		lookupCount: r.uint16,
					//		lookupRecords: new r.Array(LookupRecord, 'lookupCount')
					//	}
					//});

					//var BaseCoord = new r.VersionedStruct(r.uint16, {
					//	1: { // Design units only
					//		coordinate: r.int16 // X or Y value, in design units
					//	},

					//	2: { // Design units plus contour point
					//		coordinate: r.int16, // X or Y value, in design units
					//		referenceGlyph: r.uint16, // GlyphID of control glyph
					//		baseCoordPoint: r.uint16 // Index of contour point on the referenceGlyph
					//	},

					//	3: { // Design units plus Device table
					//		coordinate: r.int16, // X or Y value, in design units
					//		deviceTable: new r.Pointer(r.uint16, Device) // Device table for X or Y value
					//	}
					//});

					//var BaseValues = new r.Struct({
					//	defaultIndex: r.uint16, // Index of default baseline for this script-same index in the BaseTagList
					//	baseCoordCount: r.uint16,
					//	baseCoords: new r.Array(new r.Pointer(r.uint16, BaseCoord), 'baseCoordCount')
					//});

					//var FeatMinMaxRecord = new r.Struct({
					//	tag: new r.String(4), // 4-byte feature identification tag-must match FeatureTag in FeatureList
					//	minCoord: new r.Pointer(r.uint16, BaseCoord, { type: 'parent' }), // May be NULL
					//	maxCoord: new r.Pointer(r.uint16, BaseCoord, { type: 'parent' }) // May be NULL
					//});

					//var MinMax = new r.Struct({
					//	minCoord: new r.Pointer(r.uint16, BaseCoord), // May be NULL
					//	maxCoord: new r.Pointer(r.uint16, BaseCoord), // May be NULL
					//	featMinMaxCount: r.uint16, // May be 0
					//	featMinMaxRecords: new r.Array(FeatMinMaxRecord, 'featMinMaxCount') // In alphabetical order
					//});

					//var BaseLangSysRecord = new r.Struct({
					//	tag: new r.String(4), // 4-byte language system identification tag
					//	minMax: new r.Pointer(r.uint16, MinMax, { type: 'parent' })
					//});

					//var BaseScript = new r.Struct({
					//	baseValues: new r.Pointer(r.uint16, BaseValues), // May be NULL
					//	defaultMinMax: new r.Pointer(r.uint16, MinMax), // May be NULL
					//	baseLangSysCount: r.uint16, // May be 0
					//	baseLangSysRecords: new r.Array(BaseLangSysRecord, 'baseLangSysCount') // in alphabetical order by BaseLangSysTag
					//});

					//var BaseScriptRecord = new r.Struct({
					//	tag: new r.String(4), // 4-byte script identification tag
					//	script: new r.Pointer(r.uint16, BaseScript, { type: 'parent' })
					//});

					//var BaseScriptList = new r.Array(BaseScriptRecord, r.uint16);

					//// Array of 4-byte baseline identification tags-must be in alphabetical order
					//var BaseTagList = new r.Array(new r.String(4), r.uint16);

					//var Axis = new r.Struct({
					//	baseTagList: new r.Pointer(r.uint16, BaseTagList), // May be NULL
					//	baseScriptList: new r.Pointer(r.uint16, BaseScriptList)
					//});

					//var BASE = new r.Struct({
					//	version: r.uint32, // Version of the BASE table-initially 0x00010000
					//	horizAxis: new r.Pointer(r.uint16, Axis), // May be NULL
					//	vertAxis: new r.Pointer(r.uint16, Axis) // May be NULL
					//});

					//var AttachPoint = new r.Array(r.uint16, r.uint16);
					//var AttachList = new r.Struct({
					//	coverage: new r.Pointer(r.uint16, Coverage),
					//	glyphCount: r.uint16,
					//	attachPoints: new r.Array(new r.Pointer(r.uint16, AttachPoint), 'glyphCount')
					//});

					//var CaretValue = new r.VersionedStruct(r.uint16, {
					//	1: { // Design units only
					//		coordinate: r.int16
					//	},

					//	2: { // Contour point
					//		caretValuePoint: r.uint16
					//	},

					//	3: { // Design units plus Device table
					//		coordinate: r.int16,
					//		deviceTable: new r.Pointer(r.uint16, Device)
					//	}
					//});

					//var LigGlyph = new r.Array(new r.Pointer(r.uint16, CaretValue), r.uint16);

					//var LigCaretList = new r.Struct({
					//	coverage: new r.Pointer(r.uint16, Coverage),
					//	ligGlyphCount: r.uint16,
					//	ligGlyphs: new r.Array(new r.Pointer(r.uint16, LigGlyph), 'ligGlyphCount')
					//});

					//var MarkGlyphSetsDef = new r.Struct({
					//	markSetTableFormat: r.uint16,
					//	markSetCount: r.uint16,
					//	coverage: new r.Array(new r.Pointer(r.uint32, Coverage), 'markSetCount')
					//});

					//var GDEF = new r.VersionedStruct(r.uint32, {
					//	0x00010000: {
					//		glyphClassDef: new r.Pointer(r.uint16, ClassDef), // 1: base glyph, 2: ligature, 3: mark, 4: component
					//		attachList: new r.Pointer(r.uint16, AttachList),
					//		ligCaretList: new r.Pointer(r.uint16, LigCaretList),
					//		markAttachClassDef: new r.Pointer(r.uint16, ClassDef)
					//	},
					//	0x00010002: {
					//		glyphClassDef: new r.Pointer(r.uint16, ClassDef),
					//		attachList: new r.Pointer(r.uint16, AttachList),
					//		ligCaretList: new r.Pointer(r.uint16, LigCaretList),
					//		markAttachClassDef: new r.Pointer(r.uint16, ClassDef),
					//		markGlyphSetsDef: new r.Pointer(r.uint16, MarkGlyphSetsDef)
					//	}
					//});

					//var ValueFormat = new r.Bitfield(r.uint16, ['xPlacement', 'yPlacement', 'xAdvance', 'yAdvance', 'xPlaDevice', 'yPlaDevice', 'xAdvDevice', 'yAdvDevice']);

					//var types = {
					//	xPlacement: r.int16,
					//	yPlacement: r.int16,
					//	xAdvance: r.int16,
					//	yAdvance: r.int16,
					//	xPlaDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' }),
					//	yPlaDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' }),
					//	xAdvDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' }),
					//	yAdvDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' })
					//};

					//var ValueRecord: (...args) => void = function () {
					//	function ValueRecord() {
					//		var key = arguments.length <= 0 || arguments[0] === undefined ? 'valueFormat' : arguments[0];

					//		_classCallCheck(this, ValueRecord);

					//		this.key = key;
					//	}

					//	_createClass(ValueRecord, [{
					//		key: 'buildStruct',
					//		value: function buildStruct(parent) {
					//			var struct = parent;
					//			while (!struct[this.key] && struct.parent) {
					//				struct = struct.parent;
					//			}

					//			if (!struct[this.key]) return;

					//			var fields: any = {};
					//			fields.rel = function () {
					//				return struct._startOffset;
					//			};

					//			var format = struct[this.key];
					//			for (var key in format) {
					//				if (format[key]) {
					//					fields[key] = types[key];
					//				}
					//			}

					//			return new r.Struct(fields);
					//		}
					//	}, {
					//			key: 'size',
					//			value: function size(val, ctx) {
					//				return this.buildStruct(ctx).size(val, ctx);
					//			}
					//		}, {
					//			key: 'decode',
					//			value: function decode(stream, parent) {
					//				var res = this.buildStruct(parent).decode(stream, parent);
					//				delete res.rel;
					//				return res;
					//			}
					//		}]);

					//	return ValueRecord;
					//} ();

					//var PairValueRecord = new r.Struct({
					//	secondGlyph: r.uint16,
					//	value1: new ValueRecord('valueFormat1'),
					//	value2: new ValueRecord('valueFormat2')
					//});

					//var PairSet = new r.Array(PairValueRecord, r.uint16);

					//var Class2Record = new r.Struct({
					//	value1: new ValueRecord('valueFormat1'),
					//	value2: new ValueRecord('valueFormat2')
					//});

					//var Anchor = new r.VersionedStruct(r.uint16, {
					//	1: { // Design units only
					//		xCoordinate: r.int16,
					//		yCoordinate: r.int16
					//	},

					//	2: { // Design units plus contour point
					//		xCoordinate: r.int16,
					//		yCoordinate: r.int16,
					//		anchorPoint: r.uint16
					//	},

					//	3: { // Design units plus Device tables
					//		xCoordinate: r.int16,
					//		yCoordinate: r.int16,
					//		xDeviceTable: new r.Pointer(r.uint16, Device),
					//		yDeviceTable: new r.Pointer(r.uint16, Device)
					//	}
					//});

					//var EntryExitRecord = new r.Struct({
					//	entryAnchor: new r.Pointer(r.uint16, Anchor, { type: 'parent' }),
					//	exitAnchor: new r.Pointer(r.uint16, Anchor, { type: 'parent' })
					//});

					//var MarkRecord = new r.Struct({
					//	class: r.uint16,
					//	markAnchor: new r.Pointer(r.uint16, Anchor, { type: 'parent' })
					//});

					//var MarkArray = new r.Array(MarkRecord, r.uint16);

					//var BaseRecord = new r.Array(new r.Pointer(r.uint16, Anchor), function (t) {
					//	return t.parent.classCount;
					//});
					//var BaseArray = new r.Array(BaseRecord, r.uint16);

					//var ComponentRecord = new r.Array(new r.Pointer(r.uint16, Anchor), function (t) {
					//	return t.parent.parent.classCount;
					//});
					//var LigatureAttach = new r.Array(ComponentRecord, r.uint16);
					//var LigatureArray = new r.Array(new r.Pointer(r.uint16, LigatureAttach), r.uint16);

					//var GPOSLookup = new r.VersionedStruct('lookupType', {
					//	1: new r.VersionedStruct(r.uint16, { // Single Adjustment
					//		1: { // Single positioning value
					//			coverage: new r.Pointer(r.uint16, Coverage),
					//			valueFormat: ValueFormat,
					//			value: new ValueRecord()
					//		},
					//		2: {
					//			coverage: new r.Pointer(r.uint16, Coverage),
					//			valueFormat: ValueFormat,
					//			valueCount: r.uint16,
					//			values: new r.LazyArray(new ValueRecord(), 'valueCount')
					//		}
					//	}),

					//	2: new r.VersionedStruct(r.uint16, { // Pair Adjustment Positioning
					//		1: { // Adjustments for glyph pairs
					//			coverage: new r.Pointer(r.uint16, Coverage),
					//			valueFormat1: ValueFormat,
					//			valueFormat2: ValueFormat,
					//			pairSetCount: r.uint16,
					//			pairSets: new r.LazyArray(new r.Pointer(r.uint16, PairSet), 'pairSetCount')
					//		},

					//		2: { // Class pair adjustment
					//			coverage: new r.Pointer(r.uint16, Coverage),
					//			valueFormat1: ValueFormat,
					//			valueFormat2: ValueFormat,
					//			classDef1: new r.Pointer(r.uint16, ClassDef),
					//			classDef2: new r.Pointer(r.uint16, ClassDef),
					//			class1Count: r.uint16,
					//			class2Count: r.uint16,
					//			classRecords: new r.LazyArray(new r.LazyArray(Class2Record, 'class2Count'), 'class1Count')
					//		}
					//	}),

					//	3: { // Cursive Attachment Positioning
					//		format: r.uint16,
					//		coverage: new r.Pointer(r.uint16, Coverage),
					//		entryExitCount: r.uint16,
					//		entryExitRecords: new r.Array(EntryExitRecord, 'entryExitCount')
					//	},

					//	4: { // MarkToBase Attachment Positioning
					//		format: r.uint16,
					//		markCoverage: new r.Pointer(r.uint16, Coverage),
					//		baseCoverage: new r.Pointer(r.uint16, Coverage),
					//		classCount: r.uint16,
					//		markArray: new r.Pointer(r.uint16, MarkArray),
					//		baseArray: new r.Pointer(r.uint16, BaseArray)
					//	},

					//	5: { // MarkToLigature Attachment Positioning
					//		format: r.uint16,
					//		markCoverage: new r.Pointer(r.uint16, Coverage),
					//		ligatureCoverage: new r.Pointer(r.uint16, Coverage),
					//		classCount: r.uint16,
					//		markArray: new r.Pointer(r.uint16, MarkArray),
					//		ligatureArray: new r.Pointer(r.uint16, LigatureArray)
					//	},

					//	6: { // MarkToMark Attachment Positioning
					//		format: r.uint16,
					//		mark1Coverage: new r.Pointer(r.uint16, Coverage),
					//		mark2Coverage: new r.Pointer(r.uint16, Coverage),
					//		classCount: r.uint16,
					//		mark1Array: new r.Pointer(r.uint16, MarkArray),
					//		mark2Array: new r.Pointer(r.uint16, BaseArray)
					//	},

					//	7: Context, // Contextual positioning
					//	8: ChainingContext, // Chaining contextual positioning

					//	9: { // Extension Positioning
					//		posFormat: r.uint16,
					//		lookupType: r.uint16, // cannot also be 9
					//		extension: new r.Pointer(r.uint32, GPOSLookup)
					//	}
					//});

					//// Fix circular reference
					//GPOSLookup.versions[9].extension.type = GPOSLookup;

					//var GPOS = new r.Struct({
					//	version: r.int32,
					//	scriptList: new r.Pointer(r.uint16, ScriptList),
					//	featureList: new r.Pointer(r.uint16, FeatureList),
					//	lookupList: new r.Pointer(r.uint16, new LookupList(GPOSLookup))
					//});

					//var Sequence = new r.Array(r.uint16, r.uint16);
					//var AlternateSet = Sequence;

					//var Ligature = new r.Struct({
					//	glyph: r.uint16,
					//	compCount: r.uint16,
					//	components: new r.Array(r.uint16, function (t) {
					//		return t.compCount - 1;
					//	})
					//});

					//var LigatureSet = new r.Array(new r.Pointer(r.uint16, Ligature), r.uint16);

					//var GSUBLookup = new r.VersionedStruct('lookupType', {
					//	1: new r.VersionedStruct(r.uint16, { // Single Substitution
					//		1: {
					//			coverage: new r.Pointer(r.uint16, Coverage),
					//			deltaGlyphID: r.int16
					//		},
					//		2: {
					//			coverage: new r.Pointer(r.uint16, Coverage),
					//			glyphCount: r.uint16,
					//			substitute: new r.LazyArray(r.uint16, 'glyphCount')
					//		}
					//	}),

					//	2: { // Multiple Substitution
					//		substFormat: r.uint16,
					//		coverage: new r.Pointer(r.uint16, Coverage),
					//		count: r.uint16,
					//		sequences: new r.LazyArray(new r.Pointer(r.uint16, Sequence), 'count')
					//	},

					//	3: { // Alternate Substitution
					//		substFormat: r.uint16,
					//		coverage: new r.Pointer(r.uint16, Coverage),
					//		count: r.uint16,
					//		alternateSet: new r.LazyArray(new r.Pointer(r.uint16, AlternateSet), 'count')
					//	},

					//	4: { // Ligature Substitution
					//		substFormat: r.uint16,
					//		coverage: new r.Pointer(r.uint16, Coverage),
					//		count: r.uint16,
					//		ligatureSets: new r.LazyArray(new r.Pointer(r.uint16, LigatureSet), 'count')
					//	},

					//	5: Context, // Contextual Substitution
					//	6: ChainingContext, // Chaining Contextual Substitution

					//	7: { // Extension Substitution
					//		substFormat: r.uint16,
					//		lookupType: r.uint16, // cannot also be 7
					//		extension: new r.Pointer(r.uint32, GSUBLookup)
					//	},

					//	8: { // Reverse Chaining Contextual Single Substitution
					//		substFormat: r.uint16,
					//		coverage: new r.Pointer(r.uint16, Coverage),
					//		backtrackCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'backtrackGlyphCount'),
					//		lookaheadGlyphCount: r.uint16,
					//		lookaheadCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'lookaheadGlyphCount'),
					//		glyphCount: r.uint16,
					//		substitutes: new r.Array(r.uint16, 'glyphCount')
					//	}
					//});

					//// Fix circular reference
					//GSUBLookup.versions[7].extension.type = GSUBLookup;

					//var GSUB = new r.Struct({
					//	version: r.int32,
					//	scriptList: new r.Pointer(r.uint16, ScriptList),
					//	featureList: new r.Pointer(r.uint16, FeatureList),
					//	lookupList: new r.Pointer(r.uint16, new LookupList(GSUBLookup))
					//});

					//var JstfGSUBModList = new r.Array(r.uint16, r.uint16);

					//var JstfPriority = new r.Struct({
					//	shrinkageEnableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
					//	shrinkageDisableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
					//	shrinkageEnableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
					//	shrinkageDisableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
					//	shrinkageJstfMax: new r.Pointer(r.uint16, new LookupList(GPOSLookup)),
					//	extensionEnableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
					//	extensionDisableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
					//	extensionEnableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
					//	extensionDisableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
					//	extensionJstfMax: new r.Pointer(r.uint16, new LookupList(GPOSLookup))
					//});

					//var JstfLangSys = new r.Array(new r.Pointer(r.uint16, JstfPriority), r.uint16);

					//var JstfLangSysRecord = new r.Struct({
					//	tag: new r.String(4),
					//	jstfLangSys: new r.Pointer(r.uint16, JstfLangSys)
					//});

					//var JstfScript = new r.Struct({
					//	extenderGlyphs: new r.Pointer(r.uint16, new r.Array(r.uint16, r.uint16)), // array of glyphs to extend line length
					//	defaultLangSys: new r.Pointer(r.uint16, JstfLangSys),
					//	langSysCount: r.uint16,
					//	langSysRecords: new r.Array(JstfLangSysRecord, 'langSysCount')
					//});

					//var JstfScriptRecord = new r.Struct({
					//	tag: new r.String(4),
					//	script: new r.Pointer(r.uint16, JstfScript, { type: 'parent' })
					//});

					//var JSTF = new r.Struct({
					//	version: r.uint32, // should be 0x00010000
					//	scriptCount: r.uint16,
					//	scriptList: new r.Array(JstfScriptRecord, 'scriptCount')
					//});

					//var Signature = new r.Struct({
					//	format: r.uint32,
					//	length: r.uint32,
					//	offset: r.uint32
					//});

					//var SignatureBlock = new r.Struct({
					//	reserved: new r.Reserved(r.uint16, 2),
					//	cbSignature: r.uint32, // Length (in bytes) of the PKCS#7 packet in pbSignature
					//	signature: new r.Buffer('cbSignature')
					//});

					//var DSIG = new r.Struct({
					//	ulVersion: r.uint32, // Version number of the DSIG table (0x00000001)
					//	usNumSigs: r.uint16, // Number of signatures in the table
					//	usFlag: r.uint16, // Permission flags
					//	signatures: new r.Array(Signature, 'usNumSigs'),
					//	signatureBlocks: new r.Array(SignatureBlock, 'usNumSigs')
					//});

					//var GaspRange = new r.Struct({
					//	rangeMaxPPEM: r.uint16, // Upper limit of range, in ppem
					//	rangeGaspBehavior: new r.Bitfield(r.uint16, [// Flags describing desired rasterizer behavior
					//		'grayscale', 'gridfit', 'symmetricSmoothing', 'symmetricGridfit' // only in version 1, for ClearType
					//	])
					//});

					//var gasp = new r.Struct({
					//	version: r.uint16, // set to 0
					//	numRanges: r.uint16,
					//	gaspRanges: new r.Array(GaspRange, 'numRanges') // Sorted by ppem
					//});

					//var DeviceRecord = new r.Struct({
					//	pixelSize: r.uint8,
					//	maximumWidth: r.uint8,
					//	widths: new r.Array(r.uint8, function (t) {
					//		return t.parent.parent.maxp.numGlyphs;
					//	})
					//});

					//// The Horizontal Device Metrics table stores integer advance widths scaled to particular pixel sizes
					//var hdmx = new r.Struct({
					//	version: r.uint16,
					//	numRecords: r.int16,
					//	sizeDeviceRecord: r.int32,
					//	records: new r.Array(DeviceRecord, 'numRecords')
					//});

					//var KernPair = new r.Struct({
					//	left: r.uint16,
					//	right: r.uint16,
					//	value: r.int16
					//});

					//var ClassTable = new r.Struct({
					//	firstGlyph: r.uint16,
					//	nGlyphs: r.uint16,
					//	offsets: new r.Array(r.uint16, 'nGlyphs'),
					//	max: function max(t) {
					//		return t.offsets.length && Math.max.apply(Math, t.offsets);
					//	}
					//});

					//var Kern2Array = new r.Struct({
					//	off: function off(t) {
					//		return t._startOffset - t.parent.parent._startOffset;
					//	},
					//	len: function len(t) {
					//		return ((t.parent.leftTable.max - t.off) / t.parent.rowWidth + 1) * (t.parent.rowWidth / 2);
					//	},
					//	values: new r.LazyArray(r.int16, 'len')
					//});

					//var KernSubtable = new r.VersionedStruct('format', {
					//	0: {
					//		nPairs: r.uint16,
					//		searchRange: r.uint16,
					//		entrySelector: r.uint16,
					//		rangeShift: r.uint16,
					//		pairs: new r.Array(KernPair, 'nPairs')
					//	},

					//	2: {
					//		rowWidth: r.uint16,
					//		leftTable: new r.Pointer(r.uint16, ClassTable, { type: 'parent' }),
					//		rightTable: new r.Pointer(r.uint16, ClassTable, { type: 'parent' }),
					//		array: new r.Pointer(r.uint16, Kern2Array, { type: 'parent' })
					//	},

					//	3: {
					//		glyphCount: r.uint16,
					//		kernValueCount: r.uint8,
					//		leftClassCount: r.uint8,
					//		rightClassCount: r.uint8,
					//		flags: r.uint8,
					//		kernValue: new r.Array(r.int16, 'kernValueCount'),
					//		leftClass: new r.Array(r.uint8, 'glyphCount'),
					//		rightClass: new r.Array(r.uint8, 'glyphCount'),
					//		kernIndex: new r.Array(r.uint8, function (t) {
					//			return t.leftClassCount * t.rightClassCount;
					//		})
					//	}
					//});

					//var KernTable = new r.VersionedStruct('version', {
					//	0: { // Microsoft uses this format
					//		subVersion: r.uint16, // Microsoft has an extra sub-table version number
					//		length: r.uint16, // Length of the subtable, in bytes
					//		format: r.uint8, // Format of subtable
					//		coverage: new r.Bitfield(r.uint8, ['horizontal', // 1 if table has horizontal data, 0 if vertical
					//			'minimum', // If set to 1, the table has minimum values. If set to 0, the table has kerning values.
					//			'crossStream', // If set to 1, kerning is perpendicular to the flow of the text
					//			'override' // If set to 1 the value in this table replaces the accumulated value
					//		]),
					//		subtable: KernSubtable,
					//		padding: new r.Reserved(r.uint8, function (t) {
					//			return t.length - t._currentOffset;
					//		})
					//	},
					//	1: { // Apple uses this format
					//		length: r.uint32,
					//		coverage: new r.Bitfield(r.uint8, [null, null, null, null, null, 'variation', // Set if table has variation kerning values
					//			'crossStream', // Set if table has cross-stream kerning values
					//			'vertical' // Set if table has vertical kerning values
					//		]),
					//		format: r.uint8,
					//		tupleIndex: r.uint16,
					//		subtable: KernSubtable,
					//		padding: new r.Reserved(r.uint8, function (t) {
					//			return t.length - t._currentOffset;
					//		})
					//	}
					//});

					//var kern = new r.VersionedStruct(r.uint16, {
					//	0: { // Microsoft Version
					//		nTables: r.uint16,
					//		tables: new r.Array(KernTable, 'nTables')
					//	},

					//	1: { // Apple Version
					//		reserved: new r.Reserved(r.uint16), // the other half of the version number
					//		nTables: r.uint32,
					//		tables: new r.Array(KernTable, 'nTables')
					//	}
					//});

					//// Linear Threshold table
					//// Records the ppem for each glyph at which the scaling becomes linear again,
					//// despite instructions effecting the advance width
					//var LTSH = new r.Struct({
					//	version: r.uint16,
					//	numGlyphs: r.uint16,
					//	yPels: new r.Array(r.uint8, 'numGlyphs')
					//});

					//// PCL 5 Table
					//// NOTE: The PCLT table is strongly discouraged for OpenType fonts with TrueType outlines
					//var PCLT = new r.Struct({
					//	version: r.uint16,
					//	fontNumber: r.uint32,
					//	pitch: r.uint16,
					//	xHeight: r.uint16,
					//	style: r.uint16,
					//	typeFamily: r.uint16,
					//	capHeight: r.uint16,
					//	symbolSet: r.uint16,
					//	typeface: new r.String(16),
					//	characterComplement: new r.String(8),
					//	fileName: new r.String(6),
					//	strokeWeight: new r.String(1),
					//	widthType: new r.String(1),
					//	serifStyle: r.uint8,
					//	reserved: new r.Reserved(r.uint8)
					//});

					// VDMX tables contain ascender/descender overrides for certain (usually small)
					// sizes. This is needed in order to match font metrics on Windows.

					//var Ratio = new r.Struct({
					//	bCharSet: r.uint8, // Character set
					//	xRatio: r.uint8, // Value to use for x-Ratio
					//	yStartRatio: r.uint8, // Starting y-Ratio value
					//	yEndRatio: r.uint8 // Ending y-Ratio value
					//});

					//var vTable = new r.Struct({
					//	yPelHeight: r.uint16, // yPelHeight to which values apply
					//	yMax: r.int16, // Maximum value (in pels) for this yPelHeight
					//	yMin: r.int16 // Minimum value (in pels) for this yPelHeight
					//});

					//var VdmxGroup = new r.Struct({
					//	recs: r.uint16, // Number of height records in this group
					//	startsz: r.uint8, // Starting yPelHeight
					//	endsz: r.uint8, // Ending yPelHeight
					//	entries: new r.Array(vTable, 'recs') // The VDMX records
					//});

					//var VDMX = new r.Struct({
					//	version: r.uint16, // Version number (0 or 1)
					//	numRecs: r.uint16, // Number of VDMX groups present
					//	numRatios: r.uint16, // Number of aspect ratio groupings
					//	ratioRanges: new r.Array(Ratio, 'numRatios'), // Ratio ranges
					//	offsets: new r.Array(r.uint16, 'numRatios'), // Offset to the VDMX group for this ratio range
					//	groups: new r.Array(VdmxGroup, 'numRecs') // The actual VDMX groupings
					//});

					//// Vertical Header Table
					//var vhea = new r.Struct({
					//	version: r.uint16, // Version number of the Vertical Header Table
					//	ascent: r.int16, // The vertical typographic ascender for this font
					//	descent: r.int16, // The vertical typographic descender for this font
					//	lineGap: r.int16, // The vertical typographic line gap for this font
					//	advanceHeightMax: r.int16, // The maximum advance height measurement found in the font
					//	minTopSideBearing: r.int16, // The minimum top side bearing measurement found in the font
					//	minBottomSideBearing: r.int16, // The minimum bottom side bearing measurement found in the font
					//	yMaxExtent: r.int16,
					//	caretSlopeRise: r.int16, // Caret slope (rise/run)
					//	caretSlopeRun: r.int16,
					//	caretOffset: r.int16, // Set value equal to 0 for nonslanted fonts
					//	reserved: new r.Reserved(r.int16, 4),
					//	metricDataFormat: r.int16, // Set to 0
					//	numberOfMetrics: r.uint16 // Number of advance heights in the Vertical Metrics table
					//});

					//var VmtxEntry = new r.Struct({
					//	advance: r.uint16, // The advance height of the glyph
					//	bearing: r.int16 // The top sidebearing of the glyph
					//});

					//// Vertical Metrics Table
					//var vmtx = new r.Struct({
					//	metrics: new r.LazyArray(VmtxEntry, function (t) {
					//		return t.parent.vhea.numberOfMetrics;
					//	}),
					//	bearings: new r.LazyArray(r.int16, function (t) {
					//		return t.parent.maxp.numGlyphs - t.parent.vhea.numberOfMetrics;
					//	})
					//});

					//var shortFrac = new r.Fixed(16, 'BE', 14);

					//var Correspondence = new r.Struct({
					//	fromCoord: shortFrac,
					//	toCoord: shortFrac
					//});

					//var Segment = new r.Struct({
					//	pairCount: r.uint16,
					//	correspondence: new r.Array(Correspondence, 'pairCount')
					//});

					//var avar = new r.Struct({
					//	version: r.fixed32,
					//	axisCount: r.uint32,
					//	segment: new r.Array(Segment, 'axisCount')
					//});

					//var UnboundedArrayAccessor = function () {
					//	function UnboundedArrayAccessor(type, stream, parent) {
					//		_classCallCheck(this, UnboundedArrayAccessor);

					//		this.type = type;
					//		this.stream = stream;
					//		this.parent = parent;
					//		this.base = this.stream.pos;
					//		this._items = [];
					//	}

					//	_createClass(UnboundedArrayAccessor, [{
					//		key: 'getItem',
					//		value: function getItem(index) {
					//			if (this._items[index] == null) {
					//				var pos = this.stream.pos;
					//				this.stream.pos = this.base + this.type.size(null, this.parent) * index;
					//				this._items[index] = this.type.decode(this.stream, this.parent);
					//				this.stream.pos = pos;
					//			}

					//			return this._items[index];
					//		}
					//	}, {
					//			key: 'inspect',
					//			value: function inspect() {
					//				return '[UnboundedArray ' + this.type.constructor.name + ']';
					//			}
					//		}]);

					//	return UnboundedArrayAccessor;
					//} ();

					//var UnboundedArray: (...args) => void = function (_r$Array) {
					//	_inherits(UnboundedArray, _r$Array);

					//	function UnboundedArray(type) {
					//		_classCallCheck(this, UnboundedArray);

					//		return _possibleConstructorReturn(this, (UnboundedArray.__proto__ || _Object$getPrototypeOf(UnboundedArray)).call(this, type, 0));
					//	}

					//	_createClass(UnboundedArray, [{
					//		key: 'decode',
					//		value: function decode(stream, parent) {
					//			return new UnboundedArrayAccessor(this.type, stream, parent);
					//		}
					//	}]);

					//	return UnboundedArray;
					//} (r.Array);

					//var LookupTable: (...args) => void = function LookupTable() {
					//	var ValueType = arguments.length <= 0 || arguments[0] === undefined ? r.uint16 : arguments[0];

					//	// Helper class that makes internal structures invisible to pointers
					//	var Shadow = function () {
					//		function Shadow(type) {
					//			_classCallCheck(this, Shadow);

					//			this.type = type;
					//		}

					//		_createClass(Shadow, [{
					//			key: 'decode',
					//			value: function decode(stream, ctx) {
					//				ctx = ctx.parent.parent;
					//				return this.type.decode(stream, ctx);
					//			}
					//		}, {
					//				key: 'size',
					//				value: function size(val, ctx) {
					//					ctx = ctx.parent.parent;
					//					return this.type.size(val, ctx);
					//				}
					//			}, {
					//				key: 'encode',
					//				value: function encode(stream, val, ctx) {
					//					ctx = ctx.parent.parent;
					//					return this.type.encode(stream, val, ctx);
					//				}
					//			}]);

					//		return Shadow;
					//	} ();

					//	ValueType = new Shadow(ValueType);

					//	var BinarySearchHeader = new r.Struct({
					//		unitSize: r.uint16,
					//		nUnits: r.uint16,
					//		searchRange: r.uint16,
					//		entrySelector: r.uint16,
					//		rangeShift: r.uint16
					//	});

					//	var LookupSegmentSingle = new r.Struct({
					//		lastGlyph: r.uint16,
					//		firstGlyph: r.uint16,
					//		value: ValueType
					//	});

					//	var LookupSegmentArray = new r.Struct({
					//		lastGlyph: r.uint16,
					//		firstGlyph: r.uint16,
					//		values: new r.Pointer(r.uint16, new r.Array(ValueType, function (t) {
					//			return t.lastGlyph - t.firstGlyph + 1;
					//		}), { type: 'parent' })
					//	});

					//	var LookupSingle = new r.Struct({
					//		glyph: r.uint16,
					//		value: ValueType
					//	});

					//	return new r.VersionedStruct(r.uint16, {
					//		0: {
					//			values: new UnboundedArray(ValueType) // length == number of glyphs maybe?
					//		},
					//		2: {
					//			binarySearchHeader: BinarySearchHeader,
					//			segments: new r.Array(LookupSegmentSingle, function (t) {
					//				return t.binarySearchHeader.nUnits;
					//			})
					//		},
					//		4: {
					//			binarySearchHeader: BinarySearchHeader,
					//			segments: new r.Array(LookupSegmentArray, function (t) {
					//				return t.binarySearchHeader.nUnits;
					//			})
					//		},
					//		6: {
					//			binarySearchHeader: BinarySearchHeader,
					//			segments: new r.Array(LookupSingle, function (t) {
					//				return t.binarySearchHeader.nUnits;
					//			})
					//		},
					//		8: {
					//			firstGlyph: r.uint16,
					//			count: r.uint16,
					//			values: new r.Array(ValueType, 'count')
					//		}
					//	});
					//};

					//function StateTable(farg?): void {
					//	var entryData = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
					//	var lookupType = arguments.length <= 1 || arguments[1] === undefined ? r.uint16 : arguments[1];

					//	var entry = _Object$assign({
					//		newState: r.uint16,
					//		flags: r.uint16
					//	}, entryData);

					//	var Entry = new r.Struct(entry);
					//	var StateArray = new UnboundedArray(new r.Array(r.uint16, function (t) {
					//		return t.nClasses;
					//	}));

					//	var StateHeader = new r.Struct({
					//		nClasses: r.uint32,
					//		classTable: new r.Pointer(r.uint32, new LookupTable(lookupType)),
					//		stateArray: new r.Pointer(r.uint32, StateArray),
					//		entryTable: new r.Pointer(r.uint32, new UnboundedArray(Entry))
					//	});

					//	return StateHeader;
					//}

					//// This is the old version of the StateTable structure
					//function StateTable1(): void {
					//	var entryData = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
					//	var lookupType = arguments.length <= 1 || arguments[1] === undefined ? r.uint16 : arguments[1];

					//	var ClassLookupTable = new r.Struct({
					//		version: function version() {
					//			return 8;
					//		},
					//		// simulate LookupTable
					//		firstGlyph: r.uint16,
					//		values: new r.Array(r.uint8, r.uint16)
					//	});

					//	var entry = _Object$assign({
					//		newStateOffset: r.uint16,
					//		// convert offset to stateArray index
					//		newState: function newState(t) {
					//			return (t.newStateOffset - (t.parent.stateArray.base - t.parent._startOffset)) / t.parent.nClasses;
					//		},
					//		flags: r.uint16
					//	}, entryData);

					//	var Entry = new r.Struct(entry);
					//	var StateArray = new UnboundedArray(new r.Array(r.uint8, function (t) {
					//		return t.nClasses;
					//	}));

					//	var StateHeader1 = new r.Struct({
					//		nClasses: r.uint16,
					//		classTable: new r.Pointer(r.uint16, ClassLookupTable),
					//		stateArray: new r.Pointer(r.uint16, StateArray),
					//		entryTable: new r.Pointer(r.uint16, new UnboundedArray(Entry))
					//	});

					//	return StateHeader1;
					//}

					//var BslnSubtable = new r.VersionedStruct('format', {
					//	0: { // Distance-based, no mapping
					//		deltas: new r.Array(r.int16, 32)
					//	},

					//	1: { // Distance-based, with mapping
					//		deltas: new r.Array(r.int16, 32),
					//		mappingData: new LookupTable(r.uint16)
					//	},

					//	2: { // Control point-based, no mapping
					//		standardGlyph: r.uint16,
					//		controlPoints: new r.Array(r.uint16, 32)
					//	},

					//	3: { // Control point-based, with mapping
					//		standardGlyph: r.uint16,
					//		controlPoints: new r.Array(r.uint16, 32),
					//		mappingData: new LookupTable(r.uint16)
					//	}
					//});

					//var bsln = new r.Struct({
					//	version: r.fixed32,
					//	format: r.uint16,
					//	defaultBaseline: r.uint16,
					//	subtable: BslnSubtable
					//});

					//var Setting = new r.Struct({
					//	setting: r.uint16,
					//	nameIndex: r.int16,
					//	name: function name() {
					//		return this.parent.parent.parent.name.records.fontFeatures.English[this.nameIndex];
					//	}
					//});

					//var FeatureName = new r.Struct({
					//	feature: r.uint16,
					//	nSettings: r.uint16,
					//	settingTable: new r.Pointer(r.uint32, new r.Array(Setting, 'nSettings'), { type: 'parent' }),
					//	featureFlags: new r.Bitfield(r.uint8, [null, null, null, null, null, null, 'hasDefault', 'exclusive']),
					//	defaultSetting: r.uint8,
					//	nameIndex: r.int16,
					//	name: function name() {
					//		return this.parent.parent.name.records.fontFeatures.English[this.nameIndex];
					//	}
					//});

					//var feat = new r.Struct({
					//	version: r.fixed32,
					//	featureNameCount: r.uint16,
					//	reserved1: new r.Reserved(r.uint16),
					//	reserved2: new r.Reserved(r.uint32),
					//	featureNames: new r.Array(FeatureName, 'featureNameCount')
					//});

					//function getName() {
					//	var features = this.parent.parent.name.records.fontFeatures;
					//	return features && features.English && features.English[this.nameID];
					//}

					//var Axis$1 = new r.Struct({
					//	axisTag: new r.String(4),
					//	minValue: r.fixed32,
					//	defaultValue: r.fixed32,
					//	maxValue: r.fixed32,
					//	flags: r.uint16,
					//	nameID: r.uint16,
					//	name: getName
					//});

					//var Instance = new r.Struct({
					//	nameID: r.uint16,
					//	name: getName,
					//	flags: r.uint16,
					//	coord: new r.Array(r.fixed32, function (t) {
					//		return t.parent.axisCount;
					//	})
					//});

					//var fvar = new r.Struct({
					//	version: r.fixed32,
					//	offsetToData: r.uint16,
					//	countSizePairs: r.uint16,
					//	axisCount: r.uint16,
					//	axisSize: r.uint16,
					//	instanceCount: r.uint16,
					//	instanceSize: r.uint16,
					//	axis: new r.Array(Axis$1, 'axisCount'),
					//	instance: new r.Array(Instance, 'instanceCount')
					//});

					//var shortFrac$1 = new r.Fixed(16, 'BE', 14);

					//var gvar = new r.Struct({
					//	version: r.uint16,
					//	reserved: new r.Reserved(r.uint16),
					//	axisCount: r.uint16,
					//	globalCoordCount: r.uint16,
					//	globalCoords: new r.Pointer(r.uint32, new r.Array(new r.Array(shortFrac$1, 'axisCount'), 'globalCoordCount')),
					//	glyphCount: r.uint16,
					//	flags: r.uint16,
					//	offsetToData: r.uint32
					//});

					//gvar.process = function (stream) {
					//	var type = this.flags === 1 ? r.uint32 : r.uint16;
					//	var ptr = new r.Pointer(type, 'void', { relativeTo: 'offsetToData', allowNull: false });
					//	this.offsets = new r.Array(ptr, this.glyphCount + 1).decode(stream, this);

					//	if (this.flags === 0) {
					//		// In short format, offsets are multiplied by 2.
					//		// This doesn't seem to be documented by Apple, but it
					//		// is implemented this way in Freetype.
					//		for (var i = 0; i < this.offsets.length; i++) {
					//			this.offsets[i] *= 2;
					//		}
					//	}

					//	return;
					//};

					//var ClassTable$1 = new r.Struct({
					//	length: r.uint16,
					//	coverage: r.uint16,
					//	subFeatureFlags: r.uint32,
					//	stateTable: new StateTable1()
					//});

					//var WidthDeltaRecord = new r.Struct({
					//	justClass: r.uint32,
					//	beforeGrowLimit: r.fixed32,
					//	beforeShrinkLimit: r.fixed32,
					//	afterGrowLimit: r.fixed32,
					//	afterShrinkLimit: r.fixed32,
					//	growFlags: r.uint16,
					//	shrinkFlags: r.uint16
					//});

					//var WidthDeltaCluster = new r.Array(WidthDeltaRecord, r.uint32);

					//var ActionData = new r.VersionedStruct('actionType', {
					//	0: { // Decomposition action
					//		lowerLimit: r.fixed32,
					//		upperLimit: r.fixed32,
					//		order: r.uint16,
					//		glyphs: new r.Array(r.uint16, r.uint16)
					//	},

					//	1: { // Unconditional add glyph action
					//		addGlyph: r.uint16
					//	},

					//	2: { // Conditional add glyph action
					//		substThreshold: r.fixed32,
					//		addGlyph: r.uint16,
					//		substGlyph: r.uint16
					//	},

					//	3: {}, // Stretch glyph action (no data, not supported by CoreText)

					//	4: { // Ductile glyph action (not supported by CoreText)
					//		variationAxis: r.uint32,
					//		minimumLimit: r.fixed32,
					//		noStretchValue: r.fixed32,
					//		maximumLimit: r.fixed32
					//	},

					//	5: { // Repeated add glyph action
					//		flags: r.uint16,
					//		glyph: r.uint16
					//	}
					//});

					//var Action = new r.Struct({
					//	actionClass: r.uint16,
					//	actionType: r.uint16,
					//	actionLength: r.uint32,
					//	actionData: ActionData,
					//	padding: new r.Reserved(r.uint8, function (t) {
					//		return t.actionLength - t._currentOffset;
					//	})
					//});

					//var PostcompensationAction = new r.Array(Action, r.uint32);
					//var PostCompensationTable = new r.Struct({
					//	lookupTable: new LookupTable(new r.Pointer(r.uint16, PostcompensationAction))
					//});

					//var JustificationTable = new r.Struct({
					//	classTable: new r.Pointer(r.uint16, ClassTable$1, { type: 'parent' }),
					//	wdcOffset: r.uint16,
					//	postCompensationTable: new r.Pointer(r.uint16, PostCompensationTable, { type: 'parent' }),
					//	widthDeltaClusters: new LookupTable(new r.Pointer(r.uint16, WidthDeltaCluster, { type: 'parent', relativeTo: 'wdcOffset' }))
					//});

					//var just = new r.Struct({
					//	version: r.uint32,
					//	format: r.uint16,
					//	horizontal: new r.Pointer(r.uint16, JustificationTable),
					//	vertical: new r.Pointer(r.uint16, JustificationTable)
					//});

					//var LigatureData = {
					//	action: r.uint16
					//};

					//var ContextualData = {
					//	markIndex: r.uint16,
					//	currentIndex: r.uint16
					//};

					//var InsertionData = {
					//	currentInsertIndex: r.uint16,
					//	markedInsertIndex: r.uint16
					//};

					//var SubstitutionTable = new r.Struct({
					//	items: new UnboundedArray(new r.Pointer(r.uint32, new LookupTable()))
					//});

					//var SubtableData = new r.VersionedStruct('type', {
					//	0: { // Indic Rearrangement Subtable
					//		stateTable: new StateTable()
					//	},

					//	1: { // Contextual Glyph Substitution Subtable
					//		stateTable: new StateTable(ContextualData),
					//		substitutionTable: new r.Pointer(r.uint32, SubstitutionTable)
					//	},

					//	2: { // Ligature subtable
					//		stateTable: new StateTable(LigatureData),
					//		ligatureActions: new r.Pointer(r.uint32, new UnboundedArray(r.uint32)),
					//		components: new r.Pointer(r.uint32, new UnboundedArray(r.uint16)),
					//		ligatureList: new r.Pointer(r.uint32, new UnboundedArray(r.uint16))
					//	},

					//	4: { // Non-contextual Glyph Substitution Subtable
					//		lookupTable: new LookupTable()
					//	},

					//	5: { // Glyph Insertion Subtable
					//		stateTable: new StateTable(InsertionData),
					//		insertionActions: new r.Pointer(r.uint32, new UnboundedArray(r.uint16))
					//	}
					//});

					//var Subtable = new r.Struct({
					//	length: r.uint32,
					//	coverage: r.uint24,
					//	type: r.uint8,
					//	subFeatureFlags: r.uint32,
					//	table: SubtableData,
					//	padding: new r.Reserved(r.uint8, function (t) {
					//		return t.length - t._currentOffset;
					//	})
					//});

					//var FeatureEntry = new r.Struct({
					//	featureType: r.uint16,
					//	featureSetting: r.uint16,
					//	enableFlags: r.uint32,
					//	disableFlags: r.uint32
					//});

					//var MorxChain = new r.Struct({
					//	defaultFlags: r.uint32,
					//	chainLength: r.uint32,
					//	nFeatureEntries: r.uint32,
					//	nSubtables: r.uint32,
					//	features: new r.Array(FeatureEntry, 'nFeatureEntries'),
					//	subtables: new r.Array(Subtable, 'nSubtables')
					//});

					//var morx = new r.Struct({
					//	version: r.uint16,
					//	unused: new r.Reserved(r.uint16),
					//	nChains: r.uint32,
					//	chains: new r.Array(MorxChain, 'nChains')
					//});

					//var OpticalBounds = new r.Struct({
					//	left: r.int16,
					//	top: r.int16,
					//	right: r.int16,
					//	bottom: r.int16
					//});

					//var opbd = new r.Struct({
					//	version: r.fixed32,
					//	format: r.uint16,
					//	lookupTable: new LookupTable(OpticalBounds)
					//});

					var tables: any = {};
					// Required Tables
					tables.cmap = cmap;
					tables.head = head;
					tables.hhea = hhea;
					tables.hmtx = hmtx;
					tables.maxp = maxp;
					tables.name = NameTable;
					tables['OS/2'] = OS2;
					tables.post = post;

					// TrueType Outlines
					//tables.fpgm = fpgm;
					tables.loca = loca;
					//tables.prep = prep;
					//tables['cvt '] = cvt;
					tables.glyf = glyf;

					// PostScript Outlines
					//tables['CFF '] = CFFFont;
					//tables.VORG = VORG;

					// Bitmap Glyphs
					//tables.EBLC = EBLC;
					//tables.CBLC = tables.EBLC;
					//tables.sbix = sbix;
					//tables.COLR = COLR;
					//tables.CPAL = CPAL;

					// Advanced OpenType Tables
					//tables.BASE = BASE;
					//tables.GDEF = GDEF;
					//tables.GPOS = GPOS;
					//tables.GSUB = GSUB;
					//tables.JSTF = JSTF;

					// Other OpenType Tables
					//tables.DSIG = DSIG;
					//tables.gasp = gasp;
					//tables.hdmx = hdmx;
					//tables.kern = kern;
					//tables.LTSH = LTSH;
					//tables.PCLT = PCLT;
					//tables.VDMX = VDMX;
					//tables.vhea = vhea;
					//tables.vmtx = vmtx;

					// Apple Advanced Typography Tables
					//tables.avar = avar;
					//tables.bsln = bsln;
					//tables.feat = feat;
					//tables.fvar = fvar;
					//tables.gvar = gvar;
					//tables.just = just;
					//tables.morx = morx;
					//tables.opbd = opbd;

					var TableEntry = new r.Struct({
						tag: new r.String(4),
						checkSum: r.uint32,
						offset: new r.Pointer(r.uint32, 'void', { type: 'global' }),
						length: r.uint32
					});

					var Directory = new r.Struct({
						tag: new r.String(4),
						numTables: r.uint16,
						searchRange: r.uint16,
						entrySelector: r.uint16,
						rangeShift: r.uint16,
						tables: new r.Array(TableEntry, 'numTables')
					});

					Directory.process = function () {
						var tables = {};
						Object.keys(this.tables).forEach(okey => {
							var table = this.tables[okey];
							tables[table.tag] = table;
						});
						this.tables = tables;
					};

					Directory.preEncode = function (stream) {
						var tables$$ = [];
						for (var tag in this.tables) {
							var table = this.tables[tag];
							if (table) {
								tables$$.push({
									tag: tag,
									checkSum: 0,
									offset: new r.VoidPointer(tables[tag], table),
									length: tables[tag].size(table)
								});
							}
						}

						this.tag = 'true';
						this.numTables = tables$$.length;
						this.tables = tables$$;

						this.searchRange = Math.floor(Math.log(this.numTables) / Math.LN2) * 16;
						this.entrySelector = Math.floor(this.searchRange / Math.LN2);
						this.rangeShift = this.numTables * 16 - this.searchRange;
					};

					var CmapProcessor = function () {
						function CmapProcessor(cmapTable) {
							_classCallCheck(this, CmapProcessor);

							this._characterSet = null;

							// find the unicode cmap
							var keys = Object.keys(cmapTable.tables);

							// check for a 32-bit cmap first
							for (var i = 0; i < keys.length; i++) {
								cmap = cmapTable.tables[keys[i]];
								// unicode or windows platform
								if ((cmap.platformID === 0 && (cmap.encodingID === 4 || cmap.encodingID === 6)) || (cmap.platformID === 3 && cmap.encodingID === 10)) {
									this.cmap = cmap.table;
									return;
								}
							}

							// try "old" 16-bit cmap
							for (var i = 0; i < keys.length; i++) {
								cmap = cmapTable.tables[keys[i]];

								if (cmap.platformID === 0 || (cmap.platformID === 3 && cmap.encodingID === 1)) {
									this.cmap = cmap.table;
									return;
								}
							}

							throw new Error("Could not find a unicode cmap");
						}

						_createClass(CmapProcessor, [{
							key: 'lookup',
							value: function lookup(codepoint) {
								var cmap = this.cmap;
								switch (cmap.version) {
									case 0:
										return cmap.codeMap.get(codepoint) || 0;

									case 4:
										{
											var min = 0;
											var max = cmap.segCount - 1;
											while (min <= max) {
												var mid = min + max >> 1;

												if (codepoint < cmap.startCode.get(mid)) {
													max = mid - 1;
												} else if (codepoint > cmap.endCode.get(mid)) {
													min = mid + 1;
												} else {
													var rangeOffset = cmap.idRangeOffset.get(mid);
													var gid = void 0;

													if (rangeOffset === 0) {
														gid = codepoint + cmap.idDelta.get(mid);
													} else {
														var index = rangeOffset / 2 + (codepoint - cmap.startCode.get(mid)) - (cmap.segCount - mid);
														gid = cmap.glyphIndexArray.get(index) || 0;
														if (gid !== 0) {
															gid += cmap.idDelta.get(mid);
														}
													}

													return gid & 0xffff;
												}
											}

											return 0;
										}

									case 8:
										throw new Error('TODO: cmap format 8');

									case 6:
									case 10:
										return cmap.glyphIndices.get(codepoint - cmap.firstCode) || 0;

									case 12:
									case 13:
										{
											var _min = 0;
											var _max = cmap.nGroups - 1;
											while (_min <= _max) {
												var _mid = _min + _max >> 1;
												var group = cmap.groups.get(_mid);

												if (codepoint < group.startCharCode) {
													_max = _mid - 1;
												} else if (codepoint > group.endCharCode) {
													_min = _mid + 1;
												} else {
													if (cmap.version === 12) {
														return group.glyphID + (codepoint - group.startCharCode);
													} else {
														return group.glyphID;
													}
												}
											}

											return 0;
										}

									case 14:
										throw new Error('TODO: cmap format 14');

									default:
										throw new Error('Unknown cmap format ' + cmap.version);
								}
							}
						}, {
								key: 'getCharacterSet',
								value: function getCharacterSet() {
									if (this._characterSet) {
										return this._characterSet;
									}

									var cmap = this.cmap;
									switch (cmap.version) {
										case 0:
											return this._characterSet = range(0, cmap.codeMap.length);

										case 4:
											{
												var res = [];
												var endCodes = cmap.endCode.toArray();
												for (var i = 0; i < endCodes.length; i++) {
													var tail = endCodes[i] + 1;
													var start = cmap.startCode.get(i);
													res.push.apply(res, _toConsumableArray(range(start, tail)));
												}

												return this._characterSet = res;
											}

										case 8:
											throw new Error('TODO: cmap format 8');

										case 6:
										case 10:
											return this._characterSet = range(cmap.firstCode, cmap.firstCode + cmap.glyphIndices.length);

										case 12:
										case 13:
											{
												let res = [];
												let ga = cmap.groups.toArray();

												for (var i = 0; i < ga.length; i++) {
													let group = ga[i];
													res.push.apply(res, _toConsumableArray(range(group.startCharCode, group.endCharCode + 1)));

												}

												return this._characterSet = res;
											}

										case 14:
											throw new Error('TODO: cmap format 14');

										default:
											throw new Error('Unknown cmap format ' + cmap.version);
									}
								}
							}]);

						return CmapProcessor;
					} ();

					function range(index, end) {
						var range = [];
						while (index < end) {
							range.push(index++);
						}
						return range;
					}

					//var KernProcessor = function () {
					//	function KernProcessor(font) {
					//		_classCallCheck(this, KernProcessor);

					//		this.kern = font.kern;
					//	}

					//	_createClass(KernProcessor, [{
					//		key: "process",
					//		value: function process(glyphs, positions) {
					//			for (var glyphIndex = 0; glyphIndex < glyphs.length - 1; glyphIndex++) {
					//				var left = glyphs[glyphIndex].id;
					//				var right = glyphs[glyphIndex + 1].id;
					//				positions[glyphIndex].xAdvance += this.getKerning(left, right);
					//			}
					//		}
					//	}, {
					//			key: "getKerning",
					//			value: function getKerning(left, right) {
					//				var res = 0;

					//				var _iteratorNormalCompletion = true;
					//				var _didIteratorError = false;
					//				var _iteratorError = undefined;

					//				try {
					//					for (var _iterator = _getIterator(this.kern.tables), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
					//						var table = _step.value;

					//						if (table.coverage.crossStream) {
					//							continue;
					//						}

					//						switch (table.version) {
					//							case 0:
					//								if (!table.coverage.horizontal) {
					//									continue;
					//								}

					//								break;
					//							case 1:
					//								if (table.coverage.vertical || table.coverage.variation) {
					//									continue;
					//								}

					//								break;
					//							default:
					//								throw new Error("Unsupported kerning table version " + table.version);
					//						}

					//						var val = 0;
					//						var s = table.subtable;
					//						switch (table.format) {
					//							case 0:
					//								// TODO: binary search
					//								var _iteratorNormalCompletion2 = true;
					//								var _didIteratorError2 = false;
					//								var _iteratorError2 = undefined;

					//								try {
					//									for (var _iterator2 = _getIterator(s.pairs), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
					//										var pair = _step2.value;

					//										if (pair.left === left && pair.right === right) {
					//											val = pair.value;
					//											break;
					//										}
					//									}
					//								} catch (err) {
					//									_didIteratorError2 = true;
					//									_iteratorError2 = err;
					//								} finally {
					//									try {
					//										if (!_iteratorNormalCompletion2 && _iterator2.return) {
					//											_iterator2.return();
					//										}
					//									} finally {
					//										if (_didIteratorError2) {
					//											throw _iteratorError2;
					//										}
					//									}
					//								}

					//								break;

					//							case 2:
					//								var leftOffset = 0,
					//									rightOffset = 0;
					//								if (left >= s.leftTable.firstGlyph && left < s.leftTable.firstGlyph + s.leftTable.nGlyphs) {
					//									leftOffset = s.leftTable.offsets[left - s.leftTable.firstGlyph];
					//								} else {
					//									leftOffset = s.array.off;
					//								}

					//								if (right >= s.rightTable.firstGlyph && right < s.rightTable.firstGlyph + s.rightTable.nGlyphs) {
					//									rightOffset = s.rightTable.offsets[right - s.rightTable.firstGlyph];
					//								}

					//								var index = (leftOffset + rightOffset - s.array.off) / 2;
					//								val = s.array.values.get(index);
					//								break;

					//							case 3:
					//								if (left >= s.glyphCount || right >= s.glyphCount) {
					//									return 0;
					//								}

					//								val = s.kernValue[s.kernIndex[s.leftClass[left] * s.rightClassCount + s.rightClass[right]]];
					//								break;

					//							default:
					//								throw new Error("Unsupported kerning sub-table format " + table.format);
					//						}

					//						// Microsoft supports the override flag, which resets the result
					//						// Otherwise, the sum of the results from all subtables is returned
					//						if (table.coverage.override) {
					//							res = val;
					//						} else {
					//							res += val;
					//						}
					//					}
					//				} catch (err) {
					//					_didIteratorError = true;
					//					_iteratorError = err;
					//				} finally {
					//					try {
					//						if (!_iteratorNormalCompletion && _iterator.return) {
					//							_iterator.return();
					//						}
					//					} finally {
					//						if (_didIteratorError) {
					//							throw _iteratorError;
					//						}
					//					}
					//				}

					//				return res;
					//			}
					//		}]);

					//	return KernProcessor;
					//} ();

					/**
					 * This class is used when GPOS does not define 'mark' or 'mkmk' features
					 * for positioning marks relative to base glyphs. It uses the unicode
					 * combining class property to position marks.
					 *
					 * Based on code from Harfbuzz, thanks!
					 * https://github.com/behdad/harfbuzz/blob/master/src/hb-ot-shape-fallback.cc
					 */

					var UnicodeLayoutEngine = function () {
						function UnicodeLayoutEngine(font) {
							_classCallCheck(this, UnicodeLayoutEngine);

							this.font = font;
						}

						_createClass(UnicodeLayoutEngine, [{
							key: 'positionGlyphs',
							value: function positionGlyphs(glyphs, positions) {
								// find each base + mark cluster, and position the marks relative to the base
								var clusterStart = 0;
								var clusterEnd = 0;
								for (var index = 0; index < glyphs.length; index++) {
									var glyph = glyphs[index];
									if (glyph.isMark) {
										// TODO: handle ligatures
										clusterEnd = index;
									} else {
										if (clusterStart !== clusterEnd) {
											this.positionCluster(glyphs, positions, clusterStart, clusterEnd);
										}

										clusterStart = clusterEnd = index;
									}
								}

								if (clusterStart !== clusterEnd) {
									this.positionCluster(glyphs, positions, clusterStart, clusterEnd);
								}

								return positions;
							}
						}, {
								key: 'positionCluster',
								value: function positionCluster(glyphs, positions, clusterStart, clusterEnd) {
									var base = glyphs[clusterStart];
									var baseBox = base.cbox.copy();

									// adjust bounding box for ligature glyphs
									if (base.codePoints.length > 1) {
										// LTR. TODO: RTL support.
										baseBox.minX += (base.codePoints.length - 1) * baseBox.width / base.codePoints.length;
									}

									var xOffset = -positions[clusterStart].xAdvance;
									var yOffset = 0;
									var yGap = this.font.unitsPerEm / 16;

									// position each of the mark glyphs relative to the base glyph
									for (var index = clusterStart + 1; index <= clusterEnd; index++) {
										var mark = glyphs[index];
										var markBox = mark.cbox;
										var position = positions[index];

										var combiningClass = this.getCombiningClass(mark.codePoints[0]);

										if (combiningClass !== 'Not_Reordered') {
											position.xOffset = position.yOffset = 0;

											// x positioning
											switch (combiningClass) {
												case 'Double_Above':
												case 'Double_Below':
													// LTR. TODO: RTL support.
													position.xOffset += baseBox.minX - markBox.width / 2 - markBox.minX;
													break;

												case 'Attached_Below_Left':
												case 'Below_Left':
												case 'Above_Left':
													// left align
													position.xOffset += baseBox.minX - markBox.minX;
													break;

												case 'Attached_Above_Right':
												case 'Below_Right':
												case 'Above_Right':
													// right align
													position.xOffset += baseBox.maxX - markBox.width - markBox.minX;
													break;

												default:
													// Attached_Below, Attached_Above, Below, Above, other
													// center align
													position.xOffset += baseBox.minX + (baseBox.width - markBox.width) / 2 - markBox.minX;
											}

											// y positioning
											switch (combiningClass) {
												case 'Double_Below':
												case 'Below_Left':
												case 'Below':
												case 'Below_Right':
												case 'Attached_Below_Left':
												case 'Attached_Below':
													// add a small gap between the glyphs if they are not attached
													if (combiningClass === 'Attached_Below_Left' || combiningClass === 'Attached_Below') {
														baseBox.minY += yGap;
													}

													position.yOffset = -baseBox.minY - markBox.maxY;
													baseBox.minY += markBox.height;
													break;

												case 'Double_Above':
												case 'Above_Left':
												case 'Above':
												case 'Above_Right':
												case 'Attached_Above':
												case 'Attached_Above_Right':
													// add a small gap between the glyphs if they are not attached
													if (combiningClass === 'Attached_Above' || combiningClass === 'Attached_Above_Right') {
														baseBox.maxY += yGap;
													}

													position.yOffset = baseBox.maxY - markBox.minY;
													baseBox.maxY += markBox.height;
													break;
											}

											position.xAdvance = position.yAdvance = 0;
											position.xOffset += xOffset;
											position.yOffset += yOffset;
										} else {
											xOffset -= position.xAdvance;
											yOffset -= position.yAdvance;
										}
									}

									return;
								}
							}, {
								key: 'getCombiningClass',
								value: function getCombiningClass(codePoint) {
									var combiningClass = unicode.getCombiningClass(codePoint);

									// Thai / Lao need some per-character work
									if ((codePoint & ~0xff) === 0x0e00) {
										if (combiningClass === 'Not_Reordered') {
											switch (codePoint) {
												case 0x0e31:
												case 0x0e34:
												case 0x0e35:
												case 0x0e36:
												case 0x0e37:
												case 0x0e47:
												case 0x0e4c:
												case 0x0e3d:
												case 0x0e4e:
													return 'Above_Right';

												case 0x0eb1:
												case 0x0eb4:
												case 0x0eb5:
												case 0x0eb6:
												case 0x0eb7:
												case 0x0ebb:
												case 0x0ecc:
												case 0x0ecd:
													return 'Above';

												case 0x0ebc:
													return 'Below';
											}
										} else if (codePoint === 0x0e3a) {
											// virama
											return 'Below_Right';
										}
									}

									switch (combiningClass) {
										// Hebrew

										case 'CCC10': // sheva
										case 'CCC11': // hataf segol
										case 'CCC12': // hataf patah
										case 'CCC13': // hataf qamats
										case 'CCC14': // hiriq
										case 'CCC15': // tsere
										case 'CCC16': // segol
										case 'CCC17': // patah
										case 'CCC18': // qamats
										case 'CCC20': // qubuts
										case 'CCC22':
											// meteg
											return 'Below';

										case 'CCC23':
											// rafe
											return 'Attached_Above';

										case 'CCC24':
											// shin dot
											return 'Above_Right';

										case 'CCC25': // sin dot
										case 'CCC19':
											// holam
											return 'Above_Left';

										case 'CCC26':
											// point varika
											return 'Above';

										case 'CCC21':
											// dagesh
											break;

										// Arabic and Syriac

										case 'CCC27': // fathatan
										case 'CCC28': // dammatan
										case 'CCC30': // fatha
										case 'CCC31': // damma
										case 'CCC33': // shadda
										case 'CCC34': // sukun
										case 'CCC35': // superscript alef
										case 'CCC36':
											// superscript alaph
											return 'Above';

										case 'CCC29': // kasratan
										case 'CCC32':
											// kasra
											return 'Below';

										// Thai

										case 'CCC103':
											// sara u / sara uu
											return 'Below_Right';

										case 'CCC107':
											// mai
											return 'Above_Right';

										// Lao

										case 'CCC118':
											// sign u / sign uu
											return 'Below';

										case 'CCC122':
											// mai
											return 'Above';

										// Tibetan

										case 'CCC129': // sign aa
										case 'CCC132':
											// sign u
											return 'Below';

										case 'CCC130':
											// sign i
											return 'Above';
									}

									return combiningClass;
								}
							}]);

						return UnicodeLayoutEngine;
					} ();

					/**
					 * Represents a glyph bounding box
					 */
					var BBox = function () {
						function BBox(farg1?, farg2?, farg3?, farg4?): void {
							var minX = arguments.length <= 0 || arguments[0] === undefined ? Infinity : arguments[0];
							var minY = arguments.length <= 1 || arguments[1] === undefined ? Infinity : arguments[1];
							var maxX = arguments.length <= 2 || arguments[2] === undefined ? -Infinity : arguments[2];
							var maxY = arguments.length <= 3 || arguments[3] === undefined ? -Infinity : arguments[3];

							_classCallCheck(this, BBox);

							/**
							 * The minimum X position in the bounding box
							 * @type {number}
							 */
							this.minX = minX;

							/**
							 * The minimum Y position in the bounding box
							 * @type {number}
							 */
							this.minY = minY;

							/**
							 * The maxmimum X position in the bounding box
							 * @type {number}
							 */
							this.maxX = maxX;

							/**
							 * The maxmimum Y position in the bounding box
							 * @type {number}
							 */
							this.maxY = maxY;
						}

						/**
						 * The width of the bounding box
						 * @type {number}
						 */


						_createClass(BBox, [{
							key: "addPoint",
							value: function addPoint(x, y) {
								if (x < this.minX) {
									this.minX = x;
								}

								if (y < this.minY) {
									this.minY = y;
								}

								if (x > this.maxX) {
									this.maxX = x;
								}

								if (y > this.maxY) {
									this.maxY = y;
								}
							}
						}, {
								key: "copy",
								value: function copy() {
									return new BBox(this.minX, this.minY, this.maxX, this.maxY);
								}
							}, {
								key: "width",
								get: function get() {
									return this.maxX - this.minX;
								}

								/**
								 * The height of the bounding box
								 * @type {number}
								 */

							}, {
								key: "height",
								get: function get() {
									return this.maxY - this.minY;
								}
							}]);

						return BBox;
					} ();

					/**
					 * Represents a run of Glyph and GlyphPosition objects.
					 * Returned by the font layout method.
					 */

					var GlyphRun = function () {
						function GlyphRun(glyphs, positions) {
							_classCallCheck(this, GlyphRun);

							/**
							 * An array of Glyph objects in the run
							 * @type {Glyph[]}
							 */
							this.glyphs = glyphs;

							/**
							 * An array of GlyphPosition objects for each glyph in the run
							 * @type {GlyphPosition[]}
							 */
							this.positions = positions;
						}

						/**
						 * The total advance width of the run.
						 * @type {number}
						 */


						_createClass(GlyphRun, [{
							key: 'advanceWidth',
							get: function get() {
								var width = 0;
								Object.keys(this.positions).forEach(okey => {
									width += this.positions[okey].xAdvance;
								});
								return width;
							}

							/**
							 * The total advance height of the run.
							 * @type {number}
							 */

						}, {
								key: 'advanceHeight',
								get: function get() {
									var height = 0;
									Object.keys(this.positions).forEach(okey => {
										height += this.positions[okey].yAdvance;
									});
									return height;
								}

								/**
								 * The bounding box containing all glyphs in the run.
								 * @type {BBox}
								 */

							}, {
								key: 'bbox',
								get: function get() {
									var bbox = new BBox();

									var x = 0;
									var y = 0;
									for (var index = 0; index < this.glyphs.length; index++) {
										var glyph = this.glyphs[index];
										var p = this.positions[index];
										var b = glyph.bbox;

										bbox.addPoint(b.minX + x + p.xOffset, b.minY + y + p.yOffset);
										bbox.addPoint(b.maxX + x + p.xOffset, b.maxY + y + p.yOffset);

										x += p.xAdvance;
										y += p.yAdvance;
									}

									return bbox;
								}
							}]);

						return GlyphRun;
					} ();

					/**
					 * Represents positioning information for a glyph in a GlyphRun.
					 */
					var GlyphPosition: (...args) => void = function GlyphPosition() {
						var xAdvance = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0];
						var yAdvance = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
						var xOffset = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
						var yOffset = arguments.length <= 3 || arguments[3] === undefined ? 0 : arguments[3];

						_classCallCheck(this, GlyphPosition);

						/**
						 * The amount to move the virtual pen in the X direction after rendering this glyph.
						 * @type {number}
						 */
						this.xAdvance = xAdvance;

						/**
						 * The amount to move the virtual pen in the Y direction after rendering this glyph.
						 * @type {number}
						 */
						this.yAdvance = yAdvance;

						/**
						 * The offset from the pen position in the X direction at which to render this glyph.
						 * @type {number}
						 */
						this.xOffset = xOffset;

						/**
						 * The offset from the pen position in the Y direction at which to render this glyph.
						 * @type {number}
						 */
						this.yOffset = yOffset;
					};

					// This maps the Unicode Script property to an OpenType script tag
					// Data from http://www.microsoft.com/typography/otspec/scripttags.htm
					// and http://www.unicode.org/Public/UNIDATA/PropertyValueAliases.txt.
					var UNICODE_SCRIPTS = {
						Caucasian_Albanian: 'aghb',
						Arabic: 'arab',
						Imperial_Aramaic: 'armi',
						Armenian: 'armn',
						Avestan: 'avst',
						Balinese: 'bali',
						Bamum: 'bamu',
						Bassa_Vah: 'bass',
						Batak: 'batk',
						Bengali: ['bng2', 'beng'],
						Bopomofo: 'bopo',
						Brahmi: 'brah',
						Braille: 'brai',
						Buginese: 'bugi',
						Buhid: 'buhd',
						Chakma: 'cakm',
						Canadian_Aboriginal: 'cans',
						Carian: 'cari',
						Cham: 'cham',
						Cherokee: 'cher',
						Coptic: 'copt',
						Cypriot: 'cprt',
						Cyrillic: 'cyrl',
						Devanagari: ['dev2', 'deva'],
						Deseret: 'dsrt',
						Duployan: 'dupl',
						Egyptian_Hieroglyphs: 'egyp',
						Elbasan: 'elba',
						Ethiopic: 'ethi',
						Georgian: 'geor',
						Glagolitic: 'glag',
						Gothic: 'goth',
						Grantha: 'gran',
						Greek: 'grek',
						Gujarati: ['gjr2', 'gujr'],
						Gurmukhi: ['gur2', 'guru'],
						Hangul: 'hang',
						Han: 'hani',
						Hanunoo: 'hano',
						Hebrew: 'hebr',
						Hiragana: 'hira',
						Pahawh_Hmong: 'hmng',
						Katakana_Or_Hiragana: 'hrkt',
						Old_Italic: 'ital',
						Javanese: 'java',
						Kayah_Li: 'kali',
						Katakana: 'kana',
						Kharoshthi: 'khar',
						Khmer: 'khmr',
						Khojki: 'khoj',
						Kannada: ['knd2', 'knda'],
						Kaithi: 'kthi',
						Tai_Tham: 'lana',
						Lao: 'lao ',
						Latin: 'latn',
						Lepcha: 'lepc',
						Limbu: 'limb',
						Linear_A: 'lina',
						Linear_B: 'linb',
						Lisu: 'lisu',
						Lycian: 'lyci',
						Lydian: 'lydi',
						Mahajani: 'mahj',
						Mandaic: 'mand',
						Manichaean: 'mani',
						Mende_Kikakui: 'mend',
						Meroitic_Cursive: 'merc',
						Meroitic_Hieroglyphs: 'mero',
						Malayalam: ['mlm2', 'mlym'],
						Modi: 'modi',
						Mongolian: 'mong',
						Mro: 'mroo',
						Meetei_Mayek: 'mtei',
						Myanmar: ['mym2', 'mymr'],
						Old_North_Arabian: 'narb',
						Nabataean: 'nbat',
						Nko: 'nko ',
						Ogham: 'ogam',
						Ol_Chiki: 'olck',
						Old_Turkic: 'orkh',
						Oriya: 'orya',
						Osmanya: 'osma',
						Palmyrene: 'palm',
						Pau_Cin_Hau: 'pauc',
						Old_Permic: 'perm',
						Phags_Pa: 'phag',
						Inscriptional_Pahlavi: 'phli',
						Psalter_Pahlavi: 'phlp',
						Phoenician: 'phnx',
						Miao: 'plrd',
						Inscriptional_Parthian: 'prti',
						Rejang: 'rjng',
						Runic: 'runr',
						Samaritan: 'samr',
						Old_South_Arabian: 'sarb',
						Saurashtra: 'saur',
						Shavian: 'shaw',
						Sharada: 'shrd',
						Siddham: 'sidd',
						Khudawadi: 'sind',
						Sinhala: 'sinh',
						Sora_Sompeng: 'sora',
						Sundanese: 'sund',
						Syloti_Nagri: 'sylo',
						Syriac: 'syrc',
						Tagbanwa: 'tagb',
						Takri: 'takr',
						Tai_Le: 'tale',
						New_Tai_Lue: 'talu',
						Tamil: 'taml',
						Tai_Viet: 'tavt',
						Telugu: ['tel2', 'telu'],
						Tifinagh: 'tfng',
						Tagalog: 'tglg',
						Thaana: 'thaa',
						Thai: 'thai',
						Tibetan: 'tibt',
						Tirhuta: 'tirh',
						Ugaritic: 'ugar',
						Vai: 'vai ',
						Warang_Citi: 'wara',
						Old_Persian: 'xpeo',
						Cuneiform: 'xsux',
						Yi: 'yi  ',
						Inherited: 'zinh',
						Common: 'zyyy',
						Unknown: 'zzzz'
					};

					function forString(string) {
						var len = string.length;
						var idx = 0;
						while (idx < len) {
							var code = string.charCodeAt(idx++);

							// Check if this is a high surrogate
							if (0xd800 <= code && code <= 0xdbff && idx < len) {
								var next = string.charCodeAt(idx);

								// Check if this is a low surrogate
								if (0xdc00 <= next && next <= 0xdfff) {
									idx++;
									code = ((code & 0x3FF) << 10) + (next & 0x3FF) + 0x10000;
								}
							}

							var script = unicode.getScript(code);
							if (script !== 'Common' && script !== 'Inherited' && script !== 'Unknown') {
								return UNICODE_SCRIPTS[script];
							}
						}

						return UNICODE_SCRIPTS.Unknown;
					}

					function forCodePoints(codePoints) {
						for (var i = 0; i < codePoints.length; i++) {
							var codePoint = codePoints[i];
							var script = unicode.getScript(codePoint);
							if (script !== 'Common' && script !== 'Inherited' && script !== 'Unknown') {
								return UNICODE_SCRIPTS[script];
							}
						}

						return UNICODE_SCRIPTS.Unknown;
					}

					//// The scripts in this map are written from right to left
					//var RTL = {
					//	arab: true, // Arabic
					//	hebr: true, // Hebrew
					//	syrc: true, // Syriac
					//	thaa: true, // Thaana
					//	cprt: true, // Cypriot Syllabary
					//	khar: true, // Kharosthi
					//	phnx: true, // Phoenician
					//	'nko ': true, // N'Ko
					//	lydi: true, // Lydian
					//	avst: true, // Avestan
					//	armi: true, // Imperial Aramaic
					//	phli: true, // Inscriptional Pahlavi
					//	prti: true, // Inscriptional Parthian
					//	sarb: true, // Old South Arabian
					//	orkh: true, // Old Turkic, Orkhon Runic
					//	samr: true, // Samaritan
					//	mand: true, // Mandaic, Mandaean
					//	merc: true, // Meroitic Cursive
					//	mero: true, // Meroitic Hieroglyphs

					//	// Unicode 7.0 (not listed on http://www.microsoft.com/typography/otspec/scripttags.htm)
					//	mani: true, // Manichaean
					//	mend: true, // Mende Kikakui
					//	nbat: true, // Nabataean
					//	narb: true, // Old North Arabian
					//	palm: true, // Palmyrene
					//	phlp: true // Psalter Pahlavi
					//};

					function direction(script) {
						//if (RTL[script]) {
						//	return 'rtl';
						//}

						return 'ltr';
					}

					//// see https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html
					//// and /System/Library/Frameworks/CoreText.framework/Versions/A/Headers/SFNTLayoutTypes.h on a Mac
					//var features = {
					//	allTypographicFeatures: {
					//		code: 0,
					//		exclusive: false,
					//		allTypeFeatures: 0
					//	},
					//	ligatures: {
					//		code: 1,
					//		exclusive: false,
					//		requiredLigatures: 0,
					//		commonLigatures: 2,
					//		rareLigatures: 4,
					//		// logos: 6
					//		rebusPictures: 8,
					//		diphthongLigatures: 10,
					//		squaredLigatures: 12,
					//		abbrevSquaredLigatures: 14,
					//		symbolLigatures: 16,
					//		contextualLigatures: 18,
					//		historicalLigatures: 20
					//	},
					//	cursiveConnection: {
					//		code: 2,
					//		exclusive: true,
					//		unconnected: 0,
					//		partiallyConnected: 1,
					//		cursive: 2
					//	},
					//	letterCase: {
					//		code: 3,
					//		exclusive: true
					//	},
					//	// upperAndLowerCase: 0          # deprecated
					//	// allCaps: 1                    # deprecated
					//	// allLowerCase: 2               # deprecated
					//	// smallCaps: 3                  # deprecated
					//	// initialCaps: 4                # deprecated
					//	// initialCapsAndSmallCaps: 5    # deprecated
					//	verticalSubstitution: {
					//		code: 4,
					//		exclusive: false,
					//		substituteVerticalForms: 0
					//	},
					//	linguisticRearrangement: {
					//		code: 5,
					//		exclusive: false,
					//		linguisticRearrangement: 0
					//	},
					//	numberSpacing: {
					//		code: 6,
					//		exclusive: true,
					//		monospacedNumbers: 0,
					//		proportionalNumbers: 1,
					//		thirdWidthNumbers: 2,
					//		quarterWidthNumbers: 3
					//	},
					//	smartSwash: {
					//		code: 8,
					//		exclusive: false,
					//		wordInitialSwashes: 0,
					//		wordFinalSwashes: 2,
					//		// lineInitialSwashes: 4
					//		// lineFinalSwashes: 6
					//		nonFinalSwashes: 8
					//	},
					//	diacritics: {
					//		code: 9,
					//		exclusive: true,
					//		showDiacritics: 0,
					//		hideDiacritics: 1,
					//		decomposeDiacritics: 2
					//	},
					//	verticalPosition: {
					//		code: 10,
					//		exclusive: true,
					//		normalPosition: 0,
					//		superiors: 1,
					//		inferiors: 2,
					//		ordinals: 3,
					//		scientificInferiors: 4
					//	},
					//	fractions: {
					//		code: 11,
					//		exclusive: true,
					//		noFractions: 0,
					//		verticalFractions: 1,
					//		diagonalFractions: 2
					//	},
					//	overlappingCharacters: {
					//		code: 13,
					//		exclusive: false,
					//		preventOverlap: 0
					//	},
					//	typographicExtras: {
					//		code: 14,
					//		exclusive: false,
					//		// hyphensToEmDash: 0
					//		// hyphenToEnDash: 2
					//		slashedZero: 4
					//	},
					//	// formInterrobang: 6
					//	// smartQuotes: 8
					//	// periodsToEllipsis: 10
					//	mathematicalExtras: {
					//		code: 15,
					//		exclusive: false,
					//		// hyphenToMinus: 0
					//		// asteristoMultiply: 2
					//		// slashToDivide: 4
					//		// inequalityLigatures: 6
					//		// exponents: 8
					//		mathematicalGreek: 10
					//	},
					//	ornamentSets: {
					//		code: 16,
					//		exclusive: true,
					//		noOrnaments: 0,
					//		dingbats: 1,
					//		piCharacters: 2,
					//		fleurons: 3,
					//		decorativeBorders: 4,
					//		internationalSymbols: 5,
					//		mathSymbols: 6
					//	},
					//	characterAlternatives: {
					//		code: 17,
					//		exclusive: true,
					//		noAlternates: 0
					//	},
					//	// user defined options
					//	designComplexity: {
					//		code: 18,
					//		exclusive: true,
					//		designLevel1: 0,
					//		designLevel2: 1,
					//		designLevel3: 2,
					//		designLevel4: 3,
					//		designLevel5: 4
					//	},
					//	styleOptions: {
					//		code: 19,
					//		exclusive: true,
					//		noStyleOptions: 0,
					//		displayText: 1,
					//		engravedText: 2,
					//		illuminatedCaps: 3,
					//		titlingCaps: 4,
					//		tallCaps: 5
					//	},
					//	characterShape: {
					//		code: 20,
					//		exclusive: true,
					//		traditionalCharacters: 0,
					//		simplifiedCharacters: 1,
					//		JIS1978Characters: 2,
					//		JIS1983Characters: 3,
					//		JIS1990Characters: 4,
					//		traditionalAltOne: 5,
					//		traditionalAltTwo: 6,
					//		traditionalAltThree: 7,
					//		traditionalAltFour: 8,
					//		traditionalAltFive: 9,
					//		expertCharacters: 10,
					//		JIS2004Characters: 11,
					//		hojoCharacters: 12,
					//		NLCCharacters: 13,
					//		traditionalNamesCharacters: 14
					//	},
					//	numberCase: {
					//		code: 21,
					//		exclusive: true,
					//		lowerCaseNumbers: 0,
					//		upperCaseNumbers: 1
					//	},
					//	textSpacing: {
					//		code: 22,
					//		exclusive: true,
					//		proportionalText: 0,
					//		monospacedText: 1,
					//		halfWidthText: 2,
					//		thirdWidthText: 3,
					//		quarterWidthText: 4,
					//		altProportionalText: 5,
					//		altHalfWidthText: 6
					//	},
					//	transliteration: {
					//		code: 23,
					//		exclusive: true,
					//		noTransliteration: 0
					//	},
					//	// hanjaToHangul: 1
					//	// hiraganaToKatakana: 2
					//	// katakanaToHiragana: 3
					//	// kanaToRomanization: 4
					//	// romanizationToHiragana: 5
					//	// romanizationToKatakana: 6
					//	// hanjaToHangulAltOne: 7
					//	// hanjaToHangulAltTwo: 8
					//	// hanjaToHangulAltThree: 9
					//	annotation: {
					//		code: 24,
					//		exclusive: true,
					//		noAnnotation: 0,
					//		boxAnnotation: 1,
					//		roundedBoxAnnotation: 2,
					//		circleAnnotation: 3,
					//		invertedCircleAnnotation: 4,
					//		parenthesisAnnotation: 5,
					//		periodAnnotation: 6,
					//		romanNumeralAnnotation: 7,
					//		diamondAnnotation: 8,
					//		invertedBoxAnnotation: 9,
					//		invertedRoundedBoxAnnotation: 10
					//	},
					//	kanaSpacing: {
					//		code: 25,
					//		exclusive: true,
					//		fullWidthKana: 0,
					//		proportionalKana: 1
					//	},
					//	ideographicSpacing: {
					//		code: 26,
					//		exclusive: true,
					//		fullWidthIdeographs: 0,
					//		proportionalIdeographs: 1,
					//		halfWidthIdeographs: 2
					//	},
					//	unicodeDecomposition: {
					//		code: 27,
					//		exclusive: false,
					//		canonicalComposition: 0,
					//		compatibilityComposition: 2,
					//		transcodingComposition: 4
					//	},
					//	rubyKana: {
					//		code: 28,
					//		exclusive: false,
					//		// noRubyKana: 0     # deprecated - use rubyKanaOff instead
					//		// rubyKana: 1     # deprecated - use rubyKanaOn instead
					//		rubyKana: 2
					//	},
					//	CJKSymbolAlternatives: {
					//		code: 29,
					//		exclusive: true,
					//		noCJKSymbolAlternatives: 0,
					//		CJKSymbolAltOne: 1,
					//		CJKSymbolAltTwo: 2,
					//		CJKSymbolAltThree: 3,
					//		CJKSymbolAltFour: 4,
					//		CJKSymbolAltFive: 5
					//	},
					//	ideographicAlternatives: {
					//		code: 30,
					//		exclusive: true,
					//		noIdeographicAlternatives: 0,
					//		ideographicAltOne: 1,
					//		ideographicAltTwo: 2,
					//		ideographicAltThree: 3,
					//		ideographicAltFour: 4,
					//		ideographicAltFive: 5
					//	},
					//	CJKVerticalRomanPlacement: {
					//		code: 31,
					//		exclusive: true,
					//		CJKVerticalRomanCentered: 0,
					//		CJKVerticalRomanHBaseline: 1
					//	},
					//	italicCJKRoman: {
					//		code: 32,
					//		exclusive: false,
					//		// noCJKItalicRoman: 0     # deprecated - use CJKItalicRomanOff instead
					//		// CJKItalicRoman: 1     # deprecated - use CJKItalicRomanOn instead
					//		CJKItalicRoman: 2
					//	},
					//	caseSensitiveLayout: {
					//		code: 33,
					//		exclusive: false,
					//		caseSensitiveLayout: 0,
					//		caseSensitiveSpacing: 2
					//	},
					//	alternateKana: {
					//		code: 34,
					//		exclusive: false,
					//		alternateHorizKana: 0,
					//		alternateVertKana: 2
					//	},
					//	stylisticAlternatives: {
					//		code: 35,
					//		exclusive: false,
					//		noStylisticAlternates: 0,
					//		stylisticAltOne: 2,
					//		stylisticAltTwo: 4,
					//		stylisticAltThree: 6,
					//		stylisticAltFour: 8,
					//		stylisticAltFive: 10,
					//		stylisticAltSix: 12,
					//		stylisticAltSeven: 14,
					//		stylisticAltEight: 16,
					//		stylisticAltNine: 18,
					//		stylisticAltTen: 20,
					//		stylisticAltEleven: 22,
					//		stylisticAltTwelve: 24,
					//		stylisticAltThirteen: 26,
					//		stylisticAltFourteen: 28,
					//		stylisticAltFifteen: 30,
					//		stylisticAltSixteen: 32,
					//		stylisticAltSeventeen: 34,
					//		stylisticAltEighteen: 36,
					//		stylisticAltNineteen: 38,
					//		stylisticAltTwenty: 40
					//	},
					//	contextualAlternates: {
					//		code: 36,
					//		exclusive: false,
					//		contextualAlternates: 0,
					//		swashAlternates: 2,
					//		contextualSwashAlternates: 4
					//	},
					//	lowerCase: {
					//		code: 37,
					//		exclusive: true,
					//		defaultLowerCase: 0,
					//		lowerCaseSmallCaps: 1,
					//		lowerCasePetiteCaps: 2
					//	},
					//	upperCase: {
					//		code: 38,
					//		exclusive: true,
					//		defaultUpperCase: 0,
					//		upperCaseSmallCaps: 1,
					//		upperCasePetiteCaps: 2
					//	},
					//	languageTag: { // indices into ltag table
					//		code: 39,
					//		exclusive: true
					//	},
					//	CJKRomanSpacing: {
					//		code: 103,
					//		exclusive: true,
					//		halfWidthCJKRoman: 0,
					//		proportionalCJKRoman: 1,
					//		defaultCJKRoman: 2,
					//		fullWidthCJKRoman: 3
					//	}
					//};

					//var feature = function feature(name, selector) {
					//	return [features[name].code, features[name][selector]];
					//};

					//var OTMapping = {
					//	rlig: feature('ligatures', 'requiredLigatures'),
					//	clig: feature('ligatures', 'contextualLigatures'),
					//	dlig: feature('ligatures', 'rareLigatures'),
					//	hlig: feature('ligatures', 'historicalLigatures'),
					//	liga: feature('ligatures', 'commonLigatures'),
					//	hist: feature('ligatures', 'historicalLigatures'), // ??

					//	smcp: feature('lowerCase', 'lowerCaseSmallCaps'),
					//	pcap: feature('lowerCase', 'lowerCasePetiteCaps'),

					//	frac: feature('fractions', 'diagonalFractions'),
					//	dnom: feature('fractions', 'diagonalFractions'), // ??
					//	numr: feature('fractions', 'diagonalFractions'), // ??
					//	afrc: feature('fractions', 'verticalFractions'),
					//	// aalt
					//	// abvf, abvm, abvs, akhn, blwf, blwm, blws, cfar, cjct, cpsp, falt, isol, jalt, ljmo, mset?
					//	// ltra, ltrm, nukt, pref, pres, pstf, psts, rand, rkrf, rphf, rtla, rtlm, size, tjmo, tnum?
					//	// unic, vatu, vhal, vjmo, vpal, vrt2
					//	// dist -> trak table?
					//	// kern, vkrn -> kern table
					//	// lfbd + opbd + rtbd -> opbd table?
					//	// mark, mkmk -> acnt table?
					//	// locl -> languageTag + ltag table

					//	case: feature('caseSensitiveLayout', 'caseSensitiveLayout'), // also caseSensitiveSpacing
					//	ccmp: feature('unicodeDecomposition', 'canonicalComposition'), // compatibilityComposition?
					//	cpct: feature('CJKVerticalRomanPlacement', 'CJKVerticalRomanCentered'), // guess..., probably not given below
					//	valt: feature('CJKVerticalRomanPlacement', 'CJKVerticalRomanCentered'),
					//	swsh: feature('contextualAlternates', 'swashAlternates'),
					//	cswh: feature('contextualAlternates', 'contextualSwashAlternates'),
					//	curs: feature('cursiveConnection', 'cursive'), // ??
					//	c2pc: feature('upperCase', 'upperCasePetiteCaps'),
					//	c2sc: feature('upperCase', 'upperCaseSmallCaps'),

					//	init: feature('smartSwash', 'wordInitialSwashes'), // ??
					//	fin2: feature('smartSwash', 'wordFinalSwashes'), // ??
					//	medi: feature('smartSwash', 'nonFinalSwashes'), // ??
					//	med2: feature('smartSwash', 'nonFinalSwashes'), // ??
					//	fin3: feature('smartSwash', 'wordFinalSwashes'), // ??
					//	fina: feature('smartSwash', 'wordFinalSwashes'), // ??

					//	pkna: feature('kanaSpacing', 'proportionalKana'),
					//	half: feature('textSpacing', 'halfWidthText'), // also HalfWidthCJKRoman, HalfWidthIdeographs?
					//	halt: feature('textSpacing', 'altHalfWidthText'),

					//	hkna: feature('alternateKana', 'alternateHorizKana'),
					//	vkna: feature('alternateKana', 'alternateVertKana'),
					//	// hngl: feature 'transliteration', 'hanjaToHangulSelector' # deprecated

					//	ital: feature('italicCJKRoman', 'CJKItalicRoman'),
					//	lnum: feature('numberCase', 'upperCaseNumbers'),
					//	onum: feature('numberCase', 'lowerCaseNumbers'),
					//	mgrk: feature('mathematicalExtras', 'mathematicalGreek'),

					//	// nalt: not enough info. what type of annotation?
					//	// ornm: ditto, which ornament style?

					//	calt: feature('contextualAlternates', 'contextualAlternates'), // or more?
					//	vrt2: feature('verticalSubstitution', 'substituteVerticalForms'), // oh... below?
					//	vert: feature('verticalSubstitution', 'substituteVerticalForms'),
					//	tnum: feature('numberSpacing', 'monospacedNumbers'),
					//	pnum: feature('numberSpacing', 'proportionalNumbers'),
					//	sups: feature('verticalPosition', 'superiors'),
					//	subs: feature('verticalPosition', 'inferiors'),
					//	ordn: feature('verticalPosition', 'ordinals'),
					//	pwid: feature('textSpacing', 'proportionalText'),
					//	hwid: feature('textSpacing', 'halfWidthText'),
					//	qwid: feature('textSpacing', 'quarterWidthText'), // also QuarterWidthNumbers?
					//	twid: feature('textSpacing', 'thirdWidthText'), // also ThirdWidthNumbers?
					//	fwid: feature('textSpacing', 'proportionalText'), //??
					//	palt: feature('textSpacing', 'altProportionalText'),
					//	trad: feature('characterShape', 'traditionalCharacters'),
					//	smpl: feature('characterShape', 'simplifiedCharacters'),
					//	jp78: feature('characterShape', 'JIS1978Characters'),
					//	jp83: feature('characterShape', 'JIS1983Characters'),
					//	jp90: feature('characterShape', 'JIS1990Characters'),
					//	jp04: feature('characterShape', 'JIS2004Characters'),
					//	expt: feature('characterShape', 'expertCharacters'),
					//	hojo: feature('characterShape', 'hojoCharacters'),
					//	nlck: feature('characterShape', 'NLCCharacters'),
					//	tnam: feature('characterShape', 'traditionalNamesCharacters'),
					//	ruby: feature('rubyKana', 'rubyKana'),
					//	titl: feature('styleOptions', 'titlingCaps'),
					//	zero: feature('typographicExtras', 'slashedZero'),

					//	ss01: feature('stylisticAlternatives', 'stylisticAltOne'),
					//	ss02: feature('stylisticAlternatives', 'stylisticAltTwo'),
					//	ss03: feature('stylisticAlternatives', 'stylisticAltThree'),
					//	ss04: feature('stylisticAlternatives', 'stylisticAltFour'),
					//	ss05: feature('stylisticAlternatives', 'stylisticAltFive'),
					//	ss06: feature('stylisticAlternatives', 'stylisticAltSix'),
					//	ss07: feature('stylisticAlternatives', 'stylisticAltSeven'),
					//	ss08: feature('stylisticAlternatives', 'stylisticAltEight'),
					//	ss09: feature('stylisticAlternatives', 'stylisticAltNine'),
					//	ss10: feature('stylisticAlternatives', 'stylisticAltTen'),
					//	ss11: feature('stylisticAlternatives', 'stylisticAltEleven'),
					//	ss12: feature('stylisticAlternatives', 'stylisticAltTwelve'),
					//	ss13: feature('stylisticAlternatives', 'stylisticAltThirteen'),
					//	ss14: feature('stylisticAlternatives', 'stylisticAltFourteen'),
					//	ss15: feature('stylisticAlternatives', 'stylisticAltFifteen'),
					//	ss16: feature('stylisticAlternatives', 'stylisticAltSixteen'),
					//	ss17: feature('stylisticAlternatives', 'stylisticAltSeventeen'),
					//	ss18: feature('stylisticAlternatives', 'stylisticAltEighteen'),
					//	ss19: feature('stylisticAlternatives', 'stylisticAltNineteen'),
					//	ss20: feature('stylisticAlternatives', 'stylisticAltTwenty')
					//};

					//// salt: feature 'stylisticAlternatives', 'stylisticAltOne' # hmm, which one to choose

					//// Add cv01-cv99 features
					//for (var i$1 = 1; i$1 <= 99; i$1++) {
					//	OTMapping['cv' + ('00' + i$1).slice(-2)] = [features.characterAlternatives.code, i$1];
					//}

					//// create inverse mapping
					//var AATMapping = {};
					//for (var ot in OTMapping) {
					//	var aat = OTMapping[ot];
					//	if (AATMapping[aat[0]] == null) {
					//		AATMapping[aat[0]] = {};
					//	}

					//	AATMapping[aat[0]][aat[1]] = ot;
					//}

					//// Maps an array of OpenType features to AAT features
					//// in the form of {featureType:{featureSetting:true}}
					//function mapOTToAAT(features) {
					//	var res = {};
					//	for (var k = 0; k < features.length; k++) {
					//		var r = void 0;
					//		if (r = OTMapping[features[k]]) {
					//			if (res[r[0]] == null) {
					//				res[r[0]] = {};
					//			}

					//			res[r[0]][r[1]] = true;
					//		}
					//	}

					//	return res;
					//}

					//// Maps strings in a [featureType, featureSetting]
					//// to their equivalent number codes
					//function mapFeatureStrings(f) {
					//	var _f = _slicedToArray(f, 2);

					//	var type = _f[0];
					//	var setting = _f[1];

					//	if (isNaN(type)) {
					//		var typeCode = features[type] && features[type].code;
					//	} else {
					//		var typeCode = type;
					//	}

					//	if (isNaN(setting)) {
					//		var settingCode = features[type] && features[type][setting];
					//	} else {
					//		var settingCode = setting;
					//	}

					//	return [typeCode, settingCode];
					//}

					//// Maps AAT features to an array of OpenType features
					//// Supports both arrays in the form of [[featureType, featureSetting]]
					//// and objects in the form of {featureType:{featureSetting:true}}
					//// featureTypes and featureSettings can be either strings or number codes
					//function mapAATToOT(features) {
					//	var res = {};
					//	if (Array.isArray(features)) {
					//		for (var k = 0; k < features.length; k++) {
					//			var r = void 0;
					//			var f = mapFeatureStrings(features[k]);
					//			if (r = AATMapping[f[0]] && AATMapping[f[0]][f[1]]) {
					//				res[r] = true;
					//			}
					//		}
					//	} else if ((typeof features === 'undefined' ? 'undefined' : _typeof(features)) === 'object') {
					//		for (var type in features) {
					//			var _feature = features[type];
					//			for (var setting in _feature) {
					//				var _r = void 0;
					//				var _f2 = mapFeatureStrings([type, setting]);
					//				if (_feature[setting] && (_r = AATMapping[_f2[0]] && AATMapping[_f2[0]][_f2[1]])) {
					//					res[_r] = true;
					//				}
					//			}
					//		}
					//	}

					//	return _Object$keys(res);
					//}

					//var AATLookupTable = function () {
					//	function AATLookupTable(table) {
					//		_classCallCheck(this, AATLookupTable);

					//		this.table = table;
					//	}

					//	_createClass(AATLookupTable, [{
					//		key: "lookup",
					//		value: function lookup(glyph) {
					//			switch (this.table.version) {
					//				case 0:
					//					// simple array format
					//					return this.table.values.getItem(glyph);

					//				case 2: // segment format
					//				case 4:
					//					{
					//						var min = 0;
					//						var max = this.table.binarySearchHeader.nUnits - 1;

					//						while (min <= max) {
					//							var mid = min + max >> 1;
					//							var seg = this.table.segments[mid];

					//							// special end of search value
					//							if (seg.firstGlyph === 0xffff) {
					//								return null;
					//							}

					//							if (glyph < seg.firstGlyph) {
					//								max = mid - 1;
					//							} else if (glyph > seg.lastGlyph) {
					//								min = mid + 1;
					//							} else {
					//								if (this.table.version === 2) {
					//									return seg.value;
					//								} else {
					//									return seg.values[glyph - seg.firstGlyph];
					//								}
					//							}
					//						}

					//						return null;
					//					}

					//				case 6:
					//					{
					//						// lookup single
					//						var _min = 0;
					//						var _max = this.table.binarySearchHeader.nUnits - 1;

					//						while (_min <= _max) {
					//							var mid = _min + _max >> 1;
					//							var seg = this.table.segments[mid];

					//							// special end of search value
					//							if (seg.glyph === 0xffff) {
					//								return null;
					//							}

					//							if (glyph < seg.glyph) {
					//								_max = mid - 1;
					//							} else if (glyph > seg.glyph) {
					//								_min = mid + 1;
					//							} else {
					//								return seg.value;
					//							}
					//						}

					//						return null;
					//					}

					//				case 8:
					//					// lookup trimmed
					//					return this.table.values[glyph - this.table.firstGlyph];

					//				default:
					//					throw new Error("Unknown lookup table format: " + this.table.version);
					//			}
					//		}
					//	}]);

					//	return AATLookupTable;
					//} ();

					//var START_OF_TEXT_STATE = 0;
					//var END_OF_TEXT_CLASS = 0;
					//var OUT_OF_BOUNDS_CLASS = 1;
					//var DELETED_GLYPH_CLASS = 2;
					//var DONT_ADVANCE = 0x4000;

					//var AATStateMachine = function () {
					//	function AATStateMachine(stateTable) {
					//		_classCallCheck(this, AATStateMachine);

					//		this.stateTable = stateTable;
					//		this.lookupTable = new AATLookupTable(stateTable.classTable);
					//	}

					//	_createClass(AATStateMachine, [{
					//		key: 'process',
					//		value: function process(glyphs, reverse, processEntry) {
					//			var currentState = START_OF_TEXT_STATE; // START_OF_LINE_STATE is used for kashida glyph insertions sometimes I think?
					//			var index = reverse ? glyphs.length - 1 : 0;
					//			var dir = reverse ? -1 : 1;

					//			while (dir === 1 && index <= glyphs.length || dir === -1 && index >= -1) {
					//				var glyph = null;
					//				var classCode = OUT_OF_BOUNDS_CLASS;
					//				var shouldAdvance = true;

					//				if (index === glyphs.length || index === -1) {
					//					classCode = END_OF_TEXT_CLASS;
					//				} else {
					//					glyph = glyphs[index];
					//					if (glyph.id === 0xffff) {
					//						// deleted glyph
					//						classCode = DELETED_GLYPH_CLASS;
					//					} else {
					//						classCode = this.lookupTable.lookup(glyph.id);
					//						if (classCode == null) {
					//							classCode = OUT_OF_BOUNDS_CLASS;
					//						}
					//					}
					//				}

					//				var row = this.stateTable.stateArray.getItem(currentState);
					//				var entryIndex = row[classCode];
					//				var entry = this.stateTable.entryTable.getItem(entryIndex);

					//				if (classCode !== END_OF_TEXT_CLASS && classCode !== DELETED_GLYPH_CLASS) {
					//					processEntry(glyph, entry, index);
					//					shouldAdvance = !(entry.flags & DONT_ADVANCE);
					//				}

					//				currentState = entry.newState;
					//				if (shouldAdvance) {
					//					index += dir;
					//				}
					//			}

					//			return glyphs;
					//		}
					//	}]);

					//	return AATStateMachine;
					//} ();

					//// indic replacement flags
					//var MARK_FIRST = 0x8000;
					//var MARK_LAST = 0x2000;
					//var VERB = 0x000F;

					//// contextual substitution and glyph insertion flag
					//var SET_MARK = 0x8000;

					//// ligature entry flags
					//var SET_COMPONENT = 0x8000;
					//var PERFORM_ACTION = 0x2000;

					//// ligature action masks
					//var LAST_MASK = 0x80000000;
					//var STORE_MASK = 0x40000000;
					//var OFFSET_MASK = 0x3FFFFFFF;

					//var REVERSE_DIRECTION = 0x400000;
					//var CURRENT_INSERT_BEFORE = 0x0800;
					//var MARKED_INSERT_BEFORE = 0x0400;
					//var CURRENT_INSERT_COUNT = 0x03E0;
					//var MARKED_INSERT_COUNT = 0x001F;

					//var AATMorxProcessor = function () {
					//	function AATMorxProcessor(font) {
					//		_classCallCheck(this, AATMorxProcessor);

					//		this.processIndicRearragement = this.processIndicRearragement.bind(this);
					//		this.processContextualSubstitution = this.processContextualSubstitution.bind(this);
					//		this.processLigature = this.processLigature.bind(this);
					//		this.processNoncontextualSubstitutions = this.processNoncontextualSubstitutions.bind(this);
					//		this.processGlyphInsertion = this.processGlyphInsertion.bind(this);
					//		this.font = font;
					//		this.morx = font.morx;
					//	}

					//	// Processes an array of glyphs and applies the specified features
					//	// Features should be in the form of {featureType:{featureSetting:true}}


					//	_createClass(AATMorxProcessor, [{
					//		key: 'process',
					//		value: function process(glyphs) {
					//			var features = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
					//			var _iteratorNormalCompletion = true;
					//			var _didIteratorError = false;
					//			var _iteratorError = undefined;

					//			try {
					//				for (var _iterator = _getIterator(this.morx.chains), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
					//					var chain = _step.value;

					//					var flags = chain.defaultFlags;

					//					// enable/disable the requested features
					//					var _iteratorNormalCompletion2 = true;
					//					var _didIteratorError2 = false;
					//					var _iteratorError2 = undefined;

					//					try {
					//						for (var _iterator2 = _getIterator(chain.features), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
					//							var feature = _step2.value;

					//							var f = void 0;
					//							if ((f = features[feature.featureType]) && f[feature.featureSetting]) {
					//								flags &= feature.disableFlags;
					//								flags |= feature.enableFlags;
					//							}
					//						}
					//					} catch (err) {
					//						_didIteratorError2 = true;
					//						_iteratorError2 = err;
					//					} finally {
					//						try {
					//							if (!_iteratorNormalCompletion2 && _iterator2.return) {
					//								_iterator2.return();
					//							}
					//						} finally {
					//							if (_didIteratorError2) {
					//								throw _iteratorError2;
					//							}
					//						}
					//					}

					//					var _iteratorNormalCompletion3 = true;
					//					var _didIteratorError3 = false;
					//					var _iteratorError3 = undefined;

					//					try {
					//						for (var _iterator3 = _getIterator(chain.subtables), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
					//							var subtable = _step3.value;

					//							if (subtable.subFeatureFlags & flags) {
					//								this.processSubtable(subtable, glyphs);
					//							}
					//						}
					//					} catch (err) {
					//						_didIteratorError3 = true;
					//						_iteratorError3 = err;
					//					} finally {
					//						try {
					//							if (!_iteratorNormalCompletion3 && _iterator3.return) {
					//								_iterator3.return();
					//							}
					//						} finally {
					//							if (_didIteratorError3) {
					//								throw _iteratorError3;
					//							}
					//						}
					//					}
					//				}

					//				// remove deleted glyphs
					//			} catch (err) {
					//				_didIteratorError = true;
					//				_iteratorError = err;
					//			} finally {
					//				try {
					//					if (!_iteratorNormalCompletion && _iterator.return) {
					//						_iterator.return();
					//					}
					//				} finally {
					//					if (_didIteratorError) {
					//						throw _iteratorError;
					//					}
					//				}
					//			}

					//			var index = glyphs.length - 1;
					//			while (index >= 0) {
					//				if (glyphs[index].id === 0xffff) {
					//					glyphs.splice(index, 1);
					//				}

					//				index--;
					//			}

					//			return glyphs;
					//		}
					//	}, {
					//			key: 'processSubtable',
					//			value: function processSubtable(subtable, glyphs) {
					//				this.subtable = subtable;
					//				this.glyphs = glyphs;
					//				if (this.subtable.type === 4) {
					//					this.processNoncontextualSubstitutions(this.subtable, this.glyphs);
					//					return;
					//				}

					//				this.ligatureStack = [];
					//				this.markedGlyph = null;
					//				this.firstGlyph = null;
					//				this.lastGlyph = null;
					//				this.markedIndex = null;

					//				var stateMachine = new AATStateMachine(this.subtable.table.stateTable);
					//				var process = this.getProcessor();

					//				var reverse = !!(this.subtable.coverage & REVERSE_DIRECTION);
					//				return stateMachine.process(this.glyphs, reverse, process);
					//			}
					//		}, {
					//			key: 'getProcessor',
					//			value: function getProcessor() {
					//				switch (this.subtable.type) {
					//					case 0:
					//						return this.processIndicRearragement;
					//					case 1:
					//						return this.processContextualSubstitution;
					//					case 2:
					//						return this.processLigature;
					//					case 4:
					//						return this.processNoncontextualSubstitutions;
					//					case 5:
					//						return this.processGlyphInsertion;
					//					default:
					//						throw new Error('Invalid morx subtable type: ' + this.subtable.type);
					//				}
					//			}
					//		}, {
					//			key: 'processIndicRearragement',
					//			value: function processIndicRearragement(glyph, entry, index) {
					//				if (entry.flags & MARK_FIRST) {
					//					this.firstGlyph = index;
					//				}

					//				if (entry.flags & MARK_LAST) {
					//					this.lastGlyph = index;
					//				}

					//				reorderGlyphs(this.glyphs, entry.flags & VERB, this.firstGlyph, this.lastGlyph);
					//			}
					//		}, {
					//			key: 'processContextualSubstitution',
					//			value: function processContextualSubstitution(glyph, entry, index) {
					//				var subsitutions = this.subtable.table.substitutionTable.items;
					//				if (entry.markIndex !== 0xffff) {
					//					var lookup = subsitutions.getItem(entry.markIndex);
					//					var lookupTable = new AATLookupTable(lookup);
					//					glyph = this.glyphs[this.markedGlyph];
					//					var gid = lookupTable.lookup(glyph.id);
					//					if (gid) {
					//						this.glyphs[this.markedGlyph] = this.font.getGlyph(gid, glyph.codePoints);
					//					}
					//				}

					//				if (entry.currentIndex !== 0xffff) {
					//					var _lookup = subsitutions.getItem(entry.currentIndex);
					//					var _lookupTable = new AATLookupTable(_lookup);
					//					glyph = this.glyphs[index];
					//					var gid = _lookupTable.lookup(glyph.id);
					//					if (gid) {
					//						this.glyphs[index] = this.font.getGlyph(gid, glyph.codePoints);
					//					}
					//				}

					//				if (entry.flags & SET_MARK) {
					//					this.markedGlyph = index;
					//				}
					//			}
					//		}, {
					//			key: 'processLigature',
					//			value: function processLigature(glyph, entry, index) {
					//				if (entry.flags & SET_COMPONENT) {
					//					this.ligatureStack.push(index);
					//				}

					//				if (entry.flags & PERFORM_ACTION) {
					//					var _ligatureStack;

					//					var actions = this.subtable.table.ligatureActions;
					//					var components = this.subtable.table.components;
					//					var ligatureList = this.subtable.table.ligatureList;

					//					var actionIndex = entry.action;
					//					var last = false;
					//					var ligatureIndex = 0;
					//					var codePoints = [];
					//					var ligatureGlyphs = [];

					//					while (!last) {
					//						var _codePoints;

					//						var componentGlyph = this.ligatureStack.pop();
					//						(_codePoints = codePoints).unshift.apply(_codePoints, _toConsumableArray(this.glyphs[componentGlyph].codePoints));

					//						var action = actions.getItem(actionIndex++);
					//						last = !!(action & LAST_MASK);
					//						var store = !!(action & STORE_MASK);
					//						var offset = (action & OFFSET_MASK) << 2 >> 2; // sign extend 30 to 32 bits
					//						offset += this.glyphs[componentGlyph].id;

					//						var component = components.getItem(offset);
					//						ligatureIndex += component;

					//						if (last || store) {
					//							var ligatureEntry = ligatureList.getItem(ligatureIndex);
					//							this.glyphs[componentGlyph] = this.font.getGlyph(ligatureEntry, codePoints);
					//							ligatureGlyphs.push(componentGlyph);
					//							ligatureIndex = 0;
					//							codePoints = [];
					//						} else {
					//							this.glyphs[componentGlyph] = this.font.getGlyph(0xffff);
					//						}
					//					}

					//					// Put ligature glyph indexes back on the stack
					//					(_ligatureStack = this.ligatureStack).push.apply(_ligatureStack, ligatureGlyphs);
					//				}
					//			}
					//		}, {
					//			key: 'processNoncontextualSubstitutions',
					//			value: function processNoncontextualSubstitutions(subtable, glyphs, index) {
					//				var lookupTable = new AATLookupTable(subtable.table.lookupTable);

					//				for (index = 0; index < glyphs.length; index++) {
					//					var glyph = glyphs[index];
					//					if (glyph.id !== 0xffff) {
					//						var gid = lookupTable.lookup(glyph.id);
					//						if (gid) {
					//							// 0 means do nothing
					//							glyphs[index] = this.font.getGlyph(gid, glyph.codePoints);
					//						}
					//					}
					//				}
					//			}
					//		}, {
					//			key: '_insertGlyphs',
					//			value: function _insertGlyphs(glyphIndex, insertionActionIndex, count, isBefore) {
					//				var _glyphs;

					//				var insertions = [];
					//				while (count--) {
					//					var gid = this.subtable.table.insertionActions.getItem(insertionActionIndex++);
					//					insertions.push(this.font.getGlyph(gid));
					//				}

					//				if (!isBefore) {
					//					glyphIndex++;
					//				}

					//				(_glyphs = this.glyphs).splice.apply(_glyphs, [glyphIndex, 0].concat(insertions));
					//			}
					//		}, {
					//			key: 'processGlyphInsertion',
					//			value: function processGlyphInsertion(glyph, entry, index) {
					//				if (entry.flags & SET_MARK) {
					//					this.markedIndex = index;
					//				}

					//				if (entry.markedInsertIndex !== 0xffff) {
					//					var count = (entry.flags & MARKED_INSERT_COUNT) >>> 5;
					//					var isBefore = !!(entry.flags & MARKED_INSERT_BEFORE);
					//					this._insertGlyphs(this.markedIndex, entry.markedInsertIndex, count, isBefore);
					//				}

					//				if (entry.currentInsertIndex !== 0xffff) {
					//					var _count = (entry.flags & CURRENT_INSERT_COUNT) >>> 5;
					//					var _isBefore = !!(entry.flags & CURRENT_INSERT_BEFORE);
					//					this._insertGlyphs(index, entry.currentInsertIndex, _count, _isBefore);
					//				}
					//			}
					//		}, {
					//			key: 'getSupportedFeatures',
					//			value: function getSupportedFeatures() {
					//				var features = [];
					//				var _iteratorNormalCompletion4 = true;
					//				var _didIteratorError4 = false;
					//				var _iteratorError4 = undefined;

					//				try {
					//					for (var _iterator4 = _getIterator(this.morx.chains), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
					//						var chain = _step4.value;
					//						var _iteratorNormalCompletion5 = true;
					//						var _didIteratorError5 = false;
					//						var _iteratorError5 = undefined;

					//						try {
					//							for (var _iterator5 = _getIterator(chain.features), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
					//								var feature = _step5.value;

					//								features.push([feature.featureType, feature.featureSetting]);
					//							}
					//						} catch (err) {
					//							_didIteratorError5 = true;
					//							_iteratorError5 = err;
					//						} finally {
					//							try {
					//								if (!_iteratorNormalCompletion5 && _iterator5.return) {
					//									_iterator5.return();
					//								}
					//							} finally {
					//								if (_didIteratorError5) {
					//									throw _iteratorError5;
					//								}
					//							}
					//						}
					//					}
					//				} catch (err) {
					//					_didIteratorError4 = true;
					//					_iteratorError4 = err;
					//				} finally {
					//					try {
					//						if (!_iteratorNormalCompletion4 && _iterator4.return) {
					//							_iterator4.return();
					//						}
					//					} finally {
					//						if (_didIteratorError4) {
					//							throw _iteratorError4;
					//						}
					//					}
					//				}

					//				return features;
					//			}
					//		}]);

					//	return AATMorxProcessor;
					//} ();

					//function swap(glyphs, rangeA, rangeB, farg1?, farg2?) {
					//	var reverseA = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
					//	var reverseB = arguments.length <= 4 || arguments[4] === undefined ? false : arguments[4];

					//	var end = glyphs.splice(rangeB[0] - (rangeB[1] - 1), rangeB[1]);
					//	if (reverseB) {
					//		end.reverse();
					//	}

					//	var start = glyphs.splice.apply(glyphs, [rangeA[0], rangeA[1]].concat(_toConsumableArray(end)));
					//	if (reverseA) {
					//		start.reverse();
					//	}

					//	glyphs.splice.apply(glyphs, [rangeB[0] - (rangeA[1] - 1), 0].concat(_toConsumableArray(start)));
					//	return glyphs;
					//}

					//function reorderGlyphs(glyphs, verb, firstGlyph, lastGlyph) {
					//	var length = lastGlyph - firstGlyph + 1;
					//	switch (verb) {
					//		case 0:
					//			// no change
					//			return glyphs;

					//		case 1:
					//			// Ax => xA
					//			return swap(glyphs, [firstGlyph, 1], [lastGlyph, 0]);

					//		case 2:
					//			// xD => Dx
					//			return swap(glyphs, [firstGlyph, 0], [lastGlyph, 1]);

					//		case 3:
					//			// AxD => DxA
					//			return swap(glyphs, [firstGlyph, 1], [lastGlyph, 1]);

					//		case 4:
					//			// ABx => xAB
					//			return swap(glyphs, [firstGlyph, 2], [lastGlyph, 0]);

					//		case 5:
					//			// ABx => xBA
					//			return swap(glyphs, [firstGlyph, 2], [lastGlyph, 0], true, false);

					//		case 6:
					//			// xCD => CDx
					//			return swap(glyphs, [firstGlyph, 0], [lastGlyph, 2]);

					//		case 7:
					//			// xCD => DCx
					//			return swap(glyphs, [firstGlyph, 0], [lastGlyph, 2], false, true);

					//		case 8:
					//			// AxCD => CDxA
					//			return swap(glyphs, [firstGlyph, 1], [lastGlyph, 2]);

					//		case 9:
					//			// AxCD => DCxA
					//			return swap(glyphs, [firstGlyph, 1], [lastGlyph, 2], false, true);

					//		case 10:
					//			// ABxD => DxAB
					//			return swap(glyphs, [firstGlyph, 2], [lastGlyph, 1]);

					//		case 11:
					//			// ABxD => DxBA
					//			return swap(glyphs, [firstGlyph, 2], [lastGlyph, 1], true, false);

					//		case 12:
					//			// ABxCD => CDxAB
					//			return swap(glyphs, [firstGlyph, 2], [lastGlyph, 2]);

					//		case 13:
					//			// ABxCD => CDxBA
					//			return swap(glyphs, [firstGlyph, 2], [lastGlyph, 2], true, false);

					//		case 14:
					//			// ABxCD => DCxAB
					//			return swap(glyphs, [firstGlyph, 2], [lastGlyph, 2], false, true);

					//		case 15:
					//			// ABxCD => DCxBA
					//			return swap(glyphs, [firstGlyph, 2], [lastGlyph, 2], true, true);

					//		default:
					//			throw new Error('Unknown verb: ' + verb);
					//	}
					//}

					//var AATLayoutEngine = function () {
					//	function AATLayoutEngine(font) {
					//		_classCallCheck(this, AATLayoutEngine);

					//		this.morxProcessor = new AATMorxProcessor(font);
					//	}

					//	_createClass(AATLayoutEngine, [{
					//		key: 'substitute',
					//		value: function substitute(glyphs, features, script, language) {
					//			// AAT expects the glyphs to be in visual order prior to morx processing,
					//			// so reverse the glyphs if the script is right-to-left.
					//			var isRTL = direction(script) === 'rtl';
					//			if (isRTL) {
					//				glyphs.reverse();
					//			}

					//			this.morxProcessor.process(glyphs, mapOTToAAT(features));
					//			return glyphs;
					//		}
					//	}, {
					//			key: 'getAvailableFeatures',
					//			value: function getAvailableFeatures(script, language) {
					//				return mapAATToOT(this.morxProcessor.getSupportedFeatures());
					//			}
					//		}]);

					//	return AATLayoutEngine;
					//} ();

					/**
					 * ShapingPlans are used by the OpenType shapers to store which
					 * features should by applied, and in what order to apply them.
					 * The features are applied in groups called stages. A feature
					 * can be applied globally to all glyphs, or locally to only
					 * specific glyphs.
					 *
					 * @private
					 */

					var ShapingPlan = function () {
						function ShapingPlan(font, script, language) {
							_classCallCheck(this, ShapingPlan);

							this.font = font;
							this.script = script;
							this.language = language;
							this.direction = direction(script);
							this.stages = [];
							this.globalFeatures = {};
							this.allFeatures = {};
						}

						/**
						 * Adds the given features to the last stage.
						 * Ignores features that have already been applied.
						 */


						_createClass(ShapingPlan, [{
							key: '_addFeatures',
							value: function _addFeatures(features) {
								var stage = this.stages[this.stages.length - 1];
								Object.keys(features).forEach(okey => {
									var feature = features[okey];

									if (!this.allFeatures[feature]) {
										stage.push(feature);
										this.allFeatures[feature] = true;
									}
								});
							}

							/**
							 * Adds the given features to the global list
							 */

						}, {
								key: '_addGlobal',
								value: function _addGlobal(features) {
									Object.keys(features).forEach(okey => {
										var feature = features[okey];
										this.globalFeatures[feature] = true;
									});
								}

								/**
								 * Add features to the last stage
								 */

							}, {
								key: 'add',
								value: function add(arg) {
									var global = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];

									if (this.stages.length === 0) {
										this.stages.push([]);
									}

									if (typeof arg === 'string') {
										arg = [arg];
									}

									if (Array.isArray(arg)) {
										this._addFeatures(arg);
										if (global) {
											this._addGlobal(arg);
										}
									} else if ((typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object') {
										var features = (arg.global || []).concat(arg.local || []);
										this._addFeatures(features);
										if (arg.global) {
											this._addGlobal(arg.global);
										}
									} else {
										throw new Error("Unsupported argument to ShapingPlan#add");
									}
								}

								/**
								 * Add a new stage
								 */

							}, {
								key: 'addStage',
								value: function addStage(arg, global) {
									if (typeof arg === 'function') {
										this.stages.push(arg, []);
									} else {
										this.stages.push([]);
										this.add(arg, global);
									}
								}

								/**
								 * Assigns the global features to the given glyphs
								 */

							}, {
								key: 'assignGlobalFeatures',
								value: function assignGlobalFeatures(glyphs) {
									Object.keys(glyphs).forEach(okey => {
										var glyph = glyphs[okey];
										for (let feature in this.globalFeatures) {
											glyph.features[feature] = true;
										}
									});
								}

								/**
								 * Executes the planned stages using the given OTProcessor
								 */

							}, {
								key: 'process',
								value: function process(processor, glyphs, positions) {
									processor.selectScript(this.script, this.language);

									Object.keys(this.stages).forEach(okey => {
										var stage = this.stages[okey];
										if (typeof stage === 'function') {
											stage(glyphs, positions);
										} else if (stage.length > 0) {
											processor.applyFeatures(stage, glyphs, positions);
										}
									});
								}
							}]);

						return ShapingPlan;
					} ();

					var COMMON_FEATURES = ['ccmp', 'locl', 'rlig', 'mark', 'mkmk'];
					var FRACTIONAL_FEATURES = ['frac', 'numr', 'dnom'];
					var HORIZONTAL_FEATURES = ['calt', 'clig', 'liga', 'rclt', 'curs', 'kern'];
					var DIRECTIONAL_FEATURES = {
						ltr: ['ltra', 'ltrm'],
						rtl: ['rtla', 'rtlm']
					};

					var DefaultShaper = function () {
						function DefaultShaper() {
							_classCallCheck(this, DefaultShaper);
						}

						_createClass(DefaultShaper, null, [{
							key: 'plan',
							value: function plan(_plan, glyphs, features) {
								// Plan the features we want to apply
								this.planPreprocessing(_plan);
								this.planFeatures(_plan);
								this.planPostprocessing(_plan, features);

								// Assign the global features to all the glyphs
								_plan.assignGlobalFeatures(glyphs);

								// Assign local features to glyphs
								this.assignFeatures(_plan, glyphs);
							}
						}, {
								key: 'planPreprocessing',
								value: function planPreprocessing(plan) {
									plan.add({
										global: DIRECTIONAL_FEATURES[plan.direction],
										local: FRACTIONAL_FEATURES
									});
								}
							}, {
								key: 'planFeatures',
								value: function planFeatures(plan) {
									// Do nothing by default. Let subclasses override this.
								}
							}, {
								key: 'planPostprocessing',
								value: function planPostprocessing(plan, userFeatures) {
									plan.add([].concat(COMMON_FEATURES, HORIZONTAL_FEATURES, _toConsumableArray(userFeatures)));
								}
							}, {
								key: 'assignFeatures',
								value: function assignFeatures(plan, glyphs) {
									// Enable contextual fractions
									var i = 0;
									while (i < glyphs.length) {
										var glyph = glyphs[i];
										if (glyph.codePoints[0] === 0x2044) {
											// fraction slash
											var start = i - 1;
											var end = i + 1;

											// Apply numerator
											while (start >= 0 && unicode.isDigit(glyphs[start].codePoints[0])) {
												glyphs[start].features.numr = true;
												glyphs[start].features.frac = true;
												start--;
											}

											// Apply denominator
											while (end < glyphs.length && unicode.isDigit(glyphs[end].codePoints[0])) {
												glyphs[end].features.dnom = true;
												glyphs[end].features.frac = true;
												end++;
											}

											// Apply fraction slash
											glyph.features.frac = true;
											i = end - 1;
										} else {
											i++;
										}
									}
								}
							}]);

						return DefaultShaper;
					} ();

					//var trie = new UnicodeTrie(Buffer("AAEQAAAAAAAAADGgAZUBav7t2CtPA0EUBeDZB00pin9AJZIEgyUEj0QhweDAgQOJxCBRBElQSBwSicLgkOAwnNKZ5GaY2c7uzj4o5yZfZrrbefbuIx2nSq3CGmzAWH/+K+UO7MIe7MMhHMMpnMMFXMIVXIt2t3CnP088iPqjqNN8e4Ij7Rle4LUH82rLm6i/92A+RERERERERERNmfz/89GDeRARERERzbN8ceps2Iwt9H0C9/AJ6yOlDkbTczcot5VSm8Pm1vcFWfb7+BKOLTuOd2UlTX4wGP85Eg953lWPFbnuN7PkjtLmalOWbNenkHOSa7T3KmR9MVTZ2zZkVj1kHa68MueVKH0R4zqQ44WEXLM8VjcWHP0PtKLfPzQnMtGn3W4QYf6qxFxceVI394r2xnV+1rih0fV1Vzf3fO1n3evL5J78ruvZ5ptX2Rwy92Tfb1wlEqut3U+sZ3HXOeJ7/zDrbyuP6+Zz0fqa6Nv3vhY7Yu1xWnGevmsvsUpTT/RYIe8waUH/rvHMWKFzLfN8L+rTfp645mfX7ftlnfDtYxN59w0=", "base64"));
					//var FEATURES = ['isol', 'fina', 'fin2', 'fin3', 'medi', 'med2', 'init'];

					//var ShapingClasses = {
					//	Non_Joining: 0,
					//	Left_Joining: 1,
					//	Right_Joining: 2,
					//	Dual_Joining: 3,
					//	Join_Causing: 3,
					//	ALAPH: 4,
					//	'DALATH RISH': 5,
					//	Transparent: 6
					//};

					//var ISOL = 'isol';
					//var FINA = 'fina';
					//var FIN2 = 'fin2';
					//var FIN3 = 'fin3';
					//var MEDI = 'medi';
					//var MED2 = 'med2';
					//var INIT = 'init';
					//var NONE = null;

					//// Each entry is [prevAction, curAction, nextState]
					//var STATE_TABLE = [
					//	//   Non_Joining,        Left_Joining,       Right_Joining,     Dual_Joining,           ALAPH,            DALATH RISH
					//	// State 0: prev was U,  not willing to join.
					//	[[NONE, NONE, 0], [NONE, ISOL, 2], [NONE, ISOL, 1], [NONE, ISOL, 2], [NONE, ISOL, 1], [NONE, ISOL, 6]],

					//	// State 1: prev was R or ISOL/ALAPH,  not willing to join.
					//	[[NONE, NONE, 0], [NONE, ISOL, 2], [NONE, ISOL, 1], [NONE, ISOL, 2], [NONE, FIN2, 5], [NONE, ISOL, 6]],

					//	// State 2: prev was D/L in ISOL form,  willing to join.
					//	[[NONE, NONE, 0], [NONE, ISOL, 2], [INIT, FINA, 1], [INIT, FINA, 3], [INIT, FINA, 4], [INIT, FINA, 6]],

					//	// State 3: prev was D in FINA form,  willing to join.
					//	[[NONE, NONE, 0], [NONE, ISOL, 2], [MEDI, FINA, 1], [MEDI, FINA, 3], [MEDI, FINA, 4], [MEDI, FINA, 6]],

					//	// State 4: prev was FINA ALAPH,  not willing to join.
					//	[[NONE, NONE, 0], [NONE, ISOL, 2], [MED2, ISOL, 1], [MED2, ISOL, 2], [MED2, FIN2, 5], [MED2, ISOL, 6]],

					//	// State 5: prev was FIN2/FIN3 ALAPH,  not willing to join.
					//	[[NONE, NONE, 0], [NONE, ISOL, 2], [ISOL, ISOL, 1], [ISOL, ISOL, 2], [ISOL, FIN2, 5], [ISOL, ISOL, 6]],

					//	// State 6: prev was DALATH/RISH,  not willing to join.
					//	[[NONE, NONE, 0], [NONE, ISOL, 2], [NONE, ISOL, 1], [NONE, ISOL, 2], [NONE, FIN3, 5], [NONE, ISOL, 6]]];

					///**
					// * This is a shaper for Arabic, and other cursive scripts.
					// * It uses data from ArabicShaping.txt in the Unicode database,
					// * compiled to a UnicodeTrie by generate-data.coffee.
					// *
					// * The shaping state machine was ported from Harfbuzz.
					// * https://github.com/behdad/harfbuzz/blob/master/src/hb-ot-shape-complex-arabic.cc
					// */

					//var ArabicShaper = function (_DefaultShaper) {
					//	_inherits(ArabicShaper, _DefaultShaper);

					//	function ArabicShaper() {
					//		_classCallCheck(this, ArabicShaper);

					//		return _possibleConstructorReturn(this, (ArabicShaper.__proto__ || _Object$getPrototypeOf(ArabicShaper)).apply(this, arguments));
					//	}

					//	_createClass(ArabicShaper, null, [{
					//		key: 'planFeatures',
					//		value: function planFeatures(plan) {
					//			plan.add(['ccmp', 'locl']);
					//			for (var i = 0; i < FEATURES.length; i++) {
					//				var feature = FEATURES[i];
					//				plan.addStage(feature, false);
					//			}

					//			plan.addStage('mset');
					//		}
					//	}, {
					//			key: 'assignFeatures',
					//			value: function assignFeatures(plan, glyphs) {
					//				_get(ArabicShaper.__proto__ || _Object$getPrototypeOf(ArabicShaper), 'assignFeatures', this).call(this, plan, glyphs);

					//				var prev = -1;
					//				var state = 0;
					//				var actions = [];

					//				// Apply the state machine to map glyphs to features
					//				for (var i = 0; i < glyphs.length; i++) {
					//					var curAction = void 0,
					//						prevAction = void 0;
					//					var glyph = glyphs[i];
					//					var type = getShapingClass(glyph.codePoints[0]);
					//					if (type === ShapingClasses.Transparent) {
					//						actions[i] = NONE;
					//						continue;
					//					}

					//					var _STATE_TABLE$state$ty = _slicedToArray(STATE_TABLE[state][type], 3);

					//					prevAction = _STATE_TABLE$state$ty[0];
					//					curAction = _STATE_TABLE$state$ty[1];
					//					state = _STATE_TABLE$state$ty[2];


					//					if (prevAction !== NONE && prev !== -1) {
					//						actions[prev] = prevAction;
					//					}

					//					actions[i] = curAction;
					//					prev = i;
					//				}

					//				// Apply the chosen features to their respective glyphs
					//				for (var index = 0; index < glyphs.length; index++) {
					//					var feature = void 0;
					//					var glyph = glyphs[index];
					//					if (feature = actions[index]) {
					//						glyph.features[feature] = true;
					//					}
					//				}
					//			}
					//		}]);

					//	return ArabicShaper;
					//} (DefaultShaper);

					//function getShapingClass(codePoint) {
					//	var res = trie.get(codePoint);
					//	if (res) {
					//		return res - 1;
					//	}

					//	var category = unicode.getCategory(codePoint);
					//	if (category === 'Mn' || category === 'Me' || category === 'Cf') {
					//		return ShapingClasses.Transparent;
					//	}

					//	return ShapingClasses.Non_Joining;
					//}

					var GlyphInfo: (...args) => void = function GlyphInfo(id) {
						var codePoints = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
						var features = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2];

						_classCallCheck(this, GlyphInfo);

						this.id = id;
						this.codePoints = codePoints;

						// TODO: get this info from GDEF if available
						this.isMark = this.codePoints.every(unicode.isMark);
						this.isLigature = this.codePoints.length > 1;

						this.features = {};
						if (Array.isArray(features)) {
							for (var i = 0; i < features.length; i++) {
								var feature = features[i];
								this.features[feature] = true;
							}
						} else if ((typeof features === 'undefined' ? 'undefined' : _typeof(features)) === 'object') {
							_Object$assign(this.features, features);
						}

						this.ligatureID = null;
						this.ligatureComponent = null;
						this.cursiveAttachment = null;
						this.markAttachment = null;
					};

					///**
					// * This is a shaper for the Hangul script, used by the Korean language.
					// * It does the following:
					// *   - decompose if unsupported by the font:
					// *     <LV>   -> <L,V>
					// *     <LVT>  -> <L,V,T>
					// *     <LV,T> -> <L,V,T>
					// *
					// *   - compose if supported by the font:
					// *     <L,V>   -> <LV>
					// *     <L,V,T> -> <LVT>
					// *     <LV,T>  -> <LVT>
					// *
					// *   - reorder tone marks (S is any valid syllable):
					// *     <S, M> -> <M, S>
					// *
					// *   - apply ljmo, vjmo, and tjmo OpenType features to decomposed Jamo sequences.
					// *
					// * This logic is based on the following documents:
					// *   - http://www.microsoft.com/typography/OpenTypeDev/hangul/intro.htm
					// *   - http://ktug.org/~nomos/harfbuzz-hangul/hangulshaper.pdf
					// */

					//var HangulShaper = function (_DefaultShaper) {
					//	_inherits(HangulShaper, _DefaultShaper);

					//	function HangulShaper() {
					//		_classCallCheck(this, HangulShaper);

					//		return _possibleConstructorReturn(this, (HangulShaper.__proto__ || _Object$getPrototypeOf(HangulShaper)).apply(this, arguments));
					//	}

					//	_createClass(HangulShaper, null, [{
					//		key: 'planFeatures',
					//		value: function planFeatures(plan) {
					//			plan.add(['ljmo', 'vjmo', 'tjmo'], false);
					//		}
					//	}, {
					//			key: 'assignFeatures',
					//			value: function assignFeatures(plan, glyphs) {
					//				var state = 0;
					//				var i = 0;
					//				while (i < glyphs.length) {
					//					var action = void 0;
					//					var glyph = glyphs[i];
					//					var code = glyph.codePoints[0];
					//					var type = getType(code);

					//					var _STATE_TABLE$state$ty = _slicedToArray(STATE_TABLE$1[state][type], 2);

					//					action = _STATE_TABLE$state$ty[0];
					//					state = _STATE_TABLE$state$ty[1];


					//					switch (action) {
					//						case DECOMPOSE:
					//							// Decompose the composed syllable if it is not supported by the font.
					//							if (!plan.font.hasGlyphForCodePoint(code)) {
					//								i = decompose(glyphs, i, plan.font);
					//							}
					//							break;

					//						case COMPOSE:
					//							// Found a decomposed syllable. Try to compose if supported by the font.
					//							i = compose(glyphs, i, plan.font);
					//							break;

					//						case TONE_MARK:
					//							// Got a valid syllable, followed by a tone mark. Move the tone mark to the beginning of the syllable.
					//							reorderToneMark(glyphs, i, plan.font);
					//							break;

					//						case INVALID:
					//							// Tone mark has no valid syllable to attach to, so insert a dotted circle
					//							i = insertDottedCircle(glyphs, i, plan.font);
					//							break;
					//					}

					//					i++;
					//				}
					//			}
					//		}]);

					//	return HangulShaper;
					//} (DefaultShaper);

					//var HANGUL_BASE = 0xac00;
					//var HANGUL_END = 0xd7a4;
					//var HANGUL_COUNT = HANGUL_END - HANGUL_BASE + 1;
					//var L_BASE = 0x1100; // lead
					//var V_BASE = 0x1161; // vowel
					//var T_BASE = 0x11a7; // trail
					//var L_COUNT = 19;
					//var V_COUNT = 21;
					//var T_COUNT = 28;
					//var L_END = L_BASE + L_COUNT - 1;
					//var V_END = V_BASE + V_COUNT - 1;
					//var T_END = T_BASE + T_COUNT - 1;
					//var DOTTED_CIRCLE = 0x25cc;

					//var isL = function isL(code) {
					//	return 0x1100 <= code && code <= 0x115f || 0xa960 <= code && code <= 0xa97c;
					//};
					//var isV = function isV(code) {
					//	return 0x1160 <= code && code <= 0x11a7 || 0xd7b0 <= code && code <= 0xd7c6;
					//};
					//var isT = function isT(code) {
					//	return 0x11a8 <= code && code <= 0x11ff || 0xd7cb <= code && code <= 0xd7fb;
					//};
					//var isTone = function isTone(code) {
					//	return 0x302e <= code && code <= 0x302f;
					//};
					//var isLVT = function isLVT(code) {
					//	return HANGUL_BASE <= code && code <= HANGUL_END;
					//};
					//var isLV = function isLV(code) {
					//	return code - HANGUL_BASE < HANGUL_COUNT && (code - HANGUL_BASE) % T_COUNT === 0;
					//};
					//var isCombiningL = function isCombiningL(code) {
					//	return L_BASE <= code && code <= L_END;
					//};
					//var isCombiningV = function isCombiningV(code) {
					//	return V_BASE <= code && code <= V_END;
					//};
					//var isCombiningT = function isCombiningT(code) {
					//	return T_BASE + 1 && 1 <= code && code <= T_END;
					//};

					//// Character categories
					//var X = 0; // Other character
					//var L = 1; // Leading consonant
					//var V = 2; // Medial vowel
					//var T = 3; // Trailing consonant
					//var LV = 4; // Composed <LV> syllable
					//var LVT = 5; // Composed <LVT> syllable
					//var M = 6; // Tone mark

					//// This function classifies a character using the above categories.
					//function getType(code) {
					//	if (isL(code)) {
					//		return L;
					//	}
					//	if (isV(code)) {
					//		return V;
					//	}
					//	if (isT(code)) {
					//		return T;
					//	}
					//	if (isLV(code)) {
					//		return LV;
					//	}
					//	if (isLVT(code)) {
					//		return LVT;
					//	}
					//	if (isTone(code)) {
					//		return M;
					//	}
					//	return X;
					//}

					//// State machine actions
					//var NO_ACTION = 0;
					//var DECOMPOSE = 1;
					//var COMPOSE = 2;
					//var TONE_MARK = 4;
					//var INVALID = 5;

					//// Build a state machine that accepts valid syllables, and applies actions along the way.
					//// The logic this is implementing is documented at the top of the file.
					//var STATE_TABLE$1 = [
					//	//       X                 L                 V                T                  LV                LVT               M
					//	// State 0: start state
					//	[[NO_ACTION, 0], [NO_ACTION, 1], [NO_ACTION, 0], [NO_ACTION, 0], [DECOMPOSE, 2], [DECOMPOSE, 3], [INVALID, 0]],

					//	// State 1: <L>
					//	[[NO_ACTION, 0], [NO_ACTION, 1], [COMPOSE, 2], [NO_ACTION, 0], [DECOMPOSE, 2], [DECOMPOSE, 3], [INVALID, 0]],

					//	// State 2: <L,V> or <LV>
					//	[[NO_ACTION, 0], [NO_ACTION, 1], [NO_ACTION, 0], [COMPOSE, 3], [DECOMPOSE, 2], [DECOMPOSE, 3], [TONE_MARK, 0]],

					//	// State 3: <L,V,T> or <LVT>
					//	[[NO_ACTION, 0], [NO_ACTION, 1], [NO_ACTION, 0], [NO_ACTION, 0], [DECOMPOSE, 2], [DECOMPOSE, 3], [TONE_MARK, 0]]];

					//function getGlyph(font, code, features) {
					//	return new GlyphInfo(font.glyphForCodePoint(code).id, [code], _Object$keys(features));
					//}

					//function decompose(glyphs, i, font) {
					//	var glyph = glyphs[i];
					//	var code = glyph.codePoints[0];

					//	var s = code - HANGUL_BASE;
					//	var t = T_BASE + s % T_COUNT;
					//	s = s / T_COUNT | 0;
					//	var l = L_BASE + s / V_COUNT | 0;
					//	var v = V_BASE + s % V_COUNT;

					//	// Don't decompose if all of the components are not available
					//	if (!font.hasGlyphForCodePoint(l) || !font.hasGlyphForCodePoint(v) || t !== T_BASE && !font.hasGlyphForCodePoint(t)) {
					//		return i;
					//	}

					//	// Replace the current glyph with decomposed L, V, and T glyphs,
					//	// and apply the proper OpenType features to each component.
					//	var ljmo = getGlyph(font, l, glyph.features);
					//	ljmo.features.ljmo = true;

					//	var vjmo = getGlyph(font, v, glyph.features);
					//	vjmo.features.vjmo = true;

					//	var insert = [ljmo, vjmo];

					//	if (t > T_BASE) {
					//		var tjmo = getGlyph(font, t, glyph.features);
					//		tjmo.features.tjmo = true;
					//		insert.push(tjmo);
					//	}

					//	glyphs.splice.apply(glyphs, [i, 1].concat(insert));
					//	return i + insert.length - 1;
					//}

					//function compose(glyphs, i, font) {
					//	var glyph = glyphs[i];
					//	var code = glyphs[i].codePoints[0];
					//	var type = getType(code);

					//	var prev = glyphs[i - 1].codePoints[0];
					//	var prevType = getType(prev);

					//	// Figure out what type of syllable we're dealing with
					//	var lv = void 0,
					//		ljmo = void 0,
					//		vjmo = void 0,
					//		tjmo = void 0;
					//	if (prevType === LV && type === T) {
					//		// <LV,T>
					//		lv = prev;
					//		tjmo = glyph;
					//	} else {
					//		if (type === V) {
					//			// <L,V>
					//			ljmo = glyphs[i - 1];
					//			vjmo = glyph;
					//		} else {
					//			// <L,V,T>
					//			ljmo = glyphs[i - 2];
					//			vjmo = glyphs[i - 1];
					//			tjmo = glyph;
					//		}

					//		var l = ljmo.codePoints[0];
					//		var v = vjmo.codePoints[0];

					//		// Make sure L and V are combining characters
					//		if (isCombiningL(l) && isCombiningV(v)) {
					//			lv = HANGUL_BASE + ((l - L_BASE) * V_COUNT + (v - V_BASE)) * T_COUNT;
					//		}
					//	}

					//	var t = tjmo && tjmo.codePoints[0] || T_BASE;
					//	if (lv != null && (t === T_BASE || isCombiningT(t))) {
					//		var s = lv + (t - T_BASE);

					//		// Replace with a composed glyph if supported by the font,
					//		// otherwise apply the proper OpenType features to each component.
					//		if (font.hasGlyphForCodePoint(s)) {
					//			var del = prevType === V ? 3 : 2;
					//			glyphs.splice(i - del + 1, del, getGlyph(font, s, glyph.features));
					//			return i - del + 1;
					//		}
					//	}

					//	// Didn't compose (either a non-combining component or unsupported by font).
					//	if (ljmo) {
					//		ljmo.features.ljmo = true;
					//	}
					//	if (vjmo) {
					//		vjmo.features.vjmo = true;
					//	}
					//	if (tjmo) {
					//		tjmo.features.tjmo = true;
					//	}

					//	if (prevType === LV) {
					//		// Sequence was originally <L,V>, which got combined earlier.
					//		// Either the T was non-combining, or the LVT glyph wasn't supported.
					//		// Decompose the glyph again and apply OT features.
					//		decompose(glyphs, i - 1, font);
					//		return i + 1;
					//	}

					//	return i;
					//}

					//function getLength(code) {
					//	switch (getType(code)) {
					//		case LV:
					//		case LVT:
					//			return 1;
					//		case V:
					//			return 2;
					//		case T:
					//			return 3;
					//	}
					//}

					//function reorderToneMark(glyphs, i, font) {
					//	var glyph = glyphs[i];
					//	var code = glyphs[i].codePoints[0];

					//	// Move tone mark to the beginning of the previous syllable, unless it is zero width
					//	if (font.glyphForCodePoint(code).advanceWidth === 0) {
					//		return;
					//	}

					//	var prev = glyphs[i - 1].codePoints[0];
					//	var len = getLength(prev);

					//	glyphs.splice(i, 1);
					//	return glyphs.splice(i - len, 0, glyph);
					//}

					//function insertDottedCircle(glyphs, i, font) {
					//	var glyph = glyphs[i];
					//	var code = glyphs[i].codePoints[0];

					//	if (font.hasGlyphForCodePoint(DOTTED_CIRCLE)) {
					//		var dottedCircle = getGlyph(font, DOTTED_CIRCLE, glyph.features);

					//		// If the tone mark is zero width, insert the dotted circle before, otherwise after
					//		var idx = font.glyphForCodePoint(code).advanceWidth === 0 ? i : i + 1;
					//		glyphs.splice(idx, 0, dottedCircle);
					//		i++;
					//	}

					//	return i;
					//}

					var SHAPERS = {
						//arab: ArabicShaper, // Arabic
						//mong: ArabicShaper, // Mongolian
						//syrc: ArabicShaper, // Syriac
						//'nko ': ArabicShaper, // N'Ko
						//phag: ArabicShaper, // Phags Pa
						//mand: ArabicShaper, // Mandaic
						//mani: ArabicShaper, // Manichaean
						//phlp: ArabicShaper, // Psalter Pahlavi

						//hang: HangulShaper, // Hangul

						latn: DefaultShaper, // Latin
						DFLT: DefaultShaper // Default
					};

					function choose(script) {
						var shaper = SHAPERS[script];
						if (shaper) {
							return shaper;
						}

						return DefaultShaper;
					}

					var GlyphIterator: (...args) => void = function () {
						function GlyphIterator(glyphs, flags) {
							_classCallCheck(this, GlyphIterator);

							this.glyphs = glyphs;
							this.reset(flags);
						}

						_createClass(GlyphIterator, [{
							key: "reset",
							value: function reset() {
								var flags = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

								this.flags = flags;
								this.index = 0;
							}
						}, {
								key: "shouldIgnore",
								value: function shouldIgnore(glyph, flags) {
									return flags.ignoreMarks && glyph.isMark || flags.ignoreBaseGlyphs && !glyph.isMark || flags.ignoreLigatures && glyph.isLigature;
								}
							}, {
								key: "move",
								value: function move(dir) {
									this.index += dir;
									while (0 <= this.index && this.index < this.glyphs.length && this.shouldIgnore(this.glyphs[this.index], this.flags)) {
										this.index += dir;
									}

									if (0 > this.index || this.index >= this.glyphs.length) {
										return null;
									}

									return this.glyphs[this.index];
								}
							}, {
								key: "next",
								value: function next() {
									return this.move(+1);
								}
							}, {
								key: "prev",
								value: function prev() {
									return this.move(-1);
								}
							}, {
								key: "peek",
								value: function peek() {
									var count = arguments.length <= 0 || arguments[0] === undefined ? 1 : arguments[0];

									var idx = this.index;
									var res = this.increment(count);
									this.index = idx;
									return res;
								}
							}, {
								key: "peekIndex",
								value: function peekIndex() {
									var count = arguments.length <= 0 || arguments[0] === undefined ? 1 : arguments[0];

									var idx = this.index;
									this.increment(count);
									var res = this.index;
									this.index = idx;
									return res;
								}
							}, {
								key: "increment",
								value: function increment() {
									var count = arguments.length <= 0 || arguments[0] === undefined ? 1 : arguments[0];

									var dir = count < 0 ? -1 : 1;
									count = Math.abs(count);
									while (count--) {
										this.move(dir);
									}

									return this.glyphs[this.index];
								}
							}, {
								key: "cur",
								get: function get() {
									return this.glyphs[this.index] || null;
								}
							}]);

						return GlyphIterator;
					} ();

					var DEFAULT_SCRIPTS = ['DFLT', 'dflt', 'latn'];

					var OTProcessor = function () {
						function OTProcessor(font, table) {
							_classCallCheck(this, OTProcessor);

							this.font = font;
							this.table = table;

							this.script = null;
							this.scriptTag = null;

							this.language = null;
							this.languageTag = null;

							this.features = {};
							this.lookups = {};

							// initialize to default script + language
							this.selectScript();

							// current context (set by applyFeatures)
							this.glyphs = [];
							this.positions = []; // only used by GPOS
							this.ligatureID = 1;
						}

						_createClass(OTProcessor, [{
							key: 'findScript',
							value: function findScript(script) {
								if (this.table.scriptList == null) {
									return null;
								}

								if (!Array.isArray(script)) {
									script = [script];
								}

								for (var i = 0, keys1 = Object.keys(this.table.scriptList); i < keys1.length; i++) {
									var entry = this.table.scriptList[keys1[i]];
									for (var j = 0, keys2 = Object.keys(script); j < keys2.length; j++) {
										var s = script[keys2[j]];

										if (entry.tag === s) {
											return entry;
										}
									}
								}

								return null;
							}
						}, {
								key: 'selectScript',
								value: function selectScript(script, language) {
									var changed = false;
									var entry = void 0;
									if (!this.script || script !== this.scriptTag) {
										entry = this.findScript(script);
										if (script) {
											entry = this.findScript(script);
										}

										if (!entry) {
											entry = this.findScript(DEFAULT_SCRIPTS);
										}

										if (!entry) {
											return;
										}

										this.scriptTag = entry.tag;
										this.script = entry.script;
										this.direction = direction(script);
										this.language = null;
										changed = true;
									}

									if (!language && language !== this.langugeTag) {
										for (var i = 0, keys = Object.keys(this.script.langSysRecords); i < keys.length; i++) {
											var lang = this.script.langSysRecords[keys[i]];
											if (lang.tag === language) {
												this.language = lang.langSys;
												this.langugeTag = lang.tag;
												changed = true;
												break;
											}
										}
									}

									if (!this.language) {
										this.language = this.script.defaultLangSys;
									}

									// Build a feature lookup table
									if (changed) {
										this.features = {};
										if (this.language) {
											Object.keys(this.language.featureIndexes).forEach(okey => {
												var featureIndex = this.language.featureIndexes[okey];
												var record = this.table.featureList[featureIndex];
												this.features[record.tag] = record.feature;
											});
										}
									}
								}
							}, {
								key: 'lookupsForFeatures',
								value: function lookupsForFeatures() {
									var userFeatures = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
									var exclude = arguments[1];
									var lookups = [];

									for (var i = 0, keys1 = Object.keys(userFeatures); i < keys1.length; i++) {
										var tag = userFeatures[keys1[i]];
										var feature = this.features[tag];
										if (!feature) {
											continue;
										}

										for (var j = 0, keys2 = Object.keys(feature.lookupListIndexes); j < keys2.length; j++) {
											var lookupIndex = feature.lookupListIndexes[keys2[j]];

											if (exclude && exclude.indexOf(lookupIndex) !== -1) {
												continue;
											}

											lookups.push({
												feature: tag,
												index: lookupIndex,
												lookup: this.table.lookupList.get(lookupIndex)
											});
										}
									}

									lookups.sort((a, b) => a.index - b.index);
									return lookups;
								}
							}, {
								key: 'applyFeatures',
								value: function applyFeatures(userFeatures, glyphs, advances) {
									var lookups = this.lookupsForFeatures(userFeatures);
									this.applyLookups(lookups, glyphs, advances);
								}
							}, {
								key: 'applyLookups',
								value: function applyLookups(lookups, glyphs, positions) {
									this.glyphs = glyphs;
									this.positions = positions;
									this.glyphIterator = new GlyphIterator(glyphs);

									for (var i = 0, keys1 = Object.keys(lookups); i < keys1.length; i++) {
										var lk = lookups[keys1[i]],
										feature = lk.feature,
										lookup = lk.lookup;

										this.glyphIterator.reset(lookup.flags);

										while (this.glyphIterator.index < glyphs.length) {
											if (!(feature in this.glyphIterator.cur.features)) {
												this.glyphIterator.index++;
												continue;
											}

											for (var j = 0, keys2 = Object.keys(lookup.subTables); j < keys2.length; j++) {
												let table = lookup.subTables[keys2[j]];
												let res = this.applyLookup(lookup.lookupType, table);
												if (res) {
													break;
												}
											}

											this.glyphIterator.index++;
										}
									}
								}
							}, {
								key: 'applyLookup',
								value: function applyLookup(lookup, table) {
									throw new Error("applyLookup must be implemented by subclasses");
								}
							}, {
								key: 'applyLookupList',
								value: function applyLookupList(lookupRecords) {
									let glyphIndex = this.glyphIterator.index;

									Object.keys(lookupRecords).forEach(okey1 => {
										let lookupRecord = lookupRecords[okey1];

										this.glyphIterator.index = glyphIndex + lookupRecord.sequenceIndex;

										let lookup = this.table.lookupList.get(lookupRecord.lookupListIndex);

										Object.keys(lookup.subTables).forEach(okey2 => {
											let table = lookup.subTables[okey2];
											this.applyLookup(lookup.lookupType, table);
										});
									});
			
									this.glyphIterator.index = glyphIndex;
								}
							}, {
								key: 'coverageIndex',
								value: function coverageIndex(coverage, glyph) {
									if (glyph == null) {
										glyph = this.glyphIterator.cur.id;
									}

									switch (coverage.version) {
										case 1:
											return coverage.glyphs.indexOf(glyph);

										case 2:
											for (var i = 0, keys = Object.keys(coverage.rangeRecords); i < keys.length; i++) {
												var range = coverage.rangeRecords[keys[i]];
												if (range.start <= glyph && glyph <= range.end) {
													return range.startCoverageIndex + glyph - range.start;
												}
											}
											break;
									}

									return -1;
								}
							}, {
								key: 'match',
								value: function match(sequenceIndex, sequence, fn, matched) {
									var pos = this.glyphIterator.index;
									var glyph = this.glyphIterator.increment(sequenceIndex);
									var idx = 0;

									while (idx < sequence.length && glyph && fn(sequence[idx], glyph.id)) {
										if (matched) {
											matched.push(this.glyphIterator.index);
										}

										idx++;
										glyph = this.glyphIterator.next();
									}

									this.glyphIterator.index = pos;
									if (idx < sequence.length) {
										return false;
									}

									return matched || true;
								}
							}, {
								key: 'sequenceMatches',
								value: function sequenceMatches(sequenceIndex, sequence) {
									return this.match(sequenceIndex, sequence, function (component, glyph) {
										return component === glyph;
									});
								}
							}, {
								key: 'sequenceMatchIndices',
								value: function sequenceMatchIndices(sequenceIndex, sequence) {
									return this.match(sequenceIndex, sequence, function (component, glyph) {
										return component === glyph;
									}, []);
								}
							}, {
								key: 'coverageSequenceMatches',
								value: function coverageSequenceMatches(sequenceIndex, sequence) {
									var _this = this;

									return this.match(sequenceIndex, sequence, function (coverage, glyph) {
										return _this.coverageIndex(coverage, glyph) >= 0;
									});
								}
							}, {
								key: 'getClassID',
								value: function getClassID(glyph, classDef) {
									switch (classDef.version) {
										case 1:
											// Class array
											var glyphID = classDef.startGlyph;
											for (var i = 0, keys = Object.keys(classDef.classValueArray); i < keys.length; i++) {
												var classID = classDef.classValueArray[keys[i]];
												if (glyph === glyphID++) {
													return classID;
												}
											}

											break;

										case 2:
											for (var i = 0, keys = Object.keys(classDef.classRangeRecord); i < keys.length; i++) {
												var range = classDef.classRangeRecord[keys[i]];
												if (range.start <= glyph && glyph <= range.end) {
													return range.class;
												}
											}

											break;
									}

									return -1;
								}
							}, {
								key: 'classSequenceMatches',
								value: function classSequenceMatches(sequenceIndex, sequence, classDef) {
									var _this2 = this;

									return this.match(sequenceIndex, sequence, function (classID, glyph) {
										return classID === _this2.getClassID(glyph, classDef);
									});
								}
							}, {
								key: 'applyContext',
								value: function applyContext(table) {
									switch (table.version) {
										case 1:
											var index = this.coverageIndex(table.coverage);
											if (index === -1) {
												return;
											}

											var set = table.ruleSets[index];
											for (var i = 0, keys = Object.keys(set); i < keys.length; i++) {
												var rule = set[keys[i]];
												if (this.sequenceMatches(1, rule.input)) {
													return this.applyLookupList(rule.lookupRecords);
												}
											}

											break;

										case 2:
											if (this.coverageIndex(table.coverage) === -1) {
												return;
											}

											index = this.getClassID(this.glyphIterator.cur.id, table.classDef);
											if (index === -1) {
												return;
											}

											set = table.classSet[index];
											for (var i = 0, keys = Object.keys(set); i < keys.length; i++) {
												var rule = set[keys[i]];
												if (this.classSequenceMatches(1, rule.classes, table.classDef)) {
													return this.applyLookupList(rule.lookupRecords);
												}
											}

											break;

										case 3:
											if (this.coverageSequenceMatches(0, table.coverages)) {
												return this.applyLookupList(table.lookupRecords);
											}

											break;
									}
								}
							}, {
								key: 'applyChainingContext',
								value: function applyChainingContext(table) {
									switch (table.version) {
										case 1:
											var index = this.coverageIndex(table.coverage);
											if (index === -1) {
												return;
											}

											var set = table.chainRuleSets[index];
											for (var i = 0, keys = Object.keys(set); i < keys.length; i++) {
												var rule = set[keys[i]];
												if (this.sequenceMatches(-rule.backtrack.length, rule.backtrack)
													&& this.sequenceMatches(1, rule.input)
													&& this.sequenceMatches(1 + rule.input.length, rule.lookahead)) {
													return this.applyLookupList(rule.lookupRecords);
												}
											}

											break;

										case 2:
											if (this.coverageIndex(table.coverage) === -1) {
												return;
											}

											index = this.getClassID(this.glyphIterator.cur.id, table.inputClassDef);
											if (index === -1) {
												return;
											}

											var rules = table.chainClassSet[index];
											for (var i = 0, keys = Object.keys(rules); i < keys.length; i++) {
												var rule = rules[keys[i]];
												if (this.classSequenceMatches(-rule.backtrack.length, rule.backtrack, table.backtrackClassDef) &&
													this.classSequenceMatches(1, rule.input, table.inputClassDef) &&
													this.classSequenceMatches(1 + rule.input.length, rule.lookahead, table.lookaheadClassDef)) {
													return this.applyLookupList(rule.lookupRecords);
												}
											}

											break;

										case 3:
											if (this.coverageSequenceMatches(-table.backtrackGlyphCount, table.backtrackCoverage) && this.coverageSequenceMatches(0, table.inputCoverage) && this.coverageSequenceMatches(table.inputGlyphCount, table.lookaheadCoverage)) {
												return this.applyLookupList(table.lookupRecords);
											}

											break;
									}
								}
							}]);

						return OTProcessor;
					} ();

					//var GSUBProcessor: (...args) => void = function (_OTProcessor) {
					//	_inherits(GSUBProcessor, _OTProcessor);

					//	function GSUBProcessor() {
					//		_classCallCheck(this, GSUBProcessor);

					//		return _possibleConstructorReturn(this, (GSUBProcessor.__proto__ || _Object$getPrototypeOf(GSUBProcessor)).apply(this, arguments));
					//	}

					//	_createClass(GSUBProcessor, [{
					//		key: 'applyLookup',
					//		value: function applyLookup(lookupType, table) {
					//			var _this2 = this;

					//			switch (lookupType) {
					//				case 1:
					//					{
					//						// Single Substitution
					//						var index = this.coverageIndex(table.coverage);
					//						if (index === -1) {
					//							return false;
					//						}

					//						var glyph = this.glyphIterator.cur;
					//						switch (table.version) {
					//							case 1:
					//								glyph.id = glyph.id + table.deltaGlyphID & 0xffff;
					//								break;

					//							case 2:
					//								glyph.id = table.substitute.get(index);
					//								break;
					//						}

					//						return true;
					//					}

					//				case 2:
					//					{
					//						// Multiple Substitution
					//						var _index = this.coverageIndex(table.coverage);
					//						if (_index !== -1) {
					//							var _ret = function () {
					//								var _glyphs;

					//								var sequence = table.sequences.get(_index);
					//								_this2.glyphIterator.cur.id = sequence[0];

					//								var features = _this2.glyphIterator.cur.features;
					//								var replacement = sequence.slice(1).map(function (gid) {
					//									return new GlyphInfo(gid, undefined, features);
					//								});

					//								(_glyphs = _this2.glyphs).splice.apply(_glyphs, [_this2.glyphIterator.index + 1, 0].concat(_toConsumableArray(replacement)));
					//								return {
					//									v: true
					//								};
					//							} ();

					//							if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
					//						}

					//						return false;
					//					}

					//				case 3:
					//					{
					//						// Alternate Substitution
					//						var _index2 = this.coverageIndex(table.coverage);
					//						if (_index2 !== -1) {
					//							var USER_INDEX = 0; // TODO
					//							this.glyphIterator.cur.id = table.alternateSet.get(_index2)[USER_INDEX];
					//							return true;
					//						}

					//						return false;
					//					}

					//				case 4:
					//					{
					//						// Ligature Substitution
					//						var _index3 = this.coverageIndex(table.coverage);
					//						if (_index3 === -1) {
					//							return false;
					//						}

					//						var _iteratorNormalCompletion = true;
					//						var _didIteratorError = false;
					//						var _iteratorError = undefined;

					//						try {
					//							for (var _iterator = _getIterator(table.ligatureSets.get(_index3)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
					//								var ligature = _step.value;

					//								var matched = this.sequenceMatchIndices(1, ligature.components);
					//								if (!matched) {
					//									continue;
					//								}

					//								var curGlyph = this.glyphIterator.cur;

					//								// Concatenate all of the characters the new ligature will represent
					//								var characters = curGlyph.codePoints.slice();
					//								var _iteratorNormalCompletion2 = true;
					//								var _didIteratorError2 = false;
					//								var _iteratorError2 = undefined;

					//								try {
					//									for (var _iterator2 = _getIterator(matched), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
					//										var _index4 = _step2.value;

					//										characters.push.apply(characters, _toConsumableArray(this.glyphs[_index4].codePoints));
					//									}

					//									// Create the replacement ligature glyph
					//								} catch (err) {
					//									_didIteratorError2 = true;
					//									_iteratorError2 = err;
					//								} finally {
					//									try {
					//										if (!_iteratorNormalCompletion2 && _iterator2.return) {
					//											_iterator2.return();
					//										}
					//									} finally {
					//										if (_didIteratorError2) {
					//											throw _iteratorError2;
					//										}
					//									}
					//								}

					//								var ligatureGlyph = new GlyphInfo(ligature.glyph, characters);
					//								ligatureGlyph.features = curGlyph.features;

					//								// From Harfbuzz:
					//								// - If it *is* a mark ligature, we don't allocate a new ligature id, and leave
					//								//   the ligature to keep its old ligature id.  This will allow it to attach to
					//								//   a base ligature in GPOS.  Eg. if the sequence is: LAM,LAM,SHADDA,FATHA,HEH,
					//								//   and LAM,LAM,HEH for a ligature, they will leave SHADDA and FATHA with a
					//								//   ligature id and component value of 2.  Then if SHADDA,FATHA form a ligature
					//								//   later, we don't want them to lose their ligature id/component, otherwise
					//								//   GPOS will fail to correctly position the mark ligature on top of the
					//								//   LAM,LAM,HEH ligature. See https://bugzilla.gnome.org/show_bug.cgi?id=676343
					//								//
					//								// - If a ligature is formed of components that some of which are also ligatures
					//								//   themselves, and those ligature components had marks attached to *their*
					//								//   components, we have to attach the marks to the new ligature component
					//								//   positions!  Now *that*'s tricky!  And these marks may be following the
					//								//   last component of the whole sequence, so we should loop forward looking
					//								//   for them and update them.
					//								//
					//								//   Eg. the sequence is LAM,LAM,SHADDA,FATHA,HEH, and the font first forms a
					//								//   'calt' ligature of LAM,HEH, leaving the SHADDA and FATHA with a ligature
					//								//   id and component == 1.  Now, during 'liga', the LAM and the LAM-HEH ligature
					//								//   form a LAM-LAM-HEH ligature.  We need to reassign the SHADDA and FATHA to
					//								//   the new ligature with a component value of 2.
					//								//
					//								//   This in fact happened to a font...  See https://bugzilla.gnome.org/show_bug.cgi?id=437633
					//								ligatureGlyph.ligatureID = ligatureGlyph.isMark ? 0 : this.ligatureID++;

					//								var lastLigID = curGlyph.ligatureID;
					//								var lastNumComps = curGlyph.codePoints.length;
					//								var curComps = lastNumComps;
					//								var idx = this.glyphIterator.index + 1;

					//								// Set ligatureID and ligatureComponent on glyphs that were skipped in the matched sequence.
					//								// This allows GPOS to attach marks to the correct ligature components.
					//								var _iteratorNormalCompletion3 = true;
					//								var _didIteratorError3 = false;
					//								var _iteratorError3 = undefined;

					//								try {
					//									for (var _iterator3 = _getIterator(matched), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
					//										var matchIndex = _step3.value;

					//										// Don't assign new ligature components for mark ligatures (see above)
					//										if (ligatureGlyph.isMark) {
					//											idx = matchIndex;
					//										} else {
					//											while (idx < matchIndex) {
					//												var ligatureComponent = curComps - lastNumComps + Math.min(this.glyphs[idx].ligatureComponent || 1, lastNumComps);
					//												this.glyphs[idx].ligatureID = ligatureGlyph.ligatureID;
					//												this.glyphs[idx].ligatureComponent = ligatureComponent;
					//												idx++;
					//											}
					//										}

					//										lastLigID = this.glyphs[idx].ligatureID;
					//										lastNumComps = this.glyphs[idx].codePoints.length;
					//										curComps += lastNumComps;
					//										idx++; // skip base glyph
					//									}

					//									// Adjust ligature components for any marks following
					//								} catch (err) {
					//									_didIteratorError3 = true;
					//									_iteratorError3 = err;
					//								} finally {
					//									try {
					//										if (!_iteratorNormalCompletion3 && _iterator3.return) {
					//											_iterator3.return();
					//										}
					//									} finally {
					//										if (_didIteratorError3) {
					//											throw _iteratorError3;
					//										}
					//									}
					//								}

					//								if (lastLigID && !ligatureGlyph.isMark) {
					//									for (var i = idx; i < this.glyphs.length; i++) {
					//										if (this.glyphs[i].ligatureID === lastLigID) {
					//											var ligatureComponent = curComps - lastNumComps + Math.min(this.glyphs[i].ligatureComponent || 1, lastNumComps);
					//											this.glyphs[i].ligatureComponent = ligatureComponent;
					//										} else {
					//											break;
					//										}
					//									}
					//								}

					//								// Delete the matched glyphs, and replace the current glyph with the ligature glyph
					//								for (var _i = matched.length - 1; _i >= 0; _i--) {
					//									this.glyphs.splice(matched[_i], 1);
					//								}

					//								this.glyphs[this.glyphIterator.index] = ligatureGlyph;
					//								return true;
					//							}
					//						} catch (err) {
					//							_didIteratorError = true;
					//							_iteratorError = err;
					//						} finally {
					//							try {
					//								if (!_iteratorNormalCompletion && _iterator.return) {
					//									_iterator.return();
					//								}
					//							} finally {
					//								if (_didIteratorError) {
					//									throw _iteratorError;
					//								}
					//							}
					//						}

					//						return false;
					//					}

					//				case 5:
					//					// Contextual Substitution
					//					this.applyContext(table);
					//					return false;

					//				case 6:
					//					// Chaining Contextual Substitution
					//					this.applyChainingContext(table);
					//					return false;

					//				case 7:
					//					// Extension Substitution
					//					this.applyLookup(table.lookupType, table.extension);
					//					return false;

					//				default:
					//					throw new Error('GSUB lookupType ' + lookupType + ' is not supported');
					//			}
					//		}
					//	}]);

					//	return GSUBProcessor;
					//} (OTProcessor);

					//var GPOSProcessor: (...args) => void = function (_OTProcessor) {
					//	_inherits(GPOSProcessor, _OTProcessor);

					//	function GPOSProcessor() {
					//		_classCallCheck(this, GPOSProcessor);

					//		return _possibleConstructorReturn(this, (GPOSProcessor.__proto__ || _Object$getPrototypeOf(GPOSProcessor)).apply(this, arguments));
					//	}

					//	_createClass(GPOSProcessor, [{
					//		key: 'applyPositionValue',
					//		value: function applyPositionValue(sequenceIndex, value) {
					//			var position = this.positions[this.glyphIterator.peekIndex(sequenceIndex)];
					//			if (value.xAdvance != null) {
					//				position.xAdvance += value.xAdvance;
					//			}

					//			if (value.yAdvance != null) {
					//				position.yAdvance += value.yAdvance;
					//			}

					//			if (value.xPlacement != null) {
					//				position.xOffset += value.xPlacement;
					//			}

					//			if (value.yPlacement != null) {
					//				position.yOffset += value.yPlacement;
					//			}

					//			// TODO: device tables
					//		}
					//	}, {
					//			key: 'applyLookup',
					//			value: function applyLookup(lookupType, table) {
					//				switch (lookupType) {
					//					case 1:
					//						{
					//							// Single positioning value
					//							var index = this.coverageIndex(table.coverage);
					//							if (index === -1) {
					//								return false;
					//							}

					//							switch (table.version) {
					//								case 1:
					//									this.applyPositionValue(0, table.value);
					//									break;

					//								case 2:
					//									this.applyPositionValue(0, table.values.get(index));
					//									break;
					//							}

					//							return true;
					//						}

					//					case 2:
					//						{
					//							// Pair Adjustment Positioning
					//							var nextGlyph = this.glyphIterator.peek();
					//							if (!nextGlyph) {
					//								return false;
					//							}

					//							var _index = this.coverageIndex(table.coverage);
					//							if (_index === -1) {
					//								return false;
					//							}

					//							switch (table.version) {
					//								case 1:
					//									// Adjustments for glyph pairs
					//									var set = table.pairSets.get(_index);

					//									var _iteratorNormalCompletion = true;
					//									var _didIteratorError = false;
					//									var _iteratorError = undefined;

					//									try {
					//										for (var _iterator = _getIterator(set), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
					//											var _pair = _step.value;

					//											if (_pair.secondGlyph === nextGlyph.id) {
					//												this.applyPositionValue(0, _pair.value1);
					//												this.applyPositionValue(1, _pair.value2);
					//												return true;
					//											}
					//										}
					//									} catch (err) {
					//										_didIteratorError = true;
					//										_iteratorError = err;
					//									} finally {
					//										try {
					//											if (!_iteratorNormalCompletion && _iterator.return) {
					//												_iterator.return();
					//											}
					//										} finally {
					//											if (_didIteratorError) {
					//												throw _iteratorError;
					//											}
					//										}
					//									}

					//									return false;

					//								case 2:
					//									// Class pair adjustment
					//									var class1 = this.getClassID(this.glyphIterator.cur.id, table.classDef1);
					//									var class2 = this.getClassID(nextGlyph.id, table.classDef2);
					//									if (class1 === -1 || class2 === -1) {
					//										return false;
					//									}

					//									var pair = table.classRecords.get(class1).get(class2);
					//									this.applyPositionValue(0, pair.value1);
					//									this.applyPositionValue(1, pair.value2);
					//									return true;
					//							}
					//						}

					//					case 3:
					//						{
					//							// Cursive Attachment Positioning
					//							var nextIndex = this.glyphIterator.peekIndex();
					//							var _nextGlyph = this.glyphs[nextIndex];
					//							if (!_nextGlyph) {
					//								return false;
					//							}

					//							var curRecord = table.entryExitRecords[this.coverageIndex(table.coverage)];
					//							if (!curRecord || !curRecord.exitAnchor) {
					//								return false;
					//							}

					//							var nextRecord = table.entryExitRecords[this.coverageIndex(table.coverage, _nextGlyph.id)];
					//							if (!nextRecord || !nextRecord.entryAnchor) {
					//								return false;
					//							}

					//							var entry = this.getAnchor(nextRecord.entryAnchor);
					//							var exit = this.getAnchor(curRecord.exitAnchor);

					//							var cur = this.positions[this.glyphIterator.index];
					//							var next = this.positions[nextIndex];

					//							switch (this.direction) {
					//								case 'ltr':
					//									cur.xAdvance = exit.x + cur.xOffset;

					//									var d = entry.x + next.xOffset;
					//									next.xAdvance -= d;
					//									next.xOffset -= d;
					//									break;

					//								case 'rtl':
					//									d = exit.x + cur.xOffset;
					//									cur.xAdvance -= d;
					//									cur.xOffset -= d;
					//									next.xAdvance = entry.x + next.xOffset;
					//									break;
					//							}

					//							if (this.glyphIterator.flags.rightToLeft) {
					//								this.glyphIterator.cur.cursiveAttachment = nextIndex;
					//								cur.yOffset = entry.y - exit.y;
					//							} else {
					//								_nextGlyph.cursiveAttachment = this.glyphIterator.index;
					//								cur.yOffset = exit.y - entry.y;
					//							}

					//							return true;
					//						}

					//					case 4:
					//						{
					//							// Mark to base positioning
					//							var markIndex = this.coverageIndex(table.markCoverage);
					//							if (markIndex === -1) {
					//								return false;
					//							}

					//							// search backward for a base glyph
					//							var baseGlyphIndex = this.glyphIterator.index;
					//							while (--baseGlyphIndex >= 0 && this.glyphs[baseGlyphIndex].isMark) { }

					//							if (baseGlyphIndex < 0) {
					//								return false;
					//							}

					//							var baseIndex = this.coverageIndex(table.baseCoverage, this.glyphs[baseGlyphIndex].id);
					//							if (baseIndex === -1) {
					//								return false;
					//							}

					//							var markRecord = table.markArray[markIndex];
					//							var baseAnchor = table.baseArray[baseIndex][markRecord.class];
					//							this.applyAnchor(markRecord, baseAnchor, baseGlyphIndex);
					//							return true;
					//						}

					//					case 5:
					//						{
					//							// Mark to ligature positioning
					//							var _markIndex = this.coverageIndex(table.markCoverage);
					//							if (_markIndex === -1) {
					//								return false;
					//							}

					//							// search backward for a base glyph
					//							var _baseGlyphIndex = this.glyphIterator.index;
					//							while (--_baseGlyphIndex >= 0 && this.glyphs[_baseGlyphIndex].isMark) { }

					//							if (_baseGlyphIndex < 0) {
					//								return false;
					//							}

					//							var ligIndex = this.coverageIndex(table.ligatureCoverage, this.glyphs[_baseGlyphIndex].id);
					//							if (ligIndex === -1) {
					//								return false;
					//							}

					//							var ligAttach = table.ligatureArray[ligIndex];
					//							var markGlyph = this.glyphIterator.cur;
					//							var ligGlyph = this.glyphs[_baseGlyphIndex];
					//							var compIndex = ligGlyph.ligatureID && ligGlyph.ligatureID === markGlyph.ligatureID && markGlyph.ligatureComponent != null ? Math.min(markGlyph.ligatureComponent, ligGlyph.codePoints.length) - 1 : ligGlyph.codePoints.length - 1;

					//							var _markRecord = table.markArray[_markIndex];
					//							var _baseAnchor = ligAttach[compIndex][_markRecord.class];
					//							this.applyAnchor(_markRecord, _baseAnchor, _baseGlyphIndex);
					//							return true;
					//						}

					//					case 6:
					//						{
					//							// Mark to mark positioning
					//							var mark1Index = this.coverageIndex(table.mark1Coverage);
					//							if (mark1Index === -1) {
					//								return false;
					//							}

					//							// get the previous mark to attach to
					//							var prevIndex = this.glyphIterator.peekIndex(-1);
					//							var prev = this.glyphs[prevIndex];
					//							if (!prev || !prev.isMark) {
					//								return false;
					//							}

					//							var _cur = this.glyphIterator.cur;

					//							// The following logic was borrowed from Harfbuzz
					//							var good = false;
					//							if (_cur.ligatureID === prev.ligatureID) {
					//								if (!_cur.ligatureID) {
					//									// Marks belonging to the same base
					//									good = true;
					//								} else if (_cur.ligatureComponent === prev.ligatureComponent) {
					//									// Marks belonging to the same ligature component
					//									good = true;
					//								}
					//							} else {
					//								// If ligature ids don't match, it may be the case that one of the marks
					//								// itself is a ligature, in which case match.
					//								if (_cur.ligatureID && !_cur.ligatureComponent || prev.ligatureID && !prev.ligatureComponent) {
					//									good = true;
					//								}
					//							}

					//							if (!good) {
					//								return false;
					//							}

					//							var mark2Index = this.coverageIndex(table.mark2Coverage, prev.id);
					//							if (mark2Index === -1) {
					//								return false;
					//							}

					//							var _markRecord2 = table.mark1Array[mark1Index];
					//							var _baseAnchor2 = table.mark2Array[mark2Index][_markRecord2.class];
					//							this.applyAnchor(_markRecord2, _baseAnchor2, prevIndex);
					//							return true;
					//						}

					//					case 7:
					//						// Contextual positioning
					//						this.applyContext(table);
					//						return false;

					//					case 8:
					//						// Chaining contextual positioning
					//						this.applyChainingContext(table);
					//						return false;

					//					case 9:
					//						// Extension positioning
					//						this.applyLookup(table.lookupType, table.extension);
					//						return false;

					//					default:
					//						throw new Error('Unsupported GPOS table: ' + lookupType);
					//				}
					//			}
					//		}, {
					//			key: 'applyAnchor',
					//			value: function applyAnchor(markRecord, baseAnchor, baseGlyphIndex) {
					//				var baseCoords = this.getAnchor(baseAnchor);
					//				var markCoords = this.getAnchor(markRecord.markAnchor);

					//				var basePos = this.positions[baseGlyphIndex];
					//				var markPos = this.positions[this.glyphIterator.index];

					//				markPos.xOffset = baseCoords.x - markCoords.x;
					//				markPos.yOffset = baseCoords.y - markCoords.y;
					//				return this.glyphIterator.cur.markAttachment = baseGlyphIndex;
					//			}
					//		}, {
					//			key: 'getAnchor',
					//			value: function getAnchor(anchor) {
					//				// TODO: contour point, device tables
					//				return {
					//					x: anchor.xCoordinate,
					//					y: anchor.yCoordinate
					//				};
					//			}
					//		}, {
					//			key: 'applyFeatures',
					//			value: function applyFeatures(userFeatures, glyphs, advances) {
					//				_get(GPOSProcessor.prototype.__proto__ || _Object$getPrototypeOf(GPOSProcessor.prototype), 'applyFeatures', this).call(this, userFeatures, glyphs, advances);

					//				for (var i = 0; i < this.glyphs.length; i++) {
					//					this.fixCursiveAttachment(i);
					//				}

					//				this.fixMarkAttachment(i);
					//			}
					//		}, {
					//			key: 'fixCursiveAttachment',
					//			value: function fixCursiveAttachment(i) {
					//				var glyph = this.glyphs[i];
					//				if (glyph.cursiveAttachment != null) {
					//					var j = glyph.cursiveAttachment;

					//					glyph.cursiveAttachment = null;
					//					this.fixCursiveAttachment(j);

					//					this.positions[i].yOffset += this.positions[j].yOffset;
					//				}
					//			}
					//		}, {
					//			key: 'fixMarkAttachment',
					//			value: function fixMarkAttachment() {
					//				for (var i = 0; i < this.glyphs.length; i++) {
					//					var glyph = this.glyphs[i];
					//					if (glyph.markAttachment) {
					//						var j = glyph.markAttachment;

					//						this.positions[i].xOffset += this.positions[j].xOffset;
					//						this.positions[i].yOffset += this.positions[j].yOffset;

					//						if (this.direction === 'ltr') {
					//							for (var k = j; k < i; k++) {
					//								this.positions[i].xOffset -= this.positions[k].xAdvance;
					//								this.positions[i].yOffset -= this.positions[k].yAdvance;
					//							}
					//						}
					//					}
					//				}
					//			}
					//		}]);

					//	return GPOSProcessor;
					//} (OTProcessor);

					var OTLayoutEngine = function () {
						function OTLayoutEngine(font) {
							_classCallCheck(this, OTLayoutEngine);

							this.font = font;
							this.glyphInfos = null;
							this.plan = null;
							//this.GSUBProcessor = null;
							//this.GPOSProcessor = null;

							//if (font.GSUB) {
							//	this.GSUBProcessor = new GSUBProcessor(font, font.GSUB);
							//}

							//if (font.GPOS) {
							//	this.GPOSProcessor = new GPOSProcessor(font, font.GPOS);
							//}
						}

						_createClass(OTLayoutEngine, [{
							key: 'setup',
							value: function setup(glyphs, features, script, language) {
								// Map glyphs to GlyphInfo objects so data can be passed between
								// GSUB and GPOS without mutating the real (shared) Glyph objects.
								this.glyphInfos = glyphs.map(function (glyph) {
									return new GlyphInfo(glyph.id, [].concat(_toConsumableArray(glyph.codePoints)));
								});

								// Choose a shaper based on the script, and setup a shaping plan.
								// This determines which features to apply to which glyphs.
								var shaper = choose(script);
								this.plan = new ShapingPlan(this.font, script, language);
								return shaper.plan(this.plan, this.glyphInfos, features);
							}
						}, {
								key: 'substitute',
								value: function substitute(glyphs) {
									var _this = this;

									//if (this.GSUBProcessor) {
									//	this.plan.process(this.GSUBProcessor, this.glyphInfos);

									//	// Map glyph infos back to normal Glyph objects
									//	glyphs = this.glyphInfos.map(function (glyphInfo) {
									//		return _this.font.getGlyph(glyphInfo.id, glyphInfo.codePoints);
									//	});
									//}

									return glyphs;
								}
							}, {
								key: 'position',
								value: function position(glyphs, positions) {
									//if (this.GPOSProcessor) {
									//	this.plan.process(this.GPOSProcessor, this.glyphInfos, positions);
									//}

									// Reverse the glyphs and positions if the script is right-to-left
									if (this.plan.direction === 'rtl') {
										glyphs.reverse();
										positions.reverse();
									}

									return this.GPOSProcessor && this.GPOSProcessor.features;
								}
							}, {
								key: 'cleanup',
								value: function cleanup() {
									this.glyphInfos = null;
									this.plan = null;
								}
							}, {
								key: 'getAvailableFeatures',
								value: function getAvailableFeatures(script, language) {
									var features = [];

									//if (this.GSUBProcessor) {
									//	this.GSUBProcessor.selectScript(script, language);
									//	features.push.apply(features, _toConsumableArray(_Object$keys(this.GSUBProcessor.features)));
									//}

									//if (this.GPOSProcessor) {
									//	this.GPOSProcessor.selectScript(script, language);
									//	features.push.apply(features, _toConsumableArray(_Object$keys(this.GPOSProcessor.features)));
									//}

									return features;
								}
							}]);

						return OTLayoutEngine;
					} ();

					var LayoutEngine = function () {
						function LayoutEngine(font) {
							_classCallCheck(this, LayoutEngine);

							this.font = font;
							this.unicodeLayoutEngine = null;
							//this.kernProcessor = null;

							// Choose an advanced layout engine. We try the AAT morx table first since more
							// scripts are currently supported because the shaping logic is built into the font.
							//if (this.font.morx) {
							//	this.engine = new AATLayoutEngine(this.font);
							//} else if (this.font.GSUB || this.font.GPOS) {
							//	this.engine = new OTLayoutEngine(this.font);
							//}
						}

						_createClass(LayoutEngine, [{
							key: 'layout',
							value: function layout(string) {
								var features = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
								var script = arguments[2];
								var language = arguments[3];

								// Make the features parameter optional
								if (typeof features === 'string') {
									script = features;
									language = script;
									features = [];
								}

								// Map string to glyphs if needed
								if (typeof string === 'string') {
									// Attempt to detect the script from the string if not provided.
									if (script == null) {
										script = forString(string);
									}

									var glyphs = this.font.glyphsForString(string);
								} else {
									// Attempt to detect the script from the glyph code points if not provided.
									if (script == null) {
										var codePoints = [];

										for (var i = 0, keys = Object.keys(string); i < keys.length; i++) {
											var glyph = string[keys[i]];
											codePoints.push.apply(codePoints, _toConsumableArray(glyph.codePoints));
										}

										script = forCodePoints(codePoints);
									}

									var glyphs = string;
								}

								// Return early if there are no glyphs
								if (glyphs.length === 0) {
									return new GlyphRun(glyphs, []);
								}

								//// Setup the advanced layout engine
								//if (this.engine && this.engine.setup) {
								//	this.engine.setup(glyphs, features, script, language);
								//}

								// Substitute and position the glyphs
								glyphs = this.substitute(glyphs, features, script, language);
								var positions = this.position(glyphs, features, script, language);

								//// Let the layout engine clean up any state it might have
								//if (this.engine && this.engine.cleanup) {
								//	this.engine.cleanup();
								//}

								return new GlyphRun(glyphs, positions);
							}
						}, {
								key: 'substitute',
								value: function substitute(glyphs, features, script, language) {
									//// Call the advanced layout engine to make substitutions
									//if (this.engine && this.engine.substitute) {
									//	glyphs = this.engine.substitute(glyphs, features, script, language);
									//}

									return glyphs;
								}
							}, {
								key: 'position',
								value: function position(glyphs, features, script, language) {
									// Get initial glyph positions
									var positions = glyphs.map(function (glyph) {
										return new GlyphPosition(glyph.advanceWidth);
									});
									var positioned = null;

									//// Call the advanced layout engine. Returns the features applied.
									//if (this.engine && this.engine.position) {
									//	positioned = this.engine.position(glyphs, positions, features, script, language);
									//}

									// if there is no GPOS table, use unicode properties to position marks.
									if (!positioned) {
										if (!this.unicodeLayoutEngine) {
											this.unicodeLayoutEngine = new UnicodeLayoutEngine(this.font);
										}

										this.unicodeLayoutEngine.positionGlyphs(glyphs, positions);
									}

									// if kerning is not supported by GPOS, do kerning with the TrueType/AAT kern table
									//if ((!positioned || !positioned.kern) && this.font.kern) {
									//	if (!this.kernProcessor) {
									//		this.kernProcessor = new KernProcessor(this.font);
									//	}

									//	this.kernProcessor.process(glyphs, positions);
									//}

									return positions;
								}
							}, {
								key: 'getAvailableFeatures',
								value: function getAvailableFeatures(script, language) {
									var features = [];

									//if (this.engine) {
									//	features.push.apply(features, _toConsumableArray(this.engine.getAvailableFeatures(script, language)));
									//}

									//if (this.font.kern && features.indexOf('kern') === -1) {
									//	features.push('kern');
									//}

									return features;
								}
							}]);

						return LayoutEngine;
					} ();

					//var SVG_COMMANDS = {
					//	moveTo: 'M',
					//	lineTo: 'L',
					//	quadraticCurveTo: 'Q',
					//	bezierCurveTo: 'C',
					//	closePath: 'Z'
					//};

					/**
					 * Path objects are returned by glyphs and represent the actual
					 * vector outlines for each glyph in the font. Paths can be converted
					 * to SVG path data strings, or to functions that can be applied to
					 * render the path to a graphics context.
					 */

					var Path = function () {
						function Path() {
							_classCallCheck(this, Path);

							this.commands = [];
							this._bbox = null;
							this._cbox = null;
						}

						/**
						 * Compiles the path to a JavaScript function that can be applied with
						 * a graphics context in order to render the path.
						 * @return {string}
						 */


						_createClass(Path, [{
							key: 'toFunction',
							value: function toFunction() {
								var cmds = this.commands.map(function (c) {
									return '  ctx.' + c.command + '(' + c.args.join(', ') + ');';
								});
								return new Function('ctx', cmds.join('\n'));
							}

							///**
							// * Converts the path to an SVG path data string
							// * @return {string}
							// */

						},
							{
								//key: 'toSVG',
								//value: function toSVG() {
								//	var cmds = this.commands.map(function (c) {
								//		var args = c.args.map(function (arg) {
								//			return Math.round(arg * 100) / 100;
								//		});
								//		return '' + SVG_COMMANDS[c.command] + args.join(' ');
								//	});

								//	return cmds.join('');
								//}

								/**
								 * Gets the "control box" of a path.
								 * This is like the bounding box, but it includes all points including
								 * control points of bezier segments and is much faster to compute than
								 * the real bounding box.
								 * @type {BBox}
								 */

							}, {
								key: 'cbox',
								get: function get() {
									if (!this._cbox) {
										var cbox = new BBox();

										for (var j = 0, keys = Object.keys(this.commands); j < keys.length; j++) {
											var command = this.commands[j];
											for (let i = 0; i < command.args.length; i += 2) {
												cbox.addPoint(command.args[i], command.args[i + 1]);
											}
										}
										this._cbox = _Object$freeze(cbox);
									}

									return this._cbox;
								}

								/**
								 * Gets the exact bounding box of the path by evaluating curve segments.
								 * Slower to compute than the control box, but more accurate.
								 * @type {BBox}
								 */

							}, {
								key: 'bbox',
								get: function get() {
									if (this._bbox) {
										return this._bbox;
									}

									var bbox = new BBox();
									var cx = 0,
										cy = 0;

									var f = function f(t) {
										return Math.pow(1 - t, 3) * p0[i] + 3 * Math.pow(1 - t, 2) * t * p1[i] + 3 * (1 - t) * Math.pow(t, 2) * p2[i] + Math.pow(t, 3) * p3[i];
									};

									for (var i = 0, keys = Object.keys(this.commands); i < keys.length; i++) {
										var c = this.commands[keys[i]];

										switch (c.command) {
											case 'moveTo':
											case 'lineTo':
												var _c$args = _slicedToArray(c.args, 2);

												var x = _c$args[0];
												var y = _c$args[1];

												bbox.addPoint(x, y);
												cx = x;
												cy = y;
												break;

											case 'quadraticCurveTo':
											case 'bezierCurveTo':
												if (c.command === 'quadraticCurveTo') {
													// http://fontforge.org/bezier.html
													var _c$args2 = _slicedToArray(c.args, 4);

													var qp1x = _c$args2[0];
													var qp1y = _c$args2[1];
													var p3x = _c$args2[2];
													var p3y = _c$args2[3];

													var cp1x: any = cx + 2 / 3 * (qp1x - cx); // CP1 = QP0 + 2/3 * (QP1-QP0)
													var cp1y: any = cy + 2 / 3 * (qp1y - cy);
													var cp2x = p3x + 2 / 3 * (qp1x - p3x); // CP2 = QP2 + 2/3 * (QP1-QP2)
													var cp2y = p3y + 2 / 3 * (qp1y - p3y);
												} else {
													var _c$args3 = _slicedToArray(c.args, 6);

													var cp1x = _c$args3[0];
													var cp1y = _c$args3[1];
													var cp2x = _c$args3[2];
													var cp2y = _c$args3[3];
													var p3x = _c$args3[4];
													var p3y = _c$args3[5];
												}

												// http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
												bbox.addPoint(p3x, p3y);

												var p0 = [cx, cy];
												var p1 = [cp1x, cp1y];
												var p2 = [cp2x, cp2y];
												var p3 = [p3x, p3y];

												for (var j = 0; j <= 1; j++) {
													var b = 6 * p0[j] - 12 * p1[j] + 6 * p2[j];
													var a = -3 * p0[j] + 9 * p1[j] - 9 * p2[j] + 3 * p3[j];
													var i = j;
													c = 3 * p1[j] - 3 * p0[j];

													if (a === 0) {
														if (b === 0) {
															continue;
														}

														var t = -c / b;
														if (0 < t && t < 1) {
															if (j === 0) {
																bbox.addPoint(f(t), bbox.maxY);
															} else if (j === 1) {
																bbox.addPoint(bbox.maxX, f(t));
															}
														}

														continue;
													}

													var b2ac = Math.pow(b, 2) - 4 * c * a;
													if (b2ac < 0) {
														continue;
													}

													var t1 = (-b + Math.sqrt(b2ac)) / (2 * a);
													if (0 < t1 && t1 < 1) {
														if (j === 0) {
															bbox.addPoint(f(t1), bbox.maxY);
														} else if (j === 1) {
															bbox.addPoint(bbox.maxX, f(t1));
														}
													}

													var t2 = (-b - Math.sqrt(b2ac)) / (2 * a);
													if (0 < t2 && t2 < 1) {
														if (j === 0) {
															bbox.addPoint(f(t2), bbox.maxY);
														} else if (j === 1) {
															bbox.addPoint(bbox.maxX, f(t2));
														}
													}
												}

												cx = p3x;
												cy = p3y;
												break;
										}
									}
				
									return this._bbox = _Object$freeze(bbox);
								}
							}]);

						return Path;
					} ();

					var _arr = ['moveTo', 'lineTo', 'quadraticCurveTo', 'bezierCurveTo', 'closePath'];

					var _loop = function _loop() {
						var command = _arr[_i3];
						Path.prototype[command] = function () {
							for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
								args[_key] = arguments[_key];
							}

							this._bbox = this._cbox = null;
							this.commands.push({
								command: command,
								args: args
							});

							return this;
						};
					};

					for (var _i3 = 0; _i3 < _arr.length; _i3++) {
						_loop();
					}

					var StandardNames = ['.notdef', '.null', 'nonmarkingreturn', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis', 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde', 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', 'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', 'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling', 'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright', 'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', 'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff', 'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine', 'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot', 'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft', 'guillemotright', 'ellipsis', 'nonbreakingspace', 'Agrave', 'Atilde', 'Otilde', 'OE', 'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', 'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', 'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', 'periodcentered', 'quotesinglbase', 'quotedblbase', 'perthousand', 'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', 'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'Lslash', 'lslash', 'Scaron', 'scaron', 'Zcaron', 'zcaron', 'brokenbar', 'Eth', 'eth', 'Yacute', 'yacute', 'Thorn', 'thorn', 'minus', 'multiply', 'onesuperior', 'twosuperior', 'threesuperior', 'onehalf', 'onequarter', 'threequarters', 'franc', 'Gbreve', 'gbreve', 'Idotaccent', 'Scedilla', 'scedilla', 'Cacute', 'cacute', 'Ccaron', 'ccaron', 'dcroat'];

					var _class$1;
					function _applyDecoratedDescriptor$1(target, property, decorators, descriptor, context) {
						var desc: any = {};
						Object['ke' + 'ys'](descriptor).forEach(function (key) {
							desc[key] = descriptor[key];
						});
						desc.enumerable = !!desc.enumerable;
						desc.configurable = !!desc.configurable;

						if ('value' in desc || desc.initializer) {
							desc.writable = true;
						}

						desc = decorators.slice().reverse().reduce(function (desc, decorator) {
							return decorator(target, property, desc) || desc;
						}, desc);

						if (context && desc.initializer !== void 0) {
							desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
							desc.initializer = undefined;
						}

						if (desc.initializer === void 0) {
							Object['define' + 'Property'](target, property, desc);
							desc = null;
						}

						return desc;
					}

					/**
					 * Glyph objects represent a glyph in the font. They have various properties for accessing metrics and
					 * the actual vector path the glyph represents, and methods for rendering the glyph to a graphics context.
					 *
					 * You do not create glyph objects directly. They are created by various methods on the font object.
					 * There are several subclasses of the base Glyph class internally that may be returned depending
					 * on the font format, but they all inherit from this class.
					 */
					var Glyph = (_class$1 = function () {
						function Glyph(id, codePoints, font) {
							_classCallCheck(this, Glyph);

							/**
							 * The glyph id in the font
							 * @type {number}
							 */
							this.id = id;

							/**
							 * An array of unicode code points that are represented by this glyph.
							 * There can be multiple code points in the case of ligatures and other glyphs
							 * that represent multiple visual characters.
							 * @type {number[]}
							 */
							this.codePoints = codePoints;
							this._font = font;

							// TODO: get this info from GDEF if available
							this.isMark = this.codePoints.every(unicode.isMark);
							this.isLigature = this.codePoints.length > 1;
						}

						_createClass(Glyph, [
							{
							key: '_getPath',
							value: function _getPath() {
								return new Path();
							}
							},
							{
								key: '_getCBox',
								value: function _getCBox() {
									return this.path.cbox;
								}
							},
							{
								key: '_getBBox',
								value: function _getBBox() {
									return this.path.bbox;
								}
							},
							{
								key: '_getTableMetrics',
								value: function _getTableMetrics(table) {
									if (this.id < table.metrics.length) {
										return table.metrics.get(this.id);
									}

									var metric = table.metrics.get(table.metrics.length - 1);
									var res = {
										advance: metric ? metric.advance : 0,
										bearing: table.bearings.get(this.id - table.metrics.length) || 0
									};

									return res;
								}
							}, {
								key: '_getMetrics',
								value: function _getMetrics(cbox) {
									if (this._metrics) {
										return this._metrics;
									}

									var _getTableMetrics2 = this._getTableMetrics(this._font.hmtx);

									var advanceWidth = _getTableMetrics2.advance;
									var leftBearing = _getTableMetrics2.bearing;

									// For vertical metrics, use vmtx if available, or fall back to global data from OS/2 or hhea

									//if (this._font.vmtx) {
									//	var _getTableMetrics3 = this._getTableMetrics(this._font.vmtx);

									//	var advanceHeight: number = _getTableMetrics3.advance;
									//	var topBearing: number = _getTableMetrics3.bearing;
									//} else {
										var os2 = void 0;
										if (typeof cbox === 'undefined' || cbox === null) {
											cbox = this.cbox;
										}

										if ((os2 = this._font['OS/2']) && os2.version > 0) {
											var advanceHeight = Math.abs(os2.typoAscender - os2.typoDescender);
											var topBearing = os2.typoAscender - cbox.maxY;
										} else {
											var hhea = this._font.hhea;

											var advanceHeight = Math.abs(hhea.ascent - hhea.descent);
											var topBearing = hhea.ascent - cbox.maxY;
										}
									//}

									return this._metrics = { advanceWidth: advanceWidth, advanceHeight: advanceHeight, leftBearing: leftBearing, topBearing: topBearing };
								}

								/**
								 * The glyph's control box.
								 * This is often the same as the bounding box, but is faster to compute.
								 * Because of the way bezier curves are defined, some of the control points
								 * can be outside of the bounding box. Where `bbox` takes this into account,
								 * `cbox` does not. Thus, cbox is less accurate, but faster to compute.
								 * See [here](http://www.freetype.org/freetype2/docs/glyphs/glyphs-6.html#section-2)
								 * for a more detailed description.
								 *
								 * @type {BBox}
								 */

							}, {
								key: '_getName',
								value: function _getName() {
									var post = this._font.post;

									if (!post) {
										return null;
									}

									switch (post.version) {
										case 1:
											return StandardNames[this.id];

										case 2:
											var id = post.glyphNameIndex[this.id];
											if (id < StandardNames.length) {
												return StandardNames[id];
											}

											return post.names[id - StandardNames.length];

										case 2.5:
											return StandardNames[this.id + post.offsets[this.id]];

										case 4:
											return String.fromCharCode(post.map[this.id]);
									}
								}

								/**
								 * The glyph's name
								 * @type {string}
								 */

							},
							//{
							//	key: 'render',


							//	/**
							//	 * Renders the glyph to the given graphics context, at the specified font size.
							//	 * @param {CanvasRenderingContext2d} ctx
							//	 * @param {number} size
							//	 */
							//	value: function render(ctx, size) {
							//		ctx.save();

							//		var scale = 1 / this._font.head.unitsPerEm * size;
							//		ctx.scale(scale, scale);

							//		var fn = this.path.toFunction();
							//		fn(ctx);
							//		ctx.fill();

							//		ctx.restore();
							//	}
							//},
							{
								key: 'cbox',
								get: function get() {
									return this._getCBox();
								}

								/**
								 * The glyphвЂ™s bounding box, i.e. the rectangle that encloses the
								 * glyph outline as tightly as possible.
								 * @type {BBox}
								 */

							}, {
								key: 'bbox',
								get: function get() {
									return this._getBBox();
								}

								/**
								 * A vector Path object representing the glyph outline.
								 * @type {Path}
								 */

							}, {
								key: 'path',
								get: function get() {
									// Cache the path so we only decode it once
									// Decoding is actually performed by subclasses
									return this._getPath();
								}

								/**
								 * The glyph's advance width.
								 * @type {number}
								 */

							}, {
								key: 'advanceWidth',
								get: function get() {
									return this._getMetrics().advanceWidth;
								}

								/**
								 * The glyph's advance height.
								 * @type {number}
								 */

							}, {
								key: 'advanceHeight',
								get: function get() {
									return this._getMetrics().advanceHeight;
								}
							}, {
								key: 'ligatureCaretPositions',
								get: function get() { }
							}, {
								key: 'name',
								get: function get() {
									return this._getName();
								}
							}]);

						return Glyph;
					} (), (_applyDecoratedDescriptor$1(_class$1.prototype, 'cbox', [cache], _Object$getOwnPropertyDescriptor(_class$1.prototype, 'cbox'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'bbox', [cache], _Object$getOwnPropertyDescriptor(_class$1.prototype, 'bbox'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'path', [cache], _Object$getOwnPropertyDescriptor(_class$1.prototype, 'path'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'advanceWidth', [cache], _Object$getOwnPropertyDescriptor(_class$1.prototype, 'advanceWidth'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'advanceHeight', [cache], _Object$getOwnPropertyDescriptor(_class$1.prototype, 'advanceHeight'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'name', [cache], _Object$getOwnPropertyDescriptor(_class$1.prototype, 'name'), _class$1.prototype)), _class$1);

					// The header for both simple and composite glyphs
					var GlyfHeader = new r.Struct({
						numberOfContours: r.int16, // if negative, this is a composite glyph
						xMin: r.int16,
						yMin: r.int16,
						xMax: r.int16,
						yMax: r.int16
					});

					// Flags for simple glyphs
					var ON_CURVE = 1 << 0;
					var X_SHORT_VECTOR = 1 << 1;
					var Y_SHORT_VECTOR = 1 << 2;
					var REPEAT = 1 << 3;
					var SAME_X = 1 << 4;
					var SAME_Y = 1 << 5;

					// Flags for composite glyphs
					var ARG_1_AND_2_ARE_WORDS = 1 << 0;
					var WE_HAVE_A_SCALE = 1 << 3;
					var MORE_COMPONENTS = 1 << 5;
					var WE_HAVE_AN_X_AND_Y_SCALE = 1 << 6;
					var WE_HAVE_A_TWO_BY_TWO = 1 << 7;
					var WE_HAVE_INSTRUCTIONS = 1 << 8;
					// Represents a point in a simple glyph
					var Point = function () {
						function Point(onCurve, endContour, farg1?, farg2?) {
							var x = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
							var y = arguments.length <= 3 || arguments[3] === undefined ? 0 : arguments[3];

							_classCallCheck(this, Point);

							this.onCurve = onCurve;
							this.endContour = endContour;
							this.x = x;
							this.y = y;
						}

						_createClass(Point, [{
							key: 'copy',
							value: function copy() {
								return new Point(this.onCurve, this.endContour, this.x, this.y);
							}
						}]);

						return Point;
					} ();

					// Represents a component in a composite glyph

					var Component = function Component(glyphID, dx, dy) {
						_classCallCheck(this, Component);

						this.glyphID = glyphID;
						this.dx = dx;
						this.dy = dy;
						this.pos = 0;
						this.scale = this.xScale = this.yScale = this.scale01 = this.scale10 = null;
					};

					/**
					 * Represents a TrueType glyph.
					 */


					var TTFGlyph: (...args) => void = function (_Glyph) {
						_inherits(TTFGlyph, _Glyph);

						function TTFGlyph() {
							_classCallCheck(this, TTFGlyph);

							return _possibleConstructorReturn(this, (TTFGlyph.__proto__ || _Object$getPrototypeOf(TTFGlyph)).apply(this, arguments));
						}

						_createClass(TTFGlyph, [{
							key: '_getCBox',

							// Parses just the glyph header and returns the bounding box
							value: function _getCBox(internal) {
								//// We need to decode the glyph if variation processing is requested,
								//// so it's easier just to recompute the path's cbox after decoding.
								//if (this._font._variationProcessor && !internal) {
								//	return this.path.cbox;
								//}

								var stream = this._font._getTableStream('glyf');
								stream.pos += this._font.loca.offsets[this.id];
								var glyph = GlyfHeader.decode(stream);

								var cbox = new BBox(glyph.xMin, glyph.yMin, glyph.xMax, glyph.yMax);
								return _Object$freeze(cbox);
							}

							// Parses a single glyph coordinate

						}, {
								key: '_parseGlyphCoord',
								value: function _parseGlyphCoord(stream, prev, short, same) {
									if (short) {
										var val = stream.readUInt8();
										if (!same) {
											val = -val;
										}

										val += prev;
									} else {
										if (same) {
											var val = prev;
										} else {
											var val = prev + stream.readInt16BE();
										}
									}

									return val;
								}

								// Decodes the glyph data into points for simple glyphs,
								// or components for composite glyphs

							}, {
								key: '_decode',
								value: function _decode() {
									var glyfPos = this._font.loca.offsets[this.id];
									var nextPos = this._font.loca.offsets[this.id + 1];

									// Nothing to do if there is no data for this glyph
									if (glyfPos === nextPos) {
										return null;
									}

									var stream = this._font._getTableStream('glyf');
									stream.pos += glyfPos;
									var startPos = stream.pos;

									var glyph = GlyfHeader.decode(stream);

									if (glyph.numberOfContours > 0) {
										this._decodeSimple(glyph, stream);
									} else if (glyph.numberOfContours < 0) {
										this._decodeComposite(glyph, stream, startPos);
									}

									return glyph;
								}
							}, {
								key: '_decodeSimple',
								value: function _decodeSimple(glyph, stream) {
									// this is a simple glyph
									glyph.points = [];

									var endPtsOfContours = new r.Array(r.uint16, glyph.numberOfContours).decode(stream);
									var instructions = new r.Array(r.uint8, r.uint16).decode(stream);

									var flags = [];
									var numCoords = endPtsOfContours[endPtsOfContours.length - 1] + 1;

									while (flags.length < numCoords) {
										var flag = stream.readUInt8();
										flags.push(flag);

										// check for repeat flag
										if (flag & REPEAT) {
											var count = stream.readUInt8();
											for (var j = 0; j < count; j++) {
												flags.push(flag);
											}
										}
									}

									for (var i = 0; i < flags.length; i++) {
										var flag = flags[i];
										var point = new Point(!!(flag & ON_CURVE), endPtsOfContours.indexOf(i) >= 0, 0, 0);
										glyph.points.push(point);
									}

									var px = 0;
									for (var i = 0; i < flags.length; i++) {
										var flag = flags[i];
										glyph.points[i].x = px = this._parseGlyphCoord(stream, px, flag & X_SHORT_VECTOR, flag & SAME_X);
									}

									var py = 0;
									for (var i = 0; i < flags.length; i++) {
										var flag = flags[i];
										glyph.points[i].y = py = this._parseGlyphCoord(stream, py, flag & Y_SHORT_VECTOR, flag & SAME_Y);
									}

									//if (this._font._variationProcessor) {
									//	var points = glyph.points.slice();
									//	points.push.apply(points, _toConsumableArray(this._getPhantomPoints(glyph)));

									//	this._font._variationProcessor.transformPoints(this.id, points);
									//	glyph.phantomPoints = points.slice(-4);
									//}

									return;
								}
							}, {
								key: '_decodeComposite',
								value: function _decodeComposite(glyph, stream) {
									var offset = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];

									// this is a composite glyph
									glyph.components = [];
									var haveInstructions = false;
									var flags = MORE_COMPONENTS;

									while (flags & MORE_COMPONENTS) {
										flags = stream.readUInt16BE();
										var gPos = stream.pos - offset;
										var glyphID = stream.readUInt16BE();
										if (!haveInstructions) {
											haveInstructions = (flags & WE_HAVE_INSTRUCTIONS) !== 0;
										}

										if (flags & ARG_1_AND_2_ARE_WORDS) {
											var dx = stream.readInt16BE();
											var dy = stream.readInt16BE();
										} else {
											var dx = stream.readInt8();
											var dy = stream.readInt8();
										}

										var component = new Component(glyphID, dx, dy);
										component.pos = gPos;
										component.scaleX = component.scaleY = 1;
										component.scale01 = component.scale10 = 0;

										if (flags & WE_HAVE_A_SCALE) {
											// fixed number with 14 bits of fraction
											component.scaleX = component.scaleY = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
										} else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
											component.scaleX = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
											component.scaleY = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
										} else if (flags & WE_HAVE_A_TWO_BY_TWO) {
											component.scaleX = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
											component.scale01 = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
											component.scale10 = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
											component.scaleY = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
										}

										glyph.components.push(component);
									}

									//if (this._font._variationProcessor) {
									//	var points = [];
									//	for (var j = 0; j < glyph.components.length; j++) {
									//		var component = glyph.components[j];
									//		points.push(new Point(true, true, component.dx, component.dy));
									//	}

									//	points.push.apply(points, _toConsumableArray(this._getPhantomPoints(glyph)));

									//	this._font._variationProcessor.transformPoints(this.id, points);
									//	glyph.phantomPoints = points.splice(-4, 4);

									//	for (var i = 0; i < points.length; i++) {
									//		var point = points[i];
									//		glyph.components[i].dx = point.x;
									//		glyph.components[i].dy = point.y;
									//	}
									//}

									return haveInstructions;
								}
							}, {
								key: '_getPhantomPoints',
								value: function _getPhantomPoints(glyph) {
									var cbox = this._getCBox(true);
									if (this._metrics == null) {
										this._metrics = Glyph.prototype._getMetrics.call(this, cbox);
									}

									var _metrics = this._metrics;
									var advanceWidth = _metrics.advanceWidth;
									var advanceHeight = _metrics.advanceHeight;
									var leftBearing = _metrics.leftBearing;
									var topBearing = _metrics.topBearing;


									return [new Point(false, true, glyph.xMin - leftBearing, 0), new Point(false, true, glyph.xMin - leftBearing + advanceWidth, 0), new Point(false, true, 0, glyph.yMax + topBearing), new Point(false, true, 0, glyph.yMax + topBearing + advanceHeight)];
								}

								// Decodes font data, resolves composite glyphs, and returns an array of contours

							}, {
								key: '_getContours',
								value: function _getContours() {
									var glyph = this._decode();
									if (!glyph) {
										return [];
									}

									if (glyph.numberOfContours < 0) {
										// resolve composite glyphs
										var points: any = [];

										for (var i = 0, keys = Object.keys(glyph.components); i < keys.length; i++) {
											var component = glyph.components[keys[i]];
											// TODO transform
											for (var j = 0, keys2 = Object.keys(glyph.points); j < keys2.length; j++) {
												var point = glyph.points[keys[j]];
												points.push(new Point(point.onCurve, point.endContour, point.x + component.dx, point.y + component.dy));
											}
										}
									} else {
										var points = glyph.points;
									}

									//// Recompute and cache metrics if we performed variation processing
									//if (glyph.phantomPoints) {
									//	this._metrics.advanceWidth = glyph.phantomPoints[1].x - glyph.phantomPoints[0].x;
									//	this._metrics.advanceHeight = glyph.phantomPoints[3].y - glyph.phantomPoints[2].y;
									//	this._metrics.leftBearing = glyph.xMin - glyph.phantomPoints[0].x;
									//	this._metrics.topBearing = glyph.phantomPoints[2].y - glyph.yMax;
									//}

									var contours = [];
									var cur = [];
									for (var k = 0; k < points.length; k++) {
										var point = points[k];
										cur.push(point);
										if (point.endContour) {
											contours.push(cur);
											cur = [];
										}
									}

									return contours;
								}
							}, {
								key: '_getMetrics',
								value: function _getMetrics() {
									if (this._metrics) {
										return this._metrics;
									}

									var cbox = this._getCBox(true);
									_get(TTFGlyph.prototype.__proto__ || _Object$getPrototypeOf(TTFGlyph.prototype), '_getMetrics', this).call(this, cbox);

									//if (this._font._variationProcessor) {
									//	// Decode the font data (and cache for later).
									//	// This triggers recomputation of metrics
									//	this.path;
									//}

									return this._metrics;
								}

								// Converts contours to a Path object that can be rendered

							}, {
								key: '_getPath',
								value: function _getPath() {
									var contours = this._getContours();
									var path = new Path();

									for (var i = 0; i < contours.length; i++) {
										var contour = contours[i];
										var firstPt = contour[0];
										var lastPt = contour[contour.length - 1];
										var start = 0;

										if (firstPt.onCurve) {
											// The first point will be consumed by the moveTo command, so skip in the loop
											var curvePt = null;
											start = 1;
										} else {
											if (lastPt.onCurve) {
												// Start at the last point if the first point is off curve and the last point is on curve
												firstPt = lastPt;
											} else {
												// Start at the middle if both the first and last points are off curve
												firstPt = new Point(false, false, (firstPt.x + lastPt.x) / 2, (firstPt.y + lastPt.y) / 2);
											}

											var curvePt = firstPt;
										}

										path.moveTo(firstPt.x, firstPt.y);

										for (var j = start; j < contour.length; j++) {
											var pt = contour[j];
											var prevPt = j === 0 ? firstPt : contour[j - 1];

											if (prevPt.onCurve && pt.onCurve) {
												path.lineTo(pt.x, pt.y);
											} else if (prevPt.onCurve && !pt.onCurve) {
												var curvePt = pt;
											} else if (!prevPt.onCurve && !pt.onCurve) {
												var midX = (prevPt.x + pt.x) / 2;
												var midY = (prevPt.y + pt.y) / 2;
												path.quadraticCurveTo(prevPt.x, prevPt.y, midX, midY);
												var curvePt = pt;
											} else if (!prevPt.onCurve && pt.onCurve) {
												path.quadraticCurveTo(curvePt.x, curvePt.y, pt.x, pt.y);
												var curvePt = null;
											} else {
												throw new Error("Unknown TTF path state");
											}
										}

										// Connect the first and last points
										if (firstPt !== lastPt) {
											if (curvePt) {
												path.quadraticCurveTo(curvePt.x, curvePt.y, firstPt.x, firstPt.y);
											} else {
												path.lineTo(firstPt.x, firstPt.y);
											}
										}
									}

									path.closePath();
									return path;
								}
							}]);

						return TTFGlyph;
					} (Glyph);

					///**
					// * Represents an OpenType PostScript glyph, in the Compact Font Format.
					// */

					//var CFFGlyph: (...args) => void = function (_Glyph) {
					//	_inherits(CFFGlyph, _Glyph);

					//	function CFFGlyph() {
					//		_classCallCheck(this, CFFGlyph);

					//		return _possibleConstructorReturn(this, (CFFGlyph.__proto__ || _Object$getPrototypeOf(CFFGlyph)).apply(this, arguments));
					//	}

					//	_createClass(CFFGlyph, [{
					//		key: '_getName',
					//		value: function _getName() {
					//			return this._font['CFF '].getGlyphName(this.id);
					//		}
					//	}, {
					//			key: 'bias',
					//			value: function bias(s) {
					//				if (s.length < 1240) {
					//					return 107;
					//				} else if (s.length < 33900) {
					//					return 1131;
					//				} else {
					//					return 32768;
					//				}
					//			}
					//		}, {
					//			key: '_getPath',
					//			value: function _getPath() {
					//				var stream = this._font.stream;
					//				var pos = stream.pos;


					//				var cff = this._font['CFF '];
					//				var str = cff.topDict.CharStrings[this.id];
					//				var end = str.offset + str.length;
					//				stream.pos = str.offset;

					//				var path = new Path();
					//				var stack = [];
					//				var trans = [];

					//				var width = null;
					//				var nStems = 0;
					//				var x = 0,
					//					y = 0;
					//				var usedGsubrs = void 0;
					//				var usedSubrs = void 0;

					//				this._usedGsubrs = usedGsubrs = {};
					//				this._usedSubrs = usedSubrs = {};

					//				var gsubrs = cff.globalSubrIndex || [];
					//				var gsubrsBias = this.bias(gsubrs);

					//				var privateDict = cff.privateDictForGlyph(this.id);
					//				var subrs = privateDict.Subrs || [];
					//				var subrsBias = this.bias(subrs);

					//				var parseStems = function parseStems() {
					//					if (stack.length % 2 !== 0) {
					//						if (width === null) {
					//							width = stack.shift() + privateDict.nominalWidthX;
					//						}
					//					}

					//					nStems += stack.length >> 1;
					//					return stack.length = 0;
					//				};

					//				var parse = function parse() {
					//					while (stream.pos < end) {
					//						var op = stream.readUInt8();
					//						if (op < 32) {
					//							switch (op) {
					//								case 1: case 3: case 18: case 23:
					//									// hstem, vstem, hstemhm, vstemhm
					//									parseStems();
					//									break;

					//								case 4:
					//									// vmoveto
					//									if (stack.length > 1) {
					//										if (typeof width === 'undefined' || width === null) {
					//											width = stack.shift() + privateDict.nominalWidthX;
					//										}
					//									}

					//									y += stack.shift();
					//									path.moveTo(x, y);
					//									break;

					//								case 5:
					//									// rlineto
					//									while (stack.length >= 2) {
					//										x += stack.shift();
					//										y += stack.shift();
					//										path.lineTo(x, y);
					//									}
					//									break;

					//								case 6: case 7:
					//									// hlineto, vlineto
					//									var phase = op === 6;
					//									while (stack.length >= 1) {
					//										if (phase) {
					//											x += stack.shift();
					//										} else {
					//											y += stack.shift();
					//										}

					//										path.lineTo(x, y);
					//										phase = !phase;
					//									}
					//									break;

					//								case 8:
					//									// rrcurveto
					//									while (stack.length > 0) {
					//										var c1x = x + stack.shift();
					//										var c1y = y + stack.shift();
					//										var c2x = c1x + stack.shift();
					//										var c2y = c1y + stack.shift();
					//										x = c2x + stack.shift();
					//										y = c2y + stack.shift();
					//										path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
					//									}
					//									break;

					//								case 10:
					//									// callsubr
					//									var index = stack.pop() + subrsBias;
					//									var subr = subrs[index];
					//									if (subr) {
					//										usedSubrs[index] = true;
					//										var p = stream.pos;
					//										var e = end;
					//										stream.pos = subr.offset;
					//										end = subr.offset + subr.length;
					//										parse();
					//										stream.pos = p;
					//										end = e;
					//									}
					//									break;

					//								case 11:
					//									// return
					//									return;

					//								case 14:
					//									// endchar
					//									if (stack.length > 0) {
					//										if (typeof width === 'undefined' || width === null) {
					//											width = stack.shift() + privateDict.nominalWidthX;
					//										}
					//									}

					//									path.closePath();
					//									break;

					//								case 19: case 20:
					//									// hintmask, cntrmask
					//									parseStems();
					//									stream.pos += nStems + 7 >> 3;
					//									break;

					//								case 21:
					//									// rmoveto
					//									if (stack.length > 2) {
					//										if (typeof width === 'undefined' || width === null) {
					//											width = stack.shift() + privateDict.nominalWidthX;
					//										}
					//										var haveWidth = true;
					//									}

					//									x += stack.shift();
					//									y += stack.shift();
					//									path.moveTo(x, y);
					//									break;

					//								case 22:
					//									// hmoveto
					//									if (stack.length > 1) {
					//										if (typeof width === 'undefined' || width === null) {
					//											width = stack.shift() + privateDict.nominalWidthX;
					//										}
					//									}

					//									x += stack.shift();
					//									path.moveTo(x, y);
					//									break;

					//								case 24:
					//									// rcurveline
					//									while (stack.length >= 8) {
					//										var c1x = x + stack.shift();
					//										var c1y = y + stack.shift();
					//										var c2x = c1x + stack.shift();
					//										var c2y = c1y + stack.shift();
					//										x = c2x + stack.shift();
					//										y = c2y + stack.shift();
					//										path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
					//									}

					//									x += stack.shift();
					//									y += stack.shift();
					//									path.lineTo(x, y);
					//									break;

					//								case 25:
					//									// rlinecurve
					//									while (stack.length >= 8) {
					//										x += stack.shift();
					//										y += stack.shift();
					//										path.lineTo(x, y);
					//									}

					//									var c1x = x + stack.shift();
					//									var c1y = y + stack.shift();
					//									var c2x = c1x + stack.shift();
					//									var c2y = c1y + stack.shift();
					//									x = c2x + stack.shift();
					//									y = c2y + stack.shift();
					//									path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
					//									break;

					//								case 26:
					//									// vvcurveto
					//									if (stack.length % 2) {
					//										x += stack.shift();
					//									}

					//									while (stack.length >= 4) {
					//										c1x = x;
					//										c1y = y + stack.shift();
					//										c2x = c1x + stack.shift();
					//										c2y = c1y + stack.shift();
					//										x = c2x;
					//										y = c2y + stack.shift();
					//										path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
					//									}
					//									break;

					//								case 27:
					//									// hhcurveto
					//									if (stack.length % 2) {
					//										y += stack.shift();
					//									}

					//									while (stack.length >= 4) {
					//										c1x = x + stack.shift();
					//										c1y = y;
					//										c2x = c1x + stack.shift();
					//										c2y = c1y + stack.shift();
					//										x = c2x + stack.shift();
					//										y = c2y;
					//										path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
					//									}
					//									break;

					//								case 28:
					//									// shortint
					//									stack.push(stream.readInt16BE());
					//									break;

					//								case 29:
					//									// callgsubr
					//									index = stack.pop() + gsubrsBias;
					//									subr = gsubrs[index];
					//									if (subr) {
					//										usedGsubrs[index] = true;
					//										var p = stream.pos;
					//										var e = end;
					//										stream.pos = subr.offset;
					//										end = subr.offset + subr.length;
					//										parse();
					//										stream.pos = p;
					//										end = e;
					//									}
					//									break;

					//								case 30: case 31:
					//									// vhcurveto, hvcurveto
					//									phase = op === 31;
					//									while (stack.length >= 4) {
					//										if (phase) {
					//											c1x = x + stack.shift();
					//											c1y = y;
					//											c2x = c1x + stack.shift();
					//											c2y = c1y + stack.shift();
					//											y = c2y + stack.shift();
					//											x = c2x + (stack.length === 1 ? stack.shift() : 0);
					//										} else {
					//											c1x = x;
					//											c1y = y + stack.shift();
					//											c2x = c1x + stack.shift();
					//											c2y = c1y + stack.shift();
					//											x = c2x + stack.shift();
					//											y = c2y + (stack.length === 1 ? stack.shift() : 0);
					//										}

					//										path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
					//										phase = !phase;
					//									}
					//									break;

					//								case 12:
					//									op = stream.readUInt8();
					//									switch (op) {
					//										case 3:
					//											// and
					//											var a = stack.pop();
					//											var b = stack.pop();
					//											stack.push(a && b ? 1 : 0);
					//											break;

					//										case 4:
					//											// or
					//											a = stack.pop();
					//											b = stack.pop();
					//											stack.push(a || b ? 1 : 0);
					//											break;

					//										case 5:
					//											// not
					//											a = stack.pop();
					//											stack.push(a ? 0 : 1);
					//											break;

					//										case 9:
					//											// abs
					//											a = stack.pop();
					//											stack.push(Math.abs(a));
					//											break;

					//										case 10:
					//											// add
					//											a = stack.pop();
					//											b = stack.pop();
					//											stack.push(a + b);
					//											break;

					//										case 11:
					//											// sub
					//											a = stack.pop();
					//											b = stack.pop();
					//											stack.push(a - b);
					//											break;

					//										case 12:
					//											// div
					//											a = stack.pop();
					//											b = stack.pop();
					//											stack.push(a / b);
					//											break;

					//										case 14:
					//											// neg
					//											a = stack.pop();
					//											stack.push(-a);
					//											break;

					//										case 15:
					//											// eq
					//											a = stack.pop();
					//											b = stack.pop();
					//											stack.push(a === b ? 1 : 0);
					//											break;

					//										case 18:
					//											// drop
					//											stack.pop();
					//											break;

					//										case 20:
					//											// put
					//											var val = stack.pop();
					//											var idx = stack.pop();
					//											trans[idx] = val;
					//											break;

					//										case 21:
					//											// get
					//											idx = stack.pop();
					//											stack.push(trans[idx] || 0);
					//											break;

					//										case 22:
					//											// ifelse
					//											var s1 = stack.pop();
					//											var s2 = stack.pop();
					//											var v1 = stack.pop();
					//											var v2 = stack.pop();
					//											stack.push(v1 <= v2 ? s1 : s2);
					//											break;

					//										case 23:
					//											// random
					//											stack.push(Math.random());
					//											break;

					//										case 24:
					//											// mul
					//											a = stack.pop();
					//											b = stack.pop();
					//											stack.push(a * b);
					//											break;

					//										case 26:
					//											// sqrt
					//											a = stack.pop();
					//											stack.push(Math.sqrt(a));
					//											break;

					//										case 27:
					//											// dup
					//											a = stack.pop();
					//											stack.push(a, a);
					//											break;

					//										case 28:
					//											// exch
					//											a = stack.pop();
					//											b = stack.pop();
					//											stack.push(b, a);
					//											break;

					//										case 29:
					//											// index
					//											idx = stack.pop();
					//											if (idx < 0) {
					//												idx = 0;
					//											} else if (idx > stack.length - 1) {
					//												idx = stack.length - 1;
					//											}

					//											stack.push(stack[idx]);
					//											break;

					//										case 30:
					//											// roll
					//											var n = stack.pop();
					//											var j = stack.pop();

					//											if (j >= 0) {
					//												while (j > 0) {
					//													var t = stack[n - 1];
					//													for (var _i = n - 2; _i >= 0; _i--) {
					//														stack[_i + 1] = stack[_i];
					//													}

					//													stack[0] = t;
					//													j--;
					//												}
					//											} else {
					//												while (j < 0) {
					//													var t = stack[0];
					//													for (var _i2 = 0; _i2 <= n; _i2++) {
					//														stack[_i2] = stack[_i2 + 1];
					//													}

					//													stack[n - 1] = t;
					//													j++;
					//												}
					//											}
					//											break;

					//										case 34:
					//											// hflex
					//											c1x = x + stack.shift();
					//											c1y = y;
					//											c2x = c1x + stack.shift();
					//											c2y = c1y + stack.shift();
					//											var c3x = c2x + stack.shift();
					//											var c3y = c2y;
					//											var c4x = c3x + stack.shift();
					//											var c4y = c3y;
					//											var c5x = c4x + stack.shift();
					//											var c5y = c4y;
					//											var c6x = c5x + stack.shift();
					//											var c6y = c5y;
					//											x = c6x;
					//											y = c6y;

					//											path.bezierCurveTo(c1x, c1y, c2x, c2y, c3x, c3y);
					//											path.bezierCurveTo(c4x, c4y, c5x, c5y, c6x, c6y);
					//											break;

					//										case 35:
					//											// flex
					//											var pts = [];
					//											var iterable2 = [0, 1, 2, 3, 4, 5];
					//											for (var j1 = 0; j1 < iterable2.length; j1++) {
					//												//i = iterable2[j1];
					//												x += stack.shift();
					//												y += stack.shift();
					//												pts.push(x, y);
					//											}

					//											path.bezierCurveTo.apply(path, _toConsumableArray(pts.slice(0, 6)));
					//											path.bezierCurveTo.apply(path, _toConsumableArray(pts.slice(6)));
					//											stack.shift(); // fd
					//											break;

					//										case 36:
					//											// hflex1
					//											c1x = x + stack.shift();
					//											c1y = y + stack.shift();
					//											c2x = c1x + stack.shift();
					//											c2y = c1y + stack.shift();
					//											c3x = c2x + stack.shift();
					//											c3y = c2y;
					//											c4x = c3x + stack.shift();
					//											c4y = c3y;
					//											c5x = c4x + stack.shift();
					//											c5y = c4y + stack.shift();
					//											c6x = c5x + stack.shift();
					//											c6y = c5y;
					//											x = c6x;
					//											y = c6y;

					//											path.bezierCurveTo(c1x, c1y, c2x, c2y, c3x, c3y);
					//											path.bezierCurveTo(c4x, c4y, c5x, c5y, c6x, c6y);
					//											break;

					//										case 37:
					//											// flex1
					//											var startx = x;
					//											var starty = y;

					//											pts = [];
					//											var iterable3 = [0, 1, 2, 3, 4];
					//											for (var k1 = 0; k1 < iterable3.length; k1++) {
					//												//i = iterable3[k1];
					//												x += stack.shift();
					//												y += stack.shift();
					//												pts.push(x, y);
					//											}

					//											if (Math.abs(x - startx) > Math.abs(y - starty)) {
					//												// horizontal
					//												x += stack.shift();
					//												y = starty;
					//											} else {
					//												x = startx;
					//												y += stack.shift();
					//											}

					//											pts.push(x, y);
					//											path.bezierCurveTo.apply(path, _toConsumableArray(pts.slice(0, 6)));
					//											path.bezierCurveTo.apply(path, _toConsumableArray(pts.slice(6)));
					//											break;

					//										default:
					//											throw new Error('Unknown op: 12 ' + op);
					//									}
					//									break;

					//								default:
					//									throw new Error('Unknown op: ' + op);
					//							}
					//						} else if (op < 247) {
					//							stack.push(op - 139);
					//						} else if (op < 251) {
					//							var b1 = stream.readUInt8();
					//							stack.push((op - 247) * 256 + b1 + 108);
					//						} else if (op < 255) {
					//							var b1 = stream.readUInt8();
					//							stack.push(-(op - 251) * 256 - b1 - 108);
					//						} else {
					//							stack.push(stream.readInt32BE() / 65536);
					//						}
					//					}
					//				};

					//				parse();
					//				return path;
					//			}
					//		}]);

					//	return CFFGlyph;
					//} (Glyph);

					//var SBIXImage = new r.Struct({
					//	originX: r.uint16,
					//	originY: r.uint16,
					//	type: new r.String(4),
					//	data: new r.Buffer(function (t) {
					//		return t.parent.buflen - t._currentOffset;
					//	})
					//});

					///**
					// * Represents a color (e.g. emoji) glyph in Apple's SBIX format.
					// */

					//var SBIXGlyph: (...args) => void = function (_TTFGlyph) {
					//	_inherits(SBIXGlyph, _TTFGlyph);

					//	function SBIXGlyph() {
					//		_classCallCheck(this, SBIXGlyph);

					//		return _possibleConstructorReturn(this, (SBIXGlyph.__proto__ || _Object$getPrototypeOf(SBIXGlyph)).apply(this, arguments));
					//	}

					//	_createClass(SBIXGlyph, [{
					//		key: 'getImageForSize',

					//		/**
					//		 * Returns an object representing a glyph image at the given point size.
					//		 * The object has a data property with a Buffer containing the actual image data,
					//		 * along with the image type, and origin.
					//		 *
					//		 * @param {number} size
					//		 * @return {object}
					//		 */
					//		value: function getImageForSize(size) {
					//			for (var i = 0; i < this._font.sbix.imageTables.length; i++) {
					//				var table = this._font.sbix.imageTables[i];
					//				if (table.ppem >= size) {
					//					break;
					//				}
					//			}

					//			var offsets = table.imageOffsets;
					//			var start = offsets[this.id];
					//			var end = offsets[this.id + 1];

					//			if (start === end) {
					//				return null;
					//			}

					//			this._font.stream.pos = start;
					//			return SBIXImage.decode(this._font.stream, { buflen: end - start });
					//		}
					//	}, {
					//			key: 'render',
					//			value: function render(ctx, size) {
					//				var img = this.getImageForSize(size);
					//				if (img != null) {
					//					var scale = size / this._font.unitsPerEm;
					//					ctx.image(img.data, { height: size, x: img.originX, y: (this.bbox.minY - img.originY) * scale });
					//				}

					//				if (this._font.sbix.flags.renderOutlines) {
					//					_get(SBIXGlyph.prototype.__proto__ || _Object$getPrototypeOf(SBIXGlyph.prototype), 'render', this).call(this, ctx, size);
					//				}
					//			}
					//		}]);

					//	return SBIXGlyph;
					//} (TTFGlyph);

					//var COLRLayer = function COLRLayer(glyph, color) {
					//	_classCallCheck(this, COLRLayer);

					//	this.glyph = glyph;
					//	this.color = color;
					//};

					///**
					// * Represents a color (e.g. emoji) glyph in Microsoft's COLR format.
					// * Each glyph in this format contain a list of colored layers, each
					// * of which  is another vector glyph.
					// */


					//var COLRGlyph: (...args) => void = function (_Glyph) {
					//	_inherits(COLRGlyph, _Glyph);

					//	function COLRGlyph() {
					//		_classCallCheck(this, COLRGlyph);

					//		return _possibleConstructorReturn(this, (COLRGlyph.__proto__ || _Object$getPrototypeOf(COLRGlyph)).apply(this, arguments));
					//	}

					//	_createClass(COLRGlyph, [{
					//		key: '_getBBox',
					//		value: function _getBBox() {
					//			var bbox = new BBox();
					//			for (var i = 0; i < this.layers.length; i++) {
					//				var layer = this.layers[i];
					//				var b = layer.glyph.bbox;
					//				bbox.addPoint(b.minX, b.minY);
					//				bbox.addPoint(b.maxX, b.maxY);
					//			}

					//			return bbox;
					//		}

					//		/**
					//		 * Returns an array of objects containing the glyph and color for
					//		 * each layer in the composite color glyph.
					//		 * @type {object[]}
					//		 */

					//	}, {
					//			key: 'render',
					//			value: function render(ctx, size) {
					//				var _iteratorNormalCompletion = true;
					//				var _didIteratorError = false;
					//				var _iteratorError = undefined;

					//				try {
					//					for (var _iterator = _getIterator(this.layers), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
					//						var _step$value = _step.value;
					//						var glyph = _step$value.glyph;
					//						var color = _step$value.color;

					//						ctx.fillColor([color.red, color.green, color.blue], color.alpha / 255 * 100);
					//						glyph.render(ctx, size);
					//					}
					//				} catch (err) {
					//					_didIteratorError = true;
					//					_iteratorError = err;
					//				} finally {
					//					try {
					//						if (!_iteratorNormalCompletion && _iterator.return) {
					//							_iterator.return();
					//						}
					//					} finally {
					//						if (_didIteratorError) {
					//							throw _iteratorError;
					//						}
					//					}
					//				}

					//				return;
					//			}
					//		}, {
					//			key: 'layers',
					//			get: function get() {
					//				var cpal = this._font.CPAL;
					//				var colr = this._font.COLR;
					//				var low = 0;
					//				var high = colr.baseGlyphRecord.length - 1;

					//				while (low <= high) {
					//					var mid = low + high >> 1;
					//					var rec = colr.baseGlyphRecord[mid];

					//					if (this.id < rec.gid) {
					//						high = mid - 1;
					//					} else if (this.id > rec.gid) {
					//						low = mid + 1;
					//					} else {
					//						var baseLayer = rec;
					//						break;
					//					}
					//				}

					//				// if base glyph not found in COLR table,
					//				// default to normal glyph from glyf or CFF
					//				if (baseLayer == null) {
					//					var g = this._font._getBaseGlyph(this.id);
					//					var color: any = {
					//						red: 0,
					//						green: 0,
					//						blue: 0,
					//						alpha: 255
					//					};

					//					return [new COLRLayer(g, color)];
					//				}

					//				// otherwise, return an array of all the layers
					//				var layers = [];
					//				for (var i = baseLayer.firstLayerIndex; i < baseLayer.firstLayerIndex + baseLayer.numLayers; i++) {
					//					var rec = colr.layerRecords[i];
					//					var color = cpal.colorRecords[rec.paletteIndex];
					//					var g = this._font._getBaseGlyph(rec.gid);
					//					layers.push(new COLRLayer(g, color));
					//				}

					//				return layers;
					//			}
					//		}]);

					//	return COLRGlyph;
					//} (Glyph);

					//var TUPLES_SHARE_POINT_NUMBERS = 0x8000;
					//var TUPLE_COUNT_MASK = 0x0fff;
					//var EMBEDDED_TUPLE_COORD = 0x8000;
					//var INTERMEDIATE_TUPLE = 0x4000;
					//var PRIVATE_POINT_NUMBERS = 0x2000;
					//var TUPLE_INDEX_MASK = 0x0fff;
					//var POINTS_ARE_WORDS = 0x80;
					//var POINT_RUN_COUNT_MASK = 0x7f;
					//var DELTAS_ARE_ZERO = 0x80;
					//var DELTAS_ARE_WORDS = 0x40;
					//var DELTA_RUN_COUNT_MASK = 0x3f;

					///**
					// * This class is transforms TrueType glyphs according to the data from
					// * the Apple Advanced Typography variation tables (fvar, gvar, and avar).
					// * These tables allow infinite adjustments to glyph weight, width, slant,
					// * and optical size without the designer needing to specify every exact style.
					// *
					// * Apple's documentation for these tables is not great, so thanks to the
					// * Freetype project for figuring much of this out.
					// *
					// * @private
					// */

					//var GlyphVariationProcessor = function () {
					//	function GlyphVariationProcessor(font, coords) {
					//		_classCallCheck(this, GlyphVariationProcessor);

					//		this.font = font;
					//		this.normalizedCoords = this.normalizeCoords(coords);
					//	}

					//	_createClass(GlyphVariationProcessor, [{
					//		key: 'normalizeCoords',
					//		value: function normalizeCoords(coords) {
					//			// the default mapping is linear along each axis, in two segments:
					//			// from the minValue to defaultValue, and from defaultValue to maxValue.
					//			var normalized = [];
					//			for (var i = 0; i < this.font.fvar.axis.length; i++) {
					//				var axis = this.font.fvar.axis[i];
					//				if (coords[i] < axis.defaultValue) {
					//					normalized.push((coords[i] - axis.defaultValue) / (axis.defaultValue - axis.minValue));
					//				} else {
					//					normalized.push((coords[i] - axis.defaultValue) / (axis.maxValue - axis.defaultValue));
					//				}
					//			}

					//			// if there is an avar table, the normalized value is calculated
					//			// by interpolating between the two nearest mapped values.
					//			if (this.font.avar) {
					//				for (var i = 0; i < this.font.avar.segment.length; i++) {
					//					var segment = this.font.avar.segment[i];
					//					for (var j = 0; j < segment.correspondence.length; j++) {
					//						var pair = segment.correspondence[j];
					//						if (j >= 1 && normalized[i] < pair.fromCoord) {
					//							var prev = segment.correspondence[j - 1];
					//							normalized[i] = (normalized[i] - prev.fromCoord) * (pair.toCoord - prev.toCoord) / (pair.fromCoord - prev.fromCoord) + prev.toCoord;

					//							break;
					//						}
					//					}
					//				}
					//			}

					//			return normalized;
					//		}
					//	}, {
					//			key: 'transformPoints',
					//			value: function transformPoints(gid, glyphPoints) {
					//				if (!this.font.fvar || !this.font.gvar) {
					//					return;
					//				}

					//				var gvar = this.font.gvar;

					//				if (gid >= gvar.glyphCount) {
					//					return;
					//				}

					//				var offset = gvar.offsets[gid];
					//				if (offset === gvar.offsets[gid + 1]) {
					//					return;
					//				}

					//				// Read the gvar data for this glyph
					//				var stream = this.font.stream;

					//				stream.pos = offset;

					//				var tupleCount = stream.readUInt16BE();
					//				var offsetToData = offset + stream.readUInt16BE();

					//				if (tupleCount & TUPLES_SHARE_POINT_NUMBERS) {
					//					var here = stream.pos;
					//					stream.pos = offsetToData;
					//					var sharedPoints = this.decodePoints();
					//					stream.pos = here;
					//				}

					//				tupleCount &= TUPLE_COUNT_MASK;
					//				for (var i = 0; i < tupleCount; i++) {
					//					var tupleDataSize = stream.readUInt16BE();
					//					var tupleIndex = stream.readUInt16BE();

					//					if (tupleIndex & EMBEDDED_TUPLE_COORD) {
					//						var tupleCoords: any = [];
					//						for (var a = 0; a < gvar.axisCount; a++) {
					//							tupleCoords.push(stream.readInt16BE() / 16384);
					//						}
					//					} else {
					//						if ((tupleIndex & TUPLE_INDEX_MASK) >= gvar.globalCoordCount) {
					//							throw new Error('Invalid gvar table');
					//						}

					//						var tupleCoords = gvar.globalCoords[tupleIndex & TUPLE_INDEX_MASK];
					//					}

					//					if (tupleIndex & INTERMEDIATE_TUPLE) {
					//						var startCoords = [];
					//						for (var _a = 0; _a < gvar.axisCount; _a++) {
					//							startCoords.push(stream.readInt16BE() / 16384);
					//						}

					//						var endCoords = [];
					//						for (var _a2 = 0; _a2 < gvar.axisCount; _a2++) {
					//							endCoords.push(stream.readInt16BE() / 16384);
					//						}
					//					}

					//					// Get the factor at which to apply this tuple
					//					var factor = this.tupleFactor(tupleIndex, tupleCoords, startCoords, endCoords);
					//					if (factor === 0) {
					//						offsetToData += tupleDataSize;
					//						continue;
					//					}

					//					var here = stream.pos;

					//					if (tupleIndex & PRIVATE_POINT_NUMBERS) {
					//						stream.pos = offsetToData;
					//						var points = this.decodePoints();
					//					} else {
					//						var points = sharedPoints;
					//					}

					//					// points.length = 0 means there are deltas for all points
					//					var nPoints = points.length === 0 ? glyphPoints.length : points.length;
					//					var xDeltas = this.decodeDeltas(nPoints);
					//					var yDeltas = this.decodeDeltas(nPoints);

					//					if (points.length === 0) {
					//						// all points
					//						for (var _i = 0; _i < glyphPoints.length; _i++) {
					//							var point = glyphPoints[_i];
					//							point.x += xDeltas[_i] * factor;
					//							point.y += yDeltas[_i] * factor;
					//						}
					//					} else {
					//						var origPoints = glyphPoints.slice();
					//						var hasDelta = glyphPoints.map(function () {
					//							return false;
					//						});

					//						for (var _i2 = 0; _i2 < points.length; _i2++) {
					//							var idx = points[_i2];
					//							if (idx < glyphPoints.length) {
					//								var point = glyphPoints[idx];
					//								origPoints[idx] = point.copy();
					//								hasDelta[idx] = true;

					//								point.x += xDeltas[_i2] * factor;
					//								point.y += yDeltas[_i2] * factor;
					//							}
					//						}

					//						this.interpolateMissingDeltas(glyphPoints, origPoints, hasDelta);
					//					}

					//					offsetToData += tupleDataSize;
					//					stream.pos = here;
					//				}

					//				return;
					//			}
					//		}, {
					//			key: 'decodePoints',
					//			value: function decodePoints() {
					//				var stream = this.font.stream;

					//				var count = stream.readUInt8();

					//				if (count & POINTS_ARE_WORDS) {
					//					count = (count & POINT_RUN_COUNT_MASK) << 8 | stream.readUInt8();
					//				}

					//				var points = new Uint16Array(count);
					//				var i = 0;
					//				while (i < count) {
					//					var run = stream.readUInt8();
					//					var runCount = (run & POINT_RUN_COUNT_MASK) + 1;
					//					if (i + runCount > count) {
					//						throw new Error('Bad point run length');
					//					}

					//					var fn = run & POINTS_ARE_WORDS ? stream.readUInt16 : stream.readUInt8;

					//					var point = 0;
					//					for (var j = 0; j < runCount; j++) {
					//						point += fn.call(stream);
					//						points[i++] = point;
					//					}
					//				}

					//				return points;
					//			}
					//		}, {
					//			key: 'decodeDeltas',
					//			value: function decodeDeltas(count) {
					//				var stream = this.font.stream;

					//				var i = 0;
					//				var deltas = new Int16Array(count);

					//				while (i < count) {
					//					var run = stream.readUInt8();
					//					var runCount = (run & DELTA_RUN_COUNT_MASK) + 1;
					//					if (i + runCount > count) {
					//						throw new Error('Bad delta run length');
					//					}

					//					if (run & DELTAS_ARE_ZERO) {
					//						i += runCount;
					//					} else {
					//						var fn = run & DELTAS_ARE_WORDS ? stream.readInt16BE : stream.readInt8;
					//						for (var j = 0; j < runCount; j++) {
					//							deltas[i++] = fn.call(stream);
					//						}
					//					}
					//				}

					//				return deltas;
					//			}
					//		}, {
					//			key: 'tupleFactor',
					//			value: function tupleFactor(tupleIndex, tupleCoords, startCoords, endCoords) {
					//				var normalized = this.normalizedCoords;
					//				var gvar = this.font.gvar;

					//				var factor = 1;

					//				for (var i = 0; i < gvar.axisCount; i++) {
					//					if (tupleCoords[i] === 0) {
					//						continue;
					//					} else if (normalized[i] === 0) {
					//						return 0;
					//					} else if (normalized[i] < 0 && tupleCoords[i] > 0 || normalized[i] > 0 && tupleCoords[i] < 0) {
					//						return 0;
					//					} else if ((tupleIndex & INTERMEDIATE_TUPLE) === 0) {
					//						factor *= Math.abs(normalized[i]);
					//					} else if (normalized[i] < startCoords[i] || normalized[i] > endCoords[i]) {
					//						return 0;
					//					} else if (normalized[i] < tupleCoords[i]) {
					//						factor = factor * (normalized[i] - startCoords[i]) / (tupleCoords[i] - startCoords[i]);
					//					} else {
					//						factor = factor * (endCoords[i] - normalized[i]) / (endCoords[i] - tupleCoords[i]);
					//					}
					//				}

					//				return factor;
					//			}

					//			// Interpolates points without delta values.
					//			// Needed for the Г and Q glyphs in Skia.
					//			// Algorithm from Freetype.

					//		}, {
					//			key: 'interpolateMissingDeltas',
					//			value: function interpolateMissingDeltas(points, inPoints, hasDelta) {
					//				if (points.length === 0) {
					//					return;
					//				}

					//				var point = 0;
					//				while (point < points.length) {
					//					var firstPoint = point;

					//					// find the end point of the contour
					//					var endPoint = point;
					//					var pt = points[endPoint];
					//					while (!pt.endContour) {
					//						pt = points[++endPoint];
					//					}

					//					// find the first point that has a delta
					//					while (point <= endPoint && !hasDelta[point]) {
					//						point++;
					//					}

					//					if (point > endPoint) {
					//						continue;
					//					}

					//					var firstDelta = point;
					//					var curDelta = point;
					//					point++;

					//					while (point <= endPoint) {
					//						// find the next point with a delta, and interpolate intermediate points
					//						if (hasDelta[point]) {
					//							this.deltaInterpolate(curDelta + 1, point - 1, curDelta, point, inPoints, points);
					//							curDelta = point;
					//						}

					//						point++;
					//					}

					//					// shift contour if we only have a single delta
					//					if (curDelta === firstDelta) {
					//						this.deltaShift(firstPoint, endPoint, curDelta, inPoints, points);
					//					} else {
					//						// otherwise, handle the remaining points at the end and beginning of the contour
					//						this.deltaInterpolate(curDelta + 1, endPoint, curDelta, firstDelta, inPoints, points);

					//						if (firstDelta > 0) {
					//							this.deltaInterpolate(firstPoint, firstDelta - 1, curDelta, firstDelta, inPoints, points);
					//						}
					//					}

					//					point = endPoint + 1;
					//				}

					//				return;
					//			}
					//		}, {
					//			key: 'deltaInterpolate',
					//			value: function deltaInterpolate(p1, p2, ref1, ref2, inPoints, outPoints) {
					//				if (p1 > p2) {
					//					return;
					//				}

					//				var iterable = ['x', 'y'];
					//				for (var i = 0; i < iterable.length; i++) {
					//					var k = iterable[i];
					//					if (inPoints[ref1][k] > inPoints[ref2][k]) {
					//						var p = ref1;
					//						ref1 = ref2;
					//						ref2 = p;
					//					}

					//					var in1 = inPoints[ref1][k];
					//					var in2 = inPoints[ref2][k];
					//					var out1 = outPoints[ref1][k];
					//					var out2 = outPoints[ref2][k];

					//					var scale = in1 === in2 ? 0 : (out2 - out1) / (in2 - in1);

					//					for (var _p = p1; _p <= p2; _p++) {
					//						var out = inPoints[_p][k];

					//						if (out <= in1) {
					//							out += out1 - in1;
					//						} else if (out >= in2) {
					//							out += out2 - in2;
					//						} else {
					//							out = out1 + (out - in1) * scale;
					//						}

					//						outPoints[_p][k] = out;
					//					}
					//				}

					//				return;
					//			}
					//		}, {
					//			key: 'deltaShift',
					//			value: function deltaShift(p1, p2, ref, inPoints, outPoints) {
					//				var deltaX = outPoints[ref].x - inPoints[ref].x;
					//				var deltaY = outPoints[ref].y - inPoints[ref].y;

					//				if (deltaX === 0 && deltaY === 0) {
					//					return;
					//				}

					//				for (var p = p1; p <= p2; p++) {
					//					if (p !== ref) {
					//						outPoints[p].x += deltaX;
					//						outPoints[p].y += deltaY;
					//					}
					//				}

					//				return;
					//			}
					//		}]);

					//	return GlyphVariationProcessor;
					//} ();

					var Subset = function () {
						function Subset(font) {
							_classCallCheck(this, Subset);

							this.font = font;
							this.glyphs = [];
							this.mapping = {};

							// always include the missing glyph
							this.includeGlyph(0);
						}

						_createClass(Subset, [{
							key: 'includeGlyph',
							value: function includeGlyph(glyph) {
								if ((typeof glyph === 'undefined' ? 'undefined' : _typeof(glyph)) === 'object') {
									glyph = glyph.id;
								}

								if (this.mapping[glyph] == null) {
									this.glyphs.push(glyph);
									this.mapping[glyph] = this.glyphs.length - 1;
								}

								return this.mapping[glyph];
							}
						}, {
								key: 'encodeStream',
								value: function encodeStream() {
									var _this = this;

									var s = new r.EncodeStream();

									process.nextTick(function () {
										_this.encode(s);
										return s.end();
									});

									return s;
								}
							}]);

						return Subset;
					} ();

					var TTFSubset: (...args) => void = function (_Subset) {
						_inherits(TTFSubset, _Subset);

						function TTFSubset() {
							_classCallCheck(this, TTFSubset);

							return _possibleConstructorReturn(this, (TTFSubset.__proto__ || _Object$getPrototypeOf(TTFSubset)).apply(this, arguments));
						}

						_createClass(TTFSubset, [{
							key: '_addGlyph',
							value: function _addGlyph(gid) {
								var glyf = this.font.getGlyph(gid)._decode();

								// get the offset to the glyph from the loca table
								var curOffset = this.font.loca.offsets[gid];
								var nextOffset = this.font.loca.offsets[gid + 1];

								var stream = this.font._getTableStream('glyf');
								stream.pos += curOffset;

								var buffer = stream.readBuffer(nextOffset - curOffset);

								// if it is a compound glyph, include its components
								if (glyf && glyf.numberOfContours < 0) {
									buffer = new Buffer(buffer);

									for (var i = 0, keys = Object.keys(glyf.components); i < keys.length; i++) {
										var component = glyf.components[keys[i]];
										gid = this.includeGlyph(component.glyphID);
										buffer.writeUInt16BE(gid, component.pos);
									}
								}

								this.glyf.push(buffer);
								this.loca.offsets.push(this.offset);

								if (gid < this.font.hmtx.metrics.length) {
									this.hmtx.metrics.push(this.font.hmtx.metrics.get(gid));
								} else {
									this.hmtx.metrics.push({
										advance: this.font.hmtx.metrics.get(this.font.hmtx.metrics.length - 1).advance,
										bearing: this.font.hmtx.bearings.get(gid - this.font.hmtx.metrics.length)
									});
								}

								this.offset += buffer.length;
								return this.glyf.length - 1;
							}
						}, {
								key: 'encode',
								value: function encode(stream) {
									// tables required by PDF spec:
									//   head, hhea, loca, maxp, cvt , prep, glyf, hmtx, fpgm
									//
									// additional tables required for standalone fonts:
									//   name, cmap, OS/2, post

									this.glyf = [];
									this.offset = 0;
									this.loca = {
										offsets: []
									};

									this.hmtx = {
										metrics: [],
										bearings: []
									};

									// include all the glyphs
									// not using a for loop because we need to support adding more
									// glyphs to the array as we go, and CoffeeScript caches the length.
									var i = 0;
									while (i < this.glyphs.length) {
										this._addGlyph(this.glyphs[i++]);
									}

									var maxp = cloneDeep(this.font.maxp);
									maxp.numGlyphs = this.glyf.length;

									this.loca.offsets.push(this.offset);
									tables.loca.preEncode.call(this.loca);

									var head = cloneDeep(this.font.head);
									head.indexToLocFormat = this.loca.version;

									var hhea = cloneDeep(this.font.hhea);
									hhea.numberOfMetrics = this.hmtx.metrics.length;

									// map = []
									// for index in [0...256]
									//     if index < @numGlyphs
									//         map[index] = index
									//     else
									//         map[index] = 0
									//
									// cmapTable =
									//     version: 0
									//     length: 262
									//     language: 0
									//     codeMap: map
									//
									// cmap =
									//     version: 0
									//     numSubtables: 1
									//     tables: [
									//         platformID: 1
									//         encodingID: 0
									//         table: cmapTable
									//     ]

									// TODO: subset prep, cvt, fpgm?
									Directory.encode(stream, {
										tables: {
											head: head,
											hhea: hhea,
											loca: this.loca,
											maxp: maxp,
											'cvt ': this.font['cvt '],
											prep: this.font.prep,
											glyf: this.glyf,
											hmtx: this.hmtx,
											fpgm: this.font.fpgm

											// name: clone @font.name
											// 'OS/2': clone @font['OS/2']
											// post: clone @font.post
											// cmap: cmap
										}
									});
								}
							}]);

						return TTFSubset;
					} (Subset);

					//var CFFSubset: (...args) => void = function (_Subset) {
					//	_inherits(CFFSubset, _Subset);

					//	function CFFSubset(font) {
					//		_classCallCheck(this, CFFSubset);

					//		var _this = _possibleConstructorReturn(this, (CFFSubset.__proto__ || _Object$getPrototypeOf(CFFSubset)).call(this, font));

					//		_this.cff = _this.font['CFF '];
					//		if (!_this.cff) {
					//			throw new Error('Not a CFF Font');
					//		}
					//		return _this;
					//	}

					//	_createClass(CFFSubset, [{
					//		key: 'subsetCharstrings',
					//		value: function subsetCharstrings() {
					//			this.charstrings = [];
					//			var gsubrs = {};

					//			var _iteratorNormalCompletion = true;
					//			var _didIteratorError = false;
					//			var _iteratorError = undefined;

					//			try {
					//				for (var _iterator = _getIterator(this.glyphs), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
					//					var gid = _step.value;

					//					this.charstrings.push(this.cff.getCharString(gid));

					//					var glyph = this.font.getGlyph(gid);
					//					var path = glyph.path; // this causes the glyph to be parsed

					//					for (var subr in glyph._usedGsubrs) {
					//						gsubrs[subr] = true;
					//					}
					//				}
					//			} catch (err) {
					//				_didIteratorError = true;
					//				_iteratorError = err;
					//			} finally {
					//				try {
					//					if (!_iteratorNormalCompletion && _iterator.return) {
					//						_iterator.return();
					//					}
					//				} finally {
					//					if (_didIteratorError) {
					//						throw _iteratorError;
					//					}
					//				}
					//			}

					//			this.gsubrs = this.subsetSubrs(this.cff.globalSubrIndex, gsubrs);
					//		}
					//	}, {
					//			key: 'subsetSubrs',
					//			value: function subsetSubrs(subrs, used) {
					//				var res = [];
					//				for (var i = 0; i < subrs.length; i++) {
					//					var subr = subrs[i];
					//					if (used[i]) {
					//						this.cff.stream.pos = subr.offset;
					//						res.push(this.cff.stream.readBuffer(subr.length));
					//					} else {
					//						res.push(new Buffer([11])); // return
					//					}
					//				}

					//				return res;
					//			}
					//		}, {
					//			key: 'subsetFontdict',
					//			value: function subsetFontdict(topDict) {
					//				topDict.FDArray = [];
					//				topDict.FDSelect = {
					//					version: 0,
					//					fds: []
					//				};

					//				var used_fds = {};
					//				var used_subrs = [];
					//				var _iteratorNormalCompletion2 = true;
					//				var _didIteratorError2 = false;
					//				var _iteratorError2 = undefined;

					//				try {
					//					for (var _iterator2 = _getIterator(this.glyphs), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
					//						var gid = _step2.value;

					//						var fd = this.cff.fdForGlyph(gid);
					//						if (fd == null) {
					//							continue;
					//						}

					//						if (!used_fds[fd]) {
					//							topDict.FDArray.push(_Object$assign({}, this.cff.topDict.FDArray[fd]));
					//							used_subrs.push({});
					//						}

					//						used_fds[fd] = true;
					//						topDict.FDSelect.fds.push(topDict.FDArray.length - 1);

					//						var glyph = this.font.getGlyph(gid);
					//						var path = glyph.path; // this causes the glyph to be parsed
					//						for (var subr in glyph._usedSubrs) {
					//							used_subrs[used_subrs.length - 1][subr] = true;
					//						}
					//					}
					//				} catch (err) {
					//					_didIteratorError2 = true;
					//					_iteratorError2 = err;
					//				} finally {
					//					try {
					//						if (!_iteratorNormalCompletion2 && _iterator2.return) {
					//							_iterator2.return();
					//						}
					//					} finally {
					//						if (_didIteratorError2) {
					//							throw _iteratorError2;
					//						}
					//					}
					//				}

					//				for (var i = 0; i < topDict.FDArray.length; i++) {
					//					var dict = topDict.FDArray[i];
					//					delete dict.FontName;
					//					if (dict.Private && dict.Private.Subrs) {
					//						dict.Private = _Object$assign({}, dict.Private);
					//						dict.Private.Subrs = this.subsetSubrs(dict.Private.Subrs, used_subrs[i]);
					//					}
					//				}

					//				return;
					//			}
					//		}, {
					//			key: 'createCIDFontdict',
					//			value: function createCIDFontdict(topDict) {
					//				var used_subrs = {};
					//				var _iteratorNormalCompletion3 = true;
					//				var _didIteratorError3 = false;
					//				var _iteratorError3 = undefined;

					//				try {
					//					for (var _iterator3 = _getIterator(this.glyphs), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
					//						var gid = _step3.value;

					//						var glyph = this.font.getGlyph(gid);
					//						var path = glyph.path; // this causes the glyph to be parsed

					//						for (var subr in glyph._usedSubrs) {
					//							used_subrs[subr] = true;
					//						}
					//					}
					//				} catch (err) {
					//					_didIteratorError3 = true;
					//					_iteratorError3 = err;
					//				} finally {
					//					try {
					//						if (!_iteratorNormalCompletion3 && _iterator3.return) {
					//							_iterator3.return();
					//						}
					//					} finally {
					//						if (_didIteratorError3) {
					//							throw _iteratorError3;
					//						}
					//					}
					//				}

					//				var privateDict = _Object$assign({}, this.cff.topDict.Private);
					//				privateDict.Subrs = this.subsetSubrs(this.cff.topDict.Private.Subrs, used_subrs);

					//				topDict.FDArray = [{ Private: privateDict }];
					//				return topDict.FDSelect = {
					//					version: 3,
					//					nRanges: 1,
					//					ranges: [{ first: 0, fd: 0 }],
					//					sentinel: this.charstrings.length
					//				};
					//			}
					//		}, {
					//			key: 'addString',
					//			value: function addString(string) {
					//				if (!string) {
					//					return null;
					//				}

					//				if (!this.strings) {
					//					this.strings = [];
					//				}

					//				this.strings.push(string);
					//				return standardStrings.length + this.strings.length - 1;
					//			}
					//		}, {
					//			key: 'encode',
					//			value: function encode(stream) {
					//				this.subsetCharstrings();

					//				var charset = {
					//					version: this.charstrings.length > 255 ? 2 : 1,
					//					ranges: [{ first: 1, nLeft: this.charstrings.length - 2 }]
					//				};

					//				var topDict = _Object$assign({}, this.cff.topDict);
					//				topDict.Private = null;
					//				topDict.charset = charset;
					//				topDict.Encoding = null;
					//				topDict.CharStrings = this.charstrings;

					//				var _arr = ['version', 'Notice', 'Copyright', 'FullName', 'FamilyName', 'Weight', 'PostScript', 'BaseFontName', 'FontName'];
					//				for (var _i = 0; _i < _arr.length; _i++) {
					//					var key = _arr[_i];
					//					topDict[key] = this.addString(this.cff.string(topDict[key]));
					//				}

					//				topDict.ROS = [this.addString('Adobe'), this.addString('Identity'), 0];
					//				topDict.CIDCount = this.charstrings.length;

					//				if (this.cff.isCIDFont) {
					//					this.subsetFontdict(topDict);
					//				} else {
					//					this.createCIDFontdict(topDict);
					//				}

					//				var top = {
					//					header: this.cff.header,
					//					nameIndex: [this.cff.postscriptName],
					//					topDictIndex: [topDict],
					//					stringIndex: this.strings,
					//					globalSubrIndex: this.gsubrs
					//				};

					//				CFFTop.encode(stream, top);
					//			}
					//		}]);

					//	return CFFSubset;
					//} (Subset);

					var _class;
					function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
						var desc: any = {};
						Object['ke' + 'ys'](descriptor).forEach(function (key) {
							desc[key] = descriptor[key];
						});
						desc.enumerable = !!desc.enumerable;
						desc.configurable = !!desc.configurable;

						if ('value' in desc || desc.initializer) {
							desc.writable = true;
						}

						desc = decorators.slice().reverse().reduce(function (desc, decorator) {
							return decorator(target, property, desc) || desc;
						}, desc);

						if (context && desc.initializer !== void 0) {
							desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
							desc.initializer = undefined;
						}

						if (desc.initializer === void 0) {
							Object['define' + 'Property'](target, property, desc);
							desc = null;
						}

						return desc;
					}

					/**
					 * This is the base class for all SFNT-based font formats in fontkit.
					 * It supports TrueType, and PostScript glyphs, and several color glyph formats.
					 */
					var TTFFont = (_class = function () {
						_createClass(TTFFont, null, [{
							key: 'probe',
							value: function probe(buffer) {
								var format = buffer.toString('ascii', 0, 4);
								return format === 'true' || format === 'OTTO' || format === String.fromCharCode(0, 1, 0, 0);
							}
						}]);

						function TTFFont(stream, farg1?) {
							var variationCoords = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];

							_classCallCheck(this, TTFFont);

							this.stream = stream;
							this._directoryPos = this.stream.pos;
							this._tables = {};
							this._glyphs = {};
							this._decodeDirectory();

							// define properties for each table to lazily parse
							for (var tag in this.directory.tables) {
								var table = this.directory.tables[tag];
								if (tables[tag] && table.length > 0) {
									_Object$defineProperty(this, tag, {
										get: this._getTable.bind(this, table)
									});
								}
							}

							//if (variationCoords) {
							//	this._variationProcessor = new GlyphVariationProcessor(this, variationCoords);
							//}
						}

						_createClass(TTFFont, [{
							key: '_getTable',
							value: function _getTable(table) {
								if (!(table.tag in this._tables)) {
									try {
										this._tables[table.tag] = this._decodeTable(table);
									} catch (e) {
										if (fontkit.logErrors) {
											console.error('Error decoding table ' + table.tag);
											console.error(e.stack);
										}
									}
								}

								return this._tables[table.tag];
							}
						}, {
								key: '_getTableStream',
								value: function _getTableStream(tag) {
									var table = this.directory.tables[tag];
									if (table) {
										this.stream.pos = table.offset;
										return this.stream;
									}

									return null;
								}
							}, {
								key: '_decodeDirectory',
								value: function _decodeDirectory() {
									return this.directory = Directory.decode(this.stream, { _startOffset: 0 });
								}
							}, {
								key: '_decodeTable',
								value: function _decodeTable(table) {
									var pos = this.stream.pos;

									var stream = this._getTableStream(table.tag);
									var result = tables[table.tag].decode(stream, this, table.length);

									this.stream.pos = pos;
									return result;
								}

								/**
								 * The unique PostScript name for this font
								 * @type {string}
								 */

							}, {
								key: 'getName',


								/**
								 * Gets a string from the font's `name` table
								 * @return {string}
								 */
								value: function getName(key) {
									var lang = arguments.length <= 1 || arguments[1] === undefined ? 'English' : arguments[1];

									var record = this.name.records[key];
									if (record) {
										return record[lang];
									}

									return null;
								}

								/**
								 * The font's full name, e.g. "Helvetica Bold"
								 * @type {string}
								 */

							}, {
								key: 'hasGlyphForCodePoint',


								/**
								 * Returns whether there is glyph in the font for the given unicode code point.
								 *
								 * @param {number} codePoint
								 * @return {boolean}
								 */
								value: function hasGlyphForCodePoint(codePoint) {
									return !!this._cmapProcessor.lookup(codePoint);
								}

								/**
								 * Maps a single unicode code point to a Glyph object.
								 * Does not perform any advanced substitutions (there is no context to do so).
								 *
								 * @param {number} codePoint
								 * @return {Glyph}
								 */

							}, {
								key: 'glyphForCodePoint',
								value: function glyphForCodePoint(codePoint) {
									return this.getGlyph(this._cmapProcessor.lookup(codePoint), [codePoint]);
								}

								/**
								 * Returns an array of Glyph objects for the given string.
								 * This is only a one-to-one mapping from characters to glyphs.
								 * For most uses, you should use font.layout (described below), which
								 * provides a much more advanced mapping supporting AAT and OpenType shaping.
								 *
								 * @param {string} string
								 * @return {Glyph[]}
								 */

							}, {
								key: 'glyphsForString',
								value: function glyphsForString(string) {
									// Map character codes to glyph ids
									var glyphs = [];
									var len = string.length;
									var idx = 0;

									while (idx < len) {
										var code = string.charCodeAt(idx++);
										if (0xd800 <= code && code <= 0xdbff && idx < len) {
											var next = string.charCodeAt(idx);
											if (0xdc00 <= next && next <= 0xdfff) {
												idx++;
												code = ((code & 0x3FF) << 10) + (next & 0x3FF) + 0x10000;
											}
										}

										glyphs.push(this.glyphForCodePoint(code));
									}

									return glyphs;
								}
							}, {
								key: 'layout',


								/**
								 * Returns a GlyphRun object, which includes an array of Glyphs and GlyphPositions for the given string.
								 *
								 * @param {string} string
								 * @param {string[]} [userFeatures]
								 * @param {string} [script]
								 * @param {string} [language]
								 * @return {GlyphRun}
								 */
								value: function layout(string, userFeatures, script, language) {
									return this._layoutEngine.layout(string, userFeatures, script, language);
								}

								/**
								 * An array of all [OpenType feature tags](https://www.microsoft.com/typography/otspec/featuretags.htm)
								 * (or mapped AAT tags) supported by the font.
								 * The features parameter is an array of OpenType feature tags to be applied in addition to the default set.
								 * If this is an AAT font, the OpenType feature tags are mapped to AAT features.
								 *
								 * @type {string[]}
								 */

							}, {
								key: '_getBaseGlyph',
								value: function _getBaseGlyph(glyph) {
									var characters = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];

									if (!this._glyphs[glyph]) {
										if (this.directory.tables.glyf) {
											this._glyphs[glyph] = new TTFGlyph(glyph, characters, this);
										} // else if (this.directory.tables['CFF ']) {
										//	this._glyphs[glyph] = new CFFGlyph(glyph, characters, this);
										//}
									}

									return this._glyphs[glyph] || null;
								}

								/**
								 * Returns a glyph object for the given glyph id.
								 * You can pass the array of code points this glyph represents for
								 * your use later, and it will be stored in the glyph object.
								 *
								 * @param {number} glyph
								 * @param {number[]} characters
								 * @return {Glyph}
								 */

							}, {
								key: 'getGlyph',
								value: function getGlyph(glyph) {
									var characters = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];

									if (!this._glyphs[glyph]) {
										//if (this.directory.tables.sbix) {
										//	this._glyphs[glyph] = new SBIXGlyph(glyph, characters, this);
										//} else if (this.directory.tables.COLR && this.directory.tables.CPAL) {
										//	this._glyphs[glyph] = new COLRGlyph(glyph, characters, this);
										//} else {
											this._getBaseGlyph(glyph, characters);
										//}
									}

									return this._glyphs[glyph] || null;
								}

								/**
								 * Returns a Subset for this font.
								 * @return {Subset}
								 */

							}, {
								key: 'createSubset',
								value: function createSubset() {
									//if (this.directory.tables['CFF ']) {
									//	return new CFFSubset(this);
									//}

									return new TTFSubset(this);
								}

								/**
								 * Returns an object describing the available variation axes
								 * that this font supports. Keys are setting tags, and values
								 * contain the axis name, range, and default value.
								 *
								 * @type {object}
								 */

							}, {
								key: 'getVariation',


								/**
								 * Returns a new font with the given variation settings applied.
								 * Settings can either be an instance name, or an object containing
								 * variation tags as specified by the `variationAxes` property.
								 *
								 * @param {object} settings
								 * @return {TTFFont}
								 */
								value: function getVariation(settings) {
									if (!this.directory.tables.fvar || !this.directory.tables.gvar || !this.directory.tables.glyf) {
										throw new Error('Variations require a font with the fvar, gvar, and glyf tables.');
									}

									if (typeof settings === 'string') {
										settings = this.namedVariations[settings];
									}

									if ((typeof settings === 'undefined' ? 'undefined' : _typeof(settings)) !== 'object') {
										throw new Error('Variation settings must be either a variation name or settings object.');
									}

									//// normalize the coordinates
									//var coords = this.fvar.axis.map(function (axis, i) {
									//	if (axis.axisTag in settings) {
									//		return Math.max(axis.minValue, Math.min(axis.maxValue, settings[axis.axisTag]));
									//	} else {
									//		return axis.defaultValue;
									//	}
									//});

									var stream = new r.DecodeStream(this.stream.buffer);
									stream.pos = this._directoryPos;

									var font = new TTFFont(stream/*, coords*/);
									font._tables = this._tables;

									return font;
								}

								// Standardized format plugin API

							}, {
								key: 'getFont',
								value: function getFont(name) {
									return this.getVariation(name);
								}
							}, {
								key: 'postscriptName',
								get: function get() {
									var name = this.name.records.postscriptName;
									var lang = _Object$keys(name)[0];
									return name[lang];
								}
							}, {
								key: 'fullName',
								get: function get() {
									return this.getName('fullName');
								}

								/**
								 * The font's family name, e.g. "Helvetica"
								 * @type {string}
								 */

							}, {
								key: 'familyName',
								get: function get() {
									return this.getName('fontFamily');
								}

								/**
								 * The font's sub-family, e.g. "Bold".
								 * @type {string}
								 */

							}, {
								key: 'subfamilyName',
								get: function get() {
									return this.getName('fontSubfamily');
								}

								/**
								 * The font's copyright information
								 * @type {string}
								 */

							}, {
								key: 'copyright',
								get: function get() {
									return this.getName('copyright');
								}

								/**
								 * The font's version number
								 * @type {string}
								 */

							}, {
								key: 'version',
								get: function get() {
									return this.getName('version');
								}

								/**
								 * The fontвЂ™s [ascender](https://en.wikipedia.org/wiki/Ascender_(typography))
								 * @type {number}
								 */

							}, {
								key: 'ascent',
								get: function get() {
									return this.hhea.ascent;
								}

								/**
								 * The fontвЂ™s [descender](https://en.wikipedia.org/wiki/Descender)
								 * @type {number}
								 */

							}, {
								key: 'descent',
								get: function get() {
									return this.hhea.descent;
								}

								/**
								 * The amount of space that should be included between lines
								 * @type {number}
								 */

							}, {
								key: 'lineGap',
								get: function get() {
									return this.hhea.lineGap;
								}

								/**
								 * The offset from the normal underline position that should be used
								 * @type {number}
								 */

							}, {
								key: 'underlinePosition',
								get: function get() {
									return this.post.underlinePosition;
								}

								/**
								 * The weight of the underline that should be used
								 * @type {number}
								 */

							}, {
								key: 'underlineThickness',
								get: function get() {
									return this.post.underlineThickness;
								}

								/**
								 * If this is an italic font, the angle the cursor should be drawn at to match the font design
								 * @type {number}
								 */

							}, {
								key: 'italicAngle',
								get: function get() {
									return this.post.italicAngle;
								}

								/**
								 * The height of capital letters above the baseline.
								 * See [here](https://en.wikipedia.org/wiki/Cap_height) for more details.
								 * @type {number}
								 */

							}, {
								key: 'capHeight',
								get: function get() {
									var os2 = this['OS/2'];
									return os2 ? os2.capHeight : this.ascent;
								}

								/**
								 * The height of lower case letters in the font.
								 * See [here](https://en.wikipedia.org/wiki/X-height) for more details.
								 * @type {number}
								 */

							}, {
								key: 'xHeight',
								get: function get() {
									var os2 = this['OS/2'];
									return os2 ? os2.xHeight : 0;
								}

								/**
								 * The number of glyphs in the font.
								 * @type {number}
								 */

							}, {
								key: 'numGlyphs',
								get: function get() {
									return this.maxp.numGlyphs;
								}

								/**
								 * The size of the fontвЂ™s internal coordinate grid
								 * @type {number}
								 */

							}, {
								key: 'unitsPerEm',
								get: function get() {
									return this.head.unitsPerEm;
								}

								/**
								 * The fontвЂ™s bounding box, i.e. the box that encloses all glyphs in the font.
								 * @type {BBox}
								 */

							}, {
								key: 'bbox',
								get: function get() {
									return _Object$freeze(new BBox(this.head.xMin, this.head.yMin, this.head.xMax, this.head.yMax));
								}
							}, {
								key: '_cmapProcessor',
								get: function get() {
									return new CmapProcessor(this.cmap);
								}

								/**
								 * An array of all of the unicode code points supported by the font.
								 * @type {number[]}
								 */

							}, {
								key: 'characterSet',
								get: function get() {
									return this._cmapProcessor.getCharacterSet();
								}
							}, {
								key: '_layoutEngine',
								get: function get() {
									return new LayoutEngine(this);
								}
							}, {
								key: 'availableFeatures',
								get: function get() {
									return this._layoutEngine.getAvailableFeatures();
								}
							}, {
								key: 'variationAxes',
								get: function get() {
									var res = {};
									//if (!this.fvar) {
									//	return res;
									//}

									//for (var i = 0, keys = Object.keys(this.fvar.axis); i < keys.length; i++) {
									//	var axis = this.fvar.axis[keys[i]];
									//	res[axis.axisTag] = {
									//		name: axis.name,
									//		min: axis.minValue,
									//		default: axis.defaultValue,
									//		max: axis.maxValue
									//	};
									//}

									return res;
								}

								/**
								 * Returns an object describing the named variation instances
								 * that the font designer has specified. Keys are variation names
								 * and values are the variation settings for this instance.
								 *
								 * @type {object}
								 */

							}, {
								key: 'namedVariations',
								get: function get() {
									var res = {};
									//if (!this.fvar) {
									//	return res;
									//}

									//for (var j = 0, keys = Object.keys(this.fvar.instance); j < keys.length; j++) {
									//	var instance = this.fvar.instance[keys[j]];
									//	let settings = {};
									//	for (let i = 0; i < this.fvar.axis.length; i++) {
									//		let axis = this.fvar.axis[i];
									//		settings[axis.axisTag] = instance.coord[i];
									//	}

									//	res[instance.name] = settings;
									//}

									return res;
								}
							}]);

						return TTFFont;
					} (), (_applyDecoratedDescriptor(_class.prototype, 'bbox', [cache], _Object$getOwnPropertyDescriptor(_class.prototype, 'bbox'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_cmapProcessor', [cache], _Object$getOwnPropertyDescriptor(_class.prototype, '_cmapProcessor'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'characterSet', [cache], _Object$getOwnPropertyDescriptor(_class.prototype, 'characterSet'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_layoutEngine', [cache], _Object$getOwnPropertyDescriptor(_class.prototype, '_layoutEngine'), _class.prototype)), _class);

					//var WOFFDirectoryEntry = new r.Struct({
					//	tag: new r.String(4),
					//	offset: new r.Pointer(r.uint32, 'void', { type: 'global' }),
					//	compLength: r.uint32,
					//	length: r.uint32,
					//	origChecksum: r.uint32
					//});

					//var WOFFDirectory = new r.Struct({
					//	tag: new r.String(4), // should be 'wOFF'
					//	flavor: r.uint32,
					//	length: r.uint32,
					//	numTables: r.uint16,
					//	reserved: new r.Reserved(r.uint16),
					//	totalSfntSize: r.uint32,
					//	majorVersion: r.uint16,
					//	minorVersion: r.uint16,
					//	metaOffset: r.uint32,
					//	metaLength: r.uint32,
					//	metaOrigLength: r.uint32,
					//	privOffset: r.uint32,
					//	privLength: r.uint32,
					//	tables: new r.Array(WOFFDirectoryEntry, 'numTables')
					//});

					//WOFFDirectory.process = function () {
					//	var tables = {};
					//	var _iteratorNormalCompletion = true;
					//	var _didIteratorError = false;
					//	var _iteratorError = undefined;

					//	try {
					//		for (var _iterator = _getIterator(this.tables), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
					//			var table = _step.value;

					//			tables[table.tag] = table;
					//		}
					//	} catch (err) {
					//		_didIteratorError = true;
					//		_iteratorError = err;
					//	} finally {
					//		try {
					//			if (!_iteratorNormalCompletion && _iterator.return) {
					//				_iterator.return();
					//			}
					//		} finally {
					//			if (_didIteratorError) {
					//				throw _iteratorError;
					//			}
					//		}
					//	}

					//	this.tables = tables;
					//};

					//var WOFFFont = function (_TTFFont) {
					//	_inherits(WOFFFont, _TTFFont);

					//	function WOFFFont() {
					//		_classCallCheck(this, WOFFFont);

					//		return _possibleConstructorReturn(this, (WOFFFont.__proto__ || _Object$getPrototypeOf(WOFFFont)).apply(this, arguments));
					//	}

					//	_createClass(WOFFFont, [{
					//		key: '_decodeDirectory',
					//		value: function _decodeDirectory() {
					//			this.directory = WOFFDirectory.decode(this.stream, { _startOffset: 0 });
					//		}
					//	}, {
					//			key: '_getTableStream',
					//			value: function _getTableStream(tag) {
					//				var table = this.directory.tables[tag];
					//				if (table) {
					//					this.stream.pos = table.offset;

					//					if (table.compLength < table.length) {
					//						this.stream.pos += 2; // skip deflate header
					//						var outBuffer = new Buffer(table.length);
					//						var buf = inflate(this.stream.readBuffer(table.compLength - 2), outBuffer);
					//						return new r.DecodeStream(buf);
					//					} else {
					//						return this.stream;
					//					}
					//				}

					//				return null;
					//			}
					//		}], [{
					//			key: 'probe',
					//			value: function probe(buffer) {
					//				return buffer.toString('ascii', 0, 4) === 'wOFF';
					//			}
					//		}]);

					//	return WOFFFont;
					//} (TTFFont);

					///**
					// * Represents a TrueType glyph in the WOFF2 format, which compresses glyphs differently.
					// */

					//var WOFF2Glyph: (...args) => void = function (_TTFGlyph) {
					//	_inherits(WOFF2Glyph, _TTFGlyph);

					//	function WOFF2Glyph() {
					//		_classCallCheck(this, WOFF2Glyph);

					//		return _possibleConstructorReturn(this, (WOFF2Glyph.__proto__ || _Object$getPrototypeOf(WOFF2Glyph)).apply(this, arguments));
					//	}

					//	_createClass(WOFF2Glyph, [{
					//		key: '_decode',
					//		value: function _decode() {
					//			// We have to decode in advance (in WOFF2Font), so just return the pre-decoded data.
					//			return this._font._transformedGlyphs[this.id];
					//		}
					//	}, {
					//			key: '_getCBox',
					//			value: function _getCBox() {
					//				return this.path.bbox;
					//			}
					//		}]);

					//	return WOFF2Glyph;
					//} (TTFGlyph);

					//var Base128 = {
					//	decode: function decode(stream) {
					//		var result = 0;
					//		var iterable = [0, 1, 2, 3, 4];
					//		for (var j = 0; j < iterable.length; j++) {
					//			var i = iterable[j];
					//			var code = stream.readUInt8();

					//			// If any of the top seven bits are set then we're about to overflow.
					//			if (result & 0xe0000000) {
					//				throw new Error('Overflow');
					//			}

					//			result = result << 7 | code & 0x7f;
					//			if ((code & 0x80) === 0) {
					//				return result;
					//			}
					//		}

					//		throw new Error('Bad base 128 number');
					//	}
					//};

					//var knownTags = ['cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'OS/2', 'post', 'cvt ', 'fpgm', 'glyf', 'loca', 'prep', 'CFF ', 'VORG', 'EBDT', 'EBLC', 'gasp', 'hdmx', 'kern', 'LTSH', 'PCLT', 'VDMX', 'vhea', 'vmtx', 'BASE', 'GDEF', 'GPOS', 'GSUB', 'EBSC', 'JSTF', 'MATH', 'CBDT', 'CBLC', 'COLR', 'CPAL', 'SVG ', 'sbix', 'acnt', 'avar', 'bdat', 'bloc', 'bsln', 'cvar', 'fdsc', 'feat', 'fmtx', 'fvar', 'gvar', 'hsty', 'just', 'lcar', 'mort', 'morx', 'opbd', 'prop', 'trak', 'Zapf', 'Silf', 'Glat', 'Gloc', 'Feat', 'Sill'];

					//var WOFF2DirectoryEntry = new r.Struct({
					//	flags: r.uint8,
					//	customTag: new r.Optional(new r.String(4), function (t) {
					//		return (t.flags & 0x3f) === 0x3f;
					//	}),
					//	tag: function tag(t) {
					//		return t.customTag || knownTags[t.flags & 0x3f];
					//	}, // || (() => { throw new Error(`Bad tag: ${flags & 0x3f}`); })(); },
					//	length: Base128,
					//	transformVersion: function transformVersion(t) {
					//		return t.flags >>> 6 & 0x03;
					//	},
					//	transformed: function transformed(t) {
					//		return t.tag === 'glyf' || t.tag === 'loca' ? t.transformVersion === 0 : t.transformVersion !== 0;
					//	},
					//	transformLength: new r.Optional(Base128, function (t) {
					//		return t.transformed;
					//	})
					//});

					//var WOFF2Directory = new r.Struct({
					//	tag: new r.String(4), // should be 'wOF2'
					//	flavor: r.uint32,
					//	length: r.uint32,
					//	numTables: r.uint16,
					//	reserved: new r.Reserved(r.uint16),
					//	totalSfntSize: r.uint32,
					//	totalCompressedSize: r.uint32,
					//	majorVersion: r.uint16,
					//	minorVersion: r.uint16,
					//	metaOffset: r.uint32,
					//	metaLength: r.uint32,
					//	metaOrigLength: r.uint32,
					//	privOffset: r.uint32,
					//	privLength: r.uint32,
					//	tables: new r.Array(WOFF2DirectoryEntry, 'numTables')
					//});

					//WOFF2Directory.process = function () {
					//	var tables = {};
					//	for (var i = 0; i < this.tables.length; i++) {
					//		var table = this.tables[i];
					//		tables[table.tag] = table;
					//	}

					//	return this.tables = tables;
					//};

					///**
					// * Subclass of TTFFont that represents a TTF/OTF font compressed by WOFF2
					// * See spec here: http://www.w3.org/TR/WOFF2/
					// */

					//var WOFF2Font = function (_TTFFont) {
					//	_inherits(WOFF2Font, _TTFFont);

					//	function WOFF2Font() {
					//		_classCallCheck(this, WOFF2Font);

					//		return _possibleConstructorReturn(this, (WOFF2Font.__proto__ || _Object$getPrototypeOf(WOFF2Font)).apply(this, arguments));
					//	}

					//	_createClass(WOFF2Font, [{
					//		key: '_decodeDirectory',
					//		value: function _decodeDirectory() {
					//			this.directory = WOFF2Directory.decode(this.stream);
					//			this._dataPos = this.stream.pos;
					//		}
					//	}, {
					//			key: '_decompress',
					//			value: function _decompress() {
					//				// decompress data and setup table offsets if we haven't already
					//				if (!this._decompressed) {
					//					this.stream.pos = this._dataPos;
					//					var buffer = this.stream.readBuffer(this.directory.totalCompressedSize);

					//					var decompressedSize = 0;
					//					for (var tag in this.directory.tables) {
					//						var entry = this.directory.tables[tag];
					//						entry.offset = decompressedSize;
					//						decompressedSize += entry.transformLength != null ? entry.transformLength : entry.length;
					//					}

					//					var decompressed = brotli(buffer, decompressedSize);
					//					if (!decompressed) {
					//						throw new Error('Error decoding compressed data in WOFF2');
					//					}

					//					this.stream = new r.DecodeStream(new Buffer(decompressed));
					//					this._decompressed = true;
					//				}
					//			}
					//		}, {
					//			key: '_decodeTable',
					//			value: function _decodeTable(table) {
					//				this._decompress();
					//				return _get(WOFF2Font.prototype.__proto__ || _Object$getPrototypeOf(WOFF2Font.prototype), '_decodeTable', this).call(this, table);
					//			}

					//			// Override this method to get a glyph and return our
					//			// custom subclass if there is a glyf table.

					//		}, {
					//			key: '_getBaseGlyph',
					//			value: function _getBaseGlyph(glyph) {
					//				var characters = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];

					//				if (!this._glyphs[glyph]) {
					//					if (this.directory.tables.glyf && this.directory.tables.glyf.transformed) {
					//						if (!this._transformedGlyphs) {
					//							this._transformGlyfTable();
					//						}
					//						return this._glyphs[glyph] = new WOFF2Glyph(glyph, characters, this);
					//					} else {
					//						return _get(WOFF2Font.prototype.__proto__ || _Object$getPrototypeOf(WOFF2Font.prototype), '_getBaseGlyph', this).call(this, glyph, characters);
					//					}
					//				}
					//			}
					//		}, {
					//			key: '_transformGlyfTable',
					//			value: function _transformGlyfTable() {
					//				this._decompress();
					//				this.stream.pos = this.directory.tables.glyf.offset;
					//				var table = GlyfTable.decode(this.stream);
					//				var glyphs = [];

					//				for (var index = 0; index < table.numGlyphs; index++) {
					//					var glyph: any = {};
					//					var nContours = table.nContours.readInt16BE();
					//					glyph.numberOfContours = nContours;

					//					if (nContours > 0) {
					//						// simple glyph
					//						var nPoints = [];
					//						var totalPoints = 0;

					//						for (var i = 0; i < nContours; i++) {
					//							var _r = read255UInt16(table.nPoints);
					//							nPoints.push(_r);
					//							totalPoints += _r;
					//						}

					//						glyph.points = decodeTriplet(table.flags, table.glyphs, totalPoints);
					//						for (var _i = 0; _i < nContours; _i++) {
					//							glyph.points[nPoints[_i] - 1].endContour = true;
					//						}

					//						var instructionSize = read255UInt16(table.glyphs);
					//					} else if (nContours < 0) {
					//						// composite glyph
					//						var haveInstructions = TTFGlyph.prototype._decodeComposite.call({ _font: this }, glyph, table.composites);
					//						if (haveInstructions) {
					//							var instructionSize = read255UInt16(table.glyphs);
					//						}
					//					}

					//					glyphs.push(glyph);
					//				}

					//				this._transformedGlyphs = glyphs;
					//			}
					//		}], [{
					//			key: 'probe',
					//			value: function probe(buffer) {
					//				return buffer.toString('ascii', 0, 4) === 'wOF2';
					//			}
					//		}]);

					//	return WOFF2Font;
					//} (TTFFont);

					//var Substream = function () {
					//	function Substream(length) {
					//		_classCallCheck(this, Substream);

					//		this.length = length;
					//		this._buf = new r.Buffer(length);
					//	}

					//	_createClass(Substream, [{
					//		key: 'decode',
					//		value: function decode(stream, parent) {
					//			return new r.DecodeStream(this._buf.decode(stream, parent));
					//		}
					//	}]);

					//	return Substream;
					//} ();

					//// This struct represents the entire glyf table


					//var GlyfTable = new r.Struct({
					//	version: r.uint32,
					//	numGlyphs: r.uint16,
					//	indexFormat: r.uint16,
					//	nContourStreamSize: r.uint32,
					//	nPointsStreamSize: r.uint32,
					//	flagStreamSize: r.uint32,
					//	glyphStreamSize: r.uint32,
					//	compositeStreamSize: r.uint32,
					//	bboxStreamSize: r.uint32,
					//	instructionStreamSize: r.uint32,
					//	nContours: new Substream('nContourStreamSize'),
					//	nPoints: new Substream('nPointsStreamSize'),
					//	flags: new Substream('flagStreamSize'),
					//	glyphs: new Substream('glyphStreamSize'),
					//	composites: new Substream('compositeStreamSize'),
					//	bboxes: new Substream('bboxStreamSize'),
					//	instructions: new Substream('instructionStreamSize')
					//});

					//var WORD_CODE = 253;
					//var ONE_MORE_BYTE_CODE2 = 254;
					//var ONE_MORE_BYTE_CODE1 = 255;
					//var LOWEST_U_CODE = 253;

					//function read255UInt16(stream) {
					//	var code = stream.readUInt8();

					//	if (code === WORD_CODE) {
					//		return stream.readUInt16BE();
					//	}

					//	if (code === ONE_MORE_BYTE_CODE1) {
					//		return stream.readUInt8() + LOWEST_U_CODE;
					//	}

					//	if (code === ONE_MORE_BYTE_CODE2) {
					//		return stream.readUInt8() + LOWEST_U_CODE * 2;
					//	}

					//	return code;
					//}

					//function withSign(flag, baseval) {
					//	return flag & 1 ? baseval : -baseval;
					//}

					//function decodeTriplet(flags, glyphs, nPoints) {
					//	var y = void 0;
					//	var x = y = 0;
					//	var res = [];

					//	for (var i = 0; i < nPoints; i++) {
					//		var dx = 0,
					//			dy = 0;
					//		var flag = flags.readUInt8();
					//		var onCurve = !(flag >> 7);
					//		flag &= 0x7f;

					//		if (flag < 10) {
					//			dx = 0;
					//			dy = withSign(flag, ((flag & 14) << 7) + glyphs.readUInt8());
					//		} else if (flag < 20) {
					//			dx = withSign(flag, ((flag - 10 & 14) << 7) + glyphs.readUInt8());
					//			dy = 0;
					//		} else if (flag < 84) {
					//			var b0 = flag - 20;
					//			var b1 = glyphs.readUInt8();
					//			dx = withSign(flag, 1 + (b0 & 0x30) + (b1 >> 4));
					//			dy = withSign(flag >> 1, 1 + ((b0 & 0x0c) << 2) + (b1 & 0x0f));
					//		} else if (flag < 120) {
					//			var b0 = flag - 84;
					//			dx = withSign(flag, 1 + (b0 / 12 << 8) + glyphs.readUInt8());
					//			dy = withSign(flag >> 1, 1 + (b0 % 12 >> 2 << 8) + glyphs.readUInt8());
					//		} else if (flag < 124) {
					//			var b1 = glyphs.readUInt8();
					//			var b2 = glyphs.readUInt8();
					//			dx = withSign(flag, (b1 << 4) + (b2 >> 4));
					//			dy = withSign(flag >> 1, ((b2 & 0x0f) << 8) + glyphs.readUInt8());
					//		} else {
					//			dx = withSign(flag, glyphs.readUInt16BE());
					//			dy = withSign(flag >> 1, glyphs.readUInt16BE());
					//		}

					//		x += dx;
					//		y += dy;
					//		res.push(new Point(onCurve, false, x, y));
					//	}

					//	return res;
					//}

					var TTCHeader = new r.VersionedStruct(r.uint32, {
						0x00010000: {
							numFonts: r.uint32,
							offsets: new r.Array(r.uint32, 'numFonts')
						},
						0x00020000: {
							numFonts: r.uint32,
							offsets: new r.Array(r.uint32, 'numFonts'),
							dsigTag: r.uint32,
							dsigLength: r.uint32,
							dsigOffset: r.uint32
						}
					});

					var TrueTypeCollection = function () {
						_createClass(TrueTypeCollection, null, [{
							key: 'probe',
							value: function probe(buffer) {
								return buffer.toString('ascii', 0, 4) === 'ttcf';
							}
						}]);

						function TrueTypeCollection(stream) {
							_classCallCheck(this, TrueTypeCollection);

							this.stream = stream;
							if (stream.readString(4) !== 'ttcf') {
								throw new Error('Not a TrueType collection');
							}

							this.header = TTCHeader.decode(stream);
						}

						_createClass(TrueTypeCollection, [{
							key: 'getFont',
							value: function getFont(name) {
								for (var i = 0, keys = Object.keys(this.header.offsets); i < keys.length; i++) {
									var offset = this.header.offsets[keys[i]];
									let stream = new r.DecodeStream(this.stream.buffer);
									stream.pos = offset;
									let font = new TTFFont(stream);
									if (font.postscriptName === name) {
										return font;
									}
								}

								return null;
							}
						}, {
								key: 'fonts',
								get: function get() {
									var fonts = [];

									for (var i = 0, keys = Object.keys(this.header.offsets); i < keys.length; i++) {
										var offset = this.header.offsets[keys[i]];
										let stream = new r.DecodeStream(this.stream.buffer);
										stream.pos = offset;
										fonts.push(new TTFFont(stream));
									}
									return fonts;
								}
							}]);

						return TrueTypeCollection;
					} ();

					var DFontName = new r.String(r.uint8);
					var DFontData = new r.Struct({
						len: r.uint32,
						buf: new r.Buffer('len')
					});

					var Ref = new r.Struct({
						id: r.uint16,
						nameOffset: r.int16,
						attr: r.uint8,
						dataOffset: r.uint24,
						handle: r.uint32
					});

					var Type = new r.Struct({
						name: new r.String(4),
						maxTypeIndex: r.uint16,
						refList: new r.Pointer(r.uint16, new r.Array(Ref, function (t) {
							return t.maxTypeIndex + 1;
						}), { type: 'parent' })
					});

					var TypeList = new r.Struct({
						length: r.uint16,
						types: new r.Array(Type, function (t) {
							return t.length + 1;
						})
					});

					var DFontMap = new r.Struct({
						reserved: new r.Reserved(r.uint8, 24),
						typeList: new r.Pointer(r.uint16, TypeList),
						nameListOffset: new r.Pointer(r.uint16, 'void')
					});

					var DFontHeader = new r.Struct({
						dataOffset: r.uint32,
						map: new r.Pointer(r.uint32, DFontMap),
						dataLength: r.uint32,
						mapLength: r.uint32
					});

					var DFont = function () {
						_createClass(DFont, null, [{
							key: 'probe',
							value: function probe(buffer) {
								var stream = new r.DecodeStream(buffer);

								try {
									var header = DFontHeader.decode(stream);
								} catch (e) {
									return false;
								}

								for (var i = 0, keys = Object.keys(header.map.typeList.types); i < keys.length; i++) {
									var type = header.map.typeList.types[keys[i]];
									if (type.name === 'sfnt') {
										return true;
									}
								}

								return false;
							}
						}]);

						function DFont(stream) {
							_classCallCheck(this, DFont);

							this.stream = stream;
							this.header = DFontHeader.decode(this.stream);

							for (var i = 0, keys = Object.keys(this.header.map.typeList.types); i < keys.length; i++) {
								var type = this.header.map.typeList.types[keys[i]];

								for (var j = 0, keys2 = Object.keys(type.refList); j < keys2.length; j++) {
									var ref = type.refList[keys2[j]];

									if (ref.nameOffset >= 0) {
										this.stream.pos = ref.nameOffset + this.header.map.nameListOffset;
										ref.name = DFontName.decode(this.stream);
									} else {
										ref.name = null;
									}
								}

								if (type.name === 'sfnt') {
									this.sfnt = type;
								}
							}
						}

						_createClass(DFont, [{
							key: 'getFont',
							value: function getFont(name) {
								if (!this.sfnt) {
									return null;
								}

								for (var i = 0, keys = Object.keys(this.sfnt.refList); i < keys.length; i++) {
									var ref = this.sfnt.refList[keys[i]];
										var pos = this.header.dataOffset + ref.dataOffset + 4;
										var stream = new r.DecodeStream(this.stream.buffer.slice(pos));
										var font = new TTFFont(stream);
										if (font.postscriptName === name) {
											return font;
										}
								}
								return null;
							}
						}, {
								key: 'fonts',
								get: function get() {
									var fonts = [];

									for (var i = 0, keys = Object.keys(this.sfnt.refList); i < keys.length; i++) {
										var ref = this.sfnt.refList[keys[i]];
											var pos = this.header.dataOffset + ref.dataOffset + 4;
											var stream = new r.DecodeStream(this.stream.buffer.slice(pos));
											fonts.push(new TTFFont(stream))
									}

									return fonts;
								}
							}]);

						return DFont;
					} ();

					// Register font formats
					fontkit.registerFormat(TTFFont);
					//fontkit.registerFormat(WOFFFont);
					//fontkit.registerFormat(WOFF2Font);
					fontkit.registerFormat(TrueTypeCollection);
					fontkit.registerFormat(DFont);

					localModule.localExports = fontkit;


				}).call(this, localRequire('_process'), localRequire("buffer").Buffer)

			}, { "_process": 188, "babel-runtime/core-js/get-iterator": 24, "babel-runtime/core-js/object/assign": 26, "babel-runtime/core-js/object/define-properties": 28, "babel-runtime/core-js/object/define-property": 29, "babel-runtime/core-js/object/freeze": 30, "babel-runtime/core-js/object/get-own-property-descriptor": 31, "babel-runtime/core-js/object/get-prototype-of": 32, "babel-runtime/core-js/object/keys": 33, "babel-runtime/helpers/classCallCheck": 37, "babel-runtime/helpers/createClass": 38, "babel-runtime/helpers/get": 39, "babel-runtime/helpers/inherits": 40, "babel-runtime/helpers/possibleConstructorReturn": 41, "babel-runtime/helpers/slicedToArray": 42, "babel-runtime/helpers/toConsumableArray": 43, "babel-runtime/helpers/typeof": 44, /*"brotli/decompress": 55,*/ "buffer": 60, "clone": 61, /*"deep-equal": 161,*/ "restructure": 199, "restructure/src/utils": 215, "tiny-inflate": 218, "unicode-properties": 220, "unicode-trie": 221 }], 166: [function (localRequire, localModule, localExports) {
				localExports.read = function (buffer, offset, isLE, mLen, nBytes) {
					var e, m
					var eLen = nBytes * 8 - mLen - 1
					var eMax = (1 << eLen) - 1
					var eBias = eMax >> 1
					var nBits = -7
					var i = isLE ? (nBytes - 1) : 0
					var d = isLE ? -1 : 1
					var s = buffer[offset + i]

					i += d

					e = s & ((1 << (-nBits)) - 1)
					s >>= (-nBits)
					nBits += eLen
					for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) { }

					m = e & ((1 << (-nBits)) - 1)
					e >>= (-nBits)
					nBits += mLen
					for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) { }

					if (e === 0) {
						e = 1 - eBias
					} else if (e === eMax) {
						return m ? NaN : ((s ? -1 : 1) * Infinity)
					} else {
						m = m + Math.pow(2, mLen)
						e = e - eBias
					}
					return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
				}

				localExports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
					var e, m, c
					var eLen = nBytes * 8 - mLen - 1
					var eMax = (1 << eLen) - 1
					var eBias = eMax >> 1
					var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
					var i = isLE ? 0 : (nBytes - 1)
					var d = isLE ? 1 : -1
					var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0

					value = Math.abs(value)

					if (isNaN(value) || value === Infinity) {
						m = isNaN(value) ? 1 : 0
						e = eMax
					} else {
						e = Math.floor(Math.log(value) / Math.LN2)
						if (value * (c = Math.pow(2, -e)) < 1) {
							e--
							c *= 2
						}
						if (e + eBias >= 1) {
							value += rt / c
						} else {
							value += rt * Math.pow(2, 1 - eBias)
						}
						if (value * c >= 2) {
							e++
							c /= 2
						}

						if (e + eBias >= eMax) {
							m = 0
							e = eMax
						} else if (e + eBias >= 1) {
							m = (value * c - 1) * Math.pow(2, mLen)
							e = e + eBias
						} else {
							m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
							e = 0
						}
					}

					for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) { }

					e = (e << mLen) | m
					eLen += mLen
					for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) { }

					buffer[offset + i - d] |= s * 128
				}

			}, {}], 167: [function (localRequire, localModule, localExports) {
				if (typeof Object.create === 'function') {
					// implementation from standard node.js 'util' module
					localModule.localExports = function inherits(ctor, superCtor) {
						ctor.super_ = superCtor
						ctor.prototype = Object.create(superCtor.prototype, {
							constructor: {
								value: ctor,
								enumerable: false,
								writable: true,
								configurable: true
							}
						});
					};
				} else {
					// old school shim for old browsers
					localModule.localExports = function inherits(ctor, superCtor) {
						ctor.super_ = superCtor
						var TempCtor = function () { }
						TempCtor.prototype = superCtor.prototype
						ctor.prototype = new TempCtor()
						ctor.prototype.constructor = ctor
					}
				}

			}, {}], 168: [function (localRequire, localModule, localExports) {
				/*!
				 * Determine if an object is a Buffer
				 *
				 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
				 * @license  MIT
				 */

				// The _isBuffer check is for Safari 5-7 support, because it's missing
				// Object.prototype.constructor. Remove this eventually
				localModule.localExports = function (obj) {
					return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
				}

				function isBuffer(obj) {
					return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
				}

				// For Node v0.10 support. Remove this eventually.
				function isSlowBuffer(obj) {
					return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
				}

			}, {}], 169: [function (localRequire, localModule, localExports) {
				var toString = {}.toString;

				localModule.localExports = Array.isArray || function (arr) {
					return toString.call(arr) == '[object Array]';
				};

			}, {}],
			// 170: [function (localRequire, localModule, localExports) {
			//	// Generated by CoffeeScript 1.7.1
			//	var UnicodeTrie,
			//		__slice = [].slice;

			//	UnicodeTrie = (function () {
			//		var DATA_BLOCK_LENGTH, DATA_GRANULARITY, DATA_MASK, INDEX_1_OFFSET, INDEX_2_BLOCK_LENGTH, INDEX_2_BMP_LENGTH, INDEX_2_MASK, INDEX_SHIFT, LSCP_INDEX_2_LENGTH, LSCP_INDEX_2_OFFSET, OMITTED_BMP_INDEX_1_LENGTH, SHIFT_1, SHIFT_1_2, SHIFT_2, UTF8_2B_INDEX_2_LENGTH, UTF8_2B_INDEX_2_OFFSET;

			//		SHIFT_1 = 6 + 5;

			//		SHIFT_2 = 5;

			//		SHIFT_1_2 = SHIFT_1 - SHIFT_2;

			//		OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> SHIFT_1;

			//		INDEX_2_BLOCK_LENGTH = 1 << SHIFT_1_2;

			//		INDEX_2_MASK = INDEX_2_BLOCK_LENGTH - 1;

			//		INDEX_SHIFT = 2;

			//		DATA_BLOCK_LENGTH = 1 << SHIFT_2;

			//		DATA_MASK = DATA_BLOCK_LENGTH - 1;

			//		LSCP_INDEX_2_OFFSET = 0x10000 >> SHIFT_2;

			//		LSCP_INDEX_2_LENGTH = 0x400 >> SHIFT_2;

			//		INDEX_2_BMP_LENGTH = LSCP_INDEX_2_OFFSET + LSCP_INDEX_2_LENGTH;

			//		UTF8_2B_INDEX_2_OFFSET = INDEX_2_BMP_LENGTH;

			//		UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6;

			//		INDEX_1_OFFSET = UTF8_2B_INDEX_2_OFFSET + UTF8_2B_INDEX_2_LENGTH;

			//		DATA_GRANULARITY = 1 << INDEX_SHIFT;

			//		function UnicodeTrie(json) {
			//			var _ref, _ref1;
			//			if (json == null) {
			//				json = {};
			//			}
			//			this.data = json.data || [];
			//			this.highStart = (_ref = json.highStart) != null ? _ref : 0;
			//			this.errorValue = (_ref1 = json.errorValue) != null ? _ref1 : -1;
			//		}

			//		UnicodeTrie.prototype.get = function (codePoint) {
			//			var index;
			//			if (codePoint < 0 || codePoint > 0x10ffff) {
			//				return this.errorValue;
			//			}
			//			if (codePoint < 0xd800 || (codePoint > 0xdbff && codePoint <= 0xffff)) {
			//				index = (this.data[codePoint >> SHIFT_2] << INDEX_SHIFT) + (codePoint & DATA_MASK);
			//				return this.data[index];
			//			}
			//			if (codePoint <= 0xffff) {
			//				index = (this.data[LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> SHIFT_2)] << INDEX_SHIFT) + (codePoint & DATA_MASK);
			//				return this.data[index];
			//			}
			//			if (codePoint < this.highStart) {
			//				index = this.data[(INDEX_1_OFFSET - OMITTED_BMP_INDEX_1_LENGTH) + (codePoint >> SHIFT_1)];
			//				index = this.data[index + ((codePoint >> SHIFT_2) & INDEX_2_MASK)];
			//				index = (index << INDEX_SHIFT) + (codePoint & DATA_MASK);
			//				return this.data[index];
			//			}
			//			return this.data[this.data.length - DATA_GRANULARITY];
			//		};

			//		UnicodeTrie.prototype.toJSON = function () {
			//			var res;
			//			res = {
			//				data: __slice.call(this.data),
			//				highStart: this.highStart,
			//				errorValue: this.errorValue
			//			};
			//			return res;
			//		};

			//		return UnicodeTrie;

			//	})();

			//	localModule.localExports = UnicodeTrie;

			//}, {}],
			// 171: [function (localRequire, localModule, localExports) {
			//	localModule.localExports = { "data": [1961, 1969, 1977, 1985, 2025, 2033, 2041, 2049, 2057, 2065, 2073, 2081, 2089, 2097, 2105, 2113, 2121, 2129, 2137, 2145, 2153, 2161, 2169, 2177, 2185, 2193, 2201, 2209, 2217, 2225, 2233, 2241, 2249, 2257, 2265, 2273, 2281, 2289, 2297, 2305, 2313, 2321, 2329, 2337, 2345, 2353, 2361, 2369, 2377, 2385, 2393, 2401, 2409, 2417, 2425, 2433, 2441, 2449, 2457, 2465, 2473, 2481, 2489, 2497, 2505, 2513, 2521, 2529, 2529, 2537, 2009, 2545, 2553, 2561, 2569, 2577, 2585, 2593, 2601, 2609, 2617, 2625, 2633, 2641, 2649, 2657, 2665, 2673, 2681, 2689, 2697, 2705, 2713, 2721, 2729, 2737, 2745, 2753, 2761, 2769, 2777, 2785, 2793, 2801, 2809, 2817, 2825, 2833, 2841, 2849, 2857, 2865, 2873, 2881, 2889, 2009, 2897, 2905, 2913, 2009, 2921, 2929, 2937, 2945, 2953, 2961, 2969, 2009, 2977, 2977, 2985, 2993, 3001, 3009, 3009, 3009, 3017, 3017, 3017, 3025, 3025, 3033, 3041, 3041, 3049, 3049, 3049, 3049, 3049, 3049, 3049, 3049, 3049, 3049, 3057, 3065, 3073, 3073, 3073, 3081, 3089, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3105, 3113, 3113, 3121, 3129, 3137, 3145, 3153, 3161, 3161, 3169, 3177, 3185, 3193, 3193, 3193, 3193, 3201, 3209, 3209, 3217, 3225, 3233, 3241, 3241, 3241, 3249, 3257, 3265, 3273, 3273, 3281, 3289, 3297, 2009, 2009, 3305, 3313, 3321, 3329, 3337, 3345, 3353, 3361, 3369, 3377, 3385, 3393, 2009, 2009, 3401, 3409, 3417, 3417, 3417, 3417, 3417, 3417, 3425, 3425, 3433, 3433, 3433, 3433, 3433, 3433, 3433, 3433, 3433, 3433, 3433, 3433, 3433, 3433, 3433, 3441, 3449, 3457, 3465, 3473, 3481, 3489, 3497, 3505, 3513, 3521, 3529, 3537, 3545, 3553, 3561, 3569, 3577, 3585, 3593, 3601, 3609, 3617, 3625, 3625, 3633, 3641, 3649, 3649, 3649, 3649, 3649, 3657, 3665, 3665, 3673, 3681, 3681, 3681, 3681, 3689, 3697, 3697, 3705, 3713, 3721, 3729, 3737, 3745, 3753, 3761, 3769, 3777, 3785, 3793, 3801, 3809, 3817, 3825, 3833, 3841, 3849, 3857, 3865, 3873, 3881, 3881, 3881, 3881, 3881, 3881, 3881, 3881, 3881, 3881, 3881, 3881, 3889, 3897, 3905, 3913, 3921, 3921, 3921, 3921, 3921, 3921, 3921, 3921, 3921, 3921, 3929, 2009, 2009, 2009, 2009, 2009, 3937, 3937, 3937, 3937, 3937, 3937, 3937, 3945, 3953, 3953, 3953, 3961, 3969, 3969, 3977, 3985, 3993, 4001, 2009, 2009, 4009, 4009, 4009, 4009, 4009, 4009, 4009, 4009, 4009, 4009, 4009, 4009, 4017, 4025, 4033, 4041, 4049, 4057, 4065, 4073, 4081, 4081, 4081, 4081, 4081, 4081, 4081, 4089, 4097, 4097, 4105, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4113, 4121, 4121, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4137, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4145, 4153, 4161, 4169, 4169, 4169, 4169, 4169, 4169, 4169, 4169, 4177, 4185, 4193, 4201, 4209, 4217, 4217, 4225, 4233, 4233, 4233, 4233, 4233, 4233, 4233, 4233, 4241, 4249, 4257, 4265, 4273, 4281, 4289, 4297, 4305, 4313, 4321, 4329, 4337, 4345, 4353, 4361, 4361, 4369, 4377, 4385, 4385, 4385, 4385, 4393, 4401, 4409, 4409, 4409, 4409, 4409, 4409, 4417, 4425, 4433, 4441, 4449, 4457, 4465, 4473, 4481, 4489, 4497, 4505, 4513, 4521, 4529, 4537, 4545, 4553, 4561, 4569, 4577, 4585, 4593, 4601, 4609, 4617, 4625, 4633, 4641, 4649, 4657, 4665, 4673, 4681, 4689, 4697, 4705, 4713, 4721, 4729, 4737, 4745, 4753, 4761, 4769, 4777, 4785, 4793, 4801, 4809, 4817, 4825, 4833, 4841, 4849, 4857, 4865, 4873, 4881, 4889, 4897, 4905, 4913, 4921, 4929, 4937, 4945, 4953, 4961, 4969, 4977, 4985, 4993, 5001, 5009, 5017, 5025, 5033, 5041, 5049, 5057, 5065, 5073, 5081, 5089, 5097, 5105, 5113, 5121, 5129, 5137, 5145, 5153, 5161, 5169, 5177, 5185, 5193, 5201, 5209, 5217, 5225, 5233, 5241, 5249, 5257, 5265, 5273, 5281, 5289, 5297, 5305, 5313, 5321, 5329, 5337, 5345, 5353, 5361, 5369, 5377, 5385, 5393, 5401, 5409, 5417, 5425, 5433, 5441, 5449, 5457, 5465, 5473, 5481, 5489, 5497, 5505, 5513, 5521, 5529, 5537, 5545, 5553, 5561, 5569, 5577, 5585, 5593, 5601, 5609, 5617, 5625, 5633, 5641, 5649, 5657, 5665, 5673, 5681, 5689, 5697, 5705, 5713, 5721, 5729, 5737, 5745, 5753, 5761, 5769, 5777, 5785, 5793, 5801, 5809, 5817, 5825, 5833, 5841, 5849, 5857, 5865, 5873, 5881, 5889, 5897, 5905, 5913, 5921, 5929, 5937, 5945, 5953, 5961, 5969, 5977, 5985, 5993, 6001, 6009, 6017, 6025, 6033, 6041, 6049, 6057, 6065, 6073, 6081, 6089, 6097, 6105, 6113, 6121, 6129, 6137, 6145, 6153, 6161, 6169, 6177, 6185, 6193, 6201, 6209, 6217, 6225, 6233, 6241, 6249, 6257, 6265, 6273, 6281, 6289, 6297, 6305, 6313, 6321, 6329, 6337, 6345, 6353, 6361, 6369, 6377, 6385, 6393, 6401, 6409, 6417, 6425, 6433, 6441, 6449, 6457, 6465, 6473, 6481, 6489, 6497, 6505, 6513, 6521, 6529, 6537, 6545, 6553, 6561, 6569, 6577, 6585, 6593, 6601, 6609, 6617, 6625, 6633, 6641, 6649, 6657, 6665, 6673, 6681, 6689, 6697, 6705, 6713, 6721, 6729, 6737, 6745, 6753, 6761, 6769, 6777, 6785, 6793, 6801, 6809, 6817, 6825, 6833, 6841, 6849, 6857, 6865, 6873, 6881, 6889, 6897, 6905, 6913, 6921, 6929, 6937, 6945, 6953, 6961, 6969, 6977, 6985, 6993, 7001, 7009, 7017, 7025, 7033, 7041, 7049, 7057, 7065, 7073, 7081, 7089, 7097, 7105, 7113, 7121, 7129, 7137, 7145, 7153, 7161, 7169, 7177, 7185, 7193, 7201, 7209, 7217, 7225, 7233, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 7249, 7249, 7249, 7249, 7249, 7249, 7249, 7249, 7249, 7249, 7249, 7249, 7249, 7249, 7249, 7249, 7257, 7265, 7273, 7281, 7281, 7281, 7281, 7281, 7281, 7281, 7281, 7281, 7281, 7281, 7281, 7281, 7281, 7289, 7297, 7305, 7305, 7305, 7305, 7313, 7321, 7329, 7337, 7345, 7353, 7353, 7353, 7361, 7369, 7377, 7385, 7393, 7401, 7409, 7417, 7425, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7241, 7972, 7972, 8100, 8164, 8228, 8292, 8356, 8420, 8484, 8548, 8612, 8676, 8740, 8804, 8868, 8932, 8996, 9060, 9124, 9188, 9252, 9316, 9380, 9444, 9508, 9572, 9636, 9700, 9764, 9828, 9892, 9956, 2593, 2657, 2721, 2529, 2785, 2529, 2849, 2913, 2977, 3041, 3105, 3169, 3233, 3297, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 3361, 2529, 2529, 2529, 3425, 2529, 2529, 3489, 3553, 2529, 3617, 3681, 3745, 3809, 3873, 3937, 4001, 4065, 4129, 4193, 4257, 4321, 4385, 4449, 4513, 4577, 4641, 4705, 4769, 4833, 4897, 4961, 5025, 5089, 5153, 5217, 5281, 5345, 5409, 5473, 5537, 5601, 5665, 5729, 5793, 5857, 5921, 5985, 6049, 6113, 6177, 6241, 6305, 6369, 6433, 6497, 6561, 6625, 6689, 6753, 6817, 6881, 6945, 7009, 7073, 7137, 7201, 7265, 7329, 7393, 7457, 7521, 7585, 7649, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, 7713, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 7433, 7433, 7433, 7433, 7433, 7433, 7433, 7441, 7449, 7457, 7457, 7457, 7457, 7457, 7457, 7465, 2009, 2009, 2009, 2009, 7473, 7473, 7473, 7473, 7473, 7473, 7473, 7473, 7481, 7489, 7497, 7505, 7505, 7505, 7505, 7505, 7513, 7521, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 7529, 7529, 7537, 7545, 7545, 7545, 7545, 7545, 7553, 7561, 7561, 7561, 7561, 7561, 7561, 7561, 7569, 7577, 7585, 7593, 7593, 7593, 7593, 7593, 7593, 7601, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7609, 7617, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 7625, 7633, 7641, 7649, 7657, 7665, 7673, 7681, 7689, 7697, 7705, 2009, 7713, 7721, 7729, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 7737, 7745, 7753, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7761, 7769, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7777, 7785, 7793, 7801, 7809, 7809, 7809, 7809, 7809, 7809, 7817, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7825, 7833, 7841, 7849, 2009, 2009, 2009, 7857, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 7865, 7865, 7865, 7865, 7865, 7865, 7865, 7865, 7865, 7865, 7865, 7873, 7881, 7889, 7897, 7897, 7897, 7897, 7905, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7913, 7921, 7929, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 7937, 7937, 7937, 7937, 7937, 7937, 7937, 7945, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 7953, 7953, 7953, 7953, 7953, 7953, 7953, 2009, 7961, 7969, 7977, 7985, 7993, 2009, 2009, 8001, 8009, 8009, 8009, 8009, 8009, 8009, 8009, 8009, 8009, 8009, 8009, 8009, 8009, 8017, 8025, 8025, 8025, 8025, 8025, 8025, 8025, 8033, 8041, 8049, 8057, 8065, 8073, 8081, 8081, 8081, 8081, 8081, 8081, 8081, 8081, 8081, 8081, 8081, 8089, 2009, 8097, 8097, 8097, 8105, 2009, 2009, 2009, 2009, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8113, 8121, 8129, 8137, 8137, 8137, 8137, 8137, 8137, 8137, 8137, 8137, 8137, 8137, 8137, 8137, 8137, 8145, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 67496, 67496, 67496, 21, 21, 21, 21, 21, 21, 21, 21, 21, 17, 34, 30, 30, 33, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 38, 6, 3, 12, 9, 10, 12, 3, 0, 2, 12, 9, 8, 16, 8, 7, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 12, 12, 12, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 9, 2, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 17, 1, 12, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 21, 21, 21, 21, 21, 35, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 4, 0, 10, 9, 9, 9, 12, 29, 29, 12, 29, 3, 12, 17, 12, 12, 10, 9, 29, 29, 18, 12, 29, 29, 29, 29, 29, 3, 29, 29, 29, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 18, 29, 29, 29, 18, 29, 12, 12, 29, 12, 12, 12, 12, 12, 12, 12, 29, 29, 29, 29, 12, 29, 12, 18, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 4, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 4, 4, 4, 4, 4, 4, 4, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 8, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 8, 17, 39, 39, 39, 39, 9, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 17, 21, 12, 21, 21, 12, 21, 21, 6, 21, 39, 39, 39, 39, 39, 39, 39, 39, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 10, 10, 10, 8, 8, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 6, 6, 6, 6, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 12, 12, 12, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 6, 12, 21, 21, 21, 21, 21, 21, 21, 12, 12, 21, 21, 21, 21, 21, 21, 12, 12, 21, 21, 12, 21, 21, 21, 21, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 8, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 21, 21, 21, 12, 21, 21, 21, 21, 21, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 17, 17, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 21, 21, 21, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 21, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 39, 39, 39, 39, 39, 39, 39, 39, 21, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 21, 21, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 10, 10, 12, 12, 12, 12, 12, 10, 12, 9, 39, 39, 39, 39, 39, 21, 21, 21, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 21, 21, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 21, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 9, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 21, 21, 21, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 21, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 21, 21, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 12, 39, 39, 39, 39, 39, 39, 21, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 9, 12, 39, 39, 39, 39, 39, 39, 21, 21, 21, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 21, 21, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 21, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 21, 21, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 21, 21, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 39, 39, 39, 39, 39, 39, 39, 39, 21, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 21, 21, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 39, 39, 39, 10, 12, 12, 12, 12, 12, 12, 39, 39, 21, 21, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 39, 39, 39, 39, 9, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 17, 17, 39, 39, 39, 39, 39, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 36, 36, 36, 36, 12, 18, 18, 18, 18, 12, 18, 18, 4, 18, 18, 17, 4, 6, 6, 6, 6, 6, 4, 12, 6, 12, 12, 12, 21, 21, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 17, 21, 12, 21, 12, 21, 0, 1, 0, 1, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 17, 21, 21, 21, 21, 21, 17, 21, 21, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 17, 17, 12, 12, 12, 12, 12, 12, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 18, 18, 17, 18, 12, 12, 12, 12, 12, 4, 4, 39, 39, 39, 39, 39, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 17, 17, 12, 12, 12, 12, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 36, 36, 36, 36, 36, 36, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 21, 21, 21, 12, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 1, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 17, 17, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 17, 17, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 17, 17, 5, 36, 17, 12, 17, 9, 36, 36, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 6, 6, 17, 17, 18, 12, 6, 6, 12, 21, 21, 21, 4, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 12, 39, 39, 39, 6, 6, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 39, 39, 39, 39, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 36, 36, 36, 36, 36, 36, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 39, 39, 12, 12, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 39, 39, 21, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 39, 39, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 17, 17, 12, 17, 17, 17, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 17, 17, 17, 17, 17, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 17, 17, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 21, 21, 21, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 21, 12, 12, 12, 12, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 18, 12, 39, 17, 17, 17, 17, 17, 17, 17, 4, 17, 17, 17, 20, 21, 21, 21, 21, 17, 4, 17, 17, 19, 29, 29, 12, 3, 3, 0, 3, 3, 3, 0, 3, 29, 29, 12, 12, 15, 15, 15, 17, 30, 30, 21, 21, 21, 21, 21, 4, 10, 10, 10, 10, 10, 10, 10, 10, 12, 3, 3, 29, 5, 5, 12, 12, 12, 12, 12, 12, 8, 0, 1, 5, 5, 5, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 17, 12, 17, 17, 17, 17, 12, 17, 17, 17, 22, 12, 12, 12, 12, 39, 39, 39, 39, 39, 21, 21, 21, 21, 21, 21, 12, 12, 39, 39, 29, 12, 12, 12, 12, 12, 12, 12, 12, 0, 1, 29, 12, 29, 29, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 0, 1, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 9, 9, 9, 9, 9, 9, 9, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 9, 9, 9, 9, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 10, 12, 29, 12, 12, 12, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 12, 9, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 12, 12, 12, 12, 12, 29, 12, 12, 29, 12, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 12, 12, 12, 12, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 29, 29, 12, 12, 12, 29, 29, 12, 12, 29, 12, 12, 12, 29, 12, 29, 9, 9, 12, 29, 12, 12, 12, 12, 29, 12, 12, 29, 29, 29, 29, 12, 12, 29, 12, 29, 12, 29, 29, 29, 29, 29, 29, 12, 29, 12, 12, 12, 12, 12, 29, 29, 29, 29, 12, 12, 12, 12, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 12, 12, 29, 12, 12, 12, 12, 12, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 12, 12, 29, 29, 29, 29, 12, 12, 29, 29, 12, 12, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 12, 12, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 12, 12, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 12, 12, 12, 12, 12, 12, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 12, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 12, 12, 12, 12, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 12, 12, 29, 29, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 12, 29, 29, 29, 29, 29, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 12, 12, 29, 29, 12, 12, 12, 12, 29, 29, 12, 12, 29, 29, 12, 12, 12, 12, 29, 29, 29, 12, 12, 29, 12, 12, 29, 29, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 12, 29, 29, 12, 12, 29, 12, 12, 12, 12, 29, 29, 12, 12, 12, 12, 14, 14, 29, 29, 14, 12, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 12, 12, 12, 12, 29, 12, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 12, 29, 29, 29, 12, 29, 14, 29, 29, 12, 29, 29, 12, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 29, 29, 29, 29, 14, 12, 14, 14, 14, 29, 14, 14, 29, 29, 29, 14, 14, 29, 29, 14, 29, 29, 14, 14, 14, 12, 29, 12, 12, 12, 12, 29, 29, 14, 29, 29, 29, 29, 29, 29, 14, 14, 14, 14, 14, 29, 14, 14, 14, 14, 29, 29, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 12, 12, 12, 3, 3, 3, 3, 12, 12, 12, 6, 6, 12, 12, 12, 12, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 1, 0, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 29, 29, 29, 29, 29, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 12, 12, 39, 39, 39, 39, 39, 6, 17, 17, 17, 12, 6, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 17, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 17, 17, 17, 17, 17, 17, 17, 17, 12, 17, 0, 17, 12, 12, 3, 3, 12, 12, 3, 3, 0, 1, 0, 1, 0, 1, 0, 1, 17, 17, 17, 17, 6, 12, 17, 17, 12, 17, 17, 12, 12, 12, 12, 12, 19, 19, 39, 39, 39, 39, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 1, 1, 14, 14, 5, 14, 14, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 14, 14, 0, 1, 0, 1, 0, 1, 0, 1, 5, 0, 1, 1, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 21, 21, 21, 21, 21, 21, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 5, 5, 14, 14, 14, 39, 32, 14, 32, 14, 32, 14, 32, 14, 32, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 32, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 32, 14, 32, 14, 32, 14, 14, 14, 14, 14, 14, 32, 14, 14, 14, 14, 14, 14, 32, 32, 39, 39, 21, 21, 5, 5, 5, 5, 14, 5, 32, 14, 32, 14, 32, 14, 32, 14, 32, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 32, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 32, 14, 32, 14, 32, 14, 14, 14, 14, 14, 14, 32, 14, 14, 14, 14, 14, 14, 32, 32, 14, 14, 14, 14, 5, 32, 5, 5, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 29, 29, 29, 29, 29, 29, 29, 29, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 5, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 17, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 17, 6, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 12, 17, 17, 17, 17, 17, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 12, 12, 12, 21, 12, 12, 12, 12, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 18, 18, 6, 6, 39, 39, 39, 39, 39, 39, 39, 39, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 39, 17, 17, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 39, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 17, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 39, 39, 39, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 17, 17, 17, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 21, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 12, 17, 17, 17, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 17, 17, 12, 12, 12, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 17, 21, 21, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 39, 39, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 39, 39, 39, 39, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 39, 39, 39, 39, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 13, 21, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 1, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 10, 12, 39, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 8, 1, 1, 8, 8, 6, 6, 0, 1, 15, 39, 39, 39, 39, 39, 39, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 39, 14, 14, 14, 14, 14, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 14, 14, 0, 1, 14, 14, 14, 14, 14, 14, 14, 1, 14, 1, 39, 5, 5, 6, 6, 14, 0, 1, 0, 1, 0, 1, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 9, 10, 14, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 22, 39, 6, 14, 14, 9, 10, 14, 14, 0, 1, 14, 14, 1, 14, 1, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 5, 5, 14, 14, 14, 6, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 1, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 1, 14, 0, 1, 1, 0, 1, 1, 5, 12, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 5, 5, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 10, 9, 14, 14, 14, 9, 9, 39, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 21, 21, 21, 31, 29, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 17, 17, 17, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 17, 17, 17, 17, 17, 17, 17, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 17, 17, 17, 17, 17, 17, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 17, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 17, 17, 17, 17, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 39, 39, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 17, 17, 17, 17, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 17, 17, 12, 17, 39, 39, 39, 39, 39, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 17, 17, 17, 17, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 1, 1, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 12, 12, 12, 0, 1, 0, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 1, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 12, 39, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 12, 12, 39, 39, 39, 39, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 14, 14, 14, 14, 14, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 14, 12, 14, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 14, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 39, 39, 39, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39], "highStart": 919552, "errorValue": 0 }
			//}, {}],
			  172: [function (localRequire, localModule, localExports) {
				// Generated by CoffeeScript 1.7.1
				(function () {
					var AI, AL, B2, BA, BB, BK, CB, CJ, CL, CM, CP, CR, EX, GL, H2, H3, HL, HY, ID, IN, IS, JL, JT, JV, LF, NL, NS, NU, OP, PO, PR, QU, RI, SA, SG, SP, SY, WJ, XX, ZW;

					localExports.OP = OP = 0;

					localExports.CL = CL = 1;

					localExports.CP = CP = 2;

					localExports.QU = QU = 3;

					localExports.GL = GL = 4;

					localExports.NS = NS = 5;

					localExports.EX = EX = 6;

					localExports.SY = SY = 7;

					localExports.IS = IS = 8;

					localExports.PR = PR = 9;

					localExports.PO = PO = 10;

					localExports.NU = NU = 11;

					localExports.AL = AL = 12;

					localExports.HL = HL = 13;

					localExports.ID = ID = 14;

					localExports.IN = IN = 15;

					localExports.HY = HY = 16;

					localExports.BA = BA = 17;

					localExports.BB = BB = 18;

					localExports.B2 = B2 = 19;

					localExports.ZW = ZW = 20;

					localExports.CM = CM = 21;

					localExports.WJ = WJ = 22;

					localExports.H2 = H2 = 23;

					localExports.H3 = H3 = 24;

					localExports.JL = JL = 25;

					localExports.JV = JV = 26;

					localExports.JT = JT = 27;

					localExports.RI = RI = 28;

					localExports.AI = AI = 29;

					localExports.BK = BK = 30;

					localExports.CB = CB = 31;

					localExports.CJ = CJ = 32;

					localExports.CR = CR = 33;

					localExports.LF = LF = 34;

					localExports.NL = NL = 35;

					localExports.SA = SA = 36;

					localExports.SG = SG = 37;

					localExports.SP = SP = 38;

					localExports.XX = XX = 39;

				}).call(this);

			}, {}], 173: [function (localRequire, localModule, localExports) {
				// Generated by CoffeeScript 1.7.1
				(function () {
					var AI, AL, BA, BK, CB, CI_BRK, CJ, CP_BRK, CR, DI_BRK, ID, IN_BRK, LF, LineBreaker, NL, NS, PR_BRK, SA, SG, SP, UnicodeTrie, WJ, XX, characterClasses, classTrie, pairTable, _ref, _ref1;

					UnicodeTrie = localRequire('unicode-trie');
					var Buffer = localRequire("buffer").Buffer;

					classTrie = new UnicodeTrie(new Buffer(" ", "base64"));
					 
					_ref = localRequire('./classes'), BK = _ref.BK, CR = _ref.CR, LF = _ref.LF, NL = _ref.NL, CB = _ref.CB, BA = _ref.BA, SP = _ref.SP, WJ = _ref.WJ, SP = _ref.SP, BK = _ref.BK, LF = _ref.LF, NL = _ref.NL, AI = _ref.AI, AL = _ref.AL, SA = _ref.SA, SG = _ref.SG, XX = _ref.XX, CJ = _ref.CJ, ID = _ref.ID, NS = _ref.NS, characterClasses = _ref.characterClasses;

					_ref1 = localRequire('./pairs'), DI_BRK = _ref1.DI_BRK, IN_BRK = _ref1.IN_BRK, CI_BRK = _ref1.CI_BRK, CP_BRK = _ref1.CP_BRK, PR_BRK = _ref1.PR_BRK, pairTable = _ref1.pairTable;

					LineBreaker = (function () {
						var Break, mapClass, mapFirst;

						function LineBreaker(string) {
							this.string = string;
							this.pos = 0;
							this.lastPos = 0;
							this.curClass = null;
							this.nextClass = null;
						}

						LineBreaker.prototype.nextCodePoint = function () {
							var code, next;
							code = this.string.charCodeAt(this.pos++);
							next = this.string.charCodeAt(this.pos);
							if ((0xd800 <= code && code <= 0xdbff) && (0xdc00 <= next && next <= 0xdfff)) {
								this.pos++;
								return ((code - 0xd800) * 0x400) + (next - 0xdc00) + 0x10000;
							}
							return code;
						};

						mapClass = function (c) {
							switch (c) {
								case AI:
									return AL;
								case SA:
								case SG:
								case XX:
									return AL;
								case CJ:
									return NS;
								default:
									return c;
							}
						};

						mapFirst = function (c) {
							switch (c) {
								case LF:
								case NL:
									return BK;
								case CB:
									return BA;
								case SP:
									return WJ;
								default:
									return c;
							}
						};

						LineBreaker.prototype.nextCharClass = function (first) {
							if (first == null) {
								first = false;
							}
							return mapClass(classTrie.get(this.nextCodePoint()));
						};

						Break = (function () {
							function Break(position, required) {
								this.position = position;
								this.required = required != null ? required : false;
							}

							return Break;

						})();

						LineBreaker.prototype.nextBreak = function () {
							var cur, lastClass, shouldBreak;
							if (this.curClass == null) {
								this.curClass = mapFirst(this.nextCharClass());
							}
							while (this.pos < this.string.length) {
								this.lastPos = this.pos;
								lastClass = this.nextClass;
								this.nextClass = this.nextCharClass();
								if (this.curClass === BK || (this.curClass === CR && this.nextClass !== LF)) {
									this.curClass = mapFirst(mapClass(this.nextClass));
									return new Break(this.lastPos, true);
								}
								cur = (function () {
									switch (this.nextClass) {
										case SP:
											return this.curClass;
										case BK:
										case LF:
										case NL:
											return BK;
										case CR:
											return CR;
										case CB:
											return BA;
									}
								}).call(this);
								if (cur != null) {
									this.curClass = cur;
									if (this.nextClass === CB) {
										return new Break(this.lastPos);
									}
									continue;
								}
								shouldBreak = false;
								switch (pairTable[this.curClass][this.nextClass]) {
									case DI_BRK:
										shouldBreak = true;
										break;
									case IN_BRK:
										shouldBreak = lastClass === SP;
										break;
									case CI_BRK:
										shouldBreak = lastClass === SP;
										if (!shouldBreak) {
											continue;
										}
										break;
									case CP_BRK:
										if (lastClass !== SP) {
											continue;
										}
								}
								this.curClass = this.nextClass;
								if (shouldBreak) {
									return new Break(this.lastPos);
								}
							}
							if (this.pos >= this.string.length) {
								if (this.lastPos < this.string.length) {
									this.lastPos = this.string.length;
									return new Break(this.string.length);
								} else {
									return null;
								}
							}
						};

						return LineBreaker;

					})();

					localModule.localExports = LineBreaker;

				}).call(this);

			}, { "buffer": 60, "./classes": 172, "./pairs": 174, "unicode-trie": 221 }], 174: [function (localRequire, localModule, localExports) {
				// Generated by CoffeeScript 1.7.1
				(function () {
					var CI_BRK, CP_BRK, DI_BRK, IN_BRK, PR_BRK;

					localExports.DI_BRK = DI_BRK = 0;

					localExports.IN_BRK = IN_BRK = 1;

					localExports.CI_BRK = CI_BRK = 2;

					localExports.CP_BRK = CP_BRK = 3;

					localExports.PR_BRK = PR_BRK = 4;

					localExports.pairTable = [[PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, CP_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, DI_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, DI_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, PR_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK]];

				}).call(this);

			}, {}], 175: [function (localRequire, localModule, localExports) {
				'use strict';


				var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
					(typeof Uint16Array !== 'undefined') &&
					(typeof Int32Array !== 'undefined');


				localExports.assign = function (obj /*from1, from2, from3, ...*/) {
					var sources = Array.prototype.slice.call(arguments, 1);
					while (sources.length) {
						var source = sources.shift();
						if (!source) { continue; }

						if (typeof source !== 'object') {
							throw new TypeError(source + 'must be non-object');
						}

						for (var p in source) {
							if (source.hasOwnProperty(p)) {
								obj[p] = source[p];
							}
						}
					}

					return obj;
				};


				// reduce buffer size, avoiding mem copy
				localExports.shrinkBuf = function (buf, size) {
					if (buf.length === size) { return buf; }
					if (buf.subarray) { return buf.subarray(0, size); }
					buf.length = size;
					return buf;
				};


				var fnTyped = {
					arraySet: function (dest, src, src_offs, len, dest_offs) {
						if (src.subarray && dest.subarray) {
							dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
							return;
						}
						// Fallback to ordinary array
						for (var i = 0; i < len; i++) {
							dest[dest_offs + i] = src[src_offs + i];
						}
					},
					// Join array of chunks to single array.
					flattenChunks: function (chunks) {
						var i, l, len, pos, chunk, result;

						// calculate data length
						len = 0;
						for (i = 0, l = chunks.length; i < l; i++) {
							len += chunks[i].length;
						}

						// join chunks
						result = new Uint8Array(len);
						pos = 0;
						for (i = 0, l = chunks.length; i < l; i++) {
							chunk = chunks[i];
							result.set(chunk, pos);
							pos += chunk.length;
						}

						return result;
					}
				};

				var fnUntyped = {
					arraySet: function (dest, src, src_offs, len, dest_offs) {
						for (var i = 0; i < len; i++) {
							dest[dest_offs + i] = src[src_offs + i];
						}
					},
					// Join array of chunks to single array.
					flattenChunks: function (chunks) {
						return [].concat.apply([], chunks);
					}
				};


				// Enable/Disable typed arrays use, for testing
				//
				localExports.setTyped = function (on) {
					if (on) {
						localExports.Buf8 = Uint8Array;
						localExports.Buf16 = Uint16Array;
						localExports.Buf32 = Int32Array;
						localExports.assign(localExports, fnTyped);
					} else {
						localExports.Buf8 = Array;
						localExports.Buf16 = Array;
						localExports.Buf32 = Array;
						localExports.assign(localExports, fnUntyped);
					}
				};

				localExports.setTyped(TYPED_OK);

			}, {}], 176: [function (localRequire, localModule, localExports) {
				'use strict';

				// Note: adler32 takes 12% for level 0 and 2% for level 6.
				// It doesn't worth to make additional optimizationa as in original.
				// Small size is preferable.

				function adler32(adler, buf, len, pos) {
					var s1 = (adler & 0xffff) | 0,
						s2 = ((adler >>> 16) & 0xffff) | 0,
						n = 0;

					while (len !== 0) {
						// Set limit ~ twice less than 5552, to keep
						// s2 in 31-bits, because we force signed ints.
						// in other case %= will fail.
						n = len > 2000 ? 2000 : len;
						len -= n;

						do {
							s1 = (s1 + buf[pos++]) | 0;
							s2 = (s2 + s1) | 0;
						} while (--n);

						s1 %= 65521;
						s2 %= 65521;
					}

					return (s1 | (s2 << 16)) | 0;
				}


				localModule.localExports = adler32;

			}, {}], 177: [function (localRequire, localModule, localExports) {
				'use strict';


				localModule.localExports = {

					/* Allowed flush values; see deflate() and inflate() below for details */
					Z_NO_FLUSH: 0,
					Z_PARTIAL_FLUSH: 1,
					Z_SYNC_FLUSH: 2,
					Z_FULL_FLUSH: 3,
					Z_FINISH: 4,
					Z_BLOCK: 5,
					Z_TREES: 6,

					/* Return codes for the compression/decompression functions. Negative values
					* are errors, positive values are used for special but normal events.
					*/
					Z_OK: 0,
					Z_STREAM_END: 1,
					Z_NEED_DICT: 2,
					Z_ERRNO: -1,
					Z_STREAM_ERROR: -2,
					Z_DATA_ERROR: -3,
					//Z_MEM_ERROR:     -4,
					Z_BUF_ERROR: -5,
					//Z_VERSION_ERROR: -6,

					/* compression levels */
					Z_NO_COMPRESSION: 0,
					Z_BEST_SPEED: 1,
					Z_BEST_COMPRESSION: 9,
					Z_DEFAULT_COMPRESSION: -1,


					Z_FILTERED: 1,
					Z_HUFFMAN_ONLY: 2,
					Z_RLE: 3,
					Z_FIXED: 4,
					Z_DEFAULT_STRATEGY: 0,

					/* Possible values of the data_type field (though see inflate()) */
					Z_BINARY: 0,
					Z_TEXT: 1,
					//Z_ASCII:                1, // = Z_TEXT (deprecated)
					Z_UNKNOWN: 2,

					/* The deflate compression method */
					Z_DEFLATED: 8
					//Z_NULL:                 null // Use -1 or null inline, depending on var type
				};

			}, {}], 178: [function (localRequire, localModule, localExports) {
				'use strict';

				// Note: we can't get significant speed boost here.
				// So write code to minimize size - no pregenerated tables
				// and array tools dependencies.


				// Use ordinary array, since untyped makes no boost here
				function makeTable() {
					var c, table = [];

					for (var n = 0; n < 256; n++) {
						c = n;
						for (var k = 0; k < 8; k++) {
							c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
						}
						table[n] = c;
					}

					return table;
				}

				// Create table on load. Just 255 signed longs. Not a problem.
				var crcTable = makeTable();


				function crc32(crc, buf, len, pos) {
					var t = crcTable,
						end = pos + len;

					crc ^= -1;

					for (var i = pos; i < end; i++) {
						crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
					}

					return (crc ^ (-1)); // >>> 0;
				}


				localModule.localExports = crc32;

			}, {}], 179: [function (localRequire, localModule, localExports) {
				'use strict';

				var utils = localRequire('../utils/common');
				var trees = localRequire('./trees');
				var adler32 = localRequire('./adler32');
				var crc32 = localRequire('./crc32');
				var msg = localRequire('./messages');

				/* Public constants ==========================================================*/
				/* ===========================================================================*/


				/* Allowed flush values; see deflate() and inflate() below for details */
				var Z_NO_FLUSH = 0;
				var Z_PARTIAL_FLUSH = 1;
				//var Z_SYNC_FLUSH    = 2;
				var Z_FULL_FLUSH = 3;
				var Z_FINISH = 4;
				var Z_BLOCK = 5;
				//var Z_TREES         = 6;


				/* Return codes for the compression/decompression functions. Negative values
				 * are errors, positive values are used for special but normal events.
				 */
				var Z_OK = 0;
				var Z_STREAM_END = 1;
				//var Z_NEED_DICT     = 2;
				//var Z_ERRNO         = -1;
				var Z_STREAM_ERROR = -2;
				var Z_DATA_ERROR = -3;
				//var Z_MEM_ERROR     = -4;
				var Z_BUF_ERROR = -5;
				//var Z_VERSION_ERROR = -6;


				/* compression levels */
				//var Z_NO_COMPRESSION      = 0;
				//var Z_BEST_SPEED          = 1;
				//var Z_BEST_COMPRESSION    = 9;
				var Z_DEFAULT_COMPRESSION = -1;


				var Z_FILTERED = 1;
				var Z_HUFFMAN_ONLY = 2;
				var Z_RLE = 3;
				var Z_FIXED = 4;
				var Z_DEFAULT_STRATEGY = 0;

				/* Possible values of the data_type field (though see inflate()) */
				//var Z_BINARY              = 0;
				//var Z_TEXT                = 1;
				//var Z_ASCII               = 1; // = Z_TEXT
				var Z_UNKNOWN = 2;


				/* The deflate compression method */
				var Z_DEFLATED = 8;

				/*============================================================================*/


				var MAX_MEM_LEVEL = 9;
				/* Maximum value for memLevel in deflateInit2 */
				var MAX_WBITS = 15;
				/* 32K LZ77 window */
				var DEF_MEM_LEVEL = 8;


				var LENGTH_CODES = 29;
				/* number of length codes, not counting the special END_BLOCK code */
				var LITERALS = 256;
				/* number of literal bytes 0..255 */
				var L_CODES = LITERALS + 1 + LENGTH_CODES;
				/* number of Literal or Length codes, including the END_BLOCK code */
				var D_CODES = 30;
				/* number of distance codes */
				var BL_CODES = 19;
				/* number of codes used to transfer the bit lengths */
				var HEAP_SIZE = 2 * L_CODES + 1;
				/* maximum heap size */
				var MAX_BITS = 15;
				/* All codes must not exceed MAX_BITS bits */

				var MIN_MATCH = 3;
				var MAX_MATCH = 258;
				var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);

				var PRESET_DICT = 0x20;

				var INIT_STATE = 42;
				var EXTRA_STATE = 69;
				var NAME_STATE = 73;
				var COMMENT_STATE = 91;
				var HCRC_STATE = 103;
				var BUSY_STATE = 113;
				var FINISH_STATE = 666;

				var BS_NEED_MORE = 1; /* block not completed, need more input or more output */
				var BS_BLOCK_DONE = 2; /* block flush performed */
				var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
				var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */

				var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.

				function err(strm, errorCode) {
					strm.msg = msg[errorCode];
					return errorCode;
				}

				function rank(f) {
					return ((f) << 1) - ((f) > 4 ? 9 : 0);
				}

				function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }


				/* =========================================================================
				 * Flush as much pending output as possible. All deflate() output goes
				 * through this function so some applications may wish to modify it
				 * to avoid allocating a large strm->output buffer and copying into it.
				 * (See also read_buf()).
				 */
				function flush_pending(strm) {
					var s = strm.state;

					//_tr_flush_bits(s);
					var len = s.pending;
					if (len > strm.avail_out) {
						len = strm.avail_out;
					}
					if (len === 0) { return; }

					utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
					strm.next_out += len;
					s.pending_out += len;
					strm.total_out += len;
					strm.avail_out -= len;
					s.pending -= len;
					if (s.pending === 0) {
						s.pending_out = 0;
					}
				}


				function flush_block_only(s, last) {
					trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
					s.block_start = s.strstart;
					flush_pending(s.strm);
				}


				function put_byte(s, b) {
					s.pending_buf[s.pending++] = b;
				}


				/* =========================================================================
				 * Put a short in the pending buffer. The 16-bit value is put in MSB order.
				 * IN assertion: the stream state is correct and there is enough room in
				 * pending_buf.
				 */
				function putShortMSB(s, b) {
					//  put_byte(s, (Byte)(b >> 8));
					//  put_byte(s, (Byte)(b & 0xff));
					s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
					s.pending_buf[s.pending++] = b & 0xff;
				}


				/* ===========================================================================
				 * Read a new buffer from the current input stream, update the adler32
				 * and total number of bytes read.  All deflate() input goes through
				 * this function so some applications may wish to modify it to avoid
				 * allocating a large strm->input buffer and copying from it.
				 * (See also flush_pending()).
				 */
				function read_buf(strm, buf, start, size) {
					var len = strm.avail_in;

					if (len > size) { len = size; }
					if (len === 0) { return 0; }

					strm.avail_in -= len;

					// zmemcpy(buf, strm->next_in, len);
					utils.arraySet(buf, strm.input, strm.next_in, len, start);
					if (strm.state.wrap === 1) {
						strm.adler = adler32(strm.adler, buf, len, start);
					}

					else if (strm.state.wrap === 2) {
						strm.adler = crc32(strm.adler, buf, len, start);
					}

					strm.next_in += len;
					strm.total_in += len;

					return len;
				}


				/* ===========================================================================
				 * Set match_start to the longest match starting at the given string and
				 * return its length. Matches shorter or equal to prev_length are discarded,
				 * in which case the result is equal to prev_length and match_start is
				 * garbage.
				 * IN assertions: cur_match is the head of the hash chain for the current
				 *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
				 * OUT assertion: the match length is not greater than s->lookahead.
				 */
				function longest_match(s, cur_match) {
					var chain_length = s.max_chain_length;      /* max hash chain length */
					var scan = s.strstart; /* current string */
					var match;                       /* matched string */
					var len;                           /* length of current match */
					var best_len = s.prev_length;              /* best match length so far */
					var nice_match = s.nice_match;             /* stop if match long enough */
					var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
						s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;

					var _win = s.window; // shortcut

					var wmask = s.w_mask;
					var prev = s.prev;

					/* Stop when cur_match becomes <= limit. To simplify the code,
					 * we prevent matches with the string of window index 0.
					 */

					var strend = s.strstart + MAX_MATCH;
					var scan_end1 = _win[scan + best_len - 1];
					var scan_end = _win[scan + best_len];

					/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
					 * It is easy to get rid of this optimization if necessary.
					 */
					// Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");

					/* Do not waste too much time if we already have a good match: */
					if (s.prev_length >= s.good_match) {
						chain_length >>= 2;
					}
					/* Do not look for matches beyond the end of the input. This is necessary
					 * to make deflate deterministic.
					 */
					if (nice_match > s.lookahead) { nice_match = s.lookahead; }

					// Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");

					do {
						// Assert(cur_match < s->strstart, "no future");
						match = cur_match;

						/* Skip to next match if the match length cannot increase
						 * or if the match length is less than 2.  Note that the checks below
						 * for insufficient lookahead only occur occasionally for performance
						 * reasons.  Therefore uninitialized memory will be accessed, and
						 * conditional jumps will be made that depend on those values.
						 * However the length of the match is limited to the lookahead, so
						 * the output of deflate is not affected by the uninitialized values.
						 */

						if (_win[match + best_len] !== scan_end ||
							_win[match + best_len - 1] !== scan_end1 ||
							_win[match] !== _win[scan] ||
							_win[++match] !== _win[scan + 1]) {
							continue;
						}

						/* The check at best_len-1 can be removed because it will be made
						 * again later. (This heuristic is not always a win.)
						 * It is not necessary to compare scan[2] and match[2] since they
						 * are always equal when the other bytes match, given that
						 * the hash keys are equal and that HASH_BITS >= 8.
						 */
						scan += 2;
						match++;
						// Assert(*scan == *match, "match[2]?");

						/* We check for insufficient lookahead only every 8th comparison;
						 * the 256th check will be made at strstart+258.
						 */
						do {
							/*jshint noempty:false*/
						} while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
						_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
						_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
						_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
							scan < strend);

						// Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");

						len = MAX_MATCH - (strend - scan);
						scan = strend - MAX_MATCH;

						if (len > best_len) {
							s.match_start = cur_match;
							best_len = len;
							if (len >= nice_match) {
								break;
							}
							scan_end1 = _win[scan + best_len - 1];
							scan_end = _win[scan + best_len];
						}
					} while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);

					if (best_len <= s.lookahead) {
						return best_len;
					}
					return s.lookahead;
				}


				/* ===========================================================================
				 * Fill the window when the lookahead becomes insufficient.
				 * Updates strstart and lookahead.
				 *
				 * IN assertion: lookahead < MIN_LOOKAHEAD
				 * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
				 *    At least one byte has been read, or avail_in == 0; reads are
				 *    performed for at least two bytes (required for the zip translate_eol
				 *    option -- not supported here).
				 */
				function fill_window(s) {
					var _w_size = s.w_size;
					var p, n, m, more, str;

					//Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");

					do {
						more = s.window_size - s.lookahead - s.strstart;

						// JS ints have 32 bit, block below not needed
						/* Deal with !@#$% 64K limit: */
						//if (sizeof(int) <= 2) {
						//    if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
						//        more = wsize;
						//
						//  } else if (more == (unsigned)(-1)) {
						//        /* Very unlikely, but possible on 16 bit machine if
						//         * strstart == 0 && lookahead == 1 (input done a byte at time)
						//         */
						//        more--;
						//    }
						//}


						/* If the window is almost full and there is insufficient lookahead,
						 * move the upper half to the lower one to make room in the upper half.
						 */
						if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {

							utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
							s.match_start -= _w_size;
							s.strstart -= _w_size;
							/* we now have strstart >= MAX_DIST */
							s.block_start -= _w_size;

							/* Slide the hash table (could be avoided with 32 bit values
							 at the expense of memory usage). We slide even when level == 0
							 to keep the hash table consistent if we switch back to level > 0
							 later. (Using level 0 permanently is not an optimal usage of
							 zlib, so we don't care about this pathological case.)
							 */

							n = s.hash_size;
							p = n;
							do {
								m = s.head[--p];
								s.head[p] = (m >= _w_size ? m - _w_size : 0);
							} while (--n);

							n = _w_size;
							p = n;
							do {
								m = s.prev[--p];
								s.prev[p] = (m >= _w_size ? m - _w_size : 0);
								/* If n is not on any hash chain, prev[n] is garbage but
								 * its value will never be used.
								 */
							} while (--n);

							more += _w_size;
						}
						if (s.strm.avail_in === 0) {
							break;
						}

						/* If there was no sliding:
						 *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
						 *    more == window_size - lookahead - strstart
						 * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
						 * => more >= window_size - 2*WSIZE + 2
						 * In the BIG_MEM or MMAP case (not yet supported),
						 *   window_size == input_size + MIN_LOOKAHEAD  &&
						 *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
						 * Otherwise, window_size == 2*WSIZE so more >= 2.
						 * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
						 */
						//Assert(more >= 2, "more < 2");
						n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
						s.lookahead += n;

						/* Initialize the hash value now that we have some input: */
						if (s.lookahead + s.insert >= MIN_MATCH) {
							str = s.strstart - s.insert;
							s.ins_h = s.window[str];

							/* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
							s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
							//#if MIN_MATCH != 3
							//        Call update_hash() MIN_MATCH-3 more times
							//#endif
							while (s.insert) {
								/* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
								s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;

								s.prev[str & s.w_mask] = s.head[s.ins_h];
								s.head[s.ins_h] = str;
								str++;
								s.insert--;
								if (s.lookahead + s.insert < MIN_MATCH) {
									break;
								}
							}
						}
						/* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
						 * but this is not important since only literal bytes will be emitted.
						 */

					} while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);

					/* If the WIN_INIT bytes after the end of the current data have never been
					 * written, then zero those bytes in order to avoid memory check reports of
					 * the use of uninitialized (or uninitialised as Julian writes) bytes by
					 * the longest match routines.  Update the high water mark for the next
					 * time through here.  WIN_INIT is set to MAX_MATCH since the longest match
					 * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
					 */
					//  if (s.high_water < s.window_size) {
					//    var curr = s.strstart + s.lookahead;
					//    var init = 0;
					//
					//    if (s.high_water < curr) {
					//      /* Previous high water mark below current data -- zero WIN_INIT
					//       * bytes or up to end of window, whichever is less.
					//       */
					//      init = s.window_size - curr;
					//      if (init > WIN_INIT)
					//        init = WIN_INIT;
					//      zmemzero(s->window + curr, (unsigned)init);
					//      s->high_water = curr + init;
					//    }
					//    else if (s->high_water < (ulg)curr + WIN_INIT) {
					//      /* High water mark at or above current data, but below current data
					//       * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
					//       * to end of window, whichever is less.
					//       */
					//      init = (ulg)curr + WIN_INIT - s->high_water;
					//      if (init > s->window_size - s->high_water)
					//        init = s->window_size - s->high_water;
					//      zmemzero(s->window + s->high_water, (unsigned)init);
					//      s->high_water += init;
					//    }
					//  }
					//
					//  Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
					//    "not enough room for search");
				}

				/* ===========================================================================
				 * Copy without compression as much as possible from the input stream, return
				 * the current block state.
				 * This function does not insert new strings in the dictionary since
				 * uncompressible data is probably not useful. This function is used
				 * only for the level=0 compression option.
				 * NOTE: this function should be optimized to avoid extra copying from
				 * window to pending_buf.
				 */
				function deflate_stored(s, flush) {
					/* Stored blocks are limited to 0xffff bytes, pending_buf is limited
					 * to pending_buf_size, and each stored block has a 5 byte header:
					 */
					var max_block_size = 0xffff;

					if (max_block_size > s.pending_buf_size - 5) {
						max_block_size = s.pending_buf_size - 5;
					}

					/* Copy as much as possible from input to output: */
					for (; ;) {
						/* Fill the window as much as possible: */
						if (s.lookahead <= 1) {

							//Assert(s->strstart < s->w_size+MAX_DIST(s) ||
							//  s->block_start >= (long)s->w_size, "slide too late");
							//      if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
							//        s.block_start >= s.w_size)) {
							//        throw  new Error("slide too late");
							//      }

							fill_window(s);
							if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
								return BS_NEED_MORE;
							}

							if (s.lookahead === 0) {
								break;
							}
							/* flush the current block */
						}
						//Assert(s->block_start >= 0L, "block gone");
						//    if (s.block_start < 0) throw new Error("block gone");

						s.strstart += s.lookahead;
						s.lookahead = 0;

						/* Emit a stored block if pending_buf will be full: */
						var max_start = s.block_start + max_block_size;

						if (s.strstart === 0 || s.strstart >= max_start) {
							/* strstart == 0 is possible when wraparound on 16-bit machine */
							s.lookahead = s.strstart - max_start;
							s.strstart = max_start;
							/*** FLUSH_BLOCK(s, 0); ***/
							flush_block_only(s, false);
							if (s.strm.avail_out === 0) {
								return BS_NEED_MORE;
							}
							/***/


						}
						/* Flush if we may have to slide, otherwise block_start may become
						 * negative and the data will be gone:
						 */
						if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
							/*** FLUSH_BLOCK(s, 0); ***/
							flush_block_only(s, false);
							if (s.strm.avail_out === 0) {
								return BS_NEED_MORE;
							}
							/***/
						}
					}

					s.insert = 0;

					if (flush === Z_FINISH) {
						/*** FLUSH_BLOCK(s, 1); ***/
						flush_block_only(s, true);
						if (s.strm.avail_out === 0) {
							return BS_FINISH_STARTED;
						}
						/***/
						return BS_FINISH_DONE;
					}

					if (s.strstart > s.block_start) {
						/*** FLUSH_BLOCK(s, 0); ***/
						flush_block_only(s, false);
						if (s.strm.avail_out === 0) {
							return BS_NEED_MORE;
						}
						/***/
					}

					return BS_NEED_MORE;
				}

				/* ===========================================================================
				 * Compress as much as possible from the input stream, return the current
				 * block state.
				 * This function does not perform lazy evaluation of matches and inserts
				 * new strings in the dictionary only for unmatched strings or for short
				 * matches. It is used only for the fast compression options.
				 */
				function deflate_fast(s, flush) {
					var hash_head;        /* head of the hash chain */
					var bflush;           /* set if current block must be flushed */

					for (; ;) {
						/* Make sure that we always have enough lookahead, except
						 * at the end of the input file. We need MAX_MATCH bytes
						 * for the next match, plus MIN_MATCH bytes to insert the
						 * string following the next match.
						 */
						if (s.lookahead < MIN_LOOKAHEAD) {
							fill_window(s);
							if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
								return BS_NEED_MORE;
							}
							if (s.lookahead === 0) {
								break; /* flush the current block */
							}
						}

						/* Insert the string window[strstart .. strstart+2] in the
						 * dictionary, and set hash_head to the head of the hash chain:
						 */
						hash_head = 0/*NIL*/;
						if (s.lookahead >= MIN_MATCH) {
							/*** INSERT_STRING(s, s.strstart, hash_head); ***/
							s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
							hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
							s.head[s.ins_h] = s.strstart;
							/***/
						}

						/* Find the longest match, discarding those <= prev_length.
						 * At this point we have always match_length < MIN_MATCH
						 */
						if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
							/* To simplify the code, we prevent matches with the string
							 * of window index 0 (in particular we have to avoid a match
							 * of the string with itself at the start of the input file).
							 */
							s.match_length = longest_match(s, hash_head);
							/* longest_match() sets match_start */
						}
						if (s.match_length >= MIN_MATCH) {
							// check_match(s, s.strstart, s.match_start, s.match_length); // for debug only

							/*** _tr_tally_dist(s, s.strstart - s.match_start,
										   s.match_length - MIN_MATCH, bflush); ***/
							bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);

							s.lookahead -= s.match_length;

							/* Insert new strings in the hash table only if the match length
							 * is not too large. This saves time but degrades compression.
							 */
							if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
								s.match_length--; /* string at strstart already in table */
								do {
									s.strstart++;
									/*** INSERT_STRING(s, s.strstart, hash_head); ***/
									s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
									hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
									s.head[s.ins_h] = s.strstart;
									/***/
									/* strstart never exceeds WSIZE-MAX_MATCH, so there are
									 * always MIN_MATCH bytes ahead.
									 */
								} while (--s.match_length !== 0);
								s.strstart++;
							} else {
								s.strstart += s.match_length;
								s.match_length = 0;
								s.ins_h = s.window[s.strstart];
								/* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
								s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;

								//#if MIN_MATCH != 3
								//                Call UPDATE_HASH() MIN_MATCH-3 more times
								//#endif
								/* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
								 * matter since it will be recomputed at next deflate call.
								 */
							}
						} else {
							/* No match, output a literal byte */
							//Tracevv((stderr,"%c", s.window[s.strstart]));
							/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
							bflush = trees._tr_tally(s, 0, s.window[s.strstart]);

							s.lookahead--;
							s.strstart++;
						}
						if (bflush) {
							/*** FLUSH_BLOCK(s, 0); ***/
							flush_block_only(s, false);
							if (s.strm.avail_out === 0) {
								return BS_NEED_MORE;
							}
							/***/
						}
					}
					s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
					if (flush === Z_FINISH) {
						/*** FLUSH_BLOCK(s, 1); ***/
						flush_block_only(s, true);
						if (s.strm.avail_out === 0) {
							return BS_FINISH_STARTED;
						}
						/***/
						return BS_FINISH_DONE;
					}
					if (s.last_lit) {
						/*** FLUSH_BLOCK(s, 0); ***/
						flush_block_only(s, false);
						if (s.strm.avail_out === 0) {
							return BS_NEED_MORE;
						}
						/***/
					}
					return BS_BLOCK_DONE;
				}

				/* ===========================================================================
				 * Same as above, but achieves better compression. We use a lazy
				 * evaluation for matches: a match is finally adopted only if there is
				 * no better match at the next window position.
				 */
				function deflate_slow(s, flush) {
					var hash_head;          /* head of hash chain */
					var bflush;              /* set if current block must be flushed */

					var max_insert;

					/* Process the input block. */
					for (; ;) {
						/* Make sure that we always have enough lookahead, except
						 * at the end of the input file. We need MAX_MATCH bytes
						 * for the next match, plus MIN_MATCH bytes to insert the
						 * string following the next match.
						 */
						if (s.lookahead < MIN_LOOKAHEAD) {
							fill_window(s);
							if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
								return BS_NEED_MORE;
							}
							if (s.lookahead === 0) { break; } /* flush the current block */
						}

						/* Insert the string window[strstart .. strstart+2] in the
						 * dictionary, and set hash_head to the head of the hash chain:
						 */
						hash_head = 0/*NIL*/;
						if (s.lookahead >= MIN_MATCH) {
							/*** INSERT_STRING(s, s.strstart, hash_head); ***/
							s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
							hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
							s.head[s.ins_h] = s.strstart;
							/***/
						}

						/* Find the longest match, discarding those <= prev_length.
						 */
						s.prev_length = s.match_length;
						s.prev_match = s.match_start;
						s.match_length = MIN_MATCH - 1;

						if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
							s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
							/* To simplify the code, we prevent matches with the string
							 * of window index 0 (in particular we have to avoid a match
							 * of the string with itself at the start of the input file).
							 */
							s.match_length = longest_match(s, hash_head);
							/* longest_match() sets match_start */

							if (s.match_length <= 5 &&
								(s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {

								/* If prev_match is also MIN_MATCH, match_start is garbage
								 * but we will ignore the current match anyway.
								 */
								s.match_length = MIN_MATCH - 1;
							}
						}
						/* If there was a match at the previous step and the current
						 * match is not better, output the previous match:
						 */
						if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
							max_insert = s.strstart + s.lookahead - MIN_MATCH;
							/* Do not insert strings in hash table beyond this. */

							//check_match(s, s.strstart-1, s.prev_match, s.prev_length);

							/***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
										   s.prev_length - MIN_MATCH, bflush);***/
							bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
							/* Insert in hash table all strings up to the end of the match.
							 * strstart-1 and strstart are already inserted. If there is not
							 * enough lookahead, the last two strings are not inserted in
							 * the hash table.
							 */
							s.lookahead -= s.prev_length - 1;
							s.prev_length -= 2;
							do {
								if (++s.strstart <= max_insert) {
									/*** INSERT_STRING(s, s.strstart, hash_head); ***/
									s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
									hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
									s.head[s.ins_h] = s.strstart;
									/***/
								}
							} while (--s.prev_length !== 0);
							s.match_available = 0;
							s.match_length = MIN_MATCH - 1;
							s.strstart++;

							if (bflush) {
								/*** FLUSH_BLOCK(s, 0); ***/
								flush_block_only(s, false);
								if (s.strm.avail_out === 0) {
									return BS_NEED_MORE;
								}
								/***/
							}

						} else if (s.match_available) {
							/* If there was no match at the previous position, output a
							 * single literal. If there was a match but the current match
							 * is longer, truncate the previous match to a single literal.
							 */
							//Tracevv((stderr,"%c", s->window[s->strstart-1]));
							/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
							bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);

							if (bflush) {
								/*** FLUSH_BLOCK_ONLY(s, 0) ***/
								flush_block_only(s, false);
								/***/
							}
							s.strstart++;
							s.lookahead--;
							if (s.strm.avail_out === 0) {
								return BS_NEED_MORE;
							}
						} else {
							/* There is no previous match to compare with, wait for
							 * the next step to decide.
							 */
							s.match_available = 1;
							s.strstart++;
							s.lookahead--;
						}
					}
					//Assert (flush != Z_NO_FLUSH, "no flush?");
					if (s.match_available) {
						//Tracevv((stderr,"%c", s->window[s->strstart-1]));
						/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
						bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);

						s.match_available = 0;
					}
					s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
					if (flush === Z_FINISH) {
						/*** FLUSH_BLOCK(s, 1); ***/
						flush_block_only(s, true);
						if (s.strm.avail_out === 0) {
							return BS_FINISH_STARTED;
						}
						/***/
						return BS_FINISH_DONE;
					}
					if (s.last_lit) {
						/*** FLUSH_BLOCK(s, 0); ***/
						flush_block_only(s, false);
						if (s.strm.avail_out === 0) {
							return BS_NEED_MORE;
						}
						/***/
					}

					return BS_BLOCK_DONE;
				}


				/* ===========================================================================
				 * For Z_RLE, simply look for runs of bytes, generate matches only of distance
				 * one.  Do not maintain a hash table.  (It will be regenerated if this run of
				 * deflate switches away from Z_RLE.)
				 */
				function deflate_rle(s, flush) {
					var bflush;            /* set if current block must be flushed */
					var prev;              /* byte at distance one to match */
					var scan, strend;      /* scan goes up to strend for length of run */

					var _win = s.window;

					for (; ;) {
						/* Make sure that we always have enough lookahead, except
						 * at the end of the input file. We need MAX_MATCH bytes
						 * for the longest run, plus one for the unrolled loop.
						 */
						if (s.lookahead <= MAX_MATCH) {
							fill_window(s);
							if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
								return BS_NEED_MORE;
							}
							if (s.lookahead === 0) { break; } /* flush the current block */
						}

						/* See how many times the previous byte repeats */
						s.match_length = 0;
						if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
							scan = s.strstart - 1;
							prev = _win[scan];
							if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
								strend = s.strstart + MAX_MATCH;
								do {
									/*jshint noempty:false*/
								} while (prev === _win[++scan] && prev === _win[++scan] &&
								prev === _win[++scan] && prev === _win[++scan] &&
								prev === _win[++scan] && prev === _win[++scan] &&
								prev === _win[++scan] && prev === _win[++scan] &&
									scan < strend);
								s.match_length = MAX_MATCH - (strend - scan);
								if (s.match_length > s.lookahead) {
									s.match_length = s.lookahead;
								}
							}
							//Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
						}

						/* Emit match if have run of MIN_MATCH or longer, else emit literal */
						if (s.match_length >= MIN_MATCH) {
							//check_match(s, s.strstart, s.strstart - 1, s.match_length);

							/*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
							bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);

							s.lookahead -= s.match_length;
							s.strstart += s.match_length;
							s.match_length = 0;
						} else {
							/* No match, output a literal byte */
							//Tracevv((stderr,"%c", s->window[s->strstart]));
							/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
							bflush = trees._tr_tally(s, 0, s.window[s.strstart]);

							s.lookahead--;
							s.strstart++;
						}
						if (bflush) {
							/*** FLUSH_BLOCK(s, 0); ***/
							flush_block_only(s, false);
							if (s.strm.avail_out === 0) {
								return BS_NEED_MORE;
							}
							/***/
						}
					}
					s.insert = 0;
					if (flush === Z_FINISH) {
						/*** FLUSH_BLOCK(s, 1); ***/
						flush_block_only(s, true);
						if (s.strm.avail_out === 0) {
							return BS_FINISH_STARTED;
						}
						/***/
						return BS_FINISH_DONE;
					}
					if (s.last_lit) {
						/*** FLUSH_BLOCK(s, 0); ***/
						flush_block_only(s, false);
						if (s.strm.avail_out === 0) {
							return BS_NEED_MORE;
						}
						/***/
					}
					return BS_BLOCK_DONE;
				}

				/* ===========================================================================
				 * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.
				 * (It will be regenerated if this run of deflate switches away from Huffman.)
				 */
				function deflate_huff(s, flush) {
					var bflush;             /* set if current block must be flushed */

					for (; ;) {
						/* Make sure that we have a literal to write. */
						if (s.lookahead === 0) {
							fill_window(s);
							if (s.lookahead === 0) {
								if (flush === Z_NO_FLUSH) {
									return BS_NEED_MORE;
								}
								break;      /* flush the current block */
							}
						}

						/* Output a literal byte */
						s.match_length = 0;
						//Tracevv((stderr,"%c", s->window[s->strstart]));
						/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
						bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
						s.lookahead--;
						s.strstart++;
						if (bflush) {
							/*** FLUSH_BLOCK(s, 0); ***/
							flush_block_only(s, false);
							if (s.strm.avail_out === 0) {
								return BS_NEED_MORE;
							}
							/***/
						}
					}
					s.insert = 0;
					if (flush === Z_FINISH) {
						/*** FLUSH_BLOCK(s, 1); ***/
						flush_block_only(s, true);
						if (s.strm.avail_out === 0) {
							return BS_FINISH_STARTED;
						}
						/***/
						return BS_FINISH_DONE;
					}
					if (s.last_lit) {
						/*** FLUSH_BLOCK(s, 0); ***/
						flush_block_only(s, false);
						if (s.strm.avail_out === 0) {
							return BS_NEED_MORE;
						}
						/***/
					}
					return BS_BLOCK_DONE;
				}

				/* Values for max_lazy_match, good_match and max_chain_length, depending on
				 * the desired pack level (0..9). The values given below have been tuned to
				 * exclude worst case performance for pathological files. Better values may be
				 * found for specific files.
				 */
				function Config(good_length, max_lazy, nice_length, max_chain, func) {
					this.good_length = good_length;
					this.max_lazy = max_lazy;
					this.nice_length = nice_length;
					this.max_chain = max_chain;
					this.func = func;
				}

				var configuration_table;

				configuration_table = [
					/*      good lazy nice chain */
					new Config(0, 0, 0, 0, deflate_stored),          /* 0 store only */
					new Config(4, 4, 8, 4, deflate_fast),            /* 1 max speed, no lazy matches */
					new Config(4, 5, 16, 8, deflate_fast),           /* 2 */
					new Config(4, 6, 32, 32, deflate_fast),          /* 3 */

					new Config(4, 4, 16, 16, deflate_slow),          /* 4 lazy matches */
					new Config(8, 16, 32, 32, deflate_slow),         /* 5 */
					new Config(8, 16, 128, 128, deflate_slow),       /* 6 */
					new Config(8, 32, 128, 256, deflate_slow),       /* 7 */
					new Config(32, 128, 258, 1024, deflate_slow),    /* 8 */
					new Config(32, 258, 258, 4096, deflate_slow)     /* 9 max compression */
				];


				/* ===========================================================================
				 * Initialize the "longest match" routines for a new zlib stream
				 */
				function lm_init(s) {
					s.window_size = 2 * s.w_size;

					/*** CLEAR_HASH(s); ***/
					zero(s.head); // Fill with NIL (= 0);

					/* Set the default configuration parameters:
					 */
					s.max_lazy_match = configuration_table[s.level].max_lazy;
					s.good_match = configuration_table[s.level].good_length;
					s.nice_match = configuration_table[s.level].nice_length;
					s.max_chain_length = configuration_table[s.level].max_chain;

					s.strstart = 0;
					s.block_start = 0;
					s.lookahead = 0;
					s.insert = 0;
					s.match_length = s.prev_length = MIN_MATCH - 1;
					s.match_available = 0;
					s.ins_h = 0;
				}


				function DeflateState() {
					this.strm = null;            /* pointer back to this zlib stream */
					this.status = 0;            /* as the name implies */
					this.pending_buf = null;      /* output still pending */
					this.pending_buf_size = 0;  /* size of pending_buf */
					this.pending_out = 0;       /* next pending byte to output to the stream */
					this.pending = 0;           /* nb of bytes in the pending buffer */
					this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */
					this.gzhead = null;         /* gzip header information to write */
					this.gzindex = 0;           /* where in extra, name, or comment */
					this.method = Z_DEFLATED; /* can only be DEFLATED */
					this.last_flush = -1;   /* value of flush param for previous deflate call */

					this.w_size = 0;  /* LZ77 window size (32K by default) */
					this.w_bits = 0;  /* log2(w_size)  (8..16) */
					this.w_mask = 0;  /* w_size - 1 */

					this.window = null;
					/* Sliding window. Input bytes are read into the second half of the window,
					 * and move to the first half later to keep a dictionary of at least wSize
					 * bytes. With this organization, matches are limited to a distance of
					 * wSize-MAX_MATCH bytes, but this ensures that IO is always
					 * performed with a length multiple of the block size.
					 */

					this.window_size = 0;
					/* Actual size of window: 2*wSize, except when the user input buffer
					 * is directly used as sliding window.
					 */

					this.prev = null;
					/* Link to older string with same hash index. To limit the size of this
					 * array to 64K, this link is maintained only for the last 32K strings.
					 * An index in this array is thus a window index modulo 32K.
					 */

					this.head = null;   /* Heads of the hash chains or NIL. */

					this.ins_h = 0;       /* hash index of string to be inserted */
					this.hash_size = 0;   /* number of elements in hash table */
					this.hash_bits = 0;   /* log2(hash_size) */
					this.hash_mask = 0;   /* hash_size-1 */

					this.hash_shift = 0;
					/* Number of bits by which ins_h must be shifted at each input
					 * step. It must be such that after MIN_MATCH steps, the oldest
					 * byte no longer takes part in the hash key, that is:
					 *   hash_shift * MIN_MATCH >= hash_bits
					 */

					this.block_start = 0;
					/* Window position at the beginning of the current output block. Gets
					 * negative when the window is moved backwards.
					 */

					this.match_length = 0;      /* length of best match */
					this.prev_match = 0;        /* previous match */
					this.match_available = 0;   /* set if previous match exists */
					this.strstart = 0;          /* start of string to insert */
					this.match_start = 0;       /* start of matching string */
					this.lookahead = 0;         /* number of valid bytes ahead in window */

					this.prev_length = 0;
					/* Length of the best match at previous step. Matches not greater than this
					 * are discarded. This is used in the lazy match evaluation.
					 */

					this.max_chain_length = 0;
					/* To speed up deflation, hash chains are never searched beyond this
					 * length.  A higher limit improves compression ratio but degrades the
					 * speed.
					 */

					this.max_lazy_match = 0;
					/* Attempt to find a better match only when the current match is strictly
					 * smaller than this value. This mechanism is used only for compression
					 * levels >= 4.
					 */
					// That's alias to max_lazy_match, don't use directly
					//this.max_insert_length = 0;
					/* Insert new strings in the hash table only if the match length is not
					 * greater than this length. This saves time but degrades compression.
					 * max_insert_length is used only for compression levels <= 3.
					 */

					this.level = 0;     /* compression level (1..9) */
					this.strategy = 0;  /* favor or force Huffman coding*/

					this.good_match = 0;
					/* Use a faster search when the previous match is longer than this */

					this.nice_match = 0; /* Stop searching when current match exceeds this */

					/* used by trees.c: */

					/* Didn't use ct_data typedef below to suppress compiler warning */

					// struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
					// struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
					// struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */

					// Use flat array of DOUBLE size, with interleaved fata,
					// because JS does not support effective
					this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
					this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);
					this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);
					zero(this.dyn_ltree);
					zero(this.dyn_dtree);
					zero(this.bl_tree);

					this.l_desc = null;         /* desc. for literal tree */
					this.d_desc = null;         /* desc. for distance tree */
					this.bl_desc = null;         /* desc. for bit length tree */

					//ush bl_count[MAX_BITS+1];
					this.bl_count = new utils.Buf16(MAX_BITS + 1);
					/* number of codes at each bit length for an optimal tree */

					//int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */
					this.heap = new utils.Buf16(2 * L_CODES + 1);  /* heap used to build the Huffman trees */
					zero(this.heap);

					this.heap_len = 0;               /* number of elements in the heap */
					this.heap_max = 0;               /* element of largest frequency */
					/* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
					 * The same heap array is used to build all trees.
					 */

					this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];
					zero(this.depth);
					/* Depth of each subtree used as tie breaker for trees of equal frequency
					 */

					this.l_buf = 0;          /* buffer index for literals or lengths */

					this.lit_bufsize = 0;
					/* Size of match buffer for literals/lengths.  There are 4 reasons for
					 * limiting lit_bufsize to 64K:
					 *   - frequencies can be kept in 16 bit counters
					 *   - if compression is not successful for the first block, all input
					 *     data is still in the window so we can still emit a stored block even
					 *     when input comes from standard input.  (This can also be done for
					 *     all blocks if lit_bufsize is not greater than 32K.)
					 *   - if compression is not successful for a file smaller than 64K, we can
					 *     even emit a stored file instead of a stored block (saving 5 bytes).
					 *     This is applicable only for zip (not gzip or zlib).
					 *   - creating new Huffman trees less frequently may not provide fast
					 *     adaptation to changes in the input data statistics. (Take for
					 *     example a binary file with poorly compressible code followed by
					 *     a highly compressible string table.) Smaller buffer sizes give
					 *     fast adaptation but have of course the overhead of transmitting
					 *     trees more frequently.
					 *   - I can't count above 4
					 */

					this.last_lit = 0;      /* running index in l_buf */

					this.d_buf = 0;
					/* Buffer index for distances. To simplify the code, d_buf and l_buf have
					 * the same number of elements. To use different lengths, an extra flag
					 * array would be necessary.
					 */

					this.opt_len = 0;       /* bit length of current block with optimal trees */
					this.static_len = 0;    /* bit length of current block with static trees */
					this.matches = 0;       /* number of string matches in current block */
					this.insert = 0;        /* bytes at end of window left to insert */


					this.bi_buf = 0;
					/* Output buffer. bits are inserted starting at the bottom (least
					 * significant bits).
					 */
					this.bi_valid = 0;
					/* Number of valid bits in bi_buf.  All bits above the last valid bit
					 * are always zero.
					 */

					// Used for window memory init. We safely ignore it for JS. That makes
					// sense only for pointers and memory check tools.
					//this.high_water = 0;
					/* High water mark offset in window for initialized bytes -- bytes above
					 * this are set to zero in order to avoid memory check warnings when
					 * longest match routines access bytes past the input.  This is then
					 * updated to the new high water mark.
					 */
				}


				function deflateResetKeep(strm) {
					var s;

					if (!strm || !strm.state) {
						return err(strm, Z_STREAM_ERROR);
					}

					strm.total_in = strm.total_out = 0;
					strm.data_type = Z_UNKNOWN;

					s = strm.state;
					s.pending = 0;
					s.pending_out = 0;

					if (s.wrap < 0) {
						s.wrap = -s.wrap;
						/* was made negative by deflate(..., Z_FINISH); */
					}
					s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
					strm.adler = (s.wrap === 2) ?
						0  // crc32(0, Z_NULL, 0)
						:
						1; // adler32(0, Z_NULL, 0)
					s.last_flush = Z_NO_FLUSH;
					trees._tr_init(s);
					return Z_OK;
				}


				function deflateReset(strm) {
					var ret = deflateResetKeep(strm);
					if (ret === Z_OK) {
						lm_init(strm.state);
					}
					return ret;
				}


				function deflateSetHeader(strm, head) {
					if (!strm || !strm.state) { return Z_STREAM_ERROR; }
					if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
					strm.state.gzhead = head;
					return Z_OK;
				}


				function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
					if (!strm) { // === Z_NULL
						return Z_STREAM_ERROR;
					}
					var wrap = 1;

					if (level === Z_DEFAULT_COMPRESSION) {
						level = 6;
					}

					if (windowBits < 0) { /* suppress zlib wrapper */
						wrap = 0;
						windowBits = -windowBits;
					}

					else if (windowBits > 15) {
						wrap = 2;           /* write gzip wrapper instead */
						windowBits -= 16;
					}


					if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
						windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
						strategy < 0 || strategy > Z_FIXED) {
						return err(strm, Z_STREAM_ERROR);
					}


					if (windowBits === 8) {
						windowBits = 9;
					}
					/* until 256-byte window bug fixed */

					var s = new DeflateState();

					strm.state = s;
					s.strm = strm;

					s.wrap = wrap;
					s.gzhead = null;
					s.w_bits = windowBits;
					s.w_size = 1 << s.w_bits;
					s.w_mask = s.w_size - 1;

					s.hash_bits = memLevel + 7;
					s.hash_size = 1 << s.hash_bits;
					s.hash_mask = s.hash_size - 1;
					s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);

					s.window = new utils.Buf8(s.w_size * 2);
					s.head = new utils.Buf16(s.hash_size);
					s.prev = new utils.Buf16(s.w_size);

					// Don't need mem init magic for JS.
					//s.high_water = 0;  /* nothing written to s->window yet */

					s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */

					s.pending_buf_size = s.lit_bufsize * 4;

					//overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
					//s->pending_buf = (uchf *) overlay;
					s.pending_buf = new utils.Buf8(s.pending_buf_size);

					// It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)
					//s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
					s.d_buf = 1 * s.lit_bufsize;

					//s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
					s.l_buf = (1 + 2) * s.lit_bufsize;

					s.level = level;
					s.strategy = strategy;
					s.method = method;

					return deflateReset(strm);
				}

				function deflateInit(strm, level) {
					return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
				}


				function deflate(strm, flush) {
					var old_flush, s;
					var beg, val; // for gzip header write only

					if (!strm || !strm.state ||
						flush > Z_BLOCK || flush < 0) {
						return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
					}

					s = strm.state;

					if (!strm.output ||
						(!strm.input && strm.avail_in !== 0) ||
						(s.status === FINISH_STATE && flush !== Z_FINISH)) {
						return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
					}

					s.strm = strm; /* just in case */
					old_flush = s.last_flush;
					s.last_flush = flush;

					/* Write the header */
					if (s.status === INIT_STATE) {

						if (s.wrap === 2) { // GZIP header
							strm.adler = 0;  //crc32(0L, Z_NULL, 0);
							put_byte(s, 31);
							put_byte(s, 139);
							put_byte(s, 8);
							if (!s.gzhead) { // s->gzhead == Z_NULL
								put_byte(s, 0);
								put_byte(s, 0);
								put_byte(s, 0);
								put_byte(s, 0);
								put_byte(s, 0);
								put_byte(s, s.level === 9 ? 2 :
									(s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
										4 : 0));
								put_byte(s, OS_CODE);
								s.status = BUSY_STATE;
							}
							else {
								put_byte(s, (s.gzhead.text ? 1 : 0) +
									(s.gzhead.hcrc ? 2 : 0) +
									(!s.gzhead.extra ? 0 : 4) +
									(!s.gzhead.name ? 0 : 8) +
									(!s.gzhead.comment ? 0 : 16)
								);
								put_byte(s, s.gzhead.time & 0xff);
								put_byte(s, (s.gzhead.time >> 8) & 0xff);
								put_byte(s, (s.gzhead.time >> 16) & 0xff);
								put_byte(s, (s.gzhead.time >> 24) & 0xff);
								put_byte(s, s.level === 9 ? 2 :
									(s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
										4 : 0));
								put_byte(s, s.gzhead.os & 0xff);
								if (s.gzhead.extra && s.gzhead.extra.length) {
									put_byte(s, s.gzhead.extra.length & 0xff);
									put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
								}
								if (s.gzhead.hcrc) {
									strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
								}
								s.gzindex = 0;
								s.status = EXTRA_STATE;
							}
						}
						else // DEFLATE header
						{
							var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
							var level_flags = -1;

							if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
								level_flags = 0;
							} else if (s.level < 6) {
								level_flags = 1;
							} else if (s.level === 6) {
								level_flags = 2;
							} else {
								level_flags = 3;
							}
							header |= (level_flags << 6);
							if (s.strstart !== 0) { header |= PRESET_DICT; }
							header += 31 - (header % 31);

							s.status = BUSY_STATE;
							putShortMSB(s, header);

							/* Save the adler32 of the preset dictionary: */
							if (s.strstart !== 0) {
								putShortMSB(s, strm.adler >>> 16);
								putShortMSB(s, strm.adler & 0xffff);
							}
							strm.adler = 1; // adler32(0L, Z_NULL, 0);
						}
					}

					//#ifdef GZIP
					if (s.status === EXTRA_STATE) {
						if (s.gzhead.extra/* != Z_NULL*/) {
							beg = s.pending;  /* start of bytes to update crc */

							while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
								if (s.pending === s.pending_buf_size) {
									if (s.gzhead.hcrc && s.pending > beg) {
										strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
									}
									flush_pending(strm);
									beg = s.pending;
									if (s.pending === s.pending_buf_size) {
										break;
									}
								}
								put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
								s.gzindex++;
							}
							if (s.gzhead.hcrc && s.pending > beg) {
								strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
							}
							if (s.gzindex === s.gzhead.extra.length) {
								s.gzindex = 0;
								s.status = NAME_STATE;
							}
						}
						else {
							s.status = NAME_STATE;
						}
					}
					if (s.status === NAME_STATE) {
						if (s.gzhead.name/* != Z_NULL*/) {
							beg = s.pending;  /* start of bytes to update crc */
							//int val;

							do {
								if (s.pending === s.pending_buf_size) {
									if (s.gzhead.hcrc && s.pending > beg) {
										strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
									}
									flush_pending(strm);
									beg = s.pending;
									if (s.pending === s.pending_buf_size) {
										val = 1;
										break;
									}
								}
								// JS specific: little magic to add zero terminator to end of string
								if (s.gzindex < s.gzhead.name.length) {
									val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
								} else {
									val = 0;
								}
								put_byte(s, val);
							} while (val !== 0);

							if (s.gzhead.hcrc && s.pending > beg) {
								strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
							}
							if (val === 0) {
								s.gzindex = 0;
								s.status = COMMENT_STATE;
							}
						}
						else {
							s.status = COMMENT_STATE;
						}
					}
					if (s.status === COMMENT_STATE) {
						if (s.gzhead.comment/* != Z_NULL*/) {
							beg = s.pending;  /* start of bytes to update crc */
							//int val;

							do {
								if (s.pending === s.pending_buf_size) {
									if (s.gzhead.hcrc && s.pending > beg) {
										strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
									}
									flush_pending(strm);
									beg = s.pending;
									if (s.pending === s.pending_buf_size) {
										val = 1;
										break;
									}
								}
								// JS specific: little magic to add zero terminator to end of string
								if (s.gzindex < s.gzhead.comment.length) {
									val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
								} else {
									val = 0;
								}
								put_byte(s, val);
							} while (val !== 0);

							if (s.gzhead.hcrc && s.pending > beg) {
								strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
							}
							if (val === 0) {
								s.status = HCRC_STATE;
							}
						}
						else {
							s.status = HCRC_STATE;
						}
					}
					if (s.status === HCRC_STATE) {
						if (s.gzhead.hcrc) {
							if (s.pending + 2 > s.pending_buf_size) {
								flush_pending(strm);
							}
							if (s.pending + 2 <= s.pending_buf_size) {
								put_byte(s, strm.adler & 0xff);
								put_byte(s, (strm.adler >> 8) & 0xff);
								strm.adler = 0; //crc32(0L, Z_NULL, 0);
								s.status = BUSY_STATE;
							}
						}
						else {
							s.status = BUSY_STATE;
						}
					}
					//#endif

					/* Flush as much pending output as possible */
					if (s.pending !== 0) {
						flush_pending(strm);
						if (strm.avail_out === 0) {
							/* Since avail_out is 0, deflate will be called again with
							 * more output space, but possibly with both pending and
							 * avail_in equal to zero. There won't be anything to do,
							 * but this is not an error situation so make sure we
							 * return OK instead of BUF_ERROR at next call of deflate:
							 */
							s.last_flush = -1;
							return Z_OK;
						}

						/* Make sure there is something to do and avoid duplicate consecutive
						 * flushes. For repeated and useless calls with Z_FINISH, we keep
						 * returning Z_STREAM_END instead of Z_BUF_ERROR.
						 */
					} else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
						flush !== Z_FINISH) {
						return err(strm, Z_BUF_ERROR);
					}

					/* User must not provide more input after the first FINISH: */
					if (s.status === FINISH_STATE && strm.avail_in !== 0) {
						return err(strm, Z_BUF_ERROR);
					}

					/* Start a new block or continue the current one.
					 */
					if (strm.avail_in !== 0 || s.lookahead !== 0 ||
						(flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
						var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
							(s.strategy === Z_RLE ? deflate_rle(s, flush) :
								configuration_table[s.level].func(s, flush));

						if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
							s.status = FINISH_STATE;
						}
						if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
							if (strm.avail_out === 0) {
								s.last_flush = -1;
								/* avoid BUF_ERROR next call, see above */
							}
							return Z_OK;
							/* If flush != Z_NO_FLUSH && avail_out == 0, the next call
							 * of deflate should use the same flush parameter to make sure
							 * that the flush is complete. So we don't have to output an
							 * empty block here, this will be done at next call. This also
							 * ensures that for a very small output buffer, we emit at most
							 * one empty block.
							 */
						}
						if (bstate === BS_BLOCK_DONE) {
							if (flush === Z_PARTIAL_FLUSH) {
								trees._tr_align(s);
							}
							else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */

								trees._tr_stored_block(s, 0, 0, false);
								/* For a full flush, this empty block will be recognized
								 * as a special marker by inflate_sync().
								 */
								if (flush === Z_FULL_FLUSH) {
									/*** CLEAR_HASH(s); ***/             /* forget history */
									zero(s.head); // Fill with NIL (= 0);

									if (s.lookahead === 0) {
										s.strstart = 0;
										s.block_start = 0;
										s.insert = 0;
									}
								}
							}
							flush_pending(strm);
							if (strm.avail_out === 0) {
								s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
								return Z_OK;
							}
						}
					}
					//Assert(strm->avail_out > 0, "bug2");
					//if (strm.avail_out <= 0) { throw new Error("bug2");}

					if (flush !== Z_FINISH) { return Z_OK; }
					if (s.wrap <= 0) { return Z_STREAM_END; }

					/* Write the trailer */
					if (s.wrap === 2) {
						put_byte(s, strm.adler & 0xff);
						put_byte(s, (strm.adler >> 8) & 0xff);
						put_byte(s, (strm.adler >> 16) & 0xff);
						put_byte(s, (strm.adler >> 24) & 0xff);
						put_byte(s, strm.total_in & 0xff);
						put_byte(s, (strm.total_in >> 8) & 0xff);
						put_byte(s, (strm.total_in >> 16) & 0xff);
						put_byte(s, (strm.total_in >> 24) & 0xff);
					}
					else {
						putShortMSB(s, strm.adler >>> 16);
						putShortMSB(s, strm.adler & 0xffff);
					}

					flush_pending(strm);
					/* If avail_out is zero, the application will call deflate again
					 * to flush the rest.
					 */
					if (s.wrap > 0) { s.wrap = -s.wrap; }
					/* write the trailer only once! */
					return s.pending !== 0 ? Z_OK : Z_STREAM_END;
				}

				function deflateEnd(strm) {
					var status;

					if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
						return Z_STREAM_ERROR;
					}

					status = strm.state.status;
					if (status !== INIT_STATE &&
						status !== EXTRA_STATE &&
						status !== NAME_STATE &&
						status !== COMMENT_STATE &&
						status !== HCRC_STATE &&
						status !== BUSY_STATE &&
						status !== FINISH_STATE
					) {
						return err(strm, Z_STREAM_ERROR);
					}

					strm.state = null;

					return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
				}


				/* =========================================================================
				 * Initializes the compression dictionary from the given byte
				 * sequence without producing any compressed output.
				 */
				function deflateSetDictionary(strm, dictionary) {
					var dictLength = dictionary.length;

					var s;
					var str, n;
					var wrap;
					var avail;
					var next;
					var input;
					var tmpDict;

					if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
						return Z_STREAM_ERROR;
					}

					s = strm.state;
					wrap = s.wrap;

					if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {
						return Z_STREAM_ERROR;
					}

					/* when using zlib wrappers, compute Adler-32 for provided dictionary */
					if (wrap === 1) {
						/* adler32(strm->adler, dictionary, dictLength); */
						strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
					}

					s.wrap = 0;   /* avoid computing Adler-32 in read_buf */

					/* if dictionary would fill window, just replace the history */
					if (dictLength >= s.w_size) {
						if (wrap === 0) {            /* already empty otherwise */
							/*** CLEAR_HASH(s); ***/
							zero(s.head); // Fill with NIL (= 0);
							s.strstart = 0;
							s.block_start = 0;
							s.insert = 0;
						}
						/* use the tail */
						// dictionary = dictionary.slice(dictLength - s.w_size);
						tmpDict = new utils.Buf8(s.w_size);
						utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
						dictionary = tmpDict;
						dictLength = s.w_size;
					}
					/* insert dictionary into window and hash */
					avail = strm.avail_in;
					next = strm.next_in;
					input = strm.input;
					strm.avail_in = dictLength;
					strm.next_in = 0;
					strm.input = dictionary;
					fill_window(s);
					while (s.lookahead >= MIN_MATCH) {
						str = s.strstart;
						n = s.lookahead - (MIN_MATCH - 1);
						do {
							/* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
							s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;

							s.prev[str & s.w_mask] = s.head[s.ins_h];

							s.head[s.ins_h] = str;
							str++;
						} while (--n);
						s.strstart = str;
						s.lookahead = MIN_MATCH - 1;
						fill_window(s);
					}
					s.strstart += s.lookahead;
					s.block_start = s.strstart;
					s.insert = s.lookahead;
					s.lookahead = 0;
					s.match_length = s.prev_length = MIN_MATCH - 1;
					s.match_available = 0;
					strm.next_in = next;
					strm.input = input;
					strm.avail_in = avail;
					s.wrap = wrap;
					return Z_OK;
				}


				localExports.deflateInit = deflateInit;
				localExports.deflateInit2 = deflateInit2;
				localExports.deflateReset = deflateReset;
				localExports.deflateResetKeep = deflateResetKeep;
				localExports.deflateSetHeader = deflateSetHeader;
				localExports.deflate = deflate;
				localExports.deflateEnd = deflateEnd;
				localExports.deflateSetDictionary = deflateSetDictionary;
				localExports.deflateInfo = 'pako deflate (from Nodeca project)';

				/* Not implemented
				localExports.deflateBound = deflateBound;
				localExports.deflateCopy = deflateCopy;
				localExports.deflateParams = deflateParams;
				localExports.deflatePending = deflatePending;
				localExports.deflatePrime = deflatePrime;
				localExports.deflateTune = deflateTune;
				*/

			}, { "../utils/common": 175, "./adler32": 176, "./crc32": 178, "./messages": 183, "./trees": 184 }], 180: [function (localRequire, localModule, localExports) {
				'use strict';

				// See state defs from inflate.js
				var BAD = 30;       /* got a data error -- remain here until reset */
				var TYPE = 12;      /* i: waiting for type bits, including last-flag bit */

				/*
				   Decode literal, length, and distance codes and write out the resulting
				   literal and match bytes until either not enough input or output is
				   available, an end-of-block is encountered, or a data error is encountered.
				   When large enough input and output buffers are supplied to inflate(), for
				   example, a 16K input buffer and a 64K output buffer, more than 95% of the
				   inflate execution time is spent in this routine.
				
				   Entry assumptions:
				
						state.mode === LEN
						strm.avail_in >= 6
						strm.avail_out >= 258
						start >= strm.avail_out
						state.bits < 8
				
				   On return, state.mode is one of:
				
						LEN -- ran out of enough output space or enough available input
						TYPE -- reached end of block code, inflate() to interpret next block
						BAD -- error in block data
				
				   Notes:
				
					- The maximum input bits used by a length/distance pair is 15 bits for the
					  length code, 5 bits for the length extra, 15 bits for the distance code,
					  and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
					  Therefore if strm.avail_in >= 6, then there is enough input to avoid
					  checking for available input while decoding.
				
					- The maximum bytes that a single length/distance pair can output is 258
					  bytes, which is the maximum length that can be coded.  inflate_fast()
					  requires strm.avail_out >= 258 for each loop to avoid checking for
					  output space.
				 */
				localModule.localExports = function inflate_fast(strm, start) {
					var state;
					var _in;                    /* local strm.input */
					var last;                   /* have enough input while in < last */
					var _out;                   /* local strm.output */
					var beg;                    /* inflate()'s initial strm.output */
					var end;                    /* while out < end, enough space available */
					//#ifdef INFLATE_STRICT
					var dmax;                   /* maximum distance from zlib header */
					//#endif
					var wsize;                  /* window size or zero if not using window */
					var whave;                  /* valid bytes in the window */
					var wnext;                  /* window write index */
					// Use `s_window` instead `window`, avoid conflict with instrumentation tools
					var s_window;               /* allocated sliding window, if wsize != 0 */
					var hold;                   /* local strm.hold */
					var bits;                   /* local strm.bits */
					var lcode;                  /* local strm.lencode */
					var dcode;                  /* local strm.distcode */
					var lmask;                  /* mask for first level of length codes */
					var dmask;                  /* mask for first level of distance codes */
					var here;                   /* retrieved table entry */
					var op;                     /* code bits, operation, extra bits, or */
					/*  window position, window bytes to copy */
					var len;                    /* match length, unused bytes */
					var dist;                   /* match distance */
					var from;                   /* where to copy match from */
					var from_source;


					var input, output; // JS specific, because we have no pointers

					/* copy state to local variables */
					state = strm.state;
					//here = state.here;
					_in = strm.next_in;
					input = strm.input;
					last = _in + (strm.avail_in - 5);
					_out = strm.next_out;
					output = strm.output;
					beg = _out - (start - strm.avail_out);
					end = _out + (strm.avail_out - 257);
					//#ifdef INFLATE_STRICT
					dmax = state.dmax;
					//#endif
					wsize = state.wsize;
					whave = state.whave;
					wnext = state.wnext;
					s_window = state.window;
					hold = state.hold;
					bits = state.bits;
					lcode = state.lencode;
					dcode = state.distcode;
					lmask = (1 << state.lenbits) - 1;
					dmask = (1 << state.distbits) - 1;


					/* decode literals and length/distances until end-of-block or not enough
					   input data or output space */

					top:
					do {
						if (bits < 15) {
							hold += input[_in++] << bits;
							bits += 8;
							hold += input[_in++] << bits;
							bits += 8;
						}

						here = lcode[hold & lmask];

						dolen:
						for (; ;) { // Goto emulation
							op = here >>> 24/*here.bits*/;
							hold >>>= op;
							bits -= op;
							op = (here >>> 16) & 0xff/*here.op*/;
							if (op === 0) {                          /* literal */
								//Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
								//        "inflate:         literal '%c'\n" :
								//        "inflate:         literal 0x%02x\n", here.val));
								output[_out++] = here & 0xffff/*here.val*/;
							}
							else if (op & 16) {                     /* length base */
								len = here & 0xffff/*here.val*/;
								op &= 15;                           /* number of extra bits */
								if (op) {
									if (bits < op) {
										hold += input[_in++] << bits;
										bits += 8;
									}
									len += hold & ((1 << op) - 1);
									hold >>>= op;
									bits -= op;
								}
								//Tracevv((stderr, "inflate:         length %u\n", len));
								if (bits < 15) {
									hold += input[_in++] << bits;
									bits += 8;
									hold += input[_in++] << bits;
									bits += 8;
								}
								here = dcode[hold & dmask];

								dodist:
								for (; ;) { // goto emulation
									op = here >>> 24/*here.bits*/;
									hold >>>= op;
									bits -= op;
									op = (here >>> 16) & 0xff/*here.op*/;

									if (op & 16) {                      /* distance base */
										dist = here & 0xffff/*here.val*/;
										op &= 15;                       /* number of extra bits */
										if (bits < op) {
											hold += input[_in++] << bits;
											bits += 8;
											if (bits < op) {
												hold += input[_in++] << bits;
												bits += 8;
											}
										}
										dist += hold & ((1 << op) - 1);
										//#ifdef INFLATE_STRICT
										if (dist > dmax) {
											strm.msg = 'invalid distance too far back';
											state.mode = BAD;
											break top;
										}
										//#endif
										hold >>>= op;
										bits -= op;
										//Tracevv((stderr, "inflate:         distance %u\n", dist));
										op = _out - beg;                /* max distance in output */
										if (dist > op) {                /* see if copy from window */
											op = dist - op;               /* distance back in window */
											if (op > whave) {
												if (state.sane) {
													strm.msg = 'invalid distance too far back';
													state.mode = BAD;
													break top;
												}

												// (!) This block is disabled in zlib defailts,
												// don't enable it for binary compatibility
												//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
												//                if (len <= op - whave) {
												//                  do {
												//                    output[_out++] = 0;
												//                  } while (--len);
												//                  continue top;
												//                }
												//                len -= op - whave;
												//                do {
												//                  output[_out++] = 0;
												//                } while (--op > whave);
												//                if (op === 0) {
												//                  from = _out - dist;
												//                  do {
												//                    output[_out++] = output[from++];
												//                  } while (--len);
												//                  continue top;
												//                }
												//#endif
											}
											from = 0; // window index
											from_source = s_window;
											if (wnext === 0) {           /* very common case */
												from += wsize - op;
												if (op < len) {         /* some from window */
													len -= op;
													do {
														output[_out++] = s_window[from++];
													} while (--op);
													from = _out - dist;  /* rest from output */
													from_source = output;
												}
											}
											else if (wnext < op) {      /* wrap around window */
												from += wsize + wnext - op;
												op -= wnext;
												if (op < len) {         /* some from end of window */
													len -= op;
													do {
														output[_out++] = s_window[from++];
													} while (--op);
													from = 0;
													if (wnext < len) {  /* some from start of window */
														op = wnext;
														len -= op;
														do {
															output[_out++] = s_window[from++];
														} while (--op);
														from = _out - dist;      /* rest from output */
														from_source = output;
													}
												}
											}
											else {                      /* contiguous in window */
												from += wnext - op;
												if (op < len) {         /* some from window */
													len -= op;
													do {
														output[_out++] = s_window[from++];
													} while (--op);
													from = _out - dist;  /* rest from output */
													from_source = output;
												}
											}
											while (len > 2) {
												output[_out++] = from_source[from++];
												output[_out++] = from_source[from++];
												output[_out++] = from_source[from++];
												len -= 3;
											}
											if (len) {
												output[_out++] = from_source[from++];
												if (len > 1) {
													output[_out++] = from_source[from++];
												}
											}
										}
										else {
											from = _out - dist;          /* copy direct from output */
											do {                        /* minimum length is three */
												output[_out++] = output[from++];
												output[_out++] = output[from++];
												output[_out++] = output[from++];
												len -= 3;
											} while (len > 2);
											if (len) {
												output[_out++] = output[from++];
												if (len > 1) {
													output[_out++] = output[from++];
												}
											}
										}
									}
									else if ((op & 64) === 0) {          /* 2nd level distance code */
										here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
										continue dodist;
									}
									else {
										strm.msg = 'invalid distance code';
										state.mode = BAD;
										break top;
									}

									break; // need to emulate goto via "continue"
								}
							}
							else if ((op & 64) === 0) {              /* 2nd level length code */
								here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
								continue dolen;
							}
							else if (op & 32) {                     /* end-of-block */
								//Tracevv((stderr, "inflate:         end of block\n"));
								state.mode = TYPE;
								break top;
							}
							else {
								strm.msg = 'invalid literal/length code';
								state.mode = BAD;
								break top;
							}

							break; // need to emulate goto via "continue"
						}
					} while (_in < last && _out < end);

					/* return unused bytes (on entry, bits < 8, so in won't go too far back) */
					len = bits >> 3;
					_in -= len;
					bits -= len << 3;
					hold &= (1 << bits) - 1;

					/* update state and return */
					strm.next_in = _in;
					strm.next_out = _out;
					strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
					strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
					state.hold = hold;
					state.bits = bits;
					return;
				};

			}, {}], 181: [function (localRequire, localModule, localExports) {
				'use strict';


				var utils = localRequire('../utils/common');
				var adler32 = localRequire('./adler32');
				var crc32 = localRequire('./crc32');
				var inflate_fast = localRequire('./inffast');
				var inflate_table = localRequire('./inftrees');

				var CODES = 0;
				var LENS = 1;
				var DISTS = 2;

				/* Public constants ==========================================================*/
				/* ===========================================================================*/


				/* Allowed flush values; see deflate() and inflate() below for details */
				//var Z_NO_FLUSH      = 0;
				//var Z_PARTIAL_FLUSH = 1;
				//var Z_SYNC_FLUSH    = 2;
				//var Z_FULL_FLUSH    = 3;
				var Z_FINISH = 4;
				var Z_BLOCK = 5;
				var Z_TREES = 6;


				/* Return codes for the compression/decompression functions. Negative values
				 * are errors, positive values are used for special but normal events.
				 */
				var Z_OK = 0;
				var Z_STREAM_END = 1;
				var Z_NEED_DICT = 2;
				//var Z_ERRNO         = -1;
				var Z_STREAM_ERROR = -2;
				var Z_DATA_ERROR = -3;
				var Z_MEM_ERROR = -4;
				var Z_BUF_ERROR = -5;
				//var Z_VERSION_ERROR = -6;

				/* The deflate compression method */
				var Z_DEFLATED = 8;


				/* STATES ====================================================================*/
				/* ===========================================================================*/


				var HEAD = 1;       /* i: waiting for magic header */
				var FLAGS = 2;      /* i: waiting for method and flags (gzip) */
				var TIME = 3;       /* i: waiting for modification time (gzip) */
				var OS = 4;         /* i: waiting for extra flags and operating system (gzip) */
				var EXLEN = 5;      /* i: waiting for extra length (gzip) */
				var EXTRA = 6;      /* i: waiting for extra bytes (gzip) */
				var NAME = 7;       /* i: waiting for end of file name (gzip) */
				var COMMENT = 8;    /* i: waiting for end of comment (gzip) */
				var HCRC = 9;       /* i: waiting for header crc (gzip) */
				var DICTID = 10;    /* i: waiting for dictionary check value */
				var DICT = 11;      /* waiting for inflateSetDictionary() call */
				var TYPE = 12;      /* i: waiting for type bits, including last-flag bit */
				var TYPEDO = 13;    /* i: same, but skip check to exit inflate on new block */
				var STORED = 14;    /* i: waiting for stored size (length and complement) */
				var COPY_ = 15;     /* i/o: same as COPY below, but only first time in */
				var COPY = 16;      /* i/o: waiting for input or output to copy stored block */
				var TABLE = 17;     /* i: waiting for dynamic block table lengths */
				var LENLENS = 18;   /* i: waiting for code length code lengths */
				var CODELENS = 19;  /* i: waiting for length/lit and distance code lengths */
				var LEN_ = 20;      /* i: same as LEN below, but only first time in */
				var LEN = 21;       /* i: waiting for length/lit/eob code */
				var LENEXT = 22;    /* i: waiting for length extra bits */
				var DIST = 23;      /* i: waiting for distance code */
				var DISTEXT = 24;   /* i: waiting for distance extra bits */
				var MATCH = 25;     /* o: waiting for output space to copy string */
				var LIT = 26;       /* o: waiting for output space to write literal */
				var CHECK = 27;     /* i: waiting for 32-bit check value */
				var LENGTH = 28;    /* i: waiting for 32-bit length (gzip) */
				var DONE = 29;      /* finished check, done -- remain here until reset */
				var BAD = 30;       /* got a data error -- remain here until reset */
				var MEM = 31;       /* got an inflate() memory error -- remain here until reset */
				var SYNC = 32;      /* looking for synchronization bytes to restart inflate() */

				/* ===========================================================================*/



				var ENOUGH_LENS = 852;
				var ENOUGH_DISTS = 592;
				//var ENOUGH =  (ENOUGH_LENS+ENOUGH_DISTS);

				var MAX_WBITS = 15;
				/* 32K LZ77 window */
				var DEF_WBITS = MAX_WBITS;


				function zswap32(q) {
					return (((q >>> 24) & 0xff) +
						((q >>> 8) & 0xff00) +
						((q & 0xff00) << 8) +
						((q & 0xff) << 24));
				}


				function InflateState() {
					this.mode = 0;             /* current inflate mode */
					this.last = false;          /* true if processing last block */
					this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */
					this.havedict = false;      /* true if dictionary provided */
					this.flags = 0;             /* gzip header method and flags (0 if zlib) */
					this.dmax = 0;              /* zlib header max distance (INFLATE_STRICT) */
					this.check = 0;             /* protected copy of check value */
					this.total = 0;             /* protected copy of output count */
					// TODO: may be {}
					this.head = null;           /* where to save gzip header information */

					/* sliding window */
					this.wbits = 0;             /* log base 2 of requested window size */
					this.wsize = 0;             /* window size or zero if not using window */
					this.whave = 0;             /* valid bytes in the window */
					this.wnext = 0;             /* window write index */
					this.window = null;         /* allocated sliding window, if needed */

					/* bit accumulator */
					this.hold = 0;              /* input bit accumulator */
					this.bits = 0;              /* number of bits in "in" */

					/* for string and stored block copying */
					this.length = 0;            /* literal or length of data to copy */
					this.offset = 0;            /* distance back to copy string from */

					/* for table and code decoding */
					this.extra = 0;             /* extra bits needed */

					/* fixed and dynamic code tables */
					this.lencode = null;          /* starting table for length/literal codes */
					this.distcode = null;         /* starting table for distance codes */
					this.lenbits = 0;           /* index bits for lencode */
					this.distbits = 0;          /* index bits for distcode */

					/* dynamic table building */
					this.ncode = 0;             /* number of code length code lengths */
					this.nlen = 0;              /* number of length code lengths */
					this.ndist = 0;             /* number of distance code lengths */
					this.have = 0;              /* number of code lengths in lens[] */
					this.next = null;              /* next available space in codes[] */

					this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
					this.work = new utils.Buf16(288); /* work area for code table building */

					/*
					 because we don't have pointers in js, we use lencode and distcode directly
					 as buffers so we don't need codes
					*/
					//this.codes = new utils.Buf32(ENOUGH);       /* space for code tables */
					this.lendyn = null;              /* dynamic table for length/literal codes (JS specific) */
					this.distdyn = null;             /* dynamic table for distance codes (JS specific) */
					this.sane = 0;                   /* if false, allow invalid distance too far */
					this.back = 0;                   /* bits back of last unprocessed length/lit */
					this.was = 0;                    /* initial length of match */
				}

				function inflateResetKeep(strm) {
					var state;

					if (!strm || !strm.state) { return Z_STREAM_ERROR; }
					state = strm.state;
					strm.total_in = strm.total_out = state.total = 0;
					strm.msg = ''; /*Z_NULL*/
					if (state.wrap) {       /* to support ill-conceived Java test suite */
						strm.adler = state.wrap & 1;
					}
					state.mode = HEAD;
					state.last = 0;
					state.havedict = 0;
					state.dmax = 32768;
					state.head = null/*Z_NULL*/;
					state.hold = 0;
					state.bits = 0;
					//state.lencode = state.distcode = state.next = state.codes;
					state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
					state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);

					state.sane = 1;
					state.back = -1;
					//Tracev((stderr, "inflate: reset\n"));
					return Z_OK;
				}

				function inflateReset(strm) {
					var state;

					if (!strm || !strm.state) { return Z_STREAM_ERROR; }
					state = strm.state;
					state.wsize = 0;
					state.whave = 0;
					state.wnext = 0;
					return inflateResetKeep(strm);

				}

				function inflateReset2(strm, windowBits) {
					var wrap;
					var state;

					/* get the state */
					if (!strm || !strm.state) { return Z_STREAM_ERROR; }
					state = strm.state;

					/* extract wrap request from windowBits parameter */
					if (windowBits < 0) {
						wrap = 0;
						windowBits = -windowBits;
					}
					else {
						wrap = (windowBits >> 4) + 1;
						if (windowBits < 48) {
							windowBits &= 15;
						}
					}

					/* set number of window bits, free window if different */
					if (windowBits && (windowBits < 8 || windowBits > 15)) {
						return Z_STREAM_ERROR;
					}
					if (state.window !== null && state.wbits !== windowBits) {
						state.window = null;
					}

					/* update state and reset the rest of it */
					state.wrap = wrap;
					state.wbits = windowBits;
					return inflateReset(strm);
				}

				function inflateInit2(strm, windowBits) {
					var ret;
					var state;

					if (!strm) { return Z_STREAM_ERROR; }
					//strm.msg = Z_NULL;                 /* in case we return an error */

					state = new InflateState();

					//if (state === Z_NULL) return Z_MEM_ERROR;
					//Tracev((stderr, "inflate: allocated\n"));
					strm.state = state;
					state.window = null/*Z_NULL*/;
					ret = inflateReset2(strm, windowBits);
					if (ret !== Z_OK) {
						strm.state = null/*Z_NULL*/;
					}
					return ret;
				}

				function inflateInit(strm) {
					return inflateInit2(strm, DEF_WBITS);
				}


				/*
				 Return state with length and distance decoding tables and index sizes set to
				 fixed code decoding.  Normally this returns fixed tables from inffixed.h.
				 If BUILDFIXED is defined, then instead this routine builds the tables the
				 first time it's called, and returns those tables the first time and
				 thereafter.  This reduces the size of the code by about 2K bytes, in
				 exchange for a little execution time.  However, BUILDFIXED should not be
				 used for threaded applications, since the rewriting of the tables and virgin
				 may not be thread-safe.
				 */
				var virgin = true;

				var lenfix, distfix; // We have no pointers in JS, so keep tables separate

				function fixedtables(state) {
					/* build fixed huffman tables if first call (may not be thread safe) */
					if (virgin) {
						var sym;

						lenfix = new utils.Buf32(512);
						distfix = new utils.Buf32(32);

						/* literal/length table */
						sym = 0;
						while (sym < 144) { state.lens[sym++] = 8; }
						while (sym < 256) { state.lens[sym++] = 9; }
						while (sym < 280) { state.lens[sym++] = 7; }
						while (sym < 288) { state.lens[sym++] = 8; }

						inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });

						/* distance table */
						sym = 0;
						while (sym < 32) { state.lens[sym++] = 5; }

						inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });

						/* do this just once */
						virgin = false;
					}

					state.lencode = lenfix;
					state.lenbits = 9;
					state.distcode = distfix;
					state.distbits = 5;
				}


				/*
				 Update the window with the last wsize (normally 32K) bytes written before
				 returning.  If window does not exist yet, create it.  This is only called
				 when a window is already in use, or when output has been written during this
				 inflate call, but the end of the deflate stream has not been reached yet.
				 It is also called to create a window for dictionary data when a dictionary
				 is loaded.
				
				 Providing output buffers larger than 32K to inflate() should provide a speed
				 advantage, since only the last 32K of output is copied to the sliding window
				 upon return from inflate(), and since all distances after the first 32K of
				 output will fall in the output data, making match copies simpler and faster.
				 The advantage may be dependent on the size of the processor's data caches.
				 */
				function updatewindow(strm, src, end, copy) {
					var dist;
					var state = strm.state;

					/* if it hasn't been done already, allocate space for the window */
					if (state.window === null) {
						state.wsize = 1 << state.wbits;
						state.wnext = 0;
						state.whave = 0;

						state.window = new utils.Buf8(state.wsize);
					}

					/* copy state->wsize or less output bytes into the circular window */
					if (copy >= state.wsize) {
						utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
						state.wnext = 0;
						state.whave = state.wsize;
					}
					else {
						dist = state.wsize - state.wnext;
						if (dist > copy) {
							dist = copy;
						}
						//zmemcpy(state->window + state->wnext, end - copy, dist);
						utils.arraySet(state.window, src, end - copy, dist, state.wnext);
						copy -= dist;
						if (copy) {
							//zmemcpy(state->window, end - copy, copy);
							utils.arraySet(state.window, src, end - copy, copy, 0);
							state.wnext = copy;
							state.whave = state.wsize;
						}
						else {
							state.wnext += dist;
							if (state.wnext === state.wsize) { state.wnext = 0; }
							if (state.whave < state.wsize) { state.whave += dist; }
						}
					}
					return 0;
				}

				function inflate(strm, flush) {
					var state;
					var input, output;          // input/output buffers
					var next;                   /* next input INDEX */
					var put;                    /* next output INDEX */
					var have, left;             /* available input and output */
					var hold;                   /* bit buffer */
					var bits;                   /* bits in bit buffer */
					var _in, _out;              /* save starting available input and output */
					var copy;                   /* number of stored or match bytes to copy */
					var from;                   /* where to copy match bytes from */
					var from_source;
					var here = 0;               /* current decoding table entry */
					var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
					//var last;                   /* parent table entry */
					var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
					var len;                    /* length to copy for repeats, bits to drop */
					var ret;                    /* return code */
					var hbuf = new utils.Buf8(4);    /* buffer for gzip header crc calculation */
					var opts;

					var n; // temporary var for NEED_BITS

					var order = /* permutation of code lengths */
						[16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];


					if (!strm || !strm.state || !strm.output ||
						(!strm.input && strm.avail_in !== 0)) {
						return Z_STREAM_ERROR;
					}

					state = strm.state;
					if (state.mode === TYPE) { state.mode = TYPEDO; }    /* skip check */


					//--- LOAD() ---
					put = strm.next_out;
					output = strm.output;
					left = strm.avail_out;
					next = strm.next_in;
					input = strm.input;
					have = strm.avail_in;
					hold = state.hold;
					bits = state.bits;
					//---

					_in = have;
					_out = left;
					ret = Z_OK;

					inf_leave: // goto emulation
					for (; ;) {
						switch (state.mode) {
							case HEAD:
								if (state.wrap === 0) {
									state.mode = TYPEDO;
									break;
								}
								//=== NEEDBITS(16);
								while (bits < 16) {
									if (have === 0) { break inf_leave; }
									have--;
									hold += input[next++] << bits;
									bits += 8;
								}
								//===//
								if ((state.wrap & 2) && hold === 0x8b1f) {  /* gzip header */
									state.check = 0/*crc32(0L, Z_NULL, 0)*/;
									//=== CRC2(state.check, hold);
									hbuf[0] = hold & 0xff;
									hbuf[1] = (hold >>> 8) & 0xff;
									state.check = crc32(state.check, hbuf, 2, 0);
									//===//

									//=== INITBITS();
									hold = 0;
									bits = 0;
									//===//
									state.mode = FLAGS;
									break;
								}
								state.flags = 0;           /* expect zlib header */
								if (state.head) {
									state.head.done = false;
								}
								if (!(state.wrap & 1) ||   /* check if zlib header allowed */
									(((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
									strm.msg = 'incorrect header check';
									state.mode = BAD;
									break;
								}
								if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
									strm.msg = 'unknown compression method';
									state.mode = BAD;
									break;
								}
								//--- DROPBITS(4) ---//
								hold >>>= 4;
								bits -= 4;
								//---//
								len = (hold & 0x0f)/*BITS(4)*/ + 8;
								if (state.wbits === 0) {
									state.wbits = len;
								}
								else if (len > state.wbits) {
									strm.msg = 'invalid window size';
									state.mode = BAD;
									break;
								}
								state.dmax = 1 << len;
								//Tracev((stderr, "inflate:   zlib header ok\n"));
								strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
								state.mode = hold & 0x200 ? DICTID : TYPE;
								//=== INITBITS();
								hold = 0;
								bits = 0;
								//===//
								break;
							case FLAGS:
								//=== NEEDBITS(16); */
								while (bits < 16) {
									if (have === 0) { break inf_leave; }
									have--;
									hold += input[next++] << bits;
									bits += 8;
								}
								//===//
								state.flags = hold;
								if ((state.flags & 0xff) !== Z_DEFLATED) {
									strm.msg = 'unknown compression method';
									state.mode = BAD;
									break;
								}
								if (state.flags & 0xe000) {
									strm.msg = 'unknown header flags set';
									state.mode = BAD;
									break;
								}
								if (state.head) {
									state.head.text = ((hold >> 8) & 1);
								}
								if (state.flags & 0x0200) {
									//=== CRC2(state.check, hold);
									hbuf[0] = hold & 0xff;
									hbuf[1] = (hold >>> 8) & 0xff;
									state.check = crc32(state.check, hbuf, 2, 0);
									//===//
								}
								//=== INITBITS();
								hold = 0;
								bits = 0;
								//===//
								state.mode = TIME;
							/* falls through */
							case TIME:
								//=== NEEDBITS(32); */
								while (bits < 32) {
									if (have === 0) { break inf_leave; }
									have--;
									hold += input[next++] << bits;
									bits += 8;
								}
								//===//
								if (state.head) {
									state.head.time = hold;
								}
								if (state.flags & 0x0200) {
									//=== CRC4(state.check, hold)
									hbuf[0] = hold & 0xff;
									hbuf[1] = (hold >>> 8) & 0xff;
									hbuf[2] = (hold >>> 16) & 0xff;
									hbuf[3] = (hold >>> 24) & 0xff;
									state.check = crc32(state.check, hbuf, 4, 0);
									//===
								}
								//=== INITBITS();
								hold = 0;
								bits = 0;
								//===//
								state.mode = OS;
							/* falls through */
							case OS:
								//=== NEEDBITS(16); */
								while (bits < 16) {
									if (have === 0) { break inf_leave; }
									have--;
									hold += input[next++] << bits;
									bits += 8;
								}
								//===//
								if (state.head) {
									state.head.xflags = (hold & 0xff);
									state.head.os = (hold >> 8);
								}
								if (state.flags & 0x0200) {
									//=== CRC2(state.check, hold);
									hbuf[0] = hold & 0xff;
									hbuf[1] = (hold >>> 8) & 0xff;
									state.check = crc32(state.check, hbuf, 2, 0);
									//===//
								}
								//=== INITBITS();
								hold = 0;
								bits = 0;
								//===//
								state.mode = EXLEN;
							/* falls through */
							case EXLEN:
								if (state.flags & 0x0400) {
									//=== NEEDBITS(16); */
									while (bits < 16) {
										if (have === 0) { break inf_leave; }
										have--;
										hold += input[next++] << bits;
										bits += 8;
									}
									//===//
									state.length = hold;
									if (state.head) {
										state.head.extra_len = hold;
									}
									if (state.flags & 0x0200) {
										//=== CRC2(state.check, hold);
										hbuf[0] = hold & 0xff;
										hbuf[1] = (hold >>> 8) & 0xff;
										state.check = crc32(state.check, hbuf, 2, 0);
										//===//
									}
									//=== INITBITS();
									hold = 0;
									bits = 0;
									//===//
								}
								else if (state.head) {
									state.head.extra = null/*Z_NULL*/;
								}
								state.mode = EXTRA;
							/* falls through */
							case EXTRA:
								if (state.flags & 0x0400) {
									copy = state.length;
									if (copy > have) { copy = have; }
									if (copy) {
										if (state.head) {
											len = state.head.extra_len - state.length;
											if (!state.head.extra) {
												// Use untyped array for more conveniend processing later
												state.head.extra = new Array(state.head.extra_len);
											}
											utils.arraySet(
												state.head.extra,
												input,
												next,
												// extra field is limited to 65536 bytes
												// - no need for additional size check
												copy,
												/*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
												len
											);
											//zmemcpy(state.head.extra + len, next,
											//        len + copy > state.head.extra_max ?
											//        state.head.extra_max - len : copy);
										}
										if (state.flags & 0x0200) {
											state.check = crc32(state.check, input, copy, next);
										}
										have -= copy;
										next += copy;
										state.length -= copy;
									}
									if (state.length) { break inf_leave; }
								}
								state.length = 0;
								state.mode = NAME;
							/* falls through */
							case NAME:
								if (state.flags & 0x0800) {
									if (have === 0) { break inf_leave; }
									copy = 0;
									do {
										// TODO: 2 or 1 bytes?
										len = input[next + copy++];
										/* use constant limit because in js we should not preallocate memory */
										if (state.head && len &&
											(state.length < 65536 /*state.head.name_max*/)) {
											state.head.name += String.fromCharCode(len);
										}
									} while (len && copy < have);

									if (state.flags & 0x0200) {
										state.check = crc32(state.check, input, copy, next);
									}
									have -= copy;
									next += copy;
									if (len) { break inf_leave; }
								}
								else if (state.head) {
									state.head.name = null;
								}
								state.length = 0;
								state.mode = COMMENT;
							/* falls through */
							case COMMENT:
								if (state.flags & 0x1000) {
									if (have === 0) { break inf_leave; }
									copy = 0;
									do {
										len = input[next + copy++];
										/* use constant limit because in js we should not preallocate memory */
										if (state.head && len &&
											(state.length < 65536 /*state.head.comm_max*/)) {
											state.head.comment += String.fromCharCode(len);
										}
									} while (len && copy < have);
									if (state.flags & 0x0200) {
										state.check = crc32(state.check, input, copy, next);
									}
									have -= copy;
									next += copy;
									if (len) { break inf_leave; }
								}
								else if (state.head) {
									state.head.comment = null;
								}
								state.mode = HCRC;
							/* falls through */
							case HCRC:
								if (state.flags & 0x0200) {
									//=== NEEDBITS(16); */
									while (bits < 16) {
										if (have === 0) { break inf_leave; }
										have--;
										hold += input[next++] << bits;
										bits += 8;
									}
									//===//
									if (hold !== (state.check & 0xffff)) {
										strm.msg = 'header crc mismatch';
										state.mode = BAD;
										break;
									}
									//=== INITBITS();
									hold = 0;
									bits = 0;
									//===//
								}
								if (state.head) {
									state.head.hcrc = ((state.flags >> 9) & 1);
									state.head.done = true;
								}
								strm.adler = state.check = 0;
								state.mode = TYPE;
								break;
							case DICTID:
								//=== NEEDBITS(32); */
								while (bits < 32) {
									if (have === 0) { break inf_leave; }
									have--;
									hold += input[next++] << bits;
									bits += 8;
								}
								//===//
								strm.adler = state.check = zswap32(hold);
								//=== INITBITS();
								hold = 0;
								bits = 0;
								//===//
								state.mode = DICT;
							/* falls through */
							case DICT:
								if (state.havedict === 0) {
									//--- RESTORE() ---
									strm.next_out = put;
									strm.avail_out = left;
									strm.next_in = next;
									strm.avail_in = have;
									state.hold = hold;
									state.bits = bits;
									//---
									return Z_NEED_DICT;
								}
								strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
								state.mode = TYPE;
							/* falls through */
							case TYPE:
								if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
							/* falls through */
							case TYPEDO:
								if (state.last) {
									//--- BYTEBITS() ---//
									hold >>>= bits & 7;
									bits -= bits & 7;
									//---//
									state.mode = CHECK;
									break;
								}
								//=== NEEDBITS(3); */
								while (bits < 3) {
									if (have === 0) { break inf_leave; }
									have--;
									hold += input[next++] << bits;
									bits += 8;
								}
								//===//
								state.last = (hold & 0x01)/*BITS(1)*/;
								//--- DROPBITS(1) ---//
								hold >>>= 1;
								bits -= 1;
								//---//

								switch ((hold & 0x03)/*BITS(2)*/) {
									case 0:                             /* stored block */
										//Tracev((stderr, "inflate:     stored block%s\n",
										//        state.last ? " (last)" : ""));
										state.mode = STORED;
										break;
									case 1:                             /* fixed block */
										fixedtables(state);
										//Tracev((stderr, "inflate:     fixed codes block%s\n",
										//        state.last ? " (last)" : ""));
										state.mode = LEN_;             /* decode codes */
										if (flush === Z_TREES) {
											//--- DROPBITS(2) ---//
											hold >>>= 2;
											bits -= 2;
											//---//
											break inf_leave;
										}
										break;
									case 2:                             /* dynamic block */
										//Tracev((stderr, "inflate:     dynamic codes block%s\n",
										//        state.last ? " (last)" : ""));
										state.mode = TABLE;
										break;
									case 3:
										strm.msg = 'invalid block type';
										state.mode = BAD;
								}
								//--- DROPBITS(2) ---//
								hold >>>= 2;
								bits -= 2;
								//---//
								break;
							case STORED:
								//--- BYTEBITS() ---// /* go to byte boundary */
								hold >>>= bits & 7;
								bits -= bits & 7;
								//---//
								//=== NEEDBITS(32); */
								while (bits < 32) {
									if (have === 0) { break inf_leave; }
									have--;
									hold += input[next++] << bits;
									bits += 8;
								}
								//===//
								if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
									strm.msg = 'invalid stored block lengths';
									state.mode = BAD;
									break;
								}
								state.length = hold & 0xffff;
								//Tracev((stderr, "inflate:       stored length %u\n",
								//        state.length));
								//=== INITBITS();
								hold = 0;
								bits = 0;
								//===//
								state.mode = COPY_;
								if (flush === Z_TREES) { break inf_leave; }
							/* falls through */
							case COPY_:
								state.mode = COPY;
							/* falls through */
							case COPY:
								copy = state.length;
								if (copy) {
									if (copy > have) { copy = have; }
									if (copy > left) { copy = left; }
									if (copy === 0) { break inf_leave; }
									//--- zmemcpy(put, next, copy); ---
									utils.arraySet(output, input, next, copy, put);
									//---//
									have -= copy;
									next += copy;
									left -= copy;
									put += copy;
									state.length -= copy;
									break;
								}
								//Tracev((stderr, "inflate:       stored end\n"));
								state.mode = TYPE;
								break;
							case TABLE:
								//=== NEEDBITS(14); */
								while (bits < 14) {
									if (have === 0) { break inf_leave; }
									have--;
									hold += input[next++] << bits;
									bits += 8;
								}
								//===//
								state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
								//--- DROPBITS(5) ---//
								hold >>>= 5;
								bits -= 5;
								//---//
								state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
								//--- DROPBITS(5) ---//
								hold >>>= 5;
								bits -= 5;
								//---//
								state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
								//--- DROPBITS(4) ---//
								hold >>>= 4;
								bits -= 4;
								//---//
								//#ifndef PKZIP_BUG_WORKAROUND
								if (state.nlen > 286 || state.ndist > 30) {
									strm.msg = 'too many length or distance symbols';
									state.mode = BAD;
									break;
								}
								//#endif
								//Tracev((stderr, "inflate:       table sizes ok\n"));
								state.have = 0;
								state.mode = LENLENS;
							/* falls through */
							case LENLENS:
								while (state.have < state.ncode) {
									//=== NEEDBITS(3);
									while (bits < 3) {
										if (have === 0) { break inf_leave; }
										have--;
										hold += input[next++] << bits;
										bits += 8;
									}
									//===//
									state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
									//--- DROPBITS(3) ---//
									hold >>>= 3;
									bits -= 3;
									//---//
								}
								while (state.have < 19) {
									state.lens[order[state.have++]] = 0;
								}
								// We have separate tables & no pointers. 2 commented lines below not needed.
								//state.next = state.codes;
								//state.lencode = state.next;
								// Switch to use dynamic table
								state.lencode = state.lendyn;
								state.lenbits = 7;

								opts = { bits: state.lenbits };
								ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
								state.lenbits = opts.bits;

								if (ret) {
									strm.msg = 'invalid code lengths set';
									state.mode = BAD;
									break;
								}
								//Tracev((stderr, "inflate:       code lengths ok\n"));
								state.have = 0;
								state.mode = CODELENS;
							/* falls through */
							case CODELENS:
								while (state.have < state.nlen + state.ndist) {
									for (; ;) {
										here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
										here_bits = here >>> 24;
										here_op = (here >>> 16) & 0xff;
										here_val = here & 0xffff;

										if ((here_bits) <= bits) { break; }
										//--- PULLBYTE() ---//
										if (have === 0) { break inf_leave; }
										have--;
										hold += input[next++] << bits;
										bits += 8;
										//---//
									}
									if (here_val < 16) {
										//--- DROPBITS(here.bits) ---//
										hold >>>= here_bits;
										bits -= here_bits;
										//---//
										state.lens[state.have++] = here_val;
									}
									else {
										if (here_val === 16) {
											//=== NEEDBITS(here.bits + 2);
											n = here_bits + 2;
											while (bits < n) {
												if (have === 0) { break inf_leave; }
												have--;
												hold += input[next++] << bits;
												bits += 8;
											}
											//===//
											//--- DROPBITS(here.bits) ---//
											hold >>>= here_bits;
											bits -= here_bits;
											//---//
											if (state.have === 0) {
												strm.msg = 'invalid bit length repeat';
												state.mode = BAD;
												break;
											}
											len = state.lens[state.have - 1];
											copy = 3 + (hold & 0x03);//BITS(2);
											//--- DROPBITS(2) ---//
											hold >>>= 2;
											bits -= 2;
											//---//
										}
										else if (here_val === 17) {
											//=== NEEDBITS(here.bits + 3);
											n = here_bits + 3;
											while (bits < n) {
												if (have === 0) { break inf_leave; }
												have--;
												hold += input[next++] << bits;
												bits += 8;
											}
											//===//
											//--- DROPBITS(here.bits) ---//
											hold >>>= here_bits;
											bits -= here_bits;
											//---//
											len = 0;
											copy = 3 + (hold & 0x07);//BITS(3);
											//--- DROPBITS(3) ---//
											hold >>>= 3;
											bits -= 3;
											//---//
										}
										else {
											//=== NEEDBITS(here.bits + 7);
											n = here_bits + 7;
											while (bits < n) {
												if (have === 0) { break inf_leave; }
												have--;
												hold += input[next++] << bits;
												bits += 8;
											}
											//===//
											//--- DROPBITS(here.bits) ---//
											hold >>>= here_bits;
											bits -= here_bits;
											//---//
											len = 0;
											copy = 11 + (hold & 0x7f);//BITS(7);
											//--- DROPBITS(7) ---//
											hold >>>= 7;
											bits -= 7;
											//---//
										}
										if (state.have + copy > state.nlen + state.ndist) {
											strm.msg = 'invalid bit length repeat';
											state.mode = BAD;
											break;
										}
										while (copy--) {
											state.lens[state.have++] = len;
										}
									}
								}

								/* handle error breaks in while */
								if (state.mode === BAD) { break; }

								/* check for end-of-block code (better have one) */
								if (state.lens[256] === 0) {
									strm.msg = 'invalid code -- missing end-of-block';
									state.mode = BAD;
									break;
								}

								/* build code tables -- note: do not change the lenbits or distbits
								   values here (9 and 6) without reading the comments in inftrees.h
								   concerning the ENOUGH constants, which depend on those values */
								state.lenbits = 9;

								opts = { bits: state.lenbits };
								ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
								// We have separate tables & no pointers. 2 commented lines below not needed.
								// state.next_index = opts.table_index;
								state.lenbits = opts.bits;
								// state.lencode = state.next;

								if (ret) {
									strm.msg = 'invalid literal/lengths set';
									state.mode = BAD;
									break;
								}

								state.distbits = 6;
								//state.distcode.copy(state.codes);
								// Switch to use dynamic table
								state.distcode = state.distdyn;
								opts = { bits: state.distbits };
								ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
								// We have separate tables & no pointers. 2 commented lines below not needed.
								// state.next_index = opts.table_index;
								state.distbits = opts.bits;
								// state.distcode = state.next;

								if (ret) {
									strm.msg = 'invalid distances set';
									state.mode = BAD;
									break;
								}
								//Tracev((stderr, 'inflate:       codes ok\n'));
								state.mode = LEN_;
								if (flush === Z_TREES) { break inf_leave; }
							/* falls through */
							case LEN_:
								state.mode = LEN;
							/* falls through */
							case LEN:
								if (have >= 6 && left >= 258) {
									//--- RESTORE() ---
									strm.next_out = put;
									strm.avail_out = left;
									strm.next_in = next;
									strm.avail_in = have;
									state.hold = hold;
									state.bits = bits;
									//---
									inflate_fast(strm, _out);
									//--- LOAD() ---
									put = strm.next_out;
									output = strm.output;
									left = strm.avail_out;
									next = strm.next_in;
									input = strm.input;
									have = strm.avail_in;
									hold = state.hold;
									bits = state.bits;
									//---

									if (state.mode === TYPE) {
										state.back = -1;
									}
									break;
								}
								state.back = 0;
								for (; ;) {
									here = state.lencode[hold & ((1 << state.lenbits) - 1)];  /*BITS(state.lenbits)*/
									here_bits = here >>> 24;
									here_op = (here >>> 16) & 0xff;
									here_val = here & 0xffff;

									if (here_bits <= bits) { break; }
									//--- PULLBYTE() ---//
									if (have === 0) { break inf_leave; }
									have--;
									hold += input[next++] << bits;
									bits += 8;
									//---//
								}
								if (here_op && (here_op & 0xf0) === 0) {
									last_bits = here_bits;
									last_op = here_op;
									last_val = here_val;
									for (; ;) {
										here = state.lencode[last_val +
											((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
										here_bits = here >>> 24;
										here_op = (here >>> 16) & 0xff;
										here_val = here & 0xffff;

										if ((last_bits + here_bits) <= bits) { break; }
										//--- PULLBYTE() ---//
										if (have === 0) { break inf_leave; }
										have--;
										hold += input[next++] << bits;
										bits += 8;
										//---//
									}
									//--- DROPBITS(last.bits) ---//
									hold >>>= last_bits;
									bits -= last_bits;
									//---//
									state.back += last_bits;
								}
								//--- DROPBITS(here.bits) ---//
								hold >>>= here_bits;
								bits -= here_bits;
								//---//
								state.back += here_bits;
								state.length = here_val;
								if (here_op === 0) {
									//Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
									//        "inflate:         literal '%c'\n" :
									//        "inflate:         literal 0x%02x\n", here.val));
									state.mode = LIT;
									break;
								}
								if (here_op & 32) {
									//Tracevv((stderr, "inflate:         end of block\n"));
									state.back = -1;
									state.mode = TYPE;
									break;
								}
								if (here_op & 64) {
									strm.msg = 'invalid literal/length code';
									state.mode = BAD;
									break;
								}
								state.extra = here_op & 15;
								state.mode = LENEXT;
							/* falls through */
							case LENEXT:
								if (state.extra) {
									//=== NEEDBITS(state.extra);
									n = state.extra;
									while (bits < n) {
										if (have === 0) { break inf_leave; }
										have--;
										hold += input[next++] << bits;
										bits += 8;
									}
									//===//
									state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
									//--- DROPBITS(state.extra) ---//
									hold >>>= state.extra;
									bits -= state.extra;
									//---//
									state.back += state.extra;
								}
								//Tracevv((stderr, "inflate:         length %u\n", state.length));
								state.was = state.length;
								state.mode = DIST;
							/* falls through */
							case DIST:
								for (; ;) {
									here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
									here_bits = here >>> 24;
									here_op = (here >>> 16) & 0xff;
									here_val = here & 0xffff;

									if ((here_bits) <= bits) { break; }
									//--- PULLBYTE() ---//
									if (have === 0) { break inf_leave; }
									have--;
									hold += input[next++] << bits;
									bits += 8;
									//---//
								}
								if ((here_op & 0xf0) === 0) {
									last_bits = here_bits;
									last_op = here_op;
									last_val = here_val;
									for (; ;) {
										here = state.distcode[last_val +
											((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
										here_bits = here >>> 24;
										here_op = (here >>> 16) & 0xff;
										here_val = here & 0xffff;

										if ((last_bits + here_bits) <= bits) { break; }
										//--- PULLBYTE() ---//
										if (have === 0) { break inf_leave; }
										have--;
										hold += input[next++] << bits;
										bits += 8;
										//---//
									}
									//--- DROPBITS(last.bits) ---//
									hold >>>= last_bits;
									bits -= last_bits;
									//---//
									state.back += last_bits;
								}
								//--- DROPBITS(here.bits) ---//
								hold >>>= here_bits;
								bits -= here_bits;
								//---//
								state.back += here_bits;
								if (here_op & 64) {
									strm.msg = 'invalid distance code';
									state.mode = BAD;
									break;
								}
								state.offset = here_val;
								state.extra = (here_op) & 15;
								state.mode = DISTEXT;
							/* falls through */
							case DISTEXT:
								if (state.extra) {
									//=== NEEDBITS(state.extra);
									n = state.extra;
									while (bits < n) {
										if (have === 0) { break inf_leave; }
										have--;
										hold += input[next++] << bits;
										bits += 8;
									}
									//===//
									state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
									//--- DROPBITS(state.extra) ---//
									hold >>>= state.extra;
									bits -= state.extra;
									//---//
									state.back += state.extra;
								}
								//#ifdef INFLATE_STRICT
								if (state.offset > state.dmax) {
									strm.msg = 'invalid distance too far back';
									state.mode = BAD;
									break;
								}
								//#endif
								//Tracevv((stderr, "inflate:         distance %u\n", state.offset));
								state.mode = MATCH;
							/* falls through */
							case MATCH:
								if (left === 0) { break inf_leave; }
								copy = _out - left;
								if (state.offset > copy) {         /* copy from window */
									copy = state.offset - copy;
									if (copy > state.whave) {
										if (state.sane) {
											strm.msg = 'invalid distance too far back';
											state.mode = BAD;
											break;
										}
										// (!) This block is disabled in zlib defailts,
										// don't enable it for binary compatibility
										//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
										//          Trace((stderr, "inflate.c too far\n"));
										//          copy -= state.whave;
										//          if (copy > state.length) { copy = state.length; }
										//          if (copy > left) { copy = left; }
										//          left -= copy;
										//          state.length -= copy;
										//          do {
										//            output[put++] = 0;
										//          } while (--copy);
										//          if (state.length === 0) { state.mode = LEN; }
										//          break;
										//#endif
									}
									if (copy > state.wnext) {
										copy -= state.wnext;
										from = state.wsize - copy;
									}
									else {
										from = state.wnext - copy;
									}
									if (copy > state.length) { copy = state.length; }
									from_source = state.window;
								}
								else {                              /* copy from output */
									from_source = output;
									from = put - state.offset;
									copy = state.length;
								}
								if (copy > left) { copy = left; }
								left -= copy;
								state.length -= copy;
								do {
									output[put++] = from_source[from++];
								} while (--copy);
								if (state.length === 0) { state.mode = LEN; }
								break;
							case LIT:
								if (left === 0) { break inf_leave; }
								output[put++] = state.length;
								left--;
								state.mode = LEN;
								break;
							case CHECK:
								if (state.wrap) {
									//=== NEEDBITS(32);
									while (bits < 32) {
										if (have === 0) { break inf_leave; }
										have--;
										// Use '|' insdead of '+' to make sure that result is signed
										hold |= input[next++] << bits;
										bits += 8;
									}
									//===//
									_out -= left;
									strm.total_out += _out;
									state.total += _out;
									if (_out) {
										strm.adler = state.check =
											/*UPDATE(state.check, put - _out, _out);*/
											(state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));

									}
									_out = left;
									// NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
									if ((state.flags ? hold : zswap32(hold)) !== state.check) {
										strm.msg = 'incorrect data check';
										state.mode = BAD;
										break;
									}
									//=== INITBITS();
									hold = 0;
									bits = 0;
									//===//
									//Tracev((stderr, "inflate:   check matches trailer\n"));
								}
								state.mode = LENGTH;
							/* falls through */
							case LENGTH:
								if (state.wrap && state.flags) {
									//=== NEEDBITS(32);
									while (bits < 32) {
										if (have === 0) { break inf_leave; }
										have--;
										hold += input[next++] << bits;
										bits += 8;
									}
									//===//
									if (hold !== (state.total & 0xffffffff)) {
										strm.msg = 'incorrect length check';
										state.mode = BAD;
										break;
									}
									//=== INITBITS();
									hold = 0;
									bits = 0;
									//===//
									//Tracev((stderr, "inflate:   length matches trailer\n"));
								}
								state.mode = DONE;
							/* falls through */
							case DONE:
								ret = Z_STREAM_END;
								break inf_leave;
							case BAD:
								ret = Z_DATA_ERROR;
								break inf_leave;
							case MEM:
								return Z_MEM_ERROR;
							case SYNC:
							/* falls through */
							default:
								return Z_STREAM_ERROR;
						}
					}

					// inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"

					/*
					   Return from inflate(), updating the total counts and the check value.
					   If there was no progress during the inflate() call, return a buffer
					   error.  Call updatewindow() to create and/or update the window state.
					   Note: a memory error from inflate() is non-recoverable.
					 */

					//--- RESTORE() ---
					strm.next_out = put;
					strm.avail_out = left;
					strm.next_in = next;
					strm.avail_in = have;
					state.hold = hold;
					state.bits = bits;
					//---

					if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
						(state.mode < CHECK || flush !== Z_FINISH))) {
						if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
							state.mode = MEM;
							return Z_MEM_ERROR;
						}
					}
					_in -= strm.avail_in;
					_out -= strm.avail_out;
					strm.total_in += _in;
					strm.total_out += _out;
					state.total += _out;
					if (state.wrap && _out) {
						strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
							(state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
					}
					strm.data_type = state.bits + (state.last ? 64 : 0) +
						(state.mode === TYPE ? 128 : 0) +
						(state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
					if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
						ret = Z_BUF_ERROR;
					}
					return ret;
				}

				function inflateEnd(strm) {

					if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
						return Z_STREAM_ERROR;
					}

					var state = strm.state;
					if (state.window) {
						state.window = null;
					}
					strm.state = null;
					return Z_OK;
				}

				function inflateGetHeader(strm, head) {
					var state;

					/* check state */
					if (!strm || !strm.state) { return Z_STREAM_ERROR; }
					state = strm.state;
					if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }

					/* save header structure */
					state.head = head;
					head.done = false;
					return Z_OK;
				}

				function inflateSetDictionary(strm, dictionary) {
					var dictLength = dictionary.length;

					var state;
					var dictid;
					var ret;

					/* check state */
					if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
					state = strm.state;

					if (state.wrap !== 0 && state.mode !== DICT) {
						return Z_STREAM_ERROR;
					}

					/* check for correct dictionary identifier */
					if (state.mode === DICT) {
						dictid = 1; /* adler32(0, null, 0)*/
						/* dictid = adler32(dictid, dictionary, dictLength); */
						dictid = adler32(dictid, dictionary, dictLength, 0);
						if (dictid !== state.check) {
							return Z_DATA_ERROR;
						}
					}
					/* copy dictionary to window using updatewindow(), which will amend the
					 existing dictionary if appropriate */
					ret = updatewindow(strm, dictionary, dictLength, dictLength);
					if (ret) {
						state.mode = MEM;
						return Z_MEM_ERROR;
					}
					state.havedict = 1;
					// Tracev((stderr, "inflate:   dictionary set\n"));
					return Z_OK;
				}

				localExports.inflateReset = inflateReset;
				localExports.inflateReset2 = inflateReset2;
				localExports.inflateResetKeep = inflateResetKeep;
				localExports.inflateInit = inflateInit;
				localExports.inflateInit2 = inflateInit2;
				localExports.inflate = inflate;
				localExports.inflateEnd = inflateEnd;
				localExports.inflateGetHeader = inflateGetHeader;
				localExports.inflateSetDictionary = inflateSetDictionary;
				localExports.inflateInfo = 'pako inflate (from Nodeca project)';

				/* Not implemented
				localExports.inflateCopy = inflateCopy;
				localExports.inflateGetDictionary = inflateGetDictionary;
				localExports.inflateMark = inflateMark;
				localExports.inflatePrime = inflatePrime;
				localExports.inflateSync = inflateSync;
				localExports.inflateSyncPoint = inflateSyncPoint;
				localExports.inflateUndermine = inflateUndermine;
				*/

			}, { "../utils/common": 175, "./adler32": 176, "./crc32": 178, "./inffast": 180, "./inftrees": 182 }], 182: [function (localRequire, localModule, localExports) {
				'use strict';


				var utils = localRequire('../utils/common');

				var MAXBITS = 15;
				var ENOUGH_LENS = 852;
				var ENOUGH_DISTS = 592;
				//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);

				var CODES = 0;
				var LENS = 1;
				var DISTS = 2;

				var lbase = [ /* Length codes 257..285 base */
					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, 0, 0
				];

				var lext = [ /* Length codes 257..285 extra */
					16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
					19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
				];

				var dbase = [ /* Distance codes 0..29 base */
					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, 0, 0
				];

				var dext = [ /* Distance codes 0..29 extra */
					16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
					23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
					28, 28, 29, 29, 64, 64
				];

				localModule.localExports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {
					var bits = opts.bits;
					//here = opts.here; /* table entry for duplication */

					var len = 0;               /* a code's length in bits */
					var sym = 0;               /* index of code symbols */
					var min = 0, max = 0;          /* minimum and maximum code lengths */
					var root = 0;              /* number of index bits for root table */
					var curr = 0;              /* number of index bits for current table */
					var drop = 0;              /* code bits to drop for sub-table */
					var left = 0;                   /* number of prefix codes available */
					var used = 0;              /* code entries in table used */
					var huff = 0;              /* Huffman code */
					var incr;              /* for incrementing code, index */
					var fill;              /* index for replicating entries */
					var low;               /* low bits for current root entry */
					var mask;              /* mask for low root bits */
					var next;             /* next available space in table */
					var base = null;     /* base value table to use */
					var base_index = 0;
					//  var shoextra;    /* extra bits table to use */
					var end;                    /* use base and extra for symbol > end */
					var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];    /* number of codes of each length */
					var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];     /* offsets in table for each length */
					var extra = null;
					var extra_index = 0;

					var here_bits, here_op, here_val;

					/*
					 Process a set of code lengths to create a canonical Huffman code.  The
					 code lengths are lens[0..codes-1].  Each length corresponds to the
					 symbols 0..codes-1.  The Huffman code is generated by first sorting the
					 symbols by length from short to long, and retaining the symbol order
					 for codes with equal lengths.  Then the code starts with all zero bits
					 for the first code of the shortest length, and the codes are integer
					 increments for the same length, and zeros are appended as the length
					 increases.  For the deflate format, these bits are stored backwards
					 from their more natural integer increment ordering, and so when the
					 decoding tables are built in the large loop below, the integer codes
					 are incremented backwards.
				  
					 This routine assumes, but does not check, that all of the entries in
					 lens[] are in the range 0..MAXBITS.  The caller must assure this.
					 1..MAXBITS is interpreted as that code length.  zero means that that
					 symbol does not occur in this code.
				  
					 The codes are sorted by computing a count of codes for each length,
					 creating from that a table of starting indices for each length in the
					 sorted table, and then entering the symbols in order in the sorted
					 table.  The sorted table is work[], with that space being provided by
					 the caller.
				  
					 The length counts are used for other purposes as well, i.e. finding
					 the minimum and maximum length codes, determining if there are any
					 codes at all, checking for a valid set of lengths, and looking ahead
					 at length counts to determine sub-table sizes when building the
					 decoding tables.
					 */

					/* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
					for (len = 0; len <= MAXBITS; len++) {
						count[len] = 0;
					}
					for (sym = 0; sym < codes; sym++) {
						count[lens[lens_index + sym]]++;
					}

					/* bound code lengths, force root to be within code lengths */
					root = bits;
					for (max = MAXBITS; max >= 1; max--) {
						if (count[max] !== 0) { break; }
					}
					if (root > max) {
						root = max;
					}
					if (max === 0) {                     /* no symbols to code at all */
						//table.op[opts.table_index] = 64;  //here.op = (var char)64;    /* invalid code marker */
						//table.bits[opts.table_index] = 1;   //here.bits = (var char)1;
						//table.val[opts.table_index++] = 0;   //here.val = (var short)0;
						table[table_index++] = (1 << 24) | (64 << 16) | 0;


						//table.op[opts.table_index] = 64;
						//table.bits[opts.table_index] = 1;
						//table.val[opts.table_index++] = 0;
						table[table_index++] = (1 << 24) | (64 << 16) | 0;

						opts.bits = 1;
						return 0;     /* no symbols, but wait for decoding to report error */
					}
					for (min = 1; min < max; min++) {
						if (count[min] !== 0) { break; }
					}
					if (root < min) {
						root = min;
					}

					/* check for an over-subscribed or incomplete set of lengths */
					left = 1;
					for (len = 1; len <= MAXBITS; len++) {
						left <<= 1;
						left -= count[len];
						if (left < 0) {
							return -1;
						}        /* over-subscribed */
					}
					if (left > 0 && (type === CODES || max !== 1)) {
						return -1;                      /* incomplete set */
					}

					/* generate offsets into symbol table for each length for sorting */
					offs[1] = 0;
					for (len = 1; len < MAXBITS; len++) {
						offs[len + 1] = offs[len] + count[len];
					}

					/* sort symbols by length, by symbol order within each length */
					for (sym = 0; sym < codes; sym++) {
						if (lens[lens_index + sym] !== 0) {
							work[offs[lens[lens_index + sym]]++] = sym;
						}
					}

					/*
					 Create and fill in decoding tables.  In this loop, the table being
					 filled is at next and has curr index bits.  The code being used is huff
					 with length len.  That code is converted to an index by dropping drop
					 bits off of the bottom.  For codes where len is less than drop + curr,
					 those top drop + curr - len bits are incremented through all values to
					 fill the table with replicated entries.
				  
					 root is the number of index bits for the root table.  When len exceeds
					 root, sub-tables are created pointed to by the root entry with an index
					 of the low root bits of huff.  This is saved in low to check for when a
					 new sub-table should be started.  drop is zero when the root table is
					 being filled, and drop is root when sub-tables are being filled.
				  
					 When a new sub-table is needed, it is necessary to look ahead in the
					 code lengths to determine what size sub-table is needed.  The length
					 counts are used for this, and so count[] is decremented as codes are
					 entered in the tables.
				  
					 used keeps track of how many table entries have been allocated from the
					 provided *table space.  It is checked for LENS and DIST tables against
					 the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
					 the initial root table size constants.  See the comments in inftrees.h
					 for more information.
				  
					 sym increments through all symbols, and the loop terminates when
					 all codes of length max, i.e. all codes, have been processed.  This
					 routine permits incomplete codes, so another loop after this one fills
					 in the rest of the decoding tables with invalid code markers.
					 */

					/* set up for code type */
					// poor man optimization - use if-else instead of switch,
					// to avoid deopts in old v8
					if (type === CODES) {
						base = extra = work;    /* dummy value--not used */
						end = 19;

					} else if (type === LENS) {
						base = lbase;
						base_index -= 257;
						extra = lext;
						extra_index -= 257;
						end = 256;

					} else {                    /* DISTS */
						base = dbase;
						extra = dext;
						end = -1;
					}

					/* initialize opts for loop */
					huff = 0;                   /* starting code */
					sym = 0;                    /* starting code symbol */
					len = min;                  /* starting code length */
					next = table_index;              /* current table to fill in */
					curr = root;                /* current table index bits */
					drop = 0;                   /* current bits to drop from code for index */
					low = -1;                   /* trigger new sub-table when len > root */
					used = 1 << root;          /* use root table entries */
					mask = used - 1;            /* mask for comparing low */

					/* check available table space */
					if ((type === LENS && used > ENOUGH_LENS) ||
						(type === DISTS && used > ENOUGH_DISTS)) {
						return 1;
					}

					var i = 0;
					/* process all codes and make table entries */
					for (; ;) {
						i++;
						/* create table entry */
						here_bits = len - drop;
						if (work[sym] < end) {
							here_op = 0;
							here_val = work[sym];
						}
						else if (work[sym] > end) {
							here_op = extra[extra_index + work[sym]];
							here_val = base[base_index + work[sym]];
						}
						else {
							here_op = 32 + 64;         /* end of block */
							here_val = 0;
						}

						/* replicate for those indices with low len bits equal to huff */
						incr = 1 << (len - drop);
						fill = 1 << curr;
						min = fill;                 /* save offset to next table */
						do {
							fill -= incr;
							table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val | 0;
						} while (fill !== 0);

						/* backwards increment the len-bit code huff */
						incr = 1 << (len - 1);
						while (huff & incr) {
							incr >>= 1;
						}
						if (incr !== 0) {
							huff &= incr - 1;
							huff += incr;
						} else {
							huff = 0;
						}

						/* go to next symbol, update count, len */
						sym++;
						if (--count[len] === 0) {
							if (len === max) { break; }
							len = lens[lens_index + work[sym]];
						}

						/* create new sub-table if needed */
						if (len > root && (huff & mask) !== low) {
							/* if first time, transition to sub-tables */
							if (drop === 0) {
								drop = root;
							}

							/* increment past last table */
							next += min;            /* here min is 1 << curr */

							/* determine length of next table */
							curr = len - drop;
							left = 1 << curr;
							while (curr + drop < max) {
								left -= count[curr + drop];
								if (left <= 0) { break; }
								curr++;
								left <<= 1;
							}

							/* check for enough space */
							used += 1 << curr;
							if ((type === LENS && used > ENOUGH_LENS) ||
								(type === DISTS && used > ENOUGH_DISTS)) {
								return 1;
							}

							/* point entry in root table to sub-table */
							low = huff & mask;
							/*table.op[low] = curr;
							table.bits[low] = root;
							table.val[low] = next - opts.table_index;*/
							table[low] = (root << 24) | (curr << 16) | (next - table_index) | 0;
						}
					}

					/* fill in remaining table entry if code is incomplete (guaranteed to have
					 at most one remaining entry, since if the code is incomplete, the
					 maximum code length that was allowed to get this far is one bit) */
					if (huff !== 0) {
						//table.op[next + huff] = 64;            /* invalid code marker */
						//table.bits[next + huff] = len - drop;
						//table.val[next + huff] = 0;
						table[next + huff] = ((len - drop) << 24) | (64 << 16) | 0;
					}

					/* set return parameters */
					//opts.table_index += used;
					opts.bits = root;
					return 0;
				};

			}, { "../utils/common": 175 }], 183: [function (localRequire, localModule, localExports) {
				'use strict';

				localModule.localExports = {
					2: 'need dictionary',     /* Z_NEED_DICT       2  */
					1: 'stream end',          /* Z_STREAM_END      1  */
					0: '',                    /* Z_OK              0  */
					'-1': 'file error',          /* Z_ERRNO         (-1) */
					'-2': 'stream error',        /* Z_STREAM_ERROR  (-2) */
					'-3': 'data error',          /* Z_DATA_ERROR    (-3) */
					'-4': 'insufficient memory', /* Z_MEM_ERROR     (-4) */
					'-5': 'buffer error',        /* Z_BUF_ERROR     (-5) */
					'-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
				};

			}, {}], 184: [function (localRequire, localModule, localExports) {
				'use strict';


				var utils = localRequire('../utils/common');

				/* Public constants ==========================================================*/
				/* ===========================================================================*/


				//var Z_FILTERED          = 1;
				//var Z_HUFFMAN_ONLY      = 2;
				//var Z_RLE               = 3;
				var Z_FIXED = 4;
				//var Z_DEFAULT_STRATEGY  = 0;

				/* Possible values of the data_type field (though see inflate()) */
				var Z_BINARY = 0;
				var Z_TEXT = 1;
				//var Z_ASCII             = 1; // = Z_TEXT
				var Z_UNKNOWN = 2;

				/*============================================================================*/


				function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }

				// From zutil.h

				var STORED_BLOCK = 0;
				var STATIC_TREES = 1;
				var DYN_TREES = 2;
				/* The three kinds of block type */

				var MIN_MATCH = 3;
				var MAX_MATCH = 258;
				/* The minimum and maximum match lengths */

				// From deflate.h
				/* ===========================================================================
				 * Internal compression state.
				 */

				var LENGTH_CODES = 29;
				/* number of length codes, not counting the special END_BLOCK code */

				var LITERALS = 256;
				/* number of literal bytes 0..255 */

				var L_CODES = LITERALS + 1 + LENGTH_CODES;
				/* number of Literal or Length codes, including the END_BLOCK code */

				var D_CODES = 30;
				/* number of distance codes */

				var BL_CODES = 19;
				/* number of codes used to transfer the bit lengths */

				var HEAP_SIZE = 2 * L_CODES + 1;
				/* maximum heap size */

				var MAX_BITS = 15;
				/* All codes must not exceed MAX_BITS bits */

				var Buf_size = 16;
				/* size of bit buffer in bi_buf */


				/* ===========================================================================
				 * Constants
				 */

				var MAX_BL_BITS = 7;
				/* Bit length codes must not exceed MAX_BL_BITS bits */

				var END_BLOCK = 256;
				/* end of block literal code */

				var REP_3_6 = 16;
				/* repeat previous bit length 3-6 times (2 bits of repeat count) */

				var REPZ_3_10 = 17;
				/* repeat a zero length 3-10 times  (3 bits of repeat count) */

				var REPZ_11_138 = 18;
				/* repeat a zero length 11-138 times  (7 bits of repeat count) */

				/* eslint-disable comma-spacing,array-bracket-spacing */
				var extra_lbits =   /* extra bits for each length code */
					[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];

				var extra_dbits =   /* extra bits for each distance code */
					[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];

				var extra_blbits =  /* extra bits for each bit length code */
					[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];

				var bl_order =
					[16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
				/* eslint-enable comma-spacing,array-bracket-spacing */

				/* The lengths of the bit length codes are sent in order of decreasing
				 * probability, to avoid transmitting the lengths for unused bit length codes.
				 */

				/* ===========================================================================
				 * Local data. These are initialized only once.
				 */

				// We pre-fill arrays with 0 to avoid uninitialized gaps

				var DIST_CODE_LEN = 512; /* see definition of array dist_code below */

				// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1
				var static_ltree = new Array((L_CODES + 2) * 2);
				zero(static_ltree);
				/* The static literal tree. Since the bit lengths are imposed, there is no
				 * need for the L_CODES extra codes used during heap construction. However
				 * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
				 * below).
				 */

				var static_dtree = new Array(D_CODES * 2);
				zero(static_dtree);
				/* The static distance tree. (Actually a trivial tree since all codes use
				 * 5 bits.)
				 */

				var _dist_code = new Array(DIST_CODE_LEN);
				zero(_dist_code);
				/* Distance codes. The first 256 values correspond to the distances
				 * 3 .. 258, the last 256 values correspond to the top 8 bits of
				 * the 15 bit distances.
				 */

				var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);
				zero(_length_code);
				/* length code for each normalized match length (0 == MIN_MATCH) */

				var base_length = new Array(LENGTH_CODES);
				zero(base_length);
				/* First normalized length for each code (0 = MIN_MATCH) */

				var base_dist = new Array(D_CODES);
				zero(base_dist);
				/* First normalized distance for each code (0 = distance of 1) */


				function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {

					this.static_tree = static_tree;  /* static tree or NULL */
					this.extra_bits = extra_bits;   /* extra bits for each code or NULL */
					this.extra_base = extra_base;   /* base index for extra_bits */
					this.elems = elems;        /* max number of elements in the tree */
					this.max_length = max_length;   /* max bit length for the codes */

					// show if `static_tree` has data or dummy - needed for monomorphic objects
					this.has_stree = static_tree && static_tree.length;
				}


				var static_l_desc;
				var static_d_desc;
				var static_bl_desc;


				function TreeDesc(dyn_tree, stat_desc) {
					this.dyn_tree = dyn_tree;     /* the dynamic tree */
					this.max_code = 0;            /* largest code with non zero frequency */
					this.stat_desc = stat_desc;   /* the corresponding static tree */
				}



				function d_code(dist) {
					return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
				}


				/* ===========================================================================
				 * Output a short LSB first on the stream.
				 * IN assertion: there is enough room in pendingBuf.
				 */
				function put_short(s, w) {
					//    put_byte(s, (uch)((w) & 0xff));
					//    put_byte(s, (uch)((ush)(w) >> 8));
					s.pending_buf[s.pending++] = (w) & 0xff;
					s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
				}


				/* ===========================================================================
				 * Send a value on a given number of bits.
				 * IN assertion: length <= 16 and value fits in length bits.
				 */
				function send_bits(s, value, length) {
					if (s.bi_valid > (Buf_size - length)) {
						s.bi_buf |= (value << s.bi_valid) & 0xffff;
						put_short(s, s.bi_buf);
						s.bi_buf = value >> (Buf_size - s.bi_valid);
						s.bi_valid += length - Buf_size;
					} else {
						s.bi_buf |= (value << s.bi_valid) & 0xffff;
						s.bi_valid += length;
					}
				}


				function send_code(s, c, tree) {
					send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);
				}


				/* ===========================================================================
				 * Reverse the first len bits of a code, using straightforward code (a faster
				 * method would use a table)
				 * IN assertion: 1 <= len <= 15
				 */
				function bi_reverse(code, len) {
					var res = 0;
					do {
						res |= code & 1;
						code >>>= 1;
						res <<= 1;
					} while (--len > 0);
					return res >>> 1;
				}


				/* ===========================================================================
				 * Flush the bit buffer, keeping at most 7 bits in it.
				 */
				function bi_flush(s) {
					if (s.bi_valid === 16) {
						put_short(s, s.bi_buf);
						s.bi_buf = 0;
						s.bi_valid = 0;

					} else if (s.bi_valid >= 8) {
						s.pending_buf[s.pending++] = s.bi_buf & 0xff;
						s.bi_buf >>= 8;
						s.bi_valid -= 8;
					}
				}


				/* ===========================================================================
				 * Compute the optimal bit lengths for a tree and update the total bit length
				 * for the current block.
				 * IN assertion: the fields freq and dad are set, heap[heap_max] and
				 *    above are the tree nodes sorted by increasing frequency.
				 * OUT assertions: the field len is set to the optimal bit length, the
				 *     array bl_count contains the frequencies for each bit length.
				 *     The length opt_len is updated; static_len is also updated if stree is
				 *     not null.
				 */
				function gen_bitlen(s, desc)
				//    deflate_state *s;
				//    tree_desc *desc;    /* the tree descriptor */
				{
					var tree = desc.dyn_tree;
					var max_code = desc.max_code;
					var stree = desc.stat_desc.static_tree;
					var has_stree = desc.stat_desc.has_stree;
					var extra = desc.stat_desc.extra_bits;
					var base = desc.stat_desc.extra_base;
					var max_length = desc.stat_desc.max_length;
					var h;              /* heap index */
					var n, m;           /* iterate over the tree elements */
					var bits;           /* bit length */
					var xbits;          /* extra bits */
					var f;              /* frequency */
					var overflow = 0;   /* number of elements with bit length too large */

					for (bits = 0; bits <= MAX_BITS; bits++) {
						s.bl_count[bits] = 0;
					}

					/* In a first pass, compute the optimal bit lengths (which may
					 * overflow in the case of the bit length tree).
					 */
					tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */

					for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
						n = s.heap[h];
						bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
						if (bits > max_length) {
							bits = max_length;
							overflow++;
						}
						tree[n * 2 + 1]/*.Len*/ = bits;
						/* We overwrite tree[n].Dad which is no longer needed */

						if (n > max_code) { continue; } /* not a leaf node */

						s.bl_count[bits]++;
						xbits = 0;
						if (n >= base) {
							xbits = extra[n - base];
						}
						f = tree[n * 2]/*.Freq*/;
						s.opt_len += f * (bits + xbits);
						if (has_stree) {
							s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);
						}
					}
					if (overflow === 0) { return; }

					// Trace((stderr,"\nbit length overflow\n"));
					/* This happens for example on obj2 and pic of the Calgary corpus */

					/* Find the first bit length which could increase: */
					do {
						bits = max_length - 1;
						while (s.bl_count[bits] === 0) { bits--; }
						s.bl_count[bits]--;      /* move one leaf down the tree */
						s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */
						s.bl_count[max_length]--;
						/* The brother of the overflow item also moves one step up,
						 * but this does not affect bl_count[max_length]
						 */
						overflow -= 2;
					} while (overflow > 0);

					/* Now recompute all bit lengths, scanning in increasing frequency.
					 * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
					 * lengths instead of fixing only the wrong ones. This idea is taken
					 * from 'ar' written by Haruhiko Okumura.)
					 */
					for (bits = max_length; bits !== 0; bits--) {
						n = s.bl_count[bits];
						while (n !== 0) {
							m = s.heap[--h];
							if (m > max_code) { continue; }
							if (tree[m * 2 + 1]/*.Len*/ !== bits) {
								// Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
								s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;
								tree[m * 2 + 1]/*.Len*/ = bits;
							}
							n--;
						}
					}
				}


				/* ===========================================================================
				 * Generate the codes for a given tree and bit counts (which need not be
				 * optimal).
				 * IN assertion: the array bl_count contains the bit length statistics for
				 * the given tree and the field len is set for all tree elements.
				 * OUT assertion: the field code is set for all tree elements of non
				 *     zero code length.
				 */
				function gen_codes(tree, max_code, bl_count)
				//    ct_data *tree;             /* the tree to decorate */
				//    int max_code;              /* largest code with non zero frequency */
				//    ushf *bl_count;            /* number of codes at each bit length */
				{
					var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */
					var code = 0;              /* running code value */
					var bits;                  /* bit index */
					var n;                     /* code index */

					/* The distribution counts are first used to generate the code values
					 * without bit reversal.
					 */
					for (bits = 1; bits <= MAX_BITS; bits++) {
						next_code[bits] = code = (code + bl_count[bits - 1]) << 1;
					}
					/* Check that the bit counts in bl_count are consistent. The last code
					 * must be all ones.
					 */
					//Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
					//        "inconsistent bit counts");
					//Tracev((stderr,"\ngen_codes: max_code %d ", max_code));

					for (n = 0; n <= max_code; n++) {
						var len = tree[n * 2 + 1]/*.Len*/;
						if (len === 0) { continue; }
						/* Now reverse the bits */
						tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);

						//Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
						//     n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
					}
				}


				/* ===========================================================================
				 * Initialize the various 'constant' tables.
				 */
				function tr_static_init() {
					var n;        /* iterates over tree elements */
					var bits;     /* bit counter */
					var length;   /* length value */
					var code;     /* code value */
					var dist;     /* distance index */
					var bl_count = new Array(MAX_BITS + 1);
					/* number of codes at each bit length for an optimal tree */

					// do check in _tr_init()
					//if (static_init_done) return;

					/* For some embedded targets, global variables are not initialized: */
					/*#ifdef NO_INIT_GLOBAL_POINTERS
					  static_l_desc.static_tree = static_ltree;
					  static_l_desc.extra_bits = extra_lbits;
					  static_d_desc.static_tree = static_dtree;
					  static_d_desc.extra_bits = extra_dbits;
					  static_bl_desc.extra_bits = extra_blbits;
					#endif*/

					/* Initialize the mapping length (0..255) -> length code (0..28) */
					length = 0;
					for (code = 0; code < LENGTH_CODES - 1; code++) {
						base_length[code] = length;
						for (n = 0; n < (1 << extra_lbits[code]); n++) {
							_length_code[length++] = code;
						}
					}
					//Assert (length == 256, "tr_static_init: length != 256");
					/* Note that the length 255 (match length 258) can be represented
					 * in two different ways: code 284 + 5 bits or code 285, so we
					 * overwrite length_code[255] to use the best encoding:
					 */
					_length_code[length - 1] = code;

					/* Initialize the mapping dist (0..32K) -> dist code (0..29) */
					dist = 0;
					for (code = 0; code < 16; code++) {
						base_dist[code] = dist;
						for (n = 0; n < (1 << extra_dbits[code]); n++) {
							_dist_code[dist++] = code;
						}
					}
					//Assert (dist == 256, "tr_static_init: dist != 256");
					dist >>= 7; /* from now on, all distances are divided by 128 */
					for (; code < D_CODES; code++) {
						base_dist[code] = dist << 7;
						for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
							_dist_code[256 + dist++] = code;
						}
					}
					//Assert (dist == 256, "tr_static_init: 256+dist != 512");

					/* Construct the codes of the static literal tree */
					for (bits = 0; bits <= MAX_BITS; bits++) {
						bl_count[bits] = 0;
					}

					n = 0;
					while (n <= 143) {
						static_ltree[n * 2 + 1]/*.Len*/ = 8;
						n++;
						bl_count[8]++;
					}
					while (n <= 255) {
						static_ltree[n * 2 + 1]/*.Len*/ = 9;
						n++;
						bl_count[9]++;
					}
					while (n <= 279) {
						static_ltree[n * 2 + 1]/*.Len*/ = 7;
						n++;
						bl_count[7]++;
					}
					while (n <= 287) {
						static_ltree[n * 2 + 1]/*.Len*/ = 8;
						n++;
						bl_count[8]++;
					}
					/* Codes 286 and 287 do not exist, but we must include them in the
					 * tree construction to get a canonical Huffman tree (longest code
					 * all ones)
					 */
					gen_codes(static_ltree, L_CODES + 1, bl_count);

					/* The static distance tree is trivial: */
					for (n = 0; n < D_CODES; n++) {
						static_dtree[n * 2 + 1]/*.Len*/ = 5;
						static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);
					}

					// Now data ready and we can init static trees
					static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
					static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
					static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);

					//static_init_done = true;
				}


				/* ===========================================================================
				 * Initialize a new block.
				 */
				function init_block(s) {
					var n; /* iterates over tree elements */

					/* Initialize the trees. */
					for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }
					for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }
					for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }

					s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;
					s.opt_len = s.static_len = 0;
					s.last_lit = s.matches = 0;
				}


				/* ===========================================================================
				 * Flush the bit buffer and align the output on a byte boundary
				 */
				function bi_windup(s) {
					if (s.bi_valid > 8) {
						put_short(s, s.bi_buf);
					} else if (s.bi_valid > 0) {
						//put_byte(s, (Byte)s->bi_buf);
						s.pending_buf[s.pending++] = s.bi_buf;
					}
					s.bi_buf = 0;
					s.bi_valid = 0;
				}

				/* ===========================================================================
				 * Copy a stored block, storing first the length and its
				 * one's complement if requested.
				 */
				function copy_block(s, buf, len, header)
				//DeflateState *s;
				//charf    *buf;    /* the input data */
				//unsigned len;     /* its length */
				//int      header;  /* true if block header must be written */
				{
					bi_windup(s);        /* align on byte boundary */

					if (header) {
						put_short(s, len);
						put_short(s, ~len);
					}
					//  while (len--) {
					//    put_byte(s, *buf++);
					//  }
					utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
					s.pending += len;
				}

				/* ===========================================================================
				 * Compares to subtrees, using the tree depth as tie breaker when
				 * the subtrees have equal frequency. This minimizes the worst case length.
				 */
				function smaller(tree, n, m, depth) {
					var _n2 = n * 2;
					var _m2 = m * 2;
					return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
						(tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
				}

				/* ===========================================================================
				 * Restore the heap property by moving down the tree starting at node k,
				 * exchanging a node with the smallest of its two sons if necessary, stopping
				 * when the heap property is re-established (each father smaller than its
				 * two sons).
				 */
				function pqdownheap(s, tree, k)
				//    deflate_state *s;
				//    ct_data *tree;  /* the tree to restore */
				//    int k;               /* node to move down */
				{
					var v = s.heap[k];
					var j = k << 1;  /* left son of k */
					while (j <= s.heap_len) {
						/* Set j to the smallest of the two sons: */
						if (j < s.heap_len &&
							smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
							j++;
						}
						/* Exit if v is smaller than both sons */
						if (smaller(tree, v, s.heap[j], s.depth)) { break; }

						/* Exchange v with the smallest son */
						s.heap[k] = s.heap[j];
						k = j;

						/* And continue down the tree, setting j to the left son of k */
						j <<= 1;
					}
					s.heap[k] = v;
				}


				// inlined manually
				// var SMALLEST = 1;

				/* ===========================================================================
				 * Send the block data compressed using the given Huffman trees
				 */
				function compress_block(s, ltree, dtree)
				//    deflate_state *s;
				//    const ct_data *ltree; /* literal tree */
				//    const ct_data *dtree; /* distance tree */
				{
					var dist;           /* distance of matched string */
					var lc;             /* match length or unmatched char (if dist == 0) */
					var lx = 0;         /* running index in l_buf */
					var code;           /* the code to send */
					var extra;          /* number of extra bits to send */

					if (s.last_lit !== 0) {
						do {
							dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);
							lc = s.pending_buf[s.l_buf + lx];
							lx++;

							if (dist === 0) {
								send_code(s, lc, ltree); /* send a literal byte */
								//Tracecv(isgraph(lc), (stderr," '%c' ", lc));
							} else {
								/* Here, lc is the match length - MIN_MATCH */
								code = _length_code[lc];
								send_code(s, code + LITERALS + 1, ltree); /* send the length code */
								extra = extra_lbits[code];
								if (extra !== 0) {
									lc -= base_length[code];
									send_bits(s, lc, extra);       /* send the extra length bits */
								}
								dist--; /* dist is now the match distance - 1 */
								code = d_code(dist);
								//Assert (code < D_CODES, "bad d_code");

								send_code(s, code, dtree);       /* send the distance code */
								extra = extra_dbits[code];
								if (extra !== 0) {
									dist -= base_dist[code];
									send_bits(s, dist, extra);   /* send the extra distance bits */
								}
							} /* literal or match pair ? */

							/* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
							//Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
							//       "pendingBuf overflow");

						} while (lx < s.last_lit);
					}

					send_code(s, END_BLOCK, ltree);
				}


				/* ===========================================================================
				 * Construct one Huffman tree and assigns the code bit strings and lengths.
				 * Update the total bit length for the current block.
				 * IN assertion: the field freq is set for all tree elements.
				 * OUT assertions: the fields len and code are set to the optimal bit length
				 *     and corresponding code. The length opt_len is updated; static_len is
				 *     also updated if stree is not null. The field max_code is set.
				 */
				function build_tree(s, desc)
				//    deflate_state *s;
				//    tree_desc *desc; /* the tree descriptor */
				{
					var tree = desc.dyn_tree;
					var stree = desc.stat_desc.static_tree;
					var has_stree = desc.stat_desc.has_stree;
					var elems = desc.stat_desc.elems;
					var n, m;          /* iterate over heap elements */
					var max_code = -1; /* largest code with non zero frequency */
					var node;          /* new node being created */

					/* Construct the initial heap, with least frequent element in
					 * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
					 * heap[0] is not used.
					 */
					s.heap_len = 0;
					s.heap_max = HEAP_SIZE;

					for (n = 0; n < elems; n++) {
						if (tree[n * 2]/*.Freq*/ !== 0) {
							s.heap[++s.heap_len] = max_code = n;
							s.depth[n] = 0;

						} else {
							tree[n * 2 + 1]/*.Len*/ = 0;
						}
					}

					/* The pkzip format requires that at least one distance code exists,
					 * and that at least one bit should be sent even if there is only one
					 * possible code. So to avoid special checks later on we force at least
					 * two codes of non zero frequency.
					 */
					while (s.heap_len < 2) {
						node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
						tree[node * 2]/*.Freq*/ = 1;
						s.depth[node] = 0;
						s.opt_len--;

						if (has_stree) {
							s.static_len -= stree[node * 2 + 1]/*.Len*/;
						}
						/* node is 0 or 1 so it does not have extra bits */
					}
					desc.max_code = max_code;

					/* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
					 * establish sub-heaps of increasing lengths:
					 */
					for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }

					/* Construct the Huffman tree by repeatedly combining the least two
					 * frequent nodes.
					 */
					node = elems;              /* next internal node of the tree */
					do {
						//pqremove(s, tree, n);  /* n = node of least frequency */
						/*** pqremove ***/
						n = s.heap[1/*SMALLEST*/];
						s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
						pqdownheap(s, tree, 1/*SMALLEST*/);
						/***/

						m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */

						s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
						s.heap[--s.heap_max] = m;

						/* Create a new node father of n and m */
						tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
						s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
						tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;

						/* and insert the new node in the heap */
						s.heap[1/*SMALLEST*/] = node++;
						pqdownheap(s, tree, 1/*SMALLEST*/);

					} while (s.heap_len >= 2);

					s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];

					/* At this point, the fields freq and dad are set. We can now
					 * generate the bit lengths.
					 */
					gen_bitlen(s, desc);

					/* The field len is now set, we can generate the bit codes */
					gen_codes(tree, max_code, s.bl_count);
				}


				/* ===========================================================================
				 * Scan a literal or distance tree to determine the frequencies of the codes
				 * in the bit length tree.
				 */
				function scan_tree(s, tree, max_code)
				//    deflate_state *s;
				//    ct_data *tree;   /* the tree to be scanned */
				//    int max_code;    /* and its largest code of non zero frequency */
				{
					var n;                     /* iterates over all tree elements */
					var prevlen = -1;          /* last emitted length */
					var curlen;                /* length of current code */

					var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */

					var count = 0;             /* repeat count of the current code */
					var max_count = 7;         /* max repeat count */
					var min_count = 4;         /* min repeat count */

					if (nextlen === 0) {
						max_count = 138;
						min_count = 3;
					}
					tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */

					for (n = 0; n <= max_code; n++) {
						curlen = nextlen;
						nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;

						if (++count < max_count && curlen === nextlen) {
							continue;

						} else if (count < min_count) {
							s.bl_tree[curlen * 2]/*.Freq*/ += count;

						} else if (curlen !== 0) {

							if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
							s.bl_tree[REP_3_6 * 2]/*.Freq*/++;

						} else if (count <= 10) {
							s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;

						} else {
							s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;
						}

						count = 0;
						prevlen = curlen;

						if (nextlen === 0) {
							max_count = 138;
							min_count = 3;

						} else if (curlen === nextlen) {
							max_count = 6;
							min_count = 3;

						} else {
							max_count = 7;
							min_count = 4;
						}
					}
				}


				/* ===========================================================================
				 * Send a literal or distance tree in compressed form, using the codes in
				 * bl_tree.
				 */
				function send_tree(s, tree, max_code)
				//    deflate_state *s;
				//    ct_data *tree; /* the tree to be scanned */
				//    int max_code;       /* and its largest code of non zero frequency */
				{
					var n;                     /* iterates over all tree elements */
					var prevlen = -1;          /* last emitted length */
					var curlen;                /* length of current code */

					var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */

					var count = 0;             /* repeat count of the current code */
					var max_count = 7;         /* max repeat count */
					var min_count = 4;         /* min repeat count */

					/* tree[max_code+1].Len = -1; */  /* guard already set */
					if (nextlen === 0) {
						max_count = 138;
						min_count = 3;
					}

					for (n = 0; n <= max_code; n++) {
						curlen = nextlen;
						nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;

						if (++count < max_count && curlen === nextlen) {
							continue;

						} else if (count < min_count) {
							do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);

						} else if (curlen !== 0) {
							if (curlen !== prevlen) {
								send_code(s, curlen, s.bl_tree);
								count--;
							}
							//Assert(count >= 3 && count <= 6, " 3_6?");
							send_code(s, REP_3_6, s.bl_tree);
							send_bits(s, count - 3, 2);

						} else if (count <= 10) {
							send_code(s, REPZ_3_10, s.bl_tree);
							send_bits(s, count - 3, 3);

						} else {
							send_code(s, REPZ_11_138, s.bl_tree);
							send_bits(s, count - 11, 7);
						}

						count = 0;
						prevlen = curlen;
						if (nextlen === 0) {
							max_count = 138;
							min_count = 3;

						} else if (curlen === nextlen) {
							max_count = 6;
							min_count = 3;

						} else {
							max_count = 7;
							min_count = 4;
						}
					}
				}


				/* ===========================================================================
				 * Construct the Huffman tree for the bit lengths and return the index in
				 * bl_order of the last bit length code to send.
				 */
				function build_bl_tree(s) {
					var max_blindex;  /* index of last bit length code of non zero freq */

					/* Determine the bit length frequencies for literal and distance trees */
					scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
					scan_tree(s, s.dyn_dtree, s.d_desc.max_code);

					/* Build the bit length tree: */
					build_tree(s, s.bl_desc);
					/* opt_len now includes the length of the tree representations, except
					 * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
					 */

					/* Determine the number of bit length codes to send. The pkzip format
					 * requires that at least 4 bit length codes be sent. (appnote.txt says
					 * 3 but the actual value used is 4.)
					 */
					for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
						if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {
							break;
						}
					}
					/* Update opt_len to include the bit length tree and counts */
					s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
					//Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
					//        s->opt_len, s->static_len));

					return max_blindex;
				}


				/* ===========================================================================
				 * Send the header for a block using dynamic Huffman trees: the counts, the
				 * lengths of the bit length codes, the literal tree and the distance tree.
				 * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
				 */
				function send_all_trees(s, lcodes, dcodes, blcodes)
				//    deflate_state *s;
				//    int lcodes, dcodes, blcodes; /* number of codes for each tree */
				{
					var rank;                    /* index in bl_order */

					//Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
					//Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
					//        "too many codes");
					//Tracev((stderr, "\nbl counts: "));
					send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
					send_bits(s, dcodes - 1, 5);
					send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */
					for (rank = 0; rank < blcodes; rank++) {
						//Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
						send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);
					}
					//Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));

					send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */
					//Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));

					send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */
					//Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
				}


				/* ===========================================================================
				 * Check if the data type is TEXT or BINARY, using the following algorithm:
				 * - TEXT if the two conditions below are satisfied:
				 *    a) There are no non-portable control characters belonging to the
				 *       "black list" (0..6, 14..25, 28..31).
				 *    b) There is at least one printable character belonging to the
				 *       "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
				 * - BINARY otherwise.
				 * - The following partially-portable control characters form a
				 *   "gray list" that is ignored in this detection algorithm:
				 *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
				 * IN assertion: the fields Freq of dyn_ltree are set.
				 */
				function detect_data_type(s) {
					/* black_mask is the bit mask of black-listed bytes
					 * set bits 0..6, 14..25, and 28..31
					 * 0xf3ffc07f = binary 11110011111111111100000001111111
					 */
					var black_mask = 0xf3ffc07f;
					var n;

					/* Check for non-textual ("black-listed") bytes. */
					for (n = 0; n <= 31; n++ , black_mask >>>= 1) {
						if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {
							return Z_BINARY;
						}
					}

					/* Check for textual ("white-listed") bytes. */
					if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
						s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
						return Z_TEXT;
					}
					for (n = 32; n < LITERALS; n++) {
						if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
							return Z_TEXT;
						}
					}

					/* There are no "black-listed" or "white-listed" bytes:
					 * this stream either is empty or has tolerated ("gray-listed") bytes only.
					 */
					return Z_BINARY;
				}


				var static_init_done = false;

				/* ===========================================================================
				 * Initialize the tree data structures for a new zlib stream.
				 */
				function _tr_init(s) {

					if (!static_init_done) {
						tr_static_init();
						static_init_done = true;
					}

					s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
					s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
					s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);

					s.bi_buf = 0;
					s.bi_valid = 0;

					/* Initialize the first block of the first file: */
					init_block(s);
				}


				/* ===========================================================================
				 * Send a stored block
				 */
				function _tr_stored_block(s, buf, stored_len, last)
				//DeflateState *s;
				//charf *buf;       /* input block */
				//ulg stored_len;   /* length of input block */
				//int last;         /* one if this is the last block for a file */
				{
					send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);    /* send block type */
					copy_block(s, buf, stored_len, true); /* with header */
				}


				/* ===========================================================================
				 * Send one empty static block to give enough lookahead for inflate.
				 * This takes 10 bits, of which 7 may remain in the bit buffer.
				 */
				function _tr_align(s) {
					send_bits(s, STATIC_TREES << 1, 3);
					send_code(s, END_BLOCK, static_ltree);
					bi_flush(s);
				}


				/* ===========================================================================
				 * Determine the best encoding for the current block: dynamic trees, static
				 * trees or store, and output the encoded block to the zip file.
				 */
				function _tr_flush_block(s, buf, stored_len, last)
				//DeflateState *s;
				//charf *buf;       /* input block, or NULL if too old */
				//ulg stored_len;   /* length of input block */
				//int last;         /* one if this is the last block for a file */
				{
					var opt_lenb, static_lenb;  /* opt_len and static_len in bytes */
					var max_blindex = 0;        /* index of last bit length code of non zero freq */

					/* Build the Huffman trees unless a stored block is forced */
					if (s.level > 0) {

						/* Check if the file is binary or text */
						if (s.strm.data_type === Z_UNKNOWN) {
							s.strm.data_type = detect_data_type(s);
						}

						/* Construct the literal and distance trees */
						build_tree(s, s.l_desc);
						// Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
						//        s->static_len));

						build_tree(s, s.d_desc);
						// Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
						//        s->static_len));
						/* At this point, opt_len and static_len are the total bit lengths of
						 * the compressed block data, excluding the tree representations.
						 */

						/* Build the bit length tree for the above two trees, and get the index
						 * in bl_order of the last bit length code to send.
						 */
						max_blindex = build_bl_tree(s);

						/* Determine the best encoding. Compute the block lengths in bytes. */
						opt_lenb = (s.opt_len + 3 + 7) >>> 3;
						static_lenb = (s.static_len + 3 + 7) >>> 3;

						// Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
						//        opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
						//        s->last_lit));

						if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }

					} else {
						// Assert(buf != (char*)0, "lost buf");
						opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
					}

					if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {
						/* 4: two words for the lengths */

						/* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
						 * Otherwise we can't have processed more than WSIZE input bytes since
						 * the last block flush, because compression would have been
						 * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
						 * transform a block into a stored block.
						 */
						_tr_stored_block(s, buf, stored_len, last);

					} else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {

						send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
						compress_block(s, static_ltree, static_dtree);

					} else {
						send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
						send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
						compress_block(s, s.dyn_ltree, s.dyn_dtree);
					}
					// Assert (s->compressed_len == s->bits_sent, "bad compressed size");
					/* The above check is made mod 2^32, for files larger than 512 MB
					 * and uLong implemented on 32 bits.
					 */
					init_block(s);

					if (last) {
						bi_windup(s);
					}
					// Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
					//       s->compressed_len-7*last));
				}

				/* ===========================================================================
				 * Save the match info and tally the frequency counts. Return true if
				 * the current block must be flushed.
				 */
				function _tr_tally(s, dist, lc)
				//    deflate_state *s;
				//    unsigned dist;  /* distance of matched string */
				//    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */
				{
					//var out_length, in_length, dcode;

					s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;
					s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;

					s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
					s.last_lit++;

					if (dist === 0) {
						/* lc is the unmatched char */
						s.dyn_ltree[lc * 2]/*.Freq*/++;
					} else {
						s.matches++;
						/* Here, lc is the match length - MIN_MATCH */
						dist--;             /* dist = match distance - 1 */
						//Assert((ush)dist < (ush)MAX_DIST(s) &&
						//       (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
						//       (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");

						s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;
						s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
					}

					// (!) This block is disabled in zlib defailts,
					// don't enable it for binary compatibility

					//#ifdef TRUNCATE_BLOCK
					//  /* Try to guess if it is profitable to stop the current block here */
					//  if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
					//    /* Compute an upper bound for the compressed length */
					//    out_length = s.last_lit*8;
					//    in_length = s.strstart - s.block_start;
					//
					//    for (dcode = 0; dcode < D_CODES; dcode++) {
					//      out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
					//    }
					//    out_length >>>= 3;
					//    //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
					//    //       s->last_lit, in_length, out_length,
					//    //       100L - out_length*100L/in_length));
					//    if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
					//      return true;
					//    }
					//  }
					//#endif

					return (s.last_lit === s.lit_bufsize - 1);
					/* We avoid equality with lit_bufsize because of wraparound at 64K
					 * on 16 bit machines and because stored blocks are restricted to
					 * 64K-1 bytes.
					 */
				}

				localExports._tr_init = _tr_init;
				localExports._tr_stored_block = _tr_stored_block;
				localExports._tr_flush_block = _tr_flush_block;
				localExports._tr_tally = _tr_tally;
				localExports._tr_align = _tr_align;

			}, { "../utils/common": 175 }], 185: [function (localRequire, localModule, localExports) {
				'use strict';


				function ZStream() {
					/* next input byte */
					this.input = null; // JS specific, because we have no pointers
					this.next_in = 0;
					/* number of bytes available at input */
					this.avail_in = 0;
					/* total number of input bytes read so far */
					this.total_in = 0;
					/* next output byte should be put there */
					this.output = null; // JS specific, because we have no pointers
					this.next_out = 0;
					/* remaining free space at output */
					this.avail_out = 0;
					/* total number of bytes output so far */
					this.total_out = 0;
					/* last error message, NULL if no error */
					this.msg = ''/*Z_NULL*/;
					/* not visible by applications */
					this.state = null;
					/* best guess about the data type: binary or text */
					this.data_type = 2/*Z_UNKNOWN*/;
					/* adler32 value of the uncompressed data */
					this.adler = 0;
				}

				localModule.localExports = ZStream;

			}, {}], 186: [function (localRequire, localModule, localExports) {
				(function (Buffer) {
					// Generated by CoffeeScript 1.4.0

					/*
					# MIT LICENSE
					# Copyright (c) 2011 Devon Govett
					# 
					# Permission is hereby granted, free of charge, to any person obtaining a copy of this 
					# software and associated documentation files (the "Software"), to deal in the Software 
					# without restriction, including without limitation the rights to use, copy, modify, merge, 
					# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons 
					# to whom the Software is furnished to do so, subject to the following conditions:
					# 
					# The above copyright notice and this permission notice shall be included in all copies or 
					# substantial portions of the Software.
					# 
					# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 
					# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
					# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
					# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
					# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
					*/


					(function () {
						var PNG, fs, zlib;

						fs = localRequire('fs');

						zlib = localRequire('zlib');

						localModule.localExports = PNG = (function () {

							(<any>PNG).decode = function (path, fn) {
								return fs.readFile(path, function (err, file) {
									var png;
									png = new PNG(file);
									return png.decode(function (pixels) {
										return fn(pixels);
									});
								});
							};

							(<any>PNG).load = function (path) {
								var file;
								file = fs.readFileSync(path);
								return new PNG(file);
							};

							function PNG(data) {
								var chunkSize, colors, i, index, key, section, short, text, _i, _j, _ref;
								this.data = data;
								this.pos = 8;
								this.palette = [];
								this.imgData = [];
								this.transparency = {};
								this.text = {};
								while (true) {
									chunkSize = this.readUInt32();
									section = ((function () {
										var _i, _results;
										_results = [];
										for (i = _i = 0; _i < 4; i = ++_i) {
											_results.push(String.fromCharCode(this.data[this.pos++]));
										}
										return _results;
									}).call(this)).join('');
									switch (section) {
										case 'IHDR':
											this.width = this.readUInt32();
											this.height = this.readUInt32();
											this.bits = this.data[this.pos++];
											this.colorType = this.data[this.pos++];
											this.compressionMethod = this.data[this.pos++];
											this.filterMethod = this.data[this.pos++];
											this.interlaceMethod = this.data[this.pos++];
											break;
										case 'PLTE':
											this.palette = this.read(chunkSize);
											break;
										case 'IDAT':
											for (i = _i = 0; _i < chunkSize; i = _i += 1) {
												this.imgData.push(this.data[this.pos++]);
											}
											break;
										case 'tRNS':
											this.transparency = {};
											switch (this.colorType) {
												case 3:
													this.transparency.indexed = this.read(chunkSize);
													short = 255 - this.transparency.indexed.length;
													if (short > 0) {
														for (i = _j = 0; 0 <= short ? _j < short : _j > short; i = 0 <= short ? ++_j : --_j) {
															this.transparency.indexed.push(255);
														}
													}
													break;
												case 0:
													this.transparency.grayscale = this.read(chunkSize)[0];
													break;
												case 2:
													this.transparency.rgb = this.read(chunkSize);
											}
											break;
										case 'tEXt':
											text = this.read(chunkSize);
											index = text.indexOf(0);
											key = String.fromCharCode.apply(String, text.slice(0, index));
											this.text[key] = String.fromCharCode.apply(String, text.slice(index + 1));
											break;
										case 'IEND':
											this.colors = (function () {
												switch (this.colorType) {
													case 0:
													case 3:
													case 4:
														return 1;
													case 2:
													case 6:
														return 3;
												}
											}).call(this);
											this.hasAlphaChannel = (_ref = this.colorType) === 4 || _ref === 6;
											colors = this.colors + (this.hasAlphaChannel ? 1 : 0);
											this.pixelBitlength = this.bits * colors;
											this.colorSpace = (function () {
												switch (this.colors) {
													case 1:
														return 'DeviceGray';
													case 3:
														return 'DeviceRGB';
												}
											}).call(this);
											this.imgData = new Buffer(this.imgData);
											return;
										default:
											this.pos += chunkSize;
									}
									this.pos += 4;
									if (this.pos > this.data.length) {
										throw new Error("Incomplete or corrupt PNG file");
									}
								}
							}

							PNG.prototype.read = function (bytes) {
								var i, _i, _results;
								_results = [];
								for (i = _i = 0; 0 <= bytes ? _i < bytes : _i > bytes; i = 0 <= bytes ? ++_i : --_i) {
									_results.push(this.data[this.pos++]);
								}
								return _results;
							};

							PNG.prototype.readUInt32 = function () {
								var b1, b2, b3, b4;
								b1 = this.data[this.pos++] << 24;
								b2 = this.data[this.pos++] << 16;
								b3 = this.data[this.pos++] << 8;
								b4 = this.data[this.pos++];
								return b1 | b2 | b3 | b4;
							};

							PNG.prototype.readUInt16 = function () {
								var b1, b2;
								b1 = this.data[this.pos++] << 8;
								b2 = this.data[this.pos++];
								return b1 | b2;
							};

							PNG.prototype.decodePixels = function (fn) {
								var _this = this;
								return zlib.inflate(this.imgData, function (err, data) {
									var byte, c, col, i, left, length, p, pa, paeth, pb, pc, pixelBytes, pixels, pos, row, scanlineLength, upper, upperLeft, _i, _j, _k, _l, _m;
									if (err) {
										throw err;
									}
									pixelBytes = _this.pixelBitlength / 8;
									scanlineLength = pixelBytes * _this.width;
									pixels = new Buffer(scanlineLength * _this.height);
									length = data.length;
									row = 0;
									pos = 0;
									c = 0;
									while (pos < length) {
										switch (data[pos++]) {
											case 0:
												for (i = _i = 0; _i < scanlineLength; i = _i += 1) {
													pixels[c++] = data[pos++];
												}
												break;
											case 1:
												for (i = _j = 0; _j < scanlineLength; i = _j += 1) {
													byte = data[pos++];
													left = i < pixelBytes ? 0 : pixels[c - pixelBytes];
													pixels[c++] = (byte + left) % 256;
												}
												break;
											case 2:
												for (i = _k = 0; _k < scanlineLength; i = _k += 1) {
													byte = data[pos++];
													col = (i - (i % pixelBytes)) / pixelBytes;
													upper = row && pixels[(row - 1) * scanlineLength + col * pixelBytes + (i % pixelBytes)];
													pixels[c++] = (upper + byte) % 256;
												}
												break;
											case 3:
												for (i = _l = 0; _l < scanlineLength; i = _l += 1) {
													byte = data[pos++];
													col = (i - (i % pixelBytes)) / pixelBytes;
													left = i < pixelBytes ? 0 : pixels[c - pixelBytes];
													upper = row && pixels[(row - 1) * scanlineLength + col * pixelBytes + (i % pixelBytes)];
													pixels[c++] = (byte + Math.floor((left + upper) / 2)) % 256;
												}
												break;
											case 4:
												for (i = _m = 0; _m < scanlineLength; i = _m += 1) {
													byte = data[pos++];
													col = (i - (i % pixelBytes)) / pixelBytes;
													left = i < pixelBytes ? 0 : pixels[c - pixelBytes];
													if (row === 0) {
														upper = upperLeft = 0;
													} else {
														upper = pixels[(row - 1) * scanlineLength + col * pixelBytes + (i % pixelBytes)];
														upperLeft = col && pixels[(row - 1) * scanlineLength + (col - 1) * pixelBytes + (i % pixelBytes)];
													}
													p = left + upper - upperLeft;
													pa = Math.abs(p - left);
													pb = Math.abs(p - upper);
													pc = Math.abs(p - upperLeft);
													if (pa <= pb && pa <= pc) {
														paeth = left;
													} else if (pb <= pc) {
														paeth = upper;
													} else {
														paeth = upperLeft;
													}
													pixels[c++] = (byte + paeth) % 256;
												}
												break;
											default:
												throw new Error("Invalid filter algorithm: " + data[pos - 1]);
										}
										row++;
									}
									return fn(pixels);
								});
							};

							PNG.prototype.decodePalette = function () {
								var c, i, length, palette, pos, ret, transparency, _i, _ref, _ref1;
								palette = this.palette;
								transparency = this.transparency.indexed || [];
								ret = new Buffer(transparency.length + palette.length);
								pos = 0;
								length = palette.length;
								c = 0;
								for (i = _i = 0, _ref = palette.length; _i < _ref; i = _i += 3) {
									ret[pos++] = palette[i];
									ret[pos++] = palette[i + 1];
									ret[pos++] = palette[i + 2];
									ret[pos++] = (_ref1 = transparency[c++]) != null ? _ref1 : 255;
								}
								return ret;
							};

							PNG.prototype.copyToImageData = function (imageData, pixels) {
								var alpha, colors, data, i, input, j, k, length, palette, v, _ref;
								colors = this.colors;
								palette = null;
								alpha = this.hasAlphaChannel;
								if (this.palette.length) {
									palette = (_ref = this._decodedPalette) != null ? _ref : this._decodedPalette = this.decodePalette();
									colors = 4;
									alpha = true;
								}
								data = (imageData != null ? imageData.data : void 0) || imageData;
								length = data.length;
								input = palette || pixels;
								i = j = 0;
								if (colors === 1) {
									while (i < length) {
										k = palette ? pixels[i / 4] * 4 : j;
										v = input[k++];
										data[i++] = v;
										data[i++] = v;
										data[i++] = v;
										data[i++] = alpha ? input[k++] : 255;
										j = k;
									}
								} else {
									while (i < length) {
										k = palette ? pixels[i / 4] * 4 : j;
										data[i++] = input[k++];
										data[i++] = input[k++];
										data[i++] = input[k++];
										data[i++] = alpha ? input[k++] : 255;
										j = k;
									}
								}
							};

							PNG.prototype.decode = function (fn) {
								var ret,
									_this = this;
								ret = new Buffer(this.width * this.height * 4);
								return this.decodePixels(function (pixels) {
									_this.copyToImageData(ret, pixels);
									return fn(ret);
								});
							};

							return PNG;

						})();

					}).call(this);

				}).call(this, localRequire("buffer").Buffer)

			}, { "buffer": 60, "fs": 59, "zlib": 58 }], 187: [function (localRequire, localModule, localExports) {
				(function (process) {
					'use strict';

					if (!process.version ||
						process.version.indexOf('v0.') === 0 ||
						process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
						localModule.localExports = nextTick;
					} else {
						localModule.localExports = process.nextTick;
					}

					function nextTick(fn, arg1, arg2, arg3) {
						if (typeof fn !== 'function') {
							throw new TypeError('"callback" argument must be a function');
						}
						var len = arguments.length;
						var args, i;
						switch (len) {
							case 0:
							case 1:
								return process.nextTick(fn);
							case 2:
								return process.nextTick(function afterTickOne() {
									fn.call(null, arg1);
								});
							case 3:
								return process.nextTick(function afterTickTwo() {
									fn.call(null, arg1, arg2);
								});
							case 4:
								return process.nextTick(function afterTickThree() {
									fn.call(null, arg1, arg2, arg3);
								});
							default:
								args = new Array(len - 1);
								i = 0;
								while (i < args.length) {
									args[i++] = arguments[i];
								}
								return process.nextTick(function afterTick() {
									fn.apply(null, args);
								});
						}
					}

				}).call(this, localRequire('_process'))

			}, { "_process": 188 }], 188: [function (localRequire, localModule, localExports) {
				// shim for using process in browser
				var process: any = localModule.localExports = {};

				// cached from whatever global is present so that test runners that stub it
				// don't break things.  But we need to wrap it in a try catch in case it is
				// wrapped in strict mode code which doesn't define any globals.  It's inside a
				// function because try/catches deoptimize in certain engines.

				var cachedSetTimeout;
				var cachedClearTimeout;

				(function () {
					try {
						cachedSetTimeout = setTimeout;
					} catch (e) {
						cachedSetTimeout = function () {
							throw new Error('setTimeout is not defined');
						}
					}
					try {
						cachedClearTimeout = clearTimeout;
					} catch (e) {
						cachedClearTimeout = function () {
							throw new Error('clearTimeout is not defined');
						}
					}
				} ())
				function runTimeout(fun) {
					if (cachedSetTimeout === setTimeout) {
						//normal enviroments in sane situations
						return setTimeout(fun, 0);
					}
					try {
						// when when somebody has screwed with setTimeout but no I.E. maddness
						return cachedSetTimeout(fun, 0);
					} catch (e) {
						try {
							// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
							return cachedSetTimeout.call(null, fun, 0);
						} catch (e) {
							// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
							return cachedSetTimeout.call(this, fun, 0);
						}
					}


				}
				function runClearTimeout(marker) {
					if (cachedClearTimeout === clearTimeout) {
						//normal enviroments in sane situations
						return clearTimeout(marker);
					}
					try {
						// when when somebody has screwed with setTimeout but no I.E. maddness
						return cachedClearTimeout(marker);
					} catch (e) {
						try {
							// When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
							return cachedClearTimeout.call(null, marker);
						} catch (e) {
							// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
							// Some versions of I.E. have different rules for clearTimeout vs setTimeout
							return cachedClearTimeout.call(this, marker);
						}
					}



				}
				var queue = [];
				var draining = false;
				var currentQueue;
				var queueIndex = -1;

				function cleanUpNextTick() {
					if (!draining || !currentQueue) {
						return;
					}
					draining = false;
					if (currentQueue.length) {
						queue = currentQueue.concat(queue);
					} else {
						queueIndex = -1;
					}
					if (queue.length) {
						drainQueue();
					}
				}

				function drainQueue() {
					if (draining) {
						return;
					}
					var timeout = runTimeout(cleanUpNextTick);
					draining = true;

					var len = queue.length;
					while (len) {
						currentQueue = queue;
						queue = [];
						while (++queueIndex < len) {
							if (currentQueue) {
								currentQueue[queueIndex].run();
							}
						}
						queueIndex = -1;
						len = queue.length;
					}
					currentQueue = null;
					draining = false;
					runClearTimeout(timeout);
				}

				process.nextTick = function (fun) {
					var args = new Array(arguments.length - 1);
					if (arguments.length > 1) {
						for (var i = 1; i < arguments.length; i++) {
							args[i - 1] = arguments[i];
						}
					}
					queue.push(new Item(fun, args));
					if (queue.length === 1 && !draining) {
						runTimeout(drainQueue);
					}
				};

				// v8 likes predictible objects
				function Item(fun, array) {
					this.fun = fun;
					this.array = array;
				}
				Item.prototype.run = function () {
					this.fun.apply(null, this.array);
				};
				process.title = 'browser';
				process.browser = true;
				process.env = {};
				process.argv = [];
				process.version = ''; // empty string to avoid regexp issues
				process.versions = {};

				function noop() { }

				process.on = noop;
				process.addListener = noop;
				process.once = noop;
				process.off = noop;
				process.removeListener = noop;
				process.removeAllListeners = noop;
				process.emit = noop;

				process.binding = function (name) {
					throw new Error('process.binding is not supported');
				};

				process.cwd = function () { return '/' };
				process.chdir = function (dir) {
					throw new Error('process.chdir is not supported');
				};
				process.umask = function () { return 0; };

			}, {}], 189: [function (localRequire, localModule, localExports) {
				localModule.localExports = localRequire("./lib/_stream_duplex.js")

			}, { "./lib/_stream_duplex.js": 190 }], 190: [function (localRequire, localModule, localExports) {
				// a duplex stream is just a stream that is both readable and writable.
				// Since JS doesn't have multiple prototypal inheritance, this class
				// prototypally inherits from Readable, and then parasitically from
				// Writable.

				'use strict';

				/*<replacement>*/

				var objectKeys = Object.keys || function (obj) {
					var keys = [];
					for (var key in obj) {
						keys.push(key);
					} return keys;
				};
				/*</replacement>*/

				localModule.localExports = Duplex;

				/*<replacement>*/
				var processNextTick = localRequire('process-nextick-args');
				/*</replacement>*/

				/*<replacement>*/
				var util = localRequire('core-util-is');
				util.inherits = localRequire('inherits');
				/*</replacement>*/

				var Readable = localRequire('./_stream_readable');
				var Writable = localRequire('./_stream_writable');

				util.inherits(Duplex, Readable);

				var keys = objectKeys(Writable.prototype);
				for (var v = 0; v < keys.length; v++) {
					var method = keys[v];
					if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
				}

				function Duplex(options): void {
					if (!(this instanceof Duplex)) return new Duplex(options);

					Readable.call(this, options);
					Writable.call(this, options);

					if (options && options.readable === false) this.readable = false;

					if (options && options.writable === false) this.writable = false;

					this.allowHalfOpen = true;
					if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;

					this.once('end', onend);
				}

				// the no-half-open enforcer
				function onend() {
					// if we allow half-open state, or if the writable side ended,
					// then we're ok.
					if (this.allowHalfOpen || this._writableState.ended) return;

					// no more data can be written.
					// But allow more writes to happen in this tick.
					processNextTick(onEndNT, this);
				}

				function onEndNT(self) {
					self.end();
				}

				function forEach(xs, f) {
					for (var i = 0, l = xs.length; i < l; i++) {
						f(xs[i], i);
					}
				}
			}, { "./_stream_readable": 192, "./_stream_writable": 194, "core-util-is": 160, "inherits": 167, "process-nextick-args": 187 }], 191: [function (localRequire, localModule, localExports) {
				// a passthrough stream.
				// basically just the most minimal sort of Transform stream.
				// Every written chunk gets output as-is.

				'use strict';

				localModule.localExports = PassThrough;

				var Transform = localRequire('./_stream_transform');

				/*<replacement>*/
				var util = localRequire('core-util-is');
				util.inherits = localRequire('inherits');
				/*</replacement>*/

				util.inherits(PassThrough, Transform);

				function PassThrough(options): void {
					if (!(this instanceof PassThrough)) return new PassThrough(options);

					Transform.call(this, options);
				}

				PassThrough.prototype._transform = function (chunk, encoding, cb) {
					cb(null, chunk);
				};
			}, { "./_stream_transform": 193, "core-util-is": 160, "inherits": 167 }], 192: [function (localRequire, localModule, localExports) {
				(function (process) {
					'use strict';

					localModule.localExports = Readable;

					/*<replacement>*/
					var processNextTick = localRequire('process-nextick-args');
					/*</replacement>*/

					/*<replacement>*/
					var isArray = localRequire('isarray');
					/*</replacement>*/

					/*<replacement>*/
					var Buffer = localRequire('buffer').Buffer;
					/*</replacement>*/

					(<any>Readable).ReadableState = ReadableState;

					var EE = localRequire('events');

					/*<replacement>*/
					var EElistenerCount = function (emitter, type) {
						return emitter.listeners(type).length;
					};
					/*</replacement>*/

					/*<replacement>*/
					var Stream;
					(function () {
						try {
							Stream = localRequire('st' + 'ream');
						} catch (_) { } finally {
							if (!Stream) Stream = localRequire('events').EventEmitter;
						}
					})();
					/*</replacement>*/

					var Buffer = localRequire('buffer').Buffer;

					/*<replacement>*/
					var util = localRequire('core-util-is');
					util.inherits = localRequire('inherits');
					/*</replacement>*/

					/*<replacement>*/
					var debugUtil = localRequire('util');
					var debug = undefined;
					if (debugUtil && debugUtil.debuglog) {
						debug = debugUtil.debuglog('stream');
					} else {
						debug = function () { };
					}
					/*</replacement>*/

					var StringDecoder;

					util.inherits(Readable, Stream);

					var Duplex;
					function ReadableState(options, stream) {
						Duplex = Duplex || localRequire('./_stream_duplex');

						options = options || {};

						// object stream flag. Used to make read(n) ignore n and to
						// make all the buffer merging and length checks go away
						this.objectMode = !!options.objectMode;

						if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;

						// the point at which it stops calling _read() to fill the buffer
						// Note: 0 is a valid value, means "don't call _read preemptively ever"
						var hwm = options.highWaterMark;
						var defaultHwm = this.objectMode ? 16 : 16 * 1024;
						this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;

						// cast to ints.
						this.highWaterMark = ~ ~this.highWaterMark;

						this.buffer = [];
						this.length = 0;
						this.pipes = null;
						this.pipesCount = 0;
						this.flowing = null;
						this.ended = false;
						this.endEmitted = false;
						this.reading = false;

						// a flag to be able to tell if the onwrite cb is called immediately,
						// or on a later tick.  We set this to true at first, because any
						// actions that shouldn't happen until "later" should generally also
						// not happen before the first write call.
						this.sync = true;

						// whenever we return null, then we set a flag to say
						// that we're awaiting a 'readable' event emission.
						this.needReadable = false;
						this.emittedReadable = false;
						this.readableListening = false;
						this.resumeScheduled = false;

						// Crypto is kind of old and crusty.  Historically, its default string
						// encoding is 'binary' so we have to make this configurable.
						// Everything else in the universe uses 'utf8', though.
						this.defaultEncoding = options.defaultEncoding || 'utf8';

						// when piping, we only care about 'readable' events that happen
						// after read()ing all the bytes and not getting any pushback.
						this.ranOut = false;

						// the number of writers that are awaiting a drain event in .pipe()s
						this.awaitDrain = 0;

						// if true, a maybeReadMore has been scheduled
						this.readingMore = false;

						this.decoder = null;
						this.encoding = null;
						if (options.encoding) {
							if (!StringDecoder) StringDecoder = localRequire('string_decoder/').StringDecoder;
							this.decoder = new StringDecoder(options.encoding);
							this.encoding = options.encoding;
						}
					}

					var Duplex;
					function Readable(options): void {
						Duplex = Duplex || localRequire('./_stream_duplex');

						if (!(this instanceof Readable)) return new Readable(options);

						this._readableState = new ReadableState(options, this);

						// legacy
						this.readable = true;

						if (options && typeof options.read === 'function') this._read = options.read;

						Stream.call(this);
					}

					// Manually shove something into the read() buffer.
					// This returns true if the highWaterMark has not been hit yet,
					// similar to how Writable.write() returns true if you should
					// write() some more.
					Readable.prototype.push = function (chunk, encoding) {
						var state = this._readableState;

						if (!state.objectMode && typeof chunk === 'string') {
							encoding = encoding || state.defaultEncoding;
							if (encoding !== state.encoding) {
								chunk = new Buffer(chunk, encoding);
								encoding = '';
							}
						}

						return readableAddChunk(this, state, chunk, encoding, false);
					};

					// Unshift should *always* be something directly out of read()
					Readable.prototype.unshift = function (chunk) {
						var state = this._readableState;
						return readableAddChunk(this, state, chunk, '', true);
					};

					Readable.prototype.isPaused = function () {
						return this._readableState.flowing === false;
					};

					function readableAddChunk(stream, state, chunk, encoding, addToFront) {
						var er = chunkInvalid(state, chunk);
						if (er) {
							stream.emit('error', er);
						} else if (chunk === null) {
							state.reading = false;
							onEofChunk(stream, state);
						} else if (state.objectMode || chunk && chunk.length > 0) {
							if (state.ended && !addToFront) {
								var e = new Error('stream.push() after EOF');
								stream.emit('error', e);
							} else if (state.endEmitted && addToFront) {
								var e = new Error('stream.unshift() after end event');
								stream.emit('error', e);
							} else {
								var skipAdd;
								if (state.decoder && !addToFront && !encoding) {
									chunk = state.decoder.write(chunk);
									skipAdd = !state.objectMode && chunk.length === 0;
								}

								if (!addToFront) state.reading = false;

								// Don't add to the buffer if we've decoded to an empty string chunk and
								// we're not in object mode
								if (!skipAdd) {
									// if we want the data now, just emit it.
									if (state.flowing && state.length === 0 && !state.sync) {
										stream.emit('data', chunk);
										stream.read(0);
									} else {
										// update the buffer info.
										state.length += state.objectMode ? 1 : chunk.length;
										if (addToFront) state.buffer.unshift(chunk); else state.buffer.push(chunk);

										if (state.needReadable) emitReadable(stream);
									}
								}

								maybeReadMore(stream, state);
							}
						} else if (!addToFront) {
							state.reading = false;
						}

						return needMoreData(state);
					}

					// if it's past the high water mark, we can push in some more.
					// Also, if we have no data yet, we can stand some
					// more bytes.  This is to work around cases where hwm=0,
					// such as the repl.  Also, if the push() triggered a
					// readable event, and the user called read(largeNumber) such that
					// needReadable was set, then we ought to push more, so that another
					// 'readable' event will be triggered.
					function needMoreData(state) {
						return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
					}

					// backwards compatibility.
					Readable.prototype.setEncoding = function (enc) {
						if (!StringDecoder) StringDecoder = localRequire('string_decoder/').StringDecoder;
						this._readableState.decoder = new StringDecoder(enc);
						this._readableState.encoding = enc;
						return this;
					};

					// Don't raise the hwm > 8MB
					var MAX_HWM = 0x800000;
					function computeNewHighWaterMark(n) {
						if (n >= MAX_HWM) {
							n = MAX_HWM;
						} else {
							// Get the next highest power of 2
							n--;
							n |= n >>> 1;
							n |= n >>> 2;
							n |= n >>> 4;
							n |= n >>> 8;
							n |= n >>> 16;
							n++;
						}
						return n;
					}

					function howMuchToRead(n, state) {
						if (state.length === 0 && state.ended) return 0;

						if (state.objectMode) return n === 0 ? 0 : 1;

						if (n === null || isNaN(n)) {
							// only flow one buffer at a time
							if (state.flowing && state.buffer.length) return state.buffer[0].length; else return state.length;
						}

						if (n <= 0) return 0;

						// If we're asking for more than the target buffer level,
						// then raise the water mark.  Bump up to the next highest
						// power of 2, to prevent increasing it excessively in tiny
						// amounts.
						if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);

						// don't have that much.  return null, unless we've ended.
						if (n > state.length) {
							if (!state.ended) {
								state.needReadable = true;
								return 0;
							} else {
								return state.length;
							}
						}

						return n;
					}

					// you can override either this method, or the async _read(n) below.
					Readable.prototype.read = function (n) {
						debug('read', n);
						var state = this._readableState;
						var nOrig = n;

						if (typeof n !== 'number' || n > 0) state.emittedReadable = false;

						// if we're doing read(0) to trigger a readable event, but we
						// already have a bunch of data in the buffer, then just trigger
						// the 'readable' event and move on.
						if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
							debug('read: emitReadable', state.length, state.ended);
							if (state.length === 0 && state.ended) endReadable(this); else emitReadable(this);
							return null;
						}

						n = howMuchToRead(n, state);

						// if we've ended, and we're now clear, then finish it up.
						if (n === 0 && state.ended) {
							if (state.length === 0) endReadable(this);
							return null;
						}

						// All the actual chunk generation logic needs to be
						// *below* the call to _read.  The reason is that in certain
						// synthetic stream cases, such as passthrough streams, _read
						// may be a completely synchronous operation which may change
						// the state of the read buffer, providing enough data when
						// before there was *not* enough.
						//
						// So, the steps are:
						// 1. Figure out what the state of things will be after we do
						// a read from the buffer.
						//
						// 2. If that resulting state will trigger a _read, then call _read.
						// Note that this may be asynchronous, or synchronous.  Yes, it is
						// deeply ugly to write APIs this way, but that still doesn't mean
						// that the Readable class should behave improperly, as streams are
						// designed to be sync/async agnostic.
						// Take note if the _read call is sync or async (ie, if the read call
						// has returned yet), so that we know whether or not it's safe to emit
						// 'readable' etc.
						//
						// 3. Actually pull the requested chunks out of the buffer and return.

						// if we need a readable event, then we need to do some reading.
						var doRead = state.needReadable;
						debug('need readable', doRead);

						// if we currently have less than the highWaterMark, then also read some
						if (state.length === 0 || state.length - n < state.highWaterMark) {
							doRead = true;
							debug('length less than watermark', doRead);
						}

						// however, if we've ended, then there's no point, and if we're already
						// reading, then it's unnecessary.
						if (state.ended || state.reading) {
							doRead = false;
							debug('reading or ended', doRead);
						}

						if (doRead) {
							debug('do read');
							state.reading = true;
							state.sync = true;
							// if the length is currently zero, then we *need* a readable event.
							if (state.length === 0) state.needReadable = true;
							// call internal read method
							this._read(state.highWaterMark);
							state.sync = false;
						}

						// If _read pushed data synchronously, then `reading` will be false,
						// and we need to re-evaluate how much data we can return to the user.
						if (doRead && !state.reading) n = howMuchToRead(nOrig, state);

						var ret;
						if (n > 0) ret = fromList(n, state); else ret = null;

						if (ret === null) {
							state.needReadable = true;
							n = 0;
						}

						state.length -= n;

						// If we have nothing in the buffer, then we want to know
						// as soon as we *do* get something into the buffer.
						if (state.length === 0 && !state.ended) state.needReadable = true;

						// If we tried to read() past the EOF, then emit end on the next tick.
						if (nOrig !== n && state.ended && state.length === 0) endReadable(this);

						if (ret !== null) this.emit('data', ret);

						return ret;
					};

					function chunkInvalid(state, chunk) {
						var er = null;
						if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
							er = new TypeError('Invalid non-string/buffer chunk');
						}
						return er;
					}

					function onEofChunk(stream, state) {
						if (state.ended) return;
						if (state.decoder) {
							var chunk = state.decoder.end();
							if (chunk && chunk.length) {
								state.buffer.push(chunk);
								state.length += state.objectMode ? 1 : chunk.length;
							}
						}
						state.ended = true;

						// emit 'readable' now to make sure it gets picked up.
						emitReadable(stream);
					}

					// Don't emit readable right away in sync mode, because this can trigger
					// another read() call => stack overflow.  This way, it might trigger
					// a nextTick recursion warning, but that's not so bad.
					function emitReadable(stream, farg1?) {
						var state = stream._readableState;
						state.needReadable = false;
						if (!state.emittedReadable) {
							debug('emitReadable', state.flowing);
							state.emittedReadable = true;
							if (state.sync) processNextTick(emitReadable_, stream); else emitReadable_(stream);
						}
					}

					function emitReadable_(stream) {
						debug('emit readable');
						stream.emit('readable');
						flow(stream);
					}

					// at this point, the user has presumably seen the 'readable' event,
					// and called read() to consume some data.  that may have triggered
					// in turn another _read(n) call, in which case reading = true if
					// it's in progress.
					// However, if we're not ended, or reading, and the length < hwm,
					// then go ahead and try to read some more preemptively.
					function maybeReadMore(stream, state) {
						if (!state.readingMore) {
							state.readingMore = true;
							processNextTick(maybeReadMore_, stream, state);
						}
					}

					function maybeReadMore_(stream, state) {
						var len = state.length;
						while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
							debug('maybeReadMore read 0');
							stream.read(0);
							if (len === state.length)
								// didn't get any data, stop spinning.
								break; else len = state.length;
						}
						state.readingMore = false;
					}

					// abstract method.  to be overridden in specific implementation classes.
					// call cb(er, data) where data is <= n in length.
					// for virtual (non-string, non-buffer) streams, "length" is somewhat
					// arbitrary, and perhaps not very meaningful.
					Readable.prototype._read = function (n) {
						this.emit('error', new Error('not implemented'));
					};

					Readable.prototype.pipe = function (dest, pipeOpts) {
						var src = this;
						var state = this._readableState;

						switch (state.pipesCount) {
							case 0:
								state.pipes = dest;
								break;
							case 1:
								state.pipes = [state.pipes, dest];
								break;
							default:
								state.pipes.push(dest);
								break;
						}
						state.pipesCount += 1;
						debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);

						var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;

						var endFn = doEnd ? onend : cleanup;
						if (state.endEmitted) processNextTick(endFn); else src.once('end', endFn);

						dest.on('unpipe', onunpipe);
						function onunpipe(readable) {
							debug('onunpipe');
							if (readable === src) {
								cleanup();
							}
						}

						function onend() {
							debug('onend');
							dest.end();
						}

						// when the dest drains, it reduces the awaitDrain counter
						// on the source.  This would be more elegant with a .once()
						// handler in flow(), but adding and removing repeatedly is
						// too slow.
						var ondrain = pipeOnDrain(src);
						dest.on('drain', ondrain);

						var cleanedUp = false;
						function cleanup() {
							debug('cleanup');
							// cleanup event handlers once the pipe is broken
							dest.removeListener('close', onclose);
							dest.removeListener('finish', onfinish);
							dest.removeListener('drain', ondrain);
							dest.removeListener('error', onerror);
							dest.removeListener('unpipe', onunpipe);
							src.removeListener('end', onend);
							src.removeListener('end', cleanup);
							src.removeListener('data', ondata);

							cleanedUp = true;

							// if the reader is waiting for a drain event from this
							// specific writer, then it would cause it to never start
							// flowing again.
							// So, if this is awaiting a drain, then we just call it now.
							// If we don't know, then assume that we are waiting for one.
							if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
						}

						src.on('data', ondata);
						function ondata(chunk) {
							debug('ondata');
							var ret = dest.write(chunk);
							if (false === ret) {
								// If the user unpiped during `dest.write()`, it is possible
								// to get stuck in a permanently paused state if that write
								// also returned false.
								if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) {
									debug('false write response, pause', src._readableState.awaitDrain);
									src._readableState.awaitDrain++;
								}
								src.pause();
							}
						}

						// if the dest has an error, then stop piping into it.
						// however, don't suppress the throwing behavior for this.
						function onerror(er) {
							debug('onerror', er);
							unpipe();
							dest.removeListener('error', onerror);
							if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
						}
						// This is a brutally ugly hack to make sure that our error handler
						// is attached before any userland ones.  NEVER DO THIS.
						if (!dest._events || !dest._events.error) dest.on('error', onerror); else if (isArray(dest._events.error)) dest._events.error.unshift(onerror); else dest._events.error = [onerror, dest._events.error];

						// Both close and finish should trigger unpipe, but only once.
						function onclose() {
							dest.removeListener('finish', onfinish);
							unpipe();
						}
						dest.once('close', onclose);
						function onfinish() {
							debug('onfinish');
							dest.removeListener('close', onclose);
							unpipe();
						}
						dest.once('finish', onfinish);

						function unpipe() {
							debug('unpipe');
							src.unpipe(dest);
						}

						// tell the dest that it's being piped to
						dest.emit('pipe', src);

						// start the flow if it hasn't been started already.
						if (!state.flowing) {
							debug('pipe resume');
							src.resume();
						}

						return dest;
					};

					function pipeOnDrain(src) {
						return function () {
							var state = src._readableState;
							debug('pipeOnDrain', state.awaitDrain);
							if (state.awaitDrain) state.awaitDrain--;
							if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
								state.flowing = true;
								flow(src);
							}
						};
					}

					Readable.prototype.unpipe = function (dest) {
						var state = this._readableState;

						// if we're not piping anywhere, then do nothing.
						if (state.pipesCount === 0) return this;

						// just one destination.  most common case.
						if (state.pipesCount === 1) {
							// passed in one, but it's not the right one.
							if (dest && dest !== state.pipes) return this;

							if (!dest) dest = state.pipes;

							// got a match.
							state.pipes = null;
							state.pipesCount = 0;
							state.flowing = false;
							if (dest) dest.emit('unpipe', this);
							return this;
						}

						// slow case. multiple pipe destinations.

						if (!dest) {
							// remove all.
							var dests = state.pipes;
							var len = state.pipesCount;
							state.pipes = null;
							state.pipesCount = 0;
							state.flowing = false;

							for (var _i = 0; _i < len; _i++) {
								dests[_i].emit('unpipe', this);
							} return this;
						}

						// try to find the right one.
						var i = indexOf(state.pipes, dest);
						if (i === -1) return this;

						state.pipes.splice(i, 1);
						state.pipesCount -= 1;
						if (state.pipesCount === 1) state.pipes = state.pipes[0];

						dest.emit('unpipe', this);

						return this;
					};

					// set up data events if they are asked for
					// Ensure readable listeners eventually get something
					Readable.prototype.on = function (ev, fn) {
						var res = Stream.prototype.on.call(this, ev, fn);

						// If listening to data, and it has not explicitly been paused,
						// then call resume to start the flow of data on the next tick.
						if (ev === 'data' && false !== this._readableState.flowing) {
							this.resume();
						}

						if (ev === 'readable' && !this._readableState.endEmitted) {
							var state = this._readableState;
							if (!state.readableListening) {
								state.readableListening = true;
								state.emittedReadable = false;
								state.needReadable = true;
								if (!state.reading) {
									processNextTick(nReadingNextTick, this);
								} else if (state.length) {
									emitReadable(this, state);
								}
							}
						}

						return res;
					};
					Readable.prototype.addListener = Readable.prototype.on;

					function nReadingNextTick(self) {
						debug('readable nexttick read 0');
						self.read(0);
					}

					// pause() and resume() are remnants of the legacy readable stream API
					// If the user uses them, then switch into old mode.
					Readable.prototype.resume = function () {
						var state = this._readableState;
						if (!state.flowing) {
							debug('resume');
							state.flowing = true;
							resume(this, state);
						}
						return this;
					};

					function resume(stream, state) {
						if (!state.resumeScheduled) {
							state.resumeScheduled = true;
							processNextTick(resume_, stream, state);
						}
					}

					function resume_(stream, state) {
						if (!state.reading) {
							debug('resume read 0');
							stream.read(0);
						}

						state.resumeScheduled = false;
						stream.emit('resume');
						flow(stream);
						if (state.flowing && !state.reading) stream.read(0);
					}

					Readable.prototype.pause = function () {
						debug('call pause flowing=%j', this._readableState.flowing);
						if (false !== this._readableState.flowing) {
							debug('pause');
							this._readableState.flowing = false;
							this.emit('pause');
						}
						return this;
					};

					function flow(stream) {
						var state = stream._readableState;
						debug('flow', state.flowing);
						if (state.flowing) {
							do {
								var chunk = stream.read();
							} while (null !== chunk && state.flowing);
						}
					}

					// wrap an old-style stream as the async data source.
					// This is *not* part of the readable stream interface.
					// It is an ugly unfortunate mess of history.
					Readable.prototype.wrap = function (stream) {
						var state = this._readableState;
						var paused = false;

						var self = this;
						stream.on('end', function () {
							debug('wrapped end');
							if (state.decoder && !state.ended) {
								var chunk = state.decoder.end();
								if (chunk && chunk.length) self.push(chunk);
							}

							self.push(null);
						});

						stream.on('data', function (chunk) {
							debug('wrapped data');
							if (state.decoder) chunk = state.decoder.write(chunk);

							// don't skip over falsy values in objectMode
							if (state.objectMode && (chunk === null || chunk === undefined)) return; else if (!state.objectMode && (!chunk || !chunk.length)) return;

							var ret = self.push(chunk);
							if (!ret) {
								paused = true;
								stream.pause();
							}
						});

						// proxy all the other methods.
						// important when wrapping filters and duplexes.
						for (var i in stream) {
							if (this[i] === undefined && typeof stream[i] === 'function') {
								this[i] = function (method) {
									return function () {
										return stream[method].apply(stream, arguments);
									};
								} (i);
							}
						}

						// proxy certain important events.
						var events = ['error', 'close', 'destroy', 'pause', 'resume'];
						forEach(events, function (ev) {
							stream.on(ev, self.emit.bind(self, ev));
						});

						// when we try to consume some more bytes, simply unpause the
						// underlying stream.
						self._read = function (n) {
							debug('wrapped _read', n);
							if (paused) {
								paused = false;
								stream.resume();
							}
						};

						return self;
					};

					// exposed for testing purposes only.
					(<any>Readable)._fromList = fromList;

					// Pluck off n bytes from an array of buffers.
					// Length is the combined lengths of all the buffers in the list.
					function fromList(n, state) {
						var list = state.buffer;
						var length = state.length;
						var stringMode = !!state.decoder;
						var objectMode = !!state.objectMode;
						var ret;

						// nothing in the list, definitely empty.
						if (list.length === 0) return null;

						if (length === 0) ret = null; else if (objectMode) ret = list.shift(); else if (!n || n >= length) {
							// read it all, truncate the array.
							if (stringMode) ret = list.join(''); else if (list.length === 1) ret = list[0]; else ret = Buffer.concat(list, length);
							list.length = 0;
						} else {
							// read just some of it.
							if (n < list[0].length) {
								// just take a part of the first list item.
								// slice is the same for buffers and strings.
								var buf = list[0];
								ret = buf.slice(0, n);
								list[0] = buf.slice(n);
							} else if (n === list[0].length) {
								// first list is a perfect match
								ret = list.shift();
							} else {
								// complex case.
								// we have enough to cover it, but it spans past the first buffer.
								if (stringMode) ret = ''; else ret = new Buffer(n);

								var c = 0;
								for (var i = 0, l = list.length; i < l && c < n; i++) {
									var buf = list[0];
									var cpy = Math.min(n - c, buf.length);

									if (stringMode) ret += buf.slice(0, cpy); else buf.copy(ret, c, 0, cpy);

									if (cpy < buf.length) list[0] = buf.slice(cpy); else list.shift();

									c += cpy;
								}
							}
						}

						return ret;
					}

					function endReadable(stream) {
						var state = stream._readableState;

						// If we get here before consuming all the bytes, then that is a
						// bug in node.  Should never happen.
						if (state.length > 0) throw new Error('endReadable called on non-empty stream');

						if (!state.endEmitted) {
							state.ended = true;
							processNextTick(endReadableNT, state, stream);
						}
					}

					function endReadableNT(state, stream) {
						// Check that we didn't get one last unshift.
						if (!state.endEmitted && state.length === 0) {
							state.endEmitted = true;
							stream.readable = false;
							stream.emit('end');
						}
					}

					function forEach(xs, f) {
						for (var i = 0, l = xs.length; i < l; i++) {
							f(xs[i], i);
						}
					}

					function indexOf(xs, x) {
						for (var i = 0, l = xs.length; i < l; i++) {
							if (xs[i] === x) return i;
						}
						return -1;
					}
				}).call(this, localRequire('_process'))

			}, { "./_stream_duplex": 190, "_process": 188, "buffer": 60, "core-util-is": 160, "events": 164, "inherits": 167, "isarray": 169, "process-nextick-args": 187, "string_decoder/": 217, "util": 56 }], 193: [function (localRequire, localModule, localExports) {
				// a transform stream is a readable/writable stream where you do
				// something with the data.  Sometimes it's called a "filter",
				// but that's not a great name for it, since that implies a thing where
				// some bits pass through, and others are simply ignored.  (That would
				// be a valid example of a transform, of course.)
				//
				// While the output is causally related to the input, it's not a
				// necessarily symmetric or synchronous transformation.  For example,
				// a zlib stream might take multiple plain-text writes(), and then
				// emit a single compressed chunk some time in the future.
				//
				// Here's how this works:
				//
				// The Transform stream has all the aspects of the readable and writable
				// stream classes.  When you write(chunk), that calls _write(chunk,cb)
				// internally, and returns false if there's a lot of pending writes
				// buffered up.  When you call read(), that calls _read(n) until
				// there's enough pending readable data buffered up.
				//
				// In a transform stream, the written data is placed in a buffer.  When
				// _read(n) is called, it transforms the queued up data, calling the
				// buffered _write cb's as it consumes chunks.  If consuming a single
				// written chunk would result in multiple output chunks, then the first
				// outputted bit calls the readcb, and subsequent chunks just go into
				// the read buffer, and will cause it to emit 'readable' if necessary.
				//
				// This way, back-pressure is actually determined by the reading side,
				// since _read has to be called to start processing a new chunk.  However,
				// a pathological inflate type of transform can cause excessive buffering
				// here.  For example, imagine a stream where every byte of input is
				// interpreted as an integer from 0-255, and then results in that many
				// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in
				// 1kb of data being output.  In this case, you could write a very small
				// amount of input, and end up with a very large amount of output.  In
				// such a pathological inflating mechanism, there'd be no way to tell
				// the system to stop doing the transform.  A single 4MB write could
				// cause the system to run out of memory.
				//
				// However, even in such a pathological case, only a single written chunk
				// would be consumed, and then the rest would wait (un-transformed) until
				// the results of the previous transformed chunk were consumed.

				'use strict';

				localModule.localExports = Transform;

				var Duplex = localRequire('./_stream_duplex');

				/*<replacement>*/
				var util = localRequire('core-util-is');
				util.inherits = localRequire('inherits');
				/*</replacement>*/

				util.inherits(Transform, Duplex);

				function TransformState(stream) {
					this.afterTransform = function (er, data) {
						return afterTransform(stream, er, data);
					};

					this.needTransform = false;
					this.transforming = false;
					this.writecb = null;
					this.writechunk = null;
					this.writeencoding = null;
				}

				function afterTransform(stream, er, data) {
					var ts = stream._transformState;
					ts.transforming = false;

					var cb = ts.writecb;

					if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));

					ts.writechunk = null;
					ts.writecb = null;

					if (data !== null && data !== undefined) stream.push(data);

					cb(er);

					var rs = stream._readableState;
					rs.reading = false;
					if (rs.needReadable || rs.length < rs.highWaterMark) {
						stream._read(rs.highWaterMark);
					}
				}

				function Transform(options): void {
					if (!(this instanceof Transform)) return new Transform(options);

					Duplex.call(this, options);

					this._transformState = new TransformState(this);

					// when the writable side finishes, then flush out anything remaining.
					var stream = this;

					// start out asking for a readable event once data is transformed.
					this._readableState.needReadable = true;

					// we have implemented the _read method, and done the other things
					// that Readable wants before the first _read call, so unset the
					// sync guard flag.
					this._readableState.sync = false;

					if (options) {
						if (typeof options.transform === 'function') this._transform = options.transform;

						if (typeof options.flush === 'function') this._flush = options.flush;
					}

					this.once('prefinish', function () {
						if (typeof this._flush === 'function') this._flush(function (er) {
							done(stream, er);
						}); else done(stream);
					});
				}

				Transform.prototype.push = function (chunk, encoding) {
					this._transformState.needTransform = false;
					return Duplex.prototype.push.call(this, chunk, encoding);
				};

				// This is the part where you do stuff!
				// override this function in implementation classes.
				// 'chunk' is an input chunk.
				//
				// Call `push(newChunk)` to pass along transformed output
				// to the readable side.  You may call 'push' zero or more times.
				//
				// Call `cb(err)` when you are done with this chunk.  If you pass
				// an error, then that'll put the hurt on the whole operation.  If you
				// never call cb(), then you'll never get another chunk.
				Transform.prototype._transform = function (chunk, encoding, cb) {
					throw new Error('not implemented');
				};

				Transform.prototype._write = function (chunk, encoding, cb) {
					var ts = this._transformState;
					ts.writecb = cb;
					ts.writechunk = chunk;
					ts.writeencoding = encoding;
					if (!ts.transforming) {
						var rs = this._readableState;
						if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
					}
				};

				// Doesn't matter what the args are here.
				// _transform does all the work.
				// That we got here means that the readable side wants more data.
				Transform.prototype._read = function (n) {
					var ts = this._transformState;

					if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
						ts.transforming = true;
						this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
					} else {
						// mark that we need a transform, so that any data that comes in
						// will get processed, now that we've asked for it.
						ts.needTransform = true;
					}
				};

				function done(stream, er?) {
					if (er) return stream.emit('error', er);

					// if there's nothing in the write buffer, then that means
					// that nothing more will ever be provided
					var ws = stream._writableState;
					var ts = stream._transformState;

					if (ws.length) throw new Error('calling transform done when ws.length != 0');

					if (ts.transforming) throw new Error('calling transform done when still transforming');

					return stream.push(null);
				}
			}, { "./_stream_duplex": 190, "core-util-is": 160, "inherits": 167 }], 194: [function (localRequire, localModule, localExports) {
				(function (process) {
					// A bit simpler than readable streams.
					// Implement an async ._write(chunk, encoding, cb), and it'll handle all
					// the drain event emission and buffering.

					'use strict';

					localModule.localExports = Writable;

					/*<replacement>*/
					var processNextTick = localRequire('process-nextick-args');
					/*</replacement>*/

					/*<replacement>*/
					var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
					/*</replacement>*/

					/*<replacement>*/
					var Buffer = localRequire('buffer').Buffer;
					/*</replacement>*/

					(<any>Writable).WritableState = WritableState;

					/*<replacement>*/
					var util = localRequire('core-util-is');
					util.inherits = localRequire('inherits');
					/*</replacement>*/

					/*<replacement>*/
					var internalUtil = {
						deprecate: localRequire('util-deprecate')
					};
					/*</replacement>*/

					/*<replacement>*/
					var Stream;
					(function () {
						try {
							Stream = localRequire('st' + 'ream');
						} catch (_) { } finally {
							if (!Stream) Stream = localRequire('events').EventEmitter;
						}
					})();
					/*</replacement>*/

					var Buffer = localRequire('buffer').Buffer;

					util.inherits(Writable, Stream);

					function nop() { }

					function WriteReq(chunk, encoding, cb) {
						this.chunk = chunk;
						this.encoding = encoding;
						this.callback = cb;
						this.next = null;
					}

					var Duplex;
					function WritableState(options, stream) {
						Duplex = Duplex || localRequire('./_stream_duplex');

						options = options || {};

						// object stream flag to indicate whether or not this stream
						// contains buffers or objects.
						this.objectMode = !!options.objectMode;

						if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;

						// the point at which write() starts returning false
						// Note: 0 is a valid value, means that we always return false if
						// the entire buffer is not flushed immediately on write()
						var hwm = options.highWaterMark;
						var defaultHwm = this.objectMode ? 16 : 16 * 1024;
						this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;

						// cast to ints.
						this.highWaterMark = ~ ~this.highWaterMark;

						this.needDrain = false;
						// at the start of calling end()
						this.ending = false;
						// when end() has been called, and returned
						this.ended = false;
						// when 'finish' is emitted
						this.finished = false;

						// should we decode strings into buffers before passing to _write?
						// this is here so that some node-core streams can optimize string
						// handling at a lower level.
						var noDecode = options.decodeStrings === false;
						this.decodeStrings = !noDecode;

						// Crypto is kind of old and crusty.  Historically, its default string
						// encoding is 'binary' so we have to make this configurable.
						// Everything else in the universe uses 'utf8', though.
						this.defaultEncoding = options.defaultEncoding || 'utf8';

						// not an actual buffer we keep track of, but a measurement
						// of how much we're waiting to get pushed to some underlying
						// socket or file.
						this.length = 0;

						// a flag to see when we're in the middle of a write.
						this.writing = false;

						// when true all writes will be buffered until .uncork() call
						this.corked = 0;

						// a flag to be able to tell if the onwrite cb is called immediately,
						// or on a later tick.  We set this to true at first, because any
						// actions that shouldn't happen until "later" should generally also
						// not happen before the first write call.
						this.sync = true;

						// a flag to know if we're processing previously buffered items, which
						// may call the _write() callback in the same tick, so that we don't
						// end up in an overlapped onwrite situation.
						this.bufferProcessing = false;

						// the callback that's passed to _write(chunk,cb)
						this.onwrite = function (er) {
							onwrite(stream, er);
						};

						// the callback that the user supplies to write(chunk,encoding,cb)
						this.writecb = null;

						// the amount that is being written when _write is called.
						this.writelen = 0;

						this.bufferedRequest = null;
						this.lastBufferedRequest = null;

						// number of pending user-supplied write callbacks
						// this must be 0 before 'finish' can be emitted
						this.pendingcb = 0;

						// emit prefinish if the only thing we're waiting for is _write cbs
						// This is relevant for synchronous Transform streams
						this.prefinished = false;

						// True if the error was already emitted and should not be thrown again
						this.errorEmitted = false;

						// count buffered requests
						this.bufferedRequestCount = 0;

						// create the two objects needed to store the corked requests
						// they are not a linked list, as no new elements are inserted in there
						this.corkedRequestsFree = new CorkedRequest(this);
						this.corkedRequestsFree.next = new CorkedRequest(this);
					}

					WritableState.prototype.getBuffer = function writableStateGetBuffer() {
						var current = this.bufferedRequest;
						var out = [];
						while (current) {
							out.push(current);
							current = current.next;
						}
						return out;
					};

					(function () {
						try {
							Object.defineProperty(WritableState.prototype, 'buffer', {
								get: internalUtil.deprecate(function () {
									return this.getBuffer();
								}, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
							});
						} catch (_) { }
					})();

					var Duplex;
					function Writable(options): void {
						Duplex = Duplex || localRequire('./_stream_duplex');

						// Writable ctor is applied to Duplexes, though they're not
						// instanceof Writable, they're instanceof Readable.
						if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options);

						this._writableState = new WritableState(options, this);

						// legacy.
						this.writable = true;

						if (options) {
							if (typeof options.write === 'function') this._write = options.write;

							if (typeof options.writev === 'function') this._writev = options.writev;
						}

						Stream.call(this);
					}

					// Otherwise people can pipe Writable streams, which is just wrong.
					Writable.prototype.pipe = function () {
						this.emit('error', new Error('Cannot pipe. Not readable.'));
					};

					function writeAfterEnd(stream, cb) {
						var er = new Error('write after end');
						// TODO: defer error events consistently everywhere, not just the cb
						stream.emit('error', er);
						processNextTick(cb, er);
					}

					// If we get something that is not a buffer, string, null, or undefined,
					// and we're not in objectMode, then that's an error.
					// Otherwise stream chunks are all considered to be of length=1, and the
					// watermarks determine how many objects to keep in the buffer, rather than
					// how many bytes or characters.
					function validChunk(stream, state, chunk, cb) {
						var valid = true;

						if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
							var er = new TypeError('Invalid non-string/buffer chunk');
							stream.emit('error', er);
							processNextTick(cb, er);
							valid = false;
						}
						return valid;
					}

					Writable.prototype.write = function (chunk, encoding, cb) {
						var state = this._writableState;
						var ret = false;

						if (typeof encoding === 'function') {
							cb = encoding;
							encoding = null;
						}

						if (Buffer.isBuffer(chunk)) encoding = 'buffer'; else if (!encoding) encoding = state.defaultEncoding;

						if (typeof cb !== 'function') cb = nop;

						if (state.ended) writeAfterEnd(this, cb); else if (validChunk(this, state, chunk, cb)) {
							state.pendingcb++;
							ret = writeOrBuffer(this, state, chunk, encoding, cb);
						}

						return ret;
					};

					Writable.prototype.cork = function () {
						var state = this._writableState;

						state.corked++;
					};

					Writable.prototype.uncork = function () {
						var state = this._writableState;

						if (state.corked) {
							state.corked--;

							if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
						}
					};

					Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
						// node::ParseEncoding() requires lower case.
						if (typeof encoding === 'string') encoding = encoding.toLowerCase();
						if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
						this._writableState.defaultEncoding = encoding;
					};

					function decodeChunk(state, chunk, encoding) {
						if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
							chunk = new Buffer(chunk, encoding);
						}
						return chunk;
					}

					// if we're already writing something, then just put this
					// in the queue, and wait our turn.  Otherwise, call _write
					// If we return false, then we need a drain event, so set that flag.
					function writeOrBuffer(stream, state, chunk, encoding, cb) {
						chunk = decodeChunk(state, chunk, encoding);

						if (Buffer.isBuffer(chunk)) encoding = 'buffer';
						var len = state.objectMode ? 1 : chunk.length;

						state.length += len;

						var ret = state.length < state.highWaterMark;
						// we must ensure that previous needDrain will not be reset to false.
						if (!ret) state.needDrain = true;

						if (state.writing || state.corked) {
							var last = state.lastBufferedRequest;
							state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
							if (last) {
								last.next = state.lastBufferedRequest;
							} else {
								state.bufferedRequest = state.lastBufferedRequest;
							}
							state.bufferedRequestCount += 1;
						} else {
							doWrite(stream, state, false, len, chunk, encoding, cb);
						}

						return ret;
					}

					function doWrite(stream, state, writev, len, chunk, encoding, cb) {
						state.writelen = len;
						state.writecb = cb;
						state.writing = true;
						state.sync = true;
						if (writev) stream._writev(chunk, state.onwrite); else stream._write(chunk, encoding, state.onwrite);
						state.sync = false;
					}

					function onwriteError(stream, state, sync, er, cb) {
						--state.pendingcb;
						if (sync) processNextTick(cb, er); else cb(er);

						stream._writableState.errorEmitted = true;
						stream.emit('error', er);
					}

					function onwriteStateUpdate(state) {
						state.writing = false;
						state.writecb = null;
						state.length -= state.writelen;
						state.writelen = 0;
					}

					function onwrite(stream, er) {
						var state = stream._writableState;
						var sync = state.sync;
						var cb = state.writecb;

						onwriteStateUpdate(state);

						if (er) onwriteError(stream, state, sync, er, cb); else {
							// Check if we're actually ready to finish, but don't emit yet
							var finished = needFinish(state);

							if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
								clearBuffer(stream, state);
							}

							if (sync) {
								/*<replacement>*/
								asyncWrite(afterWrite, stream, state, finished, cb);
								/*</replacement>*/
							} else {
								afterWrite(stream, state, finished, cb);
							}
						}
					}

					function afterWrite(stream, state, finished, cb) {
						if (!finished) onwriteDrain(stream, state);
						state.pendingcb--;
						cb();
						finishMaybe(stream, state);
					}

					// Must force callback to be called on nextTick, so that we don't
					// emit 'drain' before the write() consumer gets the 'false' return
					// value, and has a chance to attach a 'drain' listener.
					function onwriteDrain(stream, state) {
						if (state.length === 0 && state.needDrain) {
							state.needDrain = false;
							stream.emit('drain');
						}
					}

					// if there's something in the buffer waiting, then process it
					function clearBuffer(stream, state) {
						state.bufferProcessing = true;
						var entry = state.bufferedRequest;

						if (stream._writev && entry && entry.next) {
							// Fast case, write everything using _writev()
							var l = state.bufferedRequestCount;
							var buffer = new Array(l);
							var holder = state.corkedRequestsFree;
							holder.entry = entry;

							var count = 0;
							while (entry) {
								buffer[count] = entry;
								entry = entry.next;
								count += 1;
							}

							doWrite(stream, state, true, state.length, buffer, '', holder.finish);

							// doWrite is always async, defer these to save a bit of time
							// as the hot path ends with doWrite
							state.pendingcb++;
							state.lastBufferedRequest = null;
							state.corkedRequestsFree = holder.next;
							holder.next = null;
						} else {
							// Slow case, write chunks one-by-one
							while (entry) {
								var chunk = entry.chunk;
								var encoding = entry.encoding;
								var cb = entry.callback;
								var len = state.objectMode ? 1 : chunk.length;

								doWrite(stream, state, false, len, chunk, encoding, cb);
								entry = entry.next;
								// if we didn't call the onwrite immediately, then
								// it means that we need to wait until it does.
								// also, that means that the chunk and cb are currently
								// being processed, so move the buffer counter past them.
								if (state.writing) {
									break;
								}
							}

							if (entry === null) state.lastBufferedRequest = null;
						}

						state.bufferedRequestCount = 0;
						state.bufferedRequest = entry;
						state.bufferProcessing = false;
					}

					Writable.prototype._write = function (chunk, encoding, cb) {
						cb(new Error('not implemented'));
					};

					Writable.prototype._writev = null;

					Writable.prototype.end = function (chunk, encoding, cb) {
						var state = this._writableState;

						if (typeof chunk === 'function') {
							cb = chunk;
							chunk = null;
							encoding = null;
						} else if (typeof encoding === 'function') {
							cb = encoding;
							encoding = null;
						}

						if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);

						// .end() fully uncorks
						if (state.corked) {
							state.corked = 1;
							this.uncork();
						}

						// ignore unnecessary end() calls.
						if (!state.ending && !state.finished) endWritable(this, state, cb);
					};

					function needFinish(state) {
						return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
					}

					function prefinish(stream, state) {
						if (!state.prefinished) {
							state.prefinished = true;
							stream.emit('prefinish');
						}
					}

					function finishMaybe(stream, state) {
						var need = needFinish(state);
						if (need) {
							if (state.pendingcb === 0) {
								prefinish(stream, state);
								state.finished = true;
								stream.emit('finish');
							} else {
								prefinish(stream, state);
							}
						}
						return need;
					}

					function endWritable(stream, state, cb) {
						state.ending = true;
						finishMaybe(stream, state);
						if (cb) {
							if (state.finished) processNextTick(cb); else stream.once('finish', cb);
						}
						state.ended = true;
						stream.writable = false;
					}

					// It seems a linked list but it is not
					// there will be only 2 of these for each stream
					function CorkedRequest(state) {
						var _this = this;

						this.next = null;
						this.entry = null;

						this.finish = function (err) {
							var entry = _this.entry;
							_this.entry = null;
							while (entry) {
								var cb = entry.callback;
								state.pendingcb--;
								cb(err);
								entry = entry.next;
							}
							if (state.corkedRequestsFree) {
								state.corkedRequestsFree.next = _this;
							} else {
								state.corkedRequestsFree = _this;
							}
						};
					}
				}).call(this, localRequire('_process'))

			}, { "./_stream_duplex": 190, "_process": 188, "buffer": 60, "core-util-is": 160, "events": 164, "inherits": 167, "process-nextick-args": 187, "util-deprecate": 222 }], 195: [function (localRequire, localModule, localExports) {
				localModule.localExports = localRequire("./lib/_stream_passthrough.js")

			}, { "./lib/_stream_passthrough.js": 191 }], 196: [function (localRequire, localModule, localExports) {
				var Stream = (function () {
					try {
						return localRequire('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify
					} catch (_) { }
				} ());
				localExports = localModule.localExports = localRequire('./lib/_stream_readable.js');
				localExports.Stream = Stream || localExports;
				localExports.Readable = localExports;
				localExports.Writable = localRequire('./lib/_stream_writable.js');
				localExports.Duplex = localRequire('./lib/_stream_duplex.js');
				localExports.Transform = localRequire('./lib/_stream_transform.js');
				localExports.PassThrough = localRequire('./lib/_stream_passthrough.js');

			}, { "./lib/_stream_duplex.js": 190, "./lib/_stream_passthrough.js": 191, "./lib/_stream_readable.js": 192, "./lib/_stream_transform.js": 193, "./lib/_stream_writable.js": 194 }], 197: [function (localRequire, localModule, localExports) {
				localModule.localExports = localRequire("./lib/_stream_transform.js")

			}, { "./lib/_stream_transform.js": 193 }], 198: [function (localRequire, localModule, localExports) {
				localModule.localExports = localRequire("./lib/_stream_writable.js")

			}, { "./lib/_stream_writable.js": 194 }], 199: [function (localRequire, localModule, localExports) {
				(function () {
					var key, val, _ref, _ref1;
					localExports.EncodeStream = localRequire('./src/EncodeStream');
					localExports.DecodeStream = localRequire('./src/DecodeStream');
					localExports.Array = localRequire('./src/Array');
					localExports.LazyArray = localRequire('./src/LazyArray');
					localExports.Bitfield = localRequire('./src/Bitfield');
					localExports.Boolean = localRequire('./src/Boolean');
					localExports.Buffer = localRequire('./src/Buffer');
					localExports.Enum = localRequire('./src/Enum');
					localExports.Optional = localRequire('./src/Optional');
					localExports.Reserved = localRequire('./src/Reserved');
					localExports.String = localRequire('./src/String');
					localExports.Struct = localRequire('./src/Struct');
					localExports.VersionedStruct = localRequire('./src/VersionedStruct');
					_ref = localRequire('./src/Number');
					for (key in _ref) {
						val = _ref[key];
						localExports[key] = val;
					}
					_ref1 = localRequire('./src/Pointer');
					for (key in _ref1) {
						val = _ref1[key];
						localExports[key] = val;
					}
				}.call(this));
			}, { "./src/Array": 200, "./src/Bitfield": 201, "./src/Boolean": 202, "./src/Buffer": 203, "./src/DecodeStream": 204, "./src/EncodeStream": 205, "./src/Enum": 206, "./src/LazyArray": 207, "./src/Number": 208, "./src/Optional": 209, "./src/Pointer": 210, "./src/Reserved": 211, "./src/String": 212, "./src/Struct": 213, "./src/VersionedStruct": 214 }], 200: [function (localRequire, localModule, localExports) {
				(function () {
					var ArrayT, NumberT, utils;
					NumberT = localRequire('./Number').Number;
					utils = localRequire('./utils');
					ArrayT = function () {
						function ArrayT(type, length, lengthType) {
							this.type = type;
							this.length = length;
							this.lengthType = lengthType != null ? lengthType : 'count';
						}
						ArrayT.prototype.decode = function (stream, parent) {
							var ctx, i, length, pos, res, target, _i;
							pos = stream.pos;
							res = [];
							ctx = parent;
							if (this.length != null) {
								length = utils.resolveLength(this.length, stream, parent);
							}
							if (this.length instanceof NumberT) {
								Object.defineProperties(res, {
									parent: { value: parent },
									_startOffset: { value: pos },
									_currentOffset: {
										value: 0,
										writable: true
									},
									_length: { value: length }
								});
								ctx = res;
							}
							if (length == null || this.lengthType === 'bytes') {
								target = length != null ? stream.pos + length : (parent != null ? parent._length : void 0) ? parent._startOffset + parent._length : stream.length;
								while (stream.pos < target) {
									res.push(this.type.decode(stream, ctx));
								}
							} else {
								for (i = _i = 0; _i < length; i = _i += 1) {
									res.push(this.type.decode(stream, ctx));
								}
							}
							return res;
						};
						ArrayT.prototype.size = function (array, ctx) {
							var item, size, _i, _len;
							if (!array) {
								return this.type.size(null, ctx) * utils.resolveLength(this.length, null, ctx);
							}
							size = 0;
							if (this.length instanceof NumberT) {
								size += this.length.size();
								ctx = { parent: ctx };
							}
							for (_i = 0, _len = array.length; _i < _len; _i++) {
								item = array[_i];
								size += this.type.size(item, ctx);
							}
							return size;
						};
						ArrayT.prototype.encode = function (stream, array, parent) {
							var ctx, i, item, ptr, _i, _len;
							ctx = parent;
							if (this.length instanceof NumberT) {
								ctx = {
									pointers: [],
									startOffset: stream.pos,
									parent: parent
								};
								ctx.pointerOffset = stream.pos + this.size(array, ctx);
								this.length.encode(stream, array.length);
							}
							for (_i = 0, _len = array.length; _i < _len; _i++) {
								item = array[_i];
								this.type.encode(stream, item, ctx);
							}
							if (this.length instanceof NumberT) {
								i = 0;
								while (i < ctx.pointers.length) {
									ptr = ctx.pointers[i++];
									ptr.type.encode(stream, ptr.val);
								}
							}
						};
						return ArrayT;
					} ();
					localModule.localExports = ArrayT;
				}.call(this));
			}, { "./Number": 208, "./utils": 215 }], 201: [function (localRequire, localModule, localExports) {
				(function () {
					var Bitfield;
					Bitfield = function () {
						function Bitfield(type, flags) {
							this.type = type;
							this.flags = flags != null ? flags : [];
						}
						Bitfield.prototype.decode = function (stream) {
							var flag, i, res, val, _i, _len, _ref;
							val = this.type.decode(stream);
							res = {};
							_ref = this.flags;
							for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
								flag = _ref[i];
								if (flag != null) {
									res[flag] = !!(val & 1 << i);
								}
							}
							return res;
						};
						Bitfield.prototype.size = function () {
							return this.type.size();
						};
						Bitfield.prototype.encode = function (stream, keys) {
							var flag, i, val, _i, _len, _ref;
							val = 0;
							_ref = this.flags;
							for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
								flag = _ref[i];
								if (flag != null) {
									if (keys[flag]) {
										val |= 1 << i;
									}
								}
							}
							return this.type.encode(stream, val);
						};
						return Bitfield;
					} ();
					localModule.localExports = Bitfield;
				}.call(this));
			}, {}], 202: [function (localRequire, localModule, localExports) {
				(function () {
					var BooleanT;
					BooleanT = function () {
						function BooleanT(type) {
							this.type = type;
						}
						BooleanT.prototype.decode = function (stream, parent) {
							return !!this.type.decode(stream, parent);
						};
						BooleanT.prototype.size = function (val, parent) {
							return this.type.size(val, parent);
						};
						BooleanT.prototype.encode = function (stream, val, parent) {
							return this.type.encode(stream, +val, parent);
						};
						return BooleanT;
					} ();
					localModule.localExports = BooleanT;
				}.call(this));
			}, {}], 203: [function (localRequire, localModule, localExports) {
				(function () {
					var BufferT, NumberT, utils;
					utils = localRequire('./utils');
					NumberT = localRequire('./Number').Number;
					BufferT = function () {
						function BufferT(length) {
							this.length = length;
						}
						BufferT.prototype.decode = function (stream, parent) {
							var length;
							length = utils.resolveLength(this.length, stream, parent);
							return stream.readBuffer(length);
						};
						BufferT.prototype.size = function (val, parent) {
							if (!val) {
								return utils.resolveLength(this.length, null, parent);
							}
							return val.length;
						};
						BufferT.prototype.encode = function (stream, buf, parent) {
							if (this.length instanceof NumberT) {
								this.length.encode(stream, buf.length);
							}
							return stream.writeBuffer(buf);
						};
						return BufferT;
					} ();
					localModule.localExports = BufferT;
				}.call(this));
			}, { "./Number": 208, "./utils": 215 }], 204: [function (localRequire, localModule, localExports) {
				(function (Buffer) {
					(function () {
						var DecodeStream, iconv;
						try {
							iconv = function () {
								throw new Error('Cannot find module \'iconv-lite\' from \'/Users/devongovett/projects/PDFKit/node_modules/restructure/src\'');
							} ();
						} catch (_error) {
						}
						DecodeStream = function () {
							var key;
							function DecodeStream(buffer) {
								this.buffer = buffer;
								this.pos = 0;
								this.length = this.buffer.length;
							}
							(<any>DecodeStream).TYPES = {
								UInt8: 1,
								UInt16: 2,
								UInt24: 3,
								UInt32: 4,
								Int8: 1,
								Int16: 2,
								Int24: 3,
								Int32: 4,
								Float: 4,
								Double: 8
							};
							for (key in Buffer.prototype) {
								if (key.slice(0, 4) === 'read') {
									(function (key) {
										var bytes;
										bytes = (<any>DecodeStream).TYPES[key.replace(/read|[BL]E/g, '')];
										return DecodeStream.prototype[key] = function () {
											var ret;
											ret = this.buffer[key](this.pos);
											this.pos += bytes;
											return ret;
										};
									} (key));
								}
							}
							DecodeStream.prototype.readString = function (length, encoding) {
								var buf, byte, i, _i, _ref;
								if (encoding == null) {
									encoding = 'ascii';
								}
								switch (encoding) {
									case 'utf16le':
									case 'ucs2':
									case 'utf8':
									case 'ascii':
										return this.buffer.toString(encoding, this.pos, this.pos += length);
									case 'utf16be':
										buf = new Buffer(this.readBuffer(length));
										for (i = _i = 0, _ref = buf.length - 1; _i < _ref; i = _i += 2) {
											byte = buf[i];
											buf[i] = buf[i + 1];
											buf[i + 1] = byte;
										}
										return buf.toString('utf16le');
									default:
										buf = this.readBuffer(length);
										if (iconv) {
											return iconv.decode(buf, encoding);
										}
										return buf;
								}
							};
							DecodeStream.prototype.readBuffer = function (length) {
								return this.buffer.slice(this.pos, this.pos += length);
							};
							DecodeStream.prototype.readUInt24BE = function () {
								return (this.readUInt16BE() << 8) + this.readUInt8();
							};
							DecodeStream.prototype.readUInt24LE = function () {
								return this.readUInt16LE() + (this.readUInt8() << 16);
							};
							DecodeStream.prototype.readInt24BE = function () {
								return (this.readInt16BE() << 8) + this.readUInt8();
							};
							DecodeStream.prototype.readInt24LE = function () {
								return this.readUInt16LE() + (this.readInt8() << 16);
							};
							return DecodeStream;
						} ();
						localModule.localExports = DecodeStream;
					}.call(this));
				}).call(this, localRequire("buffer").Buffer)

			}, { "buffer": 60 }], 205: [function (localRequire, localModule, localExports) {
				(function (Buffer) {
					(function () {
						var DecodeStream, EncodeStream, iconv, stream, __hasProp = {}.hasOwnProperty, __extends = function (child, parent) {
							for (var key in parent) {
								if (__hasProp.call(parent, key))
									child[key] = parent[key];
							}
							function ctor() {
								this.constructor = child;
							}
							ctor.prototype = parent.prototype;
							child.prototype = new ctor();
							child.__super__ = parent.prototype;
							return child;
						};
						stream = localRequire('stream');
						DecodeStream = localRequire('./DecodeStream');
						try {
							iconv = function () {
								throw new Error('Cannot find module \'iconv-lite\' from \'/Users/devongovett/projects/PDFKit/node_modules/restructure/src\'');
							} ();
						} catch (_error) {
						}
						EncodeStream = function (_super) {
							var key;
							__extends(EncodeStream, _super);
							function EncodeStream() {
								EncodeStream.__super__.constructor.apply(this, arguments);
								this.pos = 0;
							}
							for (key in Buffer.prototype) {
								if (key.slice(0, 5) === 'write') {
									(function (key) {
										var bytes;
										bytes = DecodeStream.TYPES[key.replace(/write|[BL]E/g, '')];
										return EncodeStream.prototype[key] = function (value) {
											var buffer;
											buffer = new Buffer(+bytes);
											buffer[key](value, 0);
											return this.writeBuffer(buffer);
										};
									} (key));
								}
							}
							EncodeStream.prototype._read = function () {
							};
							EncodeStream.prototype.writeBuffer = function (buffer) {
								this.push(buffer);
								return this.pos += buffer.length;
							};
							EncodeStream.prototype.writeString = function (string, encoding) {
								var buf, byte, i, _i, _ref;
								if (encoding == null) {
									encoding = 'ascii';
								}
								switch (encoding) {
									case 'utf16le':
									case 'ucs2':
									case 'utf8':
									case 'ascii':
										return this.writeBuffer(new Buffer(string, encoding));
									case 'utf16be':
										buf = new Buffer(string, 'utf16le');
										for (i = _i = 0, _ref = buf.length - 1; _i < _ref; i = _i += 2) {
											byte = buf[i];
											buf[i] = buf[i + 1];
											buf[i + 1] = byte;
										}
										return this.writeBuffer(buf);
									default:
										if (iconv) {
											return this.writeBuffer(iconv.encode(string, encoding));
										} else {
											throw new Error('Install iconv-lite to enable additional string encodings.');
										}
								}
							};
							EncodeStream.prototype.writeUInt24BE = function (val) {
								var buf;
								buf = new Buffer(3);
								buf[0] = val >>> 16 & 255;
								buf[1] = val >>> 8 & 255;
								buf[2] = val & 255;
								return this.writeBuffer(buf);
							};
							EncodeStream.prototype.writeUInt24LE = function (val) {
								var buf;
								buf = new Buffer(3);
								buf[0] = val & 255;
								buf[1] = val >>> 8 & 255;
								buf[2] = val >>> 16 & 255;
								return this.writeBuffer(buf);
							};
							EncodeStream.prototype.writeInt24BE = function (val) {
								if (val >= 0) {
									return this.writeUInt24BE(val);
								} else {
									return this.writeUInt24BE(val + 16777215 + 1);
								}
							};
							EncodeStream.prototype.writeInt24LE = function (val) {
								if (val >= 0) {
									return this.writeUInt24LE(val);
								} else {
									return this.writeUInt24LE(val + 16777215 + 1);
								}
							};
							EncodeStream.prototype.fill = function (val, length) {
								var buf;
								buf = new Buffer(length);
								buf.fill(val);
								return this.writeBuffer(buf);
							};
							EncodeStream.prototype.end = function () {
								return this.push(null);
							};
							return EncodeStream;
						} (stream.Readable);
						localModule.localExports = EncodeStream;
					}.call(this));
				}).call(this, localRequire("buffer").Buffer)

			}, { "./DecodeStream": 204, "buffer": 60, "stream": 216 }], 206: [function (localRequire, localModule, localExports) {
				(function () {
					var Enum;
					Enum = function () {
						function Enum(type, options) {
							this.type = type;
							this.options = options != null ? options : [];
						}
						Enum.prototype.decode = function (stream) {
							var index;
							index = this.type.decode(stream);
							return this.options[index] || index;
						};
						Enum.prototype.size = function () {
							return this.type.size();
						};
						Enum.prototype.encode = function (stream, val) {
							var index;
							index = this.options.indexOf(val);
							if (index === -1) {
								throw new Error('Unknown option in enum: ' + val);
							}
							return this.type.encode(stream, index);
						};
						return Enum;
					} ();
					localModule.localExports = Enum;
				}.call(this));
			}, {}], 207: [function (localRequire, localModule, localExports) {
				(function () {
					var ArrayT, LazyArray, LazyArrayT, NumberT, inspect, utils, __hasProp = {}.hasOwnProperty, __extends = function (child, parent) {
						for (var key in parent) {
							if (__hasProp.call(parent, key))
								child[key] = parent[key];
						}
						function ctor() {
							this.constructor = child;
						}
						ctor.prototype = parent.prototype;
						child.prototype = new ctor();
						child.__super__ = parent.prototype;
						return child;
					};
					ArrayT = localRequire('./Array');
					NumberT = localRequire('./Number').Number;
					utils = localRequire('./utils');
					inspect = localRequire('util').inspect;
					LazyArrayT = function (_super) {
						__extends(LazyArrayT, _super);
						function LazyArrayT() {
							return LazyArrayT.__super__.constructor.apply(this, arguments);
						}
						LazyArrayT.prototype.decode = function (stream, parent) {
							var length, pos, res;
							pos = stream.pos;
							length = utils.resolveLength(this.length, stream, parent);
							if (this.length instanceof NumberT) {
								parent = {
									parent: parent,
									_startOffset: pos,
									_currentOffset: 0,
									_length: length
								};
							}
							res = new LazyArray(this.type, length, stream, parent);
							stream.pos += length * this.type.size(null, parent);
							return res;
						};
						LazyArrayT.prototype.size = function (val, ctx) {
							if (val instanceof LazyArray) {
								val = val.toArray();
							}
							return LazyArrayT.__super__.size.call(this, val, ctx);
						};
						LazyArrayT.prototype.encode = function (stream, val, ctx) {
							if (val instanceof LazyArray) {
								val = val.toArray();
							}
							return LazyArrayT.__super__.encode.call(this, stream, val, ctx);
						};
						return LazyArrayT;
					} (ArrayT);
					LazyArray = function () {
						function LazyArray(type, length, stream, ctx) {
							this.type = type;
							this.length = length;
							this.stream = stream;
							this.ctx = ctx;
							this.base = this.stream.pos;
							this.items = [];
						}
						LazyArray.prototype.get = function (index) {
							var pos;
							if (index < 0 || index >= this.length) {
								return void 0;
							}
							if (this.items[index] == null) {
								pos = this.stream.pos;
								this.stream.pos = this.base + this.type.size(null, this.ctx) * index;
								this.items[index] = this.type.decode(this.stream, this.ctx);
								this.stream.pos = pos;
							}
							return this.items[index];
						};
						LazyArray.prototype.toArray = function () {
							var i, _i, _ref, _results;
							_results = [];
							for (i = _i = 0, _ref = this.length; _i < _ref; i = _i += 1) {
								_results.push(this.get(i));
							}
							return _results;
						};
						LazyArray.prototype.inspect = function () {
							return inspect(this.toArray());
						};
						return LazyArray;
					} ();
					localModule.localExports = LazyArrayT;
				}.call(this));
			}, { "./Array": 200, "./Number": 208, "./utils": 215, "util": 224 }], 208: [function (localRequire, localModule, localExports) {
				(function () {
					var DecodeStream, Fixed, NumberT, __hasProp = {}.hasOwnProperty, __extends = function (child, parent) {
						for (var key in parent) {
							if (__hasProp.call(parent, key))
								child[key] = parent[key];
						}
						function ctor() {
							this.constructor = child;
						}
						ctor.prototype = parent.prototype;
						child.prototype = new ctor();
						child.__super__ = parent.prototype;
						return child;
					};
					DecodeStream = localRequire('./DecodeStream');
					NumberT = function () {
						function NumberT(type, endian) {
							this.type = type;
							this.endian = endian != null ? endian : 'BE';
							this.fn = this.type;
							if (this.type[this.type.length - 1] !== '8') {
								this.fn += this.endian;
							}
						}
						NumberT.prototype.size = function () {
							return DecodeStream.TYPES[this.type];
						};
						NumberT.prototype.decode = function (stream) {
							return stream['read' + this.fn]();
						};
						NumberT.prototype.encode = function (stream, val) {
							return stream['write' + this.fn](val);
						};
						return NumberT;
					} ();
					localExports.Number = NumberT;
					localExports.uint8 = new NumberT('UInt8');
					localExports.uint16be = localExports.uint16 = new NumberT('UInt16', 'BE');
					localExports.uint16le = new NumberT('UInt16', 'LE');
					localExports.uint24be = localExports.uint24 = new NumberT('UInt24', 'BE');
					localExports.uint24le = new NumberT('UInt24', 'LE');
					localExports.uint32be = localExports.uint32 = new NumberT('UInt32', 'BE');
					localExports.uint32le = new NumberT('UInt32', 'LE');
					localExports.int8 = new NumberT('Int8');
					localExports.int16be = localExports.int16 = new NumberT('Int16', 'BE');
					localExports.int16le = new NumberT('Int16', 'LE');
					localExports.int24be = localExports.int24 = new NumberT('Int24', 'BE');
					localExports.int24le = new NumberT('Int24', 'LE');
					localExports.int32be = localExports.int32 = new NumberT('Int32', 'BE');
					localExports.int32le = new NumberT('Int32', 'LE');
					localExports.floatbe = localExports.float = new NumberT('Float', 'BE');
					localExports.floatle = new NumberT('Float', 'LE');
					localExports.doublebe = localExports.double = new NumberT('Double', 'BE');
					localExports.doublele = new NumberT('Double', 'LE');
					Fixed = function (_super) {
						__extends(Fixed, _super);
						function Fixed(size, endian, fracBits) {
							if (fracBits == null) {
								fracBits = size >> 1;
							}
							Fixed.__super__.constructor.call(this, 'Int' + size, endian);
							this._point = 1 << fracBits;
						}
						Fixed.prototype.decode = function (stream) {
							return Fixed.__super__.decode.call(this, stream) / this._point;
						};
						Fixed.prototype.encode = function (stream, val) {
							return Fixed.__super__.encode.call(this, stream, val * this._point | 0);
						};
						return Fixed;
					} (NumberT);
					localExports.Fixed = Fixed;
					localExports.fixed16be = localExports.fixed16 = new Fixed(16, 'BE');
					localExports.fixed16le = new Fixed(16, 'LE');
					localExports.fixed32be = localExports.fixed32 = new Fixed(32, 'BE');
					localExports.fixed32le = new Fixed(32, 'LE');
				}.call(this));
			}, { "./DecodeStream": 204 }], 209: [function (localRequire, localModule, localExports) {
				(function () {
					var Optional;
					Optional = function () {
						function Optional(type, condition) {
							this.type = type;
							this.condition = condition != null ? condition : true;
						}
						Optional.prototype.decode = function (stream, parent) {
							var condition;
							condition = this.condition;
							if (typeof condition === 'function') {
								condition = condition.call(parent, parent);
							}
							if (condition) {
								return this.type.decode(stream, parent);
							}
						};
						Optional.prototype.size = function (val, parent) {
							var condition;
							condition = this.condition;
							if (typeof condition === 'function') {
								condition = condition.call(parent, parent);
							}
							if (condition) {
								return this.type.size(val, parent);
							} else {
								return 0;
							}
						};
						Optional.prototype.encode = function (stream, val, parent) {
							var condition;
							condition = this.condition;
							if (typeof condition === 'function') {
								condition = condition.call(parent, parent);
							}
							if (condition) {
								return this.type.encode(stream, val, parent);
							}
						};
						return Optional;
					} ();
					localModule.localExports = Optional;
				}.call(this));
			}, {}], 210: [function (localRequire, localModule, localExports) {
				(function () {
					var Pointer, VoidPointer, utils;
					utils = localRequire('./utils');
					Pointer = function () {
						function Pointer(offsetType, type, options) {
							var _base, _base1, _base2, _base3;
							this.offsetType = offsetType;
							this.type = type;
							this.options = options != null ? options : {};
							if (this.type === 'void') {
								this.type = null;
							}
							if ((_base = this.options).type == null) {
								_base.type = 'local';
							}
							if ((_base1 = this.options).allowNull == null) {
								_base1.allowNull = true;
							}
							if ((_base2 = this.options).nullValue == null) {
								_base2.nullValue = 0;
							}
							if ((_base3 = this.options).lazy == null) {
								_base3.lazy = false;
							}
							if (this.options.relativeTo) {
								this.relativeToGetter = new Function('ctx', 'return ctx.' + this.options.relativeTo);
							}
						}
						Pointer.prototype.decode = function (stream, ctx) {
							var c, decodeValue, offset, ptr, relative, val;
							offset = this.offsetType.decode(stream);
							if (offset === this.options.nullValue && this.options.allowNull) {
								return null;
							}
							relative = function () {
								switch (this.options.type) {
									case 'local':
										return ctx._startOffset;
									case 'immediate':
										return stream.pos - this.offsetType.size();
									case 'parent':
										return ctx.parent._startOffset;
									default:
										c = ctx;
										while (c.parent) {
											c = c.parent;
										}
										return c._startOffset || 0;
								}
							}.call(this);
							if (this.options.relativeTo) {
								relative += this.relativeToGetter(ctx);
							}
							ptr = offset + relative;
							if (this.type != null) {
								val = null;
								decodeValue = function (_this) {
									return function () {
										var pos;
										if (val != null) {
											return val;
										}
										pos = stream.pos;
										stream.pos = ptr;
										val = _this.type.decode(stream, ctx);
										stream.pos = pos;
										return val;
									};
								} (this);
								if (this.options.lazy) {
									return new utils.PropertyDescriptor({ get: decodeValue });
								}
								return decodeValue();
							} else {
								return ptr;
							}
						};
						Pointer.prototype.size = function (val, ctx) {
							var parent, type;
							parent = ctx;
							switch (this.options.type) {
								case 'local':
								case 'immediate':
									break;
								case 'parent':
									ctx = ctx.parent;
									break;
								default:
									while (ctx.parent) {
										ctx = ctx.parent;
									}
							}
							type = this.type;
							if (type == null) {
								if (!(val instanceof VoidPointer)) {
									throw new Error('Must be a VoidPointer');
								}
								type = val.type;
								val = val.value;
							}
							if (val && ctx) {
								ctx.pointerSize += type.size(val, parent);
							}
							return this.offsetType.size();
						};
						Pointer.prototype.encode = function (stream, val, ctx) {
							var parent, relative, type;
							parent = ctx;
							if (val == null) {
								this.offsetType.encode(stream, this.options.nullValue);
								return;
							}
							switch (this.options.type) {
								case 'local':
									relative = ctx.startOffset;
									break;
								case 'immediate':
									relative = stream.pos + this.offsetType.size(val, parent);
									break;
								case 'parent':
									ctx = ctx.parent;
									relative = ctx.startOffset;
									break;
								default:
									relative = 0;
									while (ctx.parent) {
										ctx = ctx.parent;
									}
							}
							if (this.options.relativeTo) {
								relative += this.relativeToGetter(parent.val);
							}
							this.offsetType.encode(stream, ctx.pointerOffset - relative);
							type = this.type;
							if (type == null) {
								if (!(val instanceof VoidPointer)) {
									throw new Error('Must be a VoidPointer');
								}
								type = val.type;
								val = val.value;
							}
							ctx.pointers.push({
								type: type,
								val: val,
								parent: parent
							});
							return ctx.pointerOffset += type.size(val, parent);
						};
						return Pointer;
					} ();
					VoidPointer = function () {
						function VoidPointer(type, value) {
							this.type = type;
							this.value = value;
						}
						return VoidPointer;
					} ();
					localExports.Pointer = Pointer;
					localExports.VoidPointer = VoidPointer;
				}.call(this));
			}, { "./utils": 215 }], 211: [function (localRequire, localModule, localExports) {
				(function () {
					var Reserved, utils;
					utils = localRequire('./utils');
					Reserved = function () {
						function Reserved(type, count) {
							this.type = type;
							this.count = count != null ? count : 1;
						}
						Reserved.prototype.decode = function (stream, parent) {
							stream.pos += this.size(null, parent);
							return void 0;
						};
						Reserved.prototype.size = function (data, parent) {
							var count;
							count = utils.resolveLength(this.count, null, parent);
							return this.type.size() * count;
						};
						Reserved.prototype.encode = function (stream, val, parent) {
							return stream.fill(0, this.size(val, parent));
						};
						return Reserved;
					} ();
					localModule.localExports = Reserved;
				}.call(this));
			}, { "./utils": 215 }], 212: [function (localRequire, localModule, localExports) {
				(function (Buffer) {
					(function () {
						var NumberT, StringT, utils;
						NumberT = localRequire('./Number').Number;
						utils = localRequire('./utils');
						StringT = function () {
							function StringT(length, encoding) {
								this.length = length;
								this.encoding = encoding != null ? encoding : 'ascii';
							}
							StringT.prototype.decode = function (stream, parent) {
								var buffer, encoding, length, pos, string;
								length = function () {
									if (this.length != null) {
										return utils.resolveLength(this.length, stream, parent);
									} else {
										buffer = stream.buffer, length = stream.length, pos = stream.pos;
										while (pos < length && buffer[pos] !== 0) {
											++pos;
										}
										return pos - stream.pos;
									}
								}.call(this);
								encoding = this.encoding;
								if (typeof encoding === 'function') {
									encoding = encoding.call(parent, parent) || 'ascii';
								}
								string = stream.readString(length, encoding);
								if (this.length == null && stream.pos < stream.length) {
									stream.pos++;
								}
								return string;
							};
							StringT.prototype.size = function (val, parent) {
								var encoding, size;
								if (!val) {
									return utils.resolveLength(this.length, null, parent);
								}
								encoding = this.encoding;
								if (typeof encoding === 'function') {
									encoding = encoding.call(parent != null ? parent.val : void 0, parent != null ? parent.val : void 0) || 'ascii';
								}
								if (encoding === 'utf16be') {
									encoding = 'utf16le';
								}
								size = Buffer.byteLength(val, encoding);
								if (this.length instanceof NumberT) {
									size += this.length.size();
								}
								if (this.length == null) {
									size++;
								}
								return size;
							};
							StringT.prototype.encode = function (stream, val, parent) {
								var encoding;
								encoding = this.encoding;
								if (typeof encoding === 'function') {
									encoding = encoding.call(parent != null ? parent.val : void 0, parent != null ? parent.val : void 0) || 'ascii';
								}
								if (this.length instanceof NumberT) {
									this.length.encode(stream, Buffer.byteLength(val, encoding));
								}
								stream.writeString(val, encoding);
								if (this.length == null) {
									return stream.writeUInt8(0);
								}
							};
							return StringT;
						} ();
						localModule.localExports = StringT;
					}.call(this));
				}).call(this, localRequire("buffer").Buffer)

			}, { "./Number": 208, "./utils": 215, "buffer": 60 }], 213: [function (localRequire, localModule, localExports) {
				(function () {
					var Struct, utils;
					utils = localRequire('./utils');
					Struct = function () {
						function Struct(fields) {
							this.fields = fields != null ? fields : {};
						}
						Struct.prototype.decode = function (stream, parent, length) {
							var res, _ref;
							if (length == null) {
								length = 0;
							}
							res = this._setup(stream, parent, length);
							this._parseFields(stream, res, this.fields);
							if ((_ref = this.process) != null) {
								_ref.call(res, stream);
							}
							return res;
						};
						Struct.prototype._setup = function (stream, parent, length) {
							var res;
							res = {};
							Object.defineProperties(res, {
								parent: { value: parent },
								_startOffset: { value: stream.pos },
								_currentOffset: {
									value: 0,
									writable: true
								},
								_length: { value: length }
							});
							return res;
						};
						Struct.prototype._parseFields = function (stream, res, fields) {
							var key, type, val;
							for (key in fields) {
								type = fields[key];
								if (typeof type === 'function') {
									val = type.call(res, res);
								} else {
									val = type.decode(stream, res);
								}
								if (val !== void 0) {
									if (val instanceof utils.PropertyDescriptor) {
										Object.defineProperty(res, key, val);
									} else {
										res[key] = val;
									}
								}
								res._currentOffset = stream.pos - res._startOffset;
							}
						};
						Struct.prototype.size = function (val, parent, includePointers) {
							var ctx, key, size, type, _ref;
							if (val == null) {
								val = {};
							}
							if (includePointers == null) {
								includePointers = true;
							}
							ctx = {
								parent: parent,
								val: val,
								pointerSize: 0
							};
							size = 0;
							_ref = this.fields;
							for (key in _ref) {
								type = _ref[key];
								if (type.size != null) {
									size += type.size(val[key], ctx);
								}
							}
							if (includePointers) {
								size += ctx.pointerSize;
							}
							return size;
						};
						Struct.prototype.encode = function (stream, val, parent) {
							var ctx, i, key, ptr, type, _ref, _ref1;
							if ((_ref = this.preEncode) != null) {
								_ref.call(val, stream);
							}
							ctx = {
								pointers: [],
								startOffset: stream.pos,
								parent: parent,
								val: val,
								pointerSize: 0
							};
							ctx.pointerOffset = stream.pos + this.size(val, ctx, false);
							_ref1 = this.fields;
							for (key in _ref1) {
								type = _ref1[key];
								if (type.encode != null) {
									type.encode(stream, val[key], ctx);
								}
							}
							i = 0;
							while (i < ctx.pointers.length) {
								ptr = ctx.pointers[i++];
								ptr.type.encode(stream, ptr.val, ptr.parent);
							}
						};
						return Struct;
					} ();
					localModule.localExports = Struct;
				}.call(this));
			}, { "./utils": 215 }], 214: [function (localRequire, localModule, localExports) {
				(function () {
					var Struct, VersionedStruct, __hasProp = {}.hasOwnProperty, __extends = function (child, parent) {
						for (var key in parent) {
							if (__hasProp.call(parent, key))
								child[key] = parent[key];
						}
						function ctor() {
							this.constructor = child;
						}
						ctor.prototype = parent.prototype;
						child.prototype = new ctor();
						child.__super__ = parent.prototype;
						return child;
					};
					Struct = localRequire('./Struct');
					VersionedStruct = function (_super) {
						__extends(VersionedStruct, _super);
						function VersionedStruct(type, versions) {
							this.type = type;
							this.versions = versions != null ? versions : {};
							if (typeof this.type === 'string') {
								this.versionGetter = new Function('parent', 'return parent.' + this.type);
								this.versionSetter = new Function('parent', 'version', 'return parent.' + this.type + ' = version');
							}
						}
						VersionedStruct.prototype.decode = function (stream, parent, length) {
							var fields, res, _ref;
							if (length == null) {
								length = 0;
							}
							res = this._setup(stream, parent, length);
							if (typeof this.type === 'string') {
								res.version = this.versionGetter(parent);
							} else {
								res.version = this.type.decode(stream);
							}
							if (this.versions.header) {
								this._parseFields(stream, res, this.versions.header);
							}
							fields = this.versions[res.version];
							if (fields == null) {
								throw new Error('Unknown version ' + res.version);
							}
							if (fields instanceof VersionedStruct) {
								return fields.decode(stream, parent);
							}
							this._parseFields(stream, res, fields);
							if ((_ref = this.process) != null) {
								_ref.call(res, stream);
							}
							return res;
						};
						VersionedStruct.prototype.size = function (val, parent, includePointers) {
							var ctx, fields, key, size, type, _ref;
							if (includePointers == null) {
								includePointers = true;
							}
							if (!val) {
								throw new Error('Not a fixed size');
							}
							ctx = {
								parent: parent,
								val: val,
								pointerSize: 0
							};
							size = 0;
							if (typeof this.type !== 'string') {
								size += this.type.size(val.version, ctx);
							}
							if (this.versions.header) {
								_ref = this.versions.header;
								for (key in _ref) {
									type = _ref[key];
									if (type.size != null) {
										size += type.size(val[key], ctx);
									}
								}
							}
							fields = this.versions[val.version];
							if (fields == null) {
								throw new Error('Unknown version ' + val.version);
							}
							for (key in fields) {
								type = fields[key];
								if (type.size != null) {
									size += type.size(val[key], ctx);
								}
							}
							if (includePointers) {
								size += ctx.pointerSize;
							}
							return size;
						};
						VersionedStruct.prototype.encode = function (stream, val, parent) {
							var ctx, fields, i, key, ptr, type, _ref, _ref1;
							if ((_ref = this.preEncode) != null) {
								_ref.call(val, stream);
							}
							ctx = {
								pointers: [],
								startOffset: stream.pos,
								parent: parent,
								val: val,
								pointerSize: 0
							};
							ctx.pointerOffset = stream.pos + this.size(val, ctx, false);
							if (typeof this.type !== 'string') {
								this.type.encode(stream, val.version);
							}
							if (this.versions.header) {
								_ref1 = this.versions.header;
								for (key in _ref1) {
									type = _ref1[key];
									if (type.encode != null) {
										type.encode(stream, val[key], ctx);
									}
								}
							}
							fields = this.versions[val.version];
							for (key in fields) {
								type = fields[key];
								if (type.encode != null) {
									type.encode(stream, val[key], ctx);
								}
							}
							i = 0;
							while (i < ctx.pointers.length) {
								ptr = ctx.pointers[i++];
								ptr.type.encode(stream, ptr.val, ptr.parent);
							}
						};
						return VersionedStruct;
					} (Struct);
					localModule.localExports = VersionedStruct;
				}.call(this));
			}, { "./Struct": 213 }], 215: [function (localRequire, localModule, localExports) {
				(function () {
					var NumberT, PropertyDescriptor;
					NumberT = localRequire('./Number').Number;
					localExports.resolveLength = function (length, stream, parent) {
						var res;
						if (typeof length === 'number') {
							res = length;
						} else if (typeof length === 'function') {
							res = length.call(parent, parent);
						} else if (parent && typeof length === 'string') {
							res = parent[length];
						} else if (stream && length instanceof NumberT) {
							res = length.decode(stream);
						}
						if (isNaN(res)) {
							throw new Error('Not a fixed size');
						}
						return res;
					};
					PropertyDescriptor = function () {
						function PropertyDescriptor(opts) {
							var key, val;
							if (opts == null) {
								opts = {};
							}
							this.enumerable = true;
							this.configurable = true;
							for (key in opts) {
								val = opts[key];
								this[key] = val;
							}
						}
						return PropertyDescriptor;
					} ();
					localExports.PropertyDescriptor = PropertyDescriptor;
				}.call(this));
			}, { "./Number": 208 }], 216: [function (localRequire, localModule, localExports) {
				// Copyright Joyent, Inc. and other Node contributors.
				//
				// Permission is hereby granted, free of charge, to any person obtaining a
				// copy of this software and associated documentation files (the
				// "Software"), to deal in the Software without restriction, including
				// without limitation the rights to use, copy, modify, merge, publish,
				// distribute, sublicense, and/or sell copies of the Software, and to permit
				// persons to whom the Software is furnished to do so, subject to the
				// following conditions:
				//
				// The above copyright notice and this permission notice shall be included
				// in all copies or substantial portions of the Software.
				//
				// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
				// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
				// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
				// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
				// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
				// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
				// USE OR OTHER DEALINGS IN THE SOFTWARE.

				localModule.localExports = Stream;

				var EE = localRequire('events').EventEmitter;
				var inherits = localRequire('inherits');

				inherits(Stream, EE);
				(<any>Stream).Readable = localRequire('readable-stream/readable.js');
				(<any>Stream).Writable = localRequire('readable-stream/writable.js');
				(<any>Stream).Duplex = localRequire('readable-stream/duplex.js');
				(<any>Stream).Transform = localRequire('readable-stream/transform.js');
				(<any>Stream).PassThrough = localRequire('readable-stream/passthrough.js');

				// Backwards-compat with node 0.4.x
				(<any>Stream).Stream = Stream;



				// old-style streams.  Note that the pipe method (the only relevant
				// part of this class) is overridden in the Readable class.

				function Stream() {
					EE.call(this);
				}

				Stream.prototype.pipe = function (dest, options) {
					var source = this;

					function ondata(chunk) {
						if (dest.writable) {
							if (false === dest.write(chunk) && source.pause) {
								source.pause();
							}
						}
					}

					source.on('data', ondata);

					function ondrain() {
						if (source.readable && source.resume) {
							source.resume();
						}
					}

					dest.on('drain', ondrain);

					// If the 'end' option is not supplied, dest.end() will be called when
					// source gets the 'end' or 'close' events.  Only dest.end() once.
					if (!dest._isStdio && (!options || options.end !== false)) {
						source.on('end', onend);
						source.on('close', onclose);
					}

					var didOnEnd = false;
					function onend() {
						if (didOnEnd) return;
						didOnEnd = true;

						dest.end();
					}


					function onclose() {
						if (didOnEnd) return;
						didOnEnd = true;

						if (typeof dest.destroy === 'function') dest.destroy();
					}

					// don't leave dangling pipes when there are errors.
					function onerror(er) {
						cleanup();
						if (EE.listenerCount(this, 'error') === 0) {
							throw er; // Unhandled stream error in pipe.
						}
					}

					source.on('error', onerror);
					dest.on('error', onerror);

					// remove all the event listeners that were added.
					function cleanup() {
						source.removeListener('data', ondata);
						dest.removeListener('drain', ondrain);

						source.removeListener('end', onend);
						source.removeListener('close', onclose);

						source.removeListener('error', onerror);
						dest.removeListener('error', onerror);

						source.removeListener('end', cleanup);
						source.removeListener('close', cleanup);

						dest.removeListener('close', cleanup);
					}

					source.on('end', cleanup);
					source.on('close', cleanup);

					dest.on('close', cleanup);

					dest.emit('pipe', source);

					// Allow for unix-like usage: A.pipe(B).pipe(C)
					return dest;
				};

			}, { "events": 164, "inherits": 167, "readable-stream/duplex.js": 189, "readable-stream/passthrough.js": 195, "readable-stream/readable.js": 196, "readable-stream/transform.js": 197, "readable-stream/writable.js": 198 }], 217: [function (localRequire, localModule, localExports) {
				// Copyright Joyent, Inc. and other Node contributors.
				//
				// Permission is hereby granted, free of charge, to any person obtaining a
				// copy of this software and associated documentation files (the
				// "Software"), to deal in the Software without restriction, including
				// without limitation the rights to use, copy, modify, merge, publish,
				// distribute, sublicense, and/or sell copies of the Software, and to permit
				// persons to whom the Software is furnished to do so, subject to the
				// following conditions:
				//
				// The above copyright notice and this permission notice shall be included
				// in all copies or substantial portions of the Software.
				//
				// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
				// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
				// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
				// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
				// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
				// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
				// USE OR OTHER DEALINGS IN THE SOFTWARE.

				var Buffer = localRequire('buffer').Buffer;

				var isBufferEncoding = Buffer.isEncoding
					|| function (encoding) {
						switch (encoding && encoding.toLowerCase()) {
							case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
							default: return false;
						}
					}


				function assertEncoding(encoding) {
					if (encoding && !isBufferEncoding(encoding)) {
						throw new Error('Unknown encoding: ' + encoding);
					}
				}

				// StringDecoder provides an interface for efficiently splitting a series of
				// buffers into a series of JS strings without breaking apart multi-byte
				// characters. CESU-8 is handled as part of the UTF-8 encoding.
				//
				// @TODO Handling all encodings inside a single object makes it very difficult
				// to reason about this code, so it should be split up in the future.
				// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
				// points as used by CESU-8.
				var StringDecoder = localExports.StringDecoder = function (encoding) {
					this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
					assertEncoding(encoding);
					switch (this.encoding) {
						case 'utf8':
							// CESU-8 represents each of Surrogate Pair by 3-bytes
							this.surrogateSize = 3;
							break;
						case 'ucs2':
						case 'utf16le':
							// UTF-16 represents each of Surrogate Pair by 2-bytes
							this.surrogateSize = 2;
							this.detectIncompleteChar = utf16DetectIncompleteChar;
							break;
						case 'base64':
							// Base-64 stores 3 bytes in 4 chars, and pads the remainder.
							this.surrogateSize = 3;
							this.detectIncompleteChar = base64DetectIncompleteChar;
							break;
						default:
							this.write = passThroughWrite;
							return;
					}

					// Enough space to store all bytes of a single character. UTF-8 needs 4
					// bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
					this.charBuffer = new Buffer(6);
					// Number of bytes received for the current incomplete multi-byte character.
					this.charReceived = 0;
					// Number of bytes expected for the current incomplete multi-byte character.
					this.charLength = 0;
				};


				// write decodes the given buffer and returns it as JS string that is
				// guaranteed to not contain any partial multi-byte characters. Any partial
				// character found at the end of the buffer is buffered up, and will be
				// returned when calling write again with the remaining bytes.
				//
				// Note: Converting a Buffer containing an orphan surrogate to a String
				// currently works, but converting a String to a Buffer (via `new Buffer`, or
				// Buffer#write) will replace incomplete surrogates with the unicode
				// replacement character. See https://codereview.chromium.org/121173009/ .
				StringDecoder.prototype.write = function (buffer) {
					var charStr = '';
					// if our last write ended with an incomplete multibyte character
					while (this.charLength) {
						// determine how many remaining bytes this buffer has to offer for this char
						var available = (buffer.length >= this.charLength - this.charReceived) ?
							this.charLength - this.charReceived :
							buffer.length;

						// add the new bytes to the char buffer
						buffer.copy(this.charBuffer, this.charReceived, 0, available);
						this.charReceived += available;

						if (this.charReceived < this.charLength) {
							// still not enough chars in this buffer? wait for more ...
							return '';
						}

						// remove bytes belonging to the current character from the buffer
						buffer = buffer.slice(available, buffer.length);

						// get the character that was split
						charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);

						// CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
						var charCode = charStr.charCodeAt(charStr.length - 1);
						if (charCode >= 0xD800 && charCode <= 0xDBFF) {
							this.charLength += this.surrogateSize;
							charStr = '';
							continue;
						}
						this.charReceived = this.charLength = 0;

						// if there are no more bytes in this buffer, just emit our char
						if (buffer.length === 0) {
							return charStr;
						}
						break;
					}

					// determine and set charLength / charReceived
					this.detectIncompleteChar(buffer);

					var end: number = buffer.length;
					if (this.charLength) {
						// buffer the incomplete character bytes we got
						buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
						end -= this.charReceived;
					}

					charStr += buffer.toString(this.encoding, 0, end);

					var end = charStr.length - 1;
					var charCode = charStr.charCodeAt(end);
					// CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
					if (charCode >= 0xD800 && charCode <= 0xDBFF) {
						var size = this.surrogateSize;
						this.charLength += size;
						this.charReceived += size;
						this.charBuffer.copy(this.charBuffer, size, 0, size);
						buffer.copy(this.charBuffer, 0, 0, size);
						return charStr.substring(0, end);
					}

					// or just emit the charStr
					return charStr;
				};

				// detectIncompleteChar determines if there is an incomplete UTF-8 character at
				// the end of the given buffer. If so, it sets this.charLength to the byte
				// length that character, and sets this.charReceived to the number of bytes
				// that are available for this character.
				StringDecoder.prototype.detectIncompleteChar = function (buffer) {
					// determine how many bytes we have to check at the end of this buffer
					var i = (buffer.length >= 3) ? 3 : buffer.length;

					// Figure out if one of the last i bytes of our buffer announces an
					// incomplete char.
					for (; i > 0; i--) {
						var c = buffer[buffer.length - i];

						// See http://en.wikipedia.org/wiki/UTF-8#Description

						// 110XXXXX
						if (i == 1 && c >> 5 == 0x06) {
							this.charLength = 2;
							break;
						}

						// 1110XXXX
						if (i <= 2 && c >> 4 == 0x0E) {
							this.charLength = 3;
							break;
						}

						// 11110XXX
						if (i <= 3 && c >> 3 == 0x1E) {
							this.charLength = 4;
							break;
						}
					}
					this.charReceived = i;
				};

				StringDecoder.prototype.end = function (buffer) {
					var res = '';
					if (buffer && buffer.length)
						res = this.write(buffer);

					if (this.charReceived) {
						var cr = this.charReceived;
						var buf = this.charBuffer;
						var enc = this.encoding;
						res += buf.slice(0, cr).toString(enc);
					}

					return res;
				};

				function passThroughWrite(buffer) {
					return buffer.toString(this.encoding);
				}

				function utf16DetectIncompleteChar(buffer) {
					this.charReceived = buffer.length % 2;
					this.charLength = this.charReceived ? 2 : 0;
				}

				function base64DetectIncompleteChar(buffer) {
					this.charReceived = buffer.length % 3;
					this.charLength = this.charReceived ? 3 : 0;
				}

			}, { "buffer": 60 }], 218: [function (localRequire, localModule, localExports) {
				var TINF_OK = 0;
				var TINF_DATA_ERROR = -3;

				function Tree() {
					this.table = new Uint16Array(16);   /* table of code length counts */
					this.trans = new Uint16Array(288);  /* code -> symbol translation table */
				}

				function Data(source, dest) {
					this.source = source;
					this.sourceIndex = 0;
					this.tag = 0;
					this.bitcount = 0;

					this.dest = dest;
					this.destLen = 0;

					this.ltree = new Tree();  /* dynamic length/symbol tree */
					this.dtree = new Tree();  /* dynamic distance tree */
				}

				/* --------------------------------------------------- *
				 * -- uninitialized global data (static structures) -- *
				 * --------------------------------------------------- */

				var sltree = new Tree();
				var sdtree = new Tree();

				/* extra bits and base tables for length codes */
				var length_bits = new Uint8Array(30);
				var length_base = new Uint16Array(30);

				/* extra bits and base tables for distance codes */
				var dist_bits = new Uint8Array(30);
				var dist_base = new Uint16Array(30);

				/* special ordering of code length codes */
				var clcidx = new Uint8Array([
					16, 17, 18, 0, 8, 7, 9, 6,
					10, 5, 11, 4, 12, 3, 13, 2,
					14, 1, 15
				]);

				/* used by tinf_decode_trees, avoids allocations every call */
				var code_tree = new Tree();
				var lengths = new Uint8Array(288 + 32);

				/* ----------------------- *
				 * -- utility functions -- *
				 * ----------------------- */

				/* build extra bits and base tables */
				function tinf_build_bits_base(bits, base, delta, first) {
					var i, sum;

					/* build bits table */
					for (i = 0; i < delta; ++i) bits[i] = 0;
					for (i = 0; i < 30 - delta; ++i) bits[i + delta] = i / delta | 0;

					/* build base table */
					for (sum = first, i = 0; i < 30; ++i) {
						base[i] = sum;
						sum += 1 << bits[i];
					}
				}

				/* build the fixed huffman trees */
				function tinf_build_fixed_trees(lt, dt) {
					var i;

					/* build fixed length tree */
					for (i = 0; i < 7; ++i) lt.table[i] = 0;

					lt.table[7] = 24;
					lt.table[8] = 152;
					lt.table[9] = 112;

					for (i = 0; i < 24; ++i) lt.trans[i] = 256 + i;
					for (i = 0; i < 144; ++i) lt.trans[24 + i] = i;
					for (i = 0; i < 8; ++i) lt.trans[24 + 144 + i] = 280 + i;
					for (i = 0; i < 112; ++i) lt.trans[24 + 144 + 8 + i] = 144 + i;

					/* build fixed distance tree */
					for (i = 0; i < 5; ++i) dt.table[i] = 0;

					dt.table[5] = 32;

					for (i = 0; i < 32; ++i) dt.trans[i] = i;
				}

				/* given an array of code lengths, build a tree */
				var offs = new Uint16Array(16);

				function tinf_build_tree(t, lengths, off, num) {
					var i, sum;

					/* clear code length count table */
					for (i = 0; i < 16; ++i) t.table[i] = 0;

					/* scan symbol lengths, and sum code length counts */
					for (i = 0; i < num; ++i) t.table[lengths[off + i]]++;

					t.table[0] = 0;

					/* compute offset table for distribution sort */
					for (sum = 0, i = 0; i < 16; ++i) {
						offs[i] = sum;
						sum += t.table[i];
					}

					/* create code->symbol translation table (symbols sorted by code) */
					for (i = 0; i < num; ++i) {
						if (lengths[off + i]) t.trans[offs[lengths[off + i]]++] = i;
					}
				}

				/* ---------------------- *
				 * -- decode functions -- *
				 * ---------------------- */

				/* get one bit from source stream */
				function tinf_getbit(d) {
					/* check if tag is empty */
					if (!d.bitcount--) {
						/* load next tag */
						d.tag = d.source[d.sourceIndex++];
						d.bitcount = 7;
					}

					/* shift bit out of tag */
					var bit = d.tag & 1;
					d.tag >>>= 1;

					return bit;
				}

				/* read a num bit value from a stream and add base */
				function tinf_read_bits(d, num, base) {
					if (!num)
						return base;

					while (d.bitcount < 24) {
						d.tag |= d.source[d.sourceIndex++] << d.bitcount;
						d.bitcount += 8;
					}

					var val = d.tag & (0xffff >>> (16 - num));
					d.tag >>>= num;
					d.bitcount -= num;
					return val + base;
				}

				/* given a data stream and a tree, decode a symbol */
				function tinf_decode_symbol(d, t) {
					while (d.bitcount < 24) {
						d.tag |= d.source[d.sourceIndex++] << d.bitcount;
						d.bitcount += 8;
					}

					var sum = 0, cur = 0, len = 0;
					var tag = d.tag;

					/* get more bits while code value is above sum */
					do {
						cur = 2 * cur + (tag & 1);
						tag >>>= 1;
						++len;

						sum += t.table[len];
						cur -= t.table[len];
					} while (cur >= 0);

					d.tag = tag;
					d.bitcount -= len;

					return t.trans[sum + cur];
				}

				/* given a data stream, decode dynamic trees from it */
				function tinf_decode_trees(d, lt, dt) {
					var hlit, hdist, hclen;
					var i, num, length;

					/* get 5 bits HLIT (257-286) */
					hlit = tinf_read_bits(d, 5, 257);

					/* get 5 bits HDIST (1-32) */
					hdist = tinf_read_bits(d, 5, 1);

					/* get 4 bits HCLEN (4-19) */
					hclen = tinf_read_bits(d, 4, 4);

					for (i = 0; i < 19; ++i) lengths[i] = 0;

					/* read code lengths for code length alphabet */
					for (i = 0; i < hclen; ++i) {
						/* get 3 bits code length (0-7) */
						var clen = tinf_read_bits(d, 3, 0);
						lengths[clcidx[i]] = clen;
					}

					/* build code length tree */
					tinf_build_tree(code_tree, lengths, 0, 19);

					/* decode code lengths for the dynamic trees */
					for (num = 0; num < hlit + hdist;) {
						var sym = tinf_decode_symbol(d, code_tree);

						switch (sym) {
							case 16:
								/* copy previous code length 3-6 times (read 2 bits) */
								var prev = lengths[num - 1];
								for (length = tinf_read_bits(d, 2, 3); length; --length) {
									lengths[num++] = prev;
								}
								break;
							case 17:
								/* repeat code length 0 for 3-10 times (read 3 bits) */
								for (length = tinf_read_bits(d, 3, 3); length; --length) {
									lengths[num++] = 0;
								}
								break;
							case 18:
								/* repeat code length 0 for 11-138 times (read 7 bits) */
								for (length = tinf_read_bits(d, 7, 11); length; --length) {
									lengths[num++] = 0;
								}
								break;
							default:
								/* values 0-15 represent the actual code lengths */
								lengths[num++] = sym;
								break;
						}
					}

					/* build dynamic trees */
					tinf_build_tree(lt, lengths, 0, hlit);
					tinf_build_tree(dt, lengths, hlit, hdist);
				}

				/* ----------------------------- *
				 * -- block inflate functions -- *
				 * ----------------------------- */

				/* given a stream and two trees, inflate a block of data */
				function tinf_inflate_block_data(d, lt, dt) {
					while (1) {
						var sym = tinf_decode_symbol(d, lt);

						/* check for end of block */
						if (sym === 256) {
							return TINF_OK;
						}

						if (sym < 256) {
							d.dest[d.destLen++] = sym;
						} else {
							var length, dist, offs;
							var i;

							sym -= 257;

							/* possibly get more bits from length code */
							length = tinf_read_bits(d, length_bits[sym], length_base[sym]);

							dist = tinf_decode_symbol(d, dt);

							/* possibly get more bits from distance code */
							offs = d.destLen - tinf_read_bits(d, dist_bits[dist], dist_base[dist]);

							/* copy match */
							for (i = offs; i < offs + length; ++i) {
								d.dest[d.destLen++] = d.dest[i];
							}
						}
					}
				}

				/* inflate an uncompressed block of data */
				function tinf_inflate_uncompressed_block(d) {
					var length, invlength;
					var i;

					/* unread from bitbuffer */
					while (d.bitcount > 8) {
						d.sourceIndex--;
						d.bitcount -= 8;
					}

					/* get length */
					length = d.source[d.sourceIndex + 1];
					length = 256 * length + d.source[d.sourceIndex];

					/* get one's complement of length */
					invlength = d.source[d.sourceIndex + 3];
					invlength = 256 * invlength + d.source[d.sourceIndex + 2];

					/* check length */
					if (length !== (~invlength & 0x0000ffff))
						return TINF_DATA_ERROR;

					d.sourceIndex += 4;

					/* copy block */
					for (i = length; i; --i)
						d.dest[d.destLen++] = d.source[d.sourceIndex++];

					/* make sure we start next block on a byte boundary */
					d.bitcount = 0;

					return TINF_OK;
				}

				/* inflate stream from source to dest */
				function tinf_uncompress(source, dest) {
					var d = new Data(source, dest);
					var bfinal, btype, res;

					do {
						/* read final block flag */
						bfinal = tinf_getbit(d);

						/* read block type (2 bits) */
						btype = tinf_read_bits(d, 2, 0);

						/* decompress block */
						switch (btype) {
							case 0:
								/* decompress uncompressed block */
								res = tinf_inflate_uncompressed_block(d);
								break;
							case 1:
								/* decompress block with fixed huffman trees */
								res = tinf_inflate_block_data(d, sltree, sdtree);
								break;
							case 2:
								/* decompress block with dynamic huffman trees */
								tinf_decode_trees(d, d.ltree, d.dtree);
								res = tinf_inflate_block_data(d, d.ltree, d.dtree);
								break;
							default:
								res = TINF_DATA_ERROR;
						}

						if (res !== TINF_OK)
							throw new Error('Data error');

					} while (!bfinal);

					if (d.destLen < d.dest.length) {
						if (typeof d.dest.slice === 'function')
							return d.dest.slice(0, d.destLen);
						else
							return d.dest.subarray(0, d.destLen);
					}

					return d.dest;
				}

				/* -------------------- *
				 * -- initialization -- *
				 * -------------------- */

				/* build fixed huffman trees */
				tinf_build_fixed_trees(sltree, sdtree);

				/* build extra bits and base tables */
				tinf_build_bits_base(length_bits, length_base, 4, 3);
				tinf_build_bits_base(dist_bits, dist_base, 2, 1);

				/* fix a special case */
				length_bits[28] = 0;
				length_base[28] = 258;

				localModule.localExports = tinf_uncompress;

			}, {}], 219: [function (localRequire, localModule, localExports) {
				localModule.localExports = { "categories": ["Cc", "Zs", "Po", "Sc", "Ps", "Pe", "Sm", "Pd", "Nd", "Lu", "Sk", "Pc", "Ll", "So", "Lo", "Pi", "Cf", "No", "Pf", "Lt", "Lm", "Mn", "Me", "Mc", "Nl", "Zl", "Zp", "Cs", "Co"], "combiningClasses": ["Not_Reordered", "Above", "Above_Right", "Below", "Attached_Above_Right", "Attached_Below", "Overlay", "Iota_Subscript", "Double_Below", "Double_Above", "Below_Right", "Above_Left", "CCC10", "CCC11", "CCC12", "CCC13", "CCC14", "CCC15", "CCC16", "CCC17", "CCC18", "CCC19", "CCC20", "CCC21", "CCC22", "CCC23", "CCC24", "CCC25", "CCC30", "CCC31", "CCC32", "CCC27", "CCC28", "CCC29", "CCC33", "CCC34", "CCC35", "CCC36", "Nukta", "Virama", "CCC84", "CCC91", "CCC103", "CCC107", "CCC118", "CCC122", "CCC129", "CCC130", "CCC132", "Attached_Above", "Below_Left", "Left", "Kana_Voicing", "CCC26", "Right"], "scripts": ["Common", "Latin", "Bopomofo", "Inherited", "Greek", "Coptic", "Cyrillic", "Armenian", "Hebrew", "Arabic", "Syriac", "Thaana", "Nko", "Samaritan", "Mandaic", "Devanagari", "Bengali", "Gurmukhi", "Gujarati", "Oriya", "Tamil", "Telugu", "Kannada", "Malayalam", "Sinhala", "Thai", "Lao", "Tibetan", "Myanmar", "Georgian", "Hangul", "Ethiopic", "Cherokee", "Canadian_Aboriginal", "Ogham", "Runic", "Tagalog", "Hanunoo", "Buhid", "Tagbanwa", "Khmer", "Mongolian", "Limbu", "Tai_Le", "New_Tai_Lue", "Buginese", "Tai_Tham", "Balinese", "Sundanese", "Batak", "Lepcha", "Ol_Chiki", "Braille", "Glagolitic", "Tifinagh", "Han", "Hiragana", "Katakana", "Yi", "Lisu", "Vai", "Bamum", "Syloti_Nagri", "Phags_Pa", "Saurashtra", "Kayah_Li", "Rejang", "Javanese", "Cham", "Tai_Viet", "Meetei_Mayek", "null", "Linear_B", "Lycian", "Carian", "Old_Italic", "Gothic", "Old_Permic", "Ugaritic", "Old_Persian", "Deseret", "Shavian", "Osmanya", "Elbasan", "Caucasian_Albanian", "Linear_A", "Cypriot", "Imperial_Aramaic", "Palmyrene", "Nabataean", "Hatran", "Phoenician", "Lydian", "Meroitic_Hieroglyphs", "Meroitic_Cursive", "Kharoshthi", "Old_South_Arabian", "Old_North_Arabian", "Manichaean", "Avestan", "Inscriptional_Parthian", "Inscriptional_Pahlavi", "Psalter_Pahlavi", "Old_Turkic", "Old_Hungarian", "Brahmi", "Kaithi", "Sora_Sompeng", "Chakma", "Mahajani", "Sharada", "Khojki", "Multani", "Khudawadi", "Grantha", "Tirhuta", "Siddham", "Modi", "Takri", "Ahom", "Warang_Citi", "Pau_Cin_Hau", "Cuneiform", "Egyptian_Hieroglyphs", "Anatolian_Hieroglyphs", "Mro", "Bassa_Vah", "Pahawh_Hmong", "Miao", "Duployan", "SignWriting", "Mende_Kikakui"], "eaw": ["N", "Na", "A", "W", "H", "F"] }
			}, {}], 220: [function (localRequire, localModule, localExports) {
				(function (Buffer) {
					// Generated by CoffeeScript 1.9.1
					var CATEGORY_BITS, CATEGORY_MASK, CATEGORY_SHIFT, COMBINING_BITS, COMBINING_MASK, COMBINING_SHIFT, EAW_BITS, EAW_MASK, EAW_SHIFT, NUMBER_BITS, NUMBER_MASK, SCRIPT_BITS, SCRIPT_MASK, SCRIPT_SHIFT, UnicodeTrie, bits, data, fs, log2, trie;

					UnicodeTrie = localRequire('unicode-trie');

					data = localRequire('./data.json');



					trie = new UnicodeTrie(Buffer(" ", "base64"));

					log2 = (<any>Math).log2 || function (n) {
						return Math.log(n) / Math.LN2;
					};

					bits = function (n) {
						return (log2(n) + 1) | 0;
					};

					CATEGORY_BITS = bits(data.categories.length - 1);

					COMBINING_BITS = bits(data.combiningClasses.length - 1);

					SCRIPT_BITS = bits(data.scripts.length - 1);

					EAW_BITS = bits(data.eaw.length - 1);

					NUMBER_BITS = 10;

					CATEGORY_SHIFT = COMBINING_BITS + SCRIPT_BITS + EAW_BITS + NUMBER_BITS;

					COMBINING_SHIFT = SCRIPT_BITS + EAW_BITS + NUMBER_BITS;

					SCRIPT_SHIFT = EAW_BITS + NUMBER_BITS;

					EAW_SHIFT = NUMBER_BITS;

					CATEGORY_MASK = (1 << CATEGORY_BITS) - 1;

					COMBINING_MASK = (1 << COMBINING_BITS) - 1;

					SCRIPT_MASK = (1 << SCRIPT_BITS) - 1;

					EAW_MASK = (1 << EAW_BITS) - 1;

					NUMBER_MASK = (1 << NUMBER_BITS) - 1;

					localExports.getCategory = function (codePoint) {
						var val;
						val = trie.get(codePoint);
						return data.categories[(val >> CATEGORY_SHIFT) & CATEGORY_MASK];
					};

					localExports.getCombiningClass = function (codePoint) {
						var val;
						val = trie.get(codePoint);
						return data.combiningClasses[(val >> COMBINING_SHIFT) & COMBINING_MASK];
					};

					localExports.getScript = function (codePoint) {
						var val;
						val = trie.get(codePoint);
						return data.scripts[(val >> SCRIPT_SHIFT) & SCRIPT_MASK];
					};

					localExports.getEastAsianWidth = function (codePoint) {
						var val;
						val = trie.get(codePoint);
						return data.eaw[(val >> EAW_SHIFT) & EAW_MASK];
					};

					localExports.getNumericValue = function (codePoint) {
						var denominator, exp, num, numerator, val;
						val = trie.get(codePoint);
						num = val & NUMBER_MASK;
						if (num === 0) {
							return null;
						} else if (num <= 50) {
							return num - 1;
						} else if (num < 0x1e0) {
							numerator = (num >> 4) - 12;
							denominator = (num & 0xf) + 1;
							return numerator / denominator;
						} else if (num < 0x300) {
							val = (num >> 5) - 14;
							exp = (num & 0x1f) + 2;
							while (exp > 0) {
								val *= 10;
								exp--;
							}
							return val;
						} else {
							val = (num >> 2) - 0xbf;
							exp = (num & 3) + 1;
							while (exp > 0) {
								val *= 60;
								exp--;
							}
							return val;
						}
					};

					localExports.isAlphabetic = function (codePoint) {
						var ref;
						return (ref = localExports.getCategory(codePoint)) === 'Lu' || ref === 'Ll' || ref === 'Lt' || ref === 'Lm' || ref === 'Lo' || ref === 'Nl';
					};

					localExports.isDigit = function (codePoint) {
						return localExports.getCategory(codePoint) === 'Nd';
					};

					localExports.isPunctuation = function (codePoint) {
						var ref;
						return (ref = localExports.getCategory(codePoint)) === 'Pc' || ref === 'Pd' || ref === 'Pe' || ref === 'Pf' || ref === 'Pi' || ref === 'Po' || ref === 'Ps';
					};

					localExports.isLowerCase = function (codePoint) {
						return localExports.getCategory(codePoint) === 'Ll';
					};

					localExports.isUpperCase = function (codePoint) {
						return localExports.getCategory(codePoint) === 'Lu';
					};

					localExports.isTitleCase = function (codePoint) {
						return localExports.getCategory(codePoint) === 'Lt';
					};

					localExports.isWhiteSpace = function (codePoint) {
						var ref;
						return (ref = localExports.getCategory(codePoint)) === 'Zs' || ref === 'Zl' || ref === 'Zp';
					};

					localExports.isBaseForm = function (codePoint) {
						var ref;
						return (ref = localExports.getCategory(codePoint)) === 'Nd' || ref === 'No' || ref === 'Nl' || ref === 'Lu' || ref === 'Ll' || ref === 'Lt' || ref === 'Lm' || ref === 'Lo' || ref === 'Me' || ref === 'Mc';
					};

					localExports.isMark = function (codePoint) {
						var ref;
						return (ref = localExports.getCategory(codePoint)) === 'Mn' || ref === 'Me' || ref === 'Mc';
					};

				}).call(this, localRequire("buffer").Buffer)

			}, { "./data.json": 219, "buffer": 60, "unicode-trie": 221 }], 221: [function (localRequire, localModule, localExports) {
				// Generated by CoffeeScript 1.7.1
				var UnicodeTrie, inflate;

				inflate = localRequire('tiny-inflate');

				UnicodeTrie = (function () {
					var DATA_BLOCK_LENGTH, DATA_GRANULARITY, DATA_MASK, INDEX_1_OFFSET, INDEX_2_BLOCK_LENGTH, INDEX_2_BMP_LENGTH, INDEX_2_MASK, INDEX_SHIFT, LSCP_INDEX_2_LENGTH, LSCP_INDEX_2_OFFSET, OMITTED_BMP_INDEX_1_LENGTH, SHIFT_1, SHIFT_1_2, SHIFT_2, UTF8_2B_INDEX_2_LENGTH, UTF8_2B_INDEX_2_OFFSET;

					SHIFT_1 = 6 + 5;

					SHIFT_2 = 5;

					SHIFT_1_2 = SHIFT_1 - SHIFT_2;

					OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> SHIFT_1;

					INDEX_2_BLOCK_LENGTH = 1 << SHIFT_1_2;

					INDEX_2_MASK = INDEX_2_BLOCK_LENGTH - 1;

					INDEX_SHIFT = 2;

					DATA_BLOCK_LENGTH = 1 << SHIFT_2;

					DATA_MASK = DATA_BLOCK_LENGTH - 1;

					LSCP_INDEX_2_OFFSET = 0x10000 >> SHIFT_2;

					LSCP_INDEX_2_LENGTH = 0x400 >> SHIFT_2;

					INDEX_2_BMP_LENGTH = LSCP_INDEX_2_OFFSET + LSCP_INDEX_2_LENGTH;

					UTF8_2B_INDEX_2_OFFSET = INDEX_2_BMP_LENGTH;

					UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6;

					INDEX_1_OFFSET = UTF8_2B_INDEX_2_OFFSET + UTF8_2B_INDEX_2_LENGTH;

					DATA_GRANULARITY = 1 << INDEX_SHIFT;

					function UnicodeTrie(data) {
						var isBuffer, uncompressedLength, view;
						isBuffer = typeof data.readUInt32BE === 'function' && typeof data.slice === 'function';
						if (isBuffer || data instanceof Uint8Array) {
							if (isBuffer) {
								this.highStart = data.readUInt32BE(0);
								this.errorValue = data.readUInt32BE(4);
								uncompressedLength = data.readUInt32BE(8);
								data = data.slice(12);
							} else {
								view = new DataView(data.buffer);
								this.highStart = view.getUint32(0);
								this.errorValue = view.getUint32(4);
								uncompressedLength = view.getUint32(8);
								data = data.subarray(12);
							}
							data = inflate(data, new Uint8Array(uncompressedLength));
							data = inflate(data, new Uint8Array(uncompressedLength));
							this.data = new Uint32Array(data.buffer);
						} else {
							this.data = data.data, this.highStart = data.highStart, this.errorValue = data.errorValue;
						}
					}

					UnicodeTrie.prototype.get = function (codePoint) {
						var index;
						if (codePoint < 0 || codePoint > 0x10ffff) {
							return this.errorValue;
						}
						if (codePoint < 0xd800 || (codePoint > 0xdbff && codePoint <= 0xffff)) {
							index = (this.data[codePoint >> SHIFT_2] << INDEX_SHIFT) + (codePoint & DATA_MASK);
							return this.data[index];
						}
						if (codePoint <= 0xffff) {
							index = (this.data[LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> SHIFT_2)] << INDEX_SHIFT) + (codePoint & DATA_MASK);
							return this.data[index];
						}
						if (codePoint < this.highStart) {
							index = this.data[(INDEX_1_OFFSET - OMITTED_BMP_INDEX_1_LENGTH) + (codePoint >> SHIFT_1)];
							index = this.data[index + ((codePoint >> SHIFT_2) & INDEX_2_MASK)];
							index = (index << INDEX_SHIFT) + (codePoint & DATA_MASK);
							return this.data[index];
						}
						return this.data[this.data.length - DATA_GRANULARITY];
					};

					return UnicodeTrie;

				})();

				localModule.localExports = UnicodeTrie;

			}, { "tiny-inflate": 218 }], 222: [function (localRequire, localModule, localExports) {
				(function (global) {

					/**
					 * Module exports.
					 */

					localModule.localExports = deprecate;

					/**
					 * Mark that a method should not be used.
					 * Returns a modified function which warns once by default.
					 *
					 * If `localStorage.noDeprecation = true` is set, then it is a no-op.
					 *
					 * If `localStorage.throwDeprecation = true` is set, then deprecated functions
					 * will throw an Error when invoked.
					 *
					 * If `localStorage.traceDeprecation = true` is set, then deprecated functions
					 * will invoke `console.trace()` instead of `console.error()`.
					 *
					 * @param {Function} fn - the function to deprecate
					 * @param {String} msg - the string to print to the console when `fn` is invoked
					 * @returns {Function} a new "deprecated" version of `fn`
					 * @api public
					 */

					function deprecate(fn, msg) {
						if (config('noDeprecation')) {
							return fn;
						}

						var warned = false;
						function deprecated() {
							if (!warned) {
								if (config('throwDeprecation')) {
									throw new Error(msg);
								} else if (config('traceDeprecation')) {
									console.trace(msg);
								} else {
									console.warn(msg);
								}
								warned = true;
							}
							return fn.apply(this, arguments);
						}

						return deprecated;
					}

					/**
					 * Checks `localStorage` for boolean values for the given `name`.
					 *
					 * @param {String} name
					 * @returns {Boolean}
					 * @api private
					 */

					function config(name) {
						// accessing global.localStorage can trigger a DOMException in sandboxed iframes
						try {
							if (!global.localStorage) return false;
						} catch (_) {
							return false;
						}
						var val = global.localStorage[name];
						if (null == val) return false;
						return String(val).toLowerCase() === 'true';
					}

				}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})

			}, {}], 223: [function (localRequire, localModule, localExports) {
				localModule.localExports = function isBuffer(arg) {
					return arg && typeof arg === 'object'
						&& typeof arg.copy === 'function'
						&& typeof arg.fill === 'function'
						&& typeof arg.readUInt8 === 'function';
				}
			}, {}], 224: [function (localRequire, localModule, localExports) {
				(function (process, global) {
					// Copyright Joyent, Inc. and other Node contributors.
					//
					// Permission is hereby granted, free of charge, to any person obtaining a
					// copy of this software and associated documentation files (the
					// "Software"), to deal in the Software without restriction, including
					// without limitation the rights to use, copy, modify, merge, publish,
					// distribute, sublicense, and/or sell copies of the Software, and to permit
					// persons to whom the Software is furnished to do so, subject to the
					// following conditions:
					//
					// The above copyright notice and this permission notice shall be included
					// in all copies or substantial portions of the Software.
					//
					// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
					// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
					// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
					// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
					// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
					// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
					// USE OR OTHER DEALINGS IN THE SOFTWARE.

					var formatRegExp = /%[sdj%]/g;
					localExports.format = function (f) {
						if (!isString(f)) {
							var objects = [];
							for (var i = 0; i < arguments.length; i++) {
								objects.push(inspect(arguments[i]));
							}
							return objects.join(' ');
						}

						var i = 1;
						var args = arguments;
						var len = args.length;
						var str = (<any>String(f)).replace(formatRegExp, function (x) {
							if (x === '%%') return '%';
							if (i >= len) return x;
							switch (x) {
								case '%s': return String(args[i++]);
								case '%d': return Number(args[i++]);
								case '%j':
									try {
										return JSON.stringify(args[i++]);
									} catch (_) {
										return '[Circular]';
									}
								default:
									return x;
							}
						});
						for (var x = args[i]; i < len; x = args[++i]) {
							if (isNull(x) || !isObject(x)) {
								str += ' ' + x;
							} else {
								str += ' ' + inspect(x);
							}
						}
						return str;
					};


					// Mark that a method should not be used.
					// Returns a modified function which warns once by default.
					// If --no-deprecation is set, then it is a no-op.
					localExports.deprecate = function (fn, msg) {
						// Allow for deprecating things in the process of starting up.
						if (isUndefined(global.process)) {
							return function () {
								return localExports.deprecate(fn, msg).apply(this, arguments);
							};
						}

						if (process.noDeprecation === true) {
							return fn;
						}

						var warned = false;
						function deprecated() {
							if (!warned) {
								if (process.throwDeprecation) {
									throw new Error(msg);
								} else if (process.traceDeprecation) {
									console.trace(msg);
								} else {
									console.error(msg);
								}
								warned = true;
							}
							return fn.apply(this, arguments);
						}

						return deprecated;
					};


					var debugs = {};
					var debugEnviron;
					localExports.debuglog = function (set) {
						if (isUndefined(debugEnviron))
							debugEnviron = process.env.NODE_DEBUG || '';
						set = set.toUpperCase();
						if (!debugs[set]) {
							if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
								var pid = process.pid;
								debugs[set] = function () {
									var msg = localExports.format.apply(localExports, arguments);
									console.error('%s %d: %s', set, pid, msg);
								};
							} else {
								debugs[set] = function () { };
							}
						}
						return debugs[set];
					};


					/**
					 * Echos the value of a value. Trys to print the value out
					 * in the best way possible given the different types.
					 *
					 * @param {Object} obj The object to print out.
					 * @param {Object} opts Optional options object that alters the output.
					 */
					/* legacy: obj, showHidden, depth, colors*/
					function inspect(obj, opts?) {
						// default options
						var ctx: { depth?, colors?, showHidden?, customInspect?, stylize?, seen?} = {
							seen: [],
							stylize: stylizeNoColor
						};
						// legacy...
						if (arguments.length >= 3) ctx.depth = arguments[2];
						if (arguments.length >= 4) ctx.colors = arguments[3];
						if (isBoolean(opts)) {
							// legacy...
							ctx.showHidden = opts;
						} else if (opts) {
							// got an "options" object
							localExports._extend(ctx, opts);
						}
						// set default options
						if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
						if (isUndefined(ctx.depth)) ctx.depth = 2;
						if (isUndefined(ctx.colors)) ctx.colors = false;
						if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
						if (ctx.colors) ctx.stylize = stylizeWithColor;
						return formatValue(ctx, obj, ctx.depth);
					}
					localExports.inspect = inspect;


					// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
					(<any>inspect).colors = {
						'bold': [1, 22],
						'italic': [3, 23],
						'underline': [4, 24],
						'inverse': [7, 27],
						'white': [37, 39],
						'grey': [90, 39],
						'black': [30, 39],
						'blue': [34, 39],
						'cyan': [36, 39],
						'green': [32, 39],
						'magenta': [35, 39],
						'red': [31, 39],
						'yellow': [33, 39]
					};

					// Don't use 'blue' not visible on cmd.exe
					(<any>inspect).styles = {
						'special': 'cyan',
						'number': 'yellow',
						'boolean': 'yellow',
						'undefined': 'grey',
						'null': 'bold',
						'string': 'green',
						'date': 'magenta',
						// "name": intentionally not styling
						'regexp': 'red'
					};


					function stylizeWithColor(str, styleType) {
						var style = (<any>inspect).styles[styleType];

						if (style) {
							return '\u001b[' + (<any>inspect).colors[style][0] + 'm' + str +
								'\u001b[' + (<any>inspect).colors[style][1] + 'm';
						} else {
							return str;
						}
					}


					function stylizeNoColor(str, styleType) {
						return str;
					}


					function arrayToHash(array) {
						var hash = {};

						array.forEach(function (val, idx) {
							hash[val] = true;
						});

						return hash;
					}


					function formatValue(ctx, value, recurseTimes) {
						// Provide a hook for user-specified inspect functions.
						// Check that value is an object with an inspect function on it
						if (ctx.customInspect &&
							value &&
							isFunction(value.inspect) &&
							// Filter out the util module, it's inspect function is special
							value.inspect !== localExports.inspect &&
							// Also filter out any prototype objects using the circular check.
							!(value.constructor && value.constructor.prototype === value)) {
							var ret = value.inspect(recurseTimes, ctx);
							if (!isString(ret)) {
								ret = formatValue(ctx, ret, recurseTimes);
							}
							return ret;
						}

						// Primitive types cannot have properties
						var primitive = formatPrimitive(ctx, value);
						if (primitive) {
							return primitive;
						}

						// Look up the keys of the object.
						var keys = Object.keys(value);
						var visibleKeys = arrayToHash(keys);

						if (ctx.showHidden) {
							keys = Object.getOwnPropertyNames(value);
						}

						// IE doesn't make error fields non-enumerable
						// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
						if (isError(value)
							&& (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
							return formatError(value);
						}

						// Some type of object without properties can be shortcutted.
						if (keys.length === 0) {
							if (isFunction(value)) {
								var name = value.name ? ': ' + value.name : '';
								return ctx.stylize('[Function' + name + ']', 'special');
							}
							if (isRegExp(value)) {
								return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
							}
							if (isDate(value)) {
								return ctx.stylize(Date.prototype.toString.call(value), 'date');
							}
							if (isError(value)) {
								return formatError(value);
							}
						}

						var base = '', array = false, braces = ['{', '}'];

						// Make Array say that they are Array
						if (isArray(value)) {
							array = true;
							braces = ['[', ']'];
						}

						// Make functions say that they are functions
						if (isFunction(value)) {
							var n = value.name ? ': ' + value.name : '';
							base = ' [Function' + n + ']';
						}

						// Make RegExps say that they are RegExps
						if (isRegExp(value)) {
							base = ' ' + RegExp.prototype.toString.call(value);
						}

						// Make dates with properties first say the date
						if (isDate(value)) {
							base = ' ' + Date.prototype.toUTCString.call(value);
						}

						// Make error with message first say the error
						if (isError(value)) {
							base = ' ' + formatError(value);
						}

						if (keys.length === 0 && (!array || value.length == 0)) {
							return braces[0] + base + braces[1];
						}

						if (recurseTimes < 0) {
							if (isRegExp(value)) {
								return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
							} else {
								return ctx.stylize('[Object]', 'special');
							}
						}

						ctx.seen.push(value);

						var output;
						if (array) {
							output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
						} else {
							output = keys.map(function (key) {
								return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
							});
						}

						ctx.seen.pop();

						return reduceToSingleString(output, base, braces);
					}


					function formatPrimitive(ctx, value) {
						if (isUndefined(value))
							return ctx.stylize('undefined', 'undefined');
						if (isString(value)) {
							var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
								.replace(/'/g, "\\'")
								.replace(/\\"/g, '"') + '\'';
							return ctx.stylize(simple, 'string');
						}
						if (isNumber(value))
							return ctx.stylize('' + value, 'number');
						if (isBoolean(value))
							return ctx.stylize('' + value, 'boolean');
						// For some reason typeof null is "object", so special case here.
						if (isNull(value))
							return ctx.stylize('null', 'null');
					}


					function formatError(value) {
						return '[' + Error.prototype.toString.call(value) + ']';
					}


					function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
						var output = [];
						for (var i = 0, l = value.length; i < l; ++i) {
							if (hasOwnProperty(value, String(i))) {
								output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
									String(i), true));
							} else {
								output.push('');
							}
						}
						keys.forEach(function (key) {
							if (!key.match(/^\d+$/)) {
								output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
									key, true));
							}
						});
						return output;
					}


					function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
						var name, str, desc;
						desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
						if (desc.get) {
							if (desc.set) {
								str = ctx.stylize('[Getter/Setter]', 'special');
							} else {
								str = ctx.stylize('[Getter]', 'special');
							}
						} else {
							if (desc.set) {
								str = ctx.stylize('[Setter]', 'special');
							}
						}
						if (!hasOwnProperty(visibleKeys, key)) {
							name = '[' + key + ']';
						}
						if (!str) {
							if (ctx.seen.indexOf(desc.value) < 0) {
								if (isNull(recurseTimes)) {
									str = formatValue(ctx, desc.value, null);
								} else {
									str = formatValue(ctx, desc.value, recurseTimes - 1);
								}
								if (str.indexOf('\n') > -1) {
									if (array) {
										str = str.split('\n').map(function (line) {
											return '  ' + line;
										}).join('\n').substr(2);
									} else {
										str = '\n' + str.split('\n').map(function (line) {
											return '   ' + line;
										}).join('\n');
									}
								}
							} else {
								str = ctx.stylize('[Circular]', 'special');
							}
						}
						if (isUndefined(name)) {
							if (array && key.match(/^\d+$/)) {
								return str;
							}
							name = JSON.stringify('' + key);
							if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
								name = name.substr(1, name.length - 2);
								name = ctx.stylize(name, 'name');
							} else {
								name = name.replace(/'/g, "\\'")
									.replace(/\\"/g, '"')
									.replace(/(^"|"$)/g, "'");
								name = ctx.stylize(name, 'string');
							}
						}

						return name + ': ' + str;
					}


					function reduceToSingleString(output, base, braces) {
						var numLinesEst = 0;
						var length = output.reduce(function (prev, cur) {
							numLinesEst++;
							if (cur.indexOf('\n') >= 0) numLinesEst++;
							return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
						}, 0);

						if (length > 60) {
							return braces[0] +
								(base === '' ? '' : base + '\n ') +
								' ' +
								output.join(',\n  ') +
								' ' +
								braces[1];
						}

						return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
					}


					// NOTE: These type checking functions intentionally don't use `instanceof`
					// because it is fragile and can be easily faked with `Object.create()`.
					function isArray(ar) {
						return Array.isArray(ar);
					}
					localExports.isArray = isArray;

					function isBoolean(arg) {
						return typeof arg === 'boolean';
					}
					localExports.isBoolean = isBoolean;

					function isNull(arg) {
						return arg === null;
					}
					localExports.isNull = isNull;

					function isNullOrUndefined(arg) {
						return arg == null;
					}
					localExports.isNullOrUndefined = isNullOrUndefined;

					function isNumber(arg) {
						return typeof arg === 'number';
					}
					localExports.isNumber = isNumber;

					function isString(arg) {
						return typeof arg === 'string';
					}
					localExports.isString = isString;

					function isSymbol(arg) {
						return typeof arg === 'symbol';
					}
					localExports.isSymbol = isSymbol;

					function isUndefined(arg) {
						return arg === void 0;
					}
					localExports.isUndefined = isUndefined;

					function isRegExp(re) {
						return isObject(re) && objectToString(re) === '[object RegExp]';
					}
					localExports.isRegExp = isRegExp;

					function isObject(arg) {
						return typeof arg === 'object' && arg !== null;
					}
					localExports.isObject = isObject;

					function isDate(d) {
						return isObject(d) && objectToString(d) === '[object Date]';
					}
					localExports.isDate = isDate;

					function isError(e) {
						return isObject(e) &&
							(objectToString(e) === '[object Error]' || e instanceof Error);
					}
					localExports.isError = isError;

					function isFunction(arg) {
						return typeof arg === 'function';
					}
					localExports.isFunction = isFunction;

					function isPrimitive(arg) {
						return arg === null ||
							typeof arg === 'boolean' ||
							typeof arg === 'number' ||
							typeof arg === 'string' ||
							typeof arg === 'symbol' ||  // ES6 symbol
							typeof arg === 'undefined';
					}
					localExports.isPrimitive = isPrimitive;

					localExports.isBuffer = localRequire('./support/isBuffer');

					function objectToString(o) {
						return Object.prototype.toString.call(o);
					}


					function pad(n) {
						return n < 10 ? '0' + n.toString(10) : n.toString(10);
					}


					var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
						'Oct', 'Nov', 'Dec'];

					// 26 Feb 16:19:34
					function timestamp() {
						var d = new Date();
						var time = [pad(d.getHours()),
							pad(d.getMinutes()),
							pad(d.getSeconds())].join(':');
						return [d.getDate(), months[d.getMonth()], time].join(' ');
					}


					// log is just a thin wrapper to console.log that prepends a timestamp
					localExports.log = function () {
						console.log('%s - %s', timestamp(), localExports.format.apply(localExports, arguments));
					};


					/**
					 * Inherit the prototype methods from one constructor into another.
					 *
					 * The Function.prototype.inherits from lang.js rewritten as a standalone
					 * function (not on Function.prototype). NOTE: If this file is to be loaded
					 * during bootstrapping this function needs to be rewritten using some native
					 * functions as prototype setup using normal JavaScript does not work as
					 * expected during bootstrapping (see mirror.js in r114903).
					 *
					 * @param {function} ctor Constructor function which needs to inherit the
					 *     prototype.
					 * @param {function} superCtor Constructor function to inherit prototype from.
					 */
					localExports.inherits = localRequire('inherits');

					localExports._extend = function (origin, add) {
						// Don't do anything if add isn't an object
						if (!add || !isObject(add)) return origin;

						var keys = Object.keys(add);
						var i = keys.length;
						while (i--) {
							origin[keys[i]] = add[keys[i]];
						}
						return origin;
					};

					function hasOwnProperty(obj, prop) {
						return Object.prototype.hasOwnProperty.call(obj, prop);
					}

				}).call(this, localRequire('_process'), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})

			}, { "./support/isBuffer": 223, "_process": 188, "inherits": 167 }]
		}, {}, [2])(2)
	});

declare var PDFDocument: {
	prototype: _IPdfKitDocument;
	new (options?: _IPdfKitDocumentOptions): _IPdfKitDocument;
} 

interface _IPdfKitDocument {
	x: number;
	y: number;
	info: _IPdfKitDocumentInfo;
	compress: boolean;
	options: _IPdfKitDocumentOptions;
	page: _IPdfKitPage;

	addPage(options?: _IPdfKitPageOptions): _IPdfKitDocument;
	bufferedPageRange(): { start: number; count: number; };
	flushPages(): void;
	switchToPage(pageNumber: number): _IPdfKitPage;
	end(): boolean;

	lineGap(value: number): _IPdfKitDocument;
	currentLineGap(): number; // GrapeCity
	currentLineHeight(includeGap?: boolean): number;
	widthOfString(value: string, options?: _IPdfKitWidthOfStringOptions): number;
	heightOfString(value: string, options?: _IPdfKitMeasurementTextOptions): number;
	moveDown(lines: number): _IPdfKitDocument;
	moveUp(lines: number): _IPdfKitDocument;
	text(text: string, options?: _IPdfKitTextOptions): _IPdfKitDocument;
	text(text: string, x?: number, y?: number, options?: _IPdfKitTextOptions): _IPdfKitDocument;
	textAndMeasure(text: string, x: number, y: number, options: _IPdfKitMeasurementTextOptions, measureOnly?: boolean): _IPdfKitTextSize; // GrapeCity

	currentFontAscender(): number; // GrapeCity
	currentFontBBox(): _IPdfKitFontBBox; // GrapeCity
	currentFontSize(): number; // GrapeCity
	font(name: string, size?: number): _IPdfKitDocument;
	font(src: ArrayBuffer, size?: number): _IPdfKitDocument;
	font(src: ArrayBuffer, fontFamily: string, size?: number): _IPdfKitDocument;
	fontSize(size: number): _IPdfKitDocument;
	registerFont(name: string, standardFontName: string): _IPdfKitDocument;
	registerFont(name: string, src: ArrayBuffer, fontFamily?: string): _IPdfKitDocument;

	image(URI: string, options?: _IPdfKitImageOptions): _IPdfKitDocument;
	image(URI: string, x?: number, y?: number, options?: _IPdfKitImageOptions): _IPdfKitDocument;

	on(eventName: string, handler: Function): _IPdfKitDocument;
	on(eventName: 'data', handler: (chunk: any) => {}): _IPdfKitDocument;
	removeAllListeners(type: string): _IPdfKitDocument;
	removeEventListener(type: string, listener: Function): _IPdfKitDocument;

	fill(colorOrRule: string): _IPdfKitDocument;
	fill(color: string, rule?: string): _IPdfKitDocument;
	fill(color: number[], rule?: string): _IPdfKitDocument;
	fill(color: _IPdfKitGradient, rule?: string): _IPdfKitDocument;

	fillAndStroke(rule?: string): _IPdfKitDocument;
	fillAndStroke(fillColor: string, strokeColor: string, rule?: string): _IPdfKitDocument;
	fillAndStroke(fillColor: number[], strokeColor: number[], rule?: string): _IPdfKitDocument;
	fillAndStroke(fillColor: _IPdfKitGradient, strokeColor: _IPdfKitGradient, rule?: string): _IPdfKitDocument;

	fillColor(color: string, opacity?: number): _IPdfKitDocument;
	fillColor(color: number[], opacity?: number): _IPdfKitDocument;
	fillColor(color: _IPdfKitGradient, opacity?: number): _IPdfKitDocument;
	strokeColor(color: string, opacity?: number): _IPdfKitDocument;
	strokeColor(color: number[], opacity?: number): _IPdfKitDocument;
	strokeColor(color: _IPdfKitGradient, opacity?: number): _IPdfKitDocument;

	fillOpacity(opacity: number): _IPdfKitDocument;
	strokeOpacity(opacity: number): _IPdfKitDocument;
	opacity(opacity: number): _IPdfKitDocument;

	linearGradient(x1: number, y1: number, x2: number, y2: number): _IPdfKitGradient;
	radialGradient(x1: number, y1: number, r1: number, x2: number, y2: number, r2: number): _IPdfKitGradient;

	closePath(): _IPdfKitDocument;
	clip(rule?: string): _IPdfKitDocument;
	bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): _IPdfKitDocument;
	quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): _IPdfKitDocument;
	circle(x: number, y: number, radius: number): _IPdfKitDocument;
	ellipse(x: number, y: number, r1: number, r2?: number): _IPdfKitDocument;
	lineTo(x: number, y: number): _IPdfKitDocument;
	lineWidth(width: number): _IPdfKitDocument;
	moveTo(x: number, y: number): _IPdfKitDocument;
	path(path: string): _IPdfKitDocument;
	rect(x: number, y: number, w: number, h: number): _IPdfKitDocument;
	roundedRect(x: number, y: number, w: number, h: number, r?: number): _IPdfKitDocument;
	polygon(...points: number[][]): _IPdfKitDocument;
	lineCap(value: any /*string | number */): _IPdfKitDocument;
	lineJoin(value: any /*string | number */): _IPdfKitDocument;
	miterLimit(value: number): _IPdfKitDocument;
	dash(length: number, options?: _IPdfKitDashOptions): _IPdfKitDocument;
	undash(): _IPdfKitDocument;

	stroke(color?: string): _IPdfKitDocument;
	stroke(color?: number[]): _IPdfKitDocument;
	stroke(color?: _IPdfKitGradient): _IPdfKitDocument;

	scale(xFactor: number, yFactor: number, options?: _IPdfKitOrigin): _IPdfKitDocument;
	scale(factor: number): _IPdfKitDocument;
	translate(x: number, y: number): _IPdfKitDocument;
	transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): _IPdfKitDocument;
	rotate(angle: number, options?: _IPdfKitOrigin): _IPdfKitDocument;

	restore(): _IPdfKitDocument;
	save(): _IPdfKitDocument;
}

interface _IPdfKitPageOptions {
	layout?: string;
	margin?: number;
	margins?: _IPdfKitPageMargins;
	size?: any;  // string (named size) or number[2] (custom size)
}

interface _IPdfKitPage {
	document: _IPdfKitDocument;
	width: number;
	height: number;
	margins: _IPdfKitPageMargins;
	size: any; // string (named size) or number[2] (custom size)
	layout: string;

	// GrapeCity
	originalMargins: _IPdfKitPageMargins;
}

interface _IPdfKitDocumentOptions extends _IPdfKitPageOptions {
	bufferPages?: boolean;
	compress?: boolean;
	info?: _IPdfKitDocumentInfo;

	// GrapeCity
	pageAdding?: (document: _IPdfKitDocument, options: _IPdfKitPageOptions) => void;
	pageAdded?: (document: _IPdfKitDocument, pageIndex: number) => void;
}

interface _IPdfKitDocumentInfo {
	Author?: string;
	CreationDate?: Date;
	Keywords?: string;
	ModDate?: Date;
	Subject?: string;
	Title?: string;
}

interface _IPdfKitPageMargins {
	bottom: number;
	left: number;
	right: number;
	top: number;
}

interface _IPdfKitTextOptions {
	align?: string; // "left", "center", "right", "justify".
	lineBreak?: boolean; // set to false to disable line wrapping all together
	width?: number; // the width that text should be wrapped to (by default, the page width minus the left and right margin)
	height?: number; // the maximum height that text should be clipped to
	ellipsis?: any; // the character to display at the end of the text when it is too long. Set to true to use the default character.
	columns?: number; // the number of columns to flow the text into
	columnGap?: number; // the amount of space between each column(1 / 4 inch by default)
	indent?: number; // the amount in PDF points(72 per inch) to indent each paragraph of text
	paragraphGap?: number; // the amount of space between each paragraph of text
	lineGap?: number; // the amount of space between each line of text
	wordSpacing?: number; // the amount of space between each word in the text
	characterSpacing?: number; // the amount of space between each character in the text
	fill?: boolean; // whether to fill the text(true by default)
	stroke?: boolean; // whether to stroke the text
	link?: string; // a URL to link this text to(shortcut to create an annotation)
	underline?: boolean; // whether to underline the text
	strike?: boolean; // whether to strike out the text
	continued?: boolean; // whether the text segment will be followed immediately by another segment.Useful for changing styling in the middle of a paragraph.
}

interface _IPdfKitDashOptions {
	phase?: number;
	space?: number;
}

interface _IPdfKitMeasurementTextOptions extends _IPdfKitTextOptions {
	// GrapeCity
	includeLastLineExternalLeading?: boolean; // default: true
}

interface _IPdfKitWidthOfStringOptions {
	characterSpacing?: number;
}

// Neither width or height provided - image is rendered at full size
// width provided but not height - image is scaled proportionally to fit in the provided width
// height provided but not width - image is scaled proportionally to fit in the provided height
// Both width and height provided - image is stretched to the dimensions provided
// scale factor provided - image is scaled proportionally by the provided scale factor
// fit array provided - image is scaled proportionally to fit within the passed width and height
interface _IPdfKitImageOptions {
	width?: number;
	height?: number;
	scale?: number;
	fit?: number[];
	align?: string; // 'left' (default) | 'center' | 'right'
	valign?: string; // 'top' (default) | 'center' | 'bottom'
}

interface _IPdfKitGradient {
	stop(pos: number, color, opacity?: number): _IPdfKitGradient;
}

interface _IPdfKitOrigin {
	origin?: number[];
}

// GrapeCity
interface _IPdfKitTextSize {
	width?: number;
	height?: number;
	charCount?: number;
}

// GrapeCity
interface _IPdfKitFontBBox {
	llx: number,
	lly: number,
	urx: number,
	ury: number
}

	'use strict';

	// Must follow the PDFKit's _CAP_STYLES object.
	/**
	* Specifies the shape that shall be used at the ends of open subpaths
	* (and dashes, if any) when they are stroked.
	*/
	export enum PdfLineCapStyle {
		/**
		* The stroke is squared off at the endpoint of the path.
		*/
		Butt = 0,

		/**
		* A semicircular arc with a diameter equal to the line width is 
		* drawn around the endpoint and is filled in.
		*/
		Round = 1,

		/**
		* The stroke continues beyond the endpoint of the path for a
		* distance equal to the half of the line width and is squared off.
		*/
		Square = 2
	}

	// Must follow the PDFKit's _JOIN_STYLES object.
	/**
	* Specifies the shape to be used at the corners of paths that are stroked.
	*/
	export enum PdfLineJoinStyle {
		/**
		* The outer edges of the strokes for the two segments are extended
		* until they meet at an angle.
		*/
		Miter = 0,

		/**
		* An arc of a circle with a diameter equal to the line width is drawn
		* around the point where the two segments meet.
		*/
		Round = 1,

		/**
		* The two segments are finished with butt caps and the resulting notch
		* beyond the ends of the segments is filled with a triangle.
		*/
		Bevel = 2
	}

	/**
	* Specifies a rule that determines if a point falls inside the enclosed path.
	*/
	export enum PdfFillRule {
		/**
		* Non-zero rule.
		*/
		NonZero,

		/**
		* Even-odd rule.
		*/
		EvenOdd
	}

	/**
	* Specifies the page orientation.
	*/
	export enum PdfPageOrientation {
		/**
		* Portrait orientation.
		*/
		Portrait,

		/**
		* Landscape orientation.
		*/
		Landscape
	}
	
	/**
	* Specifies the horizontal alignment of the image.
	*/
	export enum PdfImageHorizontalAlign {
		/**
		* Aligns the image to the left edge of the drawing area.
		*/
		Left,

		/**
		* Aligns the image in the middle of the drawing area.
		*/
		Center,

		/**
		* Aligns the image to the right edge of the drawing area.
		*/
		Right
	}

	/**
	* Specifies the vertical alignment of the image.
	*/
	export enum PdfImageVerticalAlign {
		/**
		* Aligns the image to the top edge of the drawing area.
		*/
		Top,

		/**
		* Aligns the image in the middle of the drawing area.
		*/
		Center,

		/**
		* Aligns the image to the bottom edge of the drawing area.
		*/
		Bottom
	}

	/**
	* Specifies the horizontal alignment of text content.
	*/
	export enum PdfTextHorizontalAlign {
		/**
		* Text is aligned to the left.
		*/
		Left,
		
		/**
		* Text is centered.
		*/
		Center,

		/**
		* Text is aligned to the right.
		*/
		Right,

		/**
		* Text is justified.
		*/
		Justify
	}

	// internal, determines the baseline of the text.
	export enum _PdfTextBaseline {
		Top,
		Alphabetic
	}

	// Names must strictly follow the PDFKit's SIZES object.
	/**
	* Specifies the page size, in points.
	*/
	export enum PdfPageSize {
		/**
		* Represents the A0 page size.
		*/
		A0,

		/**
		* Represents the A1 page size.
		*/
		A1,

		/**
		* Represents the A2 page size.
		*/
		A2,

		/**
		* Represents the A3 page size.
		*/
		A3,

		/**
		* Represents the A4 page size.
		*/
		A4,

		/**
		* Represents the A5 page size.
		*/
		A5,

		/**
		* Represents the A6 page size.
		*/
		A6,

		/**
		* Represents the A7 page size.
		*/
		A7,

		/**
		* Represents the A8 page size.
		*/
		A8,

		/**
		* Represents the A9 page size.
		*/
		A9,

		/**
		* Represents the A10 page size.
		*/
		A10,

		/**
		* Represents the B0 page size.
		*/
		B0,

		/**
		* Represents the B1 page size.
		*/
		B1,

		/**
		* Represents the B2 page size.
		*/
		B2,

		/**
		* Represents the B3 page size.
		*/
		B3,

		/**
		* Represents the B4 page size.
		*/
		B4,

		/**
		* Represents the B5 page size.
		*/
		B5,

		/**
		* Represents the B6 page size.
		*/
		B6,

		/**
		* Represents the B7 page size.
		*/
		B7,

		/**
		* Represents the B8 page size.
		*/
		B8,

		/**
		* Represents the B9 page size.
		*/
		B9,

		/**
		* Represents the B10 page size.
		*/
		B10,

		/**
		* Represents the C0 page size.
		*/
		C0,

		/**
		* Represents the C1 page size.
		*/
		C1,

		/**
		* Represents the C2 page size.
		*/
		C2,

		/**
		* Represents the C3 page size.
		*/
		C3,

		/**
		* Represents the C4 page size.
		*/
		C4,

		/**
		* Represents the C5 page size.
		*/
		C5,

		/**
		* Represents the C6 page size.
		*/
		C6,

		/**
		* Represents the C7 page size.
		*/
		C7,

		/**
		* Represents the C8 page size.
		*/
		C8,

		/**
		* Represents the C9 page size.
		*/
		C9,

		/**
		* Represents the C10 page size.
		*/
		C10,

		/**
		* Represents the RA0 page size.
		*/
		RA0,

		/**
		* Represents the RA1 page size.
		*/
		RA1,

		/**
		* Represents the RA2 page size.
		*/
		RA2,

		/**
		* Represents the RA3 page size.
		*/
		RA3,

		/**
		* Represents the RA4 page size.
		*/
		RA4,

		/**
		* Represents the SRA0 page size.
		*/
		SRA0,

		/**
		* Represents the SRA1 page size.
		*/
		SRA1,

		/**
		* Represents the SRA2 page size.
		*/
		SRA2,

		/**
		* Represents the SRA3 page size.
		*/
		SRA3,

		/**
		* Represents the SRA4 page size.
		*/
		SRA4,

		/**
		* Represents the executive page size.
		*/
		Executive,

		/**
		* Represents the folio page size.
		*/
		Folio,

		/**
		* Represents the legal page size.
		*/
		Legal,

		/**
		* Represents the letter page size.
		*/
		Letter,

		/**
		* Represents the tabloid page size.
		*/
		Tabloid
	}
 


	/** Infrastructure. */
	export interface _IPdfTextFlowCtxState {
		xo: number;
		yo: number;
		lineGap: number;
	}

	// wraps the _IPdfKitTextOptions native interface.
	/**
	* Represents text settings used by @see:PdfPageArea.drawText and @see:PdfPageArea.measureText methods.
	*/
	export interface IPdfTextSettings {
		/**
		* Determines how text is aligned within the drawing area.
		* The default value is <b>Left</b>.
		*/
		align?: PdfTextHorizontalAlign;

		/**
		* Indicates whether line wrapping should be used or not.
		* The property is ignored if @see:IPdfTextSettings.width is defined.
		* The default value is true.
		*/
		lineBreak?: boolean;

		/**
		* Determines the width of the text area in points to which the text should wrap.
		* The default value is undefined which means that the text area will be limited by
		* right margin of the page.
		* Use Infinity to indicate that the text area has an infinite width.
		* If defined, forces the @see:IPdfTextSettings.lineBreak property to be enabled.
		*/
		width?: number;
		
		/**
		* Determines the height of the drawing area in points to which the text should be clipped.
		* The default value is undefined which means that the text area will be limited by
		* bottom edge of the body section.
		* Use Infinity to indicate that the text area has an infinite height.
		*/
		height?: number;

		/**
		* Determines the character to display at the end of the text when it exceeds
		* the given area.The default value is undefined, that is, ellipsis is not displayed.
		* Set to true to use the default character.
		*/
		ellipsis?: any; 

		/**
		* Determines the number of columns to flow the text into.
		* The default value is 1.
		*/
		columns?: number;

		/**
		* Determines the spacing between each column, in points.
		* The default value is 18.
		*/
		columnGap?: number;

		/**
		* Determines the value of indentaion in each paragraph of text, in points.
		* The default value is 0.
		*/
		indent?: number;

		/**
		* Determines the spacing between paragraphs of text.
		* The default value is 0.
		*/
		paragraphGap?: number; 

		/**
		* Determines the spacing between lines of text.
		* The default value is 0.
		*/
		lineGap?: number;

		/**
		* Determines the spacing between words in the text.
		* The default value is 0.
		*/
		wordSpacing?: number;

		/**
		* Determines the spacing between text characters.
		* The default value is 0.
		*/
		characterSpacing?: number;

		/**
		* Indicates whether the text should be filled or not.
		* The default value is true.
		*/
		fill?: boolean;
		
		/**
		* Indicates whether the text should be stroked or not.
		* The default value is false.
		*/
		stroke?: boolean;

		/**
		* Determines a URL used to create a link annotation (URI action).
		*/		
		link?: string;

		/**
		* Indicates whether the text should be underlined or not.
		* The default value is false.
		*/
		underline?: boolean;

		/**
		* Indicates whether the text should be striked out or not.
		* The default value is false.
		*/
		strike?: boolean;

		/**
		* Indicates whether subsequent text should be continued right after that or
		* it will be a new paragraph. If true, the text settings will be retained
		* between drawText calls. It means that options argument will be merged with
		* the one taken from the previous drawText call.
		*
		* The default value is false.
		*/
		continued?: boolean;
	}

	/**
	* Represents the settings used by @see:PdfPageArea.drawText method to draw a text
	* with the specified @see:PdfPen and @see:PdfBrush.
	*/
	export interface IPdfTextDrawSettings extends IPdfTextSettings {
		/**
		* Determines the font to use. If not specified, the default document font will be
		* used (@see:PdfDocument.setFont method).
		*/
		font?: PdfFont;

		/**
		* Determines the pen to stroke the text. If not specified, the default document
		* pen will be used (@see:PdfDocument.setPen method).
		*/
		pen?: any; // PdfPen | Color | string

		/**
		* Determines the brush to fill the text. If not specified, the default document
		* brush will be used (@see:PdfDocument.setBrush method).
		*/
		brush?: any; // PdfBrush | Color | string

		_baseline?: _PdfTextBaseline; // internal, used by SVG renderer
	}

	/**
	* Represents the settings used by @see:PdfPageArea.measureText method.
	*/
	export interface IPdfTextMeasurementSettings extends IPdfTextSettings {
		/**
		* Determines whether the last line external leading value should be included into the measurements result.
		* The default value is true.
		*/
		includeLastLineExternalLeading?: boolean; // default: true
	}

	/**
	 * Represents the image drawing settings used by @see:PdfPageArea.drawImage method.
	 *
	 * If neither width nor height options are provided, then the image will be rendered
	 * in its original size. If only width is provided, then the image will be scaled
	 * proportionally to fit in the provided width. If only height is provided, then the
	 * image will be scaled proportionally to fit in the provided height. If both width
	 * and height are provided, then image will be stretched to the dimensions depending
	 * on the stretchProportionally property.
	 */
	export interface IPdfImageDrawSettings {
		/**
		* Determines the width of the image, in points.
		*/
		width?: number;

		/**
		* Determines the height of the image, in points.
		*/
		height?: number;

		/**
		* Indicates whether an image will be stretched proportionally or not, if both width
		* and height options are provided.
		*/
		stretchProportionally?: boolean;

		/**
		* Determines the horizontal alignment in case of proportional stretching.
		*/
		align?: PdfImageHorizontalAlign;

		/**
		* Determines the vertical alignment in case of proportional stretching.
		*/
		vAlign?: PdfImageVerticalAlign;
	}

	
	/**
	* Represents the settings used by @see:PdfPageArea.drawSvg method to draw a SVG image.
	*/
	export interface IPdfSvgDrawSettings extends IPdfImageDrawSettings {
		/**
		* Determines a callback function used to convert a relative URL to a URL that is correct for the current request path.
		* The function gets passed the relative URL as its argument and should return the resolved URL.
		*/
		urlResolver?: Function;
	}

	/**
	* Represents a range of buffered pages returned by @see:PdfDocument.bufferedPageRange method.
	*/
	export interface IPdfBufferedPageRange {
		/**
		* Determines the zero-based index of the first buffered page.
		*/
		start: number;

		/**
		* Determines the count of buffered pages.
		*/
		count: number;
	}

	///*
	//* Represents a callback function which will be called when the font is registered successfully.
	//*/
	//export interface IPdfFontRegisteredCallback {
	//	/*
	//	* @param font The font which has been registered.
	//	*/
	//	(font: IPdfFontFile): void;
	//}

	/**
	* Represents the font attributes.
	*/
	export interface IPdfFontAttributes {
		/**
		* Glyphs have finishing strokes, flared or tapering ends, or have actual
		* serifed endings.
		*/
		cursive?: boolean;

		/**
		* Fantasy fonts are primarily decorative fonts that contain playful representations
		* of characters.
		*/
		fantasy?: boolean;

		/**
		* All glyphs have the same width.
		*/
		monospace?: boolean;

		/**
		* Glyphs have finishing strokes, flared or tapering ends, or have actual
		* serifed endings.
		*/
		serif?: boolean;

		/**
		* Glyphs have stroke endings that are plain.
		*/
		sansSerif?: boolean;
	}

	/**
	* Represents the settings of the font to register by @see:PdfDocument.registerFont and
	* @see:PdfDocument.registerFontAsync methods.
	*/
	export interface IPdfFontFile extends IPdfFontAttributes {
		/**
		* An ArrayBuffer containing binary data or URL to load the font from. 
		* Following font formats are supported: TrueType (.ttf), TrueType Collection (.ttc),
		* Datafork TrueType (.dfont).
		*/
		source: any; /* ArrayBuffer | string */

		/**
		* The name of the font to use.
		*/
		name: string;

		/**
		* The style of the font. One of the following values: 'normal', 'italic', 'oblique'.
		*/
		style?: string;

		/**
		* The weight of the font. One of the following values: 'normal', 'bold', '100', '200', 
		*'300', '400', '500', '600', '700', '800', '900'.
		*/
		weight?: string;

		/**
		* An optional parameter determining the TrueType Collection or Datafork TrueType
		* font family.
		*/
		family?: string;
	}

	/**
	* Represents the document information used by @see:PdfDocument.info property.
	*/
	export interface IPdfDocumentInfo {
		/**
		* Determines the name of the person who created the document.
		*/
		author?: string;

		/**
		* Determines the date and time the document was created on.
		*/
		creationDate?: Date;

		/**
		* Determines the keywords associated with the document. 
		*/
		keywords?: string;

		/**
		* Determines the date and time when the document was last modified.
		*/
		modDate?: Date;

		/**
		* Determines the subject of the document.
		*/
		subject?: string;

		/**
		* Determines the title of the document.
		*/
		title?: string;
	}

	/**
	* Represents the page margins.
	*/
	export interface IPdfPageMargins {
		/**
		* Determines the bottom margin, in points.
		*/
		bottom: number;

		/**
		* Determines the left margin, in points.
		*/
		left: number;

		/**
		* Determines the right margin, in points.
		*/
		right: number;

		/**
		* Determines the top margin, in points.
		*/
		top: number;
	}

	/**
	* Represents the page settings.
	*/
	export interface IPdfPageSettings {
		/**
		* Determines the layout of the page.
		*/
		layout?: PdfPageOrientation;

		/**
		* Determines the margins of the page.
		*/
		margins?: IPdfPageMargins;

		/**
		* Determines the dimensions of the page.
		* The following values are supported:
		* <ul>
		*  <li><b>@see:PdfPageSize</b>: predefined sizes.</li>
		*  <li><b>@see:Size</b>: custom sizes.</li>
		* </ul>
		*/
		size?: any/* PdfPageSize | Size */;
	}

	/**
	* Represents the text measurement information returned by @see:PdfPageArea.measureText method.
	*/
	export interface IPdfTextMeasurementInfo {
		/**
		* Determines the text size, in points.
		*/
		size: wjcCore.Size;

		/**
		* Determines the character count.
		*/
		charCount: number;
	}
 

	'use strict';

	export var _Errors = {
		InvalidArg: (name: string): string => {
			return 'Invalid argument: "' + name + '".';
		},
		InvalidFormat: (value: string): string => {
			return '"' + value + '" is not in the correct format.';
		},
		ValueCannotBeEmpty: (name: string): string => {
			return 'Value cannot be empty: "' + name + '".';
		},
	
		PathStarted: 'This method can not be used until the current path is finished.',
		BufferPagesMustBeEnabled: 'The bufferPages property must be enabled to render headers and footers.',
		AbstractMethod: 'This is an abstract method, it should not be called.',

		FontNameMustBeSet: 'The font name must be set.',
		FontSourceMustBeStringArrayBuffer: 'The font source must be of type string or ArrayBuffer.',
		FontSourceMustBeString: 'The font source must be of type string.',
		FontSourceMustBeArrayBuffer: 'The font source must be of type ArrayBuffer.',

		EmptyUrl: 'URL can not be empty.',
		UndefinedMimeType: 'MIME-type must be set.',
		InvalidImageDataUri: 'Invalid Data URI. It should be base64 encoded string that represents JPG or PNG image.',
		InvalidImageFormat: 'Invalid image format. Only JPG and PNG formats are supported.'
	};



	'use strict';

	export var _IE = 'ActiveXObject' in window;

	var _FontSizePt = {
		'xx-small': 7,
		'x-small': 7.5,
		small: 10,
		medium: 12,
		large: 13.5,
		'x-large': 18,
		'xx-large': 24
	};

	/**
	 * Saves the Blob object as a file.
	 * @param blob The Blob object to save.
	 * @param fileName The name with which the file is saved.
	*/
	export function saveBlob(blob: Blob, fileName: string): void {
		if (!blob || !(blob instanceof Blob) || !fileName) {
			return;
		}

		if (navigator.msSaveBlob) {
			navigator.msSaveBlob(blob, fileName);
		} else {
			var link = <HTMLAnchorElement>document.createElement('a'),
				click = function (element) {
					var evnt = <MouseEvent>document.createEvent('MouseEvents');
					evnt.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
					element.dispatchEvent(evnt);
				};

			if ("download" in link) {
				var url = window.URL || (<any>window).webkitURL || window,
					objUrl = url.createObjectURL(blob);

				link.href = objUrl;
				link.download = fileName;
				click(link);
				link = null;

				window.setTimeout(() => { // FF requires a timeout
					url.revokeObjectURL(objUrl);
				}, 30000);
			} else {
				var fr = new FileReader();

				// Save a blob using data URI scheme
				fr.onloadend = (e) => {
					link.download = fileName;
					link.href = fr.result;
					click(link);
					link = null;
				};

				fr.readAsDataURL(blob);
			}
		}
	}

	/**
	* Converts a point unit value to a pixel unit value.
	*
	* @param value The value to convert.
	* @return The converted value.
	*/
	export function ptToPx(value: number): number {
		return wjcCore.asNumber(value) / 0.75; // * 96 / 72;
	}

	/**
	* Converts a pixel unit value to a point unit value.
	*
	* @param value The value to convert.
	* @return The converted value.
	*/
	export function pxToPt(value: number): number {
		return wjcCore.asNumber(value) * 0.75; // * 72 / 96;
	}

	/*
	* Converts a value to @see:wijmo.Color.
	*
	* If value is @see:wijmo.Color then, the original or cloned value will be returned
	* depending on the cloned parameter.
	* If value is a string, then a new @see:wijmo.Color instance will be created.
	* If value is omitted, then a new @see:wijmo.Color instance designated with black color 
	* will be created.
	*
	* @param colorOrString Value to convert.
	* @param clone Indicates whether the original @see:wijmo.Color value should be cloned.
	* @return A @see:wijmo.Color.
	*/
	export function _asColor(colorOrString: any, clone = true): wjcCore.Color { // colorOrString: Color | string
		var res: wjcCore.Color;

		if (!colorOrString) {
			res = wjcCore.Color.fromRgba(0, 0, 0);
		} else {
			if (colorOrString instanceof wjcCore.Color) {
				res = clone
				? wjcCore.Color.fromRgba((<wjcCore.Color>colorOrString).r, (<wjcCore.Color>colorOrString).g, (<wjcCore.Color>colorOrString).b, (<wjcCore.Color>colorOrString).a)
				: colorOrString;
			} else {
				res = wjcCore.Color.fromString(colorOrString);
			}
		}

		wjcCore.assert(res instanceof wjcCore.Color, _Errors.InvalidArg('colorOrString'));

		return res;
	}

	/*
	* Converts a value to a @see:PdfPen.
	*
	* If value is a @see:PdfPen then the original value will be returned.
	* If value is a string or a @see:wijmo.Color then a new @see:PdfPen instance will be created using value as a color argument.
	*
	* @param penOrColor Value to convert.
	* @param nullOK Whether null values are acceptable.
	* @return A @see:PdfPen.
	*/
	export function _asPdfPen(penOrColor: any, nullOK = true): PdfPen { // penOrColor: PdfPen | Color | string
		if (wjcCore.isString(penOrColor) || (penOrColor instanceof wjcCore.Color)) {
			penOrColor = new PdfPen(penOrColor);
		}

		wjcCore.assert((penOrColor == null && nullOK) || penOrColor instanceof PdfPen, _Errors.InvalidArg('penOrColor'));

		return penOrColor;
	}

	/*
	* Converts a value to a @see:PdfBrush.
	*
	* If value is a @see:PdfBrush, then the original value will be returned.
	* If value is a string or a @see:wijmo.Color, then a new @see:PdfSolidBrush 
	* instance will be created using value as a color argument.
	*
	* @param brushOrColor Value to convert.
	* @param nullOK Whether null values are acceptable.
	* @return A @see:PdfBrush.
	*/
	export function _asPdfBrush(brushOrColor: any, nullOK = true): PdfBrush { // brushOrColor: PdfBrush | Color | string
		if (wjcCore.isString(brushOrColor) || (brushOrColor instanceof wjcCore.Color)) {
			brushOrColor = new PdfSolidBrush(brushOrColor);
		}

		wjcCore.assert((brushOrColor == null && nullOK) || brushOrColor instanceof PdfBrush, _Errors.InvalidArg('brushOrColor'));

		return brushOrColor;
	}

	/*
	* Asserts that value is a @see:PdfFont.
	*
	* @param font Value to check.
	* @param nullOK Whether null values are acceptable.
	* @return A @see:PdfFont.
	*/
	export function _asPdfFont(font: PdfFont, nullOK = true): PdfFont {
		wjcCore.assert((font == null && nullOK) || font instanceof PdfFont, _Errors.InvalidArg('font'));
		return font;
	}

	/*
	* Converts a value to a point unit value.
	*
	* The following values are supported:
	* <ul>
	*	<li>A number or numeric string or string postfixed with 'pt', treated as a point unit value.</li>
	*	<li>A string postfixed with the 'px'</li>
	*	<li>A font size value: 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'.</li>
	* </ul>
	*
	* @param value The value to convert.
	* @param emptyOK Whether empty values ('', null, undefined) are acceptable.
	* @param emptyValue A value to be returned, if the provided value is empty.
	* @return The converted value or an exception if conversion fails.
	*/
	export function _asPt(value: any, emptyOK = true, emptyValue = 0): number {
		var isEmpty = !value && value !== 0;

		wjcCore.assert(!isEmpty || emptyOK, _Errors.ValueCannotBeEmpty('value'));

		if (isEmpty) {
			return emptyValue;
		}

		if (wjcCore.isNumber(value)) {
			if (value === value) {
				return value;
			}
		} else {
			if (wjcCore.isString(value)) {
				if (_FontSizePt[value]) {
					return _FontSizePt[value];
				}

				var num = parseFloat(value);
				if (num === num) {
					if (value.match(/(px)$/i)) {
						return pxToPt(num);
					}

					if (value == num || value.match(/(pt)$/i)) {
						return num;
					}
				}
			}
		}

		wjcCore.assert(false, _Errors.InvalidFormat(value));
	}

	/*
	* Replaces each macro item in a specified string with the text equivalent to an object's
	* value.
	*
	* The function works by replacing parts of the <b>str</b> with the pattern
	* '&[MacroName]' with properties of the <b>dict</b> argument.
	*
	* Use '&&' to indicate an actual ampersand.
	*
	* @param str A string to format.
	* @param dict The macros dictionary used to format the string.
	* @return The formatted string.
	*/
	export function _formatMacros(str: string, dict: any): string {
		var amps = {},
			ampsCnt = 0;

		// && -> &
		str = str.replace(/&&/g, (match, offset, str) => {
			amps[offset - (ampsCnt * 2) + ampsCnt] = true; // store the position of an actual ampersand within the string
			ampsCnt++;
			return '&';
		});

		// process macros
		str = str.replace(/&\[(\S+?)\]/g, (match, p1, offset, str) => {
			var macros = dict[p1];

			return macros && !amps[offset]
				? macros
				: match;
		});

		return str;
	}

	/*
	* Compares two objects with priority of the obj.equals(), if provided.
	*
	* @param a The first object to compare.
	* @param b The second object to compare.
	* @return True if the specified objects are equal, otherwise false.
	*/
	export function _compare(a: any, b: any): boolean {
		if (wjcCore.isObject(a) && wjcCore.isObject(b)) {
			for (var key in a) {
				if (key && ((<string>key)[0] === '_')) {
					continue;
				}

				var val = a[key],
					cmp = val && wjcCore.isFunction(val.equals) ? val.equals(b[key]) : _compare(val, b[key]);

				if (!cmp) {
					return false;
				}
			}

			return true;
		} else {
			if (wjcCore.isArray(a) && wjcCore.isArray(b)) {
				if (a.length !== b.length) {
					return false;
				}

				for (var i = 0; i < a.length; i++) {
					if (!_compare(a[i], b[i])) {
						return false;
					}
				}

				return true;
			}
		}

		// todo: compare Dates, if necessary.

		return a === b;
	}

	/*
	* Creates a shallow copy of the source object.
	*
	* @param src The source object.
	* @return A shallow copy of the source object. 
	*/
	export function _shallowCopy(src: any): any {
		var dst = {};

		if (src) {
			for (var key in src) {
				dst[key] = src[key];
			}
		}

		return dst;
	}

	/*
	* Capitalizes the first character of the string and converts all other characters to lowercase.
	*
	* @param value The string to convert.
	* @return The converted string.
	*/
	export function _toTitleCase(value: string): string {
		if (value) {
			return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
		}

		return value;
	}
 

	'use strict';

	/**
	 * Represents the dash pattern used to stroke paths.
	 */
	export class PdfDashPattern {
		private _dash: number;
		private _gap: number;
		private _phase: number;

		/**
		* Initializes a new instance of the @see:PdfDashPattern class.
		*
		* @param dash The length of alternating dashes, in points.
		* @param gap The length of alternating gaps, in points.
		* @param phase The distance in the dash pattern to start the dash at, in points.
		*/
		constructor(dash: number = null, gap: number = dash, phase: number = 0) {
			this.dash = dash;
			this.gap = gap;
			this.phase = phase;
		}

		/**
		* Gets or sets the length of alternating dashes, in points.
		* The default value is null which indicates no dash pattern, but a solid line.
		*/
		public get dash(): number {
			return this._dash;
		}
		public set dash(value: number) {
			this._dash = wjcCore.asNumber(value, true, true);
		}

		/**
		* Gets or sets the length of alternating gaps, in points.
		* The default value is equal to @see:dash which indicates that dashes and gaps will
		* have the same length.
		*/
		public get gap(): number {
			return this._gap;
		}
		public set gap(value: number) {
			this._gap = wjcCore.asNumber(value, true, true);
		}

		/**
		* Gets or sets the distance in the dash pattern to start the dash at, in points.
		* The default value is 0.
		*/
		public get phase(): number {
			return this._phase;
		}
		public set phase(value: number) {
			this._phase = wjcCore.asNumber(value, false, true);
		}

		/**
		* Creates a copy of this @see:PdfDashPattern.
		* @return A copy of this dash pattern.
		*/
		public clone(): PdfDashPattern {
			return new PdfDashPattern(this._dash, this._gap, this._phase);
		}

		/**
		* Determines whether the specified @see:PdfDashPattern instance is equal
		* to the current one.
		*
		* @param value @see:PdfDashPattern to compare.
		* @return true if the specified object is equal to the current one, otherwise false.
		*/
		public equals(value: PdfDashPattern): boolean {
			return ((value instanceof PdfDashPattern)
				&& (this._dash === value.dash)
				&& (this._gap === value.gap)
				&& (this._phase === value.phase));
		}
	}
 

	'use strict';

	/**
	* Represents an abstract class that serves as a base class for all brushes.
	* Instances of any class that derives from this class are used to fill areas and text.
	*
	* This class is not intended to be instantiated in your code. 
	*/
	export class PdfBrush {
		/**
		* Creates a copy of this @see:PdfBrush.
		* @return A copy of this brush.
		*/
		public clone(): PdfBrush {
			throw _Errors.AbstractMethod;
		}

		/**
		* Determines whether the specified @see:PdfBrush instance is equal to the current one.
		*
		* @param value @see:PdfBrush to compare.
		* @return true if the specified object is equal to the current one, otherwise false.
		*/
		public equals(value: PdfBrush): boolean {
			throw _Errors.AbstractMethod;
		}

		/*
		* Gets a native PDFKit's object which represents the brush.
		*
		* @param area Associated @see:PdfPageArea.
		*/
		public _getBrushObject(area: PdfPageArea): any {
			throw _Errors.AbstractMethod;
		}
	}


 

	'use strict';

	/**
	* Represents an object which determines a transition point of a gradient.
	*/
	export class PdfGradientStop {
		private _offset: number;
		private _color: wjcCore.Color;
		private _opacity: number;

		/**
		* Initializes a new instance of the @see:PdfGradientStop class.
		*
		* @param offset The location of the gradient stop on the gradient axis.
		* @param color The color of the gradient stop. A @see:wijmo.Color object or
		* any string acceptable by the @see:wijmo.Color.fromString method.
		* @param opacity The opacity of the gradient stop.
		*/
		constructor(offset?: number, color?: any, opacity?: number) {
			this.offset = offset || 0;
			this.color = color || wjcCore.Color.fromRgba(0, 0, 0);
			this.opacity = opacity == null ? 1 : opacity;
		}

		/**
		* Gets or sets the location of the gradient stop on gradient axis of the brush.
		* The value must be in range [0, 1], where 0 indicates that the gradient stop is
		* placed at the beginning of the gradient axis, while 1 indicates that the 
		* gradient stop is placed at the end of the gradient axis.
		* The default value is 0.
		*/
		public get offset(): number {
			return this._offset;
		}
		public set offset(value: number) {
			this._offset = wjcCore.clamp(wjcCore.asNumber(value, false, true), 0, 1);
		}

		/**
		* Gets or sets the color of the gradient stop.
		* The default color is black.
		*/
		public get color(): wjcCore.Color {
			return this._color;
		}
		public set color(value: wjcCore.Color) { // also accepts string values
			this._color = _asColor(value);
		}

		/**
		* Gets or sets the opacity of the gradient stop.
		* The value must be in range [0, 1], where 0 indicates that the gradient stop is
		* completely transparent, while 1 indicates that the gradient stop is completely
		* opaque. The default value is 1.
		*/
		public get opacity(): number {
			return this._opacity;
		}
		public set opacity(value: number) {
			this._opacity = wjcCore.clamp(wjcCore.asNumber(value, false, true), 0, 1);
		}

		/**
		* Creates a copy of this @see:PdfGradientStop.
		* @return A copy of this gradient stop.
		*/
		public clone(): PdfGradientStop {
			return new PdfGradientStop(this.offset, this.color, this.opacity);
		}

		/**
		* Determines whether the specified @see:PdfGradientStop instance is equal to
		* the current one.
		*
		* @param value @see:PdfGradientStop to compare.
		* @return true if the specified object is equal to the current one, otherwise false.
		*/
		public equals(value: PdfGradientStop): boolean {
			return ((value instanceof PdfGradientStop)
				&& (this._offset === value._offset)
				&& this._color.equals(value._color)
				&& (this._opacity === value._opacity));
		}
	}



	'use strict';

	/**
	* Represents an abstract class that serves as a base class for the 
	* @see:PdfLinearGradientBrush and @see:PdfRadialGradientBrush classes.
	*
	* This class is not intended to be instantiated in your code. 
	*/
	export class PdfGradientBrush extends PdfBrush {
		private _opacity: number;
		private _stops: PdfGradientStop[];

		/**
		* Initializes a new instance of the @see:PdfGradientBrush class.
		*
		* @param stops The @see:PdfGradientStop array to set on this brush.
		* @param opacity The opacity of this brush.
		*/
		constructor(stops?: PdfGradientStop[], opacity?: number) {
			super();

			this.stops = stops || [];
			this.opacity = opacity == null ? 1 : opacity;
		}

		/**
		* Gets or sets the opacity of the brush.
		* The value must be in range [0, 1], where 0 indicates that the brush is
		* completely transparent and 1 indicates that the brush is completely opaque.
		* The default value is 1.
		*/
		public get opacity(): number {
			return this._opacity;
		}
		public set opacity(value: number) {
			this._opacity = wjcCore.clamp(wjcCore.asNumber(value, false, true), 0, 1);
		}

		/**
		* Gets or sets an array of @see:PdfGradientStop objects representing a color, 
		* offset and opacity within the brush's gradient axis.
		* The default value is an empty array.
		*/
		public get stops(): PdfGradientStop[] {
			return this._stops;
		}
		public set stops(value: PdfGradientStop[]) {
			wjcCore.assert(wjcCore.isArray(value), _Errors.InvalidArg('value'));
			this._stops = this._cloneStopsArray(value);
		}

		/**
		* Determines whether the specified @see:PdfGradientBrush instance is equal
		* to the current one.
		*
		* @param value @see:PdfGradientBrush to compare.
		* @return true if the specified object is equal to the current one, otherwise false.
		*/
		public equals(value: PdfGradientBrush): boolean {
			return (value instanceof PdfGradientBrush)
				&& (this._opacity === value.opacity)
				&& _compare(this._stops, value._stops);
		}

		//#region internal, private

		private _cloneStopsArray(value: PdfGradientStop[]): PdfGradientStop[] {
			var res: PdfGradientStop[] = [];

			for (var i = 0; i < value.length; i++) {
				var stop = value[i];
				wjcCore.assert(stop instanceof PdfGradientStop, _Errors.InvalidArg('stops[' + i + ']'));
				res.push(value[i].clone());
			}

			return res;
		}

		//#endregion
	}



	'use strict';

	/**
	* Represents a brush used to fill an area with a linear gradient.
	*/
	export class PdfLinearGradientBrush extends PdfGradientBrush {
		private _x1: number;
		private _y1: number;
		private _x2: number;
		private _y2: number;

		/**
		* Initializes a new instance of the @see:PdfLinearGradientBrush class.
		*
		* @param x1 The X-coordinate of the starting point of the linear gradient.
		* @param y1 The Y-coordinate of the starting point of the linear gradient.
		* @param x2 The X-coordinate of the ending point of the linear gradient.
		* @param y2 The Y-coordinate of the ending point of the linear gradient.
		* @param stops The @see:PdfGradientStop array to set on this brush.
		* @param opacity The opacity of this brush.
		*/
		constructor(x1: number, y1: number, x2: number, y2: number, stops: PdfGradientStop[], opacity?: number) {
			super(stops, opacity)

			this.x1 = x1;
			this.y1 = y1;
			this.x2 = x2;
			this.y2 = y2;
		}

		/**
		* Gets or sets the X-coordinate of the starting point of the linear gradient,
		* in page area coordinates, in points.
		*/
		public get x1(): number {
			return this._x1;
		}
		public set x1(value: number) {
			this._x1 = wjcCore.asNumber(value, false, true);
		}

		/**
		* Gets or sets the Y-coordinate of the starting point of the linear gradient,
		* in page area coordinates, in points.
		*/
		public get y1(): number {
			return this._y1;
		}
		public set y1(value: number) {
			this._y1 = wjcCore.asNumber(value, false, true);
		}

		/**
		* Gets or sets the X-coordinate of the ending point of the linear gradient, 
		* in page area coordinates, in points.
		*/
		public get x2(): number {
			return this._x2;
		}
		public set x2(value: number) {
			this._x2 = wjcCore.asNumber(value, false, true);
		}

		/**
		* Gets or sets the Y-coordinate of the ending point of the linear gradient,
		* in page area coordinates, in points.
		*/
		public get y2(): number {
			return this._y2;
		}
		public set y2(value: number) {
			this._y2 = wjcCore.asNumber(value, false, true);
		}

		//#region overrides

		/**
		* Creates a copy of this @see:PdfLinearGradientBrush.
		* @return A copy of this brush.
		*/
		public clone(): PdfLinearGradientBrush {
			return new PdfLinearGradientBrush(this._x1, this._y1, this._x2, this._y2, this.stops, this.opacity);
		}

		/**
		* Determines whether the specified @see:PdfLinearGradientBrush instance is equal to
		* the current one.
		*
		* @param value @see:PdfLinearGradientBrush to compare.
		* @return true if the specified object is equal to the current one, otherwise false.
		*/
		public equals(value: PdfLinearGradientBrush): boolean {
			return (value instanceof PdfLinearGradientBrush)
				&& (this._x1 === value._x1)
				&& (this._y1 === value._y1)
				&& (this._x2 === value._x2)
				&& (this._y2 === value._y2)
				&& super.equals(value);
		}

		public _getBrushObject(area: PdfPageArea): any {
			var g = (<_IPdfKitDocument>area._pdfdoc._document).linearGradient(
				this._x1 + area._offset.x,
				this._y1 + area._offset.y,
				this._x2 + area._offset.x,
				this._y2 + area._offset.y),
				stops = this.stops;


			for (var i = 0; i < stops.length; i++) {
				var s = stops[i];

				if (s) {
					g.stop(s.offset, [s.color.r, s.color.g, s.color.b], s.color.a);
				}
			}

			return g;
		}

		//#endregion
	}



	'use strict';

	/**
	* Represents a brush used to fill an area with a radial gradient.
	*/
	export class PdfRadialGradientBrush extends PdfGradientBrush {
		private _x1: number;
		private _y1: number;
		private _r1: number;

		private _x2: number;
		private _y2: number;
		private _r2: number;

		/**
		* Initializes a new instance of the @see:PdfRadialGradientBrush class.
		*
		* @param x1 The X-coordinate of the inner circle's center of the radial gradient.
		* @param y1 The Y-coordinate of the inner circle's center of the radial gradient.
		* @param r1 The radius of the inner circle of the radial gradient.
		* @param x2 The X-coordinate of the outer circle's center of the radial gradient.
		* @param y2 The Y-coordinate of the outer circle's center of the radial gradient.
		* @param r2 The radius of the outer circle of the radial gradient.
		* @param stops The @see:PdfGradientStop array to set on this brush.
		* @param opacity The opacity of this brush.
		*/
		constructor(x1: number, y1: number, r1: number, x2: number, y2: number, r2: number, stops: PdfGradientStop[], opacity?: number) {
			super(stops, opacity)

			this.x1 = x1;
			this.y1 = y1;
			this.r1 = r1;

			this.x2 = x2;
			this.y2 = y2;
			this.r2 = r2;
		}

		//#region inner point

		/**
		* Gets or sets the X-coordinate of the inner circle's center that represents the
		* starting point of the radial gradient, in page area coordinates, in points.
		*/
		public get x1(): number {
			return this._x1;
		}
		public set x1(value: number) {
			this._x1 = wjcCore.asNumber(value, false, true);
		}

		/**
		* Gets or sets the Y-coordinate of the inner circle's center that represents the 
		* starting point of the radial gradient, in page area coordinates, in points.
		*/
		public get y1(): number {
			return this._y1;
		}
		public set y1(value: number) {
			this._y1 = wjcCore.asNumber(value, false, true);
		}

		/**
		* Gets or sets the radius of the inner circle that represents the starting 
		* point of the radial gradient, in page area coordinates, in points.
		*/
		public set r1(value: number) {
			this._r1 = wjcCore.asNumber(value, false, true);
		}
		public get r1(): number {
			return this._r1;
		}

		//#endregion

		//#region outer point

		/**
		* Gets or sets the X-coordinate of the outer circle's center that represents the ending point of the radial gradient, in page area coordinates, in points.
		*/
		public get x2(): number {
			return this._x2;
		}
		public set x2(value: number) {
			this._x2 = wjcCore.asNumber(value, false, true);
		}

		/**
		* Gets or sets the Y-coordinate of the outer circle's center that represents
		* the ending point of the radial gradient, in page area coordinates, in points.
		*/
		public get y2(): number {
			return this._y2;
		}
		public set y2(value: number) {
			this._y2 = wjcCore.asNumber(value, false, true);
		}

		/**
		* Gets or sets the radius of the outer circle that represents the ending point of the
		* radial gradient, in page area coordinates, in points.
		*/
		public get r2(): number {
			return this._r2;
		}
		public set r2(value: number) {
			this._r2 = wjcCore.asNumber(value, false, true);
		}

		//#endregion

		//#region overrides

		/**
		* Creates a copy of this @see:PdfRadialGradientBrush.
		* @return A copy of this brush.
		*/
		public clone(): PdfRadialGradientBrush {
			return new PdfRadialGradientBrush(this._x1, this._y1, this._r1, this._x2, this._y2, this._r2, this.stops, this.opacity);
		}

		/**
		* Determines whether the specified @see:PdfRadialGradientBrush instance is equal
		* to the current one.
		*
		* @param value @see:PdfRadialGradientBrush to compare.
		* @return true if the specified object is equal to the current one, otherwise false.
		*/
		public equals(value: PdfRadialGradientBrush): boolean {
			return (value instanceof PdfRadialGradientBrush)
				&& (this._x1 === value._x1)
				&& (this._y1 === value._y1)
				&& (this._r1 === value._r1)
				&& (this._x2 === value._x2)
				&& (this._y2 === value._y2)
				&& (this._r2 === value._r2)
				&& super.equals(value);
		}

		public _getBrushObject(area: PdfPageArea): any {
			var g = (<_IPdfKitDocument>area._pdfdoc._document).radialGradient(
				this._x1 + area._offset.x,
				this._y2 + area._offset.y,
				this._r1,
				this._x2 + area._offset.x,
				this._y2 + area._offset.y,
				this._r2),
				stops = this.stops;

			for (var i = 0; i < stops.length; i++) {
				var s = stops[i];

				if (s) {
					g.stop(s.offset, [s.color.r, s.color.g, s.color.b], s.color.a);
				}
			}

			return g;
		}

		//#endregion
	}



	'use strict';

	/**
	* Represents a brush used to fill an area with a color.
	*/
	export class PdfSolidBrush extends PdfBrush {
		private _color: wjcCore.Color;

		/**
		* Initializes a new instance of the @see:PdfSolidBrush class.
		*
		* @param color The color of this brush. A @see:wijmo.Color object or any string
		* acceptable by the @see:wijmo.Color.fromString method.
		*/
		constructor(color?: any) { // color: string | Color
			super();
			this.color = color || wjcCore.Color.fromRgba(0, 0, 0);
		}

		/**
		* Gets or sets the color of the brush.
		* The default color is black.
		*/
		public get color(): wjcCore.Color {
			return this._color;
		}
		public set color(value: wjcCore.Color) { // also accepts string values
			this._color = _asColor(value);
		}

		//#region overrides

		/**
		* Creates a copy of this @see:PdfSolidBrush.
		* @return A copy of this brush.
		*/
		public clone(): PdfSolidBrush {
			return new PdfSolidBrush(this._color);
		}

		/**
		* Determines whether the specified @see:PdfSolidBrush instance is equal
		* to the current one.
		*
		* @param value @see:PdfSolidBrush to compare.
		* @return true if the specified object is equal to the current one, otherwise false.
		*/
		public equals(value: PdfSolidBrush): boolean {
			return ((value instanceof PdfSolidBrush)
				&& this._color.equals(value._color));
		}

		//#endregion

		public _getBrushObject(area: PdfPageArea): wjcCore.Color {
			// Using the non-native Color here because PDFKit doesn't has an appropriate structure that can represent a color with opacity. The PdfDocument's _setBrush and _setPen methods must take it into account.
			return this._color;
		}
	}



	'use strict';

	/**
	 * Determines an object used to stroke paths and text.
	 */
	export class PdfPen {
		private _color: wjcCore.Color;
		private _brush: PdfBrush;
		private _width: number;
		private _cap: PdfLineCapStyle;
		private _join: PdfLineJoinStyle;
		private _miterLimit: number;
		private _dashPattern: PdfDashPattern;

		/**
		* Initializes a new instance of the @see:PdfPen class with the specified color or
		* brush or JavaScript object.
		*
		* The first argument can accept the following values:
		* <ul>
		*  <li>@see:wijmo.Color object or any string acceptable by the @see:wijmo.Color.fromString method.</li>
		*  <li>@see:PdfBrush object.</li>
		*  <li>JavaScript object containing initialization properties (all other arguments are ignored).</li>
		* </ul>
		*
		* @param colorOrBrushOrOptions The color or brush or JavaScript object to use.
		* @param width The width to use.
		* @param dashPattern The dash pattern to use.
		* @param cap The line cap style to use.
		* @param join The line join style to use.
		* @param miterLimit The miter limit to use.
		*/
		constructor(colorOrBrushOrOptions?: any, width?: number, dashPattern?: PdfDashPattern, cap?: PdfLineCapStyle, join?: PdfLineJoinStyle, miterLimit?: number) {
			// Default arguments values are taken from the PDF Reference 1.7, chapter 4.3, 'Device-independent graphics state parameters'.
			if (colorOrBrushOrOptions == null) {
				colorOrBrushOrOptions = wjcCore.Color.fromRgba(0, 0, 0);
			}

			if (width == null) {
				width = 1;
			}

			if (dashPattern == null) {
				dashPattern = new PdfDashPattern(null, null, 0);
			}

			if (cap == null) {
				cap = PdfLineCapStyle.Butt;
			}

			if (join == null) {
				join = PdfLineJoinStyle.Miter;
			}

			if (miterLimit == null) {
				miterLimit = 10;
			}

			if (wjcCore.isObject(colorOrBrushOrOptions) && !(colorOrBrushOrOptions instanceof wjcCore.Color) && !(colorOrBrushOrOptions instanceof PdfBrush)) {
				var foo = <PdfPen>colorOrBrushOrOptions;

				this.color = foo.color;
				this.brush = foo.brush;
				this.width = foo.width != null ? foo.width : width;
				this.cap = foo.cap != null ? foo.cap : cap;
				this.join = foo.join != null ? foo.join : join;
				this.miterLimit = foo.miterLimit != null ? foo.miterLimit : miterLimit
				this.dashPattern = foo.dashPattern || dashPattern;
			} else {
				if (colorOrBrushOrOptions instanceof PdfBrush) {
					this.brush = colorOrBrushOrOptions;
				} else {
					this.color = colorOrBrushOrOptions;
				}

				this.width = width;
				this.cap = cap;
				this.join = join;
				this.miterLimit = miterLimit
				this.dashPattern = dashPattern;
			}

			this._color = this._color || wjcCore.Color.fromRgba(0, 0, 0);
		}

		/**
		* Gets or sets the color used to stroke paths.
		* The default color is black.
		*/
		public get color(): wjcCore.Color {
			return this._color;
		}
		public set color(value: wjcCore.Color) { // also accepts string values
			this._color = _asColor(value);
		}

		/**
		* Gets or sets the brush used to stroke paths.
		* Takes precedence over the @see:color property, if defined.
		*/
		public get brush(): PdfBrush {
			return this._brush;
		}
		public set brush(value: PdfBrush) {
			value = _asPdfBrush(value, true);
			this._brush = value ? value.clone() : null;
		}

		/**
		* Gets or sets the line width used to stroke paths, in points.
		* The default width is 1.
		*/
		public get width(): number {
			return this._width;
		}
		public set width(value: number) {
			this._width = wjcCore.asNumber(value, false, true);
		}

		/**
		* Gets or sets the shape that shall be used at the open ends of a stroked path.
		* The default value is <b>Butt</b>.
		*/
		public get cap(): PdfLineCapStyle {
			return this._cap;
		}
		public set cap(value: PdfLineCapStyle) {
			this._cap = wjcCore.asEnum(value, PdfLineCapStyle);
		}

		/**
		* Gets or sets the shape to be used at the corners of a stroked path.
		* The default value is <b>Miter</b>.
		*/
		public get join(): PdfLineJoinStyle {
			return this._join;
		}
		public set join(value: PdfLineJoinStyle) {
			this._join = wjcCore.asEnum(value, PdfLineJoinStyle);
		}

		/**
		* Determines the maximum value of the miter length to the line width ratio, when the line
		* join is converted from miter to bevel.
		* The default value is 10.
		*/
		public get miterLimit(): number {
			return this._miterLimit;
		}
		public set miterLimit(value: number) {
			this._miterLimit = wjcCore.asNumber(value, false, true);
		}

		/**
		* Gets the dash pattern used to stroke paths.
		* The default value is a solid line.
		*/
		public get dashPattern(): PdfDashPattern {
			return this._dashPattern;
		}
		public set dashPattern(value: PdfDashPattern) {
			wjcCore.assert(value instanceof PdfDashPattern, _Errors.InvalidArg('value'));
			this._dashPattern = value.clone();
		}

		/**
		* Creates a copy of this @see:PdfPen.
		* @return A copy of this pen.
		*/
		public clone(): PdfPen {
			var pen = new PdfPen(this._color, this._width, this._dashPattern, this._cap, this._join, this._miterLimit);
			pen.brush = this._brush;
			return pen;
		}

		/**
		* Determines whether the specified @see:PdfPen instance is equal to the current one.
		*
		* @param value @see:PdfPen to compare.
		* @return true if the specified object is equal to the current one, otherwise false.
		*/
		public equals(value: PdfPen): boolean {
			return ((value instanceof PdfPen)
				&& this._color.equals(value._color)
				&& (this._brush ? this._brush.equals(value._brush) : this._brush === value._brush)
				&& (this._width === value._width)
				&& (this._cap === value._cap)
				&& (this._join === value._join)
				&& (this._miterLimit === value._miterLimit)
				&& this._dashPattern.equals(value._dashPattern));
		}
	}
 

	'use strict';

	/**
	 * Represents a font.
	 */
	export class PdfFont {
		public static _DEF_NATIVE_NAME = 'Times-Roman';
		public static _DEF_FAMILY_NAME = 'times';

		public static _KNOWN_WEIGHTS = {
			'normal': 1, 'bold': 1, '100': 1, '200': 1, '300': 1, '400': 1, '500': 1, '600': 1, '700': 1, '800': 1, '900': 1
		};
		public static _KNOWN_STYLES = {
			'normal': 1, 'italic': 1, 'oblique': 1
		};

		public static _DEF_PDFKIT_FONT = new PdfFont('helvetica', 12);
		public static _DEF_FONT = new PdfFont();

		private _family: string;
		private _size: number;
		private _style: string;
		private _weight: string;

		/**
		* Initializes a new instance of the @see:PdfFont class.
		*
		* @param family The family name of the font.
		* @param size The size of the font.
		* @param style The style of the font.
		* @param weight The weight of the font.
		*/
		constructor(family = 'times', size = 10, style = 'normal', weight = 'normal') {
			this.family = family;
			this.size = size;
			this.style = style;
			this.weight = weight;
		}

		/**
		* Gets or sets the family name of the font.
		*
		* The list of the font family names in the order of preferences,
		* separated by commas. Each font family name can be the one that
		* was registered using the @see:PdfDocument.registerFont method or
		* the name of one of the PDF standard font families: 'courier',
		* 'helvetica', 'symbol', 'times', 'zapfdingbats' or the superfamily
		* name: 'cursive', 'fantasy', 'monospace', 'serif', 'sans-serif'.
		*/
		public get family(): string {
			return this._family;
		}
		public set family(value: string) {
			this._family = wjcCore.asString(value, false);
		}

		/**
		* Gets or sets the size of the font.
		*/
		public get size(): number {
			return this._size;
		}
		public set size(value: number) {
			this._size = wjcCore.asNumber(value, false, true);
		}

		/**
		 * Gets or sets the style of the font.
		 *
		 * The following values are supported: 'normal', 'italic', 'oblique'.
		 */
		public get style(): string {
			return this._style;
		}
		public set style(value: string) {
			value = wjcCore.asString(value, false);

			if (value) {
				wjcCore.assert(!!PdfFont._KNOWN_STYLES[(value || '').toLowerCase()], _Errors.InvalidArg('value'));
			}

			this._style = value;
		}

		/**
		 * Gets or sets the weight of the font.
		 *
		 * The following values are supported: 'normal', 'bold', '100', '200', '300',
		 * '400', '500', '600', '700', '800', '900'.
		 */
		public get weight(): string {
			return this._weight;
		}
		public set weight(value: string) {
			value = wjcCore.asString(value, false);

			if (value) {
				wjcCore.assert(!!PdfFont._KNOWN_WEIGHTS[(value || '').toLowerCase()], _Errors.InvalidArg('value'));
			}

			this._weight = value;
		}

		/**
		* Creates a copy of this @see:PdfFont.
		* @return A copy of this font.
		*/
		clone(): PdfFont {
			return new PdfFont(this.family, this.size, this.style, this.weight);
		}

		/**
		* Determines whether the specified @see:PdfFont instance is equal to the current one.
		*
		* @param value @see:PdfFont to compare.
		* @return true if the specified object is equal to the current one, otherwise false.
		*/
		equals(value: PdfFont): boolean {
			return (value instanceof PdfFont)
				&& (this._family === value._family)
				&& (this._size === value._size)
				&& (this._style === value._style)
				&& (this._weight === value._weight);
		}
	}



	'use strict';

	interface _IPdfFontWeightDescription {
		[index: number]: string; // <weight>: <PDFKit's internal name to use>
	}

	interface _IPdfFontDescription {
		attributes: IPdfFontAttributes;
		normal?: _IPdfFontWeightDescription;
		italic?: _IPdfFontWeightDescription;
		oblique?: _IPdfFontWeightDescription
	}

	interface _IPdfNormalizedFontSelector {
		name: string;
		style: string;
		weight: number;
	}

	class _OrderedDictionary<T> {
		private _values: { key: string; value: T }[] = [];
		private _keys: { [key: string]: number } = {};

		constructor(values?: { key: string; value: T }[]) {
			if (values) {
				for (var i = 0; i < values.length; i++) {
					var val = values[i];

					this._keys[val.key] = i;
					this._values.push({ key: val.key, value: val.value });
				}
			}
		}

		public hasKey(key: string): T {
			var idx = this._keys[key];

			if (idx !== undefined) {
				return this._values[idx].value;
			}

			return null;
		}

		public add(key: string, value: T): T {
			if (!this.hasKey(key)) {
				this._keys[key] = this._values.length;
				this._values.push({ key: key, value: value });
				return value;
			}

			return null;
		}

		public each(fn: (key: string, value: T) => any): void {
			if (fn) {
				for (var i = 0; i < this._values.length; i++) {
					var val = this._values[i];

					if (fn(val.key, val.value) === false) {
						break;
					}
				}
			}
		}

		public eachReverse(fn: (key: string, value: T) => any): void {
			if (fn) {
				for (var i = this._values.length - 1; i >= 0; i--) {
					var val = this._values[i];

					if (fn(val.key, val.value) === false) {
						break;
					}
				}
			}
		}
	}

	/* Provides font registration functionality. */
	export class _PdfFontRegistrar {
		// standard fonts, starting from the specific one
		private _fonts = new _OrderedDictionary<_IPdfFontDescription>([
			{
				key: 'zapfdingbats',
				value: {
					attributes: {
						fantasy: true
					},
					normal: {
						400: 'ZapfDingbats'
					}
				}
			},
			{
				key: 'symbol',
				value: {
					attributes: {
						serif: true
					},
					normal: {
						400: 'Symbol'
					}
				}
			},
			{
				key: 'courier',
				value: {
					attributes: {
						serif: true,
						monospace: true
					},
					normal: {
						400: 'Courier',
						700: 'Courier-Bold'
					},
					oblique: {
						400: 'Courier-Oblique',
						700: 'Courier-BoldOblique'
					}
				}
			},
			{
				key: 'helvetica',
				value: {
					attributes: {
						sansSerif: true
					},
					normal: {
						400: 'Helvetica',
						700: 'Helvetica-Bold'
					},
					oblique: {
						400: 'Helvetica-Oblique',
						700: 'Helvetica-BoldOblique'
					}
				}
			},
			{
				key: 'times',
				value: {
					attributes: {
						serif: true
					},
					normal: {
						400: 'Times-Roman',
						700: 'Times-Bold'
					},
					italic: {
						400: 'Times-Italic',
						700: 'Times-BoldItalic'
					}
				}
			}
		]);

		private _weightNameToNum = {
			'normal': 400,
			'bold': 700
		};

		private _doc: _IPdfKitDocument;
		private _findFontCache: { [uid: string]: string } = {};
		private _internalFontNames: { [key: string]: any; } = {}; // stores all internal names of the registered fonts.

		/*
		 * Initializes a new instance of the @see:_PdfFontRegistrar class.
		 *
		 * @param doc A PDFDocument object.
		 */
		constructor(doc: any) {
			this._doc = doc;

			// fill _internalFontNames
			this._fonts.each((key, value) => {
				var facesIterator = (descr: _IPdfFontWeightDescription) => {
					for (var key in descr) {
						this._internalFontNames[descr[key]] = 1;
					}
				};

				facesIterator(value.normal) || facesIterator(value.italic) || facesIterator(value.oblique);
			});
		}

		/*
		 * Registers a font from ArrayBuffer.
		 *
		 * @param font A font to register.
		 *
		 * @return A PDFKit internal font name.
		 */
		public registerFont(font: IPdfFontFile): string {
			wjcCore.assert(!!font, _Errors.ValueCannotBeEmpty('font'));
			wjcCore.asString(font.name);
			wjcCore.assert(font.source instanceof ArrayBuffer, _Errors.FontSourceMustBeArrayBuffer);

			font = _shallowCopy(font);

			var ns = this._normalizeFontSelector(font.name, font.style, font.weight),
				fntDscr = this._fonts.hasKey(ns.name);

			if (!fntDscr) {
				fntDscr = this._fonts.add(ns.name, { attributes: <IPdfFontAttributes>font });
			}

			var face = fntDscr[ns.style];
			if (!face) {
				face = fntDscr[ns.style] = {};
			}

			var internalName = this._makeInternalName(ns);

			if (!face[ns.weight]) {
				this._doc.registerFont(internalName, font.source, font.family);
				this._findFontCache = {};
				face[ns.weight] = internalName;
				this._internalFontNames[internalName] = 1;
			}

			return internalName;
		}

		/*
		 * Finds the closest registered font for a given font name, style and weight.
		 *		
		 * If exact font with given style and weight properties is not found then,
		 * it tries to search the closest font using font weight fallback 
		 * (https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight).
		 * If still nothing is found, it tries to find the closest font with other style in 
		 * the following order:
		 * 'italic': 'oblique', 'normal'.
		 * 'oblique': 'italic', 'normal'.
		 * 'normal': 'oblique', 'italic'.
		 *
		 * @param name The name of the font that was registered before using the @see:registerFont
		 * or the name of one of the PDF standard fonts: 'courier', 'helvetica', 'symbol', 'times',
		 * 'zapfdingbats', or the superfamily name: 'cursive', 'fantasy', 'monospace', 'serif',
		 * 'sans-serif'.
		 * @param style The style of the font. One of the following values: 'normal',
		 * 'italic', 'oblique'.
		 * @param weight The weight of the font. One of the following values: 'normal',
		 * 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'.
		 * @return A PDFKit internal font name or null.
		 */
		public findFont(name: string, style?: string, weight?: string): string {
			var ns = this._normalizeFontSelector(name, style, weight),
				internalName = this._makeInternalName(ns);

			if (this._findFontCache[internalName]) {
				return this._findFontCache[internalName];
			}

			ns.name += ',' + PdfFont._DEF_FAMILY_NAME; // Try to use the default font family with the same style and weight if specifed font will not be found.

			for (var i = 0, names = ns.name.split(','); i < names.length; i++) {
				var tmp = this._findFont(names[i].replace(/["']/g, '').trim(), ns.style, ns.weight);
				if (tmp) {
					return this._findFontCache[internalName] = tmp;
				}
			}

			return this._findFontCache[internalName] = this._internalFontNames[name]
				? name
				: PdfFont._DEF_NATIVE_NAME; // use default name if closest font can not be found
		}

		private _normalizeFontSelector(name: string, style?: string, weight?: string): _IPdfNormalizedFontSelector {
			return {
				name: (name || '').toLowerCase(),
				style: (style || PdfFont._DEF_FONT.style).toLowerCase(),
				weight: parseInt(this._weightNameToNum[weight] || weight) || parseInt(this._weightNameToNum[PdfFont._DEF_FONT.weight])
			}
		}

		private _findFont(name: string, style?: string, weight?: number): string {
			var facesToTest: string[] = [],
				res: string;

			switch (style) {
				// setup fallback font styles
				case 'italic':
					facesToTest = ['italic', 'oblique', 'normal'];
					break;
				case 'oblique':
					facesToTest = ['oblique', 'italic', 'normal'];
					break;
				default:
					facesToTest = ['normal', 'oblique', 'italic'];
					break;
			}

			switch (name) {
				case 'cursive':
				case 'fantasy':
				case 'monospace':
				case 'serif':
				case 'sans-serif':
					// try to find closest font within the given font superfamily using font-weight and font-style fallbacks if necessary.
					this._fonts.eachReverse((key, font) => { // try custom fonts first
						var propName = (name === 'sans-serif') ? 'sansSerif' : name;

						if (font.attributes[propName]) {
							for (var i = 0; i < facesToTest.length; i++) {
								res = this._findFontWeightFallback(key, facesToTest[i], weight);
								if (res) {
									return false; // break the loop
								}
							}
						}
					});
					break;

				default:
					if (this._fonts.hasKey(name)) {
						// try to find closest font within the given font family (name) using font-weight and font-style fallbacks if necessary.
						for (var i = 0; i < facesToTest.length && !res; i++) {
							res = this._findFontWeightFallback(name, facesToTest[i], weight);
						}
					}
			}

			return res;
		}

		private _findFontWeightFallback(name: string, style: string, weight: number, availableWeights?: number[]): string {
			var font = this._fonts.hasKey(name);

			if (font && font[style]) {
				var weights = font[style];

				if (weights[weight]) {
					return weights[weight];
				} else {
					// font-weight fallback (https://www.w3.org/TR/2016/WD-CSS22-20160412/fonts.html#font-boldness)

					if (!availableWeights) {
						availableWeights = [];

						for (var key in weights) {
                            availableWeights.push(parseFloat(key));
						}

						availableWeights.sort((a, b) => { return a - b; });
					}

					if (weight > 500) { // the closest available darker weight is used (or, if there is none, the closest available lighter weight).
						var less = 0;

						for (var i = 0; i < availableWeights.length; i++) {
							var cur = availableWeights[i];

							if (cur > weight) {
								return weights[cur];
							} else {
								less = cur;
							}
						}

						if (less) {
							return weights[less];
						}
					} else {
						if (weight < 400) { // the closest available lighter weight is used (or, if there is none, the closest available darker weight).
							var greater = 0;

							for (var i = availableWeights.length - 1; i >= 0; i--) {
								var cur = availableWeights[i];

								if (cur < weight) {
									return weights[cur];
								} else {
									greater = cur;
								}
							}

							if (greater) {
								return weights[greater];
							}
						} else {
							if (weight == 400) { // If the desired weight is 400...
								if (weights[500]) { // ...500 is checked first
									return weights[500]
								} else { // ...and then the rule for desired weights less than 400 is used
									return this._findFontWeightFallback(name, style, 300, availableWeights);
								}
							} else { // If the desired weight is 500...
								if (weights[400]) { // ...400 is checked first
									return weights[400]
								} else { // ...and then the rule for desired weights less than 400 is used.
									return this._findFontWeightFallback(name, style, 300, availableWeights);
								}
							}
						}
					}
				}
			}

			return null;
		}

		private _makeInternalName(ns: _IPdfNormalizedFontSelector): string {
			return ns.name + '-' + ns.style + '-' + ns.weight;
		}
	}



	'use strict';

	/**
	* Represents an area of a page with its own coordinate system, where (0, 0) points 
	* to the top-left corner.
	* Provides methods for drawing text, images, paths and transformations.
	*
	* This class is not intended to be instantiated in your code. 
	*/
	export class PdfPageArea {
		public _pdfdoc: PdfDocument;
		public _offset: wjcCore.Point; // upper-left corner in absolute coordinates.
		private _graphics: PdfPaths;
		private _drawingText: boolean;

		private _ctxProps: _IPdfTextFlowCtxState = {
			xo: 0,
			yo: 0,
			lineGap: 0
		};

		/**
		* Initializes a new instance of the @see:PdfRunningTitle class.
		*/
		constructor() {
		}

		//#region public properties

		/**
		* Gets or sets the X-coordinate (in points) of the current point in the text flow 
		* used to draw a text or an image.
		*/
		public get x(): number {
			this._switchCtx();
			var x = (<_IPdfKitDocument>this._pdfdoc._document).x - this._offset.x;
			this._saveCtx();
			return x;
		}
		public set x(value: number) {
			value = wjcCore.asNumber(value);

			this._switchCtx();
			(<_IPdfKitDocument>this._pdfdoc._document).x = value + this._offset.x;
			this._saveCtx();
		}

		/**
		* Gets or sets the Y-coordinate (in points) of the current point in the text flow 
		* used to draw a text or an image.
		*/
		public get y(): number {
			this._switchCtx();
			var y = (<_IPdfKitDocument>this._pdfdoc._document).y - this._offset.y;
			this._saveCtx();
			return y;
		}
		public set y(value: number) {
			value = wjcCore.asNumber(value);

			this._switchCtx();
			(<_IPdfKitDocument>this._pdfdoc._document).y = value + this._offset.y;
			this._saveCtx();
		}

		/**
		* Gets or sets the spacing between each line of text, in points.
		*
		* The default value is 0.
		*/
		public get lineGap(): number {
			return this._ctxProps.lineGap;
		}
		public set lineGap(value: number) {
			this._ctxProps.lineGap = value = wjcCore.asNumber(value, false, true);

			if (this._pdfdoc && this._pdfdoc._document) {
				this._switchCtx();
				(<_IPdfKitDocument>this._pdfdoc._document).lineGap(value);
				this._saveCtx();
			}
		}

		/**
		* Gets the height of the area, in points.
		*/
		public get height(): number {
			var page = (<_IPdfKitDocument>this._pdfdoc._document).page;
			return Math.max(0, page.height - page.margins.top - page.margins.bottom); // header and footer are placed inside the native margins.
		}

		/**
		* Gets the width of the area, in points.
		*/
		public get width(): number {
			var page = (<_IPdfKitDocument>this._pdfdoc._document).page;
			return Math.max(page.width - page.margins.left - page.margins.right);
		}

		/**
		* Gets an object that provides ability to draw paths.
		*/
		public get paths(): PdfPaths {
			return this._graphics;
		}

		//#endregion

		//#region public methods

		/**
		* Draws a string with the given options and returns the measurement information.
		*
		* If <b>options.pen</b>, <b>options.brush</b> or <b>options.font</b> are omitted,
        * the current document's pen, brush or font are used (see @see:PdfDocument.setPen,
        * @see:PdfDocument.setBrush, and  @see:PdfDocument.setFont).
		*
		* The string is drawn within the rectangular area for which top-left corner, width
        * and  height are defined by the x, y, <b>options.width</b> and <b>options.height</b>
        * values. If x and y are not provided, the @see:PdfDocument.x and @see:PdfDocument.y
        * properties are used instead.
		*
		* The text is wrapped and clipped automatically within the area.
		* If <b>options.height</b> is not provided and the text exceeds the bottom body edge,
		* then a new page will be added to accommodate the text.
		*
		* Finally, the method updates the value of the @see:PdfDocument.x and @see:PdfDocument.y
        * properties. Hence, any subsequent text or image starts below this point
		* (depending on the value of <b>options.continued</b>).
		*
		* The measurement result doesn't reflect the fact that text can be split into
		* multiple pages or columns; the text is treated as a single block.
		*
		* @param text The text to draw.
		* @param x The X-coordinate of the point to draw the text at, in points.
		* @param y The Y-coordinate of the point to draw the text at, in points.
		* @param options Determines the text drawing options.
		* @return A @see:IPdfTextMeasurementInfo object determines the measurement information.
		*/
		public drawText(text: string, x?: number, y?: number, options?: IPdfTextDrawSettings): IPdfTextMeasurementInfo {
			this._assertPathStarted();

			if (!(text = wjcCore.asString(text))) {
				return;
			}

			options = options || {};

			var doc = this._pdfdoc,
				natDoc = <_IPdfKitDocument>doc._document,
				sz: _IPdfKitTextSize,
				drawMode = options.stroke && options.fill ? 2 : options.stroke ? 1 : 0; //  0 = fill, 1 = stroke, 2 = fillAndStroke.

			if ((options.strike || options.underline) && !options.stroke) { // to draw a line PdfKit changes strokeColor to fillColor
				drawMode = 2;
			}

			this._switchCtx();

			try {
				this._drawingText = true;

				if (!(drawMode & 1)) { // fill | fillAndStroke
					doc._toggleBrush(_asPdfBrush(options.brush));
				}

				if (drawMode & 3) { // stroke | fillAndStroke
					doc._togglePen(_asPdfPen(options.pen));
				}

				doc._toggleFont(_asPdfFont(options.font));

				var native = this._textOptionsToNative(options),
					baselineOffset = options._baseline === _PdfTextBaseline.Alphabetic ? natDoc.currentFontAscender() : 0;

				if (x == null) {
					natDoc.y -= baselineOffset;
					sz = natDoc.textAndMeasure(text, null, null, native);
				} else {
					sz = natDoc.textAndMeasure(text, wjcCore.asNumber(x) + this._offset.x, wjcCore.asNumber(y) + this._offset.y - baselineOffset, native);
				}
			} finally {
				this._drawingText = false;
				this._saveCtx();
			}

			return {
				charCount: sz.charCount || 0,
				size: new wjcCore.Size(sz.width || 0, sz.height || 0)
			};
		}

		/**
		* Draws an image in JPG or PNG format with the given options.
		*
		* If x and y are not defined, then @see:x and @see:y are used instead.
		*
		* Finally, if the image was drawn in the text flow, the method updates @see:y. 
		* Hence, any subsequent text or image starts below this point.
		*
		* @param url A string containing the URL to get the image from or the data URI containing a base64 encoded image.
		* @param x The x-coordinate of the point to draw the image at, in points.
		* @param y The y-coordinate of the point to draw the image at, in points.
		* @param options Determines the image drawing options.
		* @return The @see:PdfPageArea object.
		*/
		public drawImage(url: string, x?: number, y?: number, options?: IPdfImageDrawSettings): PdfPageArea {
			this._assertPathStarted();

			if (!(url = wjcCore.asString(url))) {
				return this;
			}

			var dataUrl = _PdfImageHelper.getDataUri(url);

			this._switchCtx();
			try {
				var o: _IPdfKitImageOptions = {};

				if (options) {
					switch (wjcCore.asEnum(options.align, PdfImageHorizontalAlign, true)) {
						case PdfImageHorizontalAlign.Center:
							o.align = 'center';
							break;
						case PdfImageHorizontalAlign.Right:
							o.align = 'right';
							break;
						default:
							o.align = 'left';
					}

					switch (wjcCore.asEnum(options.vAlign, PdfImageVerticalAlign, true)) {
						case PdfImageVerticalAlign.Center:
							o.valign = 'center';
							break;
						case PdfImageVerticalAlign.Bottom:
							o.valign = 'bottom';
							break;
						default:
							o.valign = 'top';
					}

					var width = wjcCore.asNumber(options.width, true, true),
						height = wjcCore.asNumber(options.height, true, true);

					if (width && height && wjcCore.asBoolean(options.stretchProportionally, true)) {
						o.fit = [width, height];
					} else {
						o.width = width;
						o.height = height;
					}
				}

				if (x == null) {
					(<_IPdfKitDocument>this._pdfdoc._document).image(dataUrl, o);
				} else {
					(<_IPdfKitDocument>this._pdfdoc._document).image(dataUrl, wjcCore.asNumber(x) + this._offset.x, wjcCore.asNumber(y) + this._offset.y, o);
				}
			} finally {
				this._saveCtx();
			}

			return this;
		}

		/**
		* Draws a SVG image with the given options.
		*
		* If x and y are not defined, then @see:x and @see:y are used instead.
		*
		* The method uses the values of the width and height attributes of the outermost svg element to determine the
		* scale factor according to the options.width and options.height properties. If any of these attributes are
		* omitted then scaling is not performed and the image will be rendered in its original size.
		*
		* Finally, if the image was drawn in the text flow, the method updates @see:y.
		* Hence, any subsequent text or image starts below this point.
		* The increment value is defined by the options.height property or by the outermost svg element's height attribute, which comes first.
		* If none of them is provided then @see:y will stay unchanged.
		*
		* The method supports a limited set of SVG features and provided primarily for rendering wijmo 5 chart controls. 
		*
		* @param url A string containing the URL to get the SVG image from or the data URI containing a base64 encoded SVG image.
		* @param x The x-coordinate of the point to draw the image at, in points.
		* @param y The y-coordinate of the point to draw the image at, in points.
		* @param options Determines the SVG image drawing options.
		* @return The @see:PdfPageArea object.
		*/
		public drawSvg(url: string, x?: number, y?: number, options?: IPdfSvgDrawSettings): PdfPageArea {
			var base64Decode = (value: string) => {
				// return atob(value); // Unicode-unfriendly.

				// https://developer.mozilla.org/ru/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
				return decodeURIComponent(Array.prototype.map.call(atob(value), function (c) {
					return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
				}).join(''));
			}

			options = options || {};

			this._assertPathStarted();

			if (!(url = wjcCore.asString(url))) {
				return this;
			}

			var svg: string;

			if (url.indexOf('data:image/svg') >= 0) {
				svg = base64Decode(url.substring(url.indexOf(',') + 1));
			} else {
				var xhrError: string;
				svg = _XhrHelper.text(url, xhr => xhrError = xhr.statusText);
				wjcCore.assert(xhrError == null, xhrError);
			}

			if (!svg) {
				return this;
			}

			var renderer = new _SvgRenderer(svg, this, <(url: string) => string>wjcCore.asFunction(options.urlResolver)),
				textFlow = (y == null),
				x = x != null ? x : this.x,
				y = y != null ? y : this.y,
				oldY = this.y,
				oldX = this.x,
				scaleX: number,
				scaleY: number,
				optWidth = wjcCore.asNumber(options.width, true, true),
				optHeight = wjcCore.asNumber(options.height, true, true),
				svgWidth = renderer.root.width.hasVal ? renderer.root.width.val : undefined,
				svgHeight = renderer.root.height.hasVal ? renderer.root.height.val : undefined;

			// scale factor
			if ((optWidth || optHeight) && (svgWidth && svgHeight)) {
				// can be NaN if width or height is undefined
				scaleX = optWidth / svgWidth;
				scaleY = optHeight / svgHeight;

				if (optWidth && optHeight) {
					if (options.stretchProportionally) {
						var scaleMin = Math.min(scaleX, scaleY);

						if (scaleX === scaleMin) {
							switch (wjcCore.asEnum(options.vAlign, PdfImageVerticalAlign, true)) {
								case PdfImageVerticalAlign.Center:
									y += optHeight / 2 - (svgHeight * scaleX) / 2;
									break;

								case PdfImageVerticalAlign.Bottom:
									y += optHeight - svgHeight * scaleX;
									break;
							}
						}

						if (scaleY === scaleMin) {
							switch (wjcCore.asEnum(options.align, PdfImageHorizontalAlign, true)) {
								case PdfImageHorizontalAlign.Center:
									x += optWidth / 2 - (svgWidth * scaleY) / 2;
									break;

								case PdfImageHorizontalAlign.Right:
									x += optWidth - svgWidth * scaleY;
									break;
							}
						}

						scaleX = scaleY = scaleMin;
					}
				} else {
					if (options.width) {
						scaleY = scaleX;
					} else {
						scaleX = scaleY;
					}
				}
			}

			scaleX = scaleX || 1;
			scaleY = scaleY || 1;

			// render
			this._switchCtx();
			this._pdfdoc.saveState();

			try {
				this.translate(x, y);
				this.scale(scaleX, scaleY);
				renderer.render();
			}
			finally {
				this._pdfdoc.restoreState();
				this._saveCtx();
			}

			// restore the text flow coordinates
			this.x = oldX;
			this.y = oldY;

			// update this.y
			if (textFlow) {
				var imgHeight = optHeight != null ? optHeight : (svgHeight != null ? svgHeight * scaleY : undefined);
				this.y += (imgHeight || 0);
			}

			return this;
		}

		/**
		* Gets the line height with a given font.
		*
		* If font is not specified, then font used in the current document is used.
		*
		* @param font Font to get the line height.
		* @return The line height, in points.
		*/
		public lineHeight(font?: PdfFont): number {
			var doc = this._pdfdoc;
			doc._toggleFont(_asPdfFont(font));
			this._switchCtx();
			var value = (<_IPdfKitDocument>doc._document).currentLineHeight();
			this._saveCtx();
			return value;
		}

		/**
		* Measures a text with the given font and text drawing options without rendering it.
		*
		* If font is not specified, then the font used in the current document is used.
		*
		* The method uses the same text rendering engine as @see:drawText, so it is tied up
		* in the same way to @see:x and the right page margin, if options.width is not
		* provided. The measurement result doesn't reflect the fact that text can be split 
		* into multiple pages or columns; the text is treated as a single block.
		*
		* @param text Text to measure.
		* @param font Font to be applied on the text.
		* @param options Determines the text drawing options.
		* @return A @see:IPdfTextMeasurementInfo object determines the measurement information.
		*/
		public measureText(text: string, font?: PdfFont, options?: IPdfTextMeasurementSettings): IPdfTextMeasurementInfo {
			var sz: _IPdfKitTextSize = {};

			if (text = wjcCore.asString(text)) {
				var doc = this._pdfdoc;

				doc._toggleFont(_asPdfFont(font));
				this._switchCtx();

				try {
					sz = (<_IPdfKitDocument>doc._document).textAndMeasure(text, null, null, this._textOptionsToNative(options), true);
				}
				finally {
					this._saveCtx();
				}
			}

			return {
				charCount: sz.charCount || 0,
				size: new wjcCore.Size(sz.width || 0, sz.height || 0)
			};
		}

		/**
		* Moves down the @see:y by a given number of lines using the given font or,
		* using the font of current document, if not specified.
		*
		* @param lines Number of lines to move down.
		* @param font Font to calculate the line height.
		* @return The @see:PdfPageArea object.
		*/
		public moveDown(lines = 1, font?: PdfFont): PdfPageArea {
			if (lines = wjcCore.asNumber(lines, false, true)) {
				var doc = this._pdfdoc;

				doc._toggleFont(_asPdfFont(font));
				this._switchCtx();

				try {
					(<_IPdfKitDocument>doc._document).moveDown(lines);
				} finally {
					this._saveCtx();
				}
			}

			return this;
		}

		/**
		* Moves up the @see:y by a given number of lines using the given font or,
		* using the font of current document, if not specified.
		*
		* @param lines Number of lines to move up.
		* @param font Font to calculate the line height.
		* @return The @see:PdfPageArea object.
		*/
		public moveUp(lines = 1, font?: PdfFont): PdfPageArea {
			if (lines = wjcCore.asNumber(lines, false, true)) {
				var doc = this._pdfdoc;

				doc._toggleFont(_asPdfFont(font));
				this._switchCtx();

				try {
					(<_IPdfKitDocument>doc._document).moveUp(lines);
				} finally {
					this._saveCtx();
				}
			}

			return this;
		}

		/**
		* Scales the graphic context by a specified scaling factor.
		*
		* The scaling factor value within the range [0, 1] indicates that the size will be
		* decreased.
		* The scaling factor value greater than 1 indicates that the size will be increased.
		*
		* @param xFactor The factor to scale the X dimension.
		* @param yFactor The factor to scale the Y dimension. If it is not provided, it is
		* assumed to be equal to xFactor.
		* @param origin The @see:Point to scale around, in points. If it is not provided,
		* then the top left corner is used.
		* @return The @see:PdfPageArea object.
		*/
		public scale(xFactor: number, yFactor = xFactor, origin?: wjcCore.Point): PdfPageArea {
			this._assertPathStarted();

			origin = origin || new wjcCore.Point(0, 0);

			var ox = wjcCore.asNumber(origin.x) + this._offset.x,
				oy = wjcCore.asNumber(origin.y) + this._offset.y;

			xFactor = wjcCore.asNumber(xFactor, false);
			yFactor = wjcCore.asNumber(yFactor, false);

			(<_IPdfKitDocument>this._pdfdoc._document).scale(xFactor, yFactor, {
				origin: [ox, oy]
			});

			return this;
		}

		/**
		* Translates the graphic context with a given distance.
		*
		* @param x The distance to translate along the X-axis, in points.
		* @param y The distance to translate along the Y-axis, in points.
		* @return The @see:PdfPageArea object.
		*/
		public translate(x: number, y: number): PdfPageArea {
			this._assertPathStarted();

			// don't add offsets because all drawing methods using it already, otherwise the translate(0,0).moveTo(0,0) call will double the offsets.
			x = wjcCore.asNumber(x); // + this._offset.x;
			y = wjcCore.asNumber(y); // + this._offset.y;

			(<_IPdfKitDocument>this._pdfdoc._document).translate(x, y);

			return this;
		}

		/**
		* Transforms the graphic context with given six numbers which represents a 
		* 3x3 transformation matrix.
		*
		* A transformation matrix is written as follows:
		* <table>
		*   <tr><td>a</td><td>b</td><td>0</td></tr>
		*   <tr><td>c</td><td>d</td><td>0</td></tr>
		*   <tr><td>e</td><td>f</td><td>1</td></tr>
		* </table>
		* 
		* @param a Value of the first row and first column.
		* @param b Value of the first row and second column.
		* @param c Value of the second row and first column.
		* @param d Value of the second row and second column.
		* @param e Value of the third row and first column.
		* @param f Value of the third row and second column.
		* @return The @see:PdfPageArea object.
		*/
		public transform(a: number, b: number, c: number, d: number, e: number, f: number): PdfPageArea {
			this._assertPathStarted();

			a = wjcCore.asNumber(a);
			b = wjcCore.asNumber(b);
			c = wjcCore.asNumber(c);
			d = wjcCore.asNumber(d);
			e = wjcCore.asNumber(e);
			f = wjcCore.asNumber(f);

			var x = this._offset.x,
				y = this._offset.y;

			(<_IPdfKitDocument>this._pdfdoc._document).transform(a, b, c, d, e - a * x + x - c * y, f - b * x - d * y + y);

			return this;
		}

		/**
		* Rotates the graphic context clockwise by a specified angle.
		*
		* @param angle The rotation angle, in degrees.
		* @param origin The @see:Point of rotation, in points. If it is not provided,
		* then the top left corner is used.
		*/
		public rotate(angle: number, origin?: wjcCore.Point): PdfPageArea {
			this._assertPathStarted();

			origin = origin || new wjcCore.Point(0, 0);

			var ox = wjcCore.asNumber(origin.x) + this._offset.x,
				oy = wjcCore.asNumber(origin.y) + this._offset.y;

			angle = wjcCore.asNumber(angle);

			(<_IPdfKitDocument>this._pdfdoc._document).rotate(angle, {
				origin: [ox, oy]
			});

			return this;
		}

		//#endregion

		//#region internal

		public _assertPathStarted(): void {
			wjcCore.assert(!this.paths._hasPathBuffer(), _Errors.PathStarted);
		}

		public _initialize(doc: PdfDocument, xo: number, yo: number) {
			this._pdfdoc = doc;
			this._offset = new wjcCore.Point(xo, yo);
			this._ctxProps = {
				xo: xo,
				yo: yo,
				lineGap: this._ctxProps.lineGap
			};

			this._graphics = new PdfPaths(this._pdfdoc, this._offset);
		}

		public _isDrawingText(): boolean {
			return this._drawingText;
		}

		//#endregion

		//#region private

		private _switchCtx() {
			this._pdfdoc._switchTextFlowCtx(this._ctxProps);
		}

		private _saveCtx() {
			this._ctxProps = this._pdfdoc._getTextFlowCtxState();
		}

		private _textOptionsToNative(value: IPdfTextSettings): _IPdfKitTextOptions {
			value = value || {};

			var res: _IPdfKitTextOptions = _shallowCopy(value);

			if (value.align != null) {
				res.align = (PdfTextHorizontalAlign[wjcCore.asEnum(value.align, PdfTextHorizontalAlign)] || '').toLowerCase(); // default 'left'.
			}

			return res;
		}
	}



	'use strict';

	/**
	* Represents the declarative content of the running title.
	*/
	export class PdfRunningTitleDeclarativeContent {
		private _font: PdfFont;
		private _text: string;
		private _brush: PdfBrush;

		/**
		* Initializes a new instance of the @see:PdfRunningTitleDeclarativeContent class.
		*
		* @param text The text of the running title.
		* @param font Font of the text.
		* @param brushOrColor The @see:PdfBrush or @see:wijmo.Color or any string acceptable 
		* by the @see:wijmo.Color.fromString method used to fill the text.
		*/
		constructor(text?: string, font?: PdfFont, brushOrColor?: any) { // brushOrColor: PdfBrush | Color | string
			this.text = text || '';
			this.font = font || new PdfFont();
			this.brush = brushOrColor || new PdfSolidBrush();
		}

		/**
		* Gets or sets the font of the @see:text.
		*/
		public get font(): PdfFont {
			return this._font;
		}
		public set font(value: PdfFont) {
			value = _asPdfFont(value, true);
			this._font = value ? value.clone() : value;
		}

		/**
		* Gets or sets the text of the running title.
		*
		* May contain up to 3 tabular characters ('\t') which are used for separating the text
		* into the parts that will be aligned within the page area using left, center and right
		* alignment.
		* Two kinds of macros are supported, '&[Page]' and '&[Pages]'. The former one designates
		* the current page index while the latter one designates the page count.
		*
		* For example, for the first page of a document having ten pages, the following string:
		* <pre>
		*    '&[Page]\\&[Pages]\theader\t&[Page]\\&[Pages]'
		* </pre>
		* will be translated to:
		* <pre>
		*    '1\10 header 1\10'
		* </pre>
		*/
		public get text(): string {
			return this._text;
		}
		public set text(value: string) {
			this._text = wjcCore.asString(value);
		}

		/**
		* Gets or sets the brush used to fill the @see:text.
		*/
		public get brush(): PdfBrush {
			return this._brush;
		}
		public set brush(value: PdfBrush) {
			value = _asPdfBrush(value);
			this._brush = value ? value.clone() : value;
		}

		/**
		* Creates a copy of this @see:PdfRunningTitleDeclarativeContent.
		* @return A copy of this pen.
		*/
		public clone(): PdfRunningTitleDeclarativeContent {
			return new PdfRunningTitleDeclarativeContent(this.text, this.font, this.brush);
		}

		/**
		* Determines whether the specified @see:PdfRunningTitleDeclarativeContent instance
		* is equal to the current one.
		*
		* @param value @see:PdfRunningTitleDeclarativeContent to compare.
		* @return true if the specified object is equal to the current one, otherwise false.
		*/
		public equals(value: PdfRunningTitleDeclarativeContent): boolean {
			return ((value instanceof PdfRunningTitleDeclarativeContent)
				&& (this._text === value.text)
				&& (this._brush ? this._brush.equals(value._brush) : this._brush === value._brush)
				&& (this._font ? this._font.equals(value._font) : this._font === value._font));
		}
	}
 

	'use strict';

	/**
	* Represents a running title of the page, like header and footer.
	*
	* This class is not intended to be instantiated in your code.
	*/
	export class PdfRunningTitle extends PdfPageArea  {
		private _height = 24;
		private _declarative = new PdfRunningTitleDeclarativeContent();
		public _heightChanged = new wjcCore.Event();

		/**
		* Initializes a new instance of the @see:PdfRunningTitle class.
		*
		* @param options An optional object containing initialization settings.
		*/
		constructor(options?: any) {
			super();
			wjcCore.copy(this, options);
		}

		//#region public properties

		/**
		* Gets or sets an object that provides the ability to setup the running title
		* content declaratively.
		*/
		public get declarative(): PdfRunningTitleDeclarativeContent {
			return this._declarative;
		}
		public set declarative(value: PdfRunningTitleDeclarativeContent) {
			if (value != null) {
				wjcCore.assert(value instanceof PdfRunningTitleDeclarativeContent, _Errors.InvalidArg('value'));
				value = value.clone();
			}

			this._declarative = value;
		}

		/**
		* Gets or sets the height of the running title, in points.
		* To hide the running title, set this property to 0.
		* Changing this property has no effect on previous drawings; they will not be resized
		* or clipped.
		*
		* The default value is 24.
		*/
		public get height(): number {
			return this._height;
		}
		public set height(value: number) {
			if (value !== this._height) {
				this._height = wjcCore.asNumber(value, false, true);
				this._heightChanged.raise(this, wjcCore.EventArgs.empty);
			}
		}

		//#endregion

		//#region public methods

		// overrides
		public drawText(text, x?, y?, options?: IPdfTextDrawSettings): IPdfTextMeasurementInfo {
			options = options || {};
			// To be able to draw below the page bottom margin without adding a new page automatically, header and footer are positioned outside the native page margins.
			options.height = Infinity; 
			return super.drawText(text, x, y, options);
		}

		//#endregion
	}
 

	'use strict';

	export class _PdfImageHelper {
		private static DATAURI_CACHE = {};

		public static getDataUri(url: string): string {
			wjcCore.assert(!!(url = wjcCore.asString(url)), _Errors.EmptyUrl);

			if (_PdfImageHelper.DATAURI_CACHE[url]) {
				return _PdfImageHelper.DATAURI_CACHE[url];
			}

			var res = '';

			if (url.indexOf('data:') === 0) {
				wjcCore.assert(!!url.match(/^data:image\/(png|jpeg|jpg);base64,/), _Errors.InvalidImageDataUri);
				res = url;
			} else {
				var xhrError: string,
					buffer = _XhrHelper.arrayBuffer(url, xhr => xhrError = xhr.statusText);

				wjcCore.assert(xhrError == null, xhrError);

				try {
					var arr = new Uint16Array(buffer, 0, 2);

					if ((arr[0] === 0xD8FF) || (arr[0] === 0x5089 && arr[1] === 0x474E)) {
						var base64 = _PdfImageHelper._toBase64(buffer);
						res = 'data:' + ((arr[0] === 0xD8FF) ? 'image/jpeg' : 'image/png') + ';base64,' + base64;
					} else {
						throw '';
					}
				}
				catch (ex) {
					wjcCore.assert(false, _Errors.InvalidImageFormat);
				}
			}

			return _PdfImageHelper.DATAURI_CACHE[url] = res;
		}

		private static _toBase64(buffer: ArrayBuffer): string {
			var binary = '',
				bytes = new Uint8Array(buffer);

			for (var i = 0; i < bytes.byteLength; i++) {
				binary += String.fromCharCode(bytes[i]);
			}

			return window.btoa(binary);
		}
	}
 

	'use strict';

	interface _IPathFunc {
		func: Function;
		params: any[];
	}

	/**
	* Provides methods for creating graphics paths and drawing them or using them for clipping. 
	*
	* Path creation method calls must be finished with the @see:PdfPaths.stroke,
	* @see:PdfPaths.fill, @see:PdfPaths.fillAndStroke or @see:PdfPaths.clip method.
	* Any document methods which don't apply directly to path creation/ drawing/ clipping 
	* (changing a pen, drawing a text, saving the graphics state etc) are prohibited to use
	* until the path is finished.
	* The @see:PdfPaths.lineTo, @see:PdfPaths.bezierCurveTo and @see:PdfPaths.quadraticCurveTo 
	* methods should not start the path, they must be preceded with the @see:PdfPaths.moveTo.
	*
	* The methods are chainable:
	* <pre>
	* doc.paths.moveTo(0, 0).lineTo(100, 100).stroke();
	* </pre>
	*
	* This class is not intended to be instantiated in your code.
	*/
	export class PdfPaths {
		private _doc: PdfDocument;
		private _offset: wjcCore.Point;
		private _pathBuffer: _IPathFunc[] = [];

		/**
		* Initializes a new instance of the @see:PdfPaths class.
		*
		* @param doc Document.
		* @param offset Offset.
		*/
		constructor(doc: PdfDocument, offset: wjcCore.Point) {
			this._doc = doc;
			this._offset = offset;
		}

		//#region public

		/**
		* Sets a new current point.
		*
		* @param x The X-coordinate of the new point, in points.
		* @param y The Y-coordinate of the new point, in points.
		* @return The @see:PdfPaths object.
		*/
		public moveTo(x: number, y: number): PdfPaths {
			this._pathBuffer.push({
				func: (<_IPdfKitDocument>this._doc._document).moveTo,
				params: [wjcCore.asNumber(x) + this._offset.x, wjcCore.asNumber(y) + this._offset.y]
			});

			return this;
		}

		/**
		* Draws a line from the current point to a new point.
		*
		* The new current point is (x, y).
		*
		* @param x The X-coordinate of the new point, in points.
		* @param y The Y-coordinate of the new point, in points.
		* @return The @see:PdfPaths object.
		*/
		public lineTo(x: number, y: number): PdfPaths {
			this._pathBuffer.push({
				func: (<_IPdfKitDocument>this._doc._document).lineTo,
				params: [wjcCore.asNumber(x) + this._offset.x, wjcCore.asNumber(y) + this._offset.y]
			});

			return this;
		}

		/**
		* Draws a quadratic curve from the current point to a new point using the current point
		* and (cpx, cpy) as the control points.
		*
		* The new current point is (x, y).
		*
		* @param cpx The X-coordinate of the control point, in points.
		* @param cpy The Y-coordinate of the control point, in points.
		* @param x The X-coordinate of the new point, in points.
		* @param y The Y-coordinate of the new point, in points.
		* @return The @see:PdfPaths object.
		*/
		public quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): PdfPaths {
			this._pathBuffer.push({
				func: (<_IPdfKitDocument>this._doc._document).quadraticCurveTo,
				params: [
					wjcCore.asNumber(cpx) + this._offset.x,
					wjcCore.asNumber(cpy) + this._offset.y,
					wjcCore.asNumber(x) + this._offset.x,
					wjcCore.asNumber(y) + this._offset.y
				]
			});

			return this;
		}

		/**
		* Draws a bezier curve from the current point to a new point using the (cp1x, cp1y)
		* and (cp2x, cp2y) as the control points.
		*
		* The new current point is (x, y).
		*
		* @param cp1x The X-coordinate of the first control point, in points.
		* @param cp1y The Y-coordinate of the first control point, in points.
		* @param cp2x The X-coordinate of the second control point, in points.
		* @param cp2y The Y-coordinate of the second control point, in points.
		* @param x The X-coordinate of the new point, in points.
		* @param y The Y-coordinate of the new point, in points.
		* @return The @see:PdfPaths object.
		*/
		public bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): PdfPaths {
			this._pathBuffer.push({
				func: (<_IPdfKitDocument>this._doc._document).bezierCurveTo,
				params: [
					wjcCore.asNumber(cp1x) + this._offset.x,
					wjcCore.asNumber(cp1y) + this._offset.y,
					wjcCore.asNumber(cp2x) + this._offset.x,
					wjcCore.asNumber(cp2y) + this._offset.y,
					wjcCore.asNumber(x) + this._offset.x,
					wjcCore.asNumber(y) + this._offset.y
				]
			});

			return this;
		}

		/**
		* Draws a SVG 1.1 path.
		*
		* @param path The SVG path to draw.
		* @return The @see:PdfPaths object.
		*/
		public svgPath(path: string): PdfPaths {
			if (path) {
				var updatedPath = _PdfSvgPathHelper.offset(wjcCore.asString(path), this._offset);

				this._pathBuffer.push({
					func: (<_IPdfKitDocument>this._doc._document).path,
					params: [wjcCore.asString(updatedPath)]
				});
			}
			return this;
		}

		/**
		* Closes the current path and draws a line from the current point to the initial
		* point of the current path.
		*
		* @return The @see:PdfPaths object.
		*/
		public closePath(): PdfPaths {
			this._writePathBuffer();
			(<_IPdfKitDocument>this._doc._document).closePath();
			return this;
		}

		/**
		* Draws a rectangle.
		*
		* @param x The X-coordinate of the topleft corner of the rectangle, in points.
		* @param y The Y-coordinate of the topleft corner of the rectangle, in points.
		* @param width The width of the rectangle, in points.
		* @param height The width of the rectangle, in points.
		* @return The @see:PdfPaths object.
		*/
		public rect(x: number, y: number, width: number, height: number): PdfPaths {
			this._pathBuffer.push({
				func: (<_IPdfKitDocument>this._doc._document).rect,
				params: [
					wjcCore.asNumber(x) + this._offset.x,
					wjcCore.asNumber(y) + this._offset.y,
					wjcCore.asNumber(width, false, true),
					wjcCore.asNumber(height, false, true)
				]
			});

			return this;
		}

		/**
		* Draws a rounded rectangle.
		*
		* @param x The X-coordinate of the upper-left corner of the rectangle, in points.
		* @param y The Y-coordinate of the upper-left corner of the rectangle, in points.
		* @param width The width of the rectangle, in points.
		* @param height The width of the rectangle, in points.
		* @param cornerRadius The corner radius of the rectangle, in points. The default value is 0.
		* @return The @see:PdfPaths object.
		*/
		public roundedRect(x: number, y: number, width: number, height: number, cornerRadius: number = 0): PdfPaths {
			this._pathBuffer.push({
				func: (<_IPdfKitDocument>this._doc._document).roundedRect,
				params: [
					wjcCore.asNumber(x) + this._offset.x,
					wjcCore.asNumber(y) + this._offset.y,
					wjcCore.asNumber(width, false, true),
					wjcCore.asNumber(height, false, true),
					wjcCore.asNumber(cornerRadius, false, true)
				]
			});

			return this;
		}

		/**
		* Draws an ellipse.
		*
		* @param x The X-coordinate of the center of the ellipse, in points.
		* @param y The Y-coordinate of the center of the ellipse, in points.
		* @param radiusX The radius of the ellipse along the X-axis, in points.
		* @param radiusY The radius of the ellipse along the Y-axis, in points. 
		* If it is not provided, then it is assumed to be equal to radiusX.
		* @return The @see:PdfPaths object.
		*/
		public ellipse(x: number, y: number, radiusX: number, radiusY: number = radiusX): PdfPaths {
			this._pathBuffer.push({
				func: (<_IPdfKitDocument>this._doc._document).ellipse,
				params: [
					wjcCore.asNumber(x) + this._offset.x,
					wjcCore.asNumber(y) + this._offset.y,
					wjcCore.asNumber(radiusX, false, true),
					wjcCore.asNumber(radiusY, false, true)
				]
			});

			return this;
		}

		/**
		* Draws a circle.
		*
		* @param x The X-coordinate of the center of the circle, in points.
		* @param y The Y-coordinate of the center of the circle, in points.
		* @param radius The radius of the circle, in points.
		* @return The @see:PdfPaths object.
		*/
		public circle(x: number, y: number, radius: number): PdfPaths {
			this._pathBuffer.push({
				func: (<_IPdfKitDocument>this._doc._document).circle,
				params: [
					wjcCore.asNumber(x) + this._offset.x,
					wjcCore.asNumber(y) + this._offset.y,
					wjcCore.asNumber(radius, false, true)
				]
			});

			return this;
		}

		/**
		* Draws a polygon using a given points array.
		* 
		* @param points An array of two-elements arrays [x, y] specifying
		* the X and Y coordinates of the point, in points.
		* @return The @see:PdfPaths object.
		*/
		public polygon(points: number[][]): PdfPaths {
			if (points) {
				for (var i = 0; i < points.length; i++) {
					var pnt = points[i];

					pnt[0] = pnt[0] + this._offset.x;
					pnt[1] = pnt[1] + this._offset.y;
				}
			}

			this._pathBuffer.push({
				func: (<_IPdfKitDocument>this._doc._document).polygon,
				params: points
			})

			return this;
		}

		/**
		* Creates a clipping path used to limit the regions of the page affected by 
		* painting operators.
		*
		* @param rule The fill rule to use.
		* @return The @see:PdfPaths object.
		*/
		public clip(rule: PdfFillRule = PdfFillRule.NonZero): PdfPaths {
			this._writePathBuffer();
			(<_IPdfKitDocument>this._doc._document).clip(rule === PdfFillRule.EvenOdd ? 'even-odd' : 'non-zero');
			return this;
		}

		/**
		* Fills the path with the specified brush and rule.
		* If brush is not specified, then the default document brush will be used 
		* (see the @see:PdfDocument.setBrush method).
		*
		* The brushOrColor argument can accept the following values:
		* <ul>
		*   <li>A @see:PdfBrush object.</li>
		*   <li>
		*     A @see:wijmo.Color object or any string acceptable by the @see:wijmo.Color.fromString method. 
		*     In this case, the @see:PdfBrush object with the specified color will be created internally.
		*    </li>
		* </ul>
		*
		* @param brushOrColor The brush or color to use.
		* @param rule The fill rule to use.
		* @return The @see:PdfPaths object.
		*/
		public fill(brushOrColor?: any, rule?: PdfFillRule): PdfPaths { // brushOrColor: PdfBrush | Color | string
			this._doc._toggleBrush(_asPdfBrush(brushOrColor));
			this._writePathBuffer();
			(<_IPdfKitDocument>this._doc._document).fill(rule === PdfFillRule.EvenOdd ? 'even-odd' : 'non-zero');

			return this;
		}

		/**
		* Fills and strokes the path with the specified brush, pen and rule.
		* If brush and pen is not specified, then the default document brush and pen will
		* be used (See the @see:PdfDocument.setBrush, @see:PdfDocument.setPen methods).
		*
		* The brushOrColor argument can accept the following values:
		* <ul>
		*   <li>A @see:PdfBrush object.</li>
		*   <li>
		*     A @see:wijmo.Color object or any string acceptable by the @see:wijmo.Color.fromString method. 
		*     In this case, the @see:PdfBrush object with the specified color will be created internally.
		*    </li>
		* </ul>
		*
		* The penOrColor argument can accept the following values:
		* <ul>
		*   <li>A @see:PdfPen object.</li>
		*   <li>
		*     A @see:wijmo.Color object or any string acceptable by the @see:wijmo.Color.fromString method. 
		*     In this case, the @see:PdfPen object with the specified color will be created internally.
		*   </li>
		* </ul>
		*
		* @param brushOrColor The brush or color to use.
		* @param penOrColor The pen or color to use.
		* @param rule The fill rule to use.
		* @return The @see:PdfPaths object.
		*/
		public fillAndStroke(brushOrColor?: any, penOrColor?: any, rule?: PdfFillRule): PdfPaths { // brushOrColor: PdfBrush | Color | string, penOrColor: PdfPen | Color | string
			this._doc._toggleBrush(_asPdfBrush(brushOrColor));
			this._doc._togglePen(_asPdfPen(penOrColor));

			this._writePathBuffer();
			(<_IPdfKitDocument>this._doc._document).fillAndStroke(rule === PdfFillRule.EvenOdd ? 'even-odd' : 'non-zero');

			return this;
		}

		/**
		* Strokes the path with the specified pen.
		* If pen is not specified, then the default document pen will be used 
		* (See the @see:PdfDocument.setPen method).
		*
		* The penOrColor argument can accept the following values:
		* <ul>
		*   <li>A @see:PdfPen object.</li>
		*   <li>
		*     A @see:wijmo.Color object or any string acceptable by the @see:wijmo.Color.fromString method. 
		*     In this case, the @see:PdfPen object with the specified color will be created internally.
		*   </li>
		* </ul>
		* 
		* @param penOrColor The pen or color to use.
		* @return The @see:PdfPaths object.
		*/
		public stroke(penOrColor?: any): PdfPaths { // penOrColor: PdfPen | Color | string
			this._doc._togglePen(_asPdfPen(penOrColor));
			this._writePathBuffer();
			(<_IPdfKitDocument>this._doc._document).stroke();

			return this;
		}

		//#endregion

		//#region internal, private 

		public _hasPathBuffer(): boolean {
			return this._pathBuffer.length > 0;
		}

		private _writePathBuffer() {
			var doc = <_IPdfKitDocument>this._doc._document;

			for (var i = 0; i < this._pathBuffer.length; i++) {
				var item = this._pathBuffer[i];

				item.func.apply(doc, item.params);
			}

			this._pathBuffer = [];
		}

		//#endregion.
	}
 

	'use strict';

	export class _PdfSvgPathHelper {
		/*
		* Updates the absolute coordinates using the given offset and returns an updated path.
		* @param path Path.
		* @param offset Offset.
		*/
		public static offset(path: string, offset: wjcCore.Point): string {
			var newPath = this._processPath(path, (value, cmd, cmdIdx, argIdx) => {
				value = this._updateOffset(value, offset,  cmd, cmdIdx, argIdx);
				return value;
			});
			return newPath;
		}

		/*
		* Updates coordinates using the given scale factor and returns an updated path.
		* @param path Path.
		* @param scale Scale factor.
		*/
		public static scale(path: string, scale: number): string {
			var newPath = this._processPath(path, (value, cmd, cmdIdx, argIdx) => {
				if (cmd === 'a' || cmd === 'A') {
					var rm = argIdx % 7;
					if (rm >= 2 && rm <= 4) { // skip 'x-axis-rotation', 'large-arc-flag', 'sweep-flag'
						return value; 
					}
				}

				return value * scale;
			});

			return newPath;
		}

		private static _processPath(path: string, argCallback: (value: number, cmd: string, cmdIdx: number, argIdx: number) => number): string {
			var tkn = this._getTokenizer(path),
				cmd = '',
				res = '',
				argIdx = -1,
				cmdIdx = -1;

			for (var token: string; token = tkn();) {
				if (token.length === 1 && /[a-zA-Z]/.test(token)) { // a command
					cmdIdx++;
					cmd = token;
					argIdx = -1
				} else { // an argument
					argIdx++;
					var newValue = argCallback(parseFloat(token), cmd, cmdIdx, argIdx);
					token = wjcCore.toFixed(newValue, 7, false) + '';
				}

				res += token + ' ';
			}
			
			return res;
		} 

		private static _getTokenizer(path: string) {
			var len = path.length,
				i = 0;

			return () => {
				if (i >= len) {
					return ''; // done
				}

				// skip whitespaces
				while ((i < len) && (/\s/.test(path[i]) || path[i] == ',')) {
					i++;
				}

				var j = i;

				// skip numbers
				while ((i < len) && (/[0-9\.\-eE\+]/.test(path[i]))) {
					i++;
				}

				if (i != j) {
					return path.substr(j, i - j);
				}

				return path.substr(i++, 1);
			};
		}

		private static _updateOffset(value: number, offset: wjcCore.Point, cmd: string, cmdIdx: number, argIdx: number): number {
			var o = 0;

			switch (cmd) {
				case 'm': // (dx dy)+
					if (cmdIdx === 0) { // SVG specs: if a relative moveto (m) appears as the first element of the path, then it is treated as a pair of absolute coordinates.
						// inspect only the first group
						if (argIdx === 0) {
							o = -1;
						} else {
							if (argIdx === 1) {
								o = 1;
							}
						}
					}
					break;

				case 'L': // (x y)+
				case 'M': // (x y)+
				case 'C': // (c1x c1y c2x c2y x y)+
				case 'S': // (x2 y2 x y)+
				case 'Q': // (x1 y1 x y)+
				case 'T': // (x y)+
					o = (argIdx % 2 === 0) ? -1 : 1;
					break;

				case 'A': // (rx ry x-axis-rotation large-arc-flag sweep-flag x y)+
					if (argIdx % 7 === 5) { // x
						o = -1;
					} else {
						if (argIdx % 7 === 6) { // y
							o = 1;
						}
					}
					break;

				case 'H': // x+
					o = -1;
					break;

				case 'V': // y+
					o = 1;
					break;
			}

			return o
				? (o === -1 ? value + offset.x : value + offset.y)
				: value;
		}
	}



	'use strict';

	/* Represents the XMLHttpRequest settings. */
	interface _IXhrSettings {
		responseType?: string;
		headers?: { [index: string]: string };
		method?: string;
		async?: boolean;
		user?: string;
		password?: string;
		data?: any;
		overrideMimeType?: string;
	}

	var _XhrOverrideMimeTypeSupported = !!new XMLHttpRequest().overrideMimeType;

	/* XMLHttpRequest helper. */
	export class _XhrHelper {
		/*
		* Asynchronously retrieves an ArrayBuffer from the URL using XMLHttpRequest.
		*
		* @param url The URL to send the request to.
		* @param success A function to be called if the request succeeds.
		* @param error A function to be called if the request fails.
		*/
		public static arrayBufferAsync(url: string, success: (xhr: XMLHttpRequest, data: ArrayBuffer) => void, error?: (xhr: XMLHttpRequest) => void): void {
			var settings: _IXhrSettings = {
				method: 'GET',
				responseType: 'arraybuffer',
				async: true
			};

			this._getData(url, settings, success, error);
		}

		/*
		* Synchronously retrieves an ArrayBuffer from a URL using XMLHttpRequest.
		*
		* @param url The URL to send the request to.
		* @param error A function to be called if the request fails.
		*/
		public static arrayBuffer(url: string, error?: (xhr: XMLHttpRequest) => void): ArrayBuffer {
			var buffer: ArrayBuffer,
				settings: _IXhrSettings = {
					method: 'GET',
					async: false
				};

			if (_IE /*#250357*/ || !_XhrOverrideMimeTypeSupported) {
				// We can retrieve binary data synchronously using xhr.responseType in case of IE10
				settings.responseType = 'arraybuffer';

				this._getData(url, settings, (xhr, response: ArrayBuffer) => {
					buffer = response;
				}, error);
			} else { // Edge, Chrome, Firefox
				// Note: the responseType parameter must be empty in case of synchronous request (http://www.w3.org/TR/XMLHttpRequest/#the-responsetype-attribute)
				settings.overrideMimeType = 'text/plain; charset=x-user-defined'; // retrieve unprocessed data as a binary string

				this._getData(url, settings, (xhr, response: string) => {
					// convert string to ArrayBuffer
					buffer = new ArrayBuffer(response.length);

					var byteView = new Uint8Array(buffer);

					for (var i = 0, len = response.length; i < len; i++) {
						byteView[i] = response.charCodeAt(i) & 0xFF;
					}
				}, error);
			}

			return buffer;
		}

		/*
		* Synchronously retrieves a text from a URL using XMLHttpRequest.
		*
		* @param url The URL to send the request to.
		* @param error A function to be called if the request fails.
		*/
		public static text(url: string, error?: (xhr: XMLHttpRequest) => void): string {
			var settings: _IXhrSettings = {
					method: 'GET',
					async: false
				},
				res = "";

			this._getData(url, settings, (xhr, response) =>	res = response, error);

			return res;
		}

		/*
		* Retrieves data from a URL using XMLHttpRequest.
		*
		* @param url The URL to send the request to.
		* @param settings Request settings.
		* @param success A function to be called if the request succeeds.
		* @param error A function to be called if the request fails.
		*/
		private static _getData(url: string, settings: _IXhrSettings, success: (xhr: XMLHttpRequest, response: any) => void, error?: (xhr: XMLHttpRequest) => void): void {
			var xhr = new XMLHttpRequest();

			settings = settings || {};

			xhr.open(settings.method, url, settings.async, settings.user, settings.password);

			xhr.addEventListener('load', () => {
				if (xhr.readyState === 4) {
					var status = xhr.status;

					if (status >= 200 && status < 300 || status === 304) {
						if (success) {
							success(xhr, xhr.response);
						}
					} else {
						if (error) {
							error(xhr);
						}
					}
				}
			});

			if (settings.headers) {
				for (var key in settings.headers) {
					xhr.setRequestHeader(key, settings.headers[key]);
				}
			}

			if (settings.responseType) {
				xhr.responseType = <any>settings.responseType;
			}

			if (settings.overrideMimeType && xhr.overrideMimeType) {
				xhr.overrideMimeType(settings.overrideMimeType);
			}

			xhr.send(settings.data);
		}
	}



	'use strict';

	/**
	* Provides arguments for the @see:PdfDocument.end event.
	*/
	export class PdfDocumentEndedEventArgs extends wjcCore.EventArgs {
		private _blob: Blob;
		private _chunks: Uint8Array[];

		/**
		* Initializes a new instance of the @see:PdfDocumentEndedEventArgs class.
		*
		* @param chunks An array of chunks.
		*/
		constructor(chunks: Uint8Array[]) {
			super();
			this._chunks = chunks;
		}

		/**
		* Gets a Blob object that contains the document data.
		*/
		public get blob(): Blob {
			if (!this._blob) {
				this._blob = new Blob(this._chunks, { type: 'application/pdf' });
			}
			return this._blob;
		}

		/**
		* Gets the underlying array of buffers that contains the document data.
		*/
		public get chunks(): Uint8Array[] {
			return this._chunks;
		}
	}


/**
* Defines the @see:PdfDocument class and associated classes.
*/

	'use strict';

	interface _IPageGState {
		pen?: PdfPen;
		brush?: PdfBrush;
	}

	/**
	* Represents a PDF document object, based on <a href="https://github.com/devongovett/pdfkit">PDFKit</a> JavaScript library.
	*/
	export class PdfDocument extends PdfPageArea {
		private _doc: _IPdfKitDocument;
		private _docInitialized = false;
		private _compress: boolean = true;
		private _bufferPages: boolean = true; // must be true to render headers and footers
		private _chunks: Uint8Array[] = [];
		private _fontReg: _PdfFontRegistrar;
		private _pageIndex = -1;

		private _ehOnPageAdded: Function;
		private _ehOnPageAdding: Function;
		private _ehOnDocData: Function;
		private _ehOnDocEnding: Function;
		private _ehOnDocEnded: Function;

		private _header: PdfRunningTitle;
		private _footer: PdfRunningTitle;

		// stores pens and brushes between the save\ restore roundtrip.
		private _graphicsStack = [];
		
		// represents an actual stroking (pen) and filling (brush) properties for every page.
		private _currentGS: { [index: number]: _IPageGState } = {};
		// represents default (provided by the setPen method) settings of the document's stroking properties.
		private _defPen: PdfPen;
		// represents default (provided by the setBrush method) settings of the document's filling properties.
		private _defBrush: PdfBrush;

		// represents current font
		private _curFont: PdfFont;
		// represents default font (provided by the setFont method).
		private _defFont: PdfFont;

		/**
		* Initializes a new instance of the @see:PdfDocument class.
		*
		* @param options An optional object containing initialization settings.
		*/
		constructor(options?: any) {
			super();

			wjcCore.copy(this, options);

			var pre = (doc: _IPdfKitDocument) => {
					this._doc = doc;
					this._fontReg = new _PdfFontRegistrar(this._doc);
				},
				post = () => {
					this.setPen(this._currentGS[this._pageIndex].pen);
					this.setBrush(this._currentGS[this._pageIndex].brush);
					this._curFont = PdfFont._DEF_PDFKIT_FONT;
					this.setFont(new PdfFont()); // change to times-10
				},
				autoPage = false,

				pdfKitOptions = {
					compress: this._compress,
					bufferPages: this._bufferPages,
					pageAdding: this._ehOnPageAdding = (doc: _IPdfKitDocument, options: _IPdfKitPageOptions) => {
						if (!this._docInitialized) { // The event was raised before the PDFDocument's constructor call is completed.
							autoPage = true;
							pre(doc);
						}

						this._onPageAdding(doc, options);
					},
					pageAdded: this._ehOnPageAdded = (doc: _IPdfKitDocument) => {
						// we need to reset current pen\ brush to reflect the actual page's stroking\ filling properties beacause each new page has an empty graphics state.
						var brush = this._isDrawingText()
							? this._currentGS[this._pageIndex].brush // leave current brush because PDFKit spreads fill color between pages in case of page breaks when drawing text.
							: new PdfSolidBrush()

						this._currentGS[++this._pageIndex] = {
							pen: new PdfPen(),
							brush: brush
						};

						if (!this._docInitialized) { // The event was raised before the PDFDocument's constructor call is completed.
							post();
						}
						this._onPageAdded(doc);
					}
				};

			this._doc = new PDFDocument(pdfKitOptions);

			if (!autoPage) { // always false in PDFKit 0.7.1
				pre(this._doc);
				post();
			}

			this._doc
				.on('data', this._ehOnDocData = (chunk) => { this._onDocData(chunk); })
				.on('ending', this._ehOnDocEnding = () => { this._onDocEnding(); })
				.on('end', this._ehOnDocEnded = () => { this._onDocEnded(); });

			this._docInitialized = true;
		}

		//#region public properties

		/**
		* Gets a value that indicates whether the document compression is enabled.
		* This property can be assigned using the @see:PdfDocument constructor only. 
		*
		* The default value is true.
		*/
		public get compress(): boolean {
			return this._compress;
		}

		/**
		* Gets a value that indicates whether the pages buffering mode is enabled which means
		* that the document's pages can be iterated over using @see:pageIndex and @see:bufferedPageRange.
		*
		* This property can be assigned using the @see:PdfDocument constructor only. 
		* This property can be set to false only if both @see:header and @see:footer are invisible.
		*
		* The default value is true.
		*/
		public get bufferPages(): boolean {
			return this._bufferPages;
		}

		/**
		* Gets or sets the document information, such as author name, document's creation
		* date and so on.
		*/
		public info: IPdfDocumentInfo = {
			// keep wijmo.copy happy
			author: undefined,
			creationDate: undefined,
			keywords: undefined,
			modDate: undefined,
			subject: undefined,
			title: undefined
		};

		/**
		* Gets an object that represents a header, the page area positioned right below
		* the top margin.
		*/
		public get header(): PdfRunningTitle {
			if (!this._header) {
				this._header = new PdfRunningTitle({
					_heightChanged: () => {
						if (this._docInitialized) {
							this._resetAreasOffset(this._doc);
						}
					}
				});
			}

			return this._header
		}

		/**
		* Gets an object that represents a footer, the page area positioned right above
		* the bottom margin.
		*/
		public get footer(): PdfRunningTitle {
			if (!this._footer) {
				this._footer = new PdfRunningTitle({
					_heightChanged: () => {
						if (this._docInitialized) {
							this._resetAreasOffset(this._doc);
						}
					}
				});
			}

			return this._footer
		}

		/**
		* Gets or sets the index of the current page within the buffered pages range.
		*
		* Use the @see:bufferedPageRange method to get the range of buffered pages.
		*/
		public get pageIndex(): number {
			return this._pageIndex;
		}
		public set pageIndex(value: number) {
			value = wjcCore.asNumber(value, false, true);

			if (this._pageIndex !== value) {
				this._doc.switchToPage(value); // an exception will be thrown internally if page is not buffered.
				this._pageIndex = value;
			}
		}

		/**
		* Gets an object that represents the default page settings for the pages added
		* automatically and for the @see:addPage method.
		*/
		public pageSettings: IPdfPageSettings = <any>{
			layout: PdfPageOrientation.Portrait,
			size: PdfPageSize.Letter,
			margins: {
				top: 72,
				left: 72,
				bottom: 72,
				right: 72
			},
			_copy: function (key: string, value: any) {
				if (key === 'size') { // to avoid PdfPageSize <- wijmo.Size exception
					this.size = value;
					return true;
				}
			}
		};

		//#endregion

		//#region public events

		/**
		* Occurs when the document has been rendered.
		*/
		public ended = new wjcCore.Event();

		/**
		* Occurs when a new page is added to the document.
		*/
		public pageAdded = new wjcCore.Event();

		/**
		* Raises the @see:end event.
		* 
		* @param args A @see:PdfDocumentEndedEventArgs object that contains the event data.
		*/
		public onEnded(args: PdfDocumentEndedEventArgs): void {
			if (this.ended) {
				this.ended.raise(this, args);
			}
		}

		/**
		* Raises the @see:pageAdded event.
		*
		* @param args A @see:EventArgs object that contains the event data.
		*/
		public onPageAdded(args: wjcCore.EventArgs): void {
			if (this.pageAdded) {
				this.pageAdded.raise(this, args);
			}
		}
		//#endregion

		//#region public methods

		/**
		 * Disposes the document.
		 */
		public dispose(): void {
			if (this._doc) {
				this._doc
					.removeEventListener('data', this._ehOnDocData)
					.removeEventListener('ending', this._ehOnDocEnding)
					.removeEventListener('end', this._ehOnDocEnded)
					.removeEventListener('pageAdding', this._ehOnPageAdding)
					.removeEventListener('pageAdded', this._ehOnPageAdded);

				this._doc = null;
				this._chunks = null;
			}
		}

		/**
		* Gets an object that represents the current page settings (read-only).
		*
		* @return A @see:IPdfPageSettings object that represents the current page settings.
		*/
		public get currentPageSettings(): IPdfPageSettings {
			var page = this._doc.page;
			return {
				layout: page.layout === 'landscape'
					? PdfPageOrientation.Landscape
					: PdfPageOrientation.Portrait,

				size: wjcCore.isArray(page.size)
					? new wjcCore.Size(page.size[0], page.size[1])
					// "LETTER" -> PdfPageSize.Letter, "SRA4" -> PdfPageSize.SRA4.
					: PdfPageSize[page.size.match(/\d+/) ? page.size : _toTitleCase(page.size)],

				margins: {
					left: page.margins.left,
					right: page.margins.right,
					top: page.margins.top - this.header.height,
					bottom: page.margins.bottom - this.footer.height
				}
			};
		}

		/**
		* Adds a new page with the given settings.
		*
		* If the settings parameter is omitted, then @see:pageSettings will be used instead.
		*
		* @param settings Page settings.
		* @return The @see:PdfDocument object.
		*/
		public addPage(settings?: IPdfPageSettings): PdfDocument {
			var native = this._pageSettingsToNative(settings || this.pageSettings);
			this._doc.addPage(native);
			return this;
		}

		/**
		* Gets the range of buffered pages.
		* @return A @see:IPdfBufferedPageRange object that represents the range of buffered pages.
		*/
		public bufferedPageRange(): IPdfBufferedPageRange {
			return this._doc.bufferedPageRange();
		}

		/**
		 * Finishes the document rendering.
		 */
		public end(): void {
			this._doc.end();
		}


		/**
		* Sets the default document brush.
		* This brush will be used by the @see:PdfPaths.fill, @see:PdfPaths.fillAndStroke and
		* @see:drawText methods, if no specific brush is provided.
		*
		* The brushOrColor argument can accept the following values:
		* <ul>
		*   <li>A @see:PdfBrush object.</li>
		*   <li>
		*     A @see:wijmo.Color object or any string acceptable by the @see:wijmo.Color.fromString method. 
		*     In this case, the @see:PdfBrush object with the specified color will be created internally.
		*    </li>
		* </ul>
		*
		* @param brushOrColor The brush or color to use.
		* @return The @see:PdfDocument object.
		*/
		public setBrush(brushOrColor: any): PdfDocument { // brushOrColor: PdfBrush | Color | string
			this._assertAreasPathStarted();
			this._setCurBrush(this._defBrush = _asPdfBrush(brushOrColor, false).clone());
			return this;
		}

		/**
		* Sets the default document pen.
		* This pen will be used by the @see:PdfPaths.stroke, @see:PdfPaths.fillAndStroke
		* and @see:drawText methods, if no specific pen is provided.
		*
		* The penOrColor argument can accept the following values:
		* <ul>
		*   <li>A @see:PdfPen object.</li>
		*   <li>
		*     A @see:wijmo.Color object or any string acceptable by the @see:wijmo.Color.fromString method. 
		*     In this case, the @see:PdfPen object with the specified color will be created internally.
		*   </li>
		* </ul>
		*
		* @param penOrColor The pen or color to use.
		* @return The @see:PdfDocument object.
		*/
		public setPen(penOrColor: any): PdfDocument { // penOrColor: PdfPen | Color | string
			this._assertAreasPathStarted();
			this._setCurPen(this._defPen = _asPdfPen(penOrColor, false).clone());
			return this;
		}

		/**
		* Sets the document font.
		*		
		* If exact font with given style and weight properties is not found then,  
		* <ul>
		*   <li>
		*     It tries to search the closest font using
		*     <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight">font weight fallback</a>.
		*   </li>
		*   <li>
		*     If still nothing is found, it tries to find the closest font with other style in following order:
		*     <ul>
		*       <li><b>'italic'</b>: 'oblique', 'normal'.</li>
		*       <li><b>'oblique'</b>: 'italic', 'normal'.</li>
		*       <li><b>'normal'</b>: 'oblique', 'italic'.</li>
		*     </ul>
		*   </li>
		* </ul>
		*
		* @param font The font object to set.
		*
		* @return The @see:PdfDocument object.
		*/
		public setFont(font: PdfFont): PdfDocument {
			this._setCurFont(this._defFont = _asPdfFont(font, false).clone());
			return this;
		}

		public _getFont(): PdfFont {
			return this._curFont;
		}

		/**
		* Registers a font from a source and associates it with a given font family name
		* and font attributes.
		*
		* @param font The font to register.
		*
		* @return The @see:PdfDocument object.
		*/
		public registerFont(font: IPdfFontFile): PdfDocument {
			wjcCore.assert(!!font, _Errors.ValueCannotBeEmpty('font'));

			var buffer: ArrayBuffer;

			if (wjcCore.isString(font.source)) { // URL
				var xhrError: string;
				buffer = _XhrHelper.arrayBuffer(font.source, xhr => xhrError = xhr.statusText);
				wjcCore.assert(xhrError == null, xhrError);
			} else {
				if (font.source instanceof ArrayBuffer) {
					buffer = font.source;
				} else {
					wjcCore.assert(false, _Errors.FontSourceMustBeStringArrayBuffer);
				}
			}

			font = _shallowCopy(font);
			font.source = buffer;

			this._fontReg.registerFont(font);

			return this;
		}

		/**
		* Registers a font from a URL asynchronously and associates it with a given font
		* family name and font attributes.
		*
		* The callback function takes a @see:IPdfFontFile object as a parameter.
		*
		* @param font The font to register.
		* @param callback A callback function which will be called, when the font has been
		* registered.
		*/
		public registerFontAsync(font: IPdfFontFile, callback: Function): void {
			wjcCore.assert(typeof (font.source) === 'string', _Errors.FontSourceMustBeString);
			wjcCore.asFunction(callback, false);

			_XhrHelper.arrayBufferAsync(font.source, (xhr, buffer) => {
				var fnt = _shallowCopy(font);
				fnt.source = buffer;

				this._fontReg.registerFont(fnt);

				callback(font);
			});
		}

		/**
		* Saves the state of the graphic context (including current pen, brush and
		* transformation state) and pushes it onto stack.
		*
		* @return The @see:PdfDocument object.
		*/
		public saveState(): PdfDocument {
			this._assertAreasPathStarted();

			this._graphicsStack.push(this._currentGS[this._pageIndex].pen.clone(), this._defPen.clone(), this._currentGS[this._pageIndex].brush.clone(), this._defBrush.clone());
			(<_IPdfKitDocument>this._pdfdoc._document).save();

			return this;
		}

		/**
		* Restores the state from the stack and applies it to the graphic context.
		*
		* @return The @see:PdfDocument object.
		*/
		public restoreState(): PdfDocument {
			this._assertAreasPathStarted();

			if (this._graphicsStack.length) {
				this._defBrush = this._graphicsStack.pop();
				this._currentGS[this._pageIndex].brush = this._graphicsStack.pop();
				this._defPen = this._graphicsStack.pop();
				this._currentGS[this._pageIndex].pen = this._graphicsStack.pop();
			}

			(<_IPdfKitDocument>this._pdfdoc._document).restore();
			return this;
		}

		//#endregion

		//#region internal

		private _runtimeProperties = ['pageIndex', 'x', 'y']; // this read-write properties can be accessed in run-time only.

		public _copy(key: string, value: any): boolean {
			if (key === 'compress') { // read-only property.
				this._compress = wjcCore.asBoolean(value);
				return true;
			}

			if (key === 'bufferPages') { // read-only property.
				this._bufferPages = wjcCore.asBoolean(value);
				return true;
			}

			if (this._runtimeProperties.indexOf(key) >= 0) {
				return true;
			}

			return false;
		}

		public get _document(): any {
			return this._doc;
		}

		public _switchTextFlowCtx(state: _IPdfTextFlowCtxState) {
			this._doc.x = state.xo;
			this._doc.y = state.yo;
			this._doc.lineGap(state.lineGap);
		}

		public _getTextFlowCtxState(): _IPdfTextFlowCtxState {
			return {
				xo: this._doc.x,
				yo: this._doc.y,
				lineGap: this._doc.currentLineGap()
			};
		}

		public _toggleBrush(brush?: PdfBrush): void {
			if (brush) {
				this._setCurBrush(brush);
			} else {
				this._setCurBrush(this._defBrush);
			}
		}

		public _togglePen(pen?: PdfPen): void {
			if (pen) {
				this._setCurPen(pen);
			} else {
				this._setCurPen(this._defPen);
			}
		}

		public _toggleFont(font?: PdfFont): void {
			if (font) {
				this._setCurFont(font);
			} else {
				this._setCurFont(this._defFont);
			}
		}

		//#endregion

		//#region private event handlers

		private _onDocData(chunk: any): void {
			this._chunks.push(chunk);
		}

		private _onDocEnding(): void {
			this._processHeadersFooters();

			// setup document info
			if (this.info) {
				var v;

				if (v = this.info.author) {
					this._doc.info.Author = v;
				}

				if (v = this.info.creationDate) {
					this._doc.info.CreationDate = v;
				}

				if (v = this.info.keywords) {
					this._doc.info.Keywords = v;
				}

				if (v = this.info.modDate) {
					this._doc.info.ModDate = v;
				}

				if (v = this.info.subject) {
					this._doc.info.Subject = v;
				}

				if (v = this.info.title) {
					this._doc.info.Title = v;
				}
			}
		}

		private _onDocEnded(): void {
			if (_IE && this._chunks.length) { // 'InvalidStateError' exception occurs in IE10 (IE11 works fine) when chunks are passed directly into the Blob constructor, so convert each item to ArrayBuffer first.
				if (!this._chunks[0].buffer) { // Not a typed array? IE10.
					// [] -> ArrayBuffer
					for (var i = 0; i < this._chunks.length; i++) {
						var chunk = this._chunks[i],
							buf = new Uint8Array(chunk.length);

						for (var j = 0; j < chunk.length; j++) {
							buf[j] = chunk[j];
						}

						this._chunks[i] = <any>buf.buffer;
					}
				}
			}

			this.onEnded(new PdfDocumentEndedEventArgs(this._chunks));
			this._chunks = [];
		}

		private _onPageAdding(doc: _IPdfKitDocument, options: _IPdfKitPageOptions): void {
			if (this.pageSettings) {
				var native = this._pageSettingsToNative(this.pageSettings);

				options.layout = doc.options.layout = native.layout;
				options.margins = doc.options.margins = native.margins;
				options.size = doc.options.size = native.size;
			}
		}

		private _onPageAdded(doc: _IPdfKitDocument): void {
			doc.page.originalMargins = _shallowCopy(doc.page.margins);
			this._resetAreasOffset(doc);
			this.onPageAdded(wjcCore.EventArgs.empty);
		}

		//#endregion

		//#region private

		private _assertAreasPathStarted(): void {
			if (!this._docInitialized) {
				return;
			}
			this._assertPathStarted();
			this.header._assertPathStarted();
			this.footer._assertPathStarted();
		}

		private _pageSettingsToNative(pageSettings: IPdfPageSettings): _IPdfKitPageOptions {
			var res: _IPdfKitPageOptions = {};

			if (pageSettings) {
				var layout = wjcCore.asEnum(pageSettings.layout, PdfPageOrientation, true);
				if (layout != null) {
					res.layout = (PdfPageOrientation[layout] || '').toLowerCase();
				}

				var margins = pageSettings.margins;
				if (margins) {
					res.margins = {
						left: wjcCore.asNumber(margins.left, false, true),
						right: wjcCore.asNumber(margins.right, false, true),
						top: wjcCore.asNumber(margins.top, false, true),
						bottom: wjcCore.asNumber(margins.bottom, false, true)
					};
				}

				var size = pageSettings.size;
				if (size != null) {
					if (size instanceof wjcCore.Size) { // custom size
						res.size = [
							wjcCore.asNumber((<wjcCore.Size>size).width, false, true),
							wjcCore.asNumber((<wjcCore.Size>size).height, false, true)
						];
					} else {
						size = wjcCore.asEnum(size, PdfPageSize);
						res.size = (PdfPageSize[size] || '').toUpperCase();
					}
				}
			}

			return res;
		}

		private _processHeadersFooters(): void {
			var hdr = this.header,
				ftr = this.footer;

			if (hdr.height > 0 || ftr.height > 0) {
				var doc = this._doc;

				wjcCore.assert(doc.options.bufferPages, _Errors.BufferPagesMustBeEnabled);

				var range = doc.bufferedPageRange();
				for (var i = range.start; i < range.count; i++) {
					var frmt = {
						'Page': i + 1,
						'Pages': range.count
					};

					this.pageIndex = i; // switch page

					this._renderHeaderFooter(hdr, frmt, true);
					this._renderHeaderFooter(ftr, frmt, false);
				}
			}
		}

		private _renderHeaderFooter(title: PdfRunningTitle, macros: any, isHeader: boolean): void {
			if (title.height > 0 && title.declarative && title.declarative.text) {
				var text = _formatMacros(title.declarative.text, macros),
					parts = text.split('\t');

				if (parts.length > 0 && parts[0]) {
					this._renderHeaderFooterPart(title, parts[0], PdfTextHorizontalAlign.Left, isHeader);
				}

				if (parts.length > 1 && parts[1]) {
					this._renderHeaderFooterPart(title, parts[1], PdfTextHorizontalAlign.Center, isHeader);
				}

				if (parts.length > 2 && parts[2]) {
					this._renderHeaderFooterPart(title, parts[2], PdfTextHorizontalAlign.Right, isHeader);
				}
			}
		}

		private _renderHeaderFooterPart(title: PdfRunningTitle, text: string, alignment: PdfTextHorizontalAlign, isHeader: boolean): void {
			var	textSettings: IPdfTextDrawSettings = {
					font: title.declarative.font,
					brush: title.declarative.brush,
					width: title.width,
					height: title.height,
					align: alignment
				};

			if (isHeader) {
				this.header.drawText(text, 0, 0, textSettings); // top alignment
			} else {
				(<IPdfTextMeasurementSettings>textSettings).includeLastLineExternalLeading = false;
				var sz = this.footer.measureText(text, textSettings.font, textSettings);
				this.footer.drawText(text, 0, this.footer.height - sz.size.height, textSettings); // bottom alignment
			}
		}

		private _setCurBrush(brush: PdfBrush): void {
			if (!this._currentGS[this.pageIndex].brush.equals(brush)) {
				this._setNativeDocBrush(brush, false);
				this._currentGS[this.pageIndex].brush = brush.clone();
			}
		}

		private _setCurFont(font: PdfFont): void {
			if (!this._curFont.equals(font)) {
				var internalName = this._fontReg.findFont(font.family, font.style, font.weight);
				this._doc.font(internalName, font.size || PdfFont._DEF_FONT.size);
				this._curFont = font.clone();
			}
		}

		private _setCurPen(pen: PdfPen): void {
			var d = this._doc,
				cp = this._currentGS[this.pageIndex].pen;

			// check color and brush. brush property is nullable.
			if (pen.brush && (!cp.brush || !cp.brush.equals(pen.brush))) { // brush is changed
				this._setNativeDocBrush(pen.brush, true);
			} else {
				if ((cp.brush && !pen.brush) || (!cp.brush && !cp.color.equals(pen.color))) { // color is changed
					d.strokeColor([pen.color.r, pen.color.g, pen.color.b], pen.color.a);
				}
			}

			if (cp.width !== pen.width) {
				d.lineWidth(pen.width);
			}

			if (cp.miterLimit !== pen.miterLimit) {
				d.miterLimit(pen.miterLimit);
			}

			if (cp.cap !== pen.cap) {
				d.lineCap(pen.cap);
			}

			if (cp.join !== pen.join) {
				d.lineJoin(pen.join);
			}

			// check dashPattern. dashPattern.dash == null means no dashes.
			if (!cp.dashPattern.equals(pen.dashPattern)) {
				if (pen.dashPattern.dash != null) {
					d.dash(pen.dashPattern.dash, { space: pen.dashPattern.gap, phase: pen.dashPattern.phase });
				} else {
					if (cp.dashPattern.dash != null) {
						d.undash();
					}
				}
			}

			this._currentGS[this.pageIndex].pen = pen.clone();
		}

		// true = stroke, fill = false
		private _setNativeDocBrush(brush: PdfBrush, strokeOrFill: boolean): void {
			var d = this._doc,
				nativeColor = brush._getBrushObject(this),
				opacity = 1;

			if (nativeColor instanceof wjcCore.Color) { // PdfSolidBrush
				opacity = (<wjcCore.Color>nativeColor).a;
				nativeColor = [(<wjcCore.Color>nativeColor).r, (<wjcCore.Color>nativeColor).g, (<wjcCore.Color>nativeColor).b];
			} else { // gradient brushes
				if (brush instanceof PdfGradientBrush) {
					opacity = (<PdfGradientBrush>brush).opacity;
				}
			}

			if (strokeOrFill) {
				d.strokeColor(nativeColor, opacity);
			} else {
				d.fillColor(nativeColor, opacity);
			}
		}

		private _resetAreasOffset(doc: _IPdfKitDocument): void {
			// * update native margins *
			// top margin
			doc.page.margins.top = doc.page.originalMargins.top + this.header.height;
			doc.y = doc.page.margins.top;

			// bottom margin
			doc.page.margins.bottom = doc.page.originalMargins.bottom + this.footer.height;

			// reset page areas offsets
			this._header._initialize(this, doc.page.margins.left, doc.page.originalMargins.top);
			this._initialize(this, doc.page.margins.left, doc.page.margins.top);
			this._footer._initialize(this, doc.page.margins.left, doc.page.height - doc.page.margins.bottom);
		}

		//#endregion
	}


	'use strict';

	export type _TDictionary<T> = { [key: string]: T };

	export function _compressSpaces(value: string): string {
		if (value) {
			value = value.trim().replace(/\s+/gm, ' ');
		}

		return value;
	}

	export function _resolveUrlIfRelative(url: string, urlResolver: (url: string) => string): string {
		if (url && urlResolver && !/(^[a-z][a-z0-9]*:)?\/\//i.test(url)) { // (protocol:)?//
			url = urlResolver(url);
		}

		return url;
	}

	export interface _ISvgCssPropertyValue {
		value: string;
		important: boolean;
	}

	export class _SvgCssRule {
		public declarations: _TDictionary<_ISvgCssPropertyValue> = {};

		constructor(public selector: string, declaration: string) {
			this._fillDeclarations(declaration);
		}

		private _fillDeclarations(declaration: string): void {
			if (!declaration) {
				return;
			}

			declaration.split(';').forEach(item => {
				if (item) {
					var def = item.split(':');
					if (def.length === 2) {
						var name = def[0].trim().toLowerCase(),
							value = def[1].trim();

						if (name && value) {
							var important = /!important$/i.test(value);

							if (important) {
								value = value.replace(/!important$/i, '').trim();
							}

							if (value) {
								this.declarations[name] = {
									value: value,
									important: important
								};
							}
						}
					}
				}
			});
		}
	}

	export class _SvgCssHelper {
		public static matchesSelector(node: Element, selector: string): boolean {
			var res = false;

			try {
				var fn: Function = (<any>node).matches || node.msMatchesSelector || node.webkitMatchesSelector || (<any>node).mozMatchesSelector;
				res = fn.call(node, selector);
			} catch (ex) { }

			return res;
		}

		public static getSpecificity(selector: string): number {
			var a = 0,
				b = 0,
				c = 0,
				match = (rg: RegExp): number => {
					var match = (selector.match(rg) || []).length;

					if (match) {
						selector = selector.replace(rg, '');
					}

					return match;
				};

			// An adapted version of https://github.com/keeganstreet/specificity/blob/master/specificity.js

			// Remove the negation psuedo-class (:not) but leave its argument because specificity is calculated on its argument
			selector = selector.replace(/:not\(([^\)]*)\)/g, (match, g1: string) => {
				return ' ' + g1 + ' ';
			});

			// Add attribute selectors to parts collection
			b += match(/(\[[^\]]+\])/g);

			// Add ID selectors to parts collection
			a += match(/(#[^\s\+>~\.\[:]+)/g);

			// Add class selectors to parts collection
			b += match(/(\.[^\s\+>~\.\[:]+)/g);

			// Add pseudo-element selectors to parts collection
			c += match(/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi);

			// Add pseudo-class selectors to parts collection
			b += match(/(:[\w-]+\([^\)]*\))/gi);
			b += match(/(:[^\s\+>~\.\[:]+)/g);

			// Remove universal selector and separator characters
			selector = selector.replace(/[\*\s\+>~]/g, ' ');

			// Remove any stray dots or hashes which aren't attached to words
			selector = selector.replace(/[#\.]/g, ' ');

			// The only things left should be element selectors
			c += match(/([^\s\+>~\.\[:]+)/g);

			return (a << 16) | (b << 8) | c;
		}

		// Computes the actual styling properties of a node determined by the 'class' and 'style' attributes and returns them as a stylePropName-stylePropValue dictionary.
		public static getComputedStyle(node: SVGElement, registeredRules: _TDictionary<_SvgCssRule>): _TDictionary<string> {
			var composite: _TDictionary<_ISvgCssPropertyValue> = {},
				associatedRules: _SvgCssRule[] = [];

			// find the associated CSS rules
			if (node.className) {
				var associatedRules: _SvgCssRule[] = [];

				for (var i = 0, keys = Object.keys(registeredRules); i < keys.length; i++) {
					var selector = keys[i];

					if (this.matchesSelector(node, selector)) {
						associatedRules.push(registeredRules[selector]);
					}
				}
			}

			// prioritize
			associatedRules.sort((a, b) => this.getSpecificity(a.selector) - this.getSpecificity(b.selector));

			// append the 'style' attribute (it has the highest specificity)
			var inline = node.getAttribute('style');
			if (inline) {
				associatedRules.push(new _SvgCssRule('_inline_', _compressSpaces(inline)));
			}

			// compose rules
			for (var i = 0; i < associatedRules.length; i++) {
				var rule = associatedRules[i];

				for (var j = 0, keys = Object.keys(rule.declarations); j < keys.length; j++) {
					var name = keys[j],
						val = rule.declarations[name];

					//!important property has a higher priority than non-!important even if the second one comes from the more specialized rule.
					if ((composite[name] == null) || (val.important || !composite[name].important)) {
						composite[name] = val;
					}
				}
			}

			// convert to dictionary
			var result: _TDictionary<string> = {};
			for (var i = 0, keys = Object.keys(composite); i < keys.length; i++) {
				var name = keys[i];
				result[name] = composite[name].value;
			}

			return result;
		}

		public static registerFontFace(doc: PdfDocument, rule: _SvgCssRule, urlResolver?: (url: string) => string): void {
			var rd = rule.declarations;

			if (!rd['font-family'] || !rd['src']) {
				return;
			}

			rd['src'].value.split(',').every(url => {
				if (url.match(/format\(\s*['"]?truetype['"]?\s*\)/i)) { // truetype only
					var match = url.match(/url\(\s*['"]?([^'"\)]+)['"]?\s*\)/i);
					if (match) {
						var src = match[1].trim(),
							success = false;

						if (src = _resolveUrlIfRelative(src, urlResolver)) {
							var font: IPdfFontFile = {
								name: rd['font-family'].value,
								source: src,
								weight: rd['font-weight'] ? rd['font-weight'].value.toLowerCase() : 'normal',
								style: rd['font-style'] ? rd['font-style'].value.toLowerCase() : 'normal'
							}

							try {
								doc.registerFont(font);
								success = true;
							} catch (ex) { }
						}

						return !success; // break the loop if success
					}
				}

				return true;
			});
		}
	}


	'use strict';

	//#region Basic attributes

	export enum _SvgNumConversion {
		Default = 1, // convert value according to its unit identifier
		None = 2, // no unit conversion, unit identifier is not allowed
		Px = 3 // always treat value as a 'px', unit identifier is not allowed
	}

	export enum _SvgLengthContext {
		Width = 1,
		Height = 2,
		Other = 3
	}

	export enum _SvgAttrType {
		Number = 1,
		String = 2
	}

	export class _SvgAttr<T> {
		public static parseValue(value: any, attrType: _SvgAttrType, viewPort: wjcCore.Size, lCtx: _SvgLengthContext, numConv: _SvgNumConversion): any {
			if (value == null) {
				return value;
			}

			// some attributes can have both numerical and string values (font-size)
			if (attrType & _SvgAttrType.Number) {
				var numVal: number,
					unitType: string;

				if (typeof (value) === 'number') {
					numVal = value;
				} else {
					var match = value.match(/^([\+-]?[\d\.]+)(em|ex|px|pt|pc|cm|mm|in|%)?$/);
					if (match) {
						numVal = parseFloat(match[1]);
						unitType = match[2];
					}
				}

				if (numVal != null && numVal === numVal) {
					if (numConv !== _SvgNumConversion.Default) {
						wjcCore.assert(!unitType, _Errors.InvalidFormat(value));

						if (numConv === _SvgNumConversion.None) {
							return numVal;
						}
					}

					// convert to pt
					switch (unitType) {
						case 'mm':
							return numVal * 72 / 25.4

						case 'cm':
							return numVal * 72 / 2.54

						case 'in':
							return numVal * 72;

						case 'pt':
							return numVal;

						case 'pc':
							return numVal * 12;

						case '%':
							switch (lCtx) {
								case _SvgLengthContext.Height:
									numVal *= viewPort.height / 100;
									break;

								case _SvgLengthContext.Width:
									numVal *= viewPort.width / 100;
									break;

								case _SvgLengthContext.Other:
									numVal *= (Math.sqrt(viewPort.width * viewPort.width + viewPort.height * viewPort.height) / Math.sqrt(2)) / 100;
									break;
							}
							return numVal;

						case 'px':
						default:
							return numVal * 0.75;
					}
				}
			}

			if (attrType & _SvgAttrType.String) {
				return value + '';
			}

			wjcCore.assert(false, _Errors.InvalidFormat(value));
		}

		private _owner: _SvgElementBase
		private _value: any;
		private _defValue: any;
		private _propName: string;
		private _propType: _SvgAttrType;
		private _searchValue: boolean;
		private _inheritable: boolean;
		private _pCtx: _SvgLengthContext;
		private _nc: _SvgNumConversion;

		constructor(owner: _SvgElementBase, propName: string, propType: _SvgAttrType, defValue = undefined, nc = _SvgNumConversion.Default, lCtx = _SvgLengthContext.Other, inheritable = false) {
			wjcCore.assert(!!owner, _Errors.ValueCannotBeEmpty('owner'));
			wjcCore.assert(!!propName, _Errors.ValueCannotBeEmpty('propName'));

			this._owner = owner;
			this._propName = propName;
			this._propType = propType;
			this._defValue = defValue;
			this._inheritable = inheritable;
			this._nc = nc;
			this._pCtx = lCtx;
			this._searchValue = true;
		}

		public get hasVal(): boolean {
			return this._val != null;
		}

		public get val(): T {
			if (this._val != null) {
				return this._val;
			} else {
				var value = wjcCore.isFunction(this._defValue) ? (<Function>this._defValue).call(this, this._owner.ctx) : this._defValue;
				return this._parse(value);
			}
		}

		public set val(value: T) {
			this._searchValue = false;
			this._value = value;
		}

		protected get _val(): any {
			if (this._searchValue) {
				this._searchValue = false;

				var value;

				for (var p = this._owner; p; p = p.parent) {
					value = p.attr(this._propName);

					if (!(this._inheritable && (value == null || value == 'inherit'))) {
						break;
					}
				}

				this._value = (value === 'inherit') ? undefined : this._parse(value);
			}

			return this._value;
		}

		public reset(): void {
			this._value = undefined;
			this._searchValue = true;
		}

		protected _parse(value: any, nc?: _SvgNumConversion): any {
			var value = _SvgAttr.parseValue(value, this._propType, this._owner.viewport, this._pCtx, nc || this._nc);
			return value;
		}
	}

	export class _SvgNumAttr extends _SvgAttr<number> {
		constructor(owner: _SvgElementBase, propName: string, defValue = undefined, nc = _SvgNumConversion.Default, pCtx = _SvgLengthContext.Other, inheritable?: boolean) {
			super(owner, propName, _SvgAttrType.Number, defValue, nc, pCtx, inheritable);
		}
	}

	export class _SvgStrAttr extends _SvgAttr<string> {
		constructor(owner: _SvgElementBase, propName: string, defValue?: any, inheritable?: boolean) {
			super(owner, propName, _SvgAttrType.String, defValue, undefined, undefined, inheritable);
		}
	}

	//#endregion Basic attributes

	export class _SvgColorAttr extends _SvgAttr<string> {
		constructor(owner: _SvgElementBase, propName: string, defValue = undefined, inheritable = true) {
			super(owner, propName, _SvgAttrType.String, defValue, _SvgNumConversion.None, _SvgLengthContext.Other, inheritable);
		}

		public asHref(): string {
			var match = this.val.match(/url\((.+)\)/);
			if (match) {
				return match[1];
			}
			return null;
		}

		protected _parse(value: any): any {
			if (value === '' || value === 'null' || value === 'undefined') { // handle wijmo5 invalid values
				return undefined; // use default value then
			}

			return super._parse(value);
		}
	}

	export class _SvgDashArrayAttr extends _SvgAttr<number[]> {
		constructor(owner: _SvgElementBase) {
			super(owner, 'stroke-dasharray', _SvgAttrType.Number, undefined, _SvgNumConversion.Px, _SvgLengthContext.Other, true);
		}

		protected _parse(value: any): number[] {
			var res: number[],
				vals = (<string>value || '').trim().split(/[\s,]+/);

			if (vals.length) {
				res = [];

				try {
					for (var i = 0; i < vals.length; i++) {
						if (vals[i]) {
							res.push(super._parse(vals[i]));
						}
					}
				} catch (ex) {
					return undefined;
				}

				return res.length ? res : undefined;
			}

			return res;
		}
	}

	export class _SvgFillRuleAttr extends _SvgAttr<PdfFillRule> {
		constructor(owner: _SvgElementBase, propName: string) {
			super(owner, propName, _SvgAttrType.String, PdfFillRule.NonZero, undefined, undefined, true);
		}

		protected _parse(value: string): PdfFillRule {
			if (wjcCore.isNumber(value)) { // defValue
				return <any>value;
			} else {
				var match = (value || '').match(/(nonzero|evenodd)/i);
				if (match) {
					return match[1] === 'nonzero' ? PdfFillRule.NonZero : PdfFillRule.EvenOdd;
				}
				return undefined;
			}
		}
	}

	// supports attributes like attr="smth" and attr="url(smth)"
	export class _SvgHRefAttr extends _SvgStrAttr {
		constructor(owner: _SvgElementBase, propName: string) {
			super(owner, propName);
		}

		protected _parse(value: string): string {
			value = (value || '').trim();

			// url(smth) => smth
			var match = value.match(/url\((.+)\)/);
			if (match) {
				value = match[1].trim();
			}

			// "smth" => smth
			value = value.replace(/["']/g, '');

			return value;
		}
	}

	// supports attributes like attr="#id" and attr="url(#id)"
	export class _SvgIdRefAttr extends _SvgHRefAttr {
		protected _parse(value: string): string {
			value = super._parse(value);

			// #smth => smth
			if (value && value[0] === '#') {
				return value.substring(1);
			}

			return undefined;
		}
	}

	export class _SvgPointsArrayAttr extends _SvgAttr<wjcCore.Point[]> {
		constructor(owner: _SvgElementBase, propName: string) {
			super(owner, propName, _SvgAttrType.Number, undefined, _SvgNumConversion.Px);
		}

		protected _parse(value: any): wjcCore.Point[] {
			var res: wjcCore.Point[],
				vals = (<string>value || '').trim().split(/[\s,]+/),
				len = Math.floor(vals.length / 2) * 2;

			if (len) {
				res = [];

				try {
					for (var i = 0; i < len - 1; i = i + 2) {
						res.push(new wjcCore.Point(super._parse(vals[i]), super._parse(vals[i + 1])));
					}
				}
				catch (ex) {
					return undefined;
				}
			}

			return res;
		}
	}

	export class _SvgTransformAttr extends _SvgAttr<((doc: PdfPageArea) => void)[]> {
		constructor(owner: _SvgElementBase) {
			super(owner, 'transform', _SvgAttrType.Number, undefined, _SvgNumConversion.None);
		}

		public apply(element: _SvgElementBase): void {
			var area = element.ctx.area;

			if (this.hasVal) {
				this.val.forEach((item) => {
					item(area);
				});
			}
		}

		protected _parse(value: any): ((doc: PdfPageArea) => void)[] {
			var res: ((doc: PdfPageArea) => void)[] = [],
				match = (<string>value || '').match(/((matrix|translate|scale|rotate|skewX|skewY)\([^\)]+\))+/g);

			if (match) {
				for (var i = 0; i < match.length; i++) {
					var item = match[i],
						sgnr = item.match(/(\w+)\(([^\)]+)\)/),
						args: number[] = [];

					try {
						sgnr[2].trim().split(/[\s,]+/).forEach((numStr: string) => {
							if (numStr) {
								args.push(super._parse(numStr, _SvgNumConversion.None));
							}
						});
					} catch (ex) {
						return undefined;
					}

					if (args.length) {
						// replace closures with bind?
						switch (sgnr[1]) {
							case 'matrix':
								res.push(((a: number, b: number, c: number, d: number, e: number, f: number) => {
									return (area: PdfPageArea) => {
										area.transform(a, b, c, d, e, f);
									}
								})(args[0], args[1], args[2], args[3], super._parse(args[4], _SvgNumConversion.Px), super._parse(args[5], _SvgNumConversion.Px)));
								break;

							case 'translate':
								res.push(((x: number, y: number) => {
									return (area: PdfPageArea) => {
										area.translate(x, y);
									}
								})(super._parse(args[0], _SvgNumConversion.Px), super._parse(args[1] || 0, _SvgNumConversion.Px)));
								break;

							case 'scale':
								res.push(((xFactor: number, yFactor: number) => {
									return (area: PdfPageArea) => {
										area.scale(xFactor, yFactor);
									}
								})(args[0], args[1]));
								break;

							case 'rotate':
								res.push(((angle: number, point: wjcCore.Point) => {
									return (area: PdfPageArea) => {
										area.rotate(angle, point);
									}
								})(args[0], new wjcCore.Point(super._parse(args[1] || 0, _SvgNumConversion.Px), super._parse(args[2] || 0, _SvgNumConversion.Px))));
								break;

							case 'skewX':
								res.push(((angle: number) => {
									return (area: PdfPageArea) => {
										area.transform(1, 0, angle, 1, 0, 0);
									}
								})(Math.tan(args[0] * Math.PI / 180)));
								break;

							case 'skewY':
								res.push(((angle: number) => {
									return (area: PdfPageArea) => {
										area.transform(1, angle, 0, 1, 0, 0);
									}
								})(Math.tan(args[0] * Math.PI / 180)));
								break;
						}
					}
				}
			}

			return res.length ? res : undefined;
		}
	}

	export class _SvgTextDecorationAttr extends _SvgAttr<string[]> {
		constructor(owner: _SvgElementBase) {
			super(owner, 'text-decoration', _SvgAttrType.String, undefined, _SvgNumConversion.None);
		}

		protected _parse(value: any): string[] {
			var res: string[],
				vals = (<string>value || '').trim().toLowerCase().split(/[\s,]+/);

			if (vals.length) {
				res = [];

				for (var i = 0; i < vals.length; i++) {
					if (/line-through|overline|underline/.test(vals[i])) {
						res.push(vals[i]);
					}
				}
			}

			return res && res.length ? res : undefined;
		}
	}

	export interface _ISvgViewBoxAttr {
		minX: number;
		minY: number;
		width: number;
		height: number;
	}

	export class _SvgViewboxAttr extends _SvgAttr<_ISvgViewBoxAttr> {
		constructor(owner: _SvgElementBase) {
			super(owner, 'viewBox', _SvgAttrType.Number, undefined, _SvgNumConversion.Px);
		}

		protected _parse(value: any): _ISvgViewBoxAttr {
			var res: _ISvgViewBoxAttr,
				vals = (<string>value || '').trim().split(/[\s,]+/);

			if (vals.length === 4) {
				res = {
					minX: super._parse(vals[0]),
					minY: super._parse(vals[1]),
					width: super._parse(vals[2]),
					height: super._parse(vals[3])
				};
			}

			return res;
		}
	}

	export interface _ISvgPreserveAspectRatioAttr {
		align: string;
		meet: boolean;
	}

	export class _SvgPreserveAspectRatioAttr extends _SvgAttr<_ISvgPreserveAspectRatioAttr> {
		constructor(owner: _SvgElementBase) {
			super(owner, 'preserveAspectRatio', _SvgAttrType.Number, 'xMidYMid meet');
		}

		protected _parse(value: any): _ISvgPreserveAspectRatioAttr {
			var res: _ISvgPreserveAspectRatioAttr;

			if (typeof (value) === 'string') {
				var vals = (<string>value).replace(/^defer\s+/, '').trim().split(/\s+/);  // skip 'defer', it is used only with images

				res = {
					align: vals[0],
					meet: !vals[1] || (vals[1] === 'meet')
				};
			} else {
				res = value;
			}

			return res;
		}
	}

	// combines both viewBox and preserveAspectRatio attributes
	export class _SvgScaleAttributes {
		private _owner: _SvgElementBase;

		public aspect: _SvgPreserveAspectRatioAttr;
		public viewBox: _SvgViewboxAttr;

		constructor(owner: _SvgElementBase) {
			this._owner = owner;
			this.aspect = new _SvgPreserveAspectRatioAttr(this._owner);
			this.viewBox = new _SvgViewboxAttr(this._owner);
		}

		public apply(element: _SvgElementBase): wjcCore.Size {
			var area = element.ctx.area,
				viewPort = element.viewport,
				viewBox = this.viewBox.val;

			if (viewPort && viewBox) {
				if (viewBox.width && viewBox.height) {
					var ar = this.aspect.val,
						sx = viewPort.width / viewBox.width,
						sy = viewPort.height / viewBox.height,
						sMin = Math.min(sx, sy),
						sMax = Math.max(sx, sy),
						uniScaledWidth = viewBox.width * (ar.meet ? sMin : sMax),
						uniScaledHeight = viewBox.height * (ar.meet ? sMin : sMax);

					if (ar.align === 'none') { // non-uniform scaling
						area.scale(sx, sy);
					} else { // uniform scaling
						var scale = ar.meet ? sMin : sMax,
							tx = 0, ty = 0;

						if (ar.align.match(/^xMid/) && (scale === sy)) {
							tx = viewPort.width / 2 - uniScaledWidth / 2;
						} else {
							if (ar.align.match(/^xMax/) && (scale === sy)) {
								tx = viewPort.width - uniScaledWidth;
							}
						}

						if (ar.align.match(/YMid$/) && (scale === sx)) {
							ty = viewPort.height / 2 - uniScaledHeight / 2;
						} else {
							if (ar.align.match(/YMax$/) && (scale === sx)) {
								ty = viewPort.height - uniScaledHeight;
							}
						}

						if (tx || ty) {
							area.translate(tx, ty);
						}

						if (ar.meet) {
							area.scale(sMin, sMin);
						} else {
							area.scale(sMax, sMax);
						}

						if (viewBox.minX || viewBox.minY) {
							area.translate(-viewBox.minX, -viewBox.minY);
						}
					}
				}

				//return new Size(viewPort.width / sx, viewPort.height / sy);
				return new wjcCore.Size(viewBox.width, viewBox.height); // establish a new viewport.  
			}

			return viewPort;
		}
	}

	// combines all stroking attributes
	export class _SvgStrokeAttributes {
		private _owner: _SvgElementBase;

		public color: _SvgColorAttr;
		public dashArray: _SvgDashArrayAttr;
		public dashOffset: _SvgNumAttr;
		public lineCap: _SvgStrAttr;
		public lineJoin: _SvgStrAttr;
		public miterLimit: _SvgNumAttr;
		public opacity: _SvgNumAttr;
		public width: _SvgNumAttr;

		constructor(owner: _SvgElementBase) {
			this._owner = owner;

			this.color = new _SvgColorAttr(this._owner, 'stroke', 'none');
			this.dashArray = new _SvgDashArrayAttr(this._owner);
			this.dashOffset = new _SvgNumAttr(this._owner, 'stroke-dashoffset', 0, _SvgNumConversion.Default, _SvgLengthContext.Other, true);
			this.lineCap = new _SvgStrAttr(this._owner, 'stroke-linecap', 'butt', true);
			this.lineJoin = new _SvgStrAttr(this._owner, 'stroke-linejoin', 'miter', true);
			this.miterLimit = new _SvgNumAttr(this._owner, 'stroke-miterlimit', 4, _SvgNumConversion.None, _SvgLengthContext.Other, true);
			this.opacity = new _SvgNumAttr(this._owner, 'stroke-opacity', 1, _SvgNumConversion.None, _SvgLengthContext.Other, true);
			this.width = new _SvgNumAttr(this._owner, 'stroke-width', 1, _SvgNumConversion.Default, _SvgLengthContext.Other, true);
		}

		public toPen(element?: _SvgElementBase): PdfPen {
			var color = new wjcCore.Color(this.color.val);

			if (this.opacity.hasVal) {
				color.a = this.opacity.val;
			}

			var pen = new PdfPen(color, this.width.val);

			if (this.dashArray.hasVal) {
				var dashes = this.dashArray.val;

				if (dashes.length) {
					pen.dashPattern = new PdfDashPattern(dashes[0],
						dashes.length > 1 ? dashes[1] : undefined,
						this.dashOffset.val);
				}
			}

			switch (this.lineCap.val) {
				case 'butt':
					pen.cap = PdfLineCapStyle.Butt;
					break;

				case 'round':
					pen.cap = PdfLineCapStyle.Round;
					break;

				case 'square':
					pen.cap = PdfLineCapStyle.Square;
					break;
			}

			switch (this.lineJoin.val) {
				case 'miter':
					pen.join = PdfLineJoinStyle.Miter;
					break;

				case 'round':
					pen.join = PdfLineJoinStyle.Round;
					break;

				case 'bevel':
					pen.join = PdfLineJoinStyle.Bevel;
					break;
			}

			pen.miterLimit = this.miterLimit.val;

			return pen;
		}
	}

	// combines all the filling attributes
	export class _SvgFillAttributes {
		private _owner: _SvgElementBase;

		public color: _SvgColorAttr;
		public opacity: _SvgNumAttr;
		public rule: _SvgFillRuleAttr;

		constructor(owner: _SvgElementBase) {
			this._owner = owner;

			this.color = new _SvgColorAttr(this._owner, 'fill', 'black');
			this.opacity = new _SvgNumAttr(this._owner, 'fill-opacity', 1, _SvgNumConversion.None, undefined, true);
			this.rule = new _SvgFillRuleAttr(this._owner, 'fill-rule');
		}

		public toBrush(element?: _SvgElementBase): PdfBrush {
			let color: wjcCore.Color;
			let href: string = this.color.asHref();

			if (href && element) {
				var gradient = element.ctx.getElement(href);
				if (gradient instanceof _SvgLinearGradientElementImpl) {
					return (<_SvgLinearGradientElementImpl>gradient).toBrush(element);
				}
			}

			color = new wjcCore.Color(this.color.val);
			if (this.opacity.hasVal) {
				color.a = this.opacity.val;
			}

			return new PdfSolidBrush(color);
		}
	}

	// combines all of the font attributes
	export class _SvgFontAttributes {
		private _owner: _SvgElementBase;

		public family: _SvgStrAttr;
		public size: _SvgAttr<string | number>;
		public style: _SvgStrAttr;
		public weight: _SvgStrAttr;

		constructor(owner: _SvgElementBase) {
			this._owner = owner;
			this.family = new _SvgStrAttr(this._owner, 'font-family', (ctx: _ISvgRenderContext) => {
				var font = ctx.area._pdfdoc._getFont();
				return font ? font.family : undefined;
			}, true);
			this.size = new _SvgAttr<string | number>(this._owner, 'font-size', _SvgAttrType.Number | _SvgAttrType.String, 'medium', undefined, _SvgLengthContext.Other, true);
			this.style = new _SvgStrAttr(this._owner, 'font-style', 'normal', true);
			this.weight = new _SvgStrAttr(this._owner, 'font-weight', 'normal', true);
		}

		public toFont(): PdfFont {
			var size = _asPt(this.size.val); // handle string values like 'small', 'medium' etc
			return new PdfFont(this.family.val, size, this.style.val, this.weight.val);
		}
	}

	export class _SvgStyleAttributes {
		private _owner: _SvgElementBase;
		public fill: _SvgFillAttributes;
		public font: _SvgFontAttributes;
		public stroke: _SvgStrokeAttributes;
		public clipRule: _SvgFillRuleAttr;

		constructor(owner: _SvgElementBase) {
			this._owner = owner;
			this.clipRule = new _SvgFillRuleAttr(this._owner, 'clip-rule');
			this.fill = new _SvgFillAttributes(this._owner);
			this.font = new _SvgFontAttributes(this._owner);
			this.stroke = new _SvgStrokeAttributes(this._owner);
		}

		public apply(element: _SvgElementBase, fill?: boolean, stroke?: boolean): void {
			var area = element.ctx.area;

			if (element.renderMode === _SvgRenderMode.Clip) {
				// Clipping has been moved to the _SvgClippableElementBase.render() method because in PDF the clipping operator
				// intersects (not unites) a given path with the current clipping path to create a new one, so we need to call
				// the clip() method only once to unite all the clipPath's nested elements.

				// area.paths.clip(this.clipRule.val);
			} else { // fill + stroke
				if (fill && stroke && this.fill.color.val !== 'none' && this.stroke.color.val !== 'none') {
					area.paths.fillAndStroke(this.fill.toBrush(element), this.stroke.toPen(element), this.fill.rule.val);
				} else {
					if (fill && (this.fill.color.val !== 'none')) {
						area.paths.fill(this.fill.toBrush(element), this.fill.rule.val);
					} else {
						if (stroke && (this.stroke.color.val !== 'none')) {
							area.paths.stroke(this.stroke.toPen(element));
						} else { // use transparent color then (we need to finish the current path anyway).
							area.paths.stroke(wjcCore.Color.fromRgba(0, 0, 0, 0));
						}
					}
				}
			}
		}
	}


	'use strict';

	//#region Base elements

	export enum _SvgRenderMode {
		Render,
		Ignore,
		Clip
	}

	export interface _ISvgElementBaseCtor {
		new (ctx: _ISvgRenderContext, node: SVGElement, defRenderMode?: _SvgRenderMode): _SvgElementBase;
	}

	export class _SvgElementBase {
		private _children: _SvgElementBase[] = [];
		private _attributes = {};
		private _parent: _SvgElementBase;
		private _style: _SvgStyleAttributes;
		private _ctx: _ISvgRenderContext;
		private _viewport: wjcCore.Size;
		private _defRenderMode: _SvgRenderMode;
		private _curRenderMode: _SvgRenderMode;

		// at the moment the 'node' argument is used ONLY by the _SvgStyleElementImpl class.
		constructor(ctx: _ISvgRenderContext, node: SVGElement, defRenderMode = _SvgRenderMode.Render) {
			this._defRenderMode = defRenderMode;
			this._ctx = ctx;
		}

		//#region public

		public get children(): _SvgElementBase[] {
			return this._children;
		}

		public get ctx(): _ISvgRenderContext {
			return this._ctx;
		}

		public get parent(): _SvgElementBase {
			return this._parent;
		}
		public set parent(value: _SvgElementBase) {
			this._parent = value;
		}

		public get style(): _SvgStyleAttributes {
			if (!this._style) {
				this._style = new _SvgStyleAttributes(this);
			}

			return this._style;
		}

		public get viewport(): wjcCore.Size {
			return this._viewport;
		}
		public set viewport(value: wjcCore.Size) {
			this._viewport = value.clone();
		}

		public attr(name: string, value?: any): any {
			name = name.toLowerCase();

			if (arguments.length > 1) {
				this._attributes[name] = value;
			}

			return this._attributes[name];
		}

		public appendNode(node: _SvgElementBase): void {
			if (!node || (node === this)) {
				return;
			}

			if (node.parent !== this) {
				node.remove();

				this.children.push(node);
				node.parent = this;
			}
		}

		public copyAttributesFrom(el: _SvgElementBase, except?: string[]): void {
			if (!el) {
				return;
			}

			var fa = el._attributes,
				ta = this._attributes;

			for (var key in fa) {
				if (fa.hasOwnProperty(key) && (ta[key] == null) && (!except || (except.indexOf(key) < 0))) {
					ta[key] = fa[key];
				}
			}
		}

		public clone(): _SvgElementBase {
			var el = <_SvgElementBase>new (Function.prototype.bind.call(this.constructor, null /*this*/, this.ctx, null /*node*/));

			el.copyAttributesFrom(this);

			// clone children
			this._children.forEach((item) => {
				el.appendNode(item.clone());
			});

			return el;
		}

		public remove(): void {
			var p = this.parent;

			if (p) {
				for (var i = 0; i < p.children.length; i++) {
					if (p.children[i] === this) {
						p.children.splice(i, 1);
						break;
					}
				}

				this.parent = null;
			}
		}

		public clearAttr(name: string): void {
			delete this._attributes[name.toLowerCase()];
		}

		public render(viewPort: wjcCore.Size, renderMode?: _SvgRenderMode): void {
			this._viewport = viewPort.clone();

			if ((this._curRenderMode = renderMode || this._defRenderMode) !== _SvgRenderMode.Ignore) {
				this._render();
			}
		}

		public get renderMode(): _SvgRenderMode {
			return this._curRenderMode;
		}

		//#endregion

		//#region protected

		protected _render(): void {
			this._renderContent();
		}

		protected _renderContent(): void {
			for (var i = 0; i < this._children.length; i++) {
				this._children[i].render(this.viewport, this.renderMode);
			}
		}

		//#endregion
	}

	export class _SvgClippableElementBase extends _SvgElementBase {
		private _clipPath: _SvgIdRefAttr;

		constructor(ctx: _ISvgRenderContext, node: SVGElement, defRenderMode = _SvgRenderMode.Render) {
			super(ctx, node, defRenderMode);
			this._clipPath = new _SvgIdRefAttr(this, 'clip-path');
		}

		protected _render(): void {
			var clip: boolean,
				area = this.ctx.area;

			if (this._clipPath.val) {
				var clipPath = <_SvgClipPathElementImpl>this.ctx.getElement(this._clipPath.val);
				if (clip = !!(clipPath && (clipPath instanceof _SvgClipPathElementImpl))) {
					area._pdfdoc.saveState();
					clipPath.render(this.viewport, _SvgRenderMode.Clip); // force rendering using a clipping mode
					area.paths.clip(this.style.clipRule.val);
				}
			}

			super._render();

			if (clip) {
				area._pdfdoc.restoreState();
			}
		}
	}

	export class _SvgTransformableElementBase extends _SvgClippableElementBase {
		private _transform: _SvgTransformAttr;

		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node);
			this._transform = new _SvgTransformAttr(this);
		}

		protected _render(): void {
			var transform = this._transform.hasVal && this.renderMode !== _SvgRenderMode.Clip; // clipping path cannot use tranformations

			if (transform) {
				this.ctx.area._pdfdoc.saveState();
				this._transform.apply(this);
			}

			super._render();

			if (transform) {
				this.ctx.area._pdfdoc.restoreState();
			}
		}
	}

	//#endregion Base elements



	//#region Shape elements

	export class _SvgShapeElementBase extends _SvgTransformableElementBase {
		protected _fill = true;
		protected _stroke = true;

		protected _renderContent(): void {
			//super._renderContent();
			this._draw();
			this.style.apply(this, this._fill, this._stroke);
		}

		protected _draw(): void {
			wjcCore.assert(false, _Errors.AbstractMethod);
		}
	}

	export class _SvgCircleElementImpl extends _SvgShapeElementBase {
		protected _draw(): void {
			var r = new _SvgNumAttr(this, 'r', 0).val;

			if (r > 0) {
				var cx = new _SvgNumAttr(this, 'cx', 0, _SvgNumConversion.Default, _SvgLengthContext.Width).val,
					cy = new _SvgNumAttr(this, 'cy', 0, _SvgNumConversion.Default, _SvgLengthContext.Height).val;

				this.ctx.area.paths.circle(cx, cy, r);
			}
		}
	}

	export class _SvgEllipseElementImpl extends _SvgShapeElementBase {
		protected _draw(): void {
			var rx = new _SvgNumAttr(this, 'rx', 0, _SvgNumConversion.Default, _SvgLengthContext.Width).val,
				ry = new _SvgNumAttr(this, 'ry', 0, _SvgNumConversion.Default, _SvgLengthContext.Height).val;

			if (rx > 0 && ry > 0) {
				var cx = new _SvgNumAttr(this, 'cx', 0, _SvgNumConversion.Default, _SvgLengthContext.Width).val,
					cy = new _SvgNumAttr(this, 'cy', 0, _SvgNumConversion.Default, _SvgLengthContext.Height).val;

				this.ctx.area.paths.ellipse(cx, cy, rx, ry);
			}
		}
	}

	export class _SvgLineElementImpl extends _SvgShapeElementBase {
		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node);
			this._fill = false;
		}

		protected _draw(): void {
			var x1 = new _SvgNumAttr(this, 'x1', 0, _SvgNumConversion.Default, _SvgLengthContext.Width).val,
				y1 = new _SvgNumAttr(this, 'y1', 0, _SvgNumConversion.Default, _SvgLengthContext.Height).val,
				x2 = new _SvgNumAttr(this, 'x2', 0, _SvgNumConversion.Default, _SvgLengthContext.Width).val,
				y2 = new _SvgNumAttr(this, 'y2', 0, _SvgNumConversion.Default, _SvgLengthContext.Height).val;

			this.ctx.area.paths
				.moveTo(x1, y1)
				.lineTo(x2, y2);
		}
	}

	export class _SvgPathElementImpl extends _SvgShapeElementBase {
		private _d: _SvgStrAttr;

		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node);
			this._d = new _SvgStrAttr(this, 'd');
		}

		protected _renderContent() {
			var area = this.ctx.area;

			if (this.renderMode === _SvgRenderMode.Clip) {
				// the element is placed within the "clip-path" element, we can't use scale + saveState\ restoreState here
				// because it isolates clipping from an element that refers to the "clip-path" element.
				if (this._d.hasVal) {
					var path = _PdfSvgPathHelper.scale(this._d.val, 0.75); // px -> pt
					this.attr('d', path);
					this._d.reset();
				}
				super._renderContent();
			} else {
				area._pdfdoc.saveState();
				area.scale(0.75); // px -> pt
				super._renderContent();
				area._pdfdoc.restoreState();
			}
		}

		protected _draw(): void {
			if (this._d.hasVal) {
				this.ctx.area.paths.svgPath(this._d.val);
			}
		}
	}

	export class _SvgPolylineElementImpl extends _SvgShapeElementBase {
		protected _draw(): boolean {
			var _points = new _SvgPointsArrayAttr(this, 'points');

			if (_points.hasVal) {
				var points = _points.val,
					area = this.ctx.area;

				if (points.length > 1) {
					for (var i = 0; i < points.length; i++) {
						if (i == 0) {
							area.paths.moveTo(points[i].x, points[i].y);
						} else {
							area.paths.lineTo(points[i].x, points[i].y);
						}
					}

					return true;
				}
			}

			return false;
		}
	}

	export class _SvgPolygonElementImpl extends _SvgPolylineElementImpl {
		protected _draw(): boolean {
			if (super._draw()) {
				this.ctx.area.paths.closePath();
				return true;
			}

			return false;
		}
	}

	export class _SvgRectElementImpl extends _SvgShapeElementBase {
		protected _draw(): void {
			var w = new _SvgNumAttr(this, 'width', 0, _SvgNumConversion.Default, _SvgLengthContext.Width).val,
				h = new _SvgNumAttr(this, 'height', 0, _SvgNumConversion.Default, _SvgLengthContext.Height).val;

			if (w > 0 && h > 0) {
				var x = new _SvgNumAttr(this, 'x', 0, _SvgNumConversion.Default, _SvgLengthContext.Width).val,
					y = new _SvgNumAttr(this, 'y', 0, _SvgNumConversion.Default, _SvgLengthContext.Height).val,
					rx = Math.max(new _SvgNumAttr(this, 'rx', 0, _SvgNumConversion.Default, _SvgLengthContext.Width).val, 0),
					ry = Math.max(new _SvgNumAttr(this, 'ry', 0, _SvgNumConversion.Default, _SvgLengthContext.Height).val, 0),
					paths = this.ctx.area.paths;

				if (rx || ry) {
					rx = Math.min(rx || ry, w / 2);
					ry = Math.min(ry || rx, h / 2);

					// An updated version of the PdfKit's roundedRect method
					paths.moveTo(x + rx, y)
					paths.lineTo(x + w - rx, y)
					paths.quadraticCurveTo(x + w, y, x + w, y + ry);
					paths.lineTo(x + w, y + h - ry);
					paths.quadraticCurveTo(x + w, y + h, x + w - rx, y + h);
					paths.lineTo(x + rx, y + h);
					paths.quadraticCurveTo(x, y + h, x, y + h - ry);
					paths.lineTo(x, y + ry);
					paths.quadraticCurveTo(x, y, x + rx, y);
				} else {
					paths.rect(x, y, w, h);
				}
			}
		}
	}

	//#endregion Shape elements



	//#region Other elements

	export class _SvgClipPathElementImpl extends _SvgElementBase /*_TransformableElementBase*/ { // clipping path can not use tranformations
		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node, _SvgRenderMode.Ignore);
		}
	}

	export class _SvgDefsElementImpl extends _SvgClippableElementBase {
		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node, _SvgRenderMode.Ignore);
		}
	}

	export class _SvgGElementImpl extends _SvgTransformableElementBase {
	}

	export class _SvgLinearGradientElementImpl extends _SvgElementBase {
		private _x1: _SvgStrAttr;
		private _x2: _SvgStrAttr;
		private _y1: _SvgStrAttr;
		private _y2: _SvgStrAttr;
		private _gradientUnits: _SvgStrAttr;

		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node, _SvgRenderMode.Ignore);

			// context-dependent values, read as strings
			this._x1 = new _SvgStrAttr(this, 'x1', '0%');
			this._x2 = new _SvgStrAttr(this, 'x2', '100%');
			this._y1 = new _SvgStrAttr(this, 'y1', '0%');
			this._y2 = new _SvgStrAttr(this, 'y2', '0%');

			this._gradientUnits = new _SvgStrAttr(this, 'gradientUnits', 'objectBoundingBox');
		}

		public toBrush(element: _SvgElementBase): PdfLinearGradientBrush {
			// move to base class?
			var	rect = new wjcCore.Rect(new _SvgNumAttr(element, 'x', 0, _SvgNumConversion.Default, _SvgLengthContext.Width).val,
					new _SvgNumAttr(element, 'y', 0, _SvgNumConversion.Default, _SvgLengthContext.Height).val,
					new _SvgNumAttr(element, 'width', 0, _SvgNumConversion.Default, _SvgLengthContext.Width).val,
					new _SvgNumAttr(element, 'height', 0, _SvgNumConversion.Default, _SvgLengthContext.Height).val),

				vp = (this._gradientUnits.val === 'objectBoundingBox')
					? new wjcCore.Size(rect.width, rect.height)
					: element.viewport.clone(); // not tested

			var x1 = _SvgNumAttr.parseValue(this._x1.val, _SvgAttrType.Number, vp, _SvgLengthContext.Width, _SvgNumConversion.Default),
				x2 = _SvgNumAttr.parseValue(this._x2.val, _SvgAttrType.Number, vp, _SvgLengthContext.Width, _SvgNumConversion.Default),
				y1 = _SvgNumAttr.parseValue(this._y1.val, _SvgAttrType.Number, vp, _SvgLengthContext.Height, _SvgNumConversion.Default),
				y2 = _SvgNumAttr.parseValue(this._y2.val, _SvgAttrType.Number, vp, _SvgLengthContext.Height, _SvgNumConversion.Default),
				stops: PdfGradientStop[] = [];

			for (var i = 0; i < this.children.length; i++) {
				if (this.children[i] instanceof _SvgStopElementImpl) {
					var stop = <_SvgStopElementImpl>this.children[i];

					stops.push(new PdfGradientStop(
						_SvgNumAttr.parseValue(stop.offset.val, _SvgAttrType.Number, vp, _SvgLengthContext.Other, _SvgNumConversion.Default),
						stop.color.val,
						stop.opacity.val));
				}
			}

			return new PdfLinearGradientBrush(rect.left + x1, rect.top + y1, rect.left + x2, rect.top + y2, stops);
		}
	}

	export class _SvgStopElementImpl extends _SvgElementBase {
		public color: _SvgColorAttr;
		public opacity: _SvgNumAttr;
		public offset: _SvgStrAttr;

		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node, _SvgRenderMode.Ignore);

			this.color = new _SvgColorAttr(this, 'stop-color', 'black');
			this.opacity = new _SvgNumAttr(this, 'stop-opacity', 1, _SvgNumConversion.None, undefined, true);
			this.offset = new _SvgStrAttr(this, 'offset', '0'); // context-dependent value, read as string.
		}
	}

	export class _SvgImageElementImpl extends _SvgTransformableElementBase {
		private _x: _SvgNumAttr;
		private _y: _SvgNumAttr;
		private _width: _SvgNumAttr;
		private _height: _SvgNumAttr;
		private _href: _SvgHRefAttr;
		private _par: _SvgPreserveAspectRatioAttr;

		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node);

			this._x = new _SvgNumAttr(this, 'x', 0, _SvgNumConversion.Default, _SvgLengthContext.Width);
			this._y = new _SvgNumAttr(this, 'y', 0, _SvgNumConversion.Default, _SvgLengthContext.Height);
			this._width = new _SvgNumAttr(this, 'width', 0, _SvgNumConversion.Default, _SvgLengthContext.Width);
			this._height = new _SvgNumAttr(this, 'height', 0, _SvgNumConversion.Default, _SvgLengthContext.Height);
			this._href = new _SvgHRefAttr(this, 'xlink:href');

			this._par = new _SvgPreserveAspectRatioAttr(this);
		}

		protected _renderContent(): void {
			var width = this._width.val,
				height = this._height.val;

			if (width > 0 && height > 0 && this._href.hasVal) {
				var url = _resolveUrlIfRelative(this._href.val, this.ctx.urlResolver);

				if (url) {
					this.ctx.area._pdfdoc.saveState();

					if (this._x.val || this._y.val) {
						this.ctx.area.translate(this._x.val, this._y.val);
					}

					this.viewport = new wjcCore.Size(width, height);

					try {
						if (this._href.val.match(/\.svg$/i)) { // need a better detection??
							this._renderSvgImage(url);
						} else {
							this._renderRasterImage(url);
						}
					} catch (ex) {
					}

					this.ctx.area._pdfdoc.restoreState();
				}
			}
		}

		private _renderSvgImage(url: string): void {
			var xhrError: string,
				str = _XhrHelper.text(url, xhr => xhrError = xhr.statusText);

			wjcCore.assert(xhrError == null, xhrError);

			var svg = new _SvgRenderer(str, this.ctx.area),
				r = svg.root;

			this.attr('viewBox', r.attr('viewBox'));
			r.clearAttr('viewBox');
			r.clearAttr('x');
			r.clearAttr('y');
			r.clearAttr('width');
			r.clearAttr('height');
			r.clearAttr('preserveAspectRatio');
			r.clearAttr('clip');
			r.clearAttr('overflow');

			this.ctx.area.paths.rect(0, 0, this.viewport.width, this.viewport.height).clip();

			var scale = new _SvgScaleAttributes(this); // uses fake 'viewBox' attribute, see above
			svg.render(scale.apply(this));
		}

		private _renderRasterImage(url: string): void {
			var dataUri = _PdfImageHelper.getDataUri(url),
				ar = this._par.val,
				opt: IPdfImageDrawSettings = {
					width: this.viewport.width,
					height: this.viewport.height,
					align: PdfImageHorizontalAlign.Left,
					vAlign: PdfImageVerticalAlign.Top
				};

			if (ar.align === 'none') {
				opt.stretchProportionally = false;
			} else {
				// * Uniform scaling. The preserveAspectRatio's 'slice' mode is ignored (treated as 'meet'), to support preserveAspectRatio completely we need to know the referenced image sizes. *

				opt.stretchProportionally = true;

				if (ar.align.match(/^xMid/)) {
					opt.align = PdfImageHorizontalAlign.Center;
				} else {
					if (ar.align.match(/^xMax/)) {
						opt.align = PdfImageHorizontalAlign.Right;
					}
				}

				if (ar.align.match(/YMid$/)) {
					opt.vAlign = PdfImageVerticalAlign.Center;
				} else {
					if (ar.align.match(/YMax$/)) {
						opt.vAlign = PdfImageVerticalAlign.Bottom;
					}
				}
			}

			this.ctx.area.drawImage(dataUri, 0, 0, opt);
		}
	}

	export class _SvgStyleElementImpl extends _SvgElementBase {
		constructor(ctx: _ISvgRenderContext, node: SVGStyleElement) {
			super(ctx, node, _SvgRenderMode.Ignore);

			if (node && (!node.type || node.type === 'text/css')) {
				var css = '';

				for (var i = 0; i < node.childNodes.length; i++) {
					css += node.childNodes[i].textContent;
				}

				css = _compressSpaces(css);
				css = css.replace(/\/\*([^*]|\*+[^*/])*\*+\//gm, ''); // remove comments

				var rules = css.match(/[^{}]*{[^}]*}/g);
				if (rules) {
					for (var i = 0; i < rules.length; i++) {
						var rule = rules[i].match(/([^{}]*){([^}]*)}/);

						if (rule) {
							var selectors = rule[1].trim().split(','),
								declaration = rule[2].trim();

							if (selectors.length && declaration) {
								selectors.forEach(selector => {
									if (selector = selector.trim()) {
										this.ctx.registerCssRule(new _SvgCssRule(selector, declaration));
									}
								});
							}
						}
					}
				}
			}
		}
	}

	export class _SvgSvgElementImpl extends _SvgClippableElementBase {
		private _x: _SvgNumAttr;
		private _y: _SvgNumAttr;
		private _width: _SvgNumAttr;
		private _height: _SvgNumAttr;
		private _scale: _SvgScaleAttributes;
		private _overflow: _SvgStrAttr;

		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node);

			this._x = new _SvgNumAttr(this, 'x', 0, _SvgNumConversion.Default, _SvgLengthContext.Width);
			this._y = new _SvgNumAttr(this, 'y', 0, _SvgNumConversion.Default, _SvgLengthContext.Height);
			this._width = new _SvgNumAttr(this, 'width', '100%', _SvgNumConversion.Default, _SvgLengthContext.Width);
			this._height = new _SvgNumAttr(this, 'height', '100%', _SvgNumConversion.Default, _SvgLengthContext.Height);
			this._scale = new _SvgScaleAttributes(this);
			this._overflow = new _SvgStrAttr(this, 'overflow', 'hidden');
		}

		public get width(): _SvgNumAttr {
			return this._width;
		}

		public get height(): _SvgNumAttr {
			return this._height;
		}

		protected _render(): void {
			var area = this.ctx.area;

			area._pdfdoc.saveState();

			// pecentage values of these attributes are resolved using the old ("parent") viewport.
			var width = this._width.val,
				height = this._height.val,
				x = this._x.val,
				y = this._y.val;

			if (this.parent && (x || y)) {
				area.translate(x, y);
			}

			this.viewport = new wjcCore.Size(width, height);

			// don't clip the outermost svg element
			if (/*this.parent && */this._overflow.val !== 'visible') {
				area.paths.rect(0, 0, width, height).clip();
			}

			// establish a new viewport using the viewBox and preserveAspectRatio attributes
			this.viewport = this._scale.apply(this);

			// debug
			//this.ctx.area.paths
			//	.rect(0, 0, this.viewPort.width, this.viewPort.height)
			//	.stroke(new PdfPen('lime', 2, new PdfDashPattern(5)));
			// debug

			// don't render if width = 0 or height = 0; viewBox.width = 0 or viewBox.height = 0
			if (this.viewport.width > 0 && this.viewport.height > 0) {
				super._render();
			}

			area._pdfdoc.restoreState();
		}
	}

	export class _SvgSymbolElementImpl extends _SvgClippableElementBase {
		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node, _SvgRenderMode.Ignore);
		}
	}

	export class _SvgUseElementImpl extends _SvgElementBase {
		private _xlink: _SvgIdRefAttr;

		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node);
			this._xlink = new _SvgIdRefAttr(this, 'xlink:href');
		}

		protected _render(): void {
			var ref: _SvgElementBase,
				foo: any;

			if (!this._xlink.hasVal || !(ref = this.ctx.getElement(this._xlink.val))) {
				return;
			}

			// ** https://www.w3.org/TR/SVG/struct.html#UseElement **

			var g = new _SvgGElementImpl(this.ctx, null);
			g.parent = this.parent;

			g.copyAttributesFrom(this, ['x', 'y', 'width', 'height', 'xlink:href']);

			// x, y
			if (this.attr('x') != null || this.attr('y') != null) {
				var trans = wjcCore.format('translate({x},{y})', { x: this.attr('x') || 0, y: this.attr('y') || 0 });
				g.attr('transform', (foo = g.attr('transform')) ? foo + ' ' + trans : trans);
			}

			if (ref instanceof _SvgSymbolElementImpl) { // symbol
				// convert symbol to svg
				var svg = new _SvgSvgElementImpl(this.ctx, null);

				svg.copyAttributesFrom(ref);

				for (var i = 0; i < ref.children.length; i++) {
					svg.appendNode(ref.children[i].clone());
				}

				g.appendNode(svg);

				// width, height
				svg.attr('width', this.attr('width') || '100%');
				svg.attr('height', this.attr('height') || '100%');
			} else { // svg or any other element
				ref = ref.clone();
				g.appendNode(ref);

				if (ref instanceof _SvgSvgElementImpl) { // svg
					// width, height
					if ((foo = this.attr('width')) != null) {
						ref.attr('width', foo);
					}

					if ((foo = this.attr('height')) != null) {
						ref.attr('height', foo);
					}
				}
			}

			g.render(this.viewport, this.renderMode);
		}
	}

	//#endregion Other elements



	//#region Text elements

	export interface _TextDecorator {
		decoration: _SvgTextDecorationAttr;
		style: _SvgStyleAttributes;
	}

	export class _SvgTextElementImpl extends _SvgTransformableElementBase {
		private _x: _SvgNumAttr;
		private _y: _SvgNumAttr;
		private _dx: _SvgNumAttr;
		private _dy: _SvgNumAttr;
		private _textDecoration: _SvgTextDecorationAttr;

		constructor(ctx: _ISvgRenderContext, node: SVGElement) {
			super(ctx, node);

			this._x = new _SvgNumAttr(this, 'x', 0, _SvgNumConversion.Default, _SvgLengthContext.Width);
			this._y = new _SvgNumAttr(this, 'y', 0, _SvgNumConversion.Default, _SvgLengthContext.Height);
			this._dx = new _SvgNumAttr(this, 'dx', 0, _SvgNumConversion.Default, _SvgLengthContext.Width);
			this._dy = new _SvgNumAttr(this, 'dy', 0, _SvgNumConversion.Default, _SvgLengthContext.Height);
			this._textDecoration = new _SvgTextDecorationAttr(this);
		}

		protected _render() {
			if (this.renderMode === _SvgRenderMode.Render) { // render only; text elements cannot be used as a clipping path in PdfKit.
				super._render();
			}
		}

		protected _renderContent() {
			this._prepareNodes();

			var cx = this._x.val + this._dx.val,
				cy = this._y.val + this._dy.val,
				func = (node: _SvgTspanElementImpl, decorators: _TextDecorator[]): void => {
					if (node._x.hasVal) {
						cx = node._x.val;
					}

					if (node._y.hasVal) {
						cy = node._y.val;
					}

					cx += node._dx.val;
					cy += node._dy.val;

					if (node._text) {
						node._cx = cx;
						node._cy = cy;

						node._setDecorators(decorators);

						node.render(this.viewport, this.renderMode);

						cx += this.ctx.area.measureText(node._text, node.style.font.toFont(), {
							width: Infinity,
							height: Infinity,
							includeLastLineExternalLeading: false
						}).size.width;
					} else {
						for (var i = 0; i < node.children.length; i++) {
							var dec = decorators.slice();
							dec.push({ decoration: node._textDecoration, style: node.style });
							func(<_SvgTspanElementImpl>node.children[i], dec);
						}
					}
				};

			for (var i = 0; i < this.children.length; i++) {
				func(<_SvgTspanElementImpl>this.children[i], [{ decoration: this._textDecoration, style: this.style }]);
			}
		}

		private _prepareNodes() {
			var removeEmptyNodes = (node: _SvgTspanElementImpl | _SvgTextElementImpl): boolean => {
				for (var i = 0; i < node.children.length; i++) {
					var child = <_SvgTspanElementImpl>node.children[i];

					if (!child._text && removeEmptyNodes(child)) {
						child.remove();
					}
				}

				return node.children.length === 0;
			};

			var list: _SvgTspanElementImpl[] = [];
			var buildTextList = (node: _SvgElementBase): void => {
				for (var i = 0; i < node.children.length; i++) {
					var child = <_SvgTspanElementImpl>node.children[i];

					if (child._text) {
						list.push(<any>child);
					} else {
						buildTextList(child);
					}
				}
			}

			removeEmptyNodes(this);
			buildTextList(this);

			for (var i = 0; i < list.length; i++) {
				var len = list.length;

				// remove whitespaces
				if (list[i]._text === ' ' && (
					(i === 0) || // leading
					(i === len - 1) || // trailing
					(i < len - 1 && list[i + 1]._text === ' '))) { // duplicate
					list[i].remove();
					list.splice(i, 1);
					i--;
				}
			}
		}
	}

	export class _SvgTspanElementImpl extends _SvgClippableElementBase {
		_text: string;
		_x: _SvgNumAttr;
		_y: _SvgNumAttr;
		_dx: _SvgNumAttr;
		_dy: _SvgNumAttr;
		_textDecoration = new _SvgTextDecorationAttr(this);
		_decorators: _TextDecorator[];

		_cx: number;
		_cy: number;

		constructor(ctx: _ISvgRenderContext, node: SVGElement, text?: string) {
			super(ctx, node);

			this._text = wjcCore.asString(text);

			this._x = new _SvgNumAttr(this, 'x', 0, _SvgNumConversion.Default, _SvgLengthContext.Width);
			this._y = new _SvgNumAttr(this, 'y', 0, _SvgNumConversion.Default, _SvgLengthContext.Height);
			this._dx = new _SvgNumAttr(this, 'dx', 0, _SvgNumConversion.Default, _SvgLengthContext.Width);
			this._dy = new _SvgNumAttr(this, 'dy', 0, _SvgNumConversion.Default, _SvgLengthContext.Height);
			this._textDecoration = new _SvgTextDecorationAttr(this);
		}

		public clone(): _SvgElementBase {
			var clone = <_SvgTspanElementImpl>super.clone();
			clone._text = this._text;
			return clone;
		}

		_setDecorators(value: _TextDecorator[]) {
			this._decorators = value;
		}

		protected _renderContent(): void {
			if (this._text) {
				var opt: IPdfTextDrawSettings = {
					font: this.style.font.toFont(),
					width: Infinity,
					height: Infinity,
					lineBreak: false,
					fill: this.style.fill.color.val !== 'none',
					stroke: this.style.stroke.color.val !== 'none',
					_baseline: _PdfTextBaseline.Alphabetic
				};

				this._decorate();

				if (opt.fill || opt.stroke) {
					if (opt.fill) {
						opt.brush = this.style.fill.toBrush(this);
					}

					if (opt.stroke) {
						opt.pen = this.style.stroke.toPen(this);
					}

					this.ctx.area.drawText(this._text, this._cx, this._cy, opt);
				}
			}
		}

		private _decorate(): void {
			var area = this.ctx.area,
				hasValue = false;

			this._decorators.push({ decoration: this._textDecoration, style: this.style });

			for (var i = 0; i < this._decorators.length && !hasValue; i++) {
				hasValue = this._decorators[i].decoration.val != null;
			}

			if (hasValue) {
				area._pdfdoc.saveState();

				var d = <_IPdfKitDocument>area._pdfdoc._document,
					sz = area.measureText(this._text, this.style.font.toFont(), {
						width: Infinity,
						height: Infinity,
						includeLastLineExternalLeading: false
					}).size,
					lineHeight = Math.max(d.currentFontSize() / 20, 0.1),
					ascender = d.currentFontAscender(),
					x = this._cx;

				for (var dec: _TextDecorator; dec = this._decorators.shift();) {
					var decVal = dec.decoration.val;

					if (decVal) {
						for (var j = 0; j < decVal.length; j++) {
							var y = this._cy - ascender; // baseline offset (Alphabetic)

							switch (decVal[j]) {
								case 'line-through':
									y = y + sz.height / 2 - lineHeight / 2;
									break;

								case 'overline':
									y = y - (d.currentFontBBox().ury - d.currentFontAscender());
									break;

								case 'underline':
									y = y + sz.height - lineHeight * 1.5;
									break;
							}

							area.paths.rect(x, y, sz.width, lineHeight);
						}

						dec.style.apply(this, true, true);
					}
				}

				area._pdfdoc.restoreState();
			}
		}
	}

	//#endregion Text elements


	'use strict;'

	export interface _ISvgRenderContext {
		area: PdfPageArea;
		urlResolver: (url: string) => string;
		getElement: (id: string) => _SvgElementBase;
		registerCssRule: (rule: _SvgCssRule) => void;
	}

	export class _SvgRenderer {
		private _elementsById: _TDictionary<_SvgElementBase> = {};
		private _registeredCssRules: _TDictionary<_SvgCssRule> = {};
		private _svg: _SvgSvgElementImpl;
		private _doc: PdfDocument;

		constructor(svgString: string, area: PdfPageArea, urlResolver?: (url: string) => string) {
			wjcCore.assert(area != null, _Errors.ValueCannotBeEmpty('svgString'));

			this._doc = area._pdfdoc;

			var dom = this._parse(svgString);
			if (dom) {
				this._svg = new _SvgSvgElementImpl({
					area: area,
					urlResolver: urlResolver,
					getElement: this._getElementById.bind(this),
					registerCssRule: (rule: _SvgCssRule) => {
						this._registerCssRule(rule, urlResolver);
					}
				}, null);
				this._copyAttributes(dom, this._svg);
				this._buildTree(dom, this._svg);
				// pre-set viewport, so the outermost svg element's height and width properties can be resolved against the viewport before rendering
				this._svg.viewport = new wjcCore.Size(area.width, area.height);
			}
		}

		public get root(): _SvgSvgElementImpl {
			return this._svg;
		}

		public render(viewPort?: wjcCore.Size) {
			if (this._svg) {
				this._svg.render(viewPort || this._svg.viewport);
			}
		}

		private _parse(svg: string): SVGSVGElement {
			if (svg) {
				var parser = new DOMParser();
				(<any>parser).async = false;

				return parser.parseFromString(svg, 'text/xml').getElementsByTagName('svg')[0];

				//// IE10\11 throws the "SyntaxError" exception if xmlns:xlink is missed and if the string being parsed contains elements which are use the 'xlink' attribute.
				//svg = '<svg xmlns:xlink="http://www.w3.org/1999/xlink">' + svg + '</svg>';
				//return <SVGElement>parser.parseFromString(svg, 'text/xml').querySelector('svg').querySelector('svg');
			}
		}

		private _buildTree(dom: Node, tree: _SvgElementBase, handleTextNodes?: boolean): void {
			for (var i = 0; dom.childNodes && i < dom.childNodes.length; i++) {
				var domChild = <SVGElement>dom.childNodes.item(i),
					nodeName = domChild.nodeName;

				if (domChild.nodeType === 1) {
					var className = this._getClassName(nodeName);

					if (wjcSelf[className]) {
						var element = new (<_ISvgElementBaseCtor>wjcSelf[className])(tree.ctx, domChild);
						this._copyAttributes(domChild, element);
						tree.appendNode(element);

						var id;
						if (id = domChild.getAttribute('id')) {
							this._elementsById[id] = element;
						}

						this._buildTree(domChild, element, nodeName === 'text' || (handleTextNodes && nodeName === 'tspan'));
					} else {
						//DEBUG
						//alert('Not implemented: ' + nodeName);
					}
				} else {
					if (domChild.nodeType === 3 && handleTextNodes) {
						var textContent = domChild.textContent.trim();

						if (textContent) {
							// <tspan />\r\n[text] => <tspan />_text
							if (i != 0 && dom.childNodes[i - 1].nodeType === 1 && domChild.textContent.match(/^\s/)) {
								tree.appendNode(new _SvgTspanElementImpl(tree.ctx, null, ' '));
							}

							var text = _compressSpaces(domChild.textContent);
							tree.appendNode(new _SvgTspanElementImpl(tree.ctx, null, text));
						}

						// <tspan />\r\n<tspan /> => <tspan />_<tspan />
						// [text]\r\n[smth] -> [text]_[smth]
						if (!textContent || domChild.textContent.match(/\s$/)) {
							tree.appendNode(new _SvgTspanElementImpl(tree.ctx, null, ' '));
						}
					}
				}
			}
		}

		// Any class that wraps a SVG element must follow this naming pattern
		private _getClassName(nodeName: string): string {
			return '_Svg' + nodeName.charAt(0).toUpperCase() + nodeName.substring(1) + 'ElementImpl';
		}

		private _copyAttributes(node: SVGElement, element: _SvgElementBase): void {
			// copy attributes
			for (var i = 0; i < node.attributes.length; i++) {
				var attr = node.attributes.item(i);
				element.attr(attr.name, attr.value);
			}

			var css = _SvgCssHelper.getComputedStyle(node, this._registeredCssRules);

			// convert CSS to attributes (some of the presentation attributes will be overwritten as they have lower priority than CSS)
			for (var i = 0, keys = Object.keys(css); i < keys.length; i++) {
				var name = keys[i];
				element.attr(name, css[name]);
			}
		}

		private _getElementById(id: string): _SvgElementBase {
			id = (id || '').replace('#', '');
			return this._elementsById[id];
		}

		private _registerCssRule(rule: _SvgCssRule, urlResolver?: (url: string) => string): void {
			if (rule.selector[0] !== '@') {
				this._registeredCssRules[rule.selector] = rule;
			} else {
				if (rule.selector === '@font-face') {
					_SvgCssHelper.registerFontFace(this._doc, rule, urlResolver);
				}
			}
		}
	}


