workflow-editor 0.9.84-dw → 0.9.84-dw-tmp1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/lib/css/workflow-editor.common~247b300f.28fbd3a3.css +1 -0
  2. package/lib/css/workflow-editor.common~62bcfb54.c1b3ecc5.css +1 -0
  3. package/lib/css/workflow-editor.common~95b80cda.16e04122.css +1 -0
  4. package/lib/css/workflow-editor.common~e19cd708.68e04fb4.css +1 -0
  5. package/lib/css/workflow-editor.umd.min~247b300f.28fbd3a3.css +1 -0
  6. package/lib/css/workflow-editor.umd.min~62bcfb54.c1b3ecc5.css +1 -0
  7. package/lib/css/workflow-editor.umd.min~95b80cda.16e04122.css +1 -0
  8. package/lib/css/workflow-editor.umd.min~e19cd708.68e04fb4.css +1 -0
  9. package/lib/css/workflow-editor.umd~247b300f.28fbd3a3.css +1 -0
  10. package/lib/css/workflow-editor.umd~62bcfb54.c1b3ecc5.css +1 -0
  11. package/lib/css/workflow-editor.umd~95b80cda.16e04122.css +1 -0
  12. package/lib/css/workflow-editor.umd~e19cd708.68e04fb4.css +1 -0
  13. package/lib/css/yarn.prismjs~0bd0e877.9093a967.css +1 -0
  14. package/lib/workflow-editor.common.vendors~workflow-editor.common~253ae210.js +4136 -0
  15. package/lib/workflow-editor.common.workflow-editor.common~0b5ad61a.js +1022 -0
  16. package/lib/workflow-editor.common.workflow-editor.common~247b300f.js +1948 -0
  17. package/lib/workflow-editor.common.workflow-editor.common~62bcfb54.js +14764 -0
  18. package/lib/workflow-editor.common.workflow-editor.common~95b80cda.js +3300 -0
  19. package/lib/workflow-editor.common.workflow-editor.common~e19cd708.js +1585 -0
  20. package/lib/workflow-editor.common.workflow-editor.common~e2e93592.js +1293 -0
  21. package/lib/workflow-editor.common.yarn.async-validator~7864cd12.js +1223 -0
  22. package/lib/workflow-editor.common.yarn.buffer~7e5e8261.js +1801 -0
  23. package/lib/workflow-editor.common.yarn.core-js~2b13b260.js +5078 -0
  24. package/lib/workflow-editor.common.yarn.imatrix-ui~f5767151.js +2256 -0
  25. package/lib/workflow-editor.common.yarn.prismjs~0bd0e877.js +2028 -0
  26. package/lib/workflow-editor.common.yarn.readable-stream~2b6d3a99.js +2435 -0
  27. package/lib/workflow-editor.common.yarn.sax~95191fae.js +1576 -0
  28. package/lib/workflow-editor.common.yarn.vue-i18n~02576867.js +2259 -0
  29. package/lib/workflow-editor.umd.min.js +1 -39
  30. package/lib/workflow-editor.umd.min.vendors~workflow-editor.umd.min~253ae210.js +12 -0
  31. package/lib/workflow-editor.umd.min.workflow-editor.umd.min~0b5ad61a.js +1 -0
  32. package/lib/workflow-editor.umd.min.workflow-editor.umd.min~247b300f.js +1 -0
  33. package/lib/workflow-editor.umd.min.workflow-editor.umd.min~62bcfb54.js +1 -0
  34. package/lib/workflow-editor.umd.min.workflow-editor.umd.min~95b80cda.js +1 -0
  35. package/lib/workflow-editor.umd.min.workflow-editor.umd.min~e19cd708.js +1 -0
  36. package/lib/workflow-editor.umd.min.workflow-editor.umd.min~e2e93592.js +1 -0
  37. package/lib/workflow-editor.umd.min.yarn.async-validator~7864cd12.js +1 -0
  38. package/lib/workflow-editor.umd.min.yarn.buffer~7e5e8261.js +8 -0
  39. package/lib/workflow-editor.umd.min.yarn.core-js~2b13b260.js +1 -0
  40. package/lib/workflow-editor.umd.min.yarn.imatrix-ui~f5767151.js +1 -0
  41. package/lib/workflow-editor.umd.min.yarn.prismjs~0bd0e877.js +9 -0
  42. package/lib/workflow-editor.umd.min.yarn.readable-stream~2b6d3a99.js +1 -0
  43. package/lib/workflow-editor.umd.min.yarn.sax~95191fae.js +2 -0
  44. package/lib/workflow-editor.umd.min.yarn.vue-i18n~02576867.js +6 -0
  45. package/lib/workflow-editor.umd.vendors~workflow-editor.umd~253ae210.js +4136 -0
  46. package/lib/workflow-editor.umd.workflow-editor.umd~0b5ad61a.js +1032 -0
  47. package/lib/workflow-editor.umd.workflow-editor.umd~247b300f.js +1948 -0
  48. package/lib/workflow-editor.umd.workflow-editor.umd~62bcfb54.js +14764 -0
  49. package/lib/workflow-editor.umd.workflow-editor.umd~95b80cda.js +3300 -0
  50. package/lib/workflow-editor.umd.workflow-editor.umd~e19cd708.js +1585 -0
  51. package/lib/workflow-editor.umd.workflow-editor.umd~e2e93592.js +1293 -0
  52. package/lib/workflow-editor.umd.yarn.async-validator~7864cd12.js +1223 -0
  53. package/lib/workflow-editor.umd.yarn.buffer~7e5e8261.js +1801 -0
  54. package/lib/workflow-editor.umd.yarn.core-js~2b13b260.js +5078 -0
  55. package/lib/workflow-editor.umd.yarn.imatrix-ui~f5767151.js +2256 -0
  56. package/lib/workflow-editor.umd.yarn.prismjs~0bd0e877.js +2028 -0
  57. package/lib/workflow-editor.umd.yarn.readable-stream~2b6d3a99.js +2435 -0
  58. package/lib/workflow-editor.umd.yarn.sax~95191fae.js +1576 -0
  59. package/lib/workflow-editor.umd.yarn.vue-i18n~02576867.js +2259 -0
  60. package/package.json +2 -2
  61. package/lib/workflow-editor.css +0 -1
@@ -0,0 +1,2435 @@
1
+ ((typeof self !== 'undefined' ? self : this)["webpackJsonpworkflow_editor"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpworkflow_editor"] || []).push([[13],{
2
+
3
+ /***/ "0960":
4
+ /***/ (function(module, exports, __webpack_require__) {
5
+
6
+ module.exports = __webpack_require__("b19a");
7
+
8
+
9
+ /***/ }),
10
+
11
+ /***/ "27bf":
12
+ /***/ (function(module, exports, __webpack_require__) {
13
+
14
+ "use strict";
15
+ // Copyright Joyent, Inc. and other Node contributors.
16
+ //
17
+ // Permission is hereby granted, free of charge, to any person obtaining a
18
+ // copy of this software and associated documentation files (the
19
+ // "Software"), to deal in the Software without restriction, including
20
+ // without limitation the rights to use, copy, modify, merge, publish,
21
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
22
+ // persons to whom the Software is furnished to do so, subject to the
23
+ // following conditions:
24
+ //
25
+ // The above copyright notice and this permission notice shall be included
26
+ // in all copies or substantial portions of the Software.
27
+ //
28
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
29
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
31
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
32
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
33
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
34
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
35
+
36
+ // a transform stream is a readable/writable stream where you do
37
+ // something with the data. Sometimes it's called a "filter",
38
+ // but that's not a great name for it, since that implies a thing where
39
+ // some bits pass through, and others are simply ignored. (That would
40
+ // be a valid example of a transform, of course.)
41
+ //
42
+ // While the output is causally related to the input, it's not a
43
+ // necessarily symmetric or synchronous transformation. For example,
44
+ // a zlib stream might take multiple plain-text writes(), and then
45
+ // emit a single compressed chunk some time in the future.
46
+ //
47
+ // Here's how this works:
48
+ //
49
+ // The Transform stream has all the aspects of the readable and writable
50
+ // stream classes. When you write(chunk), that calls _write(chunk,cb)
51
+ // internally, and returns false if there's a lot of pending writes
52
+ // buffered up. When you call read(), that calls _read(n) until
53
+ // there's enough pending readable data buffered up.
54
+ //
55
+ // In a transform stream, the written data is placed in a buffer. When
56
+ // _read(n) is called, it transforms the queued up data, calling the
57
+ // buffered _write cb's as it consumes chunks. If consuming a single
58
+ // written chunk would result in multiple output chunks, then the first
59
+ // outputted bit calls the readcb, and subsequent chunks just go into
60
+ // the read buffer, and will cause it to emit 'readable' if necessary.
61
+ //
62
+ // This way, back-pressure is actually determined by the reading side,
63
+ // since _read has to be called to start processing a new chunk. However,
64
+ // a pathological inflate type of transform can cause excessive buffering
65
+ // here. For example, imagine a stream where every byte of input is
66
+ // interpreted as an integer from 0-255, and then results in that many
67
+ // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
68
+ // 1kb of data being output. In this case, you could write a very small
69
+ // amount of input, and end up with a very large amount of output. In
70
+ // such a pathological inflating mechanism, there'd be no way to tell
71
+ // the system to stop doing the transform. A single 4MB write could
72
+ // cause the system to run out of memory.
73
+ //
74
+ // However, even in such a pathological case, only a single written chunk
75
+ // would be consumed, and then the rest would wait (un-transformed) until
76
+ // the results of the previous transformed chunk were consumed.
77
+
78
+
79
+
80
+ module.exports = Transform;
81
+
82
+ var Duplex = __webpack_require__("b19a");
83
+
84
+ /*<replacement>*/
85
+ var util = Object.create(__webpack_require__("3a7c"));
86
+ util.inherits = __webpack_require__("3fb5");
87
+ /*</replacement>*/
88
+
89
+ util.inherits(Transform, Duplex);
90
+
91
+ function afterTransform(er, data) {
92
+ var ts = this._transformState;
93
+ ts.transforming = false;
94
+
95
+ var cb = ts.writecb;
96
+
97
+ if (!cb) {
98
+ return this.emit('error', new Error('write callback called multiple times'));
99
+ }
100
+
101
+ ts.writechunk = null;
102
+ ts.writecb = null;
103
+
104
+ if (data != null) // single equals check for both `null` and `undefined`
105
+ this.push(data);
106
+
107
+ cb(er);
108
+
109
+ var rs = this._readableState;
110
+ rs.reading = false;
111
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
112
+ this._read(rs.highWaterMark);
113
+ }
114
+ }
115
+
116
+ function Transform(options) {
117
+ if (!(this instanceof Transform)) return new Transform(options);
118
+
119
+ Duplex.call(this, options);
120
+
121
+ this._transformState = {
122
+ afterTransform: afterTransform.bind(this),
123
+ needTransform: false,
124
+ transforming: false,
125
+ writecb: null,
126
+ writechunk: null,
127
+ writeencoding: null
128
+ };
129
+
130
+ // start out asking for a readable event once data is transformed.
131
+ this._readableState.needReadable = true;
132
+
133
+ // we have implemented the _read method, and done the other things
134
+ // that Readable wants before the first _read call, so unset the
135
+ // sync guard flag.
136
+ this._readableState.sync = false;
137
+
138
+ if (options) {
139
+ if (typeof options.transform === 'function') this._transform = options.transform;
140
+
141
+ if (typeof options.flush === 'function') this._flush = options.flush;
142
+ }
143
+
144
+ // When the writable side finishes, then flush out anything remaining.
145
+ this.on('prefinish', prefinish);
146
+ }
147
+
148
+ function prefinish() {
149
+ var _this = this;
150
+
151
+ if (typeof this._flush === 'function') {
152
+ this._flush(function (er, data) {
153
+ done(_this, er, data);
154
+ });
155
+ } else {
156
+ done(this, null, null);
157
+ }
158
+ }
159
+
160
+ Transform.prototype.push = function (chunk, encoding) {
161
+ this._transformState.needTransform = false;
162
+ return Duplex.prototype.push.call(this, chunk, encoding);
163
+ };
164
+
165
+ // This is the part where you do stuff!
166
+ // override this function in implementation classes.
167
+ // 'chunk' is an input chunk.
168
+ //
169
+ // Call `push(newChunk)` to pass along transformed output
170
+ // to the readable side. You may call 'push' zero or more times.
171
+ //
172
+ // Call `cb(err)` when you are done with this chunk. If you pass
173
+ // an error, then that'll put the hurt on the whole operation. If you
174
+ // never call cb(), then you'll never get another chunk.
175
+ Transform.prototype._transform = function (chunk, encoding, cb) {
176
+ throw new Error('_transform() is not implemented');
177
+ };
178
+
179
+ Transform.prototype._write = function (chunk, encoding, cb) {
180
+ var ts = this._transformState;
181
+ ts.writecb = cb;
182
+ ts.writechunk = chunk;
183
+ ts.writeencoding = encoding;
184
+ if (!ts.transforming) {
185
+ var rs = this._readableState;
186
+ if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
187
+ }
188
+ };
189
+
190
+ // Doesn't matter what the args are here.
191
+ // _transform does all the work.
192
+ // That we got here means that the readable side wants more data.
193
+ Transform.prototype._read = function (n) {
194
+ var ts = this._transformState;
195
+
196
+ if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
197
+ ts.transforming = true;
198
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
199
+ } else {
200
+ // mark that we need a transform, so that any data that comes in
201
+ // will get processed, now that we've asked for it.
202
+ ts.needTransform = true;
203
+ }
204
+ };
205
+
206
+ Transform.prototype._destroy = function (err, cb) {
207
+ var _this2 = this;
208
+
209
+ Duplex.prototype._destroy.call(this, err, function (err2) {
210
+ cb(err2);
211
+ _this2.emit('close');
212
+ });
213
+ };
214
+
215
+ function done(stream, er, data) {
216
+ if (er) return stream.emit('error', er);
217
+
218
+ if (data != null) // single equals check for both `null` and `undefined`
219
+ stream.push(data);
220
+
221
+ // if there's nothing in the write buffer, then that means
222
+ // that nothing more will ever be provided
223
+ if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
224
+
225
+ if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
226
+
227
+ return stream.push(null);
228
+ }
229
+
230
+ /***/ }),
231
+
232
+ /***/ "2c63":
233
+ /***/ (function(module, exports, __webpack_require__) {
234
+
235
+ module.exports = __webpack_require__("dc14");
236
+
237
+
238
+ /***/ }),
239
+
240
+ /***/ "429b":
241
+ /***/ (function(module, exports, __webpack_require__) {
242
+
243
+ module.exports = __webpack_require__("faa1").EventEmitter;
244
+
245
+
246
+ /***/ }),
247
+
248
+ /***/ "4681":
249
+ /***/ (function(module, exports, __webpack_require__) {
250
+
251
+ "use strict";
252
+
253
+
254
+ /*<replacement>*/
255
+
256
+ var pna = __webpack_require__("966d");
257
+ /*</replacement>*/
258
+
259
+ // undocumented cb() API, needed for core, not for public API
260
+ function destroy(err, cb) {
261
+ var _this = this;
262
+
263
+ var readableDestroyed = this._readableState && this._readableState.destroyed;
264
+ var writableDestroyed = this._writableState && this._writableState.destroyed;
265
+
266
+ if (readableDestroyed || writableDestroyed) {
267
+ if (cb) {
268
+ cb(err);
269
+ } else if (err) {
270
+ if (!this._writableState) {
271
+ pna.nextTick(emitErrorNT, this, err);
272
+ } else if (!this._writableState.errorEmitted) {
273
+ this._writableState.errorEmitted = true;
274
+ pna.nextTick(emitErrorNT, this, err);
275
+ }
276
+ }
277
+
278
+ return this;
279
+ }
280
+
281
+ // we set destroyed to true before firing error callbacks in order
282
+ // to make it re-entrance safe in case destroy() is called within callbacks
283
+
284
+ if (this._readableState) {
285
+ this._readableState.destroyed = true;
286
+ }
287
+
288
+ // if this is a duplex stream mark the writable part as destroyed as well
289
+ if (this._writableState) {
290
+ this._writableState.destroyed = true;
291
+ }
292
+
293
+ this._destroy(err || null, function (err) {
294
+ if (!cb && err) {
295
+ if (!_this._writableState) {
296
+ pna.nextTick(emitErrorNT, _this, err);
297
+ } else if (!_this._writableState.errorEmitted) {
298
+ _this._writableState.errorEmitted = true;
299
+ pna.nextTick(emitErrorNT, _this, err);
300
+ }
301
+ } else if (cb) {
302
+ cb(err);
303
+ }
304
+ });
305
+
306
+ return this;
307
+ }
308
+
309
+ function undestroy() {
310
+ if (this._readableState) {
311
+ this._readableState.destroyed = false;
312
+ this._readableState.reading = false;
313
+ this._readableState.ended = false;
314
+ this._readableState.endEmitted = false;
315
+ }
316
+
317
+ if (this._writableState) {
318
+ this._writableState.destroyed = false;
319
+ this._writableState.ended = false;
320
+ this._writableState.ending = false;
321
+ this._writableState.finalCalled = false;
322
+ this._writableState.prefinished = false;
323
+ this._writableState.finished = false;
324
+ this._writableState.errorEmitted = false;
325
+ }
326
+ }
327
+
328
+ function emitErrorNT(self, err) {
329
+ self.emit('error', err);
330
+ }
331
+
332
+ module.exports = {
333
+ destroy: destroy,
334
+ undestroy: undestroy
335
+ };
336
+
337
+ /***/ }),
338
+
339
+ /***/ "5e1a":
340
+ /***/ (function(module, exports, __webpack_require__) {
341
+
342
+ "use strict";
343
+
344
+
345
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
346
+
347
+ var Buffer = __webpack_require__("a8f0").Buffer;
348
+ var util = __webpack_require__(1);
349
+
350
+ function copyBuffer(src, target, offset) {
351
+ src.copy(target, offset);
352
+ }
353
+
354
+ module.exports = function () {
355
+ function BufferList() {
356
+ _classCallCheck(this, BufferList);
357
+
358
+ this.head = null;
359
+ this.tail = null;
360
+ this.length = 0;
361
+ }
362
+
363
+ BufferList.prototype.push = function push(v) {
364
+ var entry = { data: v, next: null };
365
+ if (this.length > 0) this.tail.next = entry;else this.head = entry;
366
+ this.tail = entry;
367
+ ++this.length;
368
+ };
369
+
370
+ BufferList.prototype.unshift = function unshift(v) {
371
+ var entry = { data: v, next: this.head };
372
+ if (this.length === 0) this.tail = entry;
373
+ this.head = entry;
374
+ ++this.length;
375
+ };
376
+
377
+ BufferList.prototype.shift = function shift() {
378
+ if (this.length === 0) return;
379
+ var ret = this.head.data;
380
+ if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
381
+ --this.length;
382
+ return ret;
383
+ };
384
+
385
+ BufferList.prototype.clear = function clear() {
386
+ this.head = this.tail = null;
387
+ this.length = 0;
388
+ };
389
+
390
+ BufferList.prototype.join = function join(s) {
391
+ if (this.length === 0) return '';
392
+ var p = this.head;
393
+ var ret = '' + p.data;
394
+ while (p = p.next) {
395
+ ret += s + p.data;
396
+ }return ret;
397
+ };
398
+
399
+ BufferList.prototype.concat = function concat(n) {
400
+ if (this.length === 0) return Buffer.alloc(0);
401
+ var ret = Buffer.allocUnsafe(n >>> 0);
402
+ var p = this.head;
403
+ var i = 0;
404
+ while (p) {
405
+ copyBuffer(p.data, ret, i);
406
+ i += p.data.length;
407
+ p = p.next;
408
+ }
409
+ return ret;
410
+ };
411
+
412
+ return BufferList;
413
+ }();
414
+
415
+ if (util && util.inspect && util.inspect.custom) {
416
+ module.exports.prototype[util.inspect.custom] = function () {
417
+ var obj = util.inspect({ length: this.length });
418
+ return this.constructor.name + ' ' + obj;
419
+ };
420
+ }
421
+
422
+ /***/ }),
423
+
424
+ /***/ "780f":
425
+ /***/ (function(module, exports, __webpack_require__) {
426
+
427
+ "use strict";
428
+ // Copyright Joyent, Inc. and other Node contributors.
429
+ //
430
+ // Permission is hereby granted, free of charge, to any person obtaining a
431
+ // copy of this software and associated documentation files (the
432
+ // "Software"), to deal in the Software without restriction, including
433
+ // without limitation the rights to use, copy, modify, merge, publish,
434
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
435
+ // persons to whom the Software is furnished to do so, subject to the
436
+ // following conditions:
437
+ //
438
+ // The above copyright notice and this permission notice shall be included
439
+ // in all copies or substantial portions of the Software.
440
+ //
441
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
442
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
443
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
444
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
445
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
446
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
447
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
448
+
449
+ // a passthrough stream.
450
+ // basically just the most minimal sort of Transform stream.
451
+ // Every written chunk gets output as-is.
452
+
453
+
454
+
455
+ module.exports = PassThrough;
456
+
457
+ var Transform = __webpack_require__("27bf");
458
+
459
+ /*<replacement>*/
460
+ var util = Object.create(__webpack_require__("3a7c"));
461
+ util.inherits = __webpack_require__("3fb5");
462
+ /*</replacement>*/
463
+
464
+ util.inherits(PassThrough, Transform);
465
+
466
+ function PassThrough(options) {
467
+ if (!(this instanceof PassThrough)) return new PassThrough(options);
468
+
469
+ Transform.call(this, options);
470
+ }
471
+
472
+ PassThrough.prototype._transform = function (chunk, encoding, cb) {
473
+ cb(null, chunk);
474
+ };
475
+
476
+ /***/ }),
477
+
478
+ /***/ "a8f0":
479
+ /***/ (function(module, exports, __webpack_require__) {
480
+
481
+ /* eslint-disable node/no-deprecated-api */
482
+ var buffer = __webpack_require__("b639")
483
+ var Buffer = buffer.Buffer
484
+
485
+ // alternative to using Object.keys for old browsers
486
+ function copyProps (src, dst) {
487
+ for (var key in src) {
488
+ dst[key] = src[key]
489
+ }
490
+ }
491
+ if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
492
+ module.exports = buffer
493
+ } else {
494
+ // Copy properties from require('buffer')
495
+ copyProps(buffer, exports)
496
+ exports.Buffer = SafeBuffer
497
+ }
498
+
499
+ function SafeBuffer (arg, encodingOrOffset, length) {
500
+ return Buffer(arg, encodingOrOffset, length)
501
+ }
502
+
503
+ // Copy static methods from Buffer
504
+ copyProps(Buffer, SafeBuffer)
505
+
506
+ SafeBuffer.from = function (arg, encodingOrOffset, length) {
507
+ if (typeof arg === 'number') {
508
+ throw new TypeError('Argument must not be a number')
509
+ }
510
+ return Buffer(arg, encodingOrOffset, length)
511
+ }
512
+
513
+ SafeBuffer.alloc = function (size, fill, encoding) {
514
+ if (typeof size !== 'number') {
515
+ throw new TypeError('Argument must be a number')
516
+ }
517
+ var buf = Buffer(size)
518
+ if (fill !== undefined) {
519
+ if (typeof encoding === 'string') {
520
+ buf.fill(fill, encoding)
521
+ } else {
522
+ buf.fill(fill)
523
+ }
524
+ } else {
525
+ buf.fill(0)
526
+ }
527
+ return buf
528
+ }
529
+
530
+ SafeBuffer.allocUnsafe = function (size) {
531
+ if (typeof size !== 'number') {
532
+ throw new TypeError('Argument must be a number')
533
+ }
534
+ return Buffer(size)
535
+ }
536
+
537
+ SafeBuffer.allocUnsafeSlow = function (size) {
538
+ if (typeof size !== 'number') {
539
+ throw new TypeError('Argument must be a number')
540
+ }
541
+ return buffer.SlowBuffer(size)
542
+ }
543
+
544
+
545
+ /***/ }),
546
+
547
+ /***/ "ad71":
548
+ /***/ (function(module, exports, __webpack_require__) {
549
+
550
+ "use strict";
551
+ /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
552
+ //
553
+ // Permission is hereby granted, free of charge, to any person obtaining a
554
+ // copy of this software and associated documentation files (the
555
+ // "Software"), to deal in the Software without restriction, including
556
+ // without limitation the rights to use, copy, modify, merge, publish,
557
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
558
+ // persons to whom the Software is furnished to do so, subject to the
559
+ // following conditions:
560
+ //
561
+ // The above copyright notice and this permission notice shall be included
562
+ // in all copies or substantial portions of the Software.
563
+ //
564
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
565
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
566
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
567
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
568
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
569
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
570
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
571
+
572
+
573
+
574
+ /*<replacement>*/
575
+
576
+ var pna = __webpack_require__("966d");
577
+ /*</replacement>*/
578
+
579
+ module.exports = Readable;
580
+
581
+ /*<replacement>*/
582
+ var isArray = __webpack_require__("e3db");
583
+ /*</replacement>*/
584
+
585
+ /*<replacement>*/
586
+ var Duplex;
587
+ /*</replacement>*/
588
+
589
+ Readable.ReadableState = ReadableState;
590
+
591
+ /*<replacement>*/
592
+ var EE = __webpack_require__("faa1").EventEmitter;
593
+
594
+ var EElistenerCount = function (emitter, type) {
595
+ return emitter.listeners(type).length;
596
+ };
597
+ /*</replacement>*/
598
+
599
+ /*<replacement>*/
600
+ var Stream = __webpack_require__("429b");
601
+ /*</replacement>*/
602
+
603
+ /*<replacement>*/
604
+
605
+ var Buffer = __webpack_require__("a8f0").Buffer;
606
+ var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
607
+ function _uint8ArrayToBuffer(chunk) {
608
+ return Buffer.from(chunk);
609
+ }
610
+ function _isUint8Array(obj) {
611
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
612
+ }
613
+
614
+ /*</replacement>*/
615
+
616
+ /*<replacement>*/
617
+ var util = Object.create(__webpack_require__("3a7c"));
618
+ util.inherits = __webpack_require__("3fb5");
619
+ /*</replacement>*/
620
+
621
+ /*<replacement>*/
622
+ var debugUtil = __webpack_require__(0);
623
+ var debug = void 0;
624
+ if (debugUtil && debugUtil.debuglog) {
625
+ debug = debugUtil.debuglog('stream');
626
+ } else {
627
+ debug = function () {};
628
+ }
629
+ /*</replacement>*/
630
+
631
+ var BufferList = __webpack_require__("5e1a");
632
+ var destroyImpl = __webpack_require__("4681");
633
+ var StringDecoder;
634
+
635
+ util.inherits(Readable, Stream);
636
+
637
+ var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
638
+
639
+ function prependListener(emitter, event, fn) {
640
+ // Sadly this is not cacheable as some libraries bundle their own
641
+ // event emitter implementation with them.
642
+ if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
643
+
644
+ // This is a hack to make sure that our error handler is attached before any
645
+ // userland ones. NEVER DO THIS. This is here only because this code needs
646
+ // to continue to work with older versions of Node.js that do not include
647
+ // the prependListener() method. The goal is to eventually remove this hack.
648
+ if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
649
+ }
650
+
651
+ function ReadableState(options, stream) {
652
+ Duplex = Duplex || __webpack_require__("b19a");
653
+
654
+ options = options || {};
655
+
656
+ // Duplex streams are both readable and writable, but share
657
+ // the same options object.
658
+ // However, some cases require setting options to different
659
+ // values for the readable and the writable sides of the duplex stream.
660
+ // These options can be provided separately as readableXXX and writableXXX.
661
+ var isDuplex = stream instanceof Duplex;
662
+
663
+ // object stream flag. Used to make read(n) ignore n and to
664
+ // make all the buffer merging and length checks go away
665
+ this.objectMode = !!options.objectMode;
666
+
667
+ if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
668
+
669
+ // the point at which it stops calling _read() to fill the buffer
670
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
671
+ var hwm = options.highWaterMark;
672
+ var readableHwm = options.readableHighWaterMark;
673
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
674
+
675
+ if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
676
+
677
+ // cast to ints.
678
+ this.highWaterMark = Math.floor(this.highWaterMark);
679
+
680
+ // A linked list is used to store data chunks instead of an array because the
681
+ // linked list can remove elements from the beginning faster than
682
+ // array.shift()
683
+ this.buffer = new BufferList();
684
+ this.length = 0;
685
+ this.pipes = null;
686
+ this.pipesCount = 0;
687
+ this.flowing = null;
688
+ this.ended = false;
689
+ this.endEmitted = false;
690
+ this.reading = false;
691
+
692
+ // a flag to be able to tell if the event 'readable'/'data' is emitted
693
+ // immediately, or on a later tick. We set this to true at first, because
694
+ // any actions that shouldn't happen until "later" should generally also
695
+ // not happen before the first read call.
696
+ this.sync = true;
697
+
698
+ // whenever we return null, then we set a flag to say
699
+ // that we're awaiting a 'readable' event emission.
700
+ this.needReadable = false;
701
+ this.emittedReadable = false;
702
+ this.readableListening = false;
703
+ this.resumeScheduled = false;
704
+
705
+ // has it been destroyed
706
+ this.destroyed = false;
707
+
708
+ // Crypto is kind of old and crusty. Historically, its default string
709
+ // encoding is 'binary' so we have to make this configurable.
710
+ // Everything else in the universe uses 'utf8', though.
711
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
712
+
713
+ // the number of writers that are awaiting a drain event in .pipe()s
714
+ this.awaitDrain = 0;
715
+
716
+ // if true, a maybeReadMore has been scheduled
717
+ this.readingMore = false;
718
+
719
+ this.decoder = null;
720
+ this.encoding = null;
721
+ if (options.encoding) {
722
+ if (!StringDecoder) StringDecoder = __webpack_require__("7d72").StringDecoder;
723
+ this.decoder = new StringDecoder(options.encoding);
724
+ this.encoding = options.encoding;
725
+ }
726
+ }
727
+
728
+ function Readable(options) {
729
+ Duplex = Duplex || __webpack_require__("b19a");
730
+
731
+ if (!(this instanceof Readable)) return new Readable(options);
732
+
733
+ this._readableState = new ReadableState(options, this);
734
+
735
+ // legacy
736
+ this.readable = true;
737
+
738
+ if (options) {
739
+ if (typeof options.read === 'function') this._read = options.read;
740
+
741
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
742
+ }
743
+
744
+ Stream.call(this);
745
+ }
746
+
747
+ Object.defineProperty(Readable.prototype, 'destroyed', {
748
+ get: function () {
749
+ if (this._readableState === undefined) {
750
+ return false;
751
+ }
752
+ return this._readableState.destroyed;
753
+ },
754
+ set: function (value) {
755
+ // we ignore the value if the stream
756
+ // has not been initialized yet
757
+ if (!this._readableState) {
758
+ return;
759
+ }
760
+
761
+ // backward compatibility, the user is explicitly
762
+ // managing destroyed
763
+ this._readableState.destroyed = value;
764
+ }
765
+ });
766
+
767
+ Readable.prototype.destroy = destroyImpl.destroy;
768
+ Readable.prototype._undestroy = destroyImpl.undestroy;
769
+ Readable.prototype._destroy = function (err, cb) {
770
+ this.push(null);
771
+ cb(err);
772
+ };
773
+
774
+ // Manually shove something into the read() buffer.
775
+ // This returns true if the highWaterMark has not been hit yet,
776
+ // similar to how Writable.write() returns true if you should
777
+ // write() some more.
778
+ Readable.prototype.push = function (chunk, encoding) {
779
+ var state = this._readableState;
780
+ var skipChunkCheck;
781
+
782
+ if (!state.objectMode) {
783
+ if (typeof chunk === 'string') {
784
+ encoding = encoding || state.defaultEncoding;
785
+ if (encoding !== state.encoding) {
786
+ chunk = Buffer.from(chunk, encoding);
787
+ encoding = '';
788
+ }
789
+ skipChunkCheck = true;
790
+ }
791
+ } else {
792
+ skipChunkCheck = true;
793
+ }
794
+
795
+ return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
796
+ };
797
+
798
+ // Unshift should *always* be something directly out of read()
799
+ Readable.prototype.unshift = function (chunk) {
800
+ return readableAddChunk(this, chunk, null, true, false);
801
+ };
802
+
803
+ function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
804
+ var state = stream._readableState;
805
+ if (chunk === null) {
806
+ state.reading = false;
807
+ onEofChunk(stream, state);
808
+ } else {
809
+ var er;
810
+ if (!skipChunkCheck) er = chunkInvalid(state, chunk);
811
+ if (er) {
812
+ stream.emit('error', er);
813
+ } else if (state.objectMode || chunk && chunk.length > 0) {
814
+ if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
815
+ chunk = _uint8ArrayToBuffer(chunk);
816
+ }
817
+
818
+ if (addToFront) {
819
+ if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
820
+ } else if (state.ended) {
821
+ stream.emit('error', new Error('stream.push() after EOF'));
822
+ } else {
823
+ state.reading = false;
824
+ if (state.decoder && !encoding) {
825
+ chunk = state.decoder.write(chunk);
826
+ if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
827
+ } else {
828
+ addChunk(stream, state, chunk, false);
829
+ }
830
+ }
831
+ } else if (!addToFront) {
832
+ state.reading = false;
833
+ }
834
+ }
835
+
836
+ return needMoreData(state);
837
+ }
838
+
839
+ function addChunk(stream, state, chunk, addToFront) {
840
+ if (state.flowing && state.length === 0 && !state.sync) {
841
+ stream.emit('data', chunk);
842
+ stream.read(0);
843
+ } else {
844
+ // update the buffer info.
845
+ state.length += state.objectMode ? 1 : chunk.length;
846
+ if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
847
+
848
+ if (state.needReadable) emitReadable(stream);
849
+ }
850
+ maybeReadMore(stream, state);
851
+ }
852
+
853
+ function chunkInvalid(state, chunk) {
854
+ var er;
855
+ if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
856
+ er = new TypeError('Invalid non-string/buffer chunk');
857
+ }
858
+ return er;
859
+ }
860
+
861
+ // if it's past the high water mark, we can push in some more.
862
+ // Also, if we have no data yet, we can stand some
863
+ // more bytes. This is to work around cases where hwm=0,
864
+ // such as the repl. Also, if the push() triggered a
865
+ // readable event, and the user called read(largeNumber) such that
866
+ // needReadable was set, then we ought to push more, so that another
867
+ // 'readable' event will be triggered.
868
+ function needMoreData(state) {
869
+ return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
870
+ }
871
+
872
+ Readable.prototype.isPaused = function () {
873
+ return this._readableState.flowing === false;
874
+ };
875
+
876
+ // backwards compatibility.
877
+ Readable.prototype.setEncoding = function (enc) {
878
+ if (!StringDecoder) StringDecoder = __webpack_require__("7d72").StringDecoder;
879
+ this._readableState.decoder = new StringDecoder(enc);
880
+ this._readableState.encoding = enc;
881
+ return this;
882
+ };
883
+
884
+ // Don't raise the hwm > 8MB
885
+ var MAX_HWM = 0x800000;
886
+ function computeNewHighWaterMark(n) {
887
+ if (n >= MAX_HWM) {
888
+ n = MAX_HWM;
889
+ } else {
890
+ // Get the next highest power of 2 to prevent increasing hwm excessively in
891
+ // tiny amounts
892
+ n--;
893
+ n |= n >>> 1;
894
+ n |= n >>> 2;
895
+ n |= n >>> 4;
896
+ n |= n >>> 8;
897
+ n |= n >>> 16;
898
+ n++;
899
+ }
900
+ return n;
901
+ }
902
+
903
+ // This function is designed to be inlinable, so please take care when making
904
+ // changes to the function body.
905
+ function howMuchToRead(n, state) {
906
+ if (n <= 0 || state.length === 0 && state.ended) return 0;
907
+ if (state.objectMode) return 1;
908
+ if (n !== n) {
909
+ // Only flow one buffer at a time
910
+ if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
911
+ }
912
+ // If we're asking for more than the current hwm, then raise the hwm.
913
+ if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
914
+ if (n <= state.length) return n;
915
+ // Don't have enough
916
+ if (!state.ended) {
917
+ state.needReadable = true;
918
+ return 0;
919
+ }
920
+ return state.length;
921
+ }
922
+
923
+ // you can override either this method, or the async _read(n) below.
924
+ Readable.prototype.read = function (n) {
925
+ debug('read', n);
926
+ n = parseInt(n, 10);
927
+ var state = this._readableState;
928
+ var nOrig = n;
929
+
930
+ if (n !== 0) state.emittedReadable = false;
931
+
932
+ // if we're doing read(0) to trigger a readable event, but we
933
+ // already have a bunch of data in the buffer, then just trigger
934
+ // the 'readable' event and move on.
935
+ if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
936
+ debug('read: emitReadable', state.length, state.ended);
937
+ if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
938
+ return null;
939
+ }
940
+
941
+ n = howMuchToRead(n, state);
942
+
943
+ // if we've ended, and we're now clear, then finish it up.
944
+ if (n === 0 && state.ended) {
945
+ if (state.length === 0) endReadable(this);
946
+ return null;
947
+ }
948
+
949
+ // All the actual chunk generation logic needs to be
950
+ // *below* the call to _read. The reason is that in certain
951
+ // synthetic stream cases, such as passthrough streams, _read
952
+ // may be a completely synchronous operation which may change
953
+ // the state of the read buffer, providing enough data when
954
+ // before there was *not* enough.
955
+ //
956
+ // So, the steps are:
957
+ // 1. Figure out what the state of things will be after we do
958
+ // a read from the buffer.
959
+ //
960
+ // 2. If that resulting state will trigger a _read, then call _read.
961
+ // Note that this may be asynchronous, or synchronous. Yes, it is
962
+ // deeply ugly to write APIs this way, but that still doesn't mean
963
+ // that the Readable class should behave improperly, as streams are
964
+ // designed to be sync/async agnostic.
965
+ // Take note if the _read call is sync or async (ie, if the read call
966
+ // has returned yet), so that we know whether or not it's safe to emit
967
+ // 'readable' etc.
968
+ //
969
+ // 3. Actually pull the requested chunks out of the buffer and return.
970
+
971
+ // if we need a readable event, then we need to do some reading.
972
+ var doRead = state.needReadable;
973
+ debug('need readable', doRead);
974
+
975
+ // if we currently have less than the highWaterMark, then also read some
976
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
977
+ doRead = true;
978
+ debug('length less than watermark', doRead);
979
+ }
980
+
981
+ // however, if we've ended, then there's no point, and if we're already
982
+ // reading, then it's unnecessary.
983
+ if (state.ended || state.reading) {
984
+ doRead = false;
985
+ debug('reading or ended', doRead);
986
+ } else if (doRead) {
987
+ debug('do read');
988
+ state.reading = true;
989
+ state.sync = true;
990
+ // if the length is currently zero, then we *need* a readable event.
991
+ if (state.length === 0) state.needReadable = true;
992
+ // call internal read method
993
+ this._read(state.highWaterMark);
994
+ state.sync = false;
995
+ // If _read pushed data synchronously, then `reading` will be false,
996
+ // and we need to re-evaluate how much data we can return to the user.
997
+ if (!state.reading) n = howMuchToRead(nOrig, state);
998
+ }
999
+
1000
+ var ret;
1001
+ if (n > 0) ret = fromList(n, state);else ret = null;
1002
+
1003
+ if (ret === null) {
1004
+ state.needReadable = true;
1005
+ n = 0;
1006
+ } else {
1007
+ state.length -= n;
1008
+ }
1009
+
1010
+ if (state.length === 0) {
1011
+ // If we have nothing in the buffer, then we want to know
1012
+ // as soon as we *do* get something into the buffer.
1013
+ if (!state.ended) state.needReadable = true;
1014
+
1015
+ // If we tried to read() past the EOF, then emit end on the next tick.
1016
+ if (nOrig !== n && state.ended) endReadable(this);
1017
+ }
1018
+
1019
+ if (ret !== null) this.emit('data', ret);
1020
+
1021
+ return ret;
1022
+ };
1023
+
1024
+ function onEofChunk(stream, state) {
1025
+ if (state.ended) return;
1026
+ if (state.decoder) {
1027
+ var chunk = state.decoder.end();
1028
+ if (chunk && chunk.length) {
1029
+ state.buffer.push(chunk);
1030
+ state.length += state.objectMode ? 1 : chunk.length;
1031
+ }
1032
+ }
1033
+ state.ended = true;
1034
+
1035
+ // emit 'readable' now to make sure it gets picked up.
1036
+ emitReadable(stream);
1037
+ }
1038
+
1039
+ // Don't emit readable right away in sync mode, because this can trigger
1040
+ // another read() call => stack overflow. This way, it might trigger
1041
+ // a nextTick recursion warning, but that's not so bad.
1042
+ function emitReadable(stream) {
1043
+ var state = stream._readableState;
1044
+ state.needReadable = false;
1045
+ if (!state.emittedReadable) {
1046
+ debug('emitReadable', state.flowing);
1047
+ state.emittedReadable = true;
1048
+ if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
1049
+ }
1050
+ }
1051
+
1052
+ function emitReadable_(stream) {
1053
+ debug('emit readable');
1054
+ stream.emit('readable');
1055
+ flow(stream);
1056
+ }
1057
+
1058
+ // at this point, the user has presumably seen the 'readable' event,
1059
+ // and called read() to consume some data. that may have triggered
1060
+ // in turn another _read(n) call, in which case reading = true if
1061
+ // it's in progress.
1062
+ // However, if we're not ended, or reading, and the length < hwm,
1063
+ // then go ahead and try to read some more preemptively.
1064
+ function maybeReadMore(stream, state) {
1065
+ if (!state.readingMore) {
1066
+ state.readingMore = true;
1067
+ pna.nextTick(maybeReadMore_, stream, state);
1068
+ }
1069
+ }
1070
+
1071
+ function maybeReadMore_(stream, state) {
1072
+ var len = state.length;
1073
+ while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
1074
+ debug('maybeReadMore read 0');
1075
+ stream.read(0);
1076
+ if (len === state.length)
1077
+ // didn't get any data, stop spinning.
1078
+ break;else len = state.length;
1079
+ }
1080
+ state.readingMore = false;
1081
+ }
1082
+
1083
+ // abstract method. to be overridden in specific implementation classes.
1084
+ // call cb(er, data) where data is <= n in length.
1085
+ // for virtual (non-string, non-buffer) streams, "length" is somewhat
1086
+ // arbitrary, and perhaps not very meaningful.
1087
+ Readable.prototype._read = function (n) {
1088
+ this.emit('error', new Error('_read() is not implemented'));
1089
+ };
1090
+
1091
+ Readable.prototype.pipe = function (dest, pipeOpts) {
1092
+ var src = this;
1093
+ var state = this._readableState;
1094
+
1095
+ switch (state.pipesCount) {
1096
+ case 0:
1097
+ state.pipes = dest;
1098
+ break;
1099
+ case 1:
1100
+ state.pipes = [state.pipes, dest];
1101
+ break;
1102
+ default:
1103
+ state.pipes.push(dest);
1104
+ break;
1105
+ }
1106
+ state.pipesCount += 1;
1107
+ debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
1108
+
1109
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
1110
+
1111
+ var endFn = doEnd ? onend : unpipe;
1112
+ if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
1113
+
1114
+ dest.on('unpipe', onunpipe);
1115
+ function onunpipe(readable, unpipeInfo) {
1116
+ debug('onunpipe');
1117
+ if (readable === src) {
1118
+ if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
1119
+ unpipeInfo.hasUnpiped = true;
1120
+ cleanup();
1121
+ }
1122
+ }
1123
+ }
1124
+
1125
+ function onend() {
1126
+ debug('onend');
1127
+ dest.end();
1128
+ }
1129
+
1130
+ // when the dest drains, it reduces the awaitDrain counter
1131
+ // on the source. This would be more elegant with a .once()
1132
+ // handler in flow(), but adding and removing repeatedly is
1133
+ // too slow.
1134
+ var ondrain = pipeOnDrain(src);
1135
+ dest.on('drain', ondrain);
1136
+
1137
+ var cleanedUp = false;
1138
+ function cleanup() {
1139
+ debug('cleanup');
1140
+ // cleanup event handlers once the pipe is broken
1141
+ dest.removeListener('close', onclose);
1142
+ dest.removeListener('finish', onfinish);
1143
+ dest.removeListener('drain', ondrain);
1144
+ dest.removeListener('error', onerror);
1145
+ dest.removeListener('unpipe', onunpipe);
1146
+ src.removeListener('end', onend);
1147
+ src.removeListener('end', unpipe);
1148
+ src.removeListener('data', ondata);
1149
+
1150
+ cleanedUp = true;
1151
+
1152
+ // if the reader is waiting for a drain event from this
1153
+ // specific writer, then it would cause it to never start
1154
+ // flowing again.
1155
+ // So, if this is awaiting a drain, then we just call it now.
1156
+ // If we don't know, then assume that we are waiting for one.
1157
+ if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
1158
+ }
1159
+
1160
+ // If the user pushes more data while we're writing to dest then we'll end up
1161
+ // in ondata again. However, we only want to increase awaitDrain once because
1162
+ // dest will only emit one 'drain' event for the multiple writes.
1163
+ // => Introduce a guard on increasing awaitDrain.
1164
+ var increasedAwaitDrain = false;
1165
+ src.on('data', ondata);
1166
+ function ondata(chunk) {
1167
+ debug('ondata');
1168
+ increasedAwaitDrain = false;
1169
+ var ret = dest.write(chunk);
1170
+ if (false === ret && !increasedAwaitDrain) {
1171
+ // If the user unpiped during `dest.write()`, it is possible
1172
+ // to get stuck in a permanently paused state if that write
1173
+ // also returned false.
1174
+ // => Check whether `dest` is still a piping destination.
1175
+ if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
1176
+ debug('false write response, pause', state.awaitDrain);
1177
+ state.awaitDrain++;
1178
+ increasedAwaitDrain = true;
1179
+ }
1180
+ src.pause();
1181
+ }
1182
+ }
1183
+
1184
+ // if the dest has an error, then stop piping into it.
1185
+ // however, don't suppress the throwing behavior for this.
1186
+ function onerror(er) {
1187
+ debug('onerror', er);
1188
+ unpipe();
1189
+ dest.removeListener('error', onerror);
1190
+ if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
1191
+ }
1192
+
1193
+ // Make sure our error handler is attached before userland ones.
1194
+ prependListener(dest, 'error', onerror);
1195
+
1196
+ // Both close and finish should trigger unpipe, but only once.
1197
+ function onclose() {
1198
+ dest.removeListener('finish', onfinish);
1199
+ unpipe();
1200
+ }
1201
+ dest.once('close', onclose);
1202
+ function onfinish() {
1203
+ debug('onfinish');
1204
+ dest.removeListener('close', onclose);
1205
+ unpipe();
1206
+ }
1207
+ dest.once('finish', onfinish);
1208
+
1209
+ function unpipe() {
1210
+ debug('unpipe');
1211
+ src.unpipe(dest);
1212
+ }
1213
+
1214
+ // tell the dest that it's being piped to
1215
+ dest.emit('pipe', src);
1216
+
1217
+ // start the flow if it hasn't been started already.
1218
+ if (!state.flowing) {
1219
+ debug('pipe resume');
1220
+ src.resume();
1221
+ }
1222
+
1223
+ return dest;
1224
+ };
1225
+
1226
+ function pipeOnDrain(src) {
1227
+ return function () {
1228
+ var state = src._readableState;
1229
+ debug('pipeOnDrain', state.awaitDrain);
1230
+ if (state.awaitDrain) state.awaitDrain--;
1231
+ if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
1232
+ state.flowing = true;
1233
+ flow(src);
1234
+ }
1235
+ };
1236
+ }
1237
+
1238
+ Readable.prototype.unpipe = function (dest) {
1239
+ var state = this._readableState;
1240
+ var unpipeInfo = { hasUnpiped: false };
1241
+
1242
+ // if we're not piping anywhere, then do nothing.
1243
+ if (state.pipesCount === 0) return this;
1244
+
1245
+ // just one destination. most common case.
1246
+ if (state.pipesCount === 1) {
1247
+ // passed in one, but it's not the right one.
1248
+ if (dest && dest !== state.pipes) return this;
1249
+
1250
+ if (!dest) dest = state.pipes;
1251
+
1252
+ // got a match.
1253
+ state.pipes = null;
1254
+ state.pipesCount = 0;
1255
+ state.flowing = false;
1256
+ if (dest) dest.emit('unpipe', this, unpipeInfo);
1257
+ return this;
1258
+ }
1259
+
1260
+ // slow case. multiple pipe destinations.
1261
+
1262
+ if (!dest) {
1263
+ // remove all.
1264
+ var dests = state.pipes;
1265
+ var len = state.pipesCount;
1266
+ state.pipes = null;
1267
+ state.pipesCount = 0;
1268
+ state.flowing = false;
1269
+
1270
+ for (var i = 0; i < len; i++) {
1271
+ dests[i].emit('unpipe', this, { hasUnpiped: false });
1272
+ }return this;
1273
+ }
1274
+
1275
+ // try to find the right one.
1276
+ var index = indexOf(state.pipes, dest);
1277
+ if (index === -1) return this;
1278
+
1279
+ state.pipes.splice(index, 1);
1280
+ state.pipesCount -= 1;
1281
+ if (state.pipesCount === 1) state.pipes = state.pipes[0];
1282
+
1283
+ dest.emit('unpipe', this, unpipeInfo);
1284
+
1285
+ return this;
1286
+ };
1287
+
1288
+ // set up data events if they are asked for
1289
+ // Ensure readable listeners eventually get something
1290
+ Readable.prototype.on = function (ev, fn) {
1291
+ var res = Stream.prototype.on.call(this, ev, fn);
1292
+
1293
+ if (ev === 'data') {
1294
+ // Start flowing on next tick if stream isn't explicitly paused
1295
+ if (this._readableState.flowing !== false) this.resume();
1296
+ } else if (ev === 'readable') {
1297
+ var state = this._readableState;
1298
+ if (!state.endEmitted && !state.readableListening) {
1299
+ state.readableListening = state.needReadable = true;
1300
+ state.emittedReadable = false;
1301
+ if (!state.reading) {
1302
+ pna.nextTick(nReadingNextTick, this);
1303
+ } else if (state.length) {
1304
+ emitReadable(this);
1305
+ }
1306
+ }
1307
+ }
1308
+
1309
+ return res;
1310
+ };
1311
+ Readable.prototype.addListener = Readable.prototype.on;
1312
+
1313
+ function nReadingNextTick(self) {
1314
+ debug('readable nexttick read 0');
1315
+ self.read(0);
1316
+ }
1317
+
1318
+ // pause() and resume() are remnants of the legacy readable stream API
1319
+ // If the user uses them, then switch into old mode.
1320
+ Readable.prototype.resume = function () {
1321
+ var state = this._readableState;
1322
+ if (!state.flowing) {
1323
+ debug('resume');
1324
+ state.flowing = true;
1325
+ resume(this, state);
1326
+ }
1327
+ return this;
1328
+ };
1329
+
1330
+ function resume(stream, state) {
1331
+ if (!state.resumeScheduled) {
1332
+ state.resumeScheduled = true;
1333
+ pna.nextTick(resume_, stream, state);
1334
+ }
1335
+ }
1336
+
1337
+ function resume_(stream, state) {
1338
+ if (!state.reading) {
1339
+ debug('resume read 0');
1340
+ stream.read(0);
1341
+ }
1342
+
1343
+ state.resumeScheduled = false;
1344
+ state.awaitDrain = 0;
1345
+ stream.emit('resume');
1346
+ flow(stream);
1347
+ if (state.flowing && !state.reading) stream.read(0);
1348
+ }
1349
+
1350
+ Readable.prototype.pause = function () {
1351
+ debug('call pause flowing=%j', this._readableState.flowing);
1352
+ if (false !== this._readableState.flowing) {
1353
+ debug('pause');
1354
+ this._readableState.flowing = false;
1355
+ this.emit('pause');
1356
+ }
1357
+ return this;
1358
+ };
1359
+
1360
+ function flow(stream) {
1361
+ var state = stream._readableState;
1362
+ debug('flow', state.flowing);
1363
+ while (state.flowing && stream.read() !== null) {}
1364
+ }
1365
+
1366
+ // wrap an old-style stream as the async data source.
1367
+ // This is *not* part of the readable stream interface.
1368
+ // It is an ugly unfortunate mess of history.
1369
+ Readable.prototype.wrap = function (stream) {
1370
+ var _this = this;
1371
+
1372
+ var state = this._readableState;
1373
+ var paused = false;
1374
+
1375
+ stream.on('end', function () {
1376
+ debug('wrapped end');
1377
+ if (state.decoder && !state.ended) {
1378
+ var chunk = state.decoder.end();
1379
+ if (chunk && chunk.length) _this.push(chunk);
1380
+ }
1381
+
1382
+ _this.push(null);
1383
+ });
1384
+
1385
+ stream.on('data', function (chunk) {
1386
+ debug('wrapped data');
1387
+ if (state.decoder) chunk = state.decoder.write(chunk);
1388
+
1389
+ // don't skip over falsy values in objectMode
1390
+ if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
1391
+
1392
+ var ret = _this.push(chunk);
1393
+ if (!ret) {
1394
+ paused = true;
1395
+ stream.pause();
1396
+ }
1397
+ });
1398
+
1399
+ // proxy all the other methods.
1400
+ // important when wrapping filters and duplexes.
1401
+ for (var i in stream) {
1402
+ if (this[i] === undefined && typeof stream[i] === 'function') {
1403
+ this[i] = function (method) {
1404
+ return function () {
1405
+ return stream[method].apply(stream, arguments);
1406
+ };
1407
+ }(i);
1408
+ }
1409
+ }
1410
+
1411
+ // proxy certain important events.
1412
+ for (var n = 0; n < kProxyEvents.length; n++) {
1413
+ stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
1414
+ }
1415
+
1416
+ // when we try to consume some more bytes, simply unpause the
1417
+ // underlying stream.
1418
+ this._read = function (n) {
1419
+ debug('wrapped _read', n);
1420
+ if (paused) {
1421
+ paused = false;
1422
+ stream.resume();
1423
+ }
1424
+ };
1425
+
1426
+ return this;
1427
+ };
1428
+
1429
+ Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
1430
+ // making it explicit this property is not enumerable
1431
+ // because otherwise some prototype manipulation in
1432
+ // userland will fail
1433
+ enumerable: false,
1434
+ get: function () {
1435
+ return this._readableState.highWaterMark;
1436
+ }
1437
+ });
1438
+
1439
+ // exposed for testing purposes only.
1440
+ Readable._fromList = fromList;
1441
+
1442
+ // Pluck off n bytes from an array of buffers.
1443
+ // Length is the combined lengths of all the buffers in the list.
1444
+ // This function is designed to be inlinable, so please take care when making
1445
+ // changes to the function body.
1446
+ function fromList(n, state) {
1447
+ // nothing buffered
1448
+ if (state.length === 0) return null;
1449
+
1450
+ var ret;
1451
+ if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
1452
+ // read it all, truncate the list
1453
+ if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
1454
+ state.buffer.clear();
1455
+ } else {
1456
+ // read part of list
1457
+ ret = fromListPartial(n, state.buffer, state.decoder);
1458
+ }
1459
+
1460
+ return ret;
1461
+ }
1462
+
1463
+ // Extracts only enough buffered data to satisfy the amount requested.
1464
+ // This function is designed to be inlinable, so please take care when making
1465
+ // changes to the function body.
1466
+ function fromListPartial(n, list, hasStrings) {
1467
+ var ret;
1468
+ if (n < list.head.data.length) {
1469
+ // slice is the same for buffers and strings
1470
+ ret = list.head.data.slice(0, n);
1471
+ list.head.data = list.head.data.slice(n);
1472
+ } else if (n === list.head.data.length) {
1473
+ // first chunk is a perfect match
1474
+ ret = list.shift();
1475
+ } else {
1476
+ // result spans more than one buffer
1477
+ ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
1478
+ }
1479
+ return ret;
1480
+ }
1481
+
1482
+ // Copies a specified amount of characters from the list of buffered data
1483
+ // chunks.
1484
+ // This function is designed to be inlinable, so please take care when making
1485
+ // changes to the function body.
1486
+ function copyFromBufferString(n, list) {
1487
+ var p = list.head;
1488
+ var c = 1;
1489
+ var ret = p.data;
1490
+ n -= ret.length;
1491
+ while (p = p.next) {
1492
+ var str = p.data;
1493
+ var nb = n > str.length ? str.length : n;
1494
+ if (nb === str.length) ret += str;else ret += str.slice(0, n);
1495
+ n -= nb;
1496
+ if (n === 0) {
1497
+ if (nb === str.length) {
1498
+ ++c;
1499
+ if (p.next) list.head = p.next;else list.head = list.tail = null;
1500
+ } else {
1501
+ list.head = p;
1502
+ p.data = str.slice(nb);
1503
+ }
1504
+ break;
1505
+ }
1506
+ ++c;
1507
+ }
1508
+ list.length -= c;
1509
+ return ret;
1510
+ }
1511
+
1512
+ // Copies a specified amount of bytes from the list of buffered data chunks.
1513
+ // This function is designed to be inlinable, so please take care when making
1514
+ // changes to the function body.
1515
+ function copyFromBuffer(n, list) {
1516
+ var ret = Buffer.allocUnsafe(n);
1517
+ var p = list.head;
1518
+ var c = 1;
1519
+ p.data.copy(ret);
1520
+ n -= p.data.length;
1521
+ while (p = p.next) {
1522
+ var buf = p.data;
1523
+ var nb = n > buf.length ? buf.length : n;
1524
+ buf.copy(ret, ret.length - n, 0, nb);
1525
+ n -= nb;
1526
+ if (n === 0) {
1527
+ if (nb === buf.length) {
1528
+ ++c;
1529
+ if (p.next) list.head = p.next;else list.head = list.tail = null;
1530
+ } else {
1531
+ list.head = p;
1532
+ p.data = buf.slice(nb);
1533
+ }
1534
+ break;
1535
+ }
1536
+ ++c;
1537
+ }
1538
+ list.length -= c;
1539
+ return ret;
1540
+ }
1541
+
1542
+ function endReadable(stream) {
1543
+ var state = stream._readableState;
1544
+
1545
+ // If we get here before consuming all the bytes, then that is a
1546
+ // bug in node. Should never happen.
1547
+ if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
1548
+
1549
+ if (!state.endEmitted) {
1550
+ state.ended = true;
1551
+ pna.nextTick(endReadableNT, state, stream);
1552
+ }
1553
+ }
1554
+
1555
+ function endReadableNT(state, stream) {
1556
+ // Check that we didn't get one last unshift.
1557
+ if (!state.endEmitted && state.length === 0) {
1558
+ state.endEmitted = true;
1559
+ stream.readable = false;
1560
+ stream.emit('end');
1561
+ }
1562
+ }
1563
+
1564
+ function indexOf(xs, x) {
1565
+ for (var i = 0, l = xs.length; i < l; i++) {
1566
+ if (xs[i] === x) return i;
1567
+ }
1568
+ return -1;
1569
+ }
1570
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba"), __webpack_require__("f28c")))
1571
+
1572
+ /***/ }),
1573
+
1574
+ /***/ "b19a":
1575
+ /***/ (function(module, exports, __webpack_require__) {
1576
+
1577
+ "use strict";
1578
+ // Copyright Joyent, Inc. and other Node contributors.
1579
+ //
1580
+ // Permission is hereby granted, free of charge, to any person obtaining a
1581
+ // copy of this software and associated documentation files (the
1582
+ // "Software"), to deal in the Software without restriction, including
1583
+ // without limitation the rights to use, copy, modify, merge, publish,
1584
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
1585
+ // persons to whom the Software is furnished to do so, subject to the
1586
+ // following conditions:
1587
+ //
1588
+ // The above copyright notice and this permission notice shall be included
1589
+ // in all copies or substantial portions of the Software.
1590
+ //
1591
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1592
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1593
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
1594
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
1595
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1596
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
1597
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
1598
+
1599
+ // a duplex stream is just a stream that is both readable and writable.
1600
+ // Since JS doesn't have multiple prototypal inheritance, this class
1601
+ // prototypally inherits from Readable, and then parasitically from
1602
+ // Writable.
1603
+
1604
+
1605
+
1606
+ /*<replacement>*/
1607
+
1608
+ var pna = __webpack_require__("966d");
1609
+ /*</replacement>*/
1610
+
1611
+ /*<replacement>*/
1612
+ var objectKeys = Object.keys || function (obj) {
1613
+ var keys = [];
1614
+ for (var key in obj) {
1615
+ keys.push(key);
1616
+ }return keys;
1617
+ };
1618
+ /*</replacement>*/
1619
+
1620
+ module.exports = Duplex;
1621
+
1622
+ /*<replacement>*/
1623
+ var util = Object.create(__webpack_require__("3a7c"));
1624
+ util.inherits = __webpack_require__("3fb5");
1625
+ /*</replacement>*/
1626
+
1627
+ var Readable = __webpack_require__("ad71");
1628
+ var Writable = __webpack_require__("dc14");
1629
+
1630
+ util.inherits(Duplex, Readable);
1631
+
1632
+ {
1633
+ // avoid scope creep, the keys array can then be collected
1634
+ var keys = objectKeys(Writable.prototype);
1635
+ for (var v = 0; v < keys.length; v++) {
1636
+ var method = keys[v];
1637
+ if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
1638
+ }
1639
+ }
1640
+
1641
+ function Duplex(options) {
1642
+ if (!(this instanceof Duplex)) return new Duplex(options);
1643
+
1644
+ Readable.call(this, options);
1645
+ Writable.call(this, options);
1646
+
1647
+ if (options && options.readable === false) this.readable = false;
1648
+
1649
+ if (options && options.writable === false) this.writable = false;
1650
+
1651
+ this.allowHalfOpen = true;
1652
+ if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
1653
+
1654
+ this.once('end', onend);
1655
+ }
1656
+
1657
+ Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
1658
+ // making it explicit this property is not enumerable
1659
+ // because otherwise some prototype manipulation in
1660
+ // userland will fail
1661
+ enumerable: false,
1662
+ get: function () {
1663
+ return this._writableState.highWaterMark;
1664
+ }
1665
+ });
1666
+
1667
+ // the no-half-open enforcer
1668
+ function onend() {
1669
+ // if we allow half-open state, or if the writable side ended,
1670
+ // then we're ok.
1671
+ if (this.allowHalfOpen || this._writableState.ended) return;
1672
+
1673
+ // no more data can be written.
1674
+ // But allow more writes to happen in this tick.
1675
+ pna.nextTick(onEndNT, this);
1676
+ }
1677
+
1678
+ function onEndNT(self) {
1679
+ self.end();
1680
+ }
1681
+
1682
+ Object.defineProperty(Duplex.prototype, 'destroyed', {
1683
+ get: function () {
1684
+ if (this._readableState === undefined || this._writableState === undefined) {
1685
+ return false;
1686
+ }
1687
+ return this._readableState.destroyed && this._writableState.destroyed;
1688
+ },
1689
+ set: function (value) {
1690
+ // we ignore the value if the stream
1691
+ // has not been initialized yet
1692
+ if (this._readableState === undefined || this._writableState === undefined) {
1693
+ return;
1694
+ }
1695
+
1696
+ // backward compatibility, the user is explicitly
1697
+ // managing destroyed
1698
+ this._readableState.destroyed = value;
1699
+ this._writableState.destroyed = value;
1700
+ }
1701
+ });
1702
+
1703
+ Duplex.prototype._destroy = function (err, cb) {
1704
+ this.push(null);
1705
+ this.end();
1706
+
1707
+ pna.nextTick(cb, err);
1708
+ };
1709
+
1710
+ /***/ }),
1711
+
1712
+ /***/ "c2ae":
1713
+ /***/ (function(module, exports, __webpack_require__) {
1714
+
1715
+ module.exports = __webpack_require__("e372").PassThrough
1716
+
1717
+
1718
+ /***/ }),
1719
+
1720
+ /***/ "d17b":
1721
+ /***/ (function(module, exports, __webpack_require__) {
1722
+
1723
+ module.exports = __webpack_require__("e372").Transform
1724
+
1725
+
1726
+ /***/ }),
1727
+
1728
+ /***/ "dc14":
1729
+ /***/ (function(module, exports, __webpack_require__) {
1730
+
1731
+ "use strict";
1732
+ /* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.
1733
+ //
1734
+ // Permission is hereby granted, free of charge, to any person obtaining a
1735
+ // copy of this software and associated documentation files (the
1736
+ // "Software"), to deal in the Software without restriction, including
1737
+ // without limitation the rights to use, copy, modify, merge, publish,
1738
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
1739
+ // persons to whom the Software is furnished to do so, subject to the
1740
+ // following conditions:
1741
+ //
1742
+ // The above copyright notice and this permission notice shall be included
1743
+ // in all copies or substantial portions of the Software.
1744
+ //
1745
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1746
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1747
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
1748
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
1749
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1750
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
1751
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
1752
+
1753
+ // A bit simpler than readable streams.
1754
+ // Implement an async ._write(chunk, encoding, cb), and it'll handle all
1755
+ // the drain event emission and buffering.
1756
+
1757
+
1758
+
1759
+ /*<replacement>*/
1760
+
1761
+ var pna = __webpack_require__("966d");
1762
+ /*</replacement>*/
1763
+
1764
+ module.exports = Writable;
1765
+
1766
+ /* <replacement> */
1767
+ function WriteReq(chunk, encoding, cb) {
1768
+ this.chunk = chunk;
1769
+ this.encoding = encoding;
1770
+ this.callback = cb;
1771
+ this.next = null;
1772
+ }
1773
+
1774
+ // It seems a linked list but it is not
1775
+ // there will be only 2 of these for each stream
1776
+ function CorkedRequest(state) {
1777
+ var _this = this;
1778
+
1779
+ this.next = null;
1780
+ this.entry = null;
1781
+ this.finish = function () {
1782
+ onCorkedFinish(_this, state);
1783
+ };
1784
+ }
1785
+ /* </replacement> */
1786
+
1787
+ /*<replacement>*/
1788
+ var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
1789
+ /*</replacement>*/
1790
+
1791
+ /*<replacement>*/
1792
+ var Duplex;
1793
+ /*</replacement>*/
1794
+
1795
+ Writable.WritableState = WritableState;
1796
+
1797
+ /*<replacement>*/
1798
+ var util = Object.create(__webpack_require__("3a7c"));
1799
+ util.inherits = __webpack_require__("3fb5");
1800
+ /*</replacement>*/
1801
+
1802
+ /*<replacement>*/
1803
+ var internalUtil = {
1804
+ deprecate: __webpack_require__("b7d1")
1805
+ };
1806
+ /*</replacement>*/
1807
+
1808
+ /*<replacement>*/
1809
+ var Stream = __webpack_require__("429b");
1810
+ /*</replacement>*/
1811
+
1812
+ /*<replacement>*/
1813
+
1814
+ var Buffer = __webpack_require__("a8f0").Buffer;
1815
+ var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
1816
+ function _uint8ArrayToBuffer(chunk) {
1817
+ return Buffer.from(chunk);
1818
+ }
1819
+ function _isUint8Array(obj) {
1820
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
1821
+ }
1822
+
1823
+ /*</replacement>*/
1824
+
1825
+ var destroyImpl = __webpack_require__("4681");
1826
+
1827
+ util.inherits(Writable, Stream);
1828
+
1829
+ function nop() {}
1830
+
1831
+ function WritableState(options, stream) {
1832
+ Duplex = Duplex || __webpack_require__("b19a");
1833
+
1834
+ options = options || {};
1835
+
1836
+ // Duplex streams are both readable and writable, but share
1837
+ // the same options object.
1838
+ // However, some cases require setting options to different
1839
+ // values for the readable and the writable sides of the duplex stream.
1840
+ // These options can be provided separately as readableXXX and writableXXX.
1841
+ var isDuplex = stream instanceof Duplex;
1842
+
1843
+ // object stream flag to indicate whether or not this stream
1844
+ // contains buffers or objects.
1845
+ this.objectMode = !!options.objectMode;
1846
+
1847
+ if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
1848
+
1849
+ // the point at which write() starts returning false
1850
+ // Note: 0 is a valid value, means that we always return false if
1851
+ // the entire buffer is not flushed immediately on write()
1852
+ var hwm = options.highWaterMark;
1853
+ var writableHwm = options.writableHighWaterMark;
1854
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
1855
+
1856
+ if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
1857
+
1858
+ // cast to ints.
1859
+ this.highWaterMark = Math.floor(this.highWaterMark);
1860
+
1861
+ // if _final has been called
1862
+ this.finalCalled = false;
1863
+
1864
+ // drain event flag.
1865
+ this.needDrain = false;
1866
+ // at the start of calling end()
1867
+ this.ending = false;
1868
+ // when end() has been called, and returned
1869
+ this.ended = false;
1870
+ // when 'finish' is emitted
1871
+ this.finished = false;
1872
+
1873
+ // has it been destroyed
1874
+ this.destroyed = false;
1875
+
1876
+ // should we decode strings into buffers before passing to _write?
1877
+ // this is here so that some node-core streams can optimize string
1878
+ // handling at a lower level.
1879
+ var noDecode = options.decodeStrings === false;
1880
+ this.decodeStrings = !noDecode;
1881
+
1882
+ // Crypto is kind of old and crusty. Historically, its default string
1883
+ // encoding is 'binary' so we have to make this configurable.
1884
+ // Everything else in the universe uses 'utf8', though.
1885
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
1886
+
1887
+ // not an actual buffer we keep track of, but a measurement
1888
+ // of how much we're waiting to get pushed to some underlying
1889
+ // socket or file.
1890
+ this.length = 0;
1891
+
1892
+ // a flag to see when we're in the middle of a write.
1893
+ this.writing = false;
1894
+
1895
+ // when true all writes will be buffered until .uncork() call
1896
+ this.corked = 0;
1897
+
1898
+ // a flag to be able to tell if the onwrite cb is called immediately,
1899
+ // or on a later tick. We set this to true at first, because any
1900
+ // actions that shouldn't happen until "later" should generally also
1901
+ // not happen before the first write call.
1902
+ this.sync = true;
1903
+
1904
+ // a flag to know if we're processing previously buffered items, which
1905
+ // may call the _write() callback in the same tick, so that we don't
1906
+ // end up in an overlapped onwrite situation.
1907
+ this.bufferProcessing = false;
1908
+
1909
+ // the callback that's passed to _write(chunk,cb)
1910
+ this.onwrite = function (er) {
1911
+ onwrite(stream, er);
1912
+ };
1913
+
1914
+ // the callback that the user supplies to write(chunk,encoding,cb)
1915
+ this.writecb = null;
1916
+
1917
+ // the amount that is being written when _write is called.
1918
+ this.writelen = 0;
1919
+
1920
+ this.bufferedRequest = null;
1921
+ this.lastBufferedRequest = null;
1922
+
1923
+ // number of pending user-supplied write callbacks
1924
+ // this must be 0 before 'finish' can be emitted
1925
+ this.pendingcb = 0;
1926
+
1927
+ // emit prefinish if the only thing we're waiting for is _write cbs
1928
+ // This is relevant for synchronous Transform streams
1929
+ this.prefinished = false;
1930
+
1931
+ // True if the error was already emitted and should not be thrown again
1932
+ this.errorEmitted = false;
1933
+
1934
+ // count buffered requests
1935
+ this.bufferedRequestCount = 0;
1936
+
1937
+ // allocate the first CorkedRequest, there is always
1938
+ // one allocated and free to use, and we maintain at most two
1939
+ this.corkedRequestsFree = new CorkedRequest(this);
1940
+ }
1941
+
1942
+ WritableState.prototype.getBuffer = function getBuffer() {
1943
+ var current = this.bufferedRequest;
1944
+ var out = [];
1945
+ while (current) {
1946
+ out.push(current);
1947
+ current = current.next;
1948
+ }
1949
+ return out;
1950
+ };
1951
+
1952
+ (function () {
1953
+ try {
1954
+ Object.defineProperty(WritableState.prototype, 'buffer', {
1955
+ get: internalUtil.deprecate(function () {
1956
+ return this.getBuffer();
1957
+ }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
1958
+ });
1959
+ } catch (_) {}
1960
+ })();
1961
+
1962
+ // Test _writableState for inheritance to account for Duplex streams,
1963
+ // whose prototype chain only points to Readable.
1964
+ var realHasInstance;
1965
+ if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
1966
+ realHasInstance = Function.prototype[Symbol.hasInstance];
1967
+ Object.defineProperty(Writable, Symbol.hasInstance, {
1968
+ value: function (object) {
1969
+ if (realHasInstance.call(this, object)) return true;
1970
+ if (this !== Writable) return false;
1971
+
1972
+ return object && object._writableState instanceof WritableState;
1973
+ }
1974
+ });
1975
+ } else {
1976
+ realHasInstance = function (object) {
1977
+ return object instanceof this;
1978
+ };
1979
+ }
1980
+
1981
+ function Writable(options) {
1982
+ Duplex = Duplex || __webpack_require__("b19a");
1983
+
1984
+ // Writable ctor is applied to Duplexes, too.
1985
+ // `realHasInstance` is necessary because using plain `instanceof`
1986
+ // would return false, as no `_writableState` property is attached.
1987
+
1988
+ // Trying to use the custom `instanceof` for Writable here will also break the
1989
+ // Node.js LazyTransform implementation, which has a non-trivial getter for
1990
+ // `_writableState` that would lead to infinite recursion.
1991
+ if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
1992
+ return new Writable(options);
1993
+ }
1994
+
1995
+ this._writableState = new WritableState(options, this);
1996
+
1997
+ // legacy.
1998
+ this.writable = true;
1999
+
2000
+ if (options) {
2001
+ if (typeof options.write === 'function') this._write = options.write;
2002
+
2003
+ if (typeof options.writev === 'function') this._writev = options.writev;
2004
+
2005
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
2006
+
2007
+ if (typeof options.final === 'function') this._final = options.final;
2008
+ }
2009
+
2010
+ Stream.call(this);
2011
+ }
2012
+
2013
+ // Otherwise people can pipe Writable streams, which is just wrong.
2014
+ Writable.prototype.pipe = function () {
2015
+ this.emit('error', new Error('Cannot pipe, not readable'));
2016
+ };
2017
+
2018
+ function writeAfterEnd(stream, cb) {
2019
+ var er = new Error('write after end');
2020
+ // TODO: defer error events consistently everywhere, not just the cb
2021
+ stream.emit('error', er);
2022
+ pna.nextTick(cb, er);
2023
+ }
2024
+
2025
+ // Checks that a user-supplied chunk is valid, especially for the particular
2026
+ // mode the stream is in. Currently this means that `null` is never accepted
2027
+ // and undefined/non-string values are only allowed in object mode.
2028
+ function validChunk(stream, state, chunk, cb) {
2029
+ var valid = true;
2030
+ var er = false;
2031
+
2032
+ if (chunk === null) {
2033
+ er = new TypeError('May not write null values to stream');
2034
+ } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
2035
+ er = new TypeError('Invalid non-string/buffer chunk');
2036
+ }
2037
+ if (er) {
2038
+ stream.emit('error', er);
2039
+ pna.nextTick(cb, er);
2040
+ valid = false;
2041
+ }
2042
+ return valid;
2043
+ }
2044
+
2045
+ Writable.prototype.write = function (chunk, encoding, cb) {
2046
+ var state = this._writableState;
2047
+ var ret = false;
2048
+ var isBuf = !state.objectMode && _isUint8Array(chunk);
2049
+
2050
+ if (isBuf && !Buffer.isBuffer(chunk)) {
2051
+ chunk = _uint8ArrayToBuffer(chunk);
2052
+ }
2053
+
2054
+ if (typeof encoding === 'function') {
2055
+ cb = encoding;
2056
+ encoding = null;
2057
+ }
2058
+
2059
+ if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
2060
+
2061
+ if (typeof cb !== 'function') cb = nop;
2062
+
2063
+ if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
2064
+ state.pendingcb++;
2065
+ ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
2066
+ }
2067
+
2068
+ return ret;
2069
+ };
2070
+
2071
+ Writable.prototype.cork = function () {
2072
+ var state = this._writableState;
2073
+
2074
+ state.corked++;
2075
+ };
2076
+
2077
+ Writable.prototype.uncork = function () {
2078
+ var state = this._writableState;
2079
+
2080
+ if (state.corked) {
2081
+ state.corked--;
2082
+
2083
+ if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
2084
+ }
2085
+ };
2086
+
2087
+ Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
2088
+ // node::ParseEncoding() requires lower case.
2089
+ if (typeof encoding === 'string') encoding = encoding.toLowerCase();
2090
+ if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
2091
+ this._writableState.defaultEncoding = encoding;
2092
+ return this;
2093
+ };
2094
+
2095
+ function decodeChunk(state, chunk, encoding) {
2096
+ if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
2097
+ chunk = Buffer.from(chunk, encoding);
2098
+ }
2099
+ return chunk;
2100
+ }
2101
+
2102
+ Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
2103
+ // making it explicit this property is not enumerable
2104
+ // because otherwise some prototype manipulation in
2105
+ // userland will fail
2106
+ enumerable: false,
2107
+ get: function () {
2108
+ return this._writableState.highWaterMark;
2109
+ }
2110
+ });
2111
+
2112
+ // if we're already writing something, then just put this
2113
+ // in the queue, and wait our turn. Otherwise, call _write
2114
+ // If we return false, then we need a drain event, so set that flag.
2115
+ function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
2116
+ if (!isBuf) {
2117
+ var newChunk = decodeChunk(state, chunk, encoding);
2118
+ if (chunk !== newChunk) {
2119
+ isBuf = true;
2120
+ encoding = 'buffer';
2121
+ chunk = newChunk;
2122
+ }
2123
+ }
2124
+ var len = state.objectMode ? 1 : chunk.length;
2125
+
2126
+ state.length += len;
2127
+
2128
+ var ret = state.length < state.highWaterMark;
2129
+ // we must ensure that previous needDrain will not be reset to false.
2130
+ if (!ret) state.needDrain = true;
2131
+
2132
+ if (state.writing || state.corked) {
2133
+ var last = state.lastBufferedRequest;
2134
+ state.lastBufferedRequest = {
2135
+ chunk: chunk,
2136
+ encoding: encoding,
2137
+ isBuf: isBuf,
2138
+ callback: cb,
2139
+ next: null
2140
+ };
2141
+ if (last) {
2142
+ last.next = state.lastBufferedRequest;
2143
+ } else {
2144
+ state.bufferedRequest = state.lastBufferedRequest;
2145
+ }
2146
+ state.bufferedRequestCount += 1;
2147
+ } else {
2148
+ doWrite(stream, state, false, len, chunk, encoding, cb);
2149
+ }
2150
+
2151
+ return ret;
2152
+ }
2153
+
2154
+ function doWrite(stream, state, writev, len, chunk, encoding, cb) {
2155
+ state.writelen = len;
2156
+ state.writecb = cb;
2157
+ state.writing = true;
2158
+ state.sync = true;
2159
+ if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
2160
+ state.sync = false;
2161
+ }
2162
+
2163
+ function onwriteError(stream, state, sync, er, cb) {
2164
+ --state.pendingcb;
2165
+
2166
+ if (sync) {
2167
+ // defer the callback if we are being called synchronously
2168
+ // to avoid piling up things on the stack
2169
+ pna.nextTick(cb, er);
2170
+ // this can emit finish, and it will always happen
2171
+ // after error
2172
+ pna.nextTick(finishMaybe, stream, state);
2173
+ stream._writableState.errorEmitted = true;
2174
+ stream.emit('error', er);
2175
+ } else {
2176
+ // the caller expect this to happen before if
2177
+ // it is async
2178
+ cb(er);
2179
+ stream._writableState.errorEmitted = true;
2180
+ stream.emit('error', er);
2181
+ // this can emit finish, but finish must
2182
+ // always follow error
2183
+ finishMaybe(stream, state);
2184
+ }
2185
+ }
2186
+
2187
+ function onwriteStateUpdate(state) {
2188
+ state.writing = false;
2189
+ state.writecb = null;
2190
+ state.length -= state.writelen;
2191
+ state.writelen = 0;
2192
+ }
2193
+
2194
+ function onwrite(stream, er) {
2195
+ var state = stream._writableState;
2196
+ var sync = state.sync;
2197
+ var cb = state.writecb;
2198
+
2199
+ onwriteStateUpdate(state);
2200
+
2201
+ if (er) onwriteError(stream, state, sync, er, cb);else {
2202
+ // Check if we're actually ready to finish, but don't emit yet
2203
+ var finished = needFinish(state);
2204
+
2205
+ if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
2206
+ clearBuffer(stream, state);
2207
+ }
2208
+
2209
+ if (sync) {
2210
+ /*<replacement>*/
2211
+ asyncWrite(afterWrite, stream, state, finished, cb);
2212
+ /*</replacement>*/
2213
+ } else {
2214
+ afterWrite(stream, state, finished, cb);
2215
+ }
2216
+ }
2217
+ }
2218
+
2219
+ function afterWrite(stream, state, finished, cb) {
2220
+ if (!finished) onwriteDrain(stream, state);
2221
+ state.pendingcb--;
2222
+ cb();
2223
+ finishMaybe(stream, state);
2224
+ }
2225
+
2226
+ // Must force callback to be called on nextTick, so that we don't
2227
+ // emit 'drain' before the write() consumer gets the 'false' return
2228
+ // value, and has a chance to attach a 'drain' listener.
2229
+ function onwriteDrain(stream, state) {
2230
+ if (state.length === 0 && state.needDrain) {
2231
+ state.needDrain = false;
2232
+ stream.emit('drain');
2233
+ }
2234
+ }
2235
+
2236
+ // if there's something in the buffer waiting, then process it
2237
+ function clearBuffer(stream, state) {
2238
+ state.bufferProcessing = true;
2239
+ var entry = state.bufferedRequest;
2240
+
2241
+ if (stream._writev && entry && entry.next) {
2242
+ // Fast case, write everything using _writev()
2243
+ var l = state.bufferedRequestCount;
2244
+ var buffer = new Array(l);
2245
+ var holder = state.corkedRequestsFree;
2246
+ holder.entry = entry;
2247
+
2248
+ var count = 0;
2249
+ var allBuffers = true;
2250
+ while (entry) {
2251
+ buffer[count] = entry;
2252
+ if (!entry.isBuf) allBuffers = false;
2253
+ entry = entry.next;
2254
+ count += 1;
2255
+ }
2256
+ buffer.allBuffers = allBuffers;
2257
+
2258
+ doWrite(stream, state, true, state.length, buffer, '', holder.finish);
2259
+
2260
+ // doWrite is almost always async, defer these to save a bit of time
2261
+ // as the hot path ends with doWrite
2262
+ state.pendingcb++;
2263
+ state.lastBufferedRequest = null;
2264
+ if (holder.next) {
2265
+ state.corkedRequestsFree = holder.next;
2266
+ holder.next = null;
2267
+ } else {
2268
+ state.corkedRequestsFree = new CorkedRequest(state);
2269
+ }
2270
+ state.bufferedRequestCount = 0;
2271
+ } else {
2272
+ // Slow case, write chunks one-by-one
2273
+ while (entry) {
2274
+ var chunk = entry.chunk;
2275
+ var encoding = entry.encoding;
2276
+ var cb = entry.callback;
2277
+ var len = state.objectMode ? 1 : chunk.length;
2278
+
2279
+ doWrite(stream, state, false, len, chunk, encoding, cb);
2280
+ entry = entry.next;
2281
+ state.bufferedRequestCount--;
2282
+ // if we didn't call the onwrite immediately, then
2283
+ // it means that we need to wait until it does.
2284
+ // also, that means that the chunk and cb are currently
2285
+ // being processed, so move the buffer counter past them.
2286
+ if (state.writing) {
2287
+ break;
2288
+ }
2289
+ }
2290
+
2291
+ if (entry === null) state.lastBufferedRequest = null;
2292
+ }
2293
+
2294
+ state.bufferedRequest = entry;
2295
+ state.bufferProcessing = false;
2296
+ }
2297
+
2298
+ Writable.prototype._write = function (chunk, encoding, cb) {
2299
+ cb(new Error('_write() is not implemented'));
2300
+ };
2301
+
2302
+ Writable.prototype._writev = null;
2303
+
2304
+ Writable.prototype.end = function (chunk, encoding, cb) {
2305
+ var state = this._writableState;
2306
+
2307
+ if (typeof chunk === 'function') {
2308
+ cb = chunk;
2309
+ chunk = null;
2310
+ encoding = null;
2311
+ } else if (typeof encoding === 'function') {
2312
+ cb = encoding;
2313
+ encoding = null;
2314
+ }
2315
+
2316
+ if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
2317
+
2318
+ // .end() fully uncorks
2319
+ if (state.corked) {
2320
+ state.corked = 1;
2321
+ this.uncork();
2322
+ }
2323
+
2324
+ // ignore unnecessary end() calls.
2325
+ if (!state.ending) endWritable(this, state, cb);
2326
+ };
2327
+
2328
+ function needFinish(state) {
2329
+ return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
2330
+ }
2331
+ function callFinal(stream, state) {
2332
+ stream._final(function (err) {
2333
+ state.pendingcb--;
2334
+ if (err) {
2335
+ stream.emit('error', err);
2336
+ }
2337
+ state.prefinished = true;
2338
+ stream.emit('prefinish');
2339
+ finishMaybe(stream, state);
2340
+ });
2341
+ }
2342
+ function prefinish(stream, state) {
2343
+ if (!state.prefinished && !state.finalCalled) {
2344
+ if (typeof stream._final === 'function') {
2345
+ state.pendingcb++;
2346
+ state.finalCalled = true;
2347
+ pna.nextTick(callFinal, stream, state);
2348
+ } else {
2349
+ state.prefinished = true;
2350
+ stream.emit('prefinish');
2351
+ }
2352
+ }
2353
+ }
2354
+
2355
+ function finishMaybe(stream, state) {
2356
+ var need = needFinish(state);
2357
+ if (need) {
2358
+ prefinish(stream, state);
2359
+ if (state.pendingcb === 0) {
2360
+ state.finished = true;
2361
+ stream.emit('finish');
2362
+ }
2363
+ }
2364
+ return need;
2365
+ }
2366
+
2367
+ function endWritable(stream, state, cb) {
2368
+ state.ending = true;
2369
+ finishMaybe(stream, state);
2370
+ if (cb) {
2371
+ if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
2372
+ }
2373
+ state.ended = true;
2374
+ stream.writable = false;
2375
+ }
2376
+
2377
+ function onCorkedFinish(corkReq, state, err) {
2378
+ var entry = corkReq.entry;
2379
+ corkReq.entry = null;
2380
+ while (entry) {
2381
+ var cb = entry.callback;
2382
+ state.pendingcb--;
2383
+ cb(err);
2384
+ entry = entry.next;
2385
+ }
2386
+
2387
+ // reuse the free corkReq.
2388
+ state.corkedRequestsFree.next = corkReq;
2389
+ }
2390
+
2391
+ Object.defineProperty(Writable.prototype, 'destroyed', {
2392
+ get: function () {
2393
+ if (this._writableState === undefined) {
2394
+ return false;
2395
+ }
2396
+ return this._writableState.destroyed;
2397
+ },
2398
+ set: function (value) {
2399
+ // we ignore the value if the stream
2400
+ // has not been initialized yet
2401
+ if (!this._writableState) {
2402
+ return;
2403
+ }
2404
+
2405
+ // backward compatibility, the user is explicitly
2406
+ // managing destroyed
2407
+ this._writableState.destroyed = value;
2408
+ }
2409
+ });
2410
+
2411
+ Writable.prototype.destroy = destroyImpl.destroy;
2412
+ Writable.prototype._undestroy = destroyImpl.undestroy;
2413
+ Writable.prototype._destroy = function (err, cb) {
2414
+ this.end();
2415
+ cb(err);
2416
+ };
2417
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("f28c"), __webpack_require__("c8ba")))
2418
+
2419
+ /***/ }),
2420
+
2421
+ /***/ "e372":
2422
+ /***/ (function(module, exports, __webpack_require__) {
2423
+
2424
+ exports = module.exports = __webpack_require__("ad71");
2425
+ exports.Stream = exports;
2426
+ exports.Readable = exports;
2427
+ exports.Writable = __webpack_require__("dc14");
2428
+ exports.Duplex = __webpack_require__("b19a");
2429
+ exports.Transform = __webpack_require__("27bf");
2430
+ exports.PassThrough = __webpack_require__("780f");
2431
+
2432
+
2433
+ /***/ })
2434
+
2435
+ }]);