diff --git a/package.json b/package.json index a2c4883d2..0d682e680 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "url": "http://badassjs.com/" }, "scripts": { - "build": "rollup -c", + "build": "rimraf ./dist && rollup -c", + "watch": "npm run prebuild && rimraf ./dist && rollup -c -w", "prepublish": "npm run build", "prebuild": "node ./src/font/data/compressData.js", "postbuild": "rimraf ./src/font/data/*.b64.afm" @@ -28,13 +29,15 @@ "lz-string": "^1.4.4" }, "devDependencies": { + "babel-core": "^6.26.3", "babel-plugin-external-helpers": "^6.22.0", + "babel-preset-env": "^1.7.0", "babel-preset-es2015": "^6.24.1", "blob-stream": "^0.1.2", "iconv-lite": "^0.4.13", "rimraf": "^2.6.2", "rollup": "^0.52.2", - "rollup-plugin-babel": "^2.7.1", + "rollup-plugin-babel": "3", "rollup-plugin-bundle-size": "https://github.com/vimeo/rollup-plugin-bundle-size", "rollup-plugin-ignore": "^1.0.3", "rollup-plugin-json": "^2.1.0", diff --git a/rollup.config.js b/rollup.config.js index 6cd98d448..25b785d6b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,12 +1,12 @@ -import babel from 'rollup-plugin-babel'; -import json from 'rollup-plugin-json'; -import nodeResolve from 'rollup-plugin-node-resolve'; -import bundleSize from 'rollup-plugin-bundle-size'; -import uglify from 'rollup-plugin-uglify'; -import string from 'rollup-plugin-string'; +import babel from 'rollup-plugin-babel' +import json from 'rollup-plugin-json' +import nodeResolve from 'rollup-plugin-node-resolve' +import bundleSize from 'rollup-plugin-bundle-size' +import uglify from 'rollup-plugin-uglify' +import string from 'rollup-plugin-string' import replace from 'rollup-plugin-replace' import ignore from 'rollup-plugin-ignore' -import pkg from './package.json'; +import pkg from './package.json' const cjs = { exports: 'named', @@ -28,43 +28,42 @@ const configBase = { string({ include: '**/*.afm' }), babel({ babelrc: false, - presets: [['es2015', { modules: false }]], + presets: [ + [ + 'env', + { + modules: false, + targets: { + ie: '11' + } + } + ] + ], plugins: ['external-helpers'], runtimeHelpers: true }), - bundleSize(), + bundleSize() ], external: Object.keys(pkg.dependencies) } const serverConfig = Object.assign({}, configBase, { - output: [ - getESM({ file: 'dist/pdfkit.es.js' }), - getCJS({ file: 'dist/pdfkit.cjs.js' }), - ], + output: [getESM({ file: 'dist/pdfkit.es.js' }), getCJS({ file: 'dist/pdfkit.cjs.js' })], plugins: configBase.plugins.concat( replace({ - BROWSER: JSON.stringify(false), + BROWSER: JSON.stringify(false) }) ), external: configBase.external.concat(['fs']) }) const serverProdConfig = Object.assign({}, serverConfig, { - output: [ - getESM({ file: 'dist/pdfkit.es.min.js' }), - getCJS({ file: 'dist/pdfkit.cjs.min.js' }), - ], - plugins: serverConfig.plugins.concat( - uglify() - ), + output: [getESM({ file: 'dist/pdfkit.es.min.js' }), getCJS({ file: 'dist/pdfkit.cjs.min.js' })], + plugins: serverConfig.plugins.concat(uglify()) }) const browserConfig = Object.assign({}, configBase, { - output: [ - getESM({ file: 'dist/pdfkit.browser.es.js' }), - getCJS({ file: 'dist/pdfkit.browser.cjs.js' }), - ], + output: [getESM({ file: 'dist/pdfkit.browser.es.js' }), getCJS({ file: 'dist/pdfkit.browser.cjs.js' })], plugins: configBase.plugins.concat( replace({ BROWSER: JSON.stringify(true) @@ -74,18 +73,8 @@ const browserConfig = Object.assign({}, configBase, { }) const browserProdConfig = Object.assign({}, browserConfig, { - output: [ - getESM({ file: 'dist/pdfkit.browser.es.min.js' }), - getCJS({ file: 'dist/pdfkit.browser.cjs.min.js' }), - ], - plugins: browserConfig.plugins.concat( - uglify() - ), + output: [getESM({ file: 'dist/pdfkit.browser.es.min.js' }), getCJS({ file: 'dist/pdfkit.browser.cjs.min.js' })], + plugins: browserConfig.plugins.concat(uglify()) }) -export default [ - serverConfig, - serverProdConfig, - browserConfig, - browserProdConfig -] +export default [serverConfig, serverProdConfig, browserConfig, browserProdConfig] diff --git a/src/abstract_reference.js b/src/abstract_reference.js new file mode 100644 index 000000000..06cf69d8e --- /dev/null +++ b/src/abstract_reference.js @@ -0,0 +1,11 @@ +/* +PDFAbstractReference - abstract class for PDF reference +*/ + +class PDFAbstractReference { + toString() { + throw new Error('Must be implemented by subclasses') + } +} + +export default PDFAbstractReference diff --git a/src/data.js b/src/data.js index 370b0329e..bfc10ac50 100644 --- a/src/data.js +++ b/src/data.js @@ -1,131 +1,124 @@ -import range from './utils/range'; - class Data { constructor(data = []) { - this.pos = 0; - this.data = data; - this.length = this.data.length; + if (data == null) data = [] + this.data = data + this.pos = 0 + this.length = this.data.length } readByte() { - return this.data[this.pos++]; + return this.data[this.pos++] } writeByte(byte) { - return (this.data[this.pos++] = byte); + return (this.data[this.pos++] = byte) } byteAt(index) { - return this.data[index]; + return this.data[index] } readBool() { - return !!this.readByte(); + return !!this.readByte() } writeBool(val) { - return this.writeByte(val ? 1 : 0); + return this.writeByte(val ? 1 : 0) } readUInt32() { - const b1 = this.readByte() * 0x1000000; - const b2 = this.readByte() << 16; - const b3 = this.readByte() << 8; - const b4 = this.readByte(); - return b1 + b2 + b3 + b4; + const b1 = this.readByte() * 0x1000000 + const b2 = this.readByte() << 16 + const b3 = this.readByte() << 8 + const b4 = this.readByte() + return b1 + b2 + b3 + b4 } writeUInt32(val) { - this.writeByte((val >>> 24) & 0xff); - this.writeByte((val >> 16) & 0xff); - this.writeByte((val >> 8) & 0xff); - return this.writeByte(val & 0xff); + this.writeByte((val >>> 24) & 0xff) + this.writeByte((val >> 16) & 0xff) + this.writeByte((val >> 8) & 0xff) + return this.writeByte(val & 0xff) } readInt32() { - const int = this.readUInt32(); + const int = this.readUInt32() if (int >= 0x80000000) { - return int - 0x100000000; + return int - 0x100000000 } - return int; + return int } writeInt32(val) { - if (val < 0) { - val += 0x100000000; - } - return this.writeUInt32(val); + if (val < 0) val += 0x100000000 + return this.writeUInt32(val) } readUInt16() { - const b1 = this.readByte() << 8; - const b2 = this.readByte(); - return b1 | b2; + const b1 = this.readByte() << 8 + const b2 = this.readByte() + return b1 | b2 } writeUInt16(val) { - this.writeByte((val >> 8) & 0xff); - return this.writeByte(val & 0xff); + this.writeByte((val >> 8) & 0xff) + return this.writeByte(val & 0xff) } readInt16() { - const int = this.readUInt16(); + const int = this.readUInt16() if (int >= 0x8000) { - return int - 0x10000; + return int - 0x10000 } - return int; + return int } writeInt16(val) { - if (val < 0) { - val += 0x10000; - } - return this.writeUInt16(val); + if (val < 0) val += 0x10000 + return this.writeUInt16(val) } readString(length) { - const ret = []; - for ( - let i = 0, end = length, asc = 0 <= end; - asc ? i < end : i > end; - asc ? i++ : i-- - ) { - ret[i] = String.fromCharCode(this.readByte()); + const ret = [] + for (let i = 0, end = length, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) { + ret[i] = String.fromCharCode(this.readByte()) } - return ret.join(''); + return ret.join('') } writeString(val) { - return range(0, val.length, false).map(i => - this.writeByte(val.charCodeAt(i)) - ); + const result = [] + for (let i = 0; i <= val.length; i++) { + result.push(this.writeByte(val.charCodeAt(i))) + } + return result } stringAt(pos, length) { - this.pos = pos; - return this.readString(length); + this.pos = pos + return this.readString(length) } readShort() { - return this.readInt16(); + return this.readInt16() } writeShort(val) { - return this.writeInt16(val); + return this.writeInt16(val) } readLongLong() { - const b1 = this.readByte(); - const b2 = this.readByte(); - const b3 = this.readByte(); - const b4 = this.readByte(); - const b5 = this.readByte(); - const b6 = this.readByte(); - const b7 = this.readByte(); - const b8 = this.readByte(); + const b1 = this.readByte() + const b2 = this.readByte() + const b3 = this.readByte() + const b4 = this.readByte() + const b5 = this.readByte() + const b6 = this.readByte() + const b7 = this.readByte() + const b8 = this.readByte() if (b1 & 0x80) { // sign -> avoid overflow @@ -140,7 +133,7 @@ class Data { (b8 ^ 0xff) + 1) * -1 - ); + ) } return ( @@ -152,50 +145,46 @@ class Data { b6 * 0x10000 + b7 * 0x100 + b8 - ); + ) } writeLongLong(val) { - const high = Math.floor(val / 0x100000000); - const 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); + const high = Math.floor(val / 0x100000000) + const 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) } readInt() { - return this.readInt32(); + return this.readInt32() } writeInt(val) { - return this.writeInt32(val); + return this.writeInt32(val) } slice(start, end) { - return this.data.slice(start, end); + return this.data.slice(start, end) } read(bytes) { - const buf = []; - for ( - let i = 0, end = bytes, asc = 0 <= end; - asc ? i < end : i > end; - asc ? i++ : i-- - ) { - buf.push(this.readByte()); + const buf = [] + for (let i = 0, end = bytes, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) { + buf.push(this.readByte()) } - return buf; + return buf } write(bytes) { - return Array.from(bytes).map(byte => this.writeByte(byte)); + return bytes.map(byte => this.writeByte(byte)) } } -export default Data; +export default Data diff --git a/src/document.js b/src/document.js index ed6c4b02f..82d8e3dc9 100644 --- a/src/document.js +++ b/src/document.js @@ -1,118 +1,156 @@ -import stream from 'stream'; -import PDFObject from './object'; -import PDFReference from './reference'; -import PDFPage from './page'; -import Color from './mixins/color'; -import Vector from './mixins/vector'; -import Fonts from './mixins/fonts'; -import Text from './mixins/text'; -import Images from './mixins/images'; -import Annotations from './mixins/annotations'; +/* +PDFDocument - represents an entire PDF document +By Devon Govett +*/ + +import stream from 'stream' +import PDFObject from './object' +import PDFReference from './reference' +import PDFPage from './page' +import Color from './mixins/color' +import Vector from './mixins/vector' +import Fonts from './mixins/fonts' +import Text from './mixins/text' +import Images from './mixins/images' +import Annotations from './mixins/annotations' +import OutlineMixin from './mixins/outline' class PDFDocument extends stream.Readable { constructor(options = {}) { - super(); + super(options) + this.options = options - this.options = options; - this.version = 1.3; - this.compress = true; - this._pageBuffer = []; - this._pageBufferStart = 0; + // PDF version + this.version = 1.3 + + // Whether streams should be compressed + this.compress = this.options.compress != null ? this.options.compress : true + + this._pageBuffer = [] + this._pageBufferStart = 0 // The PDF object store - this._offsets = []; - this._waiting = 0; - this._ended = false; - this._offset = 0; + this._offsets = [] + this._waiting = 0 + this._ended = false + this._offset = 0 + const Pages = this.ref({ + Type: 'Pages', + Count: 0, + Kids: []}) + + Pages.finalize = function() { + this.offset = this.document._offset + this.document._write(this.id + ' ' + this.gen + ' obj') + this.document._write('<<') + this.document._write('/Type /Pages') + this.document._write(`/Count ${this.data.Count}`) + this.document._write(`/Kids [${Buffer.concat(this.data.Kids).slice(0, -1).toString()}]`) + this.document._write('>>') + this.document._write('endobj') + return this.document._refEnd(this) + } this._root = this.ref({ Type: 'Catalog', - Pages: this.ref({ - Type: 'Pages', - Count: 0, - Kids: [], - }), - }); + Pages + }) // The current page - this.page = null; + this.page = null // Initialize mixins - this.initColor(); - this.initVector(); - this.initFonts(); - this.initText(); - this.initImages(); + this.initColor() + this.initVector() + this.initFonts() + this.initText() + this.initImages() + this.initOutline() // Initialize the metadata this.info = { Producer: 'PDFKit', Creator: 'PDFKit', - CreationDate: new Date(), - }; + CreationDate: new Date() + } if (this.options.info) { for (let key in this.options.info) { - const val = this.options.info[key]; - this.info[key] = val; + const val = this.options.info[key] + this.info[key] = val } } - // Write the header PDF version - this._write(`%PDF-${this.version}`); + // Write the header + // PDF version + this._write(`%PDF-${this.version}`) // 4 binary chars, as recommended by the spec - this._write('%\xFF\xFF\xFF\xFF'); + this._write('%\xFF\xFF\xFF\xFF') // Add the first page if (this.options.autoFirstPage !== false) { - this.addPage(); + this.addPage() } } addPage(options) { // end the current page if needed - if (options == null) { - ({ options } = this); - } - - if (!this.options.bufferPages) { - this.flushPages(); - } + if (options == null) { ({ options } = this); } + if (!this.options.bufferPages) { this.flushPages(); } // create a page object - this.page = new PDFPage(this, options); - this._pageBuffer.push(this.page); + this.page = new PDFPage(this, options) + this._pageBuffer.push(this.page) // add the page to the object store - const pages = this._root.data.Pages.data; - pages.Kids.push(this.page.dictionary); - pages.Count++; + const pages = this._root.data.Pages.data + pages.Kids.push(new Buffer(this.page.dictionary + ' ')); + pages.Count++ + + // reset x and y coordinates + this.x = this.page.margins.left; + this.y = this.page.margins.top; // flip PDF coordinate system so that the origin is in // the top left rather than the bottom left - this._ctm = [1, 0, 0, 1, 0, 0]; - this.transform(1, 0, 0, -1, 0, this.page.height); + this._ctm = [1, 0, 0, 1, 0, 0] + this.transform(1, 0, 0, -1, 0, this.page.height) + + this.emit('pageAdded') - return this; + return this + } + + bufferedPageRange() { + return { start: this._pageBufferStart, count: this._pageBuffer.length }; + } + + switchToPage(n) { + let 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; } flushPages() { // this local variable exists so we're future-proof against // reentrant calls to flushPages. - const pages = this._pageBuffer; - this._pageBuffer = []; - this._pageBufferStart += pages.length; - for (let page of Array.from(pages)) { + const pages = this._pageBuffer + this._pageBuffer = [] + this._pageBufferStart += pages.length + for (let page of pages) { page.end(); } } ref(data) { - const ref = new PDFReference(this, this._offsets.length + 1, data); - this._offsets.push(null); // placeholder for this object's offset once it is finalized - this._waiting++; - return ref; + const ref = new PDFReference(this, this._offsets.length + 1, data) + this._offsets.push(null) // placeholder for this object's offset once it is finalized + this._waiting++ + return ref } _read() { @@ -121,107 +159,103 @@ class PDFDocument extends stream.Readable { _write(data) { if (!Buffer.isBuffer(data)) { - data = new Buffer(data + '\n', 'binary'); + data = new Buffer(data + '\n', 'binary') } - this.push(data); - return (this._offset += data.length); + this.push(data) + return (this._offset += data.length) } addContent(data) { - this.page.write(data); - return this; + this.page.write(data) + return this } _refEnd(ref) { - this._offsets[ref.id - 1] = ref.offset; + this._offsets[ref.id - 1] = ref.offset if (--this._waiting === 0 && this._ended) { - this._finalize(); - return (this._ended = false); + this._finalize() + return (this._ended = false) } } end() { - this.flushPages(); - this._info = this.ref(); + this.flushPages() + this._info = this.ref() for (let key in this.info) { - let val = this.info[key]; + let val = this.info[key] if (typeof val === 'string') { - val = new String(val); + val = new String(val) } - this._info.data[key] = val; + this._info.data[key] = val } - this._info.end(); + this._info.end() for (let name in this._fontFamilies) { - const font = this._fontFamilies[name]; - font.finalize(); + const font = this._fontFamilies[name] + font.finalize() } - this._root.end(); - this._root.data.Pages.end(); + this.endOutline(); + + this._root.end() + this._root.data.Pages.end() if (this._waiting === 0) { - return this._finalize(); + return this._finalize() } else { - return (this._ended = true); + return (this._ended = true) } } _finalize(fn) { // generate xref - const xRefOffset = this._offset; - this._write('xref'); - this._write(`0 ${this._offsets.length + 1}`); - this._write('0000000000 65535 f '); + const xRefOffset = this._offset + this._write('xref') + this._write(`0 ${this._offsets.length + 1}`) + this._write('0000000000 65535 f ') for (let offset of Array.from(this._offsets)) { - offset = `0000000000${offset}`.slice(-10); - this._write(offset + ' 00000 n '); + offset = `0000000000${offset}`.slice(-10) + this._write(offset + ' 00000 n ') } // trailer - this._write('trailer'); + this._write('trailer') this._write( PDFObject.convert({ Size: this._offsets.length + 1, Root: this._root, - Info: this._info, + Info: this._info }) - ); + ) - this._write('startxref'); - this._write(`${xRefOffset}`); - this._write('%%EOF'); + this._write('startxref') + this._write(`${xRefOffset}`) + this._write('%%EOF') // end the stream - return this.push(null); + return this.push(null) } toString() { - return '[object PDFDocument]'; + return '[object PDFDocument]' } } const mixin = methods => { - return (() => { - const result = []; - for (let name in methods) { - const method = methods[name]; - result.push((PDFDocument.prototype[name] = method)); - } - return result; - })(); + Object.assign(PDFDocument.prototype, methods); }; // Load mixins -mixin(Color); -mixin(Vector); -mixin(Fonts); -mixin(Text); -mixin(Images); -mixin(Annotations); - -export default PDFDocument; +mixin(Color) +mixin(Vector) +mixin(Fonts) +mixin(Text) +mixin(Images) +mixin(Annotations) +mixin(OutlineMixin); + +export default PDFDocument diff --git a/src/font.js b/src/font.js index f8bb497a9..f91e8ccd2 100644 --- a/src/font.js +++ b/src/font.js @@ -1,54 +1,24 @@ -import fontkit from '@react-pdf/fontkit'; -import createStandardFont from './font/standard'; -import createEmbeddedFont from './font/embedded'; - export class PDFFont { - static open(document, src, family, id) { - let 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); - } else if (typeof src === 'object') { - font = src; - } - - if (font == null) { - throw new Error('Not a supported font format or standard PDF font.'); - } - - return new EmbeddedFont(document, font, id); + constructor() { } - encode(text) { + encode() { throw new Error('Must be implemented by subclasses'); } - widthOfString(text) { + widthOfString() { throw new Error('Must be implemented by subclasses'); } ref() { - return this.dictionary != null - ? this.dictionary - : (this.dictionary = this.document.ref()); + return this.dictionary != null ? this.dictionary : (this.dictionary = this.document.ref()); } finalize() { - if (this.embedded || this.dictionary == null) { - return; - } + if (this.embedded || (this.dictionary == null)) { return; } this.embed(); - return (this.embedded = true); + return this.embedded = true; } embed() { @@ -56,15 +26,10 @@ export class PDFFont { } lineHeight(size, includeGap) { - if (includeGap == null) { - includeGap = false; - } + if (includeGap == null) { includeGap = false; } const gap = includeGap ? this.lineGap : 0; - return ((this.ascender + gap - this.descender) / 1000) * size; + return (((this.ascender + gap) - this.descender) / 1000) * size; } } -export const StandardFont = createStandardFont(PDFFont); -export const EmbeddedFont = createEmbeddedFont(PDFFont); - export default PDFFont; diff --git a/src/font/afm.js b/src/font/afm.js index b1c9a2334..6dc8717ee 100644 --- a/src/font/afm.js +++ b/src/font/afm.js @@ -1,5 +1,4 @@ -import fs from 'fs'; -import range from '../utils/range'; +import fs from 'fs' const WIN_ANSI_MAP = { 402: 131, @@ -28,8 +27,8 @@ const WIN_ANSI_MAP = { 353: 154, 376: 159, 381: 142, - 382: 158, -}; + 382: 158 +} const characters = `\ .notdef .notdef .notdef .notdef @@ -103,133 +102,130 @@ eth ntilde ograve oacute ocircumflex otilde odieresis divide oslash ugrave uacute ucircumflex udieresis yacute thorn ydieresis\ -`.split(/\s+/); +`.split(/\s+/) class AFMFont { static open(filename) { if (BROWSER) { - throw new Error('AFMFont.open not available on browser build'); + throw new Error('AFMFont.open not available on browser build') } - return new AFMFont(fs.readFileSync(filename, 'utf8')); + return new AFMFont(fs.readFileSync(filename, 'utf8')) } constructor(contents) { - this.contents = contents; - this.attributes = {}; - this.glyphWidths = {}; - this.boundingBoxes = {}; - this.kernPairs = {}; - - this.parse(); - this.charWidths = range(0, 255, true).map(i => this.glyphWidths[characters[i]]); - this.bbox = Array.from(this.attributes['FontBBox'].split(/\s+/)).map(e => +e); - this.ascender = +(this.attributes['Ascender'] || 0); - this.descender = +(this.attributes['Descender'] || 0); - this.xHeight = +(this.attributes['XHeight'] || 0); - this.capHeight = +(this.attributes['CapHeight'] || 0); - this.lineGap = this.bbox[3] - this.bbox[1] - (this.ascender - this.descender); + this.contents = contents + this.attributes = {} + this.glyphWidths = {} + this.boundingBoxes = {} + this.kernPairs = {} + + this.parse() + // todo: remove charWidths since appears to not be used + this.charWidths = new Array(256) + for (let char = 0; char <= 255; char++) { + this.charWidths[char] = this.glyphWidths[characters[char]] + } + + this.bbox = this.attributes['FontBBox'].split(/\s+/).map(e => +e) + this.ascender = +(this.attributes['Ascender'] || 0) + this.descender = +(this.attributes['Descender'] || 0) + this.xHeight = +(this.attributes['XHeight'] || 0) + this.capHeight = +(this.attributes['CapHeight'] || 0) + this.lineGap = this.bbox[3] - this.bbox[1] - (this.ascender - this.descender) } parse() { - let section = ''; + let section = '' for (let line of Array.from(this.contents.split('\n'))) { - var match; - var a; + var match + var a if ((match = line.match(/^Start(\w+)/))) { - section = match[1]; - continue; + section = match[1] + continue } else if ((match = line.match(/^End(\w+)/))) { - section = ''; - continue; + section = '' + continue } switch (section) { case 'FontMetrics': - match = line.match(/(^\w+)\s+(.*)/); - var key = match[1]; - var value = match[2]; + match = line.match(/(^\w+)\s+(.*)/) + var key = match[1] + var value = match[2] if ((a = this.attributes[key])) { if (!Array.isArray(a)) { - a = this.attributes[key] = [a]; + a = this.attributes[key] = [a] } - a.push(value); + a.push(value) } else { - this.attributes[key] = value; + this.attributes[key] = value } - break; + break case 'CharMetrics': if (!/^CH?\s/.test(line)) { - continue; + continue } - var name = line.match(/\bN\s+(\.?\w+)\s*;/)[1]; - this.glyphWidths[name] = +line.match(/\bWX\s+(\d+)\s*;/)[1]; - break; + var name = line.match(/\bN\s+(\.?\w+)\s*;/)[1] + this.glyphWidths[name] = +line.match(/\bWX\s+(\d+)\s*;/)[1] + break case 'KernPairs': - match = line.match(/^KPX\s+(\.?\w+)\s+(\.?\w+)\s+(-?\d+)/); + match = line.match(/^KPX\s+(\.?\w+)\s+(\.?\w+)\s+(-?\d+)/) if (match) { - this.kernPairs[match[1] + '\0' + match[2]] = parseInt(match[3]); + this.kernPairs[match[1] + '\0' + match[2]] = parseInt(match[3]) } - break; + break } } } encodeText(text) { - const res = []; - for ( - let i = 0, end = text.length, asc = 0 <= end; - asc ? i < end : i > end; - asc ? i++ : i-- - ) { - let char = text.charCodeAt(i); - char = WIN_ANSI_MAP[char] || char; - res.push(char.toString(16)); + const res = [] + for (let i = 0, end = text.length, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) { + let char = text.charCodeAt(i) + char = WIN_ANSI_MAP[char] || char + res.push(char.toString(16)) } - return res; + return res } glyphsForString(string) { - const glyphs = []; - - for ( - let i = 0, end = string.length, asc = 0 <= end; - asc ? i < end : i > end; - asc ? i++ : i-- - ) { - const charCode = string.charCodeAt(i); - glyphs.push(this.characterToGlyph(charCode)); + const glyphs = [] + + for (let i = 0, end = string.length, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) { + const charCode = string.charCodeAt(i) + glyphs.push(this.characterToGlyph(charCode)) } - return glyphs; + return glyphs } characterToGlyph(character) { - return characters[WIN_ANSI_MAP[character] || character] || '.notdef'; + return characters[WIN_ANSI_MAP[character] || character] || '.notdef' } widthOfGlyph(glyph) { - return this.glyphWidths[glyph] || 0; + return this.glyphWidths[glyph] || 0 } getKernPair(left, right) { - return this.kernPairs[left + '\0' + right] || 0; + return this.kernPairs[left + '\0' + right] || 0 } advancesForGlyphs(glyphs) { - const advances = []; + const advances = [] for (let index = 0; index < glyphs.length; index++) { - const left = glyphs[index]; - const right = glyphs[index + 1]; - advances.push(this.widthOfGlyph(left) + this.getKernPair(left, right)); + const left = glyphs[index] + const right = glyphs[index + 1] + advances.push(this.widthOfGlyph(left) + this.getKernPair(left, right)) } - return advances; + return advances } -}; +} -export default AFMFont; +export default AFMFont diff --git a/src/font/embedded.js b/src/font/embedded.js index 9f5ca19c9..cdba4f0da 100644 --- a/src/font/embedded.js +++ b/src/font/embedded.js @@ -1,288 +1,245 @@ -import PDFObject from '../object'; - -const toHex = function(...codePoints) { - const codes = Array.from(codePoints).map(code => - `0000${code.toString(16)}`.slice(-4) - ); - - return codes.join(''); -}; - -const createEmbeddedFont = PDFFont => ( - class EmbeddedFont extends PDFFont { - constructor(document, font, id) { - super(); - - 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.xHeight = this.font.xHeight * this.scale; - this.capHeight = this.font.capHeight * this.scale; - this.lineGap = this.font.lineGap * this.scale; - this.bbox = this.font.bbox; - - this.layoutCache = Object.create(null); - } - - layoutRun(text, features) { - const run = this.font.layout(text, features); +import PDFFont from '../font' + +const toHex = function(num) { + return `0000${num.toString(16)}`.slice(-4) +} + +class EmbeddedFont extends PDFFont { + constructor(document, font, id) { + super() + 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.xHeight = this.font.xHeight * this.scale + this.capHeight = this.font.capHeight * this.scale + this.lineGap = this.font.lineGap * this.scale + this.bbox = this.font.bbox + + this.layoutCache = Object.create(null) + } - // Normalize position values - for (let i = 0; i < run.positions.length; i++) { - const position = run.positions[i]; - for (let key in position) { - position[key] *= this.scale; - } + layoutRun(text, features) { + const run = this.font.layout(text, features) - position.advanceWidth = run.glyphs[i].advanceWidth * this.scale; + // Normalize position values + for (let i = 0; i < run.positions.length; i++) { + const position = run.positions[i] + for (let key in position) { + position[key] *= this.scale } - return run; + position.advanceWidth = run.glyphs[i].advanceWidth * this.scale } - layoutCached(text) { - let cached; - if ((cached = this.layoutCache[text])) { - return cached; - } + return run + } - const run = this.layoutRun(text); - this.layoutCache[text] = run; - return run; + layoutCached(text) { + let cached + if ((cached = this.layoutCache[text])) { + return cached } - layout(text, features, onlyWidth) { - // Skip the cache if any user defined features are applied - if (onlyWidth == null) { - onlyWidth = false; - } - if (features) { - return this.layoutRun(text, features); - } + const run = this.layoutRun(text) + this.layoutCache[text] = run + return run + } - const glyphs = onlyWidth ? null : []; - const positions = onlyWidth ? null : []; - let advanceWidth = 0; - - // Split the string by words to increase cache efficiency. - // For this purpose, spaces and tabs are a good enough delimeter. - let last = 0; - let index = 0; - while (index <= text.length) { - var needle; - if ( - (index === text.length && last < index) || - ((needle = text.charAt(index)), [' ', '\t'].includes(needle)) - ) { - const run = this.layoutCached(text.slice(last, ++index)); - if (!onlyWidth) { - glyphs.push(...Array.from(run.glyphs || [])); - positions.push(...Array.from(run.positions || [])); - } - - advanceWidth += run.advanceWidth; - last = index; - } else { - index++; + layout(text, features, onlyWidth) { + // Skip the cache if any user defined features are applied + if (onlyWidth == null) onlyWidth = false + if (features) { + return this.layoutRun(text, features) + } + + const glyphs = onlyWidth ? null : [] + const positions = onlyWidth ? null : [] + let advanceWidth = 0 + + // Split the string by words to increase cache efficiency. + // For this purpose, spaces and tabs are a good enough delimeter. + let last = 0 + let index = 0 + while (index <= text.length) { + var needle + if ((index === text.length && last < index) || ((needle = text.charAt(index)), [' ', '\t'].includes(needle))) { + const run = this.layoutCached(text.slice(last, ++index)) + if (!onlyWidth) { + glyphs.push(...Array.from(run.glyphs || [])) + positions.push(...Array.from(run.positions || [])) } - } - return { glyphs, positions, advanceWidth }; + advanceWidth += run.advanceWidth + last = index + } else { + index++ + } } - encode(text, features) { - const { glyphs, positions } = this.layout(text, features); + return { glyphs, positions, advanceWidth } + } - const res = []; - for (let i = 0; i < glyphs.length; i++) { - const glyph = glyphs[i]; - const gid = this.subset.includeGlyph(glyph.id); - res.push(`0000${gid.toString(16)}`.slice(-4)); + encode(text, features) { + const { glyphs, positions } = this.layout(text, features) + const res = this.encodeGlyphs(glyphs) - if (this.widths[gid] == null) { - this.widths[gid] = glyph.advanceWidth * this.scale; - } - if (this.unicode[gid] == null) { - this.unicode[gid] = this.font._cmapProcessor.codePointsForGlyph( - glyph.id - ); - } - } + return [res, positions] + } + + encodeGlyphs(glyphs) { + const res = [] + for (let i = 0; i < glyphs.length; i++) { + const glyph = glyphs[i] + const gid = this.subset.includeGlyph(glyph.id) + res.push(`0000${gid.toString(16)}`.slice(-4)) - return [res, positions]; + if (this.widths[gid] == null) this.widths[gid] = glyph.advanceWidth * this.scale + if (this.unicode[gid] == null) this.unicode[gid] = glyph.codePoints } - encodeGlyphs(glyphs) { - const res = []; - for (let i = 0; i < glyphs.length; i++) { - const glyph = glyphs[i]; - const gid = this.subset.includeGlyph(glyph.id); - res.push(`0000${gid.toString(16)}`.slice(-4)); + return res + } - if (this.widths[gid] == null) { - this.widths[gid] = glyph.advanceWidth * this.scale; - } - if (this.unicode[gid] == null) { - this.unicode[gid] = this.font._cmapProcessor.codePointsForGlyph( - glyph.id - ); - } - } + widthOfString(string, size, features) { + const width = this.layout(string, features, true).advanceWidth + const scale = size / 1000 + return width * scale + } - return res; - } + embed() { + const isCFF = this.subset.cff != null + const fontFile = this.document.ref() - widthOfString(string, size, features) { - const width = this.layout(string, features, true).advanceWidth; - const scale = size / 1000; - return width * scale; + if (isCFF) { + fontFile.data.Subtype = 'CIDFontType0C' } - embed() { - const isCFF = this.subset.cff != null; - const fontFile = this.document.ref(); - - if (isCFF) { - fontFile.data.Subtype = 'CIDFontType0C'; - } - - this.subset.encodeStream().pipe(fontFile); + this.subset.encodeStream().pipe(fontFile) - const familyClass = - ((this.font['OS/2'] != null - ? this.font['OS/2'].sFamilyClass - : undefined) || 0) >> 8; - let flags = 0; - if (this.font.post.isFixedPitch) { - flags |= 1 << 0; - } - if (1 <= familyClass && familyClass <= 7) { - flags |= 1 << 1; - } - flags |= 1 << 2; // assume the font uses non-latin characters - if (familyClass === 10) { - flags |= 1 << 3; - } - if (this.font.head.macStyle.italic) { - flags |= 1 << 6; - } + const familyClass = ((this.font['OS/2'] != null ? this.font['OS/2'].sFamilyClass : undefined) || 0) >> 8 + let flags = 0 + if (this.font.post.isFixedPitch) { + flags |= 1 << 0 + } + if (1 <= familyClass && familyClass <= 7) { + flags |= 1 << 1 + } + flags |= 1 << 2 // assume the font uses non-latin characters + if (familyClass === 10) { + flags |= 1 << 3 + } + if (this.font.head.macStyle.italic) { + flags |= 1 << 6 + } - // generate a random tag (6 uppercase letters. 65 is the char code for 'A') - const tag = [0, 1, 2, 3, 4, 5] - .map(i => String.fromCharCode(Math.random() * 26 + 65)) - .join(''); - const name = tag + '+' + this.font.postscriptName; - - const { bbox } = this.font; - const 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, - }); // not sure how to calculate this - - if (isCFF) { - descriptor.data.FontFile3 = fontFile; - } else { - descriptor.data.FontFile2 = fontFile; - } + // generate a random tag (6 uppercase letters. 65 is the char code for 'A') + const tag = [0, 1, 2, 3, 4, 5].map(i => String.fromCharCode(Math.random() * 26 + 65)).join('') + const name = tag + '+' + this.font.postscriptName + + const { bbox } = this.font + const 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 + }) // not sure how to calculate this + + if (isCFF) { + descriptor.data.FontFile3 = fontFile + } else { + descriptor.data.FontFile2 = fontFile + } - descriptor.end(); - - const 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(); + descriptor.end() + + const 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() } - // Maps the glyph ids encoded in the PDF back to unicode strings - // Because of ligature substitutions and the like, there may be one or more - // unicode characters represented by each glyph. - toUnicodeCmap() { - const cmap = this.document.ref(); - - const entries = []; - for (let codePoints of Array.from(this.unicode)) { - const encoded = []; - for (let value of Array.from(codePoints)) { - if (value > 0xffff) { - value -= 0x10000; - encoded.push(toHex(((value >>> 10) & 0x3ff) | 0xd800)); - value = 0xdc00 | (value & 0x3ff); - } - - encoded.push(toHex(value)); - - entries.push(`<${encoded.join(' ')}>`); + return this.dictionary.end() + } + + // Maps the glyph ids encoded in the PDF back to unicode strings + // Because of ligature substitutions and the like, there may be one or more + // unicode characters represented by each glyph. + toUnicodeCmap() { + const cmap = this.document.ref() + + const entries = [] + for (let codePoints of Array.from(this.unicode)) { + const encoded = [] + for (let value of Array.from(codePoints)) { + if (value > 0xffff) { + value -= 0x10000 + encoded.push(toHex(((value >>> 10) & 0x3ff) | 0xd800)) + value = 0xdc00 | (value & 0x3ff) } - } - cmap.end(`\ - /CIDInit /ProcSet findresource begin - 12 dict begin - begincmap - /CIDSystemInfo << - /Registry (Adobe) - /Ordering (UCS) - /Supplement 0 - >> def - /CMapName /Adobe-Identity-UCS def - /CMapType 2 def - 1 begincodespacerange - <0000> - endcodespacerange - 1 beginbfrange - <0000> <${toHex(entries.length - 1)}> [${entries.join(' ')}] - endbfrange - endcmap - CMapName currentdict /CMap defineresource pop - end - end\ - `); - - return cmap; + encoded.push(toHex(value)) + + entries.push(`<${encoded.join(' ')}>`) + } } + + cmap.end(`\ +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo << +/Registry (Adobe) +/Ordering (UCS) +/Supplement 0 +>> def +/CMapName /Adobe-Identity-UCS def +/CMapType 2 def +1 begincodespacerange +<0000> +endcodespacerange +1 beginbfrange +<0000> <${toHex(entries.length - 1)}> [${entries.join(' ')}] +endbfrange +endcmap +CMapName currentdict /CMap defineresource pop +end +end\ +`) + + return cmap } -); +} -export default createEmbeddedFont; +export default EmbeddedFont diff --git a/src/font/standard.js b/src/font/standard.js index 8a1b5fae2..c577b1e90 100644 --- a/src/font/standard.js +++ b/src/font/standard.js @@ -1,14 +1,15 @@ -import LZString from 'lz-string'; -import AFMFont from './afm'; -import Courier from './data/Courier.b64.afm'; -import CourierBold from './data/Courier-Bold.b64.afm'; -import CourierOblique from './data/Courier-Oblique.b64.afm'; -import Helvetica from './data/Helvetica.b64.afm'; -import HelveticaBold from './data/Helvetica-Bold.b64.afm'; -import HelveticaOblique from './data/Helvetica-Oblique.b64.afm'; -import TimesRoman from './data/Times-Roman.b64.afm'; -import TimesBold from './data/Times-Bold.b64.afm'; -import TimesItalic from './data/Times-Italic.b64.afm'; +import LZString from 'lz-string' +import AFMFont from './afm' +import PDFFont from '../font' +import Courier from './data/Courier.b64.afm' +import CourierBold from './data/Courier-Bold.b64.afm' +import CourierOblique from './data/Courier-Oblique.b64.afm' +import Helvetica from './data/Helvetica.b64.afm' +import HelveticaBold from './data/Helvetica-Bold.b64.afm' +import HelveticaOblique from './data/Helvetica-Oblique.b64.afm' +import TimesRoman from './data/Times-Roman.b64.afm' +import TimesBold from './data/Times-Bold.b64.afm' +import TimesItalic from './data/Times-Italic.b64.afm' const STANDARD_FONTS = { Courier: LZString.decompressFromBase64(Courier), @@ -19,82 +20,80 @@ const STANDARD_FONTS = { 'Helvetica-Oblique': LZString.decompressFromBase64(HelveticaOblique), 'Times-Roman': LZString.decompressFromBase64(TimesRoman), 'Times-Bold': LZString.decompressFromBase64(TimesBold), - 'Times-Italic': LZString.decompressFromBase64(TimesItalic), -}; - -const createStandardFont = PDFFont => ( - class StandardFont extends PDFFont { - constructor(document, name, id) { - super(); - - this.document = document; - this.name = name; - this.id = id; - this.font = new AFMFont(STANDARD_FONTS[this.name]); - this.ascender = this.font.ascender; - this.descender = this.font.descender; - this.bbox = this.font.bbox; - this.lineGap = this.font.lineGap; - } - - embed() { - this.dictionary.data = { - Type: 'Font', - BaseFont: this.name, - Subtype: 'Type1', - Encoding: 'WinAnsiEncoding', - }; + 'Times-Italic': LZString.decompressFromBase64(TimesItalic) +} + +class StandardFont extends PDFFont { + constructor(document, name, id) { + super() + + this.document = document + this.name = name + this.id = id + this.font = new AFMFont(STANDARD_FONTS[this.name]) + this.ascender = this.font.ascender + this.descender = this.font.descender + this.bbox = this.font.bbox + this.lineGap = this.font.lineGap + } - return this.dictionary.end(); + embed() { + this.dictionary.data = { + Type: 'Font', + BaseFont: this.name, + Subtype: 'Type1', + Encoding: 'WinAnsiEncoding' } - encode(text) { - const encoded = this.font.encodeText(text); - const glyphs = this.font.glyphsForString(`${text}`); - const advances = this.font.advancesForGlyphs(glyphs); - const positions = []; - - for (let i = 0; i < glyphs.length; i++) { - const glyph = glyphs[i]; - positions.push({ - xAdvance: advances[i], - yAdvance: 0, - xOffset: 0, - yOffset: 0, - advanceWidth: this.font.widthOfGlyph(glyph), - }); - } - - return [encoded, positions]; + return this.dictionary.end() + } + + encode(text) { + const encoded = this.font.encodeText(text) + const glyphs = this.font.glyphsForString(`${text}`) + const advances = this.font.advancesForGlyphs(glyphs) + const positions = [] + + for (let i = 0; i < glyphs.length; i++) { + const glyph = glyphs[i] + positions.push({ + xAdvance: advances[i], + yAdvance: 0, + xOffset: 0, + yOffset: 0, + advanceWidth: this.font.widthOfGlyph(glyph) + }) } - encodeGlyphs(glyphs) { - const res = []; + return [encoded, positions] + } - for (let glyph of Array.from(glyphs)) { - res.push(`00${glyph.id.toString(16)}`.slice(-2)); - } + encodeGlyphs(glyphs) { + const res = [] - return res; + for (let glyph of glyphs) { + res.push(`00${glyph.id.toString(16)}`.slice(-2)) } - widthOfString(string, size) { - const glyphs = this.font.glyphsForString(`${string}`); - const advances = this.font.advancesForGlyphs(glyphs); + return res + } - let width = 0; - for (let advance of Array.from(advances)) { - width += advance; - } + widthOfString(string, size) { + const glyphs = this.font.glyphsForString(`${string}`) + const advances = this.font.advancesForGlyphs(glyphs) - const scale = size / 1000; - return width * scale; + let width = 0 + for (let advance of advances) { + width += advance } - static isStandardFont(name) { - return name in STANDARD_FONTS; - } + const scale = size / 1000 + return width * scale + } + + static isStandardFont(name) { + return name in STANDARD_FONTS } -); +} -export default createStandardFont; +export default StandardFont diff --git a/src/font_factory.js b/src/font_factory.js new file mode 100644 index 000000000..f2f5b714f --- /dev/null +++ b/src/font_factory.js @@ -0,0 +1,36 @@ +import fontkit from '@react-pdf/fontkit' +import StandardFont from './font/standard'; +import EmbeddedFont from './font/embedded'; + +class PDFFontFactory { + static open(document, src, family, id) { + let 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); + } else if (typeof src === 'object') { + font = src; + } + + if ((font == null)) { + throw new Error('Not a supported font format or standard PDF font.'); + } + + return new EmbeddedFont(document, font, id); + } +} + + +export default PDFFontFactory; diff --git a/src/gradient.js b/src/gradient.js new file mode 100644 index 000000000..3c3d2aca9 --- /dev/null +++ b/src/gradient.js @@ -0,0 +1,251 @@ +import PDFObject from './object'; + +const { + number +} = PDFObject; + +class PDFGradient { + constructor(doc) { + this.doc = doc; + this.stops = []; + this.embedded = false; + this.transform = [1, 0, 0, 1, 0, 0]; + } + + stop(pos, color, opacity) { + if (opacity == null) { opacity = 1; } + color = this.doc._normalizeColor(color); + + if (this.stops.length === 0) { + if (color.length === 3) { + this._colorSpace = 'DeviceRGB'; + } else if (color.length === 4) { + this._colorSpace = 'DeviceCMYK'; + } else if (color.length === 1) { + this._colorSpace = 'DeviceGray'; + } else { + throw new Error('Unknown color space'); + } + } else if (((this._colorSpace === 'DeviceRGB') && (color.length !== 3)) || + ((this._colorSpace === 'DeviceCMYK') && (color.length !== 4)) || + ((this._colorSpace === 'DeviceGray') && (color.length !== 1))) { + throw new Error('All gradient stops must use the same color space'); + } + + opacity = Math.max(0, Math.min(1, opacity)); + this.stops.push([pos, color, opacity]); + return this; + } + + setTransform(m11, m12, m21, m22, dx, dy) { + this.transform = [m11, m12, m21, m22, dx, dy]; + return this; + } + + embed(m) { + let asc, i; + let end, fn; + if (this.stops.length === 0) { return; } + this.embedded = true; + this.matrix = m; + + // if the last stop comes before 100%, add a copy at 100% + const last = this.stops[this.stops.length - 1]; + if (last[0] < 1) { + this.stops.push([1, last[1], last[2]]); + } + + const bounds = []; + const encode = []; + const stops = []; + + for (i = 0, end = this.stops.length - 1, asc = 0 <= end; asc ? i < end : i > end; asc ? 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 there are only two stops, we don't need a stitching function + if (stops.length === 1) { + fn = stops[0]; + } else { + fn = this.doc.ref({ + FunctionType: 3, // stitching function + Domain: [0, 1], + Functions: stops, + Bounds: bounds, + Encode: encode + }); + + fn.end(); + } + + this.id = `Sh${++this.doc._gradCount}`; + + const shader = this.shader(fn); + shader.end(); + + const pattern = this.doc.ref({ + Type: 'Pattern', + PatternType: 2, + Shading: shader, + Matrix: (this.matrix.map((v) => number(v))) + }); + + pattern.end(); + + if (this.stops.some(stop => stop[2] < 1)) { + let grad = this.opacityGradient(); + grad._colorSpace = 'DeviceGray'; + + for (let stop of this.stops) { + grad.stop(stop[0], [stop[2]]); + } + + grad = grad.embed(this.matrix); + + const pageBBox = [0, 0, this.doc.page.width, this.doc.page.height]; + + const form = this.doc.ref({ + Type: 'XObject', + Subtype: 'Form', + FormType: 1, + BBox: pageBBox, + Group: { + Type: 'Group', + S: 'Transparency', + CS: 'DeviceGray' + }, + Resources: { + ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'], + Pattern: { + Sh1: grad + } + } + }); + + form.write("/Pattern cs /Sh1 scn"); + form.end(`${pageBBox.join(" ")} re f`); + + const gstate = this.doc.ref({ + Type: 'ExtGState', + SMask: { + Type: 'Mask', + S: 'Luminosity', + G: form + } + }); + + gstate.end(); + + const opacityPattern = this.doc.ref({ + Type: 'Pattern', + PatternType: 1, + PaintType: 1, + TilingType: 2, + BBox: pageBBox, + XStep: pageBBox[2], + YStep: pageBBox[3], + Resources: { + ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'], + Pattern: { + Sh1: pattern + }, + ExtGState: { + Gs1: gstate + } + } + }); + + opacityPattern.write("/Gs1 gs /Pattern cs /Sh1 scn"); + opacityPattern.end(`${pageBBox.join(" ")} re f`); + + this.doc.page.patterns[this.id] = opacityPattern; + + } else { + this.doc.page.patterns[this.id] = pattern; + } + + return pattern; + } + + apply(op) { + // apply gradient transform to existing document ctm + const [m0, m1, m2, m3, m4, m5] = this.doc._ctm; + const [m11, m12, m21, m22, dx, dy] = this.transform; + const m = [(m0 * m11) + (m2 * m12), + (m1 * m11) + (m3 * m12), + (m0 * m21) + (m2 * m22), + (m1 * m21) + (m3 * m22), + (m0 * dx) + (m2 * dy) + m4, + (m1 * dx) + (m3 * dy) + m5]; + + if (!this.embedded || (m.join(" ") !== this.matrix.join(" "))) { this.embed(m); } + return this.doc.addContent(`/${this.id} ${op}`); + } +} + +class PDFLinearGradient extends PDFGradient { + constructor(doc, x1, y1, x2, y2) { + super(doc); + this.x1 = x1; + this.y1 = y1; + this.x2 = x2; + this.y2 = y2; + } + + shader(fn) { + return this.doc.ref({ + ShadingType: 2, + ColorSpace: this._colorSpace, + Coords: [this.x1, this.y1, this.x2, this.y2], + Function: fn, + Extend: [true, true] + }); + } + + opacityGradient() { + return new PDFLinearGradient(this.doc, this.x1, this.y1, this.x2, this.y2); + } +} + +class PDFRadialGradient extends PDFGradient { + constructor(doc, x1, y1, r1, x2, y2, r2) { + super(doc); + this.doc = doc; + this.x1 = x1; + this.y1 = y1; + this.r1 = r1; + this.x2 = x2; + this.y2 = y2; + this.r2 = r2; + } + + shader(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] + }); + } + + opacityGradient() { + return new PDFRadialGradient(this.doc, this.x1, this.y1, this.r1, this.x2, this.y2, this.r2); + } +} + +export default { PDFGradient, PDFLinearGradient, PDFRadialGradient }; diff --git a/src/image.js b/src/image.js index 2ef936d76..86bc5c688 100644 --- a/src/image.js +++ b/src/image.js @@ -1,5 +1,4 @@ import fs from 'fs'; -import Data from './data'; import JPEG from './image/jpeg'; import PNG from './image/png'; @@ -11,8 +10,8 @@ class PDFImage { } else if (src instanceof ArrayBuffer) { data = new Buffer(new Uint8Array(src)); } else { - let match = /^data:.+;base64,(.*)$/.exec(src); - if (match) { + let match; + if (match = /^data:.+;base64,(.*)$/.exec(src)) { data = new Buffer(match[1], 'base64'); } else if (!BROWSER) { data = fs.readFileSync(src); diff --git a/src/image/jpeg.js b/src/image/jpeg.js index 715e5c6d5..6ddf09e36 100644 --- a/src/image/jpeg.js +++ b/src/image/jpeg.js @@ -13,60 +13,50 @@ let MARKERS = [ 0xffcc, 0xffcd, 0xffce, - 0xffcf, -]; + 0xffcf +] + +const COLOR_SPACE_MAP = { + 1: 'DeviceGray', + 3: 'DeviceRGB', + 4: 'DeviceCMYK' +} class JPEG { constructor(data, label) { - let marker; - this.data = data; - this.label = label; - + let marker + this.data = data + this.label = label if (this.data.readUInt16BE(0) !== 0xffd8) { - throw 'SOI not found in JPEG'; + throw 'SOI not found in JPEG' } - let pos = 2; + let pos = 2 while (pos < this.data.length) { - marker = this.data.readUInt16BE(pos); - pos += 2; - if (Array.from(MARKERS).includes(marker)) { - break; - } - pos += this.data.readUInt16BE(pos); + marker = this.data.readUInt16BE(pos) + pos += 2 + if (MARKERS.includes(marker)) break + pos += this.data.readUInt16BE(pos) } - if (!Array.from(MARKERS).includes(marker)) { - throw 'Invalid JPEG.'; - } - pos += 2; + if (!MARKERS.includes(marker)) throw 'Invalid JPEG.' + pos += 2 - this.bits = this.data[pos++]; - this.height = this.data.readUInt16BE(pos); - pos += 2; + this.bits = this.data[pos++] + this.height = this.data.readUInt16BE(pos) + pos += 2 - this.width = this.data.readUInt16BE(pos); - pos += 2; + this.width = this.data.readUInt16BE(pos) + pos += 2 - const channels = this.data[pos++]; - this.colorSpace = (() => { - switch (channels) { - case 1: - return 'DeviceGray'; - case 3: - return 'DeviceRGB'; - case 4: - return 'DeviceCMYK'; - } - })(); + const channels = this.data[pos++] + this.colorSpace = COLOR_SPACE_MAP[channels] - this.obj = null; + this.obj = null } embed(document) { - if (this.obj) { - return; - } + if (this.obj) return this.obj = document.ref({ Type: 'XObject', @@ -75,21 +65,21 @@ class JPEG { Width: this.width, Height: this.height, ColorSpace: this.colorSpace, - Filter: 'DCTDecode', - }); + Filter: 'DCTDecode' + }) // add extra decode params for CMYK images. By swapping the // min and max values from the default, we invert the colors. See // section 4.8.4 of the spec. 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.data['Decode'] = [1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0] } - this.obj.end(this.data); + this.obj.end(this.data) // free memory - return (this.data = null); + return (this.data = null) } -}; +} -export default JPEG; +export default JPEG diff --git a/src/image/png.js b/src/image/png.js index c5475f1dc..3a3d14f7e 100644 --- a/src/image/png.js +++ b/src/image/png.js @@ -13,9 +13,7 @@ class PNGImage { embed(document) { this.document = document; - if (this.obj) { - return; - } + if (this.obj) return; this.obj = this.document.ref({ Type: 'XObject', @@ -61,6 +59,7 @@ class PNGImage { // An array with N elements, where N is two times the number of color components. const val = this.image.transparency.greyscale; return (this.obj.data['Mask'] = [val, val]); + } else if (this.image.transparency.rgb) { // Use Color Key Masking (spec section 4.8.5) // An array with N elements, where N is two times the number of color components. @@ -71,6 +70,7 @@ class PNGImage { } return (this.obj.data['Mask'] = mask); + } else if (this.image.transparency.indexed) { // Create a transparency SMask for the image based on the data // in the PLTE and tRNS sections. See below for details on SMasks. diff --git a/src/mixins/annotations.js b/src/mixins/annotations.js index c7ebc4030..3b179932a 100644 --- a/src/mixins/annotations.js +++ b/src/mixins/annotations.js @@ -27,22 +27,16 @@ export default { }, note(x, y, w, h, contents, options) { - if (options == null) { - 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]; - } + if (options.color == null) options.color = [243, 223, 92]; return this.annotate(x, y, w, h, options); }, link(x, y, w, h, url, options) { - if (options == null) { - options = {}; - } + if (options == null) options = {}; options.Subtype = 'Link'; if (typeof url === 'number') { @@ -70,9 +64,7 @@ export default { }, _markup(x, y, w, h, options) { - if (options == null) { - options = {}; - } + if (options == null) options = {}; const [x1, y1, x2, y2] = Array.from(this._convertRect(x, y, w, h)); options.QuadPoints = [x1, y2, x2, y2, x1, y1, x2, y1]; options.Contents = new String(); @@ -80,36 +72,26 @@ export default { }, highlight(x, y, w, h, options) { - if (options == null) { - options = {}; - } + if (options == null) options = {}; options.Subtype = 'Highlight'; - if (options.color == null) { - options.color = [241, 238, 148]; - } + if (options.color == null) options.color = [241, 238, 148]; return this._markup(x, y, w, h, options); }, underline(x, y, w, h, options) { - if (options == null) { - options = {}; - } + if (options == null) options = {}; options.Subtype = 'Underline'; return this._markup(x, y, w, h, options); }, strike(x, y, w, h, options) { - if (options == null) { - options = {}; - } + if (options == null) options = {}; options.Subtype = 'StrikeOut'; return this._markup(x, y, w, h, options); }, lineAnnotation(x1, y1, x2, y2, options) { - if (options == null) { - options = {}; - } + if (options == null) options = {}; options.Subtype = 'Line'; options.Contents = new String(); options.L = [x1, this.page.height - y1, x2, this.page.height - y2]; @@ -117,27 +99,21 @@ export default { }, rectAnnotation(x, y, w, h, options) { - if (options == null) { - options = {}; - } + if (options == null) options = {}; options.Subtype = 'Square'; options.Contents = new String(); return this.annotate(x, y, w, h, options); }, ellipseAnnotation(x, y, w, h, options) { - if (options == null) { - options = {}; - } + if (options == null) options = {}; options.Subtype = 'Circle'; options.Contents = new String(); return this.annotate(x, y, w, h, options); }, textAnnotation(x, y, w, h, text, options) { - if (options == null) { - options = {}; - } + if (options == null) options = {}; options.Subtype = 'FreeText'; options.Contents = new String(text); options.DA = new String(); diff --git a/src/mixins/color.js b/src/mixins/color.js index 97e35cdc8..c3db50ded 100644 --- a/src/mixins/color.js +++ b/src/mixins/color.js @@ -1,23 +1,30 @@ +import Gradient from '../gradient'; + +const { + PDFGradient, + PDFLinearGradient, + PDFRadialGradient +} = Gradient; + export default { initColor() { // The opacity dictionaries this._opacityRegistry = {}; this._opacityCount = 0; - return (this._gradCount = 0); + return this._gradCount = 0; }, _normalizeColor(color) { - let 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' - ); - } + if (color.length === 4) { color = color.replace(/#([0-9A-F])([0-9A-F])([0-9A-F])/i, "#$1$1$2$2$3$3"); } const hex = parseInt(color.slice(1), 16); color = [hex >> 16, (hex >> 8) & 0xff, hex & 0xff]; + } else if (namedColors[color]) { color = namedColors[color]; } @@ -26,25 +33,11 @@ export default { if (Array.isArray(color)) { // RGB if (color.length === 3) { - color = (() => { - const result = []; - for (part of Array.from(color)) { - result.push(part / 255); - } - return result; - })(); - + color = color.map(part => part / 255); // CMYK } else if (color.length === 4) { - color = (() => { - const result1 = []; - for (part of Array.from(color)) { - result1.push(part / 100); - } - return result1; - })(); + color = color.map(part => part / 100); } - return color; } @@ -53,17 +46,20 @@ export default { _setColor(color, stroke) { color = this._normalizeColor(color); - if (!color) { - return false; - } + if (!color) { return false; } const op = stroke ? 'SCN' : 'scn'; - const space = color.length === 4 ? 'DeviceCMYK' : 'DeviceRGB'; - this._setColorSpace(space, stroke); + if (color instanceof PDFGradient) { + this._setColorSpace('Pattern', stroke); + color.apply(op); + } else { + const space = color.length === 4 ? 'DeviceCMYK' : 'DeviceRGB'; + this._setColorSpace(space, stroke); - color = color.join(' '); - this.addContent(`${color} ${op}`); + color = color.join(' '); + this.addContent(`${color} ${op}`); + } return true; }, @@ -75,9 +71,7 @@ export default { fillColor(color, opacity) { const set = this._setColor(color, false); - if (set) { - this.fillOpacity(opacity); - } + if (set) { this.fillOpacity(opacity); } // save this for text wrapper, which needs to reset // the fill color on new pages @@ -87,9 +81,7 @@ export default { strokeColor(color, opacity) { const set = this._setColor(color, true); - if (set) { - this.strokeOpacity(opacity); - } + if (set) { this.strokeOpacity(opacity); } return this; }, @@ -110,29 +102,20 @@ export default { _doOpacity(fillOpacity, strokeOpacity) { let dictionary, name; - if (fillOpacity == null && strokeOpacity == null) { - return; - } + 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)); - } + if (fillOpacity != null) { fillOpacity = Math.max(0, Math.min(1, fillOpacity)); } + if (strokeOpacity != null) { strokeOpacity = Math.max(0, Math.min(1, strokeOpacity)); } const key = `${fillOpacity}_${strokeOpacity}`; if (this._opacityRegistry[key]) { - [dictionary, name] = Array.from(this._opacityRegistry[key]); + [dictionary, name] = this._opacityRegistry[key]; } else { - dictionary = { Type: 'ExtGState' }; + dictionary = + { Type: 'ExtGState' }; - if (fillOpacity != null) { - dictionary.ca = fillOpacity; - } - if (strokeOpacity != null) { - dictionary.CA = strokeOpacity; - } + if (fillOpacity != null) { dictionary.ca = fillOpacity; } + if (strokeOpacity != null) { dictionary.CA = strokeOpacity; } dictionary = this.ref(dictionary); dictionary.end(); @@ -144,6 +127,14 @@ export default { this.page.ext_gstates[name] = dictionary; return this.addContent(`/${name} gs`); }, + + linearGradient(x1, y1, x2, y2) { + return new PDFLinearGradient(this, x1, y1, x2, y2); + }, + + radialGradient(x1, y1, r1, x2, y2, r2) { + return new PDFRadialGradient(this, x1, y1, r1, x2, y2, r2); + } }; var namedColors = { @@ -293,5 +284,5 @@ var namedColors = { white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], - yellowgreen: [154, 205, 50], + yellowgreen: [154, 205, 50] }; diff --git a/src/mixins/fonts.js b/src/mixins/fonts.js index e7490eb24..cdfcb1c83 100644 --- a/src/mixins/fonts.js +++ b/src/mixins/fonts.js @@ -1,26 +1,26 @@ -import PDFFont from '../font'; +import PDFFontFactory from '../font_factory' export default { initFonts() { // Lookup table for embedded fonts - this._fontFamilies = {}; - this._fontCount = 0; + this._fontFamilies = {} + this._fontCount = 0 // Font state - this._fontSize = 12; - this._font = null; + this._fontSize = 12 + this._font = null - this._registeredFonts = {}; + this._registeredFonts = {} // Set the default font - return this.font('Helvetica'); + return this.font('Helvetica') }, font(src, family, size) { - let cacheKey, font; + let cacheKey, font if (typeof family === 'number') { - size = family; - family = null; + size = family + family = null } // check registered fonts if src is a string @@ -28,63 +28,59 @@ export default { cacheKey = src; ({ src, family } = this._registeredFonts[src]); } else { - cacheKey = family || src; - if (typeof cacheKey !== 'string') { - cacheKey = null; - } + cacheKey = family || src + if (typeof cacheKey !== 'string') cacheKey = null } - if (size != null) { - this.fontSize(size); - } + if (size != null) this.fontSize(size) // fast path: check if the font is already in the PDF if ((font = this._fontFamilies[cacheKey])) { - this._font = font; - return this; + this._font = font + return this } // load the font - const id = `F${++this._fontCount}`; - this._font = PDFFont.open(this, src, family, id); + const id = `F${++this._fontCount}` + this._font = PDFFontFactory.open(this, src, family, id); // check for existing font familes with the same name already in the PDF // useful if the font was passed as a buffer if ((font = this._fontFamilies[this._font.name])) { - this._font = font; - return this; + this._font = font + return this } // save the font for reuse later if (cacheKey) { - this._fontFamilies[cacheKey] = this._font; + this._fontFamilies[cacheKey] = this._font } if (this._font.name) { - this._fontFamilies[this._font.name] = this._font; + this._fontFamilies[this._font.name] = this._font } - return this; + return this }, fontSize(_fontSize) { - this._fontSize = _fontSize; - return this; + this._fontSize = _fontSize + return this }, currentLineHeight(includeGap) { if (includeGap == null) { - includeGap = false; + includeGap = false } - return this._font.lineHeight(this._fontSize, includeGap); + return this._font.lineHeight(this._fontSize, includeGap) }, registerFont(name, src, family) { this._registeredFonts[name] = { src, - family, - }; + family + } - return this; - }, -}; + return this + } +} diff --git a/src/mixins/images.js b/src/mixins/images.js index 33383f395..801b51dbc 100644 --- a/src/mixins/images.js +++ b/src/mixins/images.js @@ -8,9 +8,7 @@ export default { image(src, x, y, options) { let bh, bp, bw, image, ip, left, left1; - if (options == null) { - options = {}; - } + if (options == null) options = {}; if (typeof x === 'object') { options = x; x = null; @@ -46,13 +44,16 @@ export default { const wp = w / image.width; w = image.width * wp; h = image.height * wp; + } else if (options.height && !options.width) { const hp = h / image.height; w = image.width * hp; h = image.height * hp; + } else if (options.scale) { w = image.width * options.scale; h = image.height * options.scale; + } else if (options.fit) { [bw, bh] = Array.from(options.fit); bp = bw / bh; @@ -64,6 +65,7 @@ export default { h = bh; w = bh * ip; } + } else if (options.cover) { [bw, bh] = Array.from(options.cover); bp = bw / bh; diff --git a/src/mixins/outline.js b/src/mixins/outline.js new file mode 100644 index 000000000..b67ad618e --- /dev/null +++ b/src/mixins/outline.js @@ -0,0 +1,15 @@ +import PDFOutline from '../outline'; + +export default { + initOutline() { + return this.outline = new PDFOutline(this, null, null, null); + }, + + endOutline() { + this.outline.endOutline(); + if (this.outline.children.length > 0) { + this._root.data.Outlines = this.outline.dictionary; + return this._root.data.PageMode = 'UseOutlines'; + } + } +}; diff --git a/src/mixins/text.js b/src/mixins/text.js index 25f9edab3..9d6acd4e2 100644 --- a/src/mixins/text.js +++ b/src/mixins/text.js @@ -47,7 +47,6 @@ export default { this._fragment(text, this.x, this.y, options) }, - _fragment(text, x, y, options) { text = ('' + text).replace(/\n/g, '') diff --git a/src/mixins/vector.js b/src/mixins/vector.js index 8c0efe1ba..b1853a92b 100644 --- a/src/mixins/vector.js +++ b/src/mixins/vector.js @@ -1,14 +1,17 @@ import SVGPath from '../path'; import PDFObject from '../object'; +const { + number +} = PDFObject; + // This constant is used to approximate a symmetrical arc using a cubic // Bezier curve. const KAPPA = 4.0 * ((Math.sqrt(2) - 1.0) / 3.0); - export default { initVector() { this._ctm = [1, 0, 0, 1, 0, 0]; // current transformation matrix - return (this._ctmStack = []); + return this._ctmStack = []; }, save() { @@ -27,110 +30,88 @@ export default { }, lineWidth(w) { - return this.addContent(`${PDFObject.number(w)} w`); + return this.addContent(`${number(w)} w`); }, _CAP_STYLES: { BUTT: 0, ROUND: 1, - SQUARE: 2, + SQUARE: 2 }, lineCap(c) { - if (typeof c === 'string') { - c = this._CAP_STYLES[c.toUpperCase()]; - } + if (typeof c === 'string') { c = this._CAP_STYLES[c.toUpperCase()]; } return this.addContent(`${c} J`); }, _JOIN_STYLES: { MITER: 0, ROUND: 1, - BEVEL: 2, + BEVEL: 2 }, lineJoin(j) { - if (typeof j === 'string') { - j = this._JOIN_STYLES[j.toUpperCase()]; - } + if (typeof j === 'string') { j = this._JOIN_STYLES[j.toUpperCase()]; } return this.addContent(`${j} j`); }, miterLimit(m) { - return this.addContent(`${PDFObject.number(m)} M`); + return this.addContent(`${number(m)} M`); }, dash(length, options) { let phase; - if (options == null) { - options = {}; - } - if (length == null) { - return this; - } + if (options == null) { options = {}; } + if (length == null) { return this; } if (Array.isArray(length)) { - length = Array.from(length) - .map(v => PDFObject.number(v)) - .join(' '); + length = length.map((v) => number(v)).join(' '); phase = options.phase || 0; - return this.addContent(`[${length}] ${PDFObject.number(phase)} d`); + return this.addContent(`[${length}] ${number(phase)} d`); } else { const space = options.space != null ? options.space : length; phase = options.phase || 0; - return this.addContent( - `[${PDFObject.number(length)} ${PDFObject.number(space)}] ${PDFObject.number(phase)} d` - ); + return this.addContent(`[${number(length)} ${number(space)}] ${number(phase)} d`); } }, undash() { - return this.addContent('[] 0 d'); + return this.addContent("[] 0 d"); }, moveTo(x, y) { - return this.addContent(`${PDFObject.number(x)} ${PDFObject.number(y)} m`); + return this.addContent(`${number(x)} ${number(y)} m`); }, lineTo(x, y) { - return this.addContent(`${PDFObject.number(x)} ${PDFObject.number(y)} l`); + return this.addContent(`${number(x)} ${number(y)} l`); }, bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) { - return this.addContent( - `${PDFObject.number(cp1x)} ${PDFObject.number(cp1y)} ${PDFObject.number(cp2x)} ${PDFObject.number(cp2y)} ${PDFObject.number( - x - )} ${PDFObject.number(y)} c` - ); + return this.addContent(`${number(cp1x)} ${number(cp1y)} ${number(cp2x)} ${number(cp2y)} ${number(x)} ${number(y)} c`); }, quadraticCurveTo(cpx, cpy, x, y) { - return this.addContent( - `${PDFObject.number(cpx)} ${PDFObject.number(cpy)} ${PDFObject.number(x)} ${PDFObject.number(y)} v` - ); + return this.addContent(`${number(cpx)} ${number(cpy)} ${number(x)} ${number(y)} v`); }, rect(x, y, w, h) { - return this.addContent( - `${PDFObject.number(x)} ${PDFObject.number(y)} ${PDFObject.number(w)} ${PDFObject.number(h)} re` - ); + return this.addContent(`${number(x)} ${number(y)} ${number(w)} ${number(h)} re`); }, roundedRect(x, y, w, h, r) { - if (r == null) { - r = 0; - } + if (r == null) { r = 0; } r = Math.min(r, 0.5 * w, 0.5 * h); // amount to inset control points from corners (see `ellipse`) const c = r * (1.0 - KAPPA); this.moveTo(x + r, y); - this.lineTo(x + w - r, y); - this.bezierCurveTo(x + w - c, y, x + w, y + c, x + w, y + r); - this.lineTo(x + w, y + h - r); - this.bezierCurveTo(x + w, y + h - c, x + w - c, y + h, x + w - r, y + h); + this.lineTo((x + w) - r, y); + this.bezierCurveTo((x + w) - c, y, x + w, y + c, x + w, y + r); + this.lineTo(x + w, (y + h) - r); + this.bezierCurveTo(x + w, (y + h) - c, (x + w) - c, y + h, (x + w) - r, y + h); this.lineTo(x + r, y + h); - this.bezierCurveTo(x + c, y + h, x, y + h - c, x, y + h - r); + this.bezierCurveTo(x + c, y + h, x, (y + h) - c, x, (y + h) - r); this.lineTo(x, y + r); this.bezierCurveTo(x, y + c, x + c, y, x + r, y); return this.closePath(); @@ -138,15 +119,13 @@ export default { ellipse(x, y, r1, r2) { // based on http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas/2173084#2173084 - if (r2 == null) { - r2 = r1; - } + if (r2 == null) { r2 = r1; } x -= r1; y -= r2; const ox = r1 * KAPPA; const oy = r2 * KAPPA; - const xe = x + r1 * 2; - const ye = y + r2 * 2; + const xe = x + (r1 * 2); + const ye = y + (r2 * 2); const xm = x + r1; const ym = y + r2; @@ -163,9 +142,7 @@ export default { }, arc(x, y, radius, startAngle, endAngle, anticlockwise) { - if (anticlockwise == null) { - anticlockwise = false; - } + if (anticlockwise == null) { anticlockwise = false; } const TWO_PI = 2.0 * Math.PI; const HALF_PI = 0.5 * Math.PI; @@ -174,10 +151,11 @@ export default { if (Math.abs(deltaAng) > TWO_PI) { // draw only full circle if more than that is specified deltaAng = TWO_PI; - } else if (deltaAng !== 0 && anticlockwise !== deltaAng < 0) { + + } else if ((deltaAng !== 0) && (anticlockwise !== (deltaAng < 0))) { // necessary to flip direction of rendering const dir = anticlockwise ? -1 : 1; - deltaAng = dir * TWO_PI + deltaAng; + deltaAng = (dir * TWO_PI) + deltaAng; } const numSegs = Math.ceil(Math.abs(deltaAng) / HALF_PI); @@ -190,17 +168,13 @@ export default { let deltaCy = Math.cos(curAng) * handleLen; // anchor point - let ax = x + Math.cos(curAng) * radius; - let ay = y + Math.sin(curAng) * radius; + let ax = x + (Math.cos(curAng) * radius); + let ay = y + (Math.sin(curAng) * radius); // calculate and render segments this.moveTo(ax, ay); - for ( - let segIdx = 0, end = numSegs, asc = 0 <= end; - asc ? segIdx < end : segIdx > end; - asc ? segIdx++ : segIdx-- - ) { + for (let segIdx = 0, end = numSegs, asc = 0 <= end; asc ? segIdx < end : segIdx > end; asc ? segIdx++ : segIdx--) { // starting control point const cp1x = ax + deltaCx; const cp1y = ay + deltaCy; @@ -209,8 +183,8 @@ export default { curAng += segAng; // next anchor point - ax = x + Math.cos(curAng) * radius; - ay = y + Math.sin(curAng) * radius; + ax = x + (Math.cos(curAng) * radius); + ay = y + (Math.sin(curAng) * radius); // next control point delta deltaCx = -Math.sin(curAng) * handleLen; @@ -228,10 +202,8 @@ export default { }, polygon(...points) { - this.moveTo(...Array.from(points.shift() || [])); - for (let point of Array.from(points)) { - this.lineTo(...Array.from(point || [])); - } + this.moveTo(...(points.shift() || [])); + for (let point of points) { this.lineTo(...(point || [])); } return this.closePath(); }, @@ -254,23 +226,17 @@ export default { color = null; } - if (color) { - this.fillColor(color); - } + if (color) { this.fillColor(color); } return this.addContent(`f${this._windingRule(rule)}`); }, stroke(color) { - if (color) { - this.strokeColor(color); - } + if (color) { this.strokeColor(color); } return this.addContent('S'); }, fillAndStroke(fillColor, strokeColor, rule) { - if (strokeColor == null) { - strokeColor = fillColor; - } + if (strokeColor == null) { strokeColor = fillColor; } const isFillRule = /(even-?odd)|(non-?zero)/; if (isFillRule.test(fillColor)) { rule = fillColor; @@ -297,15 +263,15 @@ export default { transform(m11, m12, m21, m22, dx, dy) { // keep track of the current transformation matrix const m = this._ctm; - const [m0, m1, m2, m3, m4, m5] = Array.from(m); - 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; - - const values = [m11, m12, m21, m22, dx, dy].map(v => PDFObject.number(v)).join(' '); + const [m0, m1, m2, m3, m4, m5] = m; + 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; + + const values = ([m11, m12, m21, m22, dx, dy].map((v) => number(v))).join(' '); return this.addContent(`${values} cm`); }, @@ -315,18 +281,16 @@ export default { rotate(angle, options) { let y; - if (options == null) { - options = {}; - } + if (options == null) { options = {}; } const rad = (angle * Math.PI) / 180; const cos = Math.cos(rad); const sin = Math.sin(rad); let x = (y = 0); if (options.origin != null) { - [x, y] = Array.from(options.origin); - const x1 = x * cos - y * sin; - const y1 = x * sin + y * cos; + [x, y] = options.origin; + const x1 = (x * cos) - (y * sin); + const y1 = (x * sin) + (y * cos); x -= x1; y -= y1; } @@ -336,24 +300,20 @@ export default { scale(xFactor, yFactor, options) { let y; - if (yFactor == null) { - yFactor = xFactor; - } - if (options == null) { - options = {}; - } - if (typeof yFactor === 'object') { + if (yFactor == null) { yFactor = xFactor; } + if (options == null) { options = {}; } + if (typeof yFactor === "object") { options = yFactor; yFactor = xFactor; } let x = (y = 0); if (options.origin != null) { - [x, y] = Array.from(options.origin); + [x, y] = options.origin; x -= xFactor * x; y -= yFactor * y; } return this.transform(xFactor, 0, 0, yFactor, x, y); - }, + } }; diff --git a/src/object.js b/src/object.js index b0216689f..a48e0faea 100644 --- a/src/object.js +++ b/src/object.js @@ -1,4 +1,11 @@ -import PDFReference from './reference'; +/* +PDFObject - converts JavaScript types into their corresponding PDF types. +By Devon Govett +*/ + +import PDFAbstractReference from './abstract_reference'; + +const pad = (str, length) => (Array(length + 1).join('0') + str).slice(-length); const escapableRe = /[\n\r\t\b\f\(\)\\]/g; const escapable = { @@ -9,16 +16,14 @@ const escapable = { '\f': '\\f', '\\': '\\\\', '(': '\\(', - ')': '\\)', + ')': '\\)' }; -const pad = (str, length) => (Array(length + 1).join('0') + str).slice(-length); - // Convert little endian UTF-16 to big endian -const swapBytes = function(buff) { +const swapBytes = function (buff) { const l = buff.length; if (l & 0x01) { - throw new Error('Buffer length must be even'); + throw new Error("Buffer length must be even"); } else { for (let i = 0, end = l - 1; i < end; i += 2) { const a = buff[i]; @@ -31,7 +36,7 @@ const swapBytes = function(buff) { }; class PDFObject { - static convert(object) { + static convert(object, encryptFn = null) { // String literals are converted to the PDF name type if (typeof object === 'string') { return `/${object}`; @@ -49,10 +54,18 @@ class PDFObject { } // If so, encode it as big endian UTF-16 + let stringBuffer; if (isUnicode) { - string = swapBytes(new Buffer(`\ufeff${string}`, 'utf16le')).toString( - 'binary' - ); + stringBuffer = swapBytes(new Buffer(`\ufeff${string}`, 'utf16le')); + } else { + stringBuffer = new Buffer(string, 'ascii'); + } + + // Encrypt the string when necessary + if (encryptFn) { + string = encryptFn(stringBuffer).toString('binary'); + } else { + string = stringBuffer.toString('binary'); } // Escape characters as required by the spec @@ -63,46 +76,57 @@ class PDFObject { // Buffers are converted to PDF hex strings } else if (Buffer.isBuffer(object)) { return `<${object.toString('hex')}>`; - } else if (object instanceof PDFReference) { + + } else if (object instanceof PDFAbstractReference) { return object.toString(); + } else if (object instanceof Date) { - return ( - `(D:${pad(object.getUTCFullYear(), 4)}` + + let string = `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)' - ); + pad(object.getUTCSeconds(), 2) + 'Z'; + + // Encrypt the string when necessary + if (encryptFn) { + string = encryptFn(new Buffer(string, 'ascii')).toString('binary'); + + // Escape characters as required by the spec + string = string.replace(escapableRe, c => escapable[c]); + } + + return `(${string})`; + } else if (Array.isArray(object)) { - const items = Array.from(object) - .map(e => PDFObject.convert(e)) - .join(' '); + const items = (object.map((e) => PDFObject.convert(e, encryptFn))).join(' '); return `[${items}]`; + } else if ({}.toString.call(object) === '[object Object]') { const out = ['<<']; for (let key in object) { const val = object[key]; - out.push(`/${key} ${PDFObject.convert(val)}`); + out.push(`/${key} ${PDFObject.convert(val, encryptFn)}`); } out.push('>>'); return out.join('\n'); + } else if (typeof object === 'number') { return PDFObject.number(object); + } else { return `${object}`; } } static number(n) { - if (n > -1e21 && n < 1e21) { + if ((n > -1e21) && (n < 1e21)) { return Math.round(n * 1e6) / 1e6; } throw new Error(`unsupported number: ${n}`); } -} +}; export default PDFObject; diff --git a/src/outline.js b/src/outline.js new file mode 100644 index 000000000..846518979 --- /dev/null +++ b/src/outline.js @@ -0,0 +1,61 @@ +class PDFOutline { + constructor(document, parent, title, dest, options) { + this.document = document; + if (options == null) { options = { expanded: false }; } + this.options = options; + this.outlineData = {}; + + if (dest !== null) { + this.outlineData['Dest'] = [dest.dictionary, 'Fit']; + } + + if (parent !== null) { + this.outlineData['Parent'] = parent; + } + + if (title !== null) { + this.outlineData['Title'] = new String(title); + } + + this.dictionary = this.document.ref(this.outlineData); + this.children = []; + } + + addItem(title, options) { + if (options == null) { options = { expanded: false }; } + const result = new PDFOutline(this.document, this.dictionary, title, this.document.page, options); + this.children.push(result); + + return result; + } + + endOutline() { + let end; + if (this.children.length > 0) { + let asc, i; + if (this.options.expanded) { + this.outlineData.Count = this.children.length; + } + + const first = this.children[0], last = this.children[this.children.length - 1]; + this.outlineData.First = first.dictionary; + this.outlineData.Last = last.dictionary; + + for (i = 0, end = this.children.length, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) { + const child = this.children[i]; + if (i > 0) { + child.outlineData.Prev = this.children[i-1].dictionary; + } + if (i < (this.children.length - 1)) { + child.outlineData.Next = this.children[i+1].dictionary; + } + child.endOutline(); + } + } + + return this.dictionary.end(); + } +} + + +export default PDFOutline; diff --git a/src/page.js b/src/page.js index 4fccc5be8..90832f4be 100644 --- a/src/page.js +++ b/src/page.js @@ -1,3 +1,15 @@ +/* +PDFPage - represents a single page in the PDF document +By Devon Govett +*/ + +const DEFAULT_MARGINS = { + top: 72, + left: 72, + bottom: 72, + right: 72 +}; + const SIZES = { '4A0': [4767.87, 6740.79], '2A0': [3370.39, 4767.87], @@ -9,16 +21,16 @@ const SIZES = { A5: [419.53, 595.28], A6: [297.64, 419.53], A7: [209.76, 297.64], - A8: [147.4, 209.76], - A9: [104.88, 147.4], - A10: [73.7, 104.88], + 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.9, 708.66], - B6: [354.33, 498.9], + 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], @@ -34,36 +46,46 @@ const SIZES = { C8: [161.57, 229.61], C9: [113.39, 161.57], C10: [79.37, 113.39], - RA0: [2437.8, 3458.27], - RA1: [1729.13, 2437.8], - RA2: [1218.9, 1729.13], - RA3: [864.57, 1218.9], + 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.8, 907.09], - EXECUTIVE: [521.86, 756.0], - FOLIO: [612.0, 936.0], - LEGAL: [612.0, 1008.0], - LETTER: [612.0, 792.0], - TABLOID: [792.0, 1224.0], + 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] }; class PDFPage { constructor(document, options) { this.document = document; - if (options == null) { - options = {}; - } + if (options == null) { options = {}; } this.size = options.size || 'letter'; this.layout = options.layout || 'portrait'; + // process margins + if (typeof options.margin === 'number') { + this.margins = { + top: options.margin, + left: options.margin, + bottom: options.margin, + right: options.margin + }; + + // default to 1 inch margins + } else { + this.margins = options.margins || DEFAULT_MARGINS; + } + // calculate page dimensions - const dimensions = Array.isArray(this.size) - ? this.size - : SIZES[this.size.toUpperCase()]; + const 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]; @@ -71,41 +93,26 @@ class PDFPage { // Initialize the Font, XObject, and ExtGState dictionaries this.resources = this.document.ref({ - ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'], + ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'] }); // Lazily create these dictionaries Object.defineProperties(this, { fonts: { - get: () => - this.resources.data.Font != null - ? this.resources.data.Font - : (this.resources.data.Font = {}), + get: () => this.resources.data.Font != null ? this.resources.data.Font : (this.resources.data.Font = {}) }, xobjects: { - get: () => - this.resources.data.XObject != null - ? this.resources.data.XObject - : (this.resources.data.XObject = {}), + get: () => this.resources.data.XObject != null ? this.resources.data.XObject : (this.resources.data.XObject = {}) }, ext_gstates: { - get: () => - this.resources.data.ExtGState != null - ? this.resources.data.ExtGState - : (this.resources.data.ExtGState = {}), + get: () => this.resources.data.ExtGState != null ? this.resources.data.ExtGState : (this.resources.data.ExtGState = {}) }, patterns: { - get: () => - this.resources.data.Pattern != null - ? this.resources.data.Pattern - : (this.resources.data.Pattern = {}), + get: () => this.resources.data.Pattern != null ? this.resources.data.Pattern : (this.resources.data.Pattern = {}) }, annotations: { - get: () => - this.dictionary.data.Annots != null - ? this.dictionary.data.Annots - : (this.dictionary.data.Annots = []), - }, + get: () => this.dictionary.data.Annots != null ? this.dictionary.data.Annots : (this.dictionary.data.Annots = []) + } }); // The page dictionary @@ -114,12 +121,12 @@ class PDFPage { Parent: this.document._root.data.Pages, MediaBox: [0, 0, this.width, this.height], Contents: this.content, - Resources: this.resources, + Resources: this.resources }); } maxY() { - return this.height; + return this.height - this.margins.bottom; } write(chunk) { @@ -131,6 +138,6 @@ class PDFPage { this.resources.end(); return this.content.end(); } -} +}; export default PDFPage; diff --git a/src/path.js b/src/path.js index 6a0288b07..5fb47b394 100644 --- a/src/path.js +++ b/src/path.js @@ -1,446 +1,375 @@ -var SVGPath = (function() { - let parameters = undefined; - let parse = undefined; - let cx = undefined; - let apply = undefined; - let runners = undefined; - let solveArc = undefined; - let arcToSegments = undefined; - let segmentToBezier = undefined; - SVGPath = class SVGPath { - static initClass() { - let cy, px, py, sx, sy; - 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) { - let cmd; - const ret = []; - let args = []; - let curArg = ''; - let foundDecimal = false; - let params = 0; - - for (let c of Array.from(path)) { - if (parameters[c] != null) { - params = parameters[c]; - if (cmd) { - // save existing command - if (curArg.length > 0) { - args[args.length] = +curArg; - } - ret[ret.length] = { cmd, args }; - - args = []; - curArg = ''; - foundDecimal = false; - } - - cmd = c; - } else if ( - [' ', ','].includes(c) || - (c === '-' && - curArg.length > 0 && - curArg[curArg.length - 1] !== 'e') || - (c === '.' && foundDecimal) - ) { - if (curArg.length === 0) { - continue; - } - - if (args.length === params) { - // handle reused commands - ret[ret.length] = { cmd, args }; - args = [+curArg]; - - // handle assumed commands - if (cmd === 'M') { - cmd = 'L'; - } - if (cmd === 'm') { - cmd = 'l'; - } - } else { - args[args.length] = +curArg; - } - - foundDecimal = c === '.'; - - // fix for negative numbers or repeated decimals with no delimeter between commands - curArg = ['-', '.'].includes(c) ? c : ''; - } else { - curArg += c; - if (c === '.') { - foundDecimal = true; - } - } - } - - // add the last command - if (curArg.length > 0) { - if (args.length === params) { - // handle reused commands - ret[ret.length] = { cmd, args }; - args = [+curArg]; - - // handle assumed commands - if (cmd === 'M') { - cmd = 'L'; - } - if (cmd === 'm') { - cmd = 'l'; - } - } else { - args[args.length] = +curArg; - } - } +let cx, cy, px, py, sx, sy; + +cx = cy = px = py = sx = sy = 0; + +const 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 +}; + +const parse = function (path) { + let cmd; + const ret = []; + let args = []; + let curArg = ""; + let foundDecimal = false; + let params = 0; + + for (let c of path) { + if (parameters[c] != null) { + params = parameters[c]; + if (cmd) { // save existing command + if (curArg.length > 0) { args[args.length] = +curArg; } + ret[ret.length] = { cmd, args }; + + args = []; + curArg = ""; + foundDecimal = false; + } + + cmd = c; + } else if ([" ", ","].includes(c) || ((c === "-") && (curArg.length > 0) && (curArg[curArg.length - 1] !== 'e')) || ((c === ".") && foundDecimal)) { + if (curArg.length === 0) { continue; } + + if (args.length === params) { // handle reused commands ret[ret.length] = { cmd, args }; + args = [+curArg]; + + // handle assumed commands + if (cmd === "M") { cmd = "L"; } + if (cmd === "m") { cmd = "l"; } + + } else { + args[args.length] = +curArg; + } - return ret; - }; - - cx = cy = px = py = sx = sy = 0; - apply = function(commands, doc) { - // current point, control point, and subpath starting point - cx = cy = px = py = sx = sy = 0; - - // run the commands - for (let i = 0; i < commands.length; i++) { - const c = commands[i]; - if (typeof runners[c.cmd] === 'function') { - runners[c.cmd](doc, c.args); - } - } - - return (cx = cy = px = py = 0); - }; - - runners = { - M(doc, a) { - cx = a[0]; - cy = a[1]; - px = py = null; - sx = cx; - sy = cy; - return doc.moveTo(cx, cy); - }, - - m(doc, a) { - cx += a[0]; - cy += a[1]; - px = py = null; - sx = cx; - sy = cy; - return doc.moveTo(cx, cy); - }, - - C(doc, a) { - cx = a[4]; - cy = a[5]; - px = a[2]; - py = a[3]; - return doc.bezierCurveTo(...Array.from(a || [])); - }, - - c(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(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(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(doc, a) { - px = a[0]; - py = a[1]; - cx = a[2]; - cy = a[3]; - return doc.quadraticCurveTo(a[0], a[1], cx, cy); - }, - - q(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(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(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(doc, a) { - solveArc(doc, cx, cy, a); - cx = a[5]; - return (cy = a[6]); - }, - - a(doc, a) { - a[5] += cx; - a[6] += cy; - solveArc(doc, cx, cy, a); - cx = a[5]; - return (cy = a[6]); - }, - - L(doc, a) { - cx = a[0]; - cy = a[1]; - px = py = null; - return doc.lineTo(cx, cy); - }, - - l(doc, a) { - cx += a[0]; - cy += a[1]; - px = py = null; - return doc.lineTo(cx, cy); - }, - - H(doc, a) { - cx = a[0]; - px = py = null; - return doc.lineTo(cx, cy); - }, - - h(doc, a) { - cx += a[0]; - px = py = null; - return doc.lineTo(cx, cy); - }, - - V(doc, a) { - cy = a[0]; - px = py = null; - return doc.lineTo(cx, cy); - }, - - v(doc, a) { - cy += a[0]; - px = py = null; - return doc.lineTo(cx, cy); - }, - - Z(doc) { - doc.closePath(); - cx = sx; - return (cy = sy); - }, - - z(doc) { - doc.closePath(); - cx = sx; - return (cy = sy); - }, - }; - - solveArc = function(doc, x, y, coords) { - const [rx, ry, rot, large, sweep, ex, ey] = Array.from(coords); - const segs = arcToSegments(ex, ey, rx, ry, large, sweep, rot, x, y); - - return (() => { - const result = []; - for (let seg of Array.from(segs)) { - const bez = segmentToBezier(...Array.from(seg || [])); - result.push(doc.bezierCurveTo(...Array.from(bez || []))); - } - return result; - })(); - }; - - // from Inkscape svgtopdf, thanks! - arcToSegments = function(x, y, rx, ry, large, sweep, rotateX, ox, oy) { - const th = rotateX * (Math.PI / 180); - const sin_th = Math.sin(th); - const 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; - let pl = (px * px) / (rx * rx) + (py * py) / (ry * ry); - if (pl > 1) { - pl = Math.sqrt(pl); - rx *= pl; - ry *= pl; - } - - const a00 = cos_th / rx; - const a01 = sin_th / rx; - const a10 = -sin_th / ry; - const a11 = cos_th / ry; - const x0 = a00 * ox + a01 * oy; - const y0 = a10 * ox + a11 * oy; - const x1 = a00 * x + a01 * y; - const y1 = a10 * x + a11 * y; - - const d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0); - let sfactor_sq = 1 / d - 0.25; - if (sfactor_sq < 0) { - sfactor_sq = 0; - } - let sfactor = Math.sqrt(sfactor_sq); - if (sweep === large) { - sfactor = -sfactor; - } - - const xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0); - const yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0); - - const th0 = Math.atan2(y0 - yc, x0 - xc); - const th1 = Math.atan2(y1 - yc, x1 - xc); - - let 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; - } - - const segments = Math.ceil(Math.abs(th_arc / (Math.PI * 0.5 + 0.001))); - const result = []; - - for ( - let i = 0, end = segments, asc = 0 <= end; - asc ? i < end : i > end; - asc ? i++ : i-- - ) { - const th2 = th0 + (i * th_arc) / segments; - const 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) { - const a00 = cos_th * rx; - const a01 = -sin_th * ry; - const a10 = sin_th * rx; - const a11 = cos_th * ry; - - const th_half = 0.5 * (th1 - th0); - const t = - ((8 / 3) * Math.sin(th_half * 0.5) * Math.sin(th_half * 0.5)) / - Math.sin(th_half); - const x1 = cx + Math.cos(th0) - t * Math.sin(th0); - const y1 = cy + Math.sin(th0) + t * Math.cos(th0); - const x3 = cx + Math.cos(th1); - const y3 = cy + Math.sin(th1); - const x2 = x3 + t * Math.sin(th1); - const y2 = 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, - ]; - }; + foundDecimal = (c === "."); + + // fix for negative numbers or repeated decimals with no delimeter between commands + curArg = ['-', '.'].includes(c) ? c : ''; + + } else { + curArg += c; + if (c === '.') { foundDecimal = true; } } - static apply(doc, path) { - const commands = parse(path); - return apply(commands, doc); + } + + // add the last command + if (curArg.length > 0) { + if (args.length === params) { // handle reused commands + ret[ret.length] = { cmd, args }; + args = [+curArg]; + + // handle assumed commands + if (cmd === "M") { cmd = "L"; } + if (cmd === "m") { cmd = "l"; } + } else { + args[args.length] = +curArg; } - }; - SVGPath.initClass(); - return SVGPath; -})(); + } + + ret[ret.length] = { cmd, args }; + + return ret; +}; + +const apply = function (commands, doc) { + // current point, control point, and subpath starting point + cx = cy = px = py = sx = sy = 0; + + // run the commands + for (let i = 0; i < commands.length; i++) { + const c = commands[i]; + if (typeof runners[c.cmd] === 'function') { + runners[c.cmd](doc, c.args); + } + } +}; + +const runners = { + M(doc, a) { + cx = a[0]; + cy = a[1]; + px = (py = null); + sx = cx; + sy = cy; + return doc.moveTo(cx, cy); + }, + + m(doc, a) { + cx += a[0]; + cy += a[1]; + px = (py = null); + sx = cx; + sy = cy; + return doc.moveTo(cx, cy); + }, + + C(doc, a) { + cx = a[4]; + cy = a[5]; + px = a[2]; + py = a[3]; + return doc.bezierCurveTo(...(a || [])); + }, + + c(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(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(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(doc, a) { + px = a[0]; + py = a[1]; + cx = a[2]; + cy = a[3]; + return doc.quadraticCurveTo(a[0], a[1], cx, cy); + }, + + q(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(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(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(doc, a) { + solveArc(doc, cx, cy, a); + cx = a[5]; + return cy = a[6]; + }, + + a(doc, a) { + a[5] += cx; + a[6] += cy; + solveArc(doc, cx, cy, a); + cx = a[5]; + return cy = a[6]; + }, + + L(doc, a) { + cx = a[0]; + cy = a[1]; + px = (py = null); + return doc.lineTo(cx, cy); + }, + + l(doc, a) { + cx += a[0]; + cy += a[1]; + px = (py = null); + return doc.lineTo(cx, cy); + }, + + H(doc, a) { + cx = a[0]; + px = (py = null); + return doc.lineTo(cx, cy); + }, + + h(doc, a) { + cx += a[0]; + px = (py = null); + return doc.lineTo(cx, cy); + }, + + V(doc, a) { + cy = a[0]; + px = (py = null); + return doc.lineTo(cx, cy); + }, + + v(doc, a) { + cy += a[0]; + px = (py = null); + return doc.lineTo(cx, cy); + }, + + Z(doc) { + doc.closePath(); + cx = sx; + return cy = sy; + }, + + z(doc) { + doc.closePath(); + cx = sx; + return cy = sy; + } +}; + +const solveArc = function (doc, x, y, coords) { + const [rx, ry, rot, large, sweep, ex, ey] = coords; + const segs = arcToSegments(ex, ey, rx, ry, large, sweep, rot, x, y); + + for (let seg of segs) { + const bez = segmentToBezier(...(seg || [])); + doc.bezierCurveTo(...(bez || [])); + } +}; + +// from Inkscape svgtopdf, thanks! +const arcToSegments = function (x, y, rx, ry, large, sweep, rotateX, ox, oy) { + const th = rotateX * (Math.PI / 180); + const sin_th = Math.sin(th); + const 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); + let pl = ((px * px) / (rx * rx)) + ((py * py) / (ry * ry)); + if (pl > 1) { + pl = Math.sqrt(pl); + rx *= pl; + ry *= pl; + } + + const a00 = cos_th / rx; + const a01 = sin_th / rx; + const a10 = (-sin_th) / ry; + const a11 = (cos_th) / ry; + const x0 = (a00 * ox) + (a01 * oy); + const y0 = (a10 * ox) + (a11 * oy); + const x1 = (a00 * x) + (a01 * y); + const y1 = (a10 * x) + (a11 * y); + + const d = ((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0)); + let sfactor_sq = (1 / d) - 0.25; + if (sfactor_sq < 0) { sfactor_sq = 0; } + let sfactor = Math.sqrt(sfactor_sq); + if (sweep === large) { sfactor = -sfactor; } + + const xc = (0.5 * (x0 + x1)) - (sfactor * (y1 - y0)); + const yc = (0.5 * (y0 + y1)) + (sfactor * (x1 - x0)); + + const th0 = Math.atan2(y0 - yc, x0 - xc); + const th1 = Math.atan2(y1 - yc, x1 - xc); + + let 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; + } + + const segments = Math.ceil(Math.abs(th_arc / ((Math.PI * 0.5) + 0.001))); + const result = []; + + for (let i = 0, end = segments, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) { + const th2 = th0 + ((i * th_arc) / segments); + const th3 = th0 + (((i + 1) * th_arc) / segments); + result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th]; + } + + return result; +}; + +const segmentToBezier = function (cx, cy, th0, th1, rx, ry, sin_th, cos_th) { + const a00 = cos_th * rx; + const a01 = -sin_th * ry; + const a10 = sin_th * rx; + const a11 = cos_th * ry; + + const th_half = 0.5 * (th1 - th0); + const t = ((8 / 3) * Math.sin(th_half * 0.5) * Math.sin(th_half * 0.5)) / Math.sin(th_half); + const x1 = (cx + Math.cos(th0)) - (t * Math.sin(th0)); + const y1 = cy + Math.sin(th0) + (t * Math.cos(th0)); + const x3 = cx + Math.cos(th1); + const y3 = cy + Math.sin(th1); + const x2 = x3 + (t * Math.sin(th1)); + const y2 = 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) + ]; +}; + +class SVGPath { + static apply(doc, path) { + const commands = parse(path); + apply(commands, doc); + } +}; export default SVGPath; diff --git a/src/reference.js b/src/reference.js index 25cea9e49..146011d99 100644 --- a/src/reference.js +++ b/src/reference.js @@ -1,91 +1,81 @@ +/* +PDFReference - represents a reference to another object in the PDF object heirarchy +By Devon Govett +*/ + import zlib from 'zlib'; -import stream from 'stream'; +import PDFAbstractReference from './abstract_reference'; import PDFObject from './object'; -class PDFReference extends stream.Writable { +class PDFReference extends PDFAbstractReference { constructor(document, id, data) { - super({ decodeStrings: false }); - - this.finalize = this.finalize.bind(this); + super(); this.document = document; this.id = id; - if (data == null) { - data = {}; - } + if (data == null) { data = {}; } this.data = data; - this.gen = 0; - this.deflate = null; this.compress = this.document.compress && !this.data.Filter; this.uncompressedLength = 0; - this.chunks = []; + this.buffer = []; } - initDeflate() { - this.data.Filter = 'FlateDecode'; - - this.deflate = zlib.createDeflate(); - this.deflate.on('data', chunk => { - this.chunks.push(chunk); - return (this.data.Length += chunk.length); - }); - - return this.deflate.on('end', this.finalize); - } - - _write(chunk, encoding, callback) { + write(chunk) { if (!Buffer.isBuffer(chunk)) { chunk = new Buffer(chunk + '\n', 'binary'); } this.uncompressedLength += chunk.length; - if (this.data.Length == null) { - this.data.Length = 0; - } - + if (this.data.Length == null) { this.data.Length = 0; } + this.buffer.push(chunk); + this.data.Length += chunk.length; if (this.compress) { - if (!this.deflate) { - this.initDeflate(); - } - this.deflate.write(chunk); - } else { - this.chunks.push(chunk); - this.data.Length += chunk.length; + return this.data.Filter = 'FlateDecode'; } - - return callback(); } end(chunk) { - super.end(...arguments); - - if (this.deflate) { - return this.deflate.end(); - } else { - return this.finalize(); + if (chunk) { + this.write(chunk); } + return this.finalize(); } finalize() { - this.offset = this.document._offset; + return setTimeout(() => { + this.offset = this.document._offset; + + const encryptFn = this.document._security ? this.document._security.getEncryptFn(this.id, this.gen) : null; - this.document._write(`${this.id} ${this.gen} obj`); - this.document._write(PDFObject.convert(this.data)); + if (this.buffer.length) { + this.buffer = Buffer.concat(this.buffer); + if (this.compress) { + this.buffer = zlib.deflateSync(this.buffer); + } - if (this.chunks.length) { - this.document._write('stream'); - for (let chunk of Array.from(this.chunks)) { - this.document._write(chunk); + if (encryptFn) { + this.buffer = encryptFn(this.buffer); + } + + this.data.Length = this.buffer.length; } - this.chunks.length = 0; // free up memory - this.document._write('\nendstream'); - } + this.document._write(`${this.id} ${this.gen} obj`); + this.document._write(PDFObject.convert(this.data, encryptFn)); - this.document._write('endobj'); - return this.document._refEnd(this); - } + if (this.buffer.length) { + this.document._write('stream'); + this.document._write(this.buffer); + + this.buffer = []; // free up memory + this.document._write('\nendstream'); + } + this.document._write('endobj'); + return this.document._refEnd(this); + } + , 0); + } toString() { return `${this.id} ${this.gen} R`; } diff --git a/src/utils/range.js b/src/utils/range.js deleted file mode 100644 index 0414fab23..000000000 --- a/src/utils/range.js +++ /dev/null @@ -1,13 +0,0 @@ -const range = (left, right, inclusive) => { - let range = []; - let ascending = left < right; - let end = !inclusive ? right : ascending ? right + 1 : right - 1; - - for (let i = left; ascending ? i < end : i > end; ascending ? i++ : i--) { - range.push(i); - } - - return range; -}; - -export default range; diff --git a/yarn.lock b/yarn.lock index 7925ddefc..0b2aaab4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,7 @@ "@react-pdf/fontkit@^1.11.0": version "1.11.0" resolved "https://registry.yarnpkg.com/@react-pdf/fontkit/-/fontkit-1.11.0.tgz#2492ffca9454be2a52eb2aba01eacdf2a11ce9fd" + integrity sha1-JJL/ypRUvipS6yq6AerN8qEc6f0= dependencies: "@react-pdf/unicode-properties" "^2.2.0" brfs "^1.4.0" @@ -20,46 +21,56 @@ "@react-pdf/png-js@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@react-pdf/png-js/-/png-js-1.0.0.tgz#00fcb969dca4ce82a0a7673413ade039e47b361e" + integrity sha1-APy5adykzoKgp2c0E63gOeR7Nh4= "@react-pdf/unicode-properties@^2.2.0": version "2.2.0" resolved "https://registry.yarnpkg.com/@react-pdf/unicode-properties/-/unicode-properties-2.2.0.tgz#f109eaac244ceb108011d4038cee4cc787cb40f3" + integrity sha1-8QnqrCRM6xCAEdQDjO5Mx4fLQPM= dependencies: unicode-trie "^0.3.0" acorn@^5.0.0: version "5.5.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" + integrity sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ== amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= dependencies: arr-flatten "^1.0.1" arr-flatten@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= ast-transform@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/ast-transform/-/ast-transform-0.0.0.tgz#74944058887d8283e189d954600947bc98fe0062" + integrity sha1-dJRAWIh9goPhidlUYAlHvJj+AGI= dependencies: escodegen "~1.2.0" esprima "~1.0.4" @@ -68,18 +79,21 @@ ast-transform@0.0.0: ast-types@^0.7.0: version "0.7.8" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.7.8.tgz#902d2e0d60d071bdcd46dc115e1809ed11c138a9" + integrity sha1-kC0uDWDQcb3NRtwRXhgJ7RHBOKk= babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= dependencies: chalk "^1.1.3" esutils "^2.0.2" js-tokens "^3.0.2" -babel-core@6, babel-core@^6.26.0: +babel-core@^6.26.0, babel-core@^6.26.3: version "6.26.3" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== dependencies: babel-code-frame "^6.26.0" babel-generator "^6.26.0" @@ -104,6 +118,7 @@ babel-core@6, babel-core@^6.26.0: babel-generator@^6.26.0: version "6.26.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== dependencies: babel-messages "^6.23.0" babel-runtime "^6.26.0" @@ -114,9 +129,19 @@ babel-generator@^6.26.0: source-map "^0.5.7" trim-right "^1.0.1" +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + integrity sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + babel-helper-call-delegate@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + integrity sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= dependencies: babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" @@ -126,15 +151,26 @@ babel-helper-call-delegate@^6.24.1: babel-helper-define-map@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + integrity sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= dependencies: babel-helper-function-name "^6.24.1" babel-runtime "^6.26.0" babel-types "^6.26.0" lodash "^4.17.4" +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + integrity sha1-8luCz33BBDPFX3BZLVdGQArCLKo= + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babel-helper-function-name@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + integrity sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= dependencies: babel-helper-get-function-arity "^6.24.1" babel-runtime "^6.22.0" @@ -145,6 +181,7 @@ babel-helper-function-name@^6.24.1: babel-helper-get-function-arity@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + integrity sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -152,6 +189,7 @@ babel-helper-get-function-arity@^6.24.1: babel-helper-hoist-variables@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + integrity sha1-HssnaJydJVE+rbyZFKc/VAi+enY= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -159,6 +197,7 @@ babel-helper-hoist-variables@^6.24.1: babel-helper-optimise-call-expression@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + integrity sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -166,14 +205,27 @@ babel-helper-optimise-call-expression@^6.24.1: babel-helper-regex@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + integrity sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= dependencies: babel-runtime "^6.26.0" babel-types "^6.26.0" lodash "^4.17.4" +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + integrity sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babel-helper-replace-supers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + integrity sha1-v22/5Dk40XNpohPKiov3S2qQqxo= dependencies: babel-helper-optimise-call-expression "^6.24.1" babel-messages "^6.23.0" @@ -185,6 +237,7 @@ babel-helper-replace-supers@^6.24.1: babel-helpers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" @@ -192,36 +245,66 @@ babel-helpers@^6.24.1: babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= dependencies: babel-runtime "^6.22.0" babel-plugin-check-es2015-constants@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + integrity sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= dependencies: babel-runtime "^6.22.0" babel-plugin-external-helpers@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" + integrity sha1-IoX0iwK9Xe3oUXXK+MYuhq3M76E= dependencies: babel-runtime "^6.22.0" +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + integrity sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + integrity sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + integrity sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= + +babel-plugin-transform-async-to-generator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + integrity sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + babel-plugin-transform-es2015-arrow-functions@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + integrity sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + integrity sha1-u8UbSflk1wy42OC5ToICRs46YUE= dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoping@^6.24.1: +babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + integrity sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= dependencies: babel-runtime "^6.26.0" babel-template "^6.26.0" @@ -229,9 +312,10 @@ babel-plugin-transform-es2015-block-scoping@^6.24.1: babel-types "^6.26.0" lodash "^4.17.4" -babel-plugin-transform-es2015-classes@^6.24.1, babel-plugin-transform-es2015-classes@^6.9.0: +babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + integrity sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= dependencies: babel-helper-define-map "^6.24.1" babel-helper-function-name "^6.24.1" @@ -243,35 +327,40 @@ babel-plugin-transform-es2015-classes@^6.24.1, babel-plugin-transform-es2015-cla babel-traverse "^6.24.1" babel-types "^6.24.1" -babel-plugin-transform-es2015-computed-properties@^6.24.1: +babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + integrity sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-destructuring@^6.22.0: +babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-duplicate-keys@^6.24.1: +babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + integrity sha1-c+s9MQypaePvnskcU3QabxV2Qj4= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-plugin-transform-es2015-for-of@^6.22.0: +babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + integrity sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-function-name@^6.24.1: +babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + integrity sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= dependencies: babel-helper-function-name "^6.24.1" babel-runtime "^6.22.0" @@ -280,52 +369,59 @@ babel-plugin-transform-es2015-function-name@^6.24.1: babel-plugin-transform-es2015-literals@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + integrity sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-modules-amd@^6.24.1: +babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + integrity sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= dependencies: babel-plugin-transform-es2015-modules-commonjs "^6.24.1" babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-modules-commonjs@^6.24.1: +babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: version "6.26.2" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" + integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q== dependencies: babel-plugin-transform-strict-mode "^6.24.1" babel-runtime "^6.26.0" babel-template "^6.26.0" babel-types "^6.26.0" -babel-plugin-transform-es2015-modules-systemjs@^6.24.1: +babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-es2015-modules-systemjs@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + integrity sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= dependencies: babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-modules-umd@^6.24.1: +babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + integrity sha1-rJl+YoXNGO1hdq22B9YCNErThGg= dependencies: babel-plugin-transform-es2015-modules-amd "^6.24.1" babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-object-super@^6.24.1: +babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + integrity sha1-JM72muIcuDp/hgPa0CH1cusnj40= dependencies: babel-helper-replace-supers "^6.24.1" babel-runtime "^6.22.0" -babel-plugin-transform-es2015-parameters@^6.24.1: +babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + integrity sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= dependencies: babel-helper-call-delegate "^6.24.1" babel-helper-get-function-arity "^6.24.1" @@ -334,9 +430,10 @@ babel-plugin-transform-es2015-parameters@^6.24.1: babel-traverse "^6.24.1" babel-types "^6.24.1" -babel-plugin-transform-es2015-shorthand-properties@^6.24.1: +babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + integrity sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" @@ -344,12 +441,14 @@ babel-plugin-transform-es2015-shorthand-properties@^6.24.1: babel-plugin-transform-es2015-spread@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-sticky-regex@^6.24.1: +babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + integrity sha1-AMHNsaynERLN8M9hJsLta0V8zbw= dependencies: babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" @@ -358,39 +457,90 @@ babel-plugin-transform-es2015-sticky-regex@^6.24.1: babel-plugin-transform-es2015-template-literals@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + integrity sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-typeof-symbol@^6.22.0: +babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + integrity sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-unicode-regex@^6.24.1: +babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + integrity sha1-04sS9C6nMj9yk4fxinxa4frrNek= dependencies: babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" regexpu-core "^2.0.0" -babel-plugin-transform-regenerator@^6.24.1: +babel-plugin-transform-exponentiation-operator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + integrity sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + integrity sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= dependencies: regenerator-transform "^0.10.0" babel-plugin-transform-strict-mode@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + integrity sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" +babel-preset-env@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" + integrity sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg== + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.23.0" + babel-plugin-transform-es2015-classes "^6.23.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.23.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.23.0" + babel-plugin-transform-es2015-function-name "^6.22.0" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.23.0" + babel-plugin-transform-es2015-modules-systemjs "^6.23.0" + babel-plugin-transform-es2015-modules-umd "^6.23.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.23.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.23.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" + browserslist "^3.2.6" + invariant "^2.2.2" + semver "^5.3.0" + babel-preset-es2015@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" + integrity sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk= dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-transform-es2015-arrow-functions "^6.22.0" @@ -420,6 +570,7 @@ babel-preset-es2015@^6.24.1: babel-register@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= dependencies: babel-core "^6.26.0" babel-runtime "^6.26.0" @@ -432,6 +583,7 @@ babel-register@^6.26.0: babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= dependencies: core-js "^2.4.0" regenerator-runtime "^0.11.0" @@ -439,6 +591,7 @@ babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runti babel-template@^6.24.1, babel-template@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= dependencies: babel-runtime "^6.26.0" babel-traverse "^6.26.0" @@ -449,6 +602,7 @@ babel-template@^6.24.1, babel-template@^6.26.0: babel-traverse@^6.24.1, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= dependencies: babel-code-frame "^6.26.0" babel-messages "^6.23.0" @@ -463,6 +617,7 @@ babel-traverse@^6.24.1, babel-traverse@^6.26.0: babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= dependencies: babel-runtime "^6.26.0" esutils "^2.0.2" @@ -472,28 +627,34 @@ babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: babylon@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base64-js@^1.1.2: version "1.3.0" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" + integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== blob-stream@^0.1.2: version "0.1.3" resolved "https://registry.yarnpkg.com/blob-stream/-/blob-stream-0.1.3.tgz#98d668af6996e0f32ef666d06e215ccc7d77686c" + integrity sha1-mNZor2mW4PMu9mbQbiFczH13aGw= dependencies: blob "0.0.4" blob@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921" + integrity sha1-vPEwUspURj8w+fx+lbmkdjCpSSE= brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -501,6 +662,7 @@ brace-expansion@^1.1.7: braces@^1.8.2: version "1.8.5" resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= dependencies: expand-range "^1.8.1" preserve "^0.2.0" @@ -509,6 +671,7 @@ braces@^1.8.2: brfs@^1.4.0: version "1.6.1" resolved "https://registry.yarnpkg.com/brfs/-/brfs-1.6.1.tgz#b78ce2336d818e25eea04a0947cba6d4fb8849c3" + integrity sha512-OfZpABRQQf+Xsmju8XE9bDjs+uU4vLREGolP7bDgcpsI17QREyZ4Bl+2KLxxx1kCgA0fAIhKQBaBYh+PEcCqYQ== dependencies: quote-stream "^1.0.1" resolve "^1.1.5" @@ -518,44 +681,65 @@ brfs@^1.4.0: brotli@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/brotli/-/brotli-1.3.2.tgz#525a9cad4fcba96475d7d388f6aecb13eed52f46" + integrity sha1-UlqcrU/LqWR119OI9q7LE+7VL0Y= dependencies: base64-js "^1.1.2" browser-resolve@^1.11.0: version "1.11.3" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== dependencies: resolve "1.1.7" browser-resolve@^1.8.1: version "1.11.2" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + integrity sha1-j/CbCixCFxihBRwmCzLkj0QpOM4= dependencies: resolve "1.1.7" browserify-optional@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/browserify-optional/-/browserify-optional-1.0.1.tgz#1e13722cfde0d85f121676c2a72ced533a018869" + integrity sha1-HhNyLP3g2F8SFnbCpyztUzoBiGk= dependencies: ast-transform "0.0.0" ast-types "^0.7.0" browser-resolve "^1.8.1" +browserslist@^3.2.6: + version "3.2.8" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" + integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== + dependencies: + caniuse-lite "^1.0.30000844" + electron-to-chromium "^1.3.47" + buffer-equal@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-0.0.1.tgz#91bc74b11ea405bc916bc6aa908faafa5b4aac4b" + integrity sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs= buffer-from@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531" + integrity sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA== builtin-modules@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + +caniuse-lite@^1.0.30000844: + version "1.0.30000904" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000904.tgz#4445d00da859a0e0ae6dbb2876c545f3324f6c74" + integrity sha512-M4sXvogCoY5Fp6fuXIaQG/MIexlEFQ3Lgwban+KlqiQUbUIkSmjAB8ZJIP79aj2cdqz2F1Lb+Z+5GwHvCrbLtg== chalk@^1.0.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= dependencies: ansi-styles "^2.2.1" escape-string-regexp "^1.0.2" @@ -566,18 +750,22 @@ chalk@^1.0.0, chalk@^1.1.3: clone@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= commander@~2.13.0: version "2.13.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" + integrity sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA== concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= concat-stream@~1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== dependencies: buffer-from "^1.0.0" inherits "^2.0.3" @@ -587,62 +775,80 @@ concat-stream@~1.6.0: convert-source-map@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + integrity sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU= core-js@^2.4.0: version "2.5.5" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.5.tgz#b14dde936c640c0579a6b50cabcc132dd6127e3b" + integrity sha1-sU3ek2xkDAV5prUMq8wTLdYSfjs= core-js@^2.5.0: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" + integrity sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw== core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" deep-equal@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= dependencies: repeating "^2.0.0" dfa@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/dfa/-/dfa-1.1.0.tgz#d30218bd10d030fa421df3ebbc82285463a31781" + integrity sha1-0wIYvRDQMPpCHfPrvIIoVGOjF4E= dependencies: babel-runtime "^6.11.6" duplexer2@~0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + integrity sha1-ixLauHjA1p4+eJEFFmKjL8a93ME= dependencies: readable-stream "^2.0.2" duplexer@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" + integrity sha1-rOb/gIwc5mtX0ev5eXessCM0z8E= + +electron-to-chromium@^1.3.47: + version "1.3.83" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.83.tgz#74584eb0972bb6777811c5d68d988c722f5e6666" + integrity sha512-DqJoDarxq50dcHsOOlMLNoy+qQitlMNbYb6wwbE0oUw2veHdRkpNrhmngiUYKMErdJ8SJ48rpJsZTQgy5SoEAA== escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= escodegen@^1.8.1, escodegen@~1.9.0: version "1.9.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2" + integrity sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q== dependencies: esprima "^3.1.3" estraverse "^4.2.0" @@ -654,6 +860,7 @@ escodegen@^1.8.1, escodegen@~1.9.0: escodegen@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.2.0.tgz#09de7967791cc958b7f89a2ddb6d23451af327e1" + integrity sha1-Cd55Z3kcyVi3+Jot220jRRrzJ+E= dependencies: esprima "~1.0.4" estraverse "~1.5.0" @@ -664,56 +871,68 @@ escodegen@~1.2.0: esprima@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= esprima@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad" + integrity sha1-n1V+CPw7TSbs6d00+Pv0drYlha0= estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= estraverse@~1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.5.1.tgz#867a3e8e58a9f84618afb6c2ddbcd916b7cbaf71" + integrity sha1-hno+jlip+EYYr7bC3bzZFrfLr3E= estree-walker@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" + integrity sha1-va/oCVOD2EFNXcLs9MkXO225QS4= estree-walker@^0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39" + integrity sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig== esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= esutils@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.0.0.tgz#8151d358e20c8acc7fb745e7472c0025fe496570" + integrity sha1-gVHTWOIMisx/t0XnRywAJf5JZXA= expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= dependencies: is-posix-bracket "^0.1.0" expand-range@^1.8.1: version "1.8.2" resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= dependencies: fill-range "^2.1.0" extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= dependencies: is-extglob "^1.0.0" falafel@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/falafel/-/falafel-2.1.0.tgz#96bb17761daba94f46d001738b3cedf3a67fe06c" + integrity sha1-lrsXdh2rqU9G0AFzizzt86Z/4Gw= dependencies: acorn "^5.0.0" foreach "^2.0.5" @@ -723,10 +942,12 @@ falafel@^2.1.0: fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= figures@^1.0.1: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= dependencies: escape-string-regexp "^1.0.5" object-assign "^4.1.0" @@ -734,10 +955,12 @@ figures@^1.0.1: filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= fill-range@^2.1.0: version "2.2.4" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== dependencies: is-number "^2.1.0" isobject "^2.0.0" @@ -748,28 +971,34 @@ fill-range@^2.1.0: for-in@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= for-own@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= dependencies: for-in "^1.0.1" foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= function-bind@^1.0.2: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= dependencies: glob-parent "^2.0.0" is-glob "^2.0.0" @@ -777,12 +1006,14 @@ glob-base@^0.3.0: glob-parent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= dependencies: is-glob "^2.0.0" glob@^7.0.5: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -794,28 +1025,33 @@ glob@^7.0.5: globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== gzip-size@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-3.0.0.tgz#546188e9bdc337f673772f81660464b389dce520" + integrity sha1-VGGI6b3DN/Zzdy+BZgRks4nc5SA= dependencies: duplexer "^0.1.1" has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= dependencies: ansi-regex "^2.0.0" has@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + integrity sha1-hGFzP1OLCDfJNh45qauelwTcLyg= dependencies: function-bind "^1.0.2" home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.1" @@ -823,12 +1059,14 @@ home-or-tmp@^2.0.0: iconv-lite@^0.4.13: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== dependencies: safer-buffer ">= 2.1.2 < 3" inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" @@ -836,112 +1074,136 @@ inflight@^1.0.4: inherits@2, inherits@^2.0.3, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: loose-envify "^1.0.0" is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= is-equal-shallow@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= dependencies: is-primitive "^2.0.0" is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= dependencies: number-is-nan "^1.0.0" is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= dependencies: is-extglob "^1.0.0" is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= dependencies: kind-of "^3.0.2" is-number@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= dependencies: isarray "1.0.0" "js-tokens@^3.0.0 || ^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= kind-of@^3.0.2: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= dependencies: is-buffer "^1.1.5" kind-of@^6.0.0: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= dependencies: prelude-ls "~1.1.2" type-check "~0.3.2" @@ -949,30 +1211,36 @@ levn@~0.3.0: lodash@^4.17.4: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + integrity sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg== loose-envify@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" lz-string@^1.4.4: version "1.4.4" resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" + integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= magic-string@^0.22.4: version "0.22.5" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.5.tgz#8e9cf5afddf44385c1da5bc2a6a0dbd10b03657e" + integrity sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w== dependencies: vlq "^0.2.2" math-random@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w= maxmin@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/maxmin/-/maxmin-2.1.0.tgz#4d3b220903d95eee7eb7ac7fa864e72dc09a3166" + integrity sha1-TTsiCQPZXu5+t6x/qGTnLcCaMWY= dependencies: chalk "^1.0.0" figures "^1.0.1" @@ -982,12 +1250,14 @@ maxmin@^2.1.0: merge-source-map@1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.0.4.tgz#a5de46538dae84d4114cc5ea02b4772a6346701f" + integrity sha1-pd5GU42uhNQRTMXqArR3KmNGcB8= dependencies: source-map "^0.5.6" micromatch@^2.3.11: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= dependencies: arr-diff "^2.0.0" array-unique "^0.2.1" @@ -1006,52 +1276,63 @@ micromatch@^2.3.11: minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= minimist@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= normalize-path@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= dependencies: remove-trailing-separator "^1.0.1" number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-inspect@~1.4.0: version "1.4.1" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.4.1.tgz#37ffb10e71adaf3748d05f713b4c9452f402cbc4" + integrity sha512-wqdhLpfCUbEsoEwl3FXwGyv8ief1k/1aUdIPCqVnupM6e8l63BEJdiF/0swtn04/8p05tG/T0FrpTlfwvljOdw== object-keys@^1.0.6: version "1.0.11" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + integrity sha1-xUYBd4rVYPEULODgG8yotW0TQm0= object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= dependencies: for-own "^0.1.4" is-extendable "^0.1.1" @@ -1059,12 +1340,14 @@ object.omit@^2.0.0: once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" optionator@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= dependencies: deep-is "~0.1.3" fast-levenshtein "~2.0.4" @@ -1076,18 +1359,22 @@ optionator@^0.8.1: os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= os-tmpdir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= pako@^0.2.5: version "0.2.9" resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" + integrity sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU= parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= dependencies: glob-base "^0.3.0" is-dotfile "^1.0.0" @@ -1097,36 +1384,44 @@ parse-glob@^3.0.4: path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + integrity sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME= prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= pretty-bytes@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-3.0.1.tgz#27d0008d778063a0b4811bb35c79f1bd5d5fbccf" + integrity sha1-J9AAjXeAY6C0gRuzXHnxvV1fvM8= dependencies: number-is-nan "^1.0.0" private@^0.1.6, private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== quote-stream@^1.0.1, quote-stream@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/quote-stream/-/quote-stream-1.0.2.tgz#84963f8c9c26b942e153feeb53aae74652b7e0b2" + integrity sha1-hJY/jJwmuULhU/7rU6rnRlK34LI= dependencies: buffer-equal "0.0.1" minimist "^1.1.3" @@ -1135,6 +1430,7 @@ quote-stream@^1.0.1, quote-stream@~1.0.2: randomatic@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" + integrity sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA== dependencies: is-number "^4.0.0" kind-of "^6.0.0" @@ -1143,6 +1439,7 @@ randomatic@^3.0.0: readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@~2.3.3: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -1155,14 +1452,17 @@ readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable regenerate@^1.2.1: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== regenerator-transform@^0.10.0: version "0.10.1" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== dependencies: babel-runtime "^6.18.0" babel-types "^6.19.0" @@ -1171,12 +1471,14 @@ regenerator-transform@^0.10.0: regex-cache@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== dependencies: is-equal-shallow "^0.1.3" regexpu-core@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + integrity sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= dependencies: regenerate "^1.2.1" regjsgen "^0.2.0" @@ -1185,66 +1487,75 @@ regexpu-core@^2.0.0: regjsgen@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + integrity sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc= regjsparser@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + integrity sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw= dependencies: jsesc "~0.5.0" remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + integrity sha1-7wiaF40Ug7quTZPrmLT55OEdmQo= repeat-string@^1.5.2: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= dependencies: is-finite "^1.0.0" resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= resolve@^1.1.5: version "1.7.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3" + integrity sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw== dependencies: path-parse "^1.0.5" resolve@^1.1.6: version "1.8.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" + integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== dependencies: path-parse "^1.0.5" restructure@^0.5.3: version "0.5.4" resolved "https://registry.yarnpkg.com/restructure/-/restructure-0.5.4.tgz#f54e7dd563590fb34fd6bf55876109aeccb28de8" + integrity sha1-9U591WNZD7NP1r9Vh2EJrsyyjeg= dependencies: browserify-optional "^1.0.0" rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== dependencies: glob "^7.0.5" -rollup-plugin-babel@^2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" +rollup-plugin-babel@3: + version "3.0.7" + resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-3.0.7.tgz#5b13611f1ab8922497e9d15197ae5d8a23fe3b1e" + integrity sha512-bVe2y0z/V5Ax1qU8NX/0idmzIwJPdUGu8Xx3vXH73h0yGjxfv2gkFI82MBVg49SlsFlLTBadBHb67zy4TWM3hA== dependencies: - babel-core "6" - babel-plugin-transform-es2015-classes "^6.9.0" - object-assign "^4.1.0" rollup-pluginutils "^1.5.0" "rollup-plugin-bundle-size@https://github.com/vimeo/rollup-plugin-bundle-size": @@ -1257,16 +1568,19 @@ rollup-plugin-babel@^2.7.1: rollup-plugin-ignore@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/rollup-plugin-ignore/-/rollup-plugin-ignore-1.0.3.tgz#9a3caac6709e481471ce4498a48164bbc2359e3d" + integrity sha1-mjyqxnCeSBRxzkSYpIFku8I1nj0= rollup-plugin-json@^2.1.0: version "2.3.1" resolved "https://registry.yarnpkg.com/rollup-plugin-json/-/rollup-plugin-json-2.3.1.tgz#9759d27f33dcd2c896de18b6235df162b88edd77" + integrity sha512-alQQQVPo2z9pl6LSK8QqyDlWwCH5KeE8YxgQv7fa/SeTxz+gQe36jBjcha7hQW68MrVh9Ms71EQaMZDAG3w2yw== dependencies: rollup-pluginutils "^2.0.1" rollup-plugin-node-resolve@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.1.1.tgz#cbb783b0d15b02794d58915350b2f0d902b8ddc8" + integrity sha1-y7eDsNFbAnlNWJFTULLw2QK43cg= dependencies: browser-resolve "^1.11.0" builtin-modules "^1.1.0" @@ -1275,6 +1589,7 @@ rollup-plugin-node-resolve@^2.0.0: rollup-plugin-replace@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/rollup-plugin-replace/-/rollup-plugin-replace-1.2.1.tgz#6307ee15f223aa1fd3207cd3c08052468f180daf" + integrity sha512-l9Pgb7bh5Wx18+qM9iOWZ/CKcwyKJETLAwCh6bjKwTOgTzNH3KmKDWI/X/ToNA7fA/68chhFyvISvreRxWFVtw== dependencies: magic-string "^0.22.4" minimatch "^3.0.2" @@ -1283,18 +1598,21 @@ rollup-plugin-replace@^1.1.1: rollup-plugin-string@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-string/-/rollup-plugin-string-2.0.2.tgz#f5323a22cfd738b450cbea62ab6593705eac744b" + integrity sha1-9TI6Is/XOLRQy+piq2WTcF6sdEs= dependencies: rollup-pluginutils "^1.5.0" rollup-plugin-uglify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-3.0.0.tgz#a34eca24617709c6bf1778e9653baafa06099b86" + integrity sha512-dehLu9eRRoV4l09aC+ySntRw1OAfoyKdbk8Nelblj03tHoynkSybqyEpgavemi1LBOH6S1vzI58/mpxkZIe1iQ== dependencies: uglify-es "^3.3.7" rollup-pluginutils@^1.5.0: version "1.5.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" + integrity sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg= dependencies: estree-walker "^0.2.1" minimatch "^3.0.2" @@ -1302,6 +1620,7 @@ rollup-pluginutils@^1.5.0: rollup-pluginutils@^2.0.1: version "2.3.0" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.0.tgz#478ace04bd7f6da2e724356ca798214884738fc4" + integrity sha512-xB6hsRsjdJdIYWEyYUJy/3ki5g69wrf0luHPGNK3ZSocV6HLNfio59l3dZ3TL4xUwEKgROhFi9jOCt6c5gfUWw== dependencies: estree-walker "^0.5.2" micromatch "^2.3.11" @@ -1309,52 +1628,68 @@ rollup-pluginutils@^2.0.1: rollup@^0.52.2: version "0.52.3" resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.52.3.tgz#020d99fffe9619351e47b3894fd397c26f5e1bf6" + integrity sha512-cw+vb9NqaTXlwJyb8G+Ve+uhhlVTcl1NKBkfANdeQqVcpZFilQgeNnAnNiu7MwfeXrqiKEGz+3R03a3zeFkmEQ== safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + integrity sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg== "safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver@^5.3.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== shallow-copy@~0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/shallow-copy/-/shallow-copy-0.0.1.tgz#415f42702d73d810330292cc5ee86eae1a11a170" + integrity sha1-QV9CcC1z2BAzApLMXuhurhoRoXA= slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= source-map-support@^0.4.15: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== dependencies: source-map "^0.5.6" source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= source-map@~0.1.30: version "0.1.43" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346" + integrity sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y= dependencies: amdefine ">=0.0.4" source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== static-eval@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.0.tgz#0e821f8926847def7b4b50cda5d55c04a9b13864" + integrity sha512-6flshd3F1Gwm+Ksxq463LtFd1liC77N/PX1FVVc3OzL3hAmo2fwHFbuArkcfi7s9rTNsLEhcRmXGFZhlgy40uw== dependencies: escodegen "^1.8.1" static-module@^2.2.0: version "2.2.4" resolved "https://registry.yarnpkg.com/static-module/-/static-module-2.2.4.tgz#25a3ffbe6e1fdaf7e64e5bc21edcd77fc7708dac" + integrity sha512-qlzhn8tYcfLsXK2RTWtkx1v/cqiPtS9eFy+UmQ9UnpEDYcwtgbceOybnKp5JncsOnLI/pyGeyzI9Bej9tv0xiA== dependencies: concat-stream "~1.6.0" convert-source-map "^1.5.1" @@ -1374,22 +1709,26 @@ static-module@^2.2.0: string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: safe-buffer "~5.1.0" strip-ansi@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= dependencies: ansi-regex "^2.0.0" supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= through2@^2.0.0, through2@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + integrity sha1-AARWmzfHx0ujnEPzzteNGtlBQL4= dependencies: readable-stream "^2.1.5" xtend "~4.0.1" @@ -1397,32 +1736,39 @@ through2@^2.0.0, through2@~2.0.3: through@~2.3.4: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= tiny-inflate@^1.0.0, tiny-inflate@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/tiny-inflate/-/tiny-inflate-1.0.2.tgz#93d9decffc8805bd57eae4310f0b745e9b6fb3a7" + integrity sha1-k9nez/yIBb1X6uQxDwt0Xptvs6c= to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= dependencies: prelude-ls "~1.1.2" typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= uglify-es@^3.3.7: version "3.3.9" resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677" + integrity sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ== dependencies: commander "~2.13.0" source-map "~0.6.1" @@ -1430,6 +1776,7 @@ uglify-es@^3.3.7: unicode-trie@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/unicode-trie/-/unicode-trie-0.3.1.tgz#d671dddd89101a08bac37b6a5161010602052085" + integrity sha1-1nHd3YkQGgi6w3tqUWEBBgIFIIU= dependencies: pako "^0.2.5" tiny-inflate "^1.0.0" @@ -1437,19 +1784,24 @@ unicode-trie@^0.3.0: util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= vlq@^0.2.2: version "0.2.3" resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26" + integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow== wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68=